[java-identity-provider] 05/07: IDP-1359 sourceAttributeID is *not* required for StoredID

Rod Widdowson rdw at steadingsoftware.com
Sat Dec 8 09:27:28 EST 2018


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch maint-3.4
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=2838780dee4e66d6a2fe1882e1cf1043491e3a8d

commit 2838780dee4e66d6a2fe1882e1cf1043491e3a8d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Nov 8 16:44:51 2018 +0000

    IDP-1359 sourceAttributeID is *not* required for StoredID
    
    https://issues.shibboleth.net/jira/browse/IDP-1359
    
    The schema was updated to remove the used="required" attribute
    and the tests enhanced.
---
 .../resolver/spring/dc/StoredIDDataConnectorParserTest.java      | 9 +++++++--
 .../idp/attribute/resolver/spring/dc/resolver/stored.xml         | 3 +--
 .../idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml   | 3 +--
 .../src/main/resources/schema/shibboleth-attribute-resolver.xsd  | 2 +-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java
index 81b4d83..d0f2298 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java
@@ -17,6 +17,8 @@
 
 package net.shibboleth.idp.attribute.resolver.spring.dc;
 
+import net.shibboleth.idp.attribute.resolver.ResolverAttributeDefinitionDependency;
+import net.shibboleth.idp.attribute.resolver.ResolverPluginDependency;
 import net.shibboleth.idp.attribute.resolver.spring.BaseAttributeDefinitionParserTest;
 import net.shibboleth.idp.attribute.resolver.spring.dc.impl.StoredIDDataConnectorParser;
 import net.shibboleth.idp.saml.attribute.resolver.impl.StoredIDDataConnector;
@@ -33,7 +35,6 @@ public class StoredIDDataConnectorParserTest extends BaseAttributeDefinitionPars
     
     private void testIt(final StoredIDDataConnector connector) throws ComponentInitializationException {
         Assert.assertEquals(connector.getId(), "stored");
-        Assert.assertEquals(connector.getSourceAttributeId(), "theSourceRemainsTheSame");
         Assert.assertEquals(connector.getGeneratedAttributeId(), "jenny");
         Assert.assertEquals(connector.getTransactionRetries(), 5);
         Assert.assertEquals(connector.getQueryTimeout(), 5000);
@@ -46,18 +47,22 @@ public class StoredIDDataConnectorParserTest extends BaseAttributeDefinitionPars
     @Test public void withSalt() throws ComponentInitializationException {
         final StoredIDDataConnector connector = getDataConnector("resolver/stored.xml", StoredIDDataConnector.class);
         
+        ResolverAttributeDefinitionDependency attrib = (ResolverAttributeDefinitionDependency) connector.getDependencies().iterator().next();
+        Assert.assertEquals(attrib.getDependencyPluginId(), "theSourceRemainsTheSame");
         Assert.assertEquals(connector.getSalt(), "abcdefghijklmnopqrst".getBytes());
         testIt(connector);
     }
 
     @Test public void withOutSalt() throws ComponentInitializationException {
         final StoredIDDataConnector connector = getDataConnector("resolver/storedNoSalt.xml", StoredIDDataConnector.class);
+        ResolverAttributeDefinitionDependency attrib = (ResolverAttributeDefinitionDependency) connector.getDependencies().iterator().next();
+        Assert.assertEquals(attrib.getDependencyPluginId(), "theSourceRemainsTheSame");
         testIt(connector);
     }
 
     @Test public void resolver() throws ComponentInitializationException {
         final StoredIDDataConnector connector = getDataConnector("stored.xml", StoredIDDataConnector.class);
-        
+        Assert.assertEquals(connector.getSourceAttributeId(), "theSourceRemainsTheSame");
         testIt(connector);
     }
 }
\ No newline at end of file
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
index 750be85..94bc44b 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
@@ -6,7 +6,6 @@
     queryTimeout="PT5S"
     transactionRetries="5"
     retryableErrors="25000 25001"
-	sourceAttributeID="theSourceRemainsTheSame"
 	generatedAttributeID="jenny"
 	salt="abcdefghijklmnopqrst"
 	
@@ -18,5 +17,5 @@
         
         <FailoverDataConnector ref="sddsadas"/>
         <FailoverDataConnector ref="sddsadas"/>
-        
+	<InputAttributeDefinition ref="theSourceRemainsTheSame"/>
 </DataConnector>
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml
index 6b15349..cde4468 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml
@@ -7,10 +7,9 @@
     queryTimeout="PT5S"
     transactionRetries="5"
     retryableErrors="25000 25001"
-	sourceAttributeID="theSourceRemainsTheSame"
 	generatedAttributeID="jenny"
 	xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd">
-
+	<InputAttributeDefinition ref="theSourceRemainsTheSame"/>
     <ApplicationManagedConnection
         jdbcDriver="org.hsqldb.jdbc.JDBCDriver"
         jdbcURL="jdbc:hsqldb:mem:RDBMSDataConnectorStore" />
diff --git a/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd b/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
index 65f0ec4..332ab58 100644
--- a/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
+++ b/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
@@ -1637,7 +1637,7 @@
                         </documentation>
                     </annotation>
                 </attribute>
-                <attribute name="sourceAttributeID" type="string" use="required">
+                <attribute name="sourceAttributeID" type="string" >
                     <annotation>
                         <documentation>
                             The name of the attribute which should be used to as input to the computed ID.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list