Я хотел бы спросить, возможно ли вообще фильтровать по v1/library/**/shelf
Мой фактический вызов будет выглядеть примерно так: v1/library/213/shelf
. 213 будет как номер комнаты.
@Configuration
@EnableWebSecurity
public class SpringSecurityWebAppConfig extends WebSecurityConfigurerAdapter {
@Autowired
public JwtAuthenticationFilter jwtAuthenticationFilter;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.exceptionHandling()
.authenticationEntryPoint(new CustomAuthenticationEntryPoint())
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.addFilterAfter(jwtAuthenticationFilter, BasicAuthenticationFilter.class)
.authorizeRequests()
.antMatchers(HttpMethod.POST, "/v1/library/**/shelf").access("hasRole('ROLE_READER')")
.and()
.headers()
.httpStrictTransportSecurity()
.includeSubDomains(true).maxAgeInSeconds(31536000);
}
}