[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-spring/src: main/java/net/shibboleth/idp/attribute/r...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Dec 12 07:10:40 EST 2013
Author: rdw
Date: Thu Dec 12 07:10:40 2013
New Revision: 5024
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5024&view=rev
Log:
IDP-330 <AttributeResolver/> gets an optional id. Plus test
Added:
trunk/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver2.xml (with props)
trunk/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/service2.xml (with props)
Modified:
trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverParser.java
trunk/idp-attribute-resolver-spring/src/main/resources/schema/shibboleth-2.0-attribute-resolver.xsd
trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java
Modified: trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverParser.java?rev=5024&r1=5023&r2=5024&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverParser.java (original)
+++ trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverParser.java Thu Dec 12 07:10:40 2013
@@ -27,6 +27,7 @@
import net.shibboleth.idp.attribute.resolver.spring.ad.BaseAttributeDefinitionParser;
import net.shibboleth.idp.attribute.resolver.spring.dc.AbstractDataConnectorParser;
import net.shibboleth.idp.spring.SpringSupport;
+import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.xml.ElementSupport;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -56,14 +57,20 @@
/** {@inheritDoc} */
protected void doParse(Element config, ParserContext context, BeanDefinitionBuilder builder) {
- Map<QName, List<Element>> configChildren = ElementSupport.getIndexedChildElements(config);
+ final Map<QName, List<Element>> configChildren = ElementSupport.getIndexedChildElements(config);
List<Element> children;
// TODO principal connector
// children = configChildren.get(new QName(AttributeResolverNamespaceHandler.NAMESPACE, "PrincipalConnector"));
// SpringSupport.parseCustomElements(children, context);
+ String id = StringSupport.trimOrNull(config.getAttributeNS(null, "id"));
+
+ if (null == id) {
+ // Compatibility with V2
+ id = "Shibboleth.Resolver";
+ }
- builder.addConstructorArgValue("Shibboleth.Resolver");
+ builder.addConstructorArgValue(id);
children = configChildren.get(BaseAttributeDefinitionParser.ELEMENT_NAME);
builder.addConstructorArgValue(SpringSupport.parseCustomElements(children, context));
Modified: trunk/idp-attribute-resolver-spring/src/main/resources/schema/shibboleth-2.0-attribute-resolver.xsd
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-spring/src/main/resources/schema/shibboleth-2.0-attribute-resolver.xsd?rev=5024&r1=5023&r2=5024&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-spring/src/main/resources/schema/shibboleth-2.0-attribute-resolver.xsd (original)
+++ trunk/idp-attribute-resolver-spring/src/main/resources/schema/shibboleth-2.0-attribute-resolver.xsd Thu Dec 12 07:10:40 2013
@@ -36,7 +36,7 @@
</keyref>
<key name="PluginDependencyKey">
<selector xpath="./resolver:AttributeDefinition|./resolver:DataConnector"/>
- <field xpath="@id"/>
+ <field xpath="@id" />
</key>
</element>
<complexType name="AttributeResolverType">
@@ -45,6 +45,11 @@
<element ref="resolver:DataConnector"/>
<element ref="resolver:PrincipalConnector"/>
</choice>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>A unique identifier for this Resolver.</documentation>
+ </annotation>
+ </attribute>
</complexType>
<element name="AttributeDefinition" type="resolver:BaseAttributeDefinitionType">
Modified: trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java?rev=5024&r1=5023&r2=5024&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java (original)
[... 45 lines stripped ...]
More information about the commits
mailing list