Search in sources :

Example 1 with JdbcThrottledSubmissionHandlerInterceptorAdapter

use of org.apereo.cas.web.support.JdbcThrottledSubmissionHandlerInterceptorAdapter in project cas by apereo.

the class CasJdbcThrottlingConfiguration method authenticationThrottle.

@Autowired
@Bean
@RefreshScope
public ThrottledSubmissionHandlerInterceptor authenticationThrottle(@Qualifier("auditTrailExecutionPlan") final AuditTrailExecutionPlan auditTrailManager) {
    final ThrottleProperties throttle = casProperties.getAuthn().getThrottle();
    final ThrottleProperties.Failure failure = throttle.getFailure();
    return new JdbcThrottledSubmissionHandlerInterceptorAdapter(failure.getThreshold(), failure.getRangeSeconds(), throttle.getUsernameParameter(), auditTrailManager, inspektrAuditTrailDataSource(), throttle.getAppcode(), throttle.getJdbc().getAuditQuery(), failure.getCode());
}
Also used : JdbcThrottledSubmissionHandlerInterceptorAdapter(org.apereo.cas.web.support.JdbcThrottledSubmissionHandlerInterceptorAdapter) ThrottleProperties(org.apereo.cas.configuration.model.support.throttle.ThrottleProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Aggregations

ThrottleProperties (org.apereo.cas.configuration.model.support.throttle.ThrottleProperties)1 JdbcThrottledSubmissionHandlerInterceptorAdapter (org.apereo.cas.web.support.JdbcThrottledSubmissionHandlerInterceptorAdapter)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1