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
public abstract class AbstractDecryptAction extends AbstractProfileAction
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
SecurityParametersContextgoverning the decryption process is located by a lookup strategy, by default a child of the inbound message context.
-
-
Field Summary
Fields Modifier and Type Field Description private DecrypterdecrypterThe decryption object.private Predicate<Pair<ProfileRequestContext,EncryptedElementType>>decryptionPredicatePredicate determining whether to attempt decryption.private booleanerrorFatalAre decryption failures a fatal condition?private org.slf4j.LoggerlogClass logger.private SAMLObjectmessageMessage to operate on.private Function<ProfileRequestContext,Object>messageLookupStrategyStrategy used to locate the SAML message to operate on.private Function<ProfileRequestContext,SecurityParametersContext>securityParamsLookupStrategyStrategy used to locate theSecurityParametersContext.
-
Constructor Summary
Constructors Constructor Description AbstractDecryptAction()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoPreExecute(ProfileRequestContext profileRequestContext)DecryptergetDecrypter()Get the decrypter.Predicate<Pair<ProfileRequestContext,EncryptedElementType>>getDecryptionPredicate()Get the predicate used to determine whether to attempt decryption.SAMLObjectgetSAMLObject()Get the object to act on.booleanisErrorFatal()Get whether decryption failure should be treated as an error or ignored.voidsetDecryptionPredicate(Predicate<Pair<ProfileRequestContext,EncryptedElementType>> predicate)Set the predicate used to determine whether to attempt decryption.voidsetErrorFatal(boolean flag)Set whether decryption failure should be treated as an error or ignored.voidsetMessageLookupStrategy(Function<ProfileRequestContext,Object> strategy)Set 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, 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 Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
errorFatal
private boolean errorFatal
Are decryption failures a fatal condition?
-
securityParamsLookupStrategy
@Nonnull private Function<ProfileRequestContext,SecurityParametersContext> securityParamsLookupStrategy
Strategy used to locate theSecurityParametersContext.
-
messageLookupStrategy
@Nonnull private Function<ProfileRequestContext,Object> messageLookupStrategy
Strategy used to locate the SAML message to operate on.
-
decryptionPredicate
@Nonnull private Predicate<Pair<ProfileRequestContext,EncryptedElementType>> decryptionPredicate
Predicate determining whether to attempt decryption.
-
decrypter
@Nullable private Decrypter decrypter
The decryption object.
-
message
@Nullable private SAMLObject message
Message to operate on.
-
-
Method Detail
-
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
public void setMessageLookupStrategy(@Nonnull Function<ProfileRequestContext,Object> strategy)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
@Nullable public Decrypter getDecrypter()
Get the decrypter.- Returns:
- the decrypter
-
getSAMLObject
@Nullable public SAMLObject getSAMLObject()
Get the object to act on.- Returns:
- the object to act on
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractProfileAction
-
-