Class AbstractDecryptAction
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.saml.saml2.profile.impl.AbstractDecryptAction
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
- Direct Known Subclasses:
DecryptAssertions
,DecryptAttributes
,DecryptNameIDs
Abstract base class for actions that perform SAML decryption.
The actual message to handle is obtained via strategy function, by default the inbound message.
The SecurityParametersContext
governing the decryption process is located by a lookup
strategy, by default a child of the inbound message context.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Decrypter
The decryption object.Predicate determining whether to attempt decryption.private boolean
Are decryption failures a fatal condition?private final org.slf4j.Logger
Class logger.private SAMLObject
Message to operate on.private Function<ProfileRequestContext,
Object> Strategy used to locate the SAML message to operate on.Strategy used to locate theSecurityParametersContext
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doPreExecute
(ProfileRequestContext profileRequestContext) Called prior to execution, actions may override this method to perform pre-processing for a request.Get the decrypter.Get the predicate used to determine whether to attempt decryption.Get the object to act on.boolean
Get whether decryption failure should be treated as an error or ignored.void
Set the predicate used to determine whether to attempt decryption.void
setErrorFatal
(boolean flag) Set whether decryption failure should be treated as an error or ignored.void
Set the strategy used to locate theSAMLObject
to operate on.void
setSecurityParametersContextLookupStrategy
(Function<ProfileRequestContext, SecurityParametersContext> strategy) Set the strategy used to locate theSecurityParametersContext
associated with a givenProfileRequestContext
.Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doExecute, doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
errorFatal
private boolean errorFatalAre decryption failures a fatal condition? -
securityParamsLookupStrategy
@Nonnull private Function<ProfileRequestContext,SecurityParametersContext> securityParamsLookupStrategyStrategy used to locate theSecurityParametersContext
. -
messageLookupStrategy
Strategy used to locate the SAML message to operate on. -
decryptionPredicate
Predicate determining whether to attempt decryption. -
decrypter
The decryption object. -
message
Message to operate on.
-
-
Constructor Details
-
AbstractDecryptAction
public AbstractDecryptAction()Constructor.
-
-
Method Details
-
isErrorFatal
public boolean isErrorFatal()Get whether decryption failure should be treated as an error or ignored.- Returns:
- whether decryption failure should be treated as an error or ignored
-
setErrorFatal
public void setErrorFatal(boolean flag) Set whether decryption failure should be treated as an error or ignored.- Parameters:
flag
- true iff decryption failure should be fatal
-
setSecurityParametersContextLookupStrategy
public void setSecurityParametersContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SecurityParametersContext> strategy) Set the strategy used to locate theSecurityParametersContext
associated with a givenProfileRequestContext
.- Parameters:
strategy
- strategy used to locate theSecurityParametersContext
associated with a givenProfileRequestContext
-
setMessageLookupStrategy
Set the strategy used to locate theSAMLObject
to operate on.- Parameters:
strategy
- strategy used to locate theSAMLObject
to operate on
-
getDecryptionPredicate
@Nonnull public Predicate<Pair<ProfileRequestContext,EncryptedElementType>> getDecryptionPredicate()Get the predicate used to determine whether to attempt decryption.- Returns:
- the predicate
-
setDecryptionPredicate
public void setDecryptionPredicate(@Nonnull Predicate<Pair<ProfileRequestContext, EncryptedElementType>> predicate) Set the predicate used to determine whether to attempt decryption.- Parameters:
predicate
- predicate to use
-
getDecrypter
Get the decrypter.- Returns:
- the decrypter
-
getSAMLObject
Get the object to act on.- Returns:
- the object to act on
-
doPreExecute
Called prior to execution, actions may override this method to perform pre-processing for a request.If false is returned, execution will not proceed, and the action should attach an
EventContext
to the context tree to signal how to continue with overall workflow processing.If returning successfully, the last step should be to return the result of the superclass version of this method.
- Overrides:
doPreExecute
in classAbstractProfileAction
- Parameters:
profileRequestContext
- the current IdP profile request context- Returns:
- true iff execution should proceed
-