changed jdk on 25 springBoot on 3.5.6 and fix code
This commit is contained in:
@@ -49,7 +49,6 @@ public class SecurityConfig {
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
// публичные эндпоинты
|
||||
.requestMatchers("/api/v1/auth/**").permitAll()
|
||||
.requestMatchers("/api/v1/test/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/v1/files/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/v1/ads-media/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/v1/posts/**").permitAll()
|
||||
@@ -74,9 +73,13 @@ public class SecurityConfig {
|
||||
.requestMatchers(HttpMethod.POST, "/api/ads/click").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/fullscreen-ad").permitAll()
|
||||
|
||||
// пример разграничения по ролям — раскомментировать и адаптировать под свои admin-эндпоинты
|
||||
// пример разграничения по ролям
|
||||
.requestMatchers("/api/v1/admin/**").hasRole("ADMIN")
|
||||
|
||||
// служебные endpoints: только для администратора
|
||||
// (в методах стоит @PreAuthorize, здесь — первый рубеж)
|
||||
.requestMatchers("/api/v1/test/**").hasRole("ADMIN")
|
||||
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
|
||||
Reference in New Issue
Block a user