Class RevocationCacheCondition
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.authn.revocation.impl.RevocationCacheCondition
-
- All Implemented Interfaces:
BiPredicate<ProfileRequestContext,AuthenticationResult>,Component,DestructableComponent,InitializableComponent
public class RevocationCacheCondition extends AbstractInitializableComponent implements BiPredicate<ProfileRequestContext,AuthenticationResult>
A condition for login flows that checks for revocation against aRevocationCache.- Since:
- 4.3.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringADDRESS_REVOCATION_PREFIXPrefix of keys for address-based revocation.private NonnullSupplier<javax.servlet.http.HttpServletRequest>httpServletRequestSupplierServlet request Supplier.private org.slf4j.LoggerlogClass logger.static StringPRINCIPAL_REVOCATION_PREFIXPrefix of keys for principal-based revocation.private Function<ProfileRequestContext,String>principalNameLookupStrategyLookup strategy for principal name.static StringREVOCATION_CONTEXTRevocation context.private RevocationCacherevocationCacheCache to use.
-
Constructor Summary
Constructors Constructor Description RevocationCacheCondition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()protected booleanisRevoked(String principal, AuthenticationResult result, Collection<String> revocationRecords)Check the revocation records' timestamps for applicability.voidsetHttpServletRequestSupplier(NonnullSupplier<javax.servlet.http.HttpServletRequest> supplier)SetHttpServletRequestin order to obtain client address.voidsetPrincipalNameLookupStrategy(Function<ProfileRequestContext,String> strategy)Set lookup strategy for principal name.voidsetRevocationCache(RevocationCache cache)SetRevocationCacheto use.booleantest(ProfileRequestContext input, AuthenticationResult input2)-
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 java.util.function.BiPredicate
and, negate, or
-
-
-
-
Field Detail
-
REVOCATION_CONTEXT
@Nonnull @NotEmpty public static final String REVOCATION_CONTEXT
Revocation context.- See Also:
- Constant Field Values
-
PRINCIPAL_REVOCATION_PREFIX
@Nonnull @NotEmpty public static final String PRINCIPAL_REVOCATION_PREFIX
Prefix of keys for principal-based revocation.- See Also:
- Constant Field Values
-
ADDRESS_REVOCATION_PREFIX
@Nonnull @NotEmpty public static final String ADDRESS_REVOCATION_PREFIX
Prefix of keys for address-based revocation.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
revocationCache
@NonnullAfterInit private RevocationCache revocationCache
Cache to use.
-
principalNameLookupStrategy
@NonnullAfterInit private Function<ProfileRequestContext,String> principalNameLookupStrategy
Lookup strategy for principal name.
-
httpServletRequestSupplier
@Nullable private NonnullSupplier<javax.servlet.http.HttpServletRequest> httpServletRequestSupplier
Servlet request Supplier.
-
-
Method Detail
-
setRevocationCache
public void setRevocationCache(@Nonnull RevocationCache cache)SetRevocationCacheto use.- Parameters:
cache- cache to use
-
setPrincipalNameLookupStrategy
public void setPrincipalNameLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)Set lookup strategy for principal name.- Parameters:
strategy- lookup strategy
-
setHttpServletRequestSupplier
public void setHttpServletRequestSupplier(@Nullable NonnullSupplier<javax.servlet.http.HttpServletRequest> supplier)SetHttpServletRequestin order to obtain client address.- Parameters:
supplier- servlet request interface
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
test
public boolean test(@Nullable ProfileRequestContext input, @Nullable AuthenticationResult input2)- Specified by:
testin interfaceBiPredicate<ProfileRequestContext,AuthenticationResult>
-
isRevoked
protected boolean isRevoked(@Nonnull @NotEmpty String principal, @Nonnull AuthenticationResult result, @Nonnull @NonnullElements Collection<String> revocationRecords)
Check the revocation records' timestamps for applicability.- Parameters:
principal- name of principalresult- active result being checkedrevocationRecords- the records from the cache- Returns:
- true iff the revocation applies to this result
-
-