Class PopulateEncryptionParameters
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- net.shibboleth.idp.profile.AbstractProfileAction
-
- net.shibboleth.idp.saml.saml2.profile.impl.PopulateEncryptionParameters
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class PopulateEncryptionParameters extends AbstractProfileAction
Action that resolves and populatesEncryptionParameterson anEncryptionContextcreated/accessed via a lookup function, by default on aRelyingPartyContextchild of the profile request context.The resolution process is contingent on the active profile configuration requesting encryption of some kind, and an
EncryptionContextis also created to capture these requirements.The OpenSAML default, per-RelyingParty, and default per-profile
EncryptionConfigurationobjects are input to the resolution process, along with the relying party's SAML metadata, which in most cases will be the source of the eventual encryption key.
-
-
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,List<EncryptionConfiguration>>configurationLookupStrategyStrategy used to look up a per-requestEncryptionConfigurationlist.private EncryptionParametersResolverencParamsresolverResolver for parameters to store into context.private booleanencryptAssertionsFlag tracking whether assertion encryption is required.private booleanencryptAttributesFlag tracking whether assertion encryption is required.private booleanencryptIdentifiersFlag tracking whether assertion encryption is required.private List<EncryptionConfiguration>encryptionConfigurationsActive configurations to feed into resolver.private Function<ProfileRequestContext,EncryptionContext>encryptionContextLookupStrategyStrategy used to look up theEncryptionContextto store parameters in.private booleanencryptionOptionalIs encryption optional in the case no parameters can be resolved?private org.slf4j.LoggerlogClass logger.private Function<ProfileRequestContext,SAMLPeerEntityContext>peerContextLookupStrategyStrategy used to look up a SAML peer context.private QNamepeerRoleMetadata role type to provide to resolver.private Function<ProfileRequestContext,RelyingPartyContext>relyingPartyContextLookupStrategyStrategy used to look up aRelyingPartyContextfor configuration options.private StringsamlProtocolMetadata protocolSupportEnumeration value to provide to resolver.
-
Constructor Summary
Constructors Constructor Description PopulateEncryptionParameters()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private CriteriaSetbuildCriteriaSet(ProfileRequestContext profileRequestContext)Build the criteria used as input to theEncryptionParametersResolver.protected voiddoExecute(ProfileRequestContext profileRequestContext)protected voiddoInitialize()protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetConfigurationLookupStrategy(Function<ProfileRequestContext,List<EncryptionConfiguration>> strategy)Set the strategy used to look up a per-requestEncryptionConfigurationlist.voidsetEncryptionContextLookupStrategy(Function<ProfileRequestContext,EncryptionContext> strategy)Set the strategy used to look up theEncryptionContextto set the flags for.voidsetEncryptionParametersResolver(EncryptionParametersResolver newResolver)Set the encParamsresolver to use for the parameters to store into the context.voidsetPeerContextLookupStrategy(Function<ProfileRequestContext,SAMLPeerEntityContext> strategy)Set lookup strategy forSAMLPeerEntityContextfor input to resolution.voidsetProtocol(String protocol)Set the protocol constant to use during resolution.voidsetRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)Set the strategy used to return theRelyingPartyContextfor configuration options.voidsetRole(QName role)Set the operational role to use during resolution.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, 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.
-
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
Strategy used to look up aRelyingPartyContextfor configuration options.
-
encryptionContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,EncryptionContext> encryptionContextLookupStrategy
Strategy used to look up theEncryptionContextto store parameters in.
-
peerContextLookupStrategy
@Nullable private Function<ProfileRequestContext,SAMLPeerEntityContext> peerContextLookupStrategy
Strategy used to look up a SAML peer context.
-
samlProtocol
@Nullable private String samlProtocol
Metadata protocolSupportEnumeration value to provide to resolver.
-
peerRole
@Nullable private QName peerRole
Metadata role type to provide to resolver.
-
configurationLookupStrategy
@NonnullAfterInit private Function<ProfileRequestContext,List<EncryptionConfiguration>> configurationLookupStrategy
Strategy used to look up a per-requestEncryptionConfigurationlist.
-
encParamsresolver
@NonnullAfterInit private EncryptionParametersResolver encParamsresolver
Resolver for parameters to store into context.
-
encryptionConfigurations
@Nullable @NonnullElements private List<EncryptionConfiguration> encryptionConfigurations
Active configurations to feed into resolver.
-
encryptionOptional
private boolean encryptionOptional
Is encryption optional in the case no parameters can be resolved?
-
encryptAssertions
private boolean encryptAssertions
Flag tracking whether assertion encryption is required.
-
encryptIdentifiers
private boolean encryptIdentifiers
Flag tracking whether assertion encryption is required.
-
encryptAttributes
private boolean encryptAttributes
Flag tracking whether assertion encryption is required.
-
-
Method Detail
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)Set the strategy used to return theRelyingPartyContextfor configuration options.- Parameters:
strategy- lookup strategy
-
setEncryptionContextLookupStrategy
public void setEncryptionContextLookupStrategy(@Nonnull Function<ProfileRequestContext,EncryptionContext> strategy)Set the strategy used to look up theEncryptionContextto set the flags for.- Parameters:
strategy- lookup strategy
-
setProtocol
public void setProtocol(@Nullable String protocol)Set the protocol constant to use during resolution.- Parameters:
protocol- the protocol constant to set
-
setRole
public void setRole(@Nullable QName role)Set the operational role to use during resolution.- Parameters:
role- the operational role to set
-
setConfigurationLookupStrategy
public void setConfigurationLookupStrategy(@Nonnull Function<ProfileRequestContext,List<EncryptionConfiguration>> strategy)Set the strategy used to look up a per-requestEncryptionConfigurationlist.- Parameters:
strategy- lookup strategy
-
setPeerContextLookupStrategy
public void setPeerContextLookupStrategy(@Nullable Function<ProfileRequestContext,SAMLPeerEntityContext> strategy)Set lookup strategy forSAMLPeerEntityContextfor input to resolution.- Parameters:
strategy- lookup strategy
-
setEncryptionParametersResolver
public void setEncryptionParametersResolver(@Nonnull EncryptionParametersResolver newResolver)Set the encParamsresolver to use for the parameters to store into the context.- Parameters:
newResolver- encParamsresolver to use
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
buildCriteriaSet
@Nonnull private CriteriaSet buildCriteriaSet(@Nonnull ProfileRequestContext profileRequestContext)
Build the criteria used as input to theEncryptionParametersResolver.- Parameters:
profileRequestContext- current profile request context- Returns:
- the criteria set to use
-
-