Class AbstractWebAuthnAuditingAction<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnAction<T>
net.shibboleth.idp.plugin.authn.webauthn.audit.impl.AbstractWebAuthnAuditingAction<T>
- Type Parameters:
T- the WebAuthn context type
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
- Direct Known Subclasses:
AdminDeletePublicKeyCredential,DeletePublicKeyCredential,StorePublicKeyCredential,UpdateCredentialNickname
A base class for actions that include audit logging support.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,AuditContext> Strategy used to locate or create theAuditContextto populate.private BiConsumer<ProfileRequestContext,String> A hook to be executed during a failure audit even.private BiConsumer<ProfileRequestContext,String> A hook to be executed during a success audit even.private PopulateAuditContextOptional audit extraction action.private RequestContextThe Spring RequestContext to operate on.private WriteAuditLogOptional audit output action. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWebAuthnAuditingAction(Function<ProfileRequestContext, T> defaultStrategy) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidauditFailure(ProfileRequestContext profileRequestContext, String action) Audit a failed operation.protected voidauditSuccess(ProfileRequestContext profileRequestContext, String action) Audit a successful operation.protected voiddoAudit(ProfileRequestContext profileRequestContext, boolean success, String action) Do audit extraction and output.protected EventdoExecute(RequestContext springRequestContext, ProfileRequestContext profileRequestContext) protected AuditContextgetAuditContext(ProfileRequestContext profileRequestContext) Create or locate theAuditContextvia the defined strategy.getAuditFields(ProfileRequestContext profileRequestContext) Subclasses can override this method to supply additional audit fields to store.voidSet the strategy used to locate theAuditContextassociated with a givenProfileRequestContext.voidSet a hook to run on a failure audit event.voidSet a hook to run on a success audit event.voidSets an audit context population action to run.voidsetWriteAuditLogAction(WriteAuditLog action) Sets an audit output action to run.Methods inherited from class net.shibboleth.idp.plugin.authn.webauthn.impl.AbstractWebAuthnAction
doExecute, doExecute, doInitialize, doPreExecute, doPreExecute, enhancedCredentialRecord, getAaguidMetadata, getAaguidService, getAuthenticatorMetadata, getCredentialRepository, getFidoMetadataService, getWebAuthnClient, setAaguidService, setCredentialRepository, setFidoMetadataService, setWebAuthnClient, setWebAuthnContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
auditContextCreationStrategy
Strategy used to locate or create theAuditContextto populate. -
populateAuditContextAction
Optional audit extraction action. -
writeAuditLogAction
Optional audit output action. -
requestContext
The Spring RequestContext to operate on. -
onSuccessAuditHook
A hook to be executed during a success audit even. -
onFailureAuditHook
A hook to be executed during a failure audit even.
-
-
Constructor Details
-
AbstractWebAuthnAuditingAction
protected AbstractWebAuthnAuditingAction(@Nonnull Function<ProfileRequestContext, T> defaultStrategy) Constructor.- Parameters:
defaultStrategy- the default audit context lookup strategy
-
-
Method Details
-
setAuditContextCreationStrategy
public void setAuditContextCreationStrategy(@Nonnull Function<ProfileRequestContext, AuditContext> strategy) Set the strategy used to locate theAuditContextassociated with a givenProfileRequestContext.- Parameters:
strategy- lookup strategy
-
setPopulateAuditContextAction
Sets an audit context population action to run.- Parameters:
action- optional action to use to populate audit context
-
setWriteAuditLogAction
Sets an audit output action to run.- Parameters:
action- optional action to use to write to audit log
-
getAuditContext
@Nullable protected AuditContext getAuditContext(@Nonnull ProfileRequestContext profileRequestContext) Create or locate theAuditContextvia the defined strategy.- Parameters:
profileRequestContext- profile request context- Returns:
- the audit context
-
setOnFailureAuditHook
Set a hook to run on a failure audit event.- Parameters:
hook- the hook to set.- Since:
- 1.3.0
-
setOnSuccessAuditHook
Set a hook to run on a success audit event.- Parameters:
hook- the hook to set.- Since:
- 1.3.0
-
doExecute
protected Event doExecute(@Nonnull RequestContext springRequestContext, @Nonnull ProfileRequestContext profileRequestContext) - Overrides:
doExecutein classAbstractProfileAction
-
auditSuccess
protected void auditSuccess(@Nonnull ProfileRequestContext profileRequestContext, @Nullable String action) Audit a successful operation. This will automatically add a 'success' field to the audit context. TheonSuccessAuditHookis run before audit logging.- Parameters:
profileRequestContext- the profile request contextaction- a descriptive string of the action that was performed. Can benullif not used.
-
auditFailure
protected void auditFailure(@Nonnull ProfileRequestContext profileRequestContext, @Nullable String action) Audit a failed operation. This will automatically add a 'failure' field to the audit context. TheonFailureAuditHookis run before audit logging.- Parameters:
profileRequestContext- the profile request contextaction- a descriptive string of the action that was performed. Can benullif not used.
-
doAudit
protected void doAudit(@Nonnull ProfileRequestContext profileRequestContext, boolean success, @Nullable String action) Do audit extraction and output.- Parameters:
profileRequestContext- profile request contextsuccess- true iff this is an audit of successful action, false otherwiseaction- the type of action that was performed
-
getAuditFields
@Nullable @Unmodifiable @NotLive protected Map<String,String> getAuditFields(@Nonnull ProfileRequestContext profileRequestContext) Subclasses can override this method to supply additional audit fields to store.- Parameters:
profileRequestContext- profile request context- Returns:
- audit fields
-