Repository navigation
feat: implement importKeycloakUsers endpoint for migrating Keycloak users to Dex - #1141
Merged
Merged
Conversation
…sers to Dex Signed-off-by: Cas Lubbers <clubbers@akamai.com>
CasLubbers
requested review from
dennisvankekem and
ferruhcihan
as code owners
November 26, 2026 11:02
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success921 tests passing in 32 suites. Report generated by 🧪jest coverage report action from 5832ea2 |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Direct tests are missing for the secret reader’s error propagation, the listing helper’s empty-array fallback, and successful secret decoding and filtering, leaving cluster failures at risk of appearing as successful empty imports.
1 open issue
What changed in this PR
Adds a platform-admin-only maintenance endpoint to migrate users from Keycloak-backed Kubernetes secrets into Dex, supporting the authentication-provider transition.
Changes:
- Imports users with new passwords and existing team memberships, returning per-user outcomes.
- Separates strict secret reading from the existing error-tolerant listing helper.
- Adds response schemas, model types, and migration and authorization tests.
| File | Description |
|---|---|
src/otomi-stack.ts |
Implements migration guards, user provisioning, and per-user results. |
src/otomi-stack.test.ts |
Tests migration outcomes, repeat runs, and provider guards. |
src/otomi-models.ts |
Exports migration response types. |
src/openapi/keycloakUserImport.yaml |
Defines results and platform-admin access. |
src/openapi/api.yaml |
Registers the maintenance endpoint and response schema. |
src/k8s-operations.ts |
Extracts a secret reader that propagates failures. |
src/api/v1/maintenance.ts |
Adds the migration request handler. |
src/api.authz.test.ts |
Tests platform-admin access and team-role denial. |
eslint.config.mjs |
Excludes .claude from linting. |
Review effort: Balanced
merll
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Created 4 teams, 3 users. Assigned to multiple teams. While still being on keycloak. Then migrated to Dex. Logged in with the platform-admin. On the maintenance page the import keycloak users button is visable. Once you press it, it will import the users and return the ones imported.
Together with:
linode/apl-console#888