mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Add swagger
This commit is contained in:
19
src/main/java/com/imgfloat/app/config/OpenApiConfig.java
Normal file
19
src/main/java/com/imgfloat/app/config/OpenApiConfig.java
Normal 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"));
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user