[java-opensaml COMMIT] /trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/PopulateSignatur...
noreply at shibboleth.net
noreply at shibboleth.net
Mon May 12 13:29:50 EDT 2014
Author: scantor
Date: Mon May 12 13:29:50 2014
New Revision: 3863
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3863&view=rev
Log:
Revert the entityID change, we don't need it for this resolver.
Modified:
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/PopulateSignatureSigningParameters.java
Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/PopulateSignatureSigningParameters.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/PopulateSignatureSigningParameters.java?rev=3863&r1=3862&r2=3863&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/PopulateSignatureSigningParameters.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/PopulateSignatureSigningParameters.java Mon May 12 13:29:50 2014
@@ -45,7 +45,6 @@
import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
import net.shibboleth.utilities.java.support.resolver.ResolverException;
-import org.opensaml.core.criterion.EntityIdCriterion;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -76,8 +75,8 @@
@NonnullAfterInit
private Function<ProfileRequestContext,List<SignatureSigningConfiguration>> configurationLookupStrategy;
- /** Strategy used to look up a SAML peer context. */
- @Nullable private Function<ProfileRequestContext,SAMLPeerEntityContext> peerContextLookupStrategy;
+ /** Strategy used to look up a SAML metadata context. */
+ @Nullable private Function<ProfileRequestContext,SAMLMetadataContext> metadataContextLookupStrategy;
/** Resolver for parameters to store into context. */
@NonnullAfterInit private SignatureSigningParametersResolver resolver;
@@ -92,10 +91,11 @@
securityParametersContextLookupStrategy = Functions.compose(
new ChildContextLookup<>(SecurityParametersContext.class, true), new OutboundMessageContextLookup());
- // Default: outbound msg context -> SAMLPeerEntityContext
- peerContextLookupStrategy =
+ // Default: outbound msg context -> SAMLPeerEntityContext -> SAMLMetadataContext
+ metadataContextLookupStrategy = Functions.compose(
+ new ChildContextLookup<>(SAMLMetadataContext.class),
Functions.compose(new ChildContextLookup<>(SAMLPeerEntityContext.class),
- new OutboundMessageContextLookup());
+ new OutboundMessageContextLookup()));
}
/**
@@ -123,17 +123,17 @@
existingParametersContextLookupStrategy = strategy;
}
-
- /**
- * Set lookup strategy for {@link SAMLPeerEntityContext} for input to resolution.
+
+ /**
+ * Set lookup strategy for {@link SAMLMetadataContext} for input to resolution.
*
* @param strategy lookup strategy
*/
- public void setPeerContextLookupStrategy(
- @Nullable final Function<ProfileRequestContext,SAMLPeerEntityContext> strategy) {
- ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-
- peerContextLookupStrategy = strategy;
+ public void setMetadataContextLookupStrategy(
+ @Nullable final Function<ProfileRequestContext,SAMLMetadataContext> strategy) {
+ ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+
+ metadataContextLookupStrategy = strategy;
}
/**
@@ -225,20 +225,11 @@
final CriteriaSet criteria = new CriteriaSet(new SignatureSigningConfigurationCriterion(configs));
- if (peerContextLookupStrategy != null) {
- final SAMLPeerEntityContext peerCtx = peerContextLookupStrategy.apply(profileRequestContext);
- if (peerCtx != null) {
- if (peerCtx.getEntityId() != null) {
- log.debug("{} Adding entityID to resolution criteria for signing/digest algorithms",
- getLogPrefix());
- criteria.add(new EntityIdCriterion(peerCtx.getEntityId()));
- }
- final SAMLMetadataContext metadataCtx = peerCtx.getSubcontext(SAMLMetadataContext.class);
- if (metadataCtx != null && metadataCtx.getRoleDescriptor() != null) {
- log.debug("{} Adding role metadata to resolution criteria for signing/digest algorithms",
- getLogPrefix());
- criteria.add(new RoleDescriptorCriterion(metadataCtx.getRoleDescriptor()));
- }
+ if (metadataContextLookupStrategy != null) {
+ final SAMLMetadataContext metadataCtx = metadataContextLookupStrategy.apply(profileRequestContext);
+ if (metadataCtx != null && metadataCtx.getRoleDescriptor() != null) {
[... 6 lines stripped ...]
More information about the commits
mailing list