Class AbstractDecryptAction
java.lang.Object
net.shibboleth.shared.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 DecrypterThe decryption object.Predicate determining whether to attempt decryption.private booleanAre decryption failures a fatal condition?private final org.slf4j.LoggerClass logger.private SAMLObjectMessage 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 booleandoPreExecute(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.booleanGet whether decryption failure should be treated as an error or ignored.voidSet the predicate used to determine whether to attempt decryption.voidsetErrorFatal(boolean flag) Set whether decryption failure should be treated as an error or ignored.voidSet the strategy used to locate theSAMLObjectto operate on.voidsetSecurityParametersContextLookupStrategy(Function<ProfileRequestContext, SecurityParametersContext> strategy) Set the strategy used to locate theSecurityParametersContextassociated with a givenProfileRequestContext.Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doExecute, doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.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 theSecurityParametersContextassociated with a givenProfileRequestContext.- Parameters:
strategy- strategy used to locate theSecurityParametersContextassociated with a givenProfileRequestContext
-
setMessageLookupStrategy
Set the strategy used to locate theSAMLObjectto operate on.- Parameters:
strategy- strategy used to locate theSAMLObjectto 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
EventContextto 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:
doPreExecutein classAbstractProfileAction- Parameters:
profileRequestContext- the current IdP profile request context- Returns:
- true iff execution should proceed
-