Skip to content

Commit

Permalink
Experimenting with removing anyRequest()
Browse files Browse the repository at this point in the history
  • Loading branch information
agile-josiah committed Oct 14, 2023
1 parent 699ddef commit 6a0512a
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions app/src/main/java/gov/va/vro/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.HttpStatusEntryPoint;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

@Configuration
@EnableWebSecurity
Expand Down Expand Up @@ -83,23 +82,15 @@ public SecurityFilterChain apikeyFilterChain(HttpSecurity httpSecurity) throws E
.authorizeHttpRequests(
(authz) -> {
authz
.requestMatchers(claimInfo)
.permitAll()
.requestMatchers(claimMetrics)
.permitAll()
.requestMatchers(evidencePdf)
.permitAll()
.requestMatchers(fullHealth)
.permitAll()
.requestMatchers(healthAssessment)
.permitAll()
.requestMatchers(immediatePdf)
.permitAll()
.requestMatchers(ACTUATOR_URLS)
.permitAll()
.requestMatchers(V3_URLS)
.permitAll()
.anyRequest()
.requestMatchers(
claimInfo,
claimMetrics,
evidencePdf,
fullHealth,
healthAssessment,
immediatePdf,
ACTUATOR_URLS,
V3_URLS)
.authenticated();
})
.csrf(AbstractHttpConfigurer::disable)
Expand Down Expand Up @@ -134,15 +125,7 @@ public SecurityFilterChain jwtFilterChain(HttpSecurity httpSecurity) throws Exce
.authorizeHttpRequests(
(authz) ->
authz
.requestMatchers(new AntPathRequestMatcher(automatedClaim))
.permitAll()
.requestMatchers(new AntPathRequestMatcher(examOrder))
.permitAll()
.requestMatchers(new AntPathRequestMatcher(ACTUATOR_URLS))
.permitAll()
.requestMatchers(new AntPathRequestMatcher(V3_URLS))
.permitAll()
.anyRequest()
.requestMatchers(automatedClaim, examOrder, ACTUATOR_URLS, V3_URLS)
.authenticated())
.csrf(AbstractHttpConfigurer::disable)
.sessionManagement(
Expand Down

0 comments on commit 6a0512a

Please sign in to comment.