Fix auth for recipes search endpoint.

This commit is contained in:
Jesse Brault 2026-01-25 17:52:14 -06:00
parent c088cb2253
commit d61fb97dbb

View File

@ -12,6 +12,7 @@ public class RecipesEndpointAuthConfigurator implements EndpointAuthConfigurator
@Override @Override
public void configure(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) { public void configure(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
registry.requestMatchers(HttpMethod.GET, "/recipes/**").permitAll(); registry.requestMatchers(HttpMethod.GET, "/recipes/**").permitAll();
registry.requestMatchers(HttpMethod.POST, "/recipes").permitAll(); // search
registry.requestMatchers(HttpMethod.POST, "/recipes/**").authenticated(); registry.requestMatchers(HttpMethod.POST, "/recipes/**").authenticated();
registry.requestMatchers(HttpMethod.PUT, "/recipes/**").authenticated(); registry.requestMatchers(HttpMethod.PUT, "/recipes/**").authenticated();
registry.requestMatchers(HttpMethod.DELETE, "/recipes/**").authenticated(); registry.requestMatchers(HttpMethod.DELETE, "/recipes/**").authenticated();