Skip to content

Commit

Permalink
♻️ refactor: binding POST request urls related to item in WebSecurity…
Browse files Browse the repository at this point in the history
…Config
  • Loading branch information
siyeonSon committed Jul 10, 2023
1 parent abe9f34 commit 6548548
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;

import static org.springframework.http.HttpMethod.POST;

@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
Expand All @@ -31,11 +29,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.and().csrf().disable()
.authorizeHttpRequests()
.requestMatchers("/users/*").authenticated()
.requestMatchers(HttpMethod.POST, "/items").authenticated()
.requestMatchers(HttpMethod.POST, "/items/*").authenticated()
.requestMatchers(HttpMethod.PATCH, "/items/*").authenticated()
.requestMatchers(HttpMethod.DELETE, "/items/*").authenticated()
.requestMatchers("/items/*/likes", "/items/*/unlikes").authenticated()
.requestMatchers(POST, "items/claim").authenticated()
.anyRequest().permitAll().and()
.anonymous().and()
.formLogin().disable()
Expand Down

0 comments on commit 6548548

Please sign in to comment.