use of org.apereo.inspektr.audit.spi.AuditResourceResolver in project cas by apereo.
the class CasCoreAuditConfiguration method nullableReturnValueResourceResolver.
@Bean
public AuditResourceResolver nullableReturnValueResourceResolver() {
return new AuditResourceResolver() {
@Override
public String[] resolveFrom(final JoinPoint joinPoint, final Object o) {
if (o == null) {
return new String[0];
}
if (o instanceof Event) {
final Event event = Event.class.cast(o);
final String sourceName = event.getSource().getClass().getSimpleName();
final String result = new ToStringBuilder(event, ToStringStyle.NO_CLASS_NAME_STYLE).append("event", event.getId()).append("timestamp", new Date(event.getTimestamp())).append("source", sourceName).toString();
return new String[] { result };
}
return returnValueResourceResolver().resolveFrom(joinPoint, o);
}
@Override
public String[] resolveFrom(final JoinPoint joinPoint, final Exception e) {
return returnValueResourceResolver().resolveFrom(joinPoint, e);
}
};
}
use of org.apereo.inspektr.audit.spi.AuditResourceResolver 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;
}
Aggregations