Skip to content

Commit

Permalink
462 git ops (#35)
Browse files Browse the repository at this point in the history
* 🐛 Fixed security

* Spotless

* Unified the request format

* Deleted import

* Changed request matcher

* Using ant matchers

* Using ant matchers
  • Loading branch information
mirrodi authored Apr 15, 2024
1 parent 825f8fc commit 3449dd0
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,20 @@ public class SecurityConfiguration {
public SecurityFilterChain securityFilterChain(final HttpSecurity http) throws Exception {

return http
.authorizeHttpRequests((authorize) -> authorize
.requestMatchers(new AntPathRequestMatcher("/**")).authenticated())
.authorizeHttpRequests((requests) -> requests.requestMatchers(AntPathRequestMatcher.antMatcher("/**"),
// allow access to /actuator/info
AntPathRequestMatcher.antMatcher("/actuator/info"),
// allow access to /actuator/health for OpenShift Health Check
AntPathRequestMatcher.antMatcher("/actuator/health"),
// allow access to /actuator/health/liveness for OpenShift Liveness Check
AntPathRequestMatcher.antMatcher("/actuator/health/liveness"),
// allow access to /actuator/health/readiness for OpenShift Readiness Check
AntPathRequestMatcher.antMatcher("/actuator/health/readiness"),
// allow access to /actuator/metrics for Prometheus monitoring in OpenShift
AntPathRequestMatcher.antMatcher("/actuator/metrics"))
.permitAll())
.authorizeHttpRequests((requests) -> requests.requestMatchers(AntPathRequestMatcher.antMatcher("/**"))
.authenticated())
.oauth2ResourceServer(oauth2 -> oauth2
.jwt(withDefaults()))
.build();
Expand Down

0 comments on commit 3449dd0

Please sign in to comment.