У нас есть следующий код настройки безопасности:
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity.cors().and().csrf().disable().authorizeRequests().antMatchers("/api/**").anyRequest()
.authenticated().and().exceptionHandling().accessDeniedPage("/").and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
}
GET /api/users
POST /api/users
GET /api/users/{userId}
Нам нужно ограничить запросы ниже (не для всех запросов) в приложении Spring Boot и разрешить эти запросы только для указанных ipaddress (multiple ipaddress)
в свойствах.