Hello! I want to include health check for my Vaadin 24 application. I have included actuator starter, but how configure VaadinWebSecurity to make it works.
Thanks in advance.
Hello! I want to include health check for my Vaadin 24 application. I have included actuator starter, but how configure VaadinWebSecurity to make it works.
Thanks in advance.
http.authorizeHttpRequests(c → c.requestMatchers(
EndpointRequest.to(HealthEndpoint.class)
).permitAll());
I mean the Spring Boot Actuator https://www.baeldung.com/spring-boot-actuators which running on different port and expose different end points.
If it runs on another port then Vaadin is not involved
It runs on another port, but all requests to /actuator are catched by the Vaadin servlet.
Yes you are right. So my initial answer is then applicable.
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(c -> c.requestMatchers(
new AntPathRequestMatcher("/icons/*.png"),
new AntPathRequestMatcher("/line-awesome/**"),
EndpointRequest.to(HealthEndpoint.class)
).permitAll());
super.configure(http);
setLoginView(http, LoginView.class, LOGOUT_URL);
}
The important line is: EndpointRequest.to(HealthEndpoint.class)
There are predefined *Endpoint classes that you can us.