From 55819e05e64e4cc9ed530ed6c275d83798ab6025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=88=ED=99=8D=EC=A0=9C?= Date: Fri, 6 Dec 2024 00:30:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?MATE-98=20:=20[FIX]=20SwaggerConfig=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=ED=8F=AC=ED=8A=B8=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EB=B3=80=EA=B2=BD=20(#88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/mate/common/config/SwaggerConfig.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/mate/common/config/SwaggerConfig.java b/src/main/java/com/example/mate/common/config/SwaggerConfig.java index 66086c60..862b8e76 100644 --- a/src/main/java/com/example/mate/common/config/SwaggerConfig.java +++ b/src/main/java/com/example/mate/common/config/SwaggerConfig.java @@ -1,7 +1,10 @@ package com.example.mate.common.config; +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; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -19,6 +22,15 @@ public OpenAPI openAPI() { return new OpenAPI() .info(info) - .servers(List.of(new Server().url("http://localhost:8000"))); + .servers(List.of(new Server().url("http://localhost:8080"))) + .addSecurityItem(new SecurityRequirement().addList("Bearer Authentication")) + .components(new Components().addSecuritySchemes("Bearer Authentication", createAPIKeyScheme())); + } + + private SecurityScheme createAPIKeyScheme() { + return new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .bearerFormat("JWT") + .scheme("bearer"); } } \ No newline at end of file From 48d024f7c45a869ab827c25a5e87918080c571d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=88=ED=99=8D=EC=A0=9C?= Date: Fri, 6 Dec 2024 00:57:56 +0900 Subject: [PATCH 2/2] =?UTF-8?q?MATE-98=20:=20[FIX]=20Jwt=20=EA=B8=B0?= =?UTF-8?q?=EB=B0=98=20=EC=8B=9C=ED=81=90=EB=A6=AC=ED=8B=B0=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EB=B3=80=EA=B2=BD=20(#89)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - request uri 설정 변경 --- .../com/example/mate/common/security/filter/JwtCheckFilter.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/example/mate/common/security/filter/JwtCheckFilter.java b/src/main/java/com/example/mate/common/security/filter/JwtCheckFilter.java index eb982113..e1b668d5 100644 --- a/src/main/java/com/example/mate/common/security/filter/JwtCheckFilter.java +++ b/src/main/java/com/example/mate/common/security/filter/JwtCheckFilter.java @@ -73,8 +73,6 @@ private boolean isAuthExcludedPath(HttpServletRequest request) { // 소셜 로그인/회원 가입 경로, mate 서비스 로그인/회원 가입 경로 인증 제외 return requestURI.startsWith("/api/auth") || - // 프론트엔드 테스트를 위해 모든 요청 허용 - requestURI.startsWith("/") || requestURI.startsWith("/api/members/join") || requestURI.startsWith("/swagger-ui") || requestURI.startsWith("/api/members/login");