Skip to content

Commit a4624af

Browse files
authored
v2.9.2
v2.9.2
2 parents 75ec239 + 25223cb commit a4624af

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

main/src/main/java/org/sopt/makers/crew/main/global/config/SecurityConfig.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.sopt.makers.crew.main.global.config;
22

3+
import java.util.List;
34
import java.util.stream.Stream;
45

56
import org.sopt.makers.crew.main.global.security.filter.JwtAuthenticationExceptionFilter;
@@ -15,6 +16,9 @@
1516
import org.springframework.security.web.SecurityFilterChain;
1617
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
1718
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
19+
import org.springframework.web.cors.CorsConfiguration;
20+
import org.springframework.web.cors.CorsConfigurationSource;
21+
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
1822

1923
import lombok.RequiredArgsConstructor;
2024

@@ -74,4 +78,26 @@ SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
7478
.addFilterBefore(jwtAuthenticationExceptionFilter, JwtAuthenticationFilter.class);
7579
return http.build();
7680
}
81+
82+
@Bean
83+
CorsConfigurationSource corsConfigurationSource() {
84+
CorsConfiguration configuration = new CorsConfiguration();
85+
configuration.setAllowCredentials(false);
86+
87+
configuration.setAllowedOrigins(List.of(
88+
"https://playground.sopt.org",
89+
"http://localhost:3000",
90+
"https://sopt-internal-dev.pages.dev",
91+
"https://crew.api.dev.sopt.org",
92+
"https://crew.api.prod.sopt.org"
93+
));
94+
95+
configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
96+
configuration.setAllowedHeaders(List.of("*"));
97+
98+
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
99+
source.registerCorsConfiguration("/**", configuration);
100+
101+
return source;
102+
}
77103
}

main/src/main/java/org/sopt/makers/crew/main/global/config/WebMvcConfig.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import org.sopt.makers.crew.main.global.resolver.AuthenticatedUserIdArgumentResolver;
66
import org.springframework.context.annotation.Configuration;
77
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
8-
import org.springframework.web.servlet.config.annotation.CorsRegistry;
98
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
109

1110
import lombok.RequiredArgsConstructor;
@@ -20,19 +19,4 @@ public class WebMvcConfig implements WebMvcConfigurer {
2019
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
2120
resolvers.add(authenticatedUserIdArgumentResolver);
2221
}
23-
24-
@Override
25-
public void addCorsMappings(CorsRegistry registry) {
26-
registry.addMapping("/**")
27-
.allowedOrigins(
28-
"https://playground.sopt.org",
29-
"http://localhost:3000",
30-
"https://sopt-internal-dev.pages.dev",
31-
"https://crew.api.dev.sopt.org",
32-
"https://crew.api.prod.sopt.org"
33-
)
34-
.allowedMethods("GET", "POST", "PATCH", "DELETE", "PUT", "OPTIONS")
35-
.allowedHeaders("*")
36-
.allowCredentials(true);
37-
}
3822
}

main/src/main/resources/application-dev.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spring:
88
import: application-secret.properties
99
datasource:
1010
driver-class-name: org.postgresql.Driver
11-
jdbc-url: jdbc:postgresql://${DEV_DB_HOST}:${DEV_DB_PORT}/${DEV_DB_NAME}?currentSchema=${DEV_DB_SCHEMA}
11+
jdbc-url: jdbc:postgresql://${DEV_DB_HOST}:${DEV_DB_PORT}/${DEV_DB_NAME}?currentSchema=${DEV_DB_V2_SCHEMA}
1212
username: ${DEV_DB_USERNAME}
1313
password: ${DEV_DB_PASSWORD}
1414
playground-datasource:
@@ -32,11 +32,6 @@ spring:
3232
caffeine:
3333
spec: maximumSize=500,expireAfterWrite=24h
3434

35-
#jwt:
36-
# header: Authorization
37-
# secret: ${DEV_JWT_SECRET}
38-
# access-token:
39-
# expire-length: ${DEV_ACCESS_TOKEN_EXPIRED_TIME} # 10분
4035

4136
aws-property:
4237
aws-region: ${AWS_REGION}

main/src/main/resources/application-prod.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ spring:
3131
caffeine:
3232
spec: maximumSize=500,expireAfterWrite=24h
3333

34-
#jwt:
35-
# header: Authorization
36-
# secret: ${PROD_JWT_SECRET}
37-
# access-token:
38-
# expire-length: ${ACCESS_TOKEN_EXPIRED_TIME} # 10분
3934

4035
jwt:
4136
jwk:

main/src/test/java/org/sopt/makers/crew/main/meeting/v2/service/MeetingV2ConcurrencyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void applyMeetingWithLock_WhenMultipleRequestsFromSameUser_ShouldProcessOnlyOne(
139139

140140
readyLatch.await();
141141

142-
Thread.sleep(1000);
142+
Thread.sleep(5000);
143143

144144
startLatch.countDown();
145145
boolean completedInTime = finishLatch.await(10, TimeUnit.SECONDS);

0 commit comments

Comments
 (0)