Skip to content

Commit

Permalink
update firewall
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-DoHa committed Dec 8, 2022
1 parent 14984cb commit 0b18c03
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 0 deletions.
Binary file modified .gradle/7.5.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.5.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.firewall.DefaultHttpFirewall;
import org.springframework.security.web.firewall.HttpFirewall;
import org.springframework.web.filter.CorsFilter;

import javax.servlet.Filter;
Expand Down Expand Up @@ -58,6 +61,11 @@ protected void configure(HttpSecurity http) throws Exception {
http.addFilterBefore(jwtExceptionFilter(), JwtRequestFilter.class);
}

@Override
public void configure(WebSecurity web) throws Exception {
web.httpFirewall(defaultHttpFirewall());
}

@Bean
public JwtExceptionFilter jwtExceptionFilter() {
JwtExceptionFilter jwtExceptionFilter = new JwtExceptionFilter();
Expand All @@ -69,4 +77,9 @@ public JwtRequestFilter jwtRequestFilter() {
JwtRequestFilter jwtRequestFilter = new JwtRequestFilter(memberRepository, jwtService);
return jwtRequestFilter;
}

@Bean
public HttpFirewall defaultHttpFirewall() {
return new DefaultHttpFirewall();
}
}

0 comments on commit 0b18c03

Please sign in to comment.