Add swagger

This commit is contained in:
2025-12-10 11:04:06 +01:00
parent e5182591b9
commit 650b33111a
4 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
package com.imgfloat.app.config;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class OpenApiConfig {
@Bean
public OpenAPI imgfloatOpenAPI() {
return new OpenAPI()
.info(new Info()
.title("Imgfloat API")
.description("OpenAPI documentation for Imgfloat admin and broadcaster APIs.")
.version("v1"));
}
}

View File

@@ -20,7 +20,16 @@ public class SecurityConfig {
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(auth -> auth
.requestMatchers("/", "/css/**", "/js/**", "/webjars/**", "/actuator/health").permitAll()
.requestMatchers(
"/",
"/css/**",
"/js/**",
"/webjars/**",
"/actuator/health",
"/v3/api-docs/**",
"/swagger-ui.html",
"/swagger-ui/**"
).permitAll()
.requestMatchers("/ws/**").permitAll()
.anyRequest().authenticated()
)