Skip to content

Commit

Permalink
test : github 액션 작동해서 자동 배포 테스트1
Browse files Browse the repository at this point in the history
  • Loading branch information
kyumho kim committed Feb 2, 2024
1 parent 92274fe commit d7ba490
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.mysql:mysql-connector-j'
testRuntimeOnly 'com.mysql:mysql-connector-j'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
runtimeOnly 'com.h2database:h2'

// validation
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down
Binary file added db_prod.mv.db
Binary file not shown.
21 changes: 16 additions & 5 deletions src/main/java/com/ll/medium/common/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.web.servlet.handler.HandlerMappingIntrospector;

@Configuration
@EnableWebSecurity
Expand All @@ -27,7 +30,7 @@ public class SecurityConfig {
private final UserDetailsServiceImpl userDetailsService;

@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
public SecurityFilterChain securityFilterChain(HttpSecurity http, HandlerMappingIntrospector introspector) throws Exception {
JwtAuthenticationFilter jwtAuthenticationFilter = new JwtAuthenticationFilter(jwtTokenUtil);
http
.cors(c -> c.configure(http))
Expand All @@ -36,10 +39,18 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
.authorizeHttpRequests(a -> a
.requestMatchers(
"/**",
"/api/v1/member/join", "/api/v1/auth/login", "/api/v1/auth/logout",
"/api/v1/auth/confirm-account", "/api/v1/auth/email-exists", "/api/v1/post/list", "/api/v1/post/detail/**", "api/v1/post/recent", "api/v1/member/exist/**",
"api/v1/email/exist/**"
new MvcRequestMatcher(introspector, "/h2-console/**"),
new AntPathRequestMatcher("/**"),
new AntPathRequestMatcher("/api/v1/member/join"),
new AntPathRequestMatcher("/api/v1/auth/login"),
new AntPathRequestMatcher("/api/v1/auth/logout"),
new AntPathRequestMatcher("/api/v1/auth/confirm-account"),
new AntPathRequestMatcher("/api/v1/auth/email-exists"),
new AntPathRequestMatcher("/api/v1/post/list"),
new AntPathRequestMatcher("/api/v1/post/detail/**"),
new AntPathRequestMatcher("/api/v1/post/recent"),
new AntPathRequestMatcher("/api/v1/member/exist/**"),
new AntPathRequestMatcher("/api/v1/email/exist/**")
).permitAll()
.anyRequest().authenticated()
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ll/medium/common/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000", "https://www.lionshop.me") // Next.js 애플리케이션의 URL
.allowedOrigins("http://localhost:3000", "https://www.llcode.me") // Next.js 애플리케이션의 URL
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH")
.allowedHeaders("X-CSRF-Token", "X-Requested-With", "Accept", "Accept-Version", "Content-Length",
"Content-MD5", "Content-Type", "Date", "X-Api-Version")
Expand Down

0 comments on commit d7ba490

Please sign in to comment.