changed jdk on 25 springBoot on 3.5.6 and fix code

This commit is contained in:
SlimusMinus
2026-09-30 00:27:10 +03:00
parent 1efb67824f
commit 015b68d96d
19 changed files with 2226 additions and 71 deletions

View File

@@ -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);