Skip to content

feat: soft-refresh immutable UserDetails without mass session kick#24490

Closed
netroms wants to merge 1 commit into
masterfrom
feat/userdetails-soft-refresh
Closed

feat: soft-refresh immutable UserDetails without mass session kick#24490
netroms wants to merge 1 commit into
masterfrom
feat/userdetails-soft-refresh

Conversation

@netroms

@netroms netroms commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace role/group/OU-driven mass SessionRegistry.expireNow with dual generation stamps (userAuthzGen + roleAuthzGen) and a shared AuthzService.
  • Role authority or restriction edits bump one role gen (O(1)); form/OIDC sessions rebuild immutable UserDetails on the next request via UserDetailsSoftRefreshFilter (explicit SecurityContext save, no logout).
  • JWT and PAT share AuthzService; password / disable / lock / expiry remain hard invalidate.

Design note: docs/design/2026-07-18-userdetails-soft-refresh.md

Related: PR #24477 only batches N+1 lookups and does not change semantics. This PR changes the authz-invalidation model.

Test plan

  • Unit: InMemoryAuthzVersionStoreTest, DefaultAuthzServiceTest (8)
  • Unit: UserDetailsSoftRefreshFilterTest (3)
  • Integration/web-api: role authority change → next request sees new authorities, session cookie unchanged
  • Integration: password change / disable still hard-kick
  • OIDC principal rebuild path
  • PAT cache refresh after role revoke
  • Multi-node Redis gen store smoke (when Redis sessions enabled)

Replace role/group/OU-driven SessionRegistry mass invalidation with dual
generation stamps (user + role) and a shared AuthzService. Role authority
or restriction edits bump one role gen (O(1)). Form/OIDC sessions rebuild
and replace Authentication on next request via UserDetailsSoftRefreshFilter
with explicit SecurityContext save. JWT/PAT share AuthzService. Password,
disable, lock, expiry remain hard invalidate.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
12 New issues
12 New Code Smells (required ≤ 0)
1 New Critical Issues (required ≤ 0)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

@netroms

netroms commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #24493 (v2 of the same approach: repository decoration instead of a filter, epoch+gen store, Postgres-only SQL with test coverage moved to Postgres ITs).

@netroms netroms closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant