Add logging to CsrfTokenRequestHandler implementations#16994
Add logging to CsrfTokenRequestHandler implementations#16994jzheaux merged 1 commit intospring-projects:mainfrom
Conversation
There was a problem hiding this comment.
Hi, @yybmion, thanks for the PR! I've left some feedback inline for the servlet code. Will you please apply the same to the reactive code?
Also, I don't see changes to ServerCsrfTokenRequestHandler. Can you add logging changes equivalent to CsrfTokenRequestHandler?
|
Thank you @jzheaux for thorough review and detailed guidance! |
|
Thanks for additional feedback @jzheaux! I updated feedback. |
|
Thanks, @yybmion, this is taking shape nicely. When I run the build ( |
|
@jzheaux I ran "./gradlew :spring-security-web:check" and the build completed successfully. Sorry for the small issues that extended the review process. I've learned a lot from this contribution opportunity and appreciate your patience!" |
Add trace-level logging to show the logical path of CSRF token processing - Log token source (header or parameter) in resolveCsrfTokenValue - Log request attribute names in handle methods - Log failures in XorCsrfTokenRequestAttributeHandler (especially Base64 decoding) - Add similar logging to XorServerCsrfTokenRequestAttributeHandler Improves debugging capabilities without changing functionality. Closes spring-projectsgh-13626 Signed-off-by: yybmion <yunyubin54@gmail.com>
There was a problem hiding this comment.
Nice work, @yybmion! I've squashed your commits and will merge this once the build finishes.
And don't worry at all, it's part of the learning process and you did great. I hope you continue to contribute and we get to learn more together!
Issue
This PR adds trace-level logging to CSRF token handlers to improve debugging capabilities.
Changes
resolveCsrfTokenValuehandlemethodsXorCsrfTokenRequestAttributeHandlerwhen token processing fails (as specifically requested in the issue)XorServerCsrfTokenRequestAttributeHandlerfor consistencyFixes #13626