[java-opensaml COMMIT] in /trunk: opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/PopulateDecryp...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Apr 2 11:43:34 EDT 2014
Author: scantor
Date: Wed Apr 2 11:43:34 2014
New Revision: 3756
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3756&view=rev
Log:
OSJ-70 - make decryption populator conditional, and add a copy option to optimize signing populator
Modified:
trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/PopulateDecryptionParameters.java
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/PopulateSignatureSigningParameters.java
trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/common/profile/impl/PopulateSignatureSigningParametersTest.java
Modified: trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/PopulateDecryptionParameters.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/PopulateDecryptionParameters.java?rev=3756&r1=3755&r2=3756&view=diff
==============================================================================
--- trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/PopulateDecryptionParameters.java (original)
+++ trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/PopulateDecryptionParameters.java Wed Apr 2 11:43:34 2014
@@ -23,7 +23,7 @@
import javax.annotation.Nullable;
import org.opensaml.profile.ProfileException;
-import org.opensaml.profile.action.AbstractProfileAction;
+import org.opensaml.profile.action.AbstractConditionalProfileAction;
import org.opensaml.profile.action.ActionSupport;
import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
@@ -58,7 +58,7 @@
* @event {@link EventIds#INVALID_PROFILE_CTX}
* @event {@link EventIds#INVALID_SEC_CFG}
*/
-public class PopulateDecryptionParameters extends AbstractProfileAction {
+public class PopulateDecryptionParameters extends AbstractConditionalProfileAction {
/** Class logger. */
@Nonnull private final Logger log = LoggerFactory.getLogger(PopulateDecryptionParameters.class);
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=3756&r1=3755&r2=3756&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 Wed Apr 2 11:43:34 2014
@@ -68,6 +68,9 @@
/** Strategy used to look up the {@link SecurityParametersContext} to set the parameters for. */
@Nonnull private Function<ProfileRequestContext,SecurityParametersContext> securityParametersContextLookupStrategy;
+
+ /** Strategy used to look up an existing {@link SecurityParametersContext} to copy. */
+ @Nullable private Function<ProfileRequestContext,SecurityParametersContext> existingParametersContextLookupStrategy;
/** Strategy used to look up a per-request {@link SignatureSigningConfiguration}. */
@Nullable private Function<ProfileRequestContext,SignatureSigningConfiguration> configurationLookupStrategy;
@@ -87,7 +90,7 @@
// Create context by default.
securityParametersContextLookupStrategy = Functions.compose(
new ChildContextLookup<>(SecurityParametersContext.class, true), new OutboundMessageContextLookup());
-
+
// Default: outbound msg context -> SAMLPeerEntityContext -> SAMLMetadataContext
metadataContextLookupStrategy = Functions.compose(
new ChildContextLookup<>(SAMLMetadataContext.class),
@@ -106,6 +109,19 @@
securityParametersContextLookupStrategy = Constraint.isNotNull(strategy,
"SecurityParametersContext lookup strategy cannot be null");
+ }
+
+ /**
+ * Set the strategy used to look up an existing {@link SecurityParametersContext} to copy instead
+ * of actually resolving the parameters to set.
+ *
+ * @param strategy lookup strategy
+ */
+ public void setExistingParametersContextLookupStrategy(
+ @Nullable final Function<ProfileRequestContext,SecurityParametersContext> strategy) {
+ ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+
+ existingParametersContextLookupStrategy = strategy;
}
/**
@@ -167,6 +183,7 @@
}
}
+// Checkstyle: CyclomaticComplexity OFF
/** {@inheritDoc} */
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) throws ProfileException {
@@ -179,6 +196,16 @@
log.debug("{} No SecurityParametersContext returned by lookup strategy", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
return;
[... 76 lines stripped ...]
More information about the commits
mailing list