feat: extend import ClientBlueprint with PKCE, device auth, origins, lifetimes - #36
Merged
Merged
Conversation
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (7)
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 |
This was referenced Sep 3, 2026
… lifetimes
post_logout_redirect_uris, web_origins, PKCE requirement, the Device
Authorization grant toggle, and per-client token lifetimes were
missing from ClientBlueprint, so an import couldn't reproduce them and
they were lost on the next realm.
Adds the corresponding client endpoints (POST .../post-logout-redirects,
POST .../web-origins, PATCH .../clients/{id} for PKCE/lifetimes — the
latter only settable after creation, unlike the rest of a client's
fields) and applies them in apply.rs. All five stay optional so
existing blueprint files keep importing unchanged.
Keycloak/Zitadel sources default these fields rather than extracting
them: Keycloak carries the equivalent settings under a free-form
`attributes` map with Keycloak-specific keys, which is a separate
scope of work.
NathaelB
force-pushed
the
feat/import-client-blueprint-fields
branch
from
September 3, 2026 00:30
589207a to
64916be
Compare
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.
Summary
ClientBlueprintgains five optional fields the console exposes but the import format couldn't reproduce:post_logout_redirect_uris,web_origins,require_pkce,device_authorization_grant_enabled, and the four per-client token lifetimes (access_token_lifetime,refresh_token_lifetime,id_token_lifetime,temporary_token_lifetime). All stay optional/empty-by-default so existing blueprint files keep importing unchanged.New client endpoints, discovered and verified live (none of these were documented, guessed via the same 405-
Allow-header technique as earlier PRs):POST .../clients/{uuid}/post-logout-redirects— same{value, enabled}shape as the existing redirects endpoint.POST .../clients/{uuid}/web-origins—{value}only.device_authorization_grant_enabledis settable at client creation (added toCreateClientRequest).PATCH .../clients/{uuid}afterward. Newupdate_client_settings, applied once per client after creation/resolution, mirroring the existingupdate_realm_settingspattern.Issue
Closes #25.
Stacked on #35
This branch is based on
fix/import-conflict-detection(#35), notmain— it extendsis_conflict/ImportReportfurther and would conflict badly if built independently. Merge #35 first; this will retarget tomainautomatically once that branch is gone.Also found while verifying
web-originreturns400with"...this origin is already registered..."— no "exist" in the body, sois_conflictneeded widening (added here, on top of fix: recognize 500 unique-constraint conflicts on import replay #35's).post-logout-redirectshas no duplicate check server-side: re-adding the same value returns201every time. An import replay will keep accumulating duplicate rows for this specific field. Not fixable from the CLI; flagging it rather than pretending otherwise.resolve_client's conflict path (client already exists) is itself broken the same way as the role case in fix: recognize 500 unique-constraint conflicts on import replay #35: duplicateclient_idreturns an opaque500("Failed to create client", no diagnostic text), not409. Sorealm importreplay does not actually converge for realms with clients today, on top of the role-replay gap already noted in fix: recognize 500 unique-constraint conflicts on import replay #35. Both need the server-side 409 fix; no safe CLI-side text match exists for either.attributesmap with Keycloak-specific keys (e.g. PKCE underattributes."pkce.code.challenge.method"), which is real additional scope this issue didn't ask for.Test plan
cargo build --workspacecargo test --workspace(74 passed, +1 new: web-origin conflict wording)cargo clippy --workspace --all-targets --all-features -- -D warnings