Skip to content

Commit 7a24a12

Browse files
authoredNov 6, 2024··
Merge pull request #73 from TEAM-YOAJUNG/feature/application-swagger-adding-auth-config
[FEAT] Add Swagger Authorization Config
2 parents 2edc0ca + 02ca348 commit 7a24a12

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
 

‎application-service/src/main/java/club/gach_dong/config/SwaggerConfig.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io.swagger.v3.oas.models.Components;
44
import io.swagger.v3.oas.models.OpenAPI;
55
import io.swagger.v3.oas.models.info.Info;
6+
import io.swagger.v3.oas.models.security.SecurityScheme;
67
import io.swagger.v3.oas.models.servers.Server;
78
import org.springframework.beans.factory.annotation.Value;
89
import org.springframework.context.annotation.Bean;
@@ -11,7 +12,9 @@
1112
@Configuration
1213
public class SwaggerConfig {
1314

14-
@Value("${app.gateway.endpoint}") String gatewayEndpoint;
15+
@Value("${app.gateway.endpoint}")
16+
String gatewayEndpoint;
17+
1518
@Bean
1619
public OpenAPI openAPI() {
1720
return new OpenAPI()
@@ -20,6 +23,16 @@ public OpenAPI openAPI() {
2023
.addServersItem(serverItem());
2124
}
2225

26+
private Components component() {
27+
return new Components()
28+
.addSecuritySchemes("Authorization",
29+
new SecurityScheme()
30+
.type(SecurityScheme.Type.HTTP)
31+
.scheme("Bearer")
32+
.bearerFormat("JWT"));
33+
}
34+
35+
2336
private Info apiInfo() {
2437
return new Info()
2538
.title("가츠동 API 명세 - 지원 서비스")

0 commit comments

Comments
 (0)
Please sign in to comment.