You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2011/08/08 17:07:00 UTC

svn commit: r1154983 - in /cxf/branches/2.4.x-fixes/rt/ws/security: ./ src/main/java/org/apache/cxf/ws/security/sts/provider/ src/main/model/

Author: coheigea
Date: Mon Aug  8 15:06:59 2011
New Revision: 1154983

URL: http://svn.apache.org/viewvc?rev=1154983&view=rev
Log:
Adding WS-Trust 1.4 schema and making JAXB types available to the STSProvider.

Added:
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/binding14.xjb
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/ws-trust-1.4.xsd
Modified:
    cxf/branches/2.4.x-fixes/rt/ws/security/pom.xml
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/pom.xml?rev=1154983&r1=1154982&r2=1154983&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/pom.xml (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/pom.xml Mon Aug  8 15:06:59 2011
@@ -172,6 +172,11 @@
                                 <xsd>${basedir}/src/main/model/ws-trust-1.3.xsd</xsd>
                                 <bindingFile>${basedir}/src/main/model/binding.xjb</bindingFile>
                             </xsdOption>
+                            <xsdOption>
+                                <extension>true</extension>
+                                <xsd>${basedir}/src/main/model/ws-trust-1.4.xsd</xsd>
+                                <bindingFile>${basedir}/src/main/model/binding14.xjb</bindingFile>
+                            </xsdOption>
                         </xsdOptions>
                     </configuration>
                 </execution>

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java?rev=1154983&r1=1154982&r2=1154983&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenService.java Mon Aug  8 15:06:59 2011
@@ -35,6 +35,7 @@ import org.apache.cxf.ws.security.sts.pr
 @WebService(targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/wsdl", 
             name = "SecurityTokenService")
 @XmlSeeAlso({org.apache.cxf.ws.security.sts.provider.model.ObjectFactory.class,
+    org.apache.cxf.ws.security.sts.provider.model.wstrust14.ObjectFactory.class,
     org.apache.cxf.ws.security.sts.provider.model.secext.ObjectFactory.class,
     org.apache.cxf.ws.security.sts.provider.model.utility.ObjectFactory.class, 
     org.apache.cxf.ws.security.sts.provider.model.xmldsig.ObjectFactory.class,

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java?rev=1154983&r1=1154982&r2=1154983&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/sts/provider/SecurityTokenServiceProvider.java Mon Aug  8 15:06:59 2011
@@ -22,6 +22,7 @@ package org.apache.cxf.ws.security.sts.p
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -127,7 +128,12 @@ public class SecurityTokenServiceProvide
     private WebServiceContext context;
 
     public SecurityTokenServiceProvider() throws Exception {
-        CachedContextAndSchemas cache = JAXBContextCache.getCachedContextAndSchemas(ObjectFactory.class);
+        Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(ObjectFactory.class);
+        classes.add(org.apache.cxf.ws.security.sts.provider.model.wstrust14.ObjectFactory.class);
+                
+        CachedContextAndSchemas cache = 
+            JAXBContextCache.getCachedContextAndSchemas(classes, null, null, null, false);
         jaxbContext = cache.getContext();
         jaxbContextClasses = cache.getClasses();
     }

Added: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/binding14.xjb
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/binding14.xjb?rev=1154983&view=auto
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/binding14.xjb (added)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/binding14.xjb Mon Aug  8 15:06:59 2011
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<jaxb:bindings version="2.1"
+  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+  xmlns:wsa="http://www.w3.org/2005/08/addressing"
+  jaxb:extensionBindingPrefixes="xjc">
+
+    <jaxb:bindings schemaLocation="ws-trust-1.4.xsd" node="/xs:schema">
+        <jaxb:schemaBindings>
+            <jaxb:package name="org.apache.cxf.ws.security.sts.provider.model.wstrust14"/>
+        </jaxb:schemaBindings>
+    </jaxb:bindings>
+    
+    <jaxb:bindings schemaLocation="ws-addr.xsd">
+        <jaxb:schemaBindings map="false"/>
+    </jaxb:bindings>
+    <jaxb:bindings schemaLocation="oasis-200401-wss-wssecurity-utility-1.0.xsd" node="/xs:schema">
+        <jaxb:schemaBindings map="false">
+        </jaxb:schemaBindings>
+    </jaxb:bindings>
+    <jaxb:bindings schemaLocation="oasis-200401-wss-wssecurity-secext-1.0.xsd" node="/xs:schema">
+        <jaxb:schemaBindings map="false">
+        </jaxb:schemaBindings>
+    </jaxb:bindings>
+    <jaxb:bindings schemaLocation="xmldsig-core-schema.xsd" node="/xs:schema">
+        <jaxb:schemaBindings map="false">
+        </jaxb:schemaBindings>
+    </jaxb:bindings>
+    <jaxb:bindings schemaLocation="ws-policy.xsd" node="/xs:schema">
+        <jaxb:schemaBindings map="false">
+        </jaxb:schemaBindings>
+    </jaxb:bindings>
+</jaxb:bindings>

Added: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/ws-trust-1.4.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/ws-trust-1.4.xsd?rev=1154983&view=auto
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/ws-trust-1.4.xsd (added)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/model/ws-trust-1.4.xsd Mon Aug  8 15:06:59 2011
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the 
+implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; 
+neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS 
+specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made 
+available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users 
+of this specification, can be obtained from the OASIS Executive Director.
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may 
+cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director.
+Copyright © OASIS Open 2002-2008. All Rights Reserved.
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist 
+in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the 
+above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself does not be modified 
+in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, 
+in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate 
+it into languages other than English.
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
+This document and the information contained herein is provided on an AS IS basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+-->
+<xs:schema targetNamespace="http://docs.oasis-open.org/ws-sx/ws-trust/200802" xmlns:tns="http://docs.oasis-open.org/ws-sx/ws-trust/200802" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" elementFormDefault="qualified">
+
+  <xs:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" schemaLocation="oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
+  <xs:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" schemaLocation="oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
+  <xs:import namespace="http://schemas.xmlsoap.org/ws/2004/09/policy" schemaLocation="ws-policy.xsd"/>
+  <xs:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="ws-addr.xsd"/>
+
+
+  <!-- Section 8.3.1 -->
+  <xs:element name="InteractiveChallenge" type="tns:InteractiveChallengeType"/>
+  <xs:complexType name="InteractiveChallengeType">
+    <xs:annotation>
+      <xs:documentation>
+        Actual content model is non-deterministic, hence wildcard. The following shows intended content model:
+        &lt;xs:element ref='wst14:Title' minOccurs='0' /&gt;
+        &lt;xs:element ref='wst14:TextChallenge' minOccurs='0' /&gt;
+        &lt;xs:element ref='wst14:ChoiceChallenge' minOccurs='0' /&gt;
+        &lt;xs:element ref='wst14:ContextData' minOccurs='0' /&gt;
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:element name="Title" type="tns:TitleType"/>
+  <xs:complexType name="TitleType">
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="TextChallenge" type="tns:TextChallengeType"/>
+  <xs:complexType name="TextChallengeType">
+    <xs:sequence>
+      <xs:element name="Image" type="tns:ImageType" minOccurs="0" maxOccurs="1"/>
+    </xs:sequence>
+    <xs:attribute name="RefID" type="xs:anyURI" use="required"/>
+    <xs:attribute name="Label" type="xs:string" use="optional"/>
+    <xs:attribute name="MaxLen" type="xs:int" use="optional"/>
+    <xs:attribute name="HideText" type="xs:boolean" use="optional"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:complexType name="ImageType">
+    <xs:simpleContent>
+      <xs:extension base="xs:base64Binary">
+        <xs:attribute name="MimeType" type="xs:string"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ChoiceChallenge" type="tns:ChoiceChallengeType"/>
+
+  <xs:complexType name="ChoiceChallengeType">
+    <xs:sequence>
+      <xs:element name="Choice" type="tns:ChoiceType" minOccurs="0" maxOccurs="1"/>
+    </xs:sequence>
+    <xs:attribute name="RefID" type="xs:anyURI" use="required"/>
+    <xs:attribute name="Label" type="xs:string" use="optional"/>
+    <xs:attribute name="ExactlyOne" type="xs:boolean" use="optional"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:complexType name="ChoiceType">
+    <xs:sequence>
+      <xs:element name="Image" type="tns:ImageType" minOccurs="0" maxOccurs="1"/>
+    </xs:sequence>
+    <xs:attribute name="RefID" type="xs:anyURI" use="required"/>
+    <xs:attribute name="Label" type="xs:string" use="optional"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:element name="ContextData" type="tns:ContextDataType"/>
+  <xs:complexType name="ContextDataType">
+    <xs:sequence>
+      <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="RefID" type="xs:anyURI" use="required"/>
+  </xs:complexType>
+
+  <xs:element name="InteractiveChallengeResponse" type="tns:InteractiveChallengeResponseType"/>
+  <xs:complexType name="InteractiveChallengeResponseType">
+    <xs:annotation>
+      <xs:documentation>
+        Actual content model is non-deterministic, hence wildcard. The following shows intended content model:
+        &lt;xs:element ref='wst14:TextChallengeResponse' minOccurs='0' /&gt;
+        &lt;xs:element ref='wst14:ChoiceChallengeResponse' minOccurs='0' /&gt;
+        &lt;xs:element ref='wst14:ContextData' minOccurs='0' /&gt;
+      </xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:element name="TextChallengeResponse" type="tns:TextChallengeResponseType"/>
+  <xs:complexType name="TextChallengeResponseType">
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute name="RefId" type="xs:anyURI" use="required"/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+  <xs:element name="ChoiceChallengeResponse" type="tns:ChoiceChallengeResponseType"/>
+  <xs:complexType name="ChoiceChallengeResponseType">
+    <xs:sequence>
+      <xs:element name="ChoiceSelected" type="tns:ChoiceSelectedType" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="RefId" type="xs:anyURI" use="required"/>
+  </xs:complexType>
+  
+  <xs:complexType name="ChoiceSelectedType">
+    <xs:attribute name="RefId" type="xs:anyURI" use="required"/>
+  </xs:complexType>
+  
+  <!-- Section 9.3 -->
+  <xs:element name="ActAs" type="tns:ActAsType"/>
+  <xs:complexType name="ActAsType">
+   <xs:sequence>
+      <xs:any namespace="##any" processContents="lax"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
\ No newline at end of file