-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### List of available actuator endpoints | ||
GET {{host}}/actuator | ||
Accept: application/json | ||
Authorization: Bearer {{$auth.token("frontend")}} | ||
|
||
### Healthcheck endpoint (public) | ||
GET {{host}}/actuator/health | ||
Accept: application/json | ||
|
||
### List of loggers and their settings | ||
GET {{host}}/actuator/loggers | ||
Accept: application/json | ||
Authorization: Bearer {{$auth.token("frontend")}} | ||
|
25 changes: 25 additions & 0 deletions
25
backend/src/main/java/club/klabis/config/security/ActuatorSecurity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package club.klabis.config.security; | ||
|
||
import club.klabis.config.authserver.AuthorizationServerConfiguration; | ||
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; | ||
import org.springframework.security.web.SecurityFilterChain; | ||
|
||
@Configuration | ||
public class ActuatorSecurity { | ||
@Bean("actuatorSecurityFilterChain") | ||
@Order(value = AuthorizationServerConfiguration.BEFORE_AUTH_SERVER_SECURITY_ORDER) | ||
public SecurityFilterChain errorPageFilterChain(HttpSecurity http) throws Exception { | ||
http.securityMatcher(EndpointRequest.to("health")) | ||
.csrf(AbstractHttpConfigurer::disable) | ||
.authorizeHttpRequests( | ||
c -> c.anyRequest().permitAll() | ||
); | ||
|
||
return http.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters