Failsafe in case folks have problems validating without xsi:type on attribute values.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 9 Apr 2004 19:03:58 +0000 (19:03 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 9 Apr 2004 19:03:58 +0000 (19:03 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@963 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/AAAttribute.java
src/edu/internet2/middleware/shibboleth/aa/AAConfig.java
src/schemas/origin.xsd

index 3f6b06e..fdf76cb 100644 (file)
@@ -57,6 +57,7 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.log4j.Logger;
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.opensaml.QName;
 import org.opensaml.SAMLAttribute;
 import org.opensaml.SAMLException;
 import org.opensaml.XML;
 import org.opensaml.SAMLAttribute;
 import org.opensaml.SAMLException;
 import org.opensaml.XML;
@@ -79,6 +80,8 @@ public class AAAttribute extends SAMLAttribute implements ResolverAttribute, Arp
 
        private static Logger log = Logger.getLogger(AAAttribute.class.getName());
        private boolean resolved = false;
 
        private static Logger log = Logger.getLogger(AAAttribute.class.getName());
        private boolean resolved = false;
+       /** A hedge in case we are wrong about no longer needing xsi:type.  Remove this, if possible, in 1.3. **/
+       static boolean typeHack = false;
        
        public final static String SHIB_ATTRIBUTE_NAMESPACE_URI = "urn:mace:shibboleth:1.0:attributeNamespace:uri";
        
        
        public final static String SHIB_ATTRIBUTE_NAMESPACE_URI = "urn:mace:shibboleth:1.0:attributeNamespace:uri";
        
@@ -90,7 +93,7 @@ public class AAAttribute extends SAMLAttribute implements ResolverAttribute, Arp
                super(
                        name,
                        SHIB_ATTRIBUTE_NAMESPACE_URI,
                super(
                        name,
                        SHIB_ATTRIBUTE_NAMESPACE_URI,
-                       null,
+                       !typeHack? null: new QName("urn:mace:shibboleth:1.0", "AttributeValueType"),
                        defaultLifetime,
                        null);
        }
                        defaultLifetime,
                        null);
        }
index 233b365..27b82b6 100644 (file)
@@ -56,6 +56,15 @@ public class AAConfig extends ShibbolethOriginConfig {
                if (attribute != null && !attribute.equals("")) {
                        passThruErrors = Boolean.valueOf(attribute).booleanValue();
                }
                if (attribute != null && !attribute.equals("")) {
                        passThruErrors = Boolean.valueOf(attribute).booleanValue();
                }
+               
+               //xsi:type hack
+               attribute = ((Element) config).getAttribute("typeHack");
+               if (attribute != null && !attribute.equals("")) {
+                       if(Boolean.valueOf(attribute).booleanValue()) {
+                               AAAttribute.typeHack = true;
+                               log.debug("Enabling xsi:type hack.");
+                       }
+               }
 
                log.debug("Global config: (resolverConfig) = (" + getResolverConfigLocation() + ").");
                log.debug("Global config: (passThruErrors) = (" + passThruErrors() + ").");
 
                log.debug("Global config: (resolverConfig) = (" + getResolverConfigLocation() + ").");
                log.debug("Global config: (passThruErrors) = (" + passThruErrors() + ").");
index 3e9498f..61576dd 100644 (file)
                        <xs:attribute name="passThruErrors" type="xs:boolean" use="optional" default="false"/>
                        <xs:attribute name="authHeaderName" type="xs:string" use="optional"/>
                        <xs:attribute name="maxHSThreads" type="xs:integer" use="optional"/>
                        <xs:attribute name="passThruErrors" type="xs:boolean" use="optional" default="false"/>
                        <xs:attribute name="authHeaderName" type="xs:string" use="optional"/>
                        <xs:attribute name="maxHSThreads" type="xs:integer" use="optional"/>
+                       <xs:attribute name="typeHack" type="xs:boolean" use="optional" default="false"/>
                </xs:complexType>
        </xs:element>
 
                </xs:complexType>
        </xs:element>