Search in sources :

Example 1 with EndpointHandlerMappingCustomizer

use of org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMappingCustomizer in project spring-boot by spring-projects.

the class EndpointWebMvcManagementContextConfiguration method endpointHandlerMapping.

@Bean
@ConditionalOnMissingBean
public EndpointHandlerMapping endpointHandlerMapping() {
    Set<MvcEndpoint> endpoints = mvcEndpoints().getEndpoints();
    CorsConfiguration corsConfiguration = getCorsConfiguration(this.corsProperties);
    EndpointHandlerMapping mapping = new EndpointHandlerMapping(endpoints, corsConfiguration);
    mapping.setPrefix(this.managementServerProperties.getContextPath());
    MvcEndpointSecurityInterceptor securityInterceptor = new MvcEndpointSecurityInterceptor(this.managementServerProperties.getSecurity().isEnabled(), this.managementServerProperties.getSecurity().getRoles());
    mapping.setSecurityInterceptor(securityInterceptor);
    for (EndpointHandlerMappingCustomizer customizer : this.mappingCustomizers) {
        customizer.customize(mapping);
    }
    return mapping;
}
Also used : EnvironmentMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint) HeapdumpMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint) LogFileMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.LogFileMvcEndpoint) LoggersMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint) ShutdownMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.ShutdownMvcEndpoint) AuditEventsMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint) MetricsMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint) HealthMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint) MvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint) EndpointHandlerMappingCustomizer(org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMappingCustomizer) CorsConfiguration(org.springframework.web.cors.CorsConfiguration) MvcEndpointSecurityInterceptor(org.springframework.boot.actuate.endpoint.mvc.MvcEndpointSecurityInterceptor) EndpointHandlerMapping(org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

AuditEventsMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint)1 EndpointHandlerMapping (org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping)1 EndpointHandlerMappingCustomizer (org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMappingCustomizer)1 EnvironmentMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint)1 HealthMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint)1 HeapdumpMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint)1 LogFileMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.LogFileMvcEndpoint)1 LoggersMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint)1 MetricsMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint)1 MvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint)1 MvcEndpointSecurityInterceptor (org.springframework.boot.actuate.endpoint.mvc.MvcEndpointSecurityInterceptor)1 ShutdownMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.ShutdownMvcEndpoint)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1 CorsConfiguration (org.springframework.web.cors.CorsConfiguration)1