feat(auth): retire fakeidp — Keycloak is the IdP everywhere - #2315
Conversation
|
Warning Review limit reached
Next review available in: 9 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (74)
📝 WalkthroughWalkthroughThe change retires fakeidp and makes Keycloak the authentication provider across Compose, GitOps, Helm, CI, seed generation, authenticator configuration, and gateway end-to-end tests. Keycloak realms are generated from roster data and imported before test and CI deployments. ChangesKeycloak migration
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant CI as CI workflow
participant Seed as insight-seed-realm
participant Keycloak
participant Authenticator
participant GatewayE2E as Gateway E2E fixture
CI->>Seed: Generate roster realm
Seed-->>CI: Write realm import
CI->>Keycloak: Start with imported realm
GatewayE2E->>Keycloak: Request authorization
Keycloak-->>GatewayE2E: Return HTML login form
GatewayE2E->>Keycloak: Submit roster credentials
Keycloak->>Authenticator: Send OIDC callback
Authenticator-->>GatewayE2E: Establish authenticated session
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
charts/insight/Chart.yaml (1)
77-82: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winBump the umbrella chart version to publish the dependency change.
charts/insight/Chart.yamlstill declaresversion: 0.5.90while addinginsight-keycloak. Bump the chart version, and ifcharts/insight/Chart.lockis tracked, regenerate it and ensure it listsinsight-keycloakwithoutinsight-fakeidp.🤖 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 `@charts/insight/Chart.yaml` around lines 77 - 82, Update the umbrella chart metadata in Chart.yaml by incrementing its declared chart version from 0.5.90 to the next release version for the added insight-keycloak dependency. If Chart.lock is tracked, regenerate it so it includes insight-keycloak and excludes insight-fakeidp.
🧹 Nitpick comments (2)
docker-compose.yml (1)
686-688: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the obsolete
AUTH_MODEinjection.
get_login_id_pairs()no longer readsAUTH_MODE; it always returns the whole roster UUID pairs, and login-IdP rows are selected byget_idp_source_type()usingIDP_SOURCE_TYPE. Keep this comment withIDP_SOURCE_TYPEand remove theAUTH_MODEline from theseed-sampleenvironment block.🤖 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 `@docker-compose.yml` around lines 686 - 688, Remove the obsolete AUTH_MODE environment injection from the seed-sample environment block. Update the adjacent comment to reference IDP_SOURCE_TYPE instead, while preserving its explanation of get_login_id_pairs and get_idp_source_type behavior.dev-compose.sh (1)
460-470: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low valueRemove the stale
AUTH_MODEmigration warning.
get_login_id_pairsno longer usesAUTH_MODE; it returns(person.uuid, person.uuid)for the Keycloak realm profile. The Job also usesIDP_SOURCE_TYPEviaSEED_IDP_SOURCE_TYPE. Keep settingAUTHENTICATOR_IDP_SOURCE_TYPEindev-compose.sh, but drop theAUTH_MODE="keycloak", staleget_login_id_pairscomment, andexport AUTH_MODE.🤖 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 `@dev-compose.sh` around lines 460 - 470, Remove the obsolete AUTH_MODE warning block and the AUTH_MODE assignment/export from the setup flow. In dev-compose.sh, retain the existing AUTHENTICATOR_IDP_SOURCE_TYPE configuration, but delete the stale get_login_id_pairs comment and any AUTH_MODE-related environment handling.
🤖 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 @.github/workflows/functional-k3s.yml:
- Around line 190-197: Update the “Generate Keycloak realm” workflow step to
invoke the `make keycloak-realm` target in required mode, ensuring it fails when
the selected `GITOPS_ENV` has `keycloak.deploy` set to anything other than true.
Preserve the existing environment and Kubernetes context arguments.
In @.github/workflows/gateway.yml:
- Around line 16-17: Update the pull-request path filter in the workflow to
include the Keycloak realm’s dependent source files, covering
insight_seed/config.py, insight_seed/profiles.py, or the broader insight_seed
source pattern alongside keycloak_realm.py, so roster and configuration changes
trigger the workflow.
In `@src/backend/services/gateway/tests/downstream-verify/README.md`:
- Around line 45-48: Update the command code fence in the downstream
verification README to specify the bash language on its opening fence, while
leaving the contained commands unchanged.
In `@src/ingestion/tests/e2e/lib/api_coverage.py`:
- Around line 156-158: Update the back-channel logout comment near
e2e_backchannel to one line, remove the unmatched closing parenthesis, and
accurately state that the test client observes 401 responses after session
termination as well as 400 responses for malformed logout tokens.
In `@tests/lib/insight_stand/session.py`:
- Line 154: Update the error message in LoginSession._start() to report that the
/auth/login request failed to redirect to the stand’s configured external IdP,
rather than asking whether Keycloak is available. Keep the existing status-code
detail and use the configured IdP terminology supported by LoginSession.
---
Outside diff comments:
In `@charts/insight/Chart.yaml`:
- Around line 77-82: Update the umbrella chart metadata in Chart.yaml by
incrementing its declared chart version from 0.5.90 to the next release version
for the added insight-keycloak dependency. If Chart.lock is tracked, regenerate
it so it includes insight-keycloak and excludes insight-fakeidp.
---
Nitpick comments:
In `@dev-compose.sh`:
- Around line 460-470: Remove the obsolete AUTH_MODE warning block and the
AUTH_MODE assignment/export from the setup flow. In dev-compose.sh, retain the
existing AUTHENTICATOR_IDP_SOURCE_TYPE configuration, but delete the stale
get_login_id_pairs comment and any AUTH_MODE-related environment handling.
In `@docker-compose.yml`:
- Around line 686-688: Remove the obsolete AUTH_MODE environment injection from
the seed-sample environment block. Update the adjacent comment to reference
IDP_SOURCE_TYPE instead, while preserving its explanation of get_login_id_pairs
and get_idp_source_type behavior.
🪄 Autofix
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: 91c5e248-64f8-4a01-9407-2ffe9a9dccd0
📥 Commits
Reviewing files that changed from the base of the PR and between 7eb1a15 and 64d6ba1bbb7752f5e9f9bd85ad1725e3fe00f837.
⛔ Files ignored due to path filters (2)
charts/insight/Chart.lockis excluded by!**/*.locksrc/backend/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (74)
.cf-studio/config/artifacts.toml.claude/skills/file-bug-insight/SKILL.md.env.compose.example.github/workflows/functional-k3s.yml.github/workflows/gateway.ymlCONTRIBUTING.mdcharts/insight/Chart.yamlcharts/insight/templates/NOTES.txtcharts/insight/templates/_helpers.tplcharts/insight/templates/secrets.yamlcharts/insight/values.yamldeploy/HELM_DEPLOY.mddeploy/compose/authenticator-fullauth.yamldeploy/compose/insight-init.shdeploy/compose/keycloak/README.mddeploy/gitops/.gitignoredeploy/gitops/Makefiledeploy/gitops/environments/functional-ci/values.yamldeploy/gitops/environments/local/inventory.yaml.templatedeploy/gitops/environments/local/values.yaml.templatedeploy/gitops/scripts/compose-app-secrets.shdeploy/gitops/secrets-store.yaml.templatedev-compose.shdocker-compose.ymldocs/components/backend/authenticator/DESIGN.mddocs/components/backend/authenticator/specs/ADR/0001-per-environment-idp-selection.mddocs/components/backend/authenticator/specs/ADR/0002-real-idp-on-deployed-stands.mddocs/components/backend/authenticator/specs/ADR/0003-keycloak-identity-broker.mddocs/components/deployment/specs/DESIGN.mdscripts/ci/components.pysrc/backend/Cargo.tomlsrc/backend/services/analytics/Dockerfilesrc/backend/services/authenticator/Dockerfilesrc/backend/services/authenticator/config/insight.yamlsrc/backend/services/authenticator/src/config.rssrc/backend/services/authenticator/src/identity.rssrc/backend/services/authenticator/src/oidc.rssrc/backend/services/authenticator/tests/common/kc.rssrc/backend/services/authenticator/tests/e2e_refresher.rssrc/backend/services/authenticator/tests/run-e2e.shsrc/backend/services/fakeidp/Cargo.tomlsrc/backend/services/fakeidp/Dockerfilesrc/backend/services/fakeidp/README.mdsrc/backend/services/fakeidp/helm/Chart.yamlsrc/backend/services/fakeidp/helm/templates/_helpers.tplsrc/backend/services/fakeidp/helm/templates/deployment.yamlsrc/backend/services/fakeidp/helm/templates/ingress.yamlsrc/backend/services/fakeidp/helm/templates/service.yamlsrc/backend/services/fakeidp/helm/values.yamlsrc/backend/services/fakeidp/src/lib.rssrc/backend/services/fakeidp/src/main.rssrc/backend/services/fakeidp/tests/boot.rssrc/backend/services/fakeidp/tests/flow.rssrc/backend/services/fakeidp/users.yamlsrc/backend/services/gateway/tests/.gitignoresrc/backend/services/gateway/tests/conftest.pysrc/backend/services/gateway/tests/docker-compose.e2e.ymlsrc/backend/services/gateway/tests/downstream-verify/README.mdsrc/backend/services/gateway/tests/downstream-verify/conftest.pysrc/backend/services/gateway/tests/downstream-verify/docker-compose.e2e.ymlsrc/backend/services/gateway/tests/downstream-verify/run-e2e.shsrc/backend/services/gateway/tests/run-e2e.shsrc/backend/services/identity-resolution/Dockerfilesrc/ingestion/tests/e2e/lib/api_coverage.pysrc/ingestion/tools/seed/PROFILE.mdsrc/ingestion/tools/seed/insight_seed/identity.pysrc/ingestion/tools/seed/insight_seed/manifest.pysrc/ingestion/tools/seed/insight_seed/profiles.pysrc/ingestion/tools/seed/seed-job.yaml.tplsrc/ingestion/tools/seed/seed-stand.shsrc/ingestion/tools/seed/tests/test_identity.pytests/lib/insight_stand/manifest.pytests/lib/insight_stand/session.pytests/stand/api/identity/test_internal.py
💤 Files with no reviewable changes (19)
- src/backend/services/fakeidp/helm/templates/service.yaml
- deploy/compose/keycloak/README.md
- src/backend/services/authenticator/Dockerfile
- src/backend/services/fakeidp/helm/Chart.yaml
- src/backend/services/fakeidp/README.md
- src/backend/services/fakeidp/tests/boot.rs
- src/backend/services/fakeidp/tests/flow.rs
- src/backend/services/fakeidp/Dockerfile
- charts/insight/templates/NOTES.txt
- src/backend/services/fakeidp/users.yaml
- src/backend/services/fakeidp/helm/templates/deployment.yaml
- src/backend/services/fakeidp/src/lib.rs
- src/backend/services/fakeidp/src/main.rs
- src/backend/services/identity-resolution/Dockerfile
- src/backend/services/fakeidp/helm/values.yaml
- src/backend/services/fakeidp/helm/templates/_helpers.tpl
- src/backend/services/fakeidp/Cargo.toml
- src/backend/services/fakeidp/helm/templates/ingress.yaml
- src/backend/services/analytics/Dockerfile
1a04091 to
15a386e
Compare
…torfabric#2198) Deletes the fakeidp OIDC test double (crate, helm subchart, umbrella wiring, compose service, CI component) and migrates its last consumers: - functional-ci (k3s smoke): in-stack Keycloak subchart on the shared MariaDB, realm generated by insight-seed-realm and applied via the keycloak-config-cli hook; workflow installs uv and runs keycloak-realm. - gateway e2e rigs (main + downstream-verify): realm-importing Keycloak container; the pytest client drives the real login form. Both suites pass locally (11 + 6). - seed/stand tooling: AUTH_MODE/--auth-mode removed; the whole roster gets login rows keyed on persona uuid; IDP_SOURCE_TYPE defaults to keycloak. - docs: DESIGNs updated, ADR-0001/0002/0003 get dated status notes; ADR-0003 registered in the cfs artifact registry (fixes pre-existing dangling refs). Completes the fakeidp retirement tracked in constructorfabric#2198 (ADR-0003). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
…DE plumbing, comment trims CodeRabbit follow-ups on constructorfabric#2315: the functional-k3s realm step fails when keycloak.deploy != true instead of silently skipping; gateway.yml triggers on the whole insight_seed package (the realm generator imports config + profiles); the seed container's AUTH_MODE env and dev-compose export are dropped (nothing reads AUTH_MODE anymore); misleading Keycloak-liveness error hint and stale back-channel comment fixed; wordier new comments trimmed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
15a386e to
4e74747
Compare
Part of #2198 (ADR-0003). Deletes the
fakeidpOIDC test double and migrates its last consumers to the in-stack Keycloak.What
fakeidpcrate, its helm subchart, the umbrella chart dependency/values/helpers wiring, the compose service +auth-fakeidpprofile, the CI component entry, and Dockerfile workspace-skeleton references.insight-seed-realmand applied via the keycloak-config-cli hook Job. The workflow installs uv and runs thekeycloak-realmmake target; deploy timeout raised 5m → 10m to cover Keycloak first boot.login-actions/authenticatePOST).AUTH_MODE/--auth-moderemoved; the whole roster gets login rows keyed on persona uuid (matching the generated realm'ssub);IDP_SOURCE_TYPEdefaults tokeycloak.keycloak-realmreads.keycloak.devUserEmail(the.fakeidp.*key is gone).The chart-side removal is inert for deployed environments: every published chart line defaults
fakeidp.deploy: false, and the sibling insight-gitops cleanup (dropping the now-dead overrides) is prepared separately.Verification
cargo check --workspace+cargo fmt --checkclean; authenticator oidc unit tests pass (7/7).render_profile --checkpasses.helm dependency update+ fullhelm templaterender with the functional-ci overlay: clean, zero fakeidp strings, config-cli hook + Keycloak DB CREATE/GRANT present.docker compose config,pre-commit run(full changed set), and cfs validate/check-language on touched spec artifacts: green.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation