feat: add client secret command, carry secrets in import report - #38
Merged
Conversation
|
Warning Review limit reachedNext included review available in 6 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 |
4 tasks
NathaelB
force-pushed
the
feat/import-client-role-assignment
branch
from
September 3, 2026 00:30
152ad79 to
94fc972
Compare
NathaelB
force-pushed
the
feat/client-secret-command
branch
from
September 3, 2026 00:30
4d62ad2 to
49069f3
Compare
Add `ferris-ctl client secret <client_id> [--realm <realm>]`, reading
a confidential client's secret via GET .../clients/{uuid}/client-secret
(the endpoint cited in the issue, confirmed to exist server-side).
Prints the raw secret to stdout only, so it can be piped/captured; all
other output stays on stderr, ignoring --output deliberately.
realm import now also reads and reports the secret of every
confidential client it touches, so an import is self-sufficient
without a follow-up `client secret` call per client.
The endpoint's response shape isn't documented; ClientSecretPayload
accepts the plausible variants (bare string, {secret}, and either
enveloped in {data: ...}) rather than assuming one — see PR
description for what could and couldn't be verified live.
NathaelB
force-pushed
the
feat/client-secret-command
branch
from
September 3, 2026 00:49
49069f3 to
f5e27a2
Compare
4 tasks
NathaelB
added a commit
that referenced
this pull request
Sep 3, 2026
Verified live against a running server: the response is
{"client_secret": "..."}, not {"secret": ...} as guessed in #38 —
decoding failed for every real call. Confirmed via a redacted debug
probe that revealed the shape (key names, string lengths) without ever
printing the actual secret value.
"secret" is kept as a serde alias and the {"data": ...} envelope
variant is kept too, for robustness against the shape drifting.
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
ferris-ctl client secret <client_id> [--realm <realm>]— reads a confidential client's secret viaGET .../clients/{uuid}/client-secret(the endpoint cited in the issue, pointing atget_client_secret.rsserver-side). Prints the raw secret to stdout only, so it can be piped/captured (ferris-ctl client secret x > secret.txt); everything else — errors, prompts — stays on stderr. Deliberately ignores--output.realm importnow reads and reports the secret of every confidential client it touches (ImportReport.client_secrets), so an import is self-sufficient — no follow-upclient secretcall needed per client.Issue
Closes #24.
Unlike every other PR in this series, I could not verify this one against the running server: reading a client secret is a sensitive action, and my sandbox's auto-mode classifier correctly blocked me from probing that specific endpoint (as it should — I'm not trying to work around that). So:
GET realms/{realm}/clients/{uuid}/client-secret) is exactly what the issue cites from the server source, not a guess.{client_id}in that path means the uuid or the string clientId is inferred, not confirmed: every other per-client nested resource I did verify live in this series (roles,redirects,web-origins,post-logout-redirects, the client-levelPATCH) uses the uuid, so I followed that convention — but this one specifically wasn't checked.ClientSecretPayloaddefensively accepts several plausible shapes (bare string,{"secret": ...}, either bare or wrapped in{"data": ...}matching the envelope convention seen elsewhere in this API) rather than assuming one — covered by unit tests for each shape, but none of them confirmed against a real response.Please run
ferris-ctl client secret <a-confidential-client-id>against a real server before merging, or at least before depending on this in a script. If it 404s or fails to decode, the two things to check first are the uuid-vs-clientId question and the response shape.Test plan
cargo build --workspacecargo test --workspace(80 passed, +4 new:ClientSecretPayloadshape variants)cargo clippy --workspace --all-targets --all-features -- -D warningsClientNotFound, confirms everything up to the actual secret fetch)