docs(authenticator): ADR-0003 — adopt Keycloak as identity broker, configured as code - #2170
Conversation
…igured as code Resolves the investigation deferred by ADR-0001 and ADR-0002 (constructorfabric#1782): Keycloak brokers heterogeneous customer IdPs and social logins (GitHub per constructorfabric#2163; Google, Facebook, Apple later) behind one uniform OIDC issuer; the authenticator contract is unchanged. Realm content is managed declaratively with keycloak-config-cli from gitops (secrets via sealed secrets, env-var substitution); per-provider identity-provider mappers inject the single tenant_id claim and protocol mappers allow-list what enters the token. Amends ADR-0002: the fakeidp survival clause is retired -- Keycloak becomes the issuer in compose and the in-process rig too, via the existing generated realm. Also refreshes the DESIGN ADR index (0001 was listed as current; 0002 was missing) and fixes the stale specs/ADR traceability link. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
📝 WalkthroughWalkthroughThe change adds an ADR for Keycloak as the identity broker, records its amendment to the real-IdP decision, and updates authenticator architecture references and traceability to ADRs 0001–0003. ChangesKeycloak broker documentation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…tion, config consequences Extend the decision with three points raised in review of the plan: - IdP selection within a customer is the realm's login page (or default-IdP auto-redirect); realm selection across customers (cloud) is host-based -- the authenticator's issuerUrl generalises to a host-keyed issuer map, with a single-entry map as the dedicated-install degenerate case. Keycloak Organizations rejected for now. - Upstreams that distinguish tenants by a claim value get an in-realm translation table (advanced claim-to-group mapper, syncMode FORCE, group tenant_id attribute); unmapped values fail closed. - Consequences: the host-keyed issuer map is the authenticator's only config change, and idp.tenant_claim is defaulted to tenant_id and frozen once migration completes (kept for third-party chart consumers). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/components/backend/authenticator/specs/ADR/0002-real-idp-on-deployed-stands.md (1)
103-105: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider an inline pointer to the amendment at the retired bullet.
The status history (Lines 10-16) states the fakeidp survival clause is retired. The Decision Outcome bullet at Lines 103-105 still asserts "fakeidp survives in exactly three places" with no inline note. A reader who jumps directly to the Decision Outcome section can miss the amendment recorded only at the top of the file.
Add a short inline annotation, for example "(retired by ADR-0003, see status history)", next to this bullet.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/components/backend/authenticator/specs/ADR/0002-real-idp-on-deployed-stands.md` around lines 103 - 105, Add a brief inline annotation to the Decision Outcome bullet containing “fakeidp survives in exactly three places,” pointing readers to ADR-0003 and the status history as the source of its retirement.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@docs/components/backend/authenticator/specs/ADR/0003-keycloak-identity-broker.md`:
- Around line 86-88: Remove the incorrect claim that Apple is a built-in
identity provider shipped with Keycloak from the provider coverage section.
Delete "and Apple since Keycloak 24" from the list of GitHub, Google, Facebook,
Microsoft, LinkedIn, and GitLab providers in the quoted section. Update the
corresponding claim at lines 186-187, and add a note that deployments requiring
Sign in with Apple must use an app-specific extension dependency instead of
relying on built-in support.
---
Nitpick comments:
In
`@docs/components/backend/authenticator/specs/ADR/0002-real-idp-on-deployed-stands.md`:
- Around line 103-105: Add a brief inline annotation to the Decision Outcome
bullet containing “fakeidp survives in exactly three places,” pointing readers
to ADR-0003 and the status history as the source of its retirement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 937e8486-4323-4ff5-912a-b81342f0aaf4
📒 Files selected for processing (3)
docs/components/backend/authenticator/DESIGN.mddocs/components/backend/authenticator/specs/ADR/0002-real-idp-on-deployed-stands.mddocs/components/backend/authenticator/specs/ADR/0003-keycloak-identity-broker.md
af29993
What
Records the outcome of the identity-broker investigation (#1782) as ADR-0003 under the authenticator specs, per the issue's deliverable. Closes #1782.
issuerUrland is unchanged. Realm content is configuration-as-code only —keycloak-config-cliYAML applied from gitops, secrets via sealed secrets — never the admin UI. Per-provider identity-provider mappers inject the singletenant_idclaim; protocol mappers allow-list what enters the token. Topology: realm per customer. fakeidp is retired (Keycloak becomes the issuer in compose and the in-process rig too, via the existinggen-realm.pyrealm)../ADR/traceability link fixed to./specs/ADR/.Investigation report with the full comparison: #1782 (comment)
Validation
cfs tocregenerated for touched files;cfs validate --local-onlyreports no findings for the authenticator artifacts (remaining repo-wide findings are pre-existing in other components);cfs check-languageclean.Confirmation gate (recorded in the ADR)
The PoC — a config-cli-only realm brokering one upstream, unchanged authenticator, gateway JWT minted — validates refresh-token passthrough and logout propagation before rollout.
Refs #2163, #1583.
🤖 Generated with Claude Code
Summary by CodeRabbit