Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Oct 14, 2023
1 parent cf73a1c commit bcaa905
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.header.writers.XXssProtectionHeaderWriter.HeaderValue;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

import ch.xxx.moviemanager.usecase.service.JwtTokenService;

Expand All @@ -41,8 +42,8 @@ public SecurityConfig(JwtTokenService jwtTokenService) {
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
JwtTokenFilter customFilter = new JwtTokenFilter(jwtTokenService);
HttpSecurity httpSecurity = http
.authorizeHttpRequests(authorize -> authorize.requestMatchers("/rest/auth/**").permitAll()
.requestMatchers("/rest/**").authenticated().requestMatchers("/**").permitAll())
.authorizeHttpRequests(authorize -> authorize.requestMatchers(AntPathRequestMatcher.antMatcher("/rest/auth/**")).permitAll()
.requestMatchers(AntPathRequestMatcher.antMatcher("/rest/**")).authenticated().requestMatchers(AntPathRequestMatcher.antMatcher("/**")).permitAll())
.csrf(myCsrf -> myCsrf.disable())
.sessionManagement(mySm -> mySm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.headers(myHeaders -> myHeaders.xssProtection(myXss -> myXss.headerValue(HeaderValue.ENABLED)))
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.1</version>
<version>3.1.4</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand Down

0 comments on commit bcaa905

Please sign in to comment.