Search in sources :

Example 1 with ActuatorEndpointProperties

use of org.apereo.cas.configuration.model.core.monitor.ActuatorEndpointProperties in project cas by apereo.

the class CasWebSecurityConfigurerAdapter method configureEndpointAccessByIpAddress.

private void configureEndpointAccessByIpAddress(final ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry requests, final ActuatorEndpointProperties properties, final EndpointRequest.EndpointRequestMatcher endpoint) {
    val addresses = properties.getRequiredIpAddresses().stream().map(address -> "hasIpAddress('" + address + "')").collect(Collectors.joining(" or "));
    requests.requestMatchers(endpoint).access(addresses);
}
Also used : lombok.val(lombok.val) CasConfigurationProperties(org.apereo.cas.configuration.CasConfigurationProperties) JaasSecurityActuatorEndpointsMonitorProperties(org.apereo.cas.configuration.model.core.monitor.JaasSecurityActuatorEndpointsMonitorProperties) EndpointLdapAuthenticationProvider(org.apereo.cas.web.security.authentication.EndpointLdapAuthenticationProvider) SneakyThrows(lombok.SneakyThrows) RequiredArgsConstructor(lombok.RequiredArgsConstructor) ArrayUtils(org.apache.commons.lang3.ArrayUtils) HttpSecurity(org.springframework.security.config.annotation.web.builders.HttpSecurity) StringUtils(org.apache.commons.lang3.StringUtils) BeanSupplier(org.apereo.cas.util.spring.beans.BeanSupplier) WebSecurityConfigurerAdapter(org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter) ObjectProvider(org.springframework.beans.factory.ObjectProvider) AuthenticationManagerBuilder(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder) ProtocolEndpointWebSecurityConfigurer(org.apereo.cas.web.ProtocolEndpointWebSecurityConfigurer) JaasAuthenticationProvider(org.springframework.security.authentication.jaas.JaasAuthenticationProvider) SecurityExpressionHandler(org.springframework.security.access.expression.SecurityExpressionHandler) SecurityProperties(org.springframework.boot.autoconfigure.security.SecurityProperties) Order(org.springframework.core.annotation.Order) PathRequest(org.springframework.boot.autoconfigure.security.servlet.PathRequest) Unchecked(org.jooq.lambda.Unchecked) ExpressionUrlAuthorizationConfigurer(org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer) lombok.val(lombok.val) EndpointRequest(org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest) Collectors(java.util.stream.Collectors) LdapSecurityActuatorEndpointsMonitorProperties(org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) CasWebSecurityConstants(org.apereo.cas.web.CasWebSecurityConstants) ActuatorEndpointProperties(org.apereo.cas.configuration.model.core.monitor.ActuatorEndpointProperties) DisposableBean(org.springframework.beans.factory.DisposableBean) FilterInvocation(org.springframework.security.web.FilterInvocation) PathMappedEndpoints(org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints) LdapUtils(org.apereo.cas.util.LdapUtils)

Aggregations

List (java.util.List)1 Collectors (java.util.stream.Collectors)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 SneakyThrows (lombok.SneakyThrows)1 Slf4j (lombok.extern.slf4j.Slf4j)1 lombok.val (lombok.val)1 ArrayUtils (org.apache.commons.lang3.ArrayUtils)1 StringUtils (org.apache.commons.lang3.StringUtils)1 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)1 ActuatorEndpointProperties (org.apereo.cas.configuration.model.core.monitor.ActuatorEndpointProperties)1 JaasSecurityActuatorEndpointsMonitorProperties (org.apereo.cas.configuration.model.core.monitor.JaasSecurityActuatorEndpointsMonitorProperties)1 LdapSecurityActuatorEndpointsMonitorProperties (org.apereo.cas.configuration.model.core.monitor.LdapSecurityActuatorEndpointsMonitorProperties)1 LdapUtils (org.apereo.cas.util.LdapUtils)1 BeanSupplier (org.apereo.cas.util.spring.beans.BeanSupplier)1 CasWebSecurityConstants (org.apereo.cas.web.CasWebSecurityConstants)1 ProtocolEndpointWebSecurityConfigurer (org.apereo.cas.web.ProtocolEndpointWebSecurityConfigurer)1 EndpointLdapAuthenticationProvider (org.apereo.cas.web.security.authentication.EndpointLdapAuthenticationProvider)1 Unchecked (org.jooq.lambda.Unchecked)1 DisposableBean (org.springframework.beans.factory.DisposableBean)1 ObjectProvider (org.springframework.beans.factory.ObjectProvider)1