[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-impl/src: main/java/net/shibboleth/idp/attribute/res...

noreply at shibboleth.net noreply at shibboleth.net
Fri Feb 22 09:51:11 EST 2013


Author: rdw
Date: Fri Feb 22 09:51:10 2013
New Revision: 4286

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4286&view=rev
Log:
https://issues.shibboleth.net/jira/browse/IDP-6 https://issues.shibboleth.net/jira/browse/IDP-255
Move Attribute Issued and Attribute recipient into the resolution Context

Modified:
    trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/BaseComputedIDDataConnector.java
    trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnector.java
    trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java

Modified: trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/BaseComputedIDDataConnector.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/BaseComputedIDDataConnector.java?rev=4286&r1=4285&r2=4286&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/BaseComputedIDDataConnector.java (original)
+++ trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/BaseComputedIDDataConnector.java Fri Feb 22 09:51:10 2013
@@ -41,7 +41,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Function;
 import com.google.common.base.Optional;
 
 /**
@@ -63,10 +62,6 @@
     /** Salt used when computing the ID. */
     private byte[] salt;
 
-    /** Strategy used to locate the SP EntityId given a {@link AttributeResolutionContext}. */
-    // TODO(rdw) These needs to be changed when the profile handling has been finalized.  Name and Interface type?
-    private Function<AttributeResolutionContext, String> spEntityIdStrategy;
-
     /**
      * Gets the salt used when computing the ID.
      * 
@@ -124,33 +119,9 @@
         generatedAttribute = newAttributeId;
     }
 
-    /**
-     * Gets the strategy for finding the RelyingParty EntityId from the resolution context.
-     * 
-     * @return the required strategy.
-     */
-    public Function<AttributeResolutionContext, String> getSPEntityIdStrategy() {
-        return spEntityIdStrategy;
-    }
-
-    /**
-     * Sets the strategy for finding the RelyingPartyContext from the resolution context.
-     * 
-     * @param strategy to set.
-     */
-    public void setSPEntityIdStrategy(Function<AttributeResolutionContext, String> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        spEntityIdStrategy = strategy;
-    }
-
     /** {@inheritDoc} */
     protected void doInitialize() throws ComponentInitializationException {
         super.doInitialize();
-
-        if (null == spEntityIdStrategy) {
-            throw new ComponentInitializationException("Stored/Computer Connector'" + getId()
-                    + "': no SP EntityId Lookup Strategy set");
-        }
 
         if (null == getSourceAttributeId()) {
             throw new ComponentInitializationException("Stored/Computer Connector'" + getId()

Modified: trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnector.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnector.java?rev=4286&r1=4285&r2=4286&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnector.java (original)
+++ trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnector.java Fri Feb 22 09:51:10 2013
@@ -63,14 +63,14 @@
 
         ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
 
-        String spEntityId = getSPEntityIdStrategy().apply(resolutionContext); 
+        String attributeRecipientID = resolutionContext.getAttributeRecipientID();
         
-        if (spEntityId == null) {
-            log.warn("ComputedIDDataConnector '{}' : No source SP identified, unable to compute ID", getId());
+        if (attributeRecipientID == null) {
+            log.warn("ComputedIDDataConnector '{}' : No Attribute Recipient ID located, unable to compute ID", getId());
             return Optional.absent();
         }
 
-        return encodeAsAttribute(generateComputedId(spEntityId, resolveSourceAttribute(resolutionContext)));
+        return encodeAsAttribute(generateComputedId(attributeRecipientID, resolveSourceAttribute(resolutionContext)));
     }
 
 }


[... 207 lines stripped ...]


More information about the commits mailing list