I would like to authorize http request or not, using a RestController class.
So far I only know the matchers like AntPathMatcher, but they are all based on string-based patterns.
I would like to reuse the already existing RequestMappings.
E.g instead of
HttpSecurity http
http.authorizeHttpRequests(
authorizeHttpRequests -> authorizeHttpRequests.requestMatchers( "/api/public/my-path" ).permitAll() );
This would be nice
HttpSecurity http
http.authorizeHttpRequests(
authorizeHttpRequests -> authorizeHttpRequests.requestMatchers( MyPublicRestController.class ).permitAll() );
For the acutator project here is something available, what is really nice
final AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizedUrl authorizedUrl = auth.requestMatchers(
EndpointRequest.to( InfoEndpoint.class, HealthEndpoint.class ) )
.permitAll()
Is this possible?
4