Search in sources :

Example 1 with ServiceResourceResolver

use of org.apereo.cas.audit.spi.ServiceResourceResolver in project cas by apereo.

the class CasCoreAuditConfiguration method auditResourceResolverMap.

@Bean
public Map<String, AuditResourceResolver> auditResourceResolverMap() {
    final Map<String, AuditResourceResolver> map = new HashMap<>();
    map.put("AUTHENTICATION_RESOURCE_RESOLVER", new CredentialsAsFirstParameterResourceResolver());
    map.put("CREATE_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER", this.messageBundleAwareResourceResolver());
    map.put("CREATE_PROXY_GRANTING_TICKET_RESOURCE_RESOLVER", this.messageBundleAwareResourceResolver());
    map.put("DESTROY_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER", this.ticketResourceResolver());
    map.put("DESTROY_PROXY_GRANTING_TICKET_RESOURCE_RESOLVER", this.ticketResourceResolver());
    map.put("GRANT_SERVICE_TICKET_RESOURCE_RESOLVER", new ServiceResourceResolver());
    map.put("GRANT_PROXY_TICKET_RESOURCE_RESOLVER", new ServiceResourceResolver());
    map.put("VALIDATE_SERVICE_TICKET_RESOURCE_RESOLVER", this.ticketResourceResolver());
    map.put("SAVE_SERVICE_RESOURCE_RESOLVER", returnValueResourceResolver());
    map.put("CHANGE_PASSWORD_RESOURCE_RESOLVER", returnValueResourceResolver());
    map.put("TRUSTED_AUTHENTICATION_RESOURCE_RESOLVER", returnValueResourceResolver());
    map.put("ADAPTIVE_RISKY_AUTHENTICATION_RESOURCE_RESOLVER", returnValueResourceResolver());
    map.put("AUTHENTICATION_EVENT_RESOURCE_RESOLVER", nullableReturnValueResourceResolver());
    return map;
}
Also used : ServiceResourceResolver(org.apereo.cas.audit.spi.ServiceResourceResolver) HashMap(java.util.HashMap) AuditResourceResolver(org.apereo.inspektr.audit.spi.AuditResourceResolver) CredentialsAsFirstParameterResourceResolver(org.apereo.cas.audit.spi.CredentialsAsFirstParameterResourceResolver) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with ServiceResourceResolver

use of org.apereo.cas.audit.spi.ServiceResourceResolver 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)

Aggregations

CredentialsAsFirstParameterResourceResolver (org.apereo.cas.audit.spi.CredentialsAsFirstParameterResourceResolver)2 ServiceResourceResolver (org.apereo.cas.audit.spi.ServiceResourceResolver)2 AuditResourceResolver (org.apereo.inspektr.audit.spi.AuditResourceResolver)2 HashMap (java.util.HashMap)1 NullableReturnValueAuditResourceResolver (org.apereo.cas.audit.spi.NullableReturnValueAuditResourceResolver)1 ServiceAccessEnforcementAuditResourceResolver (org.apereo.cas.audit.spi.ServiceAccessEnforcementAuditResourceResolver)1 AuditActionResolver (org.apereo.inspektr.audit.spi.AuditActionResolver)1 DefaultAuditActionResolver (org.apereo.inspektr.audit.spi.support.DefaultAuditActionResolver)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)1 Bean (org.springframework.context.annotation.Bean)1