From d3af6f4ec251a406018cd8a99e32751c9b711c13 Mon Sep 17 00:00:00 2001 From: yb__char Date: Wed, 11 Dec 2024 23:39:41 +0900 Subject: [PATCH 1/2] fix: swagger version --- build.gradle | 8 +++++++- .../global/config/security/WebSecurityConfig.java | 4 ++-- .../global/config/swagger/SwaggerConfig.java | 13 +++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 7a945fb98..3e3e25973 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.h2database:h2' runtimeOnly 'com.mysql:mysql-connector-j' @@ -79,6 +79,12 @@ dependencies { testAnnotationProcessor 'org.projectlombok:lombok' } +dependencyManagement { + imports { + mavenBom "org.springframework.boot:spring-boot-dependencies:3.4.0" + } +} + tasks.named('bootBuildImage') { builder = 'paketobuildpacks/builder-jammy-base:latest' } diff --git a/src/main/java/com/depromeet/global/config/security/WebSecurityConfig.java b/src/main/java/com/depromeet/global/config/security/WebSecurityConfig.java index 266311680..62a893b1f 100644 --- a/src/main/java/com/depromeet/global/config/security/WebSecurityConfig.java +++ b/src/main/java/com/depromeet/global/config/security/WebSecurityConfig.java @@ -72,14 +72,14 @@ public PasswordEncoder passwordEncoder() { @Bean @Order(1) - @ConditionalOnProfile({DEV, LOCAL}) + @ConditionalOnProfile({PROD, DEV, LOCAL}) public SecurityFilterChain swaggerFilterChain(HttpSecurity http) throws Exception { defaultFilterChain(http); http.securityMatcher(getSwaggerUrls()).httpBasic(withDefaults()); http.authorizeHttpRequests( - springEnvironmentUtil.isDevProfile() + (springEnvironmentUtil.isDevProfile() || springEnvironmentUtil.isProdProfile()) ? authorize -> authorize.anyRequest().authenticated() : authorize -> authorize.anyRequest().permitAll()); diff --git a/src/main/java/com/depromeet/global/config/swagger/SwaggerConfig.java b/src/main/java/com/depromeet/global/config/swagger/SwaggerConfig.java index 1dff23cee..880296942 100644 --- a/src/main/java/com/depromeet/global/config/swagger/SwaggerConfig.java +++ b/src/main/java/com/depromeet/global/config/swagger/SwaggerConfig.java @@ -49,14 +49,11 @@ private List swaggerServers() { } private String getServerUrl() { - switch (springEnvironmentUtil.getCurrentProfile()) { - case "prod": - return UrlConstants.PROD_SERVER_URL.getValue(); - case "dev": - return UrlConstants.DEV_SERVER_URL.getValue(); - default: - return UrlConstants.LOCAL_SERVER_URL.getValue(); - } + return switch (springEnvironmentUtil.getCurrentProfile()) { + case "prod" -> UrlConstants.PROD_SERVER_URL.getValue(); + case "dev" -> UrlConstants.DEV_SERVER_URL.getValue(); + default -> UrlConstants.LOCAL_SERVER_URL.getValue(); + }; } private Components authSetting() { From 3191ae6dcaeffdb0e250c0edefcdae14e94fb85a Mon Sep 17 00:00:00 2001 From: yb__char Date: Wed, 11 Dec 2024 23:46:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20dependencyManagement=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle b/build.gradle index 3e3e25973..91f7686cf 100644 --- a/build.gradle +++ b/build.gradle @@ -79,12 +79,6 @@ dependencies { testAnnotationProcessor 'org.projectlombok:lombok' } -dependencyManagement { - imports { - mavenBom "org.springframework.boot:spring-boot-dependencies:3.4.0" - } -} - tasks.named('bootBuildImage') { builder = 'paketobuildpacks/builder-jammy-base:latest' }