GeezerVison is showing github.com — Persist one-time authentication tokens for cross-replica failover · Issue #739 · OpenResilienceInitiative/ORISO-UserService
Persist one-time authentication tokens for cross-replica failover #739DescriptionParent: #733
Problem
Magic-link and password-reset tokens are stored in process-local ConcurrentHashMaps. A restart invalidates every outstanding link, and a request handled by one replica cannot be consumed by another.
Scope
- Add one Redis-backed token store for both flows.
- Preserve atomic single-use consumption and bounded retry restoration.
- Keep password-reset one-token-per-account semantics across replicas.
- Prove two independent service/store instances can create and consume the same token.
- Keep tokens, account identifiers, and Redis values out of logs and test artifacts.
Acceptance
- A token created through instance A can be consumed once through instance B.
- A second consume fails deterministically.
- Tokens survive application instance replacement until their TTL expires.
- Password-policy rejection may restore only the claimed token for its remaining TTL.
- A newer password-reset token invalidates the older token for that account across instances.
- Redis outage fails closed without falling back to process-local state.
- Targeted and proportional JDK 21 tests pass.
Activitycoderabbitai commented on Jul 25, 2026
🔗 Related PRs
#439 - feat(auth): self-service password reset (mirrors Magic Link) [merged]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord! Storypapst commented on Jul 25, 2026 CollaboratorAuthor More actions Implementation is ready for human review in #740.
Verified evidence:
- 3,752 unit tests passed locally with zero failures/errors (7 skipped)
- 58 focused authentication tests passed
- 4 real-Redis cross-instance tests passed locally
- blocking GitHub
Redis shared-state contracts check passed
- magic-link and password-reset tokens now survive instance replacement and can be claimed exactly once by another instance
This subtask does not unlock multi-replica UserService by itself. Matrix ownership, schedulers, and remaining coordination stay tracked in #543, #379, and #216. Storypapst commented on Aug 24, 2026 CollaboratorAuthor More actions Verified as delivered: PR #740 ("fix(auth): persist one-time tokens in Redis"), merged into pre-dev on 2026-07-27, replaces the process-local token maps with a shared Redis store, adds atomic cross-instance claim/consume logic with TTL-preserving retry restoration, enforces one outstanding reset token per account, and fails closed on Redis outage; 3,752 unit tests, 58 focused auth tests and 4 real-Redis cross-instance integration tests passed.
Moving to QA external Dev for external review. cc @BjoernLudwig
MetadataMetadataStatusShow more project fields
DevelopmentNo branches or pull requestsIssue actions
|