Search in sources :

Example 6 with DefaultAuditActionResolver

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());
}
Also used : ServiceResourceResolver(org.apereo.cas.audit.spi.ServiceResourceResolver) DefaultAuditActionResolver(org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver) AuditActionResolver(org.apereo.inspektr.audit.spi.AuditActionResolver) DefaultAuditActionResolver(org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver) NullableReturnValueAuditResourceResolver(org.apereo.cas.audit.spi.NullableReturnValueAuditResourceResolver) ServiceAccessEnforcementAuditResourceResolver(org.apereo.cas.audit.spi.ServiceAccessEnforcementAuditResourceResolver) AuditResourceResolver(org.apereo.inspektr.audit.spi.AuditResourceResolver) CredentialsAsFirstParameterResourceResolver(org.apereo.cas.audit.spi.CredentialsAsFirstParameterResourceResolver)

Example 7 with DefaultAuditActionResolver

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());
}
Also used : AccessTokenGrantRequestAuditResourceResolver(org.apereo.cas.support.oauth.web.audit.AccessTokenGrantRequestAuditResourceResolver) DefaultAuditActionResolver(org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver) OAuth20UserProfileDataAuditResourceResolver(org.apereo.cas.support.oauth.web.audit.OAuth20UserProfileDataAuditResourceResolver)

Example 8 with DefaultAuditActionResolver

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());
}
Also used : lombok.val(lombok.val) SpringWebflowActionExecutionAuditablePrincipalResolver(org.apereo.inspektr.audit.spi.support.SpringWebflowActionExecutionAuditablePrincipalResolver) ReturnValueAsStringResourceResolver(org.apereo.inspektr.audit.spi.support.ReturnValueAsStringResourceResolver) DefaultAuditActionResolver(org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver) Test(org.junit.jupiter.api.Test)

Aggregations

DefaultAuditActionResolver (org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver)8 AuditActionResolver (org.apereo.inspektr.audit.spi.AuditActionResolver)3 HashMap (java.util.HashMap)1 lombok.val (lombok.val)1 CredentialsAsFirstParameterResourceResolver (org.apereo.cas.audit.spi.CredentialsAsFirstParameterResourceResolver)1 NullableReturnValueAuditResourceResolver (org.apereo.cas.audit.spi.NullableReturnValueAuditResourceResolver)1 ServiceAccessEnforcementAuditResourceResolver (org.apereo.cas.audit.spi.ServiceAccessEnforcementAuditResourceResolver)1 ServiceResourceResolver (org.apereo.cas.audit.spi.ServiceResourceResolver)1 RestResponseEntityAuditResourceResolver (org.apereo.cas.rest.audit.RestResponseEntityAuditResourceResolver)1 AccessTokenGrantRequestAuditResourceResolver (org.apereo.cas.support.oauth.web.audit.AccessTokenGrantRequestAuditResourceResolver)1 OAuth20UserProfileDataAuditResourceResolver (org.apereo.cas.support.oauth.web.audit.OAuth20UserProfileDataAuditResourceResolver)1 SamlRequestAuditResourceResolver (org.apereo.cas.support.saml.web.idp.audit.SamlRequestAuditResourceResolver)1 SamlResponseAuditResourceResolver (org.apereo.cas.support.saml.web.idp.audit.SamlResponseAuditResourceResolver)1 AuditResourceResolver (org.apereo.inspektr.audit.spi.AuditResourceResolver)1 ReturnValueAsStringResourceResolver (org.apereo.inspektr.audit.spi.support.ReturnValueAsStringResourceResolver)1 SpringWebflowActionExecutionAuditablePrincipalResolver (org.apereo.inspektr.audit.spi.support.SpringWebflowActionExecutionAuditablePrincipalResolver)1 Test (org.junit.jupiter.api.Test)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)1 Bean (org.springframework.context.annotation.Bean)1