feat : 인그레스 적용을 위한 스웨거 주소 수정
This commit is contained in:
parent
55c5845772
commit
ea25b5a502
@ -31,9 +31,9 @@ public class SecurityConfig {
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
// Swagger 관련 경로 모두 허용
|
||||
.requestMatchers("/swagger-ui.html","/swagger-ui/**", "/swagger-ui.html").permitAll()
|
||||
.requestMatchers("/api-docs/**", "/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/swagger-resources/**", "/webjars/**").permitAll()
|
||||
.requestMatchers("/docs/analytics/swagger-ui.html","/docs/analytics/swagger-ui/**").permitAll()
|
||||
.requestMatchers("/docs/analytics/api-docs/**").permitAll()
|
||||
.requestMatchers("/docs/analytics/swagger-resources/**", "/webjars/**").permitAll()
|
||||
|
||||
// Analytics API 모두 허용 (테스트용)
|
||||
.requestMatchers("/api/analytics/**").permitAll()
|
||||
|
||||
@ -64,8 +64,10 @@ external:
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
enabled: true
|
||||
path: /swagger-ui.html
|
||||
path: /docs/analytics/swagger-ui.html
|
||||
try-it-out-enabled: true
|
||||
api-docs:
|
||||
path: /docs/analytics/api-docs
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
|
||||
@ -43,9 +43,10 @@ public class SecurityConfig {
|
||||
.cors(cors -> cors.configurationSource(corsConfigurationSource))
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(authz -> authz
|
||||
.requestMatchers("/api/auth/**", "/api/members/register", "/api/auth/login").permitAll()
|
||||
.requestMatchers("/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/swagger-resources/**", "/webjars/**").permitAll()
|
||||
.requestMatchers("/api/auth/find-username","/api/auth/find-password", "/api/auth/sms/send", "/api/auth/sms/verify").permitAll()
|
||||
.requestMatchers("/api/members/register", "/api/auth/login").permitAll()
|
||||
.requestMatchers("/docs/member/swagger-ui.html", "/docs/member/swagger-ui/**", "/docs/member/api-docs/**").permitAll()
|
||||
.requestMatchers("/docs/member/swagger-resources/**", "/webjars/**").permitAll()
|
||||
.requestMatchers("/actuator/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
|
||||
@ -46,8 +46,10 @@ sms:
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
enabled: true
|
||||
path: /swagger-ui.html
|
||||
path: /docs/member/swagger-ui.html
|
||||
try-it-out-enabled: true
|
||||
api-docs:
|
||||
path: /docs/member/api-docs
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
|
||||
@ -32,13 +32,13 @@ public class SecurityConfig {
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
// Swagger 관련 경로 모두 허용
|
||||
.requestMatchers("/swagger-ui.html","/swagger-ui/**", "/swagger-ui.html").permitAll()
|
||||
.requestMatchers("/api-docs/**", "/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/swagger-resources/**", "/webjars/**").permitAll()
|
||||
.requestMatchers("/docs/recommend/swagger-ui.html","/docs/recommend/swagger-ui/**").permitAll()
|
||||
.requestMatchers("/docs/recommend/api-docs/**").permitAll()
|
||||
.requestMatchers("/docs/recommend/swagger-resources/**", "/webjars/**").permitAll()
|
||||
|
||||
// Recommend API 모두 허용 (테스트용)
|
||||
.requestMatchers("/api/recommend/**").permitAll()
|
||||
|
||||
// Analytics API 모두 허용 (테스트용)
|
||||
.requestMatchers("/api/analytics/**").permitAll()
|
||||
.requestMatchers("/api/action-plans/**").permitAll()
|
||||
|
||||
// Actuator 엔드포인트 허용
|
||||
.requestMatchers("/actuator/**").permitAll()
|
||||
|
||||
@ -44,8 +44,6 @@ spring:
|
||||
order_updates: true
|
||||
open-in-view: false
|
||||
|
||||
|
||||
|
||||
# Redis 설정 (올바른 구조)
|
||||
data:
|
||||
redis:
|
||||
@ -133,9 +131,9 @@ management:
|
||||
# Swagger/OpenAPI 설정
|
||||
springdoc:
|
||||
api-docs:
|
||||
path: /api-docs
|
||||
path: /docs/recommend/api-docs
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
path: /docs/recommend/swagger-ui.html
|
||||
tags-sorter: alpha
|
||||
operations-sorter: alpha
|
||||
display-request-duration: true
|
||||
|
||||
@ -30,13 +30,12 @@ public class SecurityConfig {
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
// Swagger 관련 경로 모두 허용
|
||||
.requestMatchers("/swagger-ui.html","/swagger-ui/**", "/swagger-ui.html").permitAll()
|
||||
.requestMatchers("/api-docs/**", "/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/swagger-resources/**", "/webjars/**").permitAll()
|
||||
.requestMatchers("/docs/review/swagger-ui.html","/docs/review/swagger-ui/**").permitAll()
|
||||
.requestMatchers("/docs/review/api-docs/**").permitAll()
|
||||
.requestMatchers("/docs/review/swagger-resources/**", "/webjars/**").permitAll()
|
||||
|
||||
// Analytics API 모두 허용 (테스트용)
|
||||
.requestMatchers("/api/analytics/**").permitAll()
|
||||
.requestMatchers("/api/action-plans/**").permitAll()
|
||||
// review API 모두 허용 (테스트용)
|
||||
.requestMatchers("/api/reviews/**").permitAll()
|
||||
|
||||
// Actuator 엔드포인트 허용
|
||||
.requestMatchers("/actuator/**").permitAll()
|
||||
|
||||
@ -37,6 +37,7 @@ file-storage:
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
path: /api-docs
|
||||
path: /docs/review/api-docs
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
enabled: true
|
||||
path: /docs/review/swagger-ui.html
|
||||
|
||||
@ -30,13 +30,12 @@ public class SecurityConfig {
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
// Swagger 관련 경로 모두 허용
|
||||
.requestMatchers("/swagger-ui.html","/swagger-ui/**", "/swagger-ui.html").permitAll()
|
||||
.requestMatchers("/api-docs/**", "/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/swagger-resources/**", "/webjars/**").permitAll()
|
||||
.requestMatchers("/docs/store/swagger-ui.html","/docs/store/swagger-ui/**").permitAll()
|
||||
.requestMatchers("/docs/store/api-docs/**").permitAll()
|
||||
.requestMatchers("/docs/store/swagger-resources/**", "/webjars/**").permitAll()
|
||||
|
||||
// Analytics API 모두 허용 (테스트용)
|
||||
.requestMatchers("/api/analytics/**").permitAll()
|
||||
.requestMatchers("/api/action-plans/**").permitAll()
|
||||
.requestMatchers("/api/external/**").permitAll()
|
||||
|
||||
// Actuator 엔드포인트 허용
|
||||
.requestMatchers("/actuator/**").permitAll()
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package com.ktds.hi.store.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public OpenAPI openAPI() {
|
||||
final String securitySchemeName = "Bearer Authentication";
|
||||
|
||||
return new OpenAPI()
|
||||
.addServersItem(new Server().url("/"))
|
||||
.info(new Info()
|
||||
.title("하이오더 매장 관리 서비스 API")
|
||||
.description("매장, 외부연동관련 API")
|
||||
.version("1.0.0"))
|
||||
.addSecurityItem(new SecurityRequirement()
|
||||
.addList(securitySchemeName))
|
||||
.components(new Components()
|
||||
.addSecuritySchemes(securitySchemeName, new SecurityScheme()
|
||||
.name(securitySchemeName)
|
||||
.type(SecurityScheme.Type.HTTP)
|
||||
.scheme("bearer")
|
||||
.bearerFormat("JWT")));
|
||||
}
|
||||
}
|
||||
@ -43,6 +43,6 @@ external-api:
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
path: /api-docs
|
||||
path: /docs/store/api-docs
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
path: /docs/store/swagger-ui.html
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user