Add reactive logout handler support - #2194
Open
sdelamo wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Micronaut Security with a reactive logout extension point and controller, while also adding an opt-in configuration to make role comparisons case-insensitive across authorization checks.
Changes:
- Introduce
ReactiveLogoutHandler<I, O>and aReactiveLogoutControllerthat is selected when a reactive handler bean exists (with precedence over the synchronous handler). - Add
micronaut.security.roles-case-sensitiveconfiguration, wiring it intoDefaultRolesFinderto support case-insensitive role matching when disabled. - Add/adjust documentation and tests covering reactive logout behavior and the new roles-case-sensitivity configuration.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/docs/guide/securityConfiguration.adoc | Documents the new roles-case-sensitive configuration option. |
| src/main/docs/guide/endpoints/logout/logoutHandler.adoc | Documents ReactiveLogoutHandler usage and precedence. |
| src/main/docs/guide/endpoints/logout.adoc | Updates logout endpoint docs for reactive handler support and behavior. |
| security/src/main/java/io/micronaut/security/handlers/ReactiveLogoutHandler.java | Adds new reactive logout handler public API. |
| security/src/main/java/io/micronaut/security/endpoints/ReactiveLogoutController.java | Adds reactive /logout controller that delegates to ReactiveLogoutHandler. |
| security/src/main/java/io/micronaut/security/endpoints/LogoutController.java | Disables the sync controller when a ReactiveLogoutHandler bean is present. |
| security/src/main/java/io/micronaut/security/token/DefaultRolesFinder.java | Implements optional case-insensitive role matching based on security configuration. |
| security/src/main/java/io/micronaut/security/config/SecurityConfiguration.java | Adds isRolesCaseSensitive() to the security configuration contract. |
| security/src/main/java/io/micronaut/security/config/SecurityConfigurationProperties.java | Adds/binds rolesCaseSensitive configuration property. |
| security/src/test/java/io/micronaut/security/endpoints/ReactiveLogoutControllerTest.java | Tests reactive controller selection, completion waiting, and endpoint behaviors. |
| security/src/test/groovy/io/micronaut/security/rules/ConfigurationInterceptUrlMapRuleSpec.groovy | Adds coverage for case sensitivity in intercept-url-map role comparisons. |
| security/src/test/groovy/io/micronaut/security/config/SecurityConfigurationPropertiesSpec.groovy | Adds configuration binding test for roles-case-sensitive. |
| security/src/test/groovy/io/micronaut/security/authorization/SecuredRolesCaseInsensitiveConfigurationSpec.groovy | Tests case-insensitive behavior for @Secured and SecurityService.hasRole. |
sdelamo
force-pushed
the
paperclip/mng-279-reactive-logout-handler
branch
from
May 22, 2026 10:36
25471a4 to
b47f236
Compare
|
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.


Summary
ReactiveLogoutHandler<I, O>as an additive public logout extension point returning a cold single-result publisher./logoutcontroller that is selected when a reactive handler bean exists while preserving the synchronous controller for sync-only applications.Release Metadata
5.1.x5.1.0type: enhancement5.1.0 Release(Throw an error if multiple annotations are used. #147). Live project association could not be applied from this run because GitHub rejected project mutation without theprojecttoken scope.Fixes #1879.
Verification
./gradlew :micronaut-security:test --tests 'io.micronaut.security.endpoints.ReactiveLogoutControllerTest'./gradlew :micronaut-security:japiCmp :micronaut-security:spotlessJavaCheck :micronaut-security:checkstyleMain :micronaut-security:checkstyleTestBoth verification commands passed in clean worktree
/tmp/mng-279-sonar-fix.LyzI6Hfor the final PR headc7f65afb16. GitHub checks are also passing, includingSonarCloud Code Analysis.PR Assets
No rendered output, image, PDF, log archive, or generated artifact changed in a way that requires a PR-visible asset.
✨ This message was AI-generated using gpt-5.5