Last active
December 29, 2024 06:17
-
-
Save sandipchitale/f30b624d05bdbc5cd221116eec1ef0a2 to your computer and use it in GitHub Desktop.
RequestMatcher for all Actuator paths #actuator
This file contains hidden or 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
management: | |
endpoints: | |
enabled-by-default: true | |
web: | |
exposure: | |
# Enable all | |
include: "*" | |
# Change from default /actuator to /mamamia | |
base-path: "/mamamia" |
This file contains hidden or 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
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest; | |
httpSecurity | |
.authorizeHttpRequests(auth -> { | |
auth.requestMatchers(EndpointRequest.toAnyEndpoint()).permitAll(); | |
auth.anyRequest().fullyAuthenticated(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment