Package net.shibboleth.idp.profile.impl
Class ResolveAttributes
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public final class ResolveAttributes extends AbstractProfileAction
Action that invokes theAttributeResolverfor the current request.- Event:
EventIds.PROCEED_EVENT_ID,IdPEventIds.UNABLE_RESOLVE_ATTRIBS- Postcondition:
- If resolution is successful, an AttributeContext is created with the results.
-
-
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,AttributeContext>attributeContextCreationStrategyStrategy used to locate or create theAttributeContextto populate.private ReloadableService<AttributeResolver>attributeResolverServiceService used to get the resolver used to fetch attributes.private Function<ProfileRequestContext,Collection<String>>attributesLookupStrategyStrategy used to determine the attributes to resolve.private booleancreateResolutionContextWhether to create and populateAttributeResolutionContext.private Function<ProfileRequestContext,String>issuerLookupStrategyStrategy used to locate the identity of the issuer associated with the attribute resolution.private org.slf4j.LoggerlogClass logger.private booleanmaskFailuresWhether to treat resolver errors as equivalent to resolving no attributes.private Function<ProfileRequestContext,String>principalNameLookupStrategyStrategy used to locate the principal name associated with the attribute resolution.private Function<ProfileRequestContext,String>recipientLookupStrategyStrategy used to locate the identity of the recipient associated with the attribute resolution.private Consumer<AttributeResolutionContext>resolutionContextDecoratorHook for adjusting/adding to resolution context.private StringresolutionLabelLabel distinguishing different "types" of attribute resolution for use in resolver.private ReloadableService<AttributeTranscoderRegistry>transcoderRegistryTranscoder registry service object.
-
Constructor Summary
Constructors Constructor Description ResolveAttributes(ReloadableService<AttributeResolver> resolverService)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)private voidpopulateResolutionContext(ProfileRequestContext profileRequestContext, AttributeResolutionContext resolutionContext)Fill in the resolution context data.voidsetAttributeContextCreationStrategy(Function<ProfileRequestContext,AttributeContext> strategy)Set the strategy used to locate or create theAttributeContextto populate.voidsetAttributesLookupStrategy(Function<ProfileRequestContext,Collection<String>> strategy)Set a strategy to use to obtain the names of the attributes to resolve.voidsetAttributesToResolve(Collection<String> attributeIds)Set the attribute IDs to pass into the resolver.voidsetCreateResolutionContext(boolean flag)Set whether to create theAttributeResolutionContextinternally.voidsetIssuerLookupStrategy(Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the issuer for this attribute resolution.voidsetMaskFailures(boolean flag)Set whether to treat resolution failure as equivalent to resolving no attributes.voidsetPrincipalNameLookupStrategy(Function<ProfileRequestContext,String> strategy)Set the strategy used to locate the principal name for this attribute resolution.voidsetRecipientLookupStrategy(Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the recipient for this attribute resolution.voidsetResolutionContextDecorator(Consumer<AttributeResolutionContext> decorator)Set optional hook for decorating or adding to resolution context.voidsetResolutionLabel(String label)Set the optional "contextual" label associated with this attribute resolution.voidsetTranscoderRegistry(ReloadableService<AttributeTranscoderRegistry> registry)Sets the registry of transcoding rules to apply to supply attribute display metadata.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, 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, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
-
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.
-
attributeResolverService
@Nonnull private final ReloadableService<AttributeResolver> attributeResolverService
Service used to get the resolver used to fetch attributes.
-
transcoderRegistry
@NonnullAfterInit private ReloadableService<AttributeTranscoderRegistry> transcoderRegistry
Transcoder registry service object.
-
issuerLookupStrategy
@Nullable private Function<ProfileRequestContext,String> issuerLookupStrategy
Strategy used to locate the identity of the issuer associated with the attribute resolution.
-
recipientLookupStrategy
@Nullable private Function<ProfileRequestContext,String> recipientLookupStrategy
Strategy used to locate the identity of the recipient associated with the attribute resolution.
-
principalNameLookupStrategy
@Nullable private Function<ProfileRequestContext,String> principalNameLookupStrategy
Strategy used to locate the principal name associated with the attribute resolution.
-
attributeContextCreationStrategy
@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextCreationStrategy
Strategy used to locate or create theAttributeContextto populate.
-
attributesLookupStrategy
@Nonnull private Function<ProfileRequestContext,Collection<String>> attributesLookupStrategy
Strategy used to determine the attributes to resolve.
-
resolutionContextDecorator
@Nullable private Consumer<AttributeResolutionContext> resolutionContextDecorator
Hook for adjusting/adding to resolution context.
-
maskFailures
private boolean maskFailures
Whether to treat resolver errors as equivalent to resolving no attributes.
-
resolutionLabel
@Nullable private String resolutionLabel
Label distinguishing different "types" of attribute resolution for use in resolver.
-
createResolutionContext
private boolean createResolutionContext
Whether to create and populateAttributeResolutionContext.
-
-
Constructor Detail
-
ResolveAttributes
public ResolveAttributes(@Nonnull ReloadableService<AttributeResolver> resolverService)Constructor.- Parameters:
resolverService- resolver used to fetch attributes
-
-
Method Detail
-
setTranscoderRegistry
public void setTranscoderRegistry(@Nullable ReloadableService<AttributeTranscoderRegistry> registry)Sets the registry of transcoding rules to apply to supply attribute display metadata.- Parameters:
registry- registry service interface
-
setIssuerLookupStrategy
public void setIssuerLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the issuer for this attribute resolution.- Parameters:
strategy- lookup strategy
-
setRecipientLookupStrategy
public void setRecipientLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)Set the strategy used to lookup the recipient for this attribute resolution.- Parameters:
strategy- lookup strategy
-
setPrincipalNameLookupStrategy
public void setPrincipalNameLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)Set the strategy used to locate the principal name for this attribute resolution.- Parameters:
strategy- lookup strategy
-
setAttributeContextCreationStrategy
public void setAttributeContextCreationStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)Set the strategy used to locate or create theAttributeContextto populate.- Parameters:
strategy- lookup/creation strategy
-
setAttributesLookupStrategy
public void setAttributesLookupStrategy(@Nonnull Function<ProfileRequestContext,Collection<String>> strategy)Set a strategy to use to obtain the names of the attributes to resolve.- Parameters:
strategy- lookup strategy
-
setAttributesToResolve
public void setAttributesToResolve(@Nonnull @NonnullElements Collection<String> attributeIds)
Set the attribute IDs to pass into the resolver.- Parameters:
attributeIds- attribute ID collection
-
setResolutionContextDecorator
public void setResolutionContextDecorator(@Nullable Consumer<AttributeResolutionContext> decorator)Set optional hook for decorating or adding to resolution context.- Parameters:
decorator- decorator hook- Since:
- 4.2.0
-
setMaskFailures
public void setMaskFailures(boolean flag)
Set whether to treat resolution failure as equivalent to resolving no attributes.This matches the behavior of V2.
- Parameters:
flag- flag to set
-
setResolutionLabel
public void setResolutionLabel(@Nullable String label)Set the optional "contextual" label associated with this attribute resolution.- Parameters:
label- label to set- Since:
- 3.4.0
-
setCreateResolutionContext
public void setCreateResolutionContext(boolean flag)
Set whether to create theAttributeResolutionContextinternally.Defaults to 'true', disable to allow external creation of the context.
- Parameters:
flag- flag to set
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
populateResolutionContext
private void populateResolutionContext(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AttributeResolutionContext resolutionContext)Fill in the resolution context data.- Parameters:
profileRequestContext- current profile request contextresolutionContext- context to populate
-
-