|
|
|
|
@ -15,14 +15,14 @@ import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
public class OpenAPIConfig {
|
|
|
|
|
private final Environment environment;
|
|
|
|
|
|
|
|
|
|
private static final String SECURITY_SCHEME_ACCESS = "cuuva-jwt-cookie";
|
|
|
|
|
private static final String SECURITY_SCHEME_REFRESH = "cuuva-jwt-refresh-cookie";
|
|
|
|
|
|
|
|
|
|
private static final String SECURITY_SCHEME_NAME = "bezkoder-jwt-cookie";
|
|
|
|
|
private static final String PRODUCTION_SERVER_URL = "http://cuuva.com:2480/autoflow";
|
|
|
|
|
private static final String LOCAL_SERVER_URL = "http://localhost:80";
|
|
|
|
|
|
|
|
|
|
@ -36,16 +36,25 @@ public class OpenAPIConfig {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Components createComponents() {
|
|
|
|
|
return new Components().addSecuritySchemes(SECURITY_SCHEME_NAME,
|
|
|
|
|
return new Components()
|
|
|
|
|
.addSecuritySchemes(SECURITY_SCHEME_ACCESS,
|
|
|
|
|
new SecurityScheme()
|
|
|
|
|
.name("bezkoder-jwt") // 쿠키 이름
|
|
|
|
|
.name("cuuva-jwt") // 액세스 토큰 쿠키 이름
|
|
|
|
|
.type(SecurityScheme.Type.APIKEY)
|
|
|
|
|
.in(SecurityScheme.In.COOKIE)
|
|
|
|
|
)
|
|
|
|
|
.addSecuritySchemes(SECURITY_SCHEME_REFRESH,
|
|
|
|
|
new SecurityScheme()
|
|
|
|
|
.name("cuuva-jwt-refresh") // 리프레시 토큰 쿠키 이름
|
|
|
|
|
.type(SecurityScheme.Type.APIKEY)
|
|
|
|
|
.in(SecurityScheme.In.COOKIE)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SecurityRequirement createSecurityRequirement() {
|
|
|
|
|
return new SecurityRequirement().addList(SECURITY_SCHEME_NAME);
|
|
|
|
|
return new SecurityRequirement()
|
|
|
|
|
.addList(SECURITY_SCHEME_ACCESS)
|
|
|
|
|
.addList(SECURITY_SCHEME_REFRESH);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Info createApiInfo() {
|
|
|
|
|
@ -83,5 +92,4 @@ public class OpenAPIConfig {
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|