Repository navigation
Conversation
SingleResultAuthorizationManager, AuthenticatedAuthorizationManager, AllAuthoritiesAuthorizationManager, and the managers returned by AuthorizationManagers#anyOf, #allOf, and #not now describe themselves so that authorization rules are readable in logs. Issue spring-projectsgh-20174 Signed-off-by: 박종현 <fhrmrk@naver.com>
When a DefaultSecurityFilterChain is created, log the chain's request matcher together with the rules of its AuthorizationFilter in a single debug event. RequestMatcherDelegatingAuthorizationManager#toString now lists each request matcher and its AuthorizationManager in the order they are evaluated. Issue spring-projectsgh-20174 Signed-off-by: 박종현 <fhrmrk@naver.com>
This was referenced Dec 1, 2026
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses the first item of gh-20174, "Log the effective authorization rules".
When a
DefaultSecurityFilterChainis created, it now emits one additional debug event that pairs the chain's request matcher with the rules of itsAuthorizationFilter:To make that readable, this PR also adds
toString()to the managers the DSL produces that did not have one:SingleResultAuthorizationManagerAuthenticatedAuthorizationManagerAllAuthoritiesAuthorizationManagerAuthorizationManagers#anyOf,#allOf, and#notRequestMatcherDelegatingAuthorizationManager, which lists its mappings in evaluation orderThe formats follow the existing
AuthorityAuthorizationManager[authorities=...]convention.Notes for review
DefaultSecurityFilterChainrather thanHttpSecurity#performBuild(as I first suggested in the issue) because it already logs "Will secure ... with filters" there, it has both the matcher and the filters, and it needs no new public API. It also covers chains that are not built throughHttpSecurity.toString()additions into a separate PR.ObservationAuthorizationManager), the rules are not visible yet. I left that out to keep this change small.Issue gh-20174