Skip to content

Commit

Permalink
MATE-95 : [REFACTOR] 깃 병합
Browse files Browse the repository at this point in the history
  • Loading branch information
juchan204 committed Dec 5, 2024
2 parents 40e6c59 + 48d024f commit 0393331
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/main/java/com/example/mate/common/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 0393331

Please sign in to comment.