spring-projects / spring-security

Spring Security
http://spring.io/projects/spring-security
Apache License 2.0
8.55k stars 5.79k forks source link

Add Kotlin support to PreFilter and PostFilter annotations #15095

Closed call-me-baki closed 1 month ago

call-me-baki commented 1 month ago

Closes the following issue:

Summary Adds support for Kotlin in DefaultMethodSecurityExpressionHandler.

It additionally updates the documentation (both javadoc and asciidoc) to reflect the current implementation details and usage.

Implementation details Attempts to mutate the state of either the Collection or the Map:

Tests The original Java test DefaultMethodSecurityExpressionHandlerTests has been left unchanged and acts as a regression test.

A new test DefaultMethodSecurityExpressionHandlerKotlinTests has been added to assert over the correct behavior when using Kotlin instead of Java.

call-me-baki commented 1 month ago

Thank you @jzheaux for the feedback! 🙏🏼

I've addressed the requested changes, would you please have a look again?

Regarding adding myself to JavaDoc's authors, I'm completely fine if we revert that commit should this change not warrant it.

jzheaux commented 1 month ago

Thanks for the updates, @call-me-baki! In preparation for merging, will you please do the following:

  1. Run ./gradlew format && ./gradlew :spring-security-core:check and make any changes the output requires
  2. Squash your commits into one
  3. Ensure your commit message is brief and also contains Closes gh-15093, for example:
Add Kotlin support for Pre-PostFilter Annotations

Closes gh-15093
call-me-baki commented 1 month ago

Hey @jzheaux! Thanks for your support and guidance.

I ran ./gradlew format && ./gradlew :spring-security-core:check, there wasn't anything actionable. The commits have been squashed and I hope that the commit message is fitting.

Looking forward to contributing to Spring Security in the future!

jzheaux commented 1 month ago

Thanks again, @call-me-baki! This is now merged into main and will go out in the next milestone release. I also added a slight polish in aa9bf83c6d0be0c40e868e085dfd8e809afa4e91 to clarify variable names and align logging levels.