File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
src/main/java/cmf/commitField/global/springDoc Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ dependencies {
3535 testImplementation(" org.springframework.boot:spring-boot-starter-test" )
3636 testImplementation(" org.springframework.security:spring-security-test" )
3737 testRuntimeOnly(" org.junit.platform:junit-platform-launcher" )
38+
3839 // Lombok
3940 compileOnly(" org.projectlombok:lombok" )
4041 annotationProcessor(" org.projectlombok:lombok" )
@@ -55,6 +56,12 @@ dependencies {
5556 // Swagger
5657 implementation(" org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0" )
5758 implementation(" org.java-websocket:Java-WebSocket:1.5.2" )
59+
60+ // JWT
61+ implementation(" io.jsonwebtoken:jjwt-api:0.12.6" )
62+ runtimeOnly(" io.jsonwebtoken:jjwt-impl:0.12.6" )
63+ runtimeOnly(" io.jsonwebtoken:jjwt-jackson:0.12.6" )
64+
5865}
5966
6067tasks.withType<Test > {
Original file line number Diff line number Diff line change 1+ package cmf .commitField .global .springDoc ;
2+
3+ import io .swagger .v3 .oas .models .Components ;
4+ import io .swagger .v3 .oas .models .OpenAPI ;
5+ import io .swagger .v3 .oas .models .info .Info ;
6+ import io .swagger .v3 .oas .models .security .SecurityRequirement ;
7+ import io .swagger .v3 .oas .models .security .SecurityScheme ;
8+ import org .springframework .context .annotation .Bean ;
9+ import org .springframework .context .annotation .Configuration ;
10+
11+ @ Configuration
12+ public class SwaggerConfig {
13+
14+ @ Bean
15+ public OpenAPI customOpenAPI () {
16+ String securitySchemeName = "Authorization" ;
17+ return new OpenAPI ()
18+ .info (new Info ().title ("Commit Field API ๋ช
์ธ์" )
19+ .description ("API ๋ฌธ์" )
20+ .version ("v1.0" ))
21+ .addSecurityItem (new SecurityRequirement ().addList (securitySchemeName ))
22+ .components (new Components ()
23+ .addSecuritySchemes (securitySchemeName ,
24+ new SecurityScheme ()
25+ .name (securitySchemeName )
26+ .type (SecurityScheme .Type .HTTP )
27+ .scheme ("bearer" )
28+ .bearerFormat ("JWT" )));
29+ }
30+ }
You canโt perform that action at this time.
0 commit comments