Package net.shibboleth.idp.authn
Class AbstractSubjectCanonicalizationAction
- 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.authn.AbstractSubjectCanonicalizationAction
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
- Direct Known Subclasses:
AttributeSourcedSubjectCanonicalization,LegacyCanonicalization,NameIDCanonicalization,NameIdentifierCanonicalization,PopulateSubjectCanonicalizationContext,SelectSubjectCanonicalizationFlow,SimpleSubjectCanonicalization,X500SubjectCanonicalization
public abstract class AbstractSubjectCanonicalizationAction extends AbstractProfileAction
A base class for subject canonicalization actions. In addition to the work performed byAbstractProfileAction, this action also looks up and makes available theSubjectCanonicalizationContext. Authentication action implementations should overridedoExecute(ProfileRequestContext, SubjectCanonicalizationContext)
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private booleanlowercaseConvert to lowercase prior to transforms?private SubjectCanonicalizationContextscContextSubjectCanonicalizationContextto operate on.private Function<ProfileRequestContext,SubjectCanonicalizationContext>scCtxLookupStrategyStrategy used to find theSubjectCanonicalizationContextfrom theProfileRequestContext.private List<Pair<Pattern,String>>transformsMatch patterns and replacement strings to apply.private booleantrimTrim prior to transforms?private booleanuppercaseConvert to uppercase prior to transforms?
-
Constructor Summary
Constructors Constructor Description AbstractSubjectCanonicalizationAction()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringapplyTransforms(String input)Apply any configured regular expression replacements to an input value and return the result.protected voiddoExecute(ProfileRequestContext profileRequestContext)protected voiddoExecute(ProfileRequestContext profileRequestContext, SubjectCanonicalizationContext c14nContext)Performs this authentication action.protected booleandoPreExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext, SubjectCanonicalizationContext c14nContext)Performs this c14n action's pre-execute step.voidsetLookupStrategy(Function<ProfileRequestContext,SubjectCanonicalizationContext> strategy)Set the context lookup strategy.voidsetLowercase(boolean flag)Controls conversion to lowercase prior to applying any transforms.voidsetTransforms(Collection<Pair<String,String>> newTransforms)A collection of regular expression and replacement pairs.voidsetTrim(boolean flag)Controls whitespace trimming prior to applying any transforms.voidsetUppercase(boolean flag)Controls conversion to uppercase prior to applying any transforms.-
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.
-
scCtxLookupStrategy
@Nonnull private Function<ProfileRequestContext,SubjectCanonicalizationContext> scCtxLookupStrategy
Strategy used to find theSubjectCanonicalizationContextfrom theProfileRequestContext.
-
scContext
@Nullable private SubjectCanonicalizationContext scContext
SubjectCanonicalizationContextto operate on.
-
transforms
@Nonnull @NonnullElements private List<Pair<Pattern,String>> transforms
Match patterns and replacement strings to apply.
-
uppercase
private boolean uppercase
Convert to uppercase prior to transforms?
-
lowercase
private boolean lowercase
Convert to lowercase prior to transforms?
-
trim
private boolean trim
Trim prior to transforms?
-
-
Method Detail
-
setLookupStrategy
public void setLookupStrategy(@Nonnull Function<ProfileRequestContext,SubjectCanonicalizationContext> strategy)Set the context lookup strategy.- Parameters:
strategy- lookup strategy function forSubjectCanonicalizationContext.
-
setTransforms
public void setTransforms(@Nullable @NonnullElements Collection<Pair<String,String>> newTransforms)
A collection of regular expression and replacement pairs.- Parameters:
newTransforms- collection of replacement transforms
-
setUppercase
public void setUppercase(boolean flag)
Controls conversion to uppercase prior to applying any transforms.- Parameters:
flag- uppercase flag
-
setLowercase
public void setLowercase(boolean flag)
Controls conversion to lowercase prior to applying any transforms.- Parameters:
flag- lowercase flag
-
setTrim
public void setTrim(boolean flag)
Controls whitespace trimming prior to applying any transforms.- Parameters:
flag- trim flag
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull SubjectCanonicalizationContext c14nContext)Performs this c14n action's pre-execute step. Default implementation just returns true iff a subject is set.- Parameters:
profileRequestContext- the current IdP profile request contextc14nContext- the current subject canonicalization context- Returns:
- true iff execution should continue
-
doExecute
protected final void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull SubjectCanonicalizationContext c14nContext)Performs this authentication action. Default implementation throws an exception.- Parameters:
profileRequestContext- the current IdP profile request contextc14nContext- the current subject canonicalization context
-
-