Search in sources :

Example 1 with InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter

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

the class CasJdbcThrottlingConfiguration method authenticationThrottle.

@Autowired
@Bean
@RefreshScope
public ThrottledSubmissionHandlerInterceptor authenticationThrottle(@Qualifier("auditTrailManager") final AuditTrailManager auditTrailManager) {
    final ThrottleProperties throttle = casProperties.getAuthn().getThrottle();
    final String appcode = throttle.getAppcode();
    final String sqlQueryAudit = throttle.getJdbc().getAuditQuery();
    final ThrottleProperties.Failure failure = throttle.getFailure();
    return new InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter(failure.getThreshold(), failure.getRangeSeconds(), throttle.getUsernameParameter(), auditTrailManager, inspektrAuditTrailDataSource(), appcode, sqlQueryAudit, failure.getCode());
}
Also used : InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter(org.apereo.cas.web.support.InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter) 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 InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter (org.apereo.cas.web.support.InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapter)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