make actuator optional

This commit is contained in:
anhefti 2023-12-20 12:19:53 +01:00
parent ea94adf29b
commit b837163c79

View file

@ -92,7 +92,7 @@ public class WebServiceSecurityConfig extends WebSecurityConfigurerAdapter {
private String adminAPIEndpoint; private String adminAPIEndpoint;
@Value("${sebserver.webservice.api.exam.endpoint}") @Value("${sebserver.webservice.api.exam.endpoint}")
private String examAPIEndpoint; private String examAPIEndpoint;
@Value("${management.endpoints.web.base-path}") @Value("${management.endpoints.web.base-path:NONE}")
private String actuatorEndpoint; private String actuatorEndpoint;
@Value("${sebserver.webservice.http.redirect.gui}") @Value("${sebserver.webservice.http.redirect.gui}")
private String unauthorizedRedirect; private String unauthorizedRedirect;
@ -181,6 +181,10 @@ public class WebServiceSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean @Bean
protected ResourceServerConfiguration sebServerActuatorResources() throws Exception { protected ResourceServerConfiguration sebServerActuatorResources() throws Exception {
if ("NONE".equals(this.actuatorEndpoint)) {
return null;
}
return new ActuatorResourceServerConfiguration( return new ActuatorResourceServerConfiguration(
this.tokenStore, this.tokenStore,
this.webServiceClientDetails, this.webServiceClientDetails,