GeezerVison is showing github.com — Decouple magic-link sessions from Keycloak transport · Issue #770 · OpenResilienceInitiative/ORISO-UserService
Decouple magic-link sessions from Keycloak transport #770DescriptionParent: #335
Why
The magic-link application service and user web controller imported a Keycloak response DTO, while MagicLinkLoginService owned Keycloak credentials, grant fields and token-exchange transport details. That let one provider's wire contract cross the identity-module and web boundaries.
What to build
- Add a focused outbound identity-session exchange port with an application-owned result.
- Move Keycloak admin login, token exchange and wire-response mapping into a Keycloak adapter.
- Return a web-owned response DTO that preserves the existing snake-case magic-link JSON contract.
- Keep Redis one-time-token claim/restore behavior and current failure semantics unchanged.
- Add executable module-boundary, adapter, service and web regression tests.
Acceptance
- Magic-link application and web code import no Keycloak DTO or Keycloak configuration type.
- The public web DTO maps an application model and does not depend on an outbound-port package.
- Keycloak grant fields and response mapping exist only in the Keycloak adapter.
- The public consume response preserves all existing token fields and JSON names.
- Failed exchanges restore the claimed one-time token; successful exchanges remain one-shot.
- Focused, complete unit, integration, Redis, MariaDB and CI contract gates pass without new quarantine.
Current implementation: review-ready PR #831 at exact head be71efb9. The first replay's dependency-direction error was corrected before publication. The old stacked PR #771 is superseded. This remains source/CI evidence until it is merged and deployed.
This strengthens the modular monolith. It does not propose a microservice extraction. Activitycoderabbitai commented on Jul 27, 2026
🔗 Related PRs
#249 - fix(sb4): remove dead Keycloak adapter resolver bean (incompatible with Spring Boot 4) [merged]
#439 - feat(auth): self-service password reset (mirrors Magic Link) [merged]
#448 - fix: harden anonymous live-chat redemption and acceptance [merged]
#508 - Fix own-email rejection during consultant 2FA setup [merged]
#728 - Fix email 2FA completion for encoded Admin usernames [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 27, 2026 CollaboratorAuthor More actions Final publication gate: PR #771 is open as a draft, CLEAN and MERGEABLE. All branch and PR checks are terminal green, including both integration runs, Redis and MariaDB contracts, Docker validation, API diff, and Required PreDev CI. GitHub CodeRabbit reported the explicit successful draft-PR skip; there are no actionable review comments. Local CodeRabbit reported zero findings. Nothing was merged or deployed, and no shared database was reset. Storypapst commented on Jul 27, 2026 CollaboratorAuthor More actions Current-baseline replay published as draft PR #831. It isolates Keycloak grant/exchange details behind IdentitySessionExchange, preserves the seven-field public JSON contract, restores one-time tokens on empty/exceptional exchange failures, and adds the boundary guard. Local proof: focused 194; unit 3,376/0 failures; integration 841/0 failures/0 errors; Python architecture 14; OpenAPI 8; Spotless/diff green. No Rocket.Chat/Jitsi code or fallback is introduced. Storypapst commented on Jul 28, 2026 CollaboratorAuthor More actions Published for review at exact head be71efb9414924841c80987007b13c22d4b16a99.
Independent review found that the first replay let the public web DTO depend on an outbound-port model. The corrected head moves the provider-neutral IdentitySession into api.model.identity and adds an executable guard against that dependency direction.
Evidence on the corrected head:
- 194 focused Java tests passed with zero failures, errors or skips
- 7 module-boundary contracts passed
- Spotless and diff checks passed
- all 12 GitHub checks are terminal green
- the PR is cleanly mergeable against current
pre-dev
Ordered follow-up #833 was also proven in a disposable exact-head combination: after retaining both sets of additive test imports/contracts, 345 focused Java tests and 8 module-boundary tests passed. #833 stays draft until this PR lands and is then replayed onto the resulting pre-dev.
This is source/CI readiness only. It is not merged, deployed or PreDev runtime proof. Storypapst commented on Jul 28, 2026 CollaboratorAuthor More actions Current-base refresh published in PR #831 at exact head f3d4a39071d883221d1f4b9779e000711c1193b8 on merged pre-dev base 947cd1baa142cc4ac9360a96f4694be5e932c657. Fresh local evidence: focused Magic-Link/Keycloak/web tests and 8 module-boundary contracts green; 3,417 package/unit tests with 0 failures/errors and 4 existing email-supplier quarantine skips handled separately by #829; 846 integration tests with 0 failures/errors and 5 environment-gated skips; 37 Python CI contracts; Spotless and diff checks green. Fresh GitHub checks are running. No persistent database reset, merge, deployment, or runtime claim. Storypapst commented on Jul 28, 2026 CollaboratorAuthor More actions CI follow-up for exact head f3d4a39071d883221d1f4b9779e000711c1193b8: all 12 GitHub checks are now terminal green, including both complete integration jobs, both MariaDB contracts, Redis, OpenAPI, branch and PR builds, Docker validation, API diff, and Required PreDev CI. PR #831 remains open with no human review; this is not a merge, deployment, or live-runtime claim.
MetadataMetadataStatusShow more project fields
DevelopmentNo branches or pull requestsIssue actions
|