use of org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver in project cas by apereo.
the class CasCoreAuditConfiguration method configureAuditTrailRecordResolutionPlan.
@Override
public void configureAuditTrailRecordResolutionPlan(final AuditTrailRecordResolutionPlan plan) {
/*
Add audit action resolvers here.
*/
final AuditActionResolver resolver = authenticationActionResolver();
plan.registerAuditActionResolver("AUTHENTICATION_RESOLVER", resolver);
plan.registerAuditActionResolver("SAVE_SERVICE_ACTION_RESOLVER", resolver);
final AuditActionResolver defResolver = new DefaultAuditActionResolver();
plan.registerAuditActionResolver("DESTROY_TICKET_GRANTING_TICKET_RESOLVER", defResolver);
plan.registerAuditActionResolver("DESTROY_PROXY_GRANTING_TICKET_RESOLVER", defResolver);
final AuditActionResolver cResolver = ticketCreationActionResolver();
plan.registerAuditActionResolver("CREATE_PROXY_GRANTING_TICKET_RESOLVER", cResolver);
plan.registerAuditActionResolver("GRANT_SERVICE_TICKET_RESOLVER", cResolver);
plan.registerAuditActionResolver("GRANT_PROXY_TICKET_RESOLVER", cResolver);
plan.registerAuditActionResolver("CREATE_TICKET_GRANTING_TICKET_RESOLVER", cResolver);
final AuditActionResolver authResolver = new DefaultAuditActionResolver("_TRIGGERED", StringUtils.EMPTY);
plan.registerAuditActionResolver("AUTHENTICATION_EVENT_ACTION_RESOLVER", authResolver);
plan.registerAuditActionResolver("VALIDATE_SERVICE_TICKET_RESOLVER", ticketValidationActionResolver());
final AuditActionResolver serviceAccessResolver = new DefaultAuditActionResolver("_TRIGGERED", StringUtils.EMPTY);
plan.registerAuditActionResolver("SERVICE_ACCESS_ENFORCEMENT_ACTION_RESOLVER", serviceAccessResolver);
/*
Add audit resource resolvers here.
*/
plan.registerAuditResourceResolver("AUTHENTICATION_RESOURCE_RESOLVER", new CredentialsAsFirstParameterResourceResolver());
final AuditResourceResolver messageBundleAwareResourceResolver = messageBundleAwareResourceResolver();
plan.registerAuditResourceResolver("CREATE_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER", messageBundleAwareResourceResolver);
plan.registerAuditResourceResolver("CREATE_PROXY_GRANTING_TICKET_RESOURCE_RESOLVER", messageBundleAwareResourceResolver);
final AuditResourceResolver ticketResourceResolver = ticketResourceResolver();
plan.registerAuditResourceResolver("DESTROY_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER", ticketResourceResolver);
plan.registerAuditResourceResolver("DESTROY_PROXY_GRANTING_TICKET_RESOURCE_RESOLVER", ticketResourceResolver);
plan.registerAuditResourceResolver("GRANT_SERVICE_TICKET_RESOURCE_RESOLVER", new ServiceResourceResolver());
plan.registerAuditResourceResolver("GRANT_PROXY_TICKET_RESOURCE_RESOLVER", new ServiceResourceResolver());
plan.registerAuditResourceResolver("VALIDATE_SERVICE_TICKET_RESOURCE_RESOLVER", ticketValidationResourceResolver());
plan.registerAuditResourceResolver("SAVE_SERVICE_RESOURCE_RESOLVER", returnValueResourceResolver());
plan.registerAuditResourceResolver("AUTHENTICATION_EVENT_RESOURCE_RESOLVER", nullableReturnValueResourceResolver());
plan.registerAuditResourceResolver("SERVICE_ACCESS_ENFORCEMENT_RESOURCE_RESOLVER", serviceAccessEnforcementAuditResourceResolver());
/*
Add custom resolvers here.
*/
plan.registerAuditActionResolvers(customAuditActionResolverMap());
plan.registerAuditResourceResolvers(customAuditResourceResolverMap());
}
use of org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver in project cas by apereo.
the class CasOAuthConfiguration method configureAuditTrailRecordResolutionPlan.
@Override
public void configureAuditTrailRecordResolutionPlan(final AuditTrailRecordResolutionPlan plan) {
plan.registerAuditActionResolver("OAUTH2_USER_PROFILE_DATA_ACTION_RESOLVER", new DefaultAuditActionResolver("_CREATED", "_FAILED"));
plan.registerAuditResourceResolver("OAUTH2_USER_PROFILE_DATA_RESOURCE_RESOLVER", new OAuth20UserProfileDataAuditResourceResolver());
plan.registerAuditActionResolver("OAUTH2_ACCESS_TOKEN_REQUEST_ACTION_RESOLVER", new DefaultAuditActionResolver("_CREATED", "_FAILED"));
plan.registerAuditResourceResolver("OAUTH2_ACCESS_TOKEN_REQUEST_RESOURCE_RESOLVER", new AccessTokenGrantRequestAuditResourceResolver());
}
use of org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver in project cas by apereo.
the class DefaultAuditTrailRecordResolutionPlanTests method verifyOperation.
@Test
public void verifyOperation() {
val plan = new DefaultAuditTrailRecordResolutionPlan();
plan.registerAuditActionResolver("action", new DefaultAuditActionResolver());
plan.registerAuditResourceResolver("resource", new ReturnValueAsStringResourceResolver());
plan.registerAuditPrincipalResolver("principal", new SpringWebflowActionExecutionAuditablePrincipalResolver("key"));
assertFalse(plan.getAuditActionResolvers().isEmpty());
assertFalse(plan.getAuditPrincipalResolvers().isEmpty());
assertFalse(plan.getAuditActionResolvers().isEmpty());
}
Aggregations