[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-api/src: main/java/net/shibboleth/idp/attribute/reso...
noreply at shibboleth.net
noreply at shibboleth.net
Fri May 31 19:40:40 EDT 2013
Author: putmanb
Date: Fri May 31 19:40:40 2013
New Revision: 4503
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4503&view=rev
Log:
Refactor subject name principal connector to use a MessageContext<SAMLObject> and related new API classes.
Eliminate remaining dependencies on old v2 SAMLMessageContext and related classes.
Modified:
trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/BaseSubjectNamePrincipalConnectorDefinition.java
trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/BaseSubjectNamePrincipalConnectorDefinitionTest.java
trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/MockMessageContext.java
trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/SamlContextFinder.java
Modified: trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/BaseSubjectNamePrincipalConnectorDefinition.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/BaseSubjectNamePrincipalConnectorDefinition.java?rev=4503&r1=4502&r2=4503&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/BaseSubjectNamePrincipalConnectorDefinition.java (original)
+++ trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/BaseSubjectNamePrincipalConnectorDefinition.java Fri May 31 19:40:40 2013
@@ -29,8 +29,10 @@
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
+import org.opensaml.messaging.context.MessageContext;
import org.opensaml.saml.common.SAMLObject;
-import org.opensaml.saml.common.binding.SAMLMessageContext;
+import org.opensaml.saml.common.messaging.context.SamlPeerEntityContext;
+import org.opensaml.saml.common.messaging.context.SamlSubjectNameIdentifierContext;
import org.opensaml.saml.saml1.core.NameIdentifier;
import org.opensaml.saml.saml2.core.NameID;
@@ -39,7 +41,8 @@
/**
* The base implementation of all SAML Subject Name Connectors.<b/> This takes on the heavy lifting of finding the
- * SAMLMessageContext, looking up the nameID and so forth. Concrete implementations take care of the other plumbing.
+ * MessageContext containing the SAML message being processed, looking up the nameID and so forth.
+ * Concrete implementations take care of the other plumbing.
*/
public abstract class BaseSubjectNamePrincipalConnectorDefinition extends BaseResolverPlugin<String> implements
PrincipalConnectorDefinition<AttributeResolutionContext> {
@@ -55,9 +58,11 @@
private Set<String> relyingParties = Collections.EMPTY_SET;
/**
- * TODO remove The temporary mechanism to get the SAML message.
- */
- private Function<AttributeResolutionContext, SAMLMessageContext> contextFinderStrategy;
+ * TODO - verify that this is correct going forward.
+ *
+ * The strategy to resolve the message context containing the SAML message being processed.
+ */
+ private Function<AttributeResolutionContext, MessageContext<SAMLObject>> contextFinderStrategy;
/**
* Get NameID format.
@@ -98,29 +103,31 @@
}
/**
- * Temporary function to set up the context navigation mechanism.<b/> This is used to go from a
- * {@link AttributeResolutionContext} to a {@link SAMLMessageContext}. It is expected that the latter will become a
- * real "context" and at that stage we can do a getParent.getSubcontext(SAMLMessageContext.class);
- *
- * @param function the navigation function. TODO This function needs to be removed and replaced by proper navigation
- * at a later stage.
- */
- public void setContextFinderStrategy(final Function<AttributeResolutionContext, SAMLMessageContext> function) {
+ * TODO - verify that this is correct going forward.
+ *
+ * Function to set up the context navigation mechanism. This is used to go from a
+ * {@link AttributeResolutionContext} to a {@link MessageContext} containing a SAML protocol message represented by
+ * a {@link SAMLObject}.
+ *
+ * @param function the navigation function.
+ */
+ public void setContextFinderStrategy(final Function<AttributeResolutionContext,
+ MessageContext<SAMLObject>> function) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
contextFinderStrategy = function;
}
/**
- * Helper function to get the {@link SAMLMessageContext} from our context.
+ * Helper function to get the {@link MessageContext} from our context.
*
* @param inputContext What we are passed
- * @return the {@link SAMLMessageContext} never null.
+ * @return the {@link MessageContext} never null.
[... 188 lines stripped ...]
More information about the commits
mailing list