Repository navigation
refactor(admin)!: client show prints the listed client's shape, and recoveries are admin views - #681
Draft
PiquelChips wants to merge 2 commits into
Draft
PiquelChips wants to merge 2 commits into
PiquelChips wants to merge 2 commits into
Conversation
…rows `admin::ClientDetail` (the listed client with its kind, dates and secrets) replaces `ClientDetails`, which flattened `StoredOidcClient`, so `client show --json` and `client list --json` share one client shape. `admin::Recovery`, `RecoveryState` and `RecoveryPasskey` move out of the database crate, which decodes into them. The UI converts a `ClientDetail` and its secrets into rows once.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
This was referenced Nov 22, 2026
…the client page names the client as one
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.
Part of #544 (NEW-2). Stacked on #677: it changes the same client CLI and dashboard files, so its base is
refactor/544-decision-typed-status.The conventions say the dashboard and the CLI show views from
sourceorigin_common::admin, which the database decodes into. Two reads didn't:ClientDetailsflattened the database'sStoredOidcClientandStoredClientSecret. Soclient show --jsonprinted database rows, whileclient list --jsonprintedadmin::Client: one client had two JSON shapes.RecentRecovery,RecoveryStateandRecoveryPasskeylived in the database crate. The CLI, the dashboard and the service imported admin views fromsourceorigin_repository.This PR adds the views to
common::adminand has the database produce them:admin::ClientDetailis the listedadmin::Client(flattened), pluskind,created_at,updated_atandsecrets(admin::SecretLifetime).OidcRepository::client_detailbuilds it from the existing queries;From<StoredClientSecret>converts each secret, since the console reads secrets too.AdminService::client_detailsbecomesclient_detail, andClientDetailsis gone.admin::Recovery,admin::RecoveryStateandadmin::RecoveryPasskeymove unchanged fromcrates/database/src/repositories/recoveries.rs. The database decodesrecentinto them, andStoredRecovery::state()returnsadmin::RecoveryState.sourceorigin-uigetsFrom<&ClientDetail> for ClientRowandFrom<&SecretLifetime> for SecretRow. These replaceAdminApplication::client_rowand the three hand-writtenSecretRowmaps: the dashboard's client and secret pages, and the developer console's secrets page, whoseAccountService::client_secretsnow returnsSecretLifetimes.Visible changes
auth-service client show --jsonchanges shape (approved). It is now aclient listentry plus four keys.Before, the flattened database row:
{"id":"notes","display_name":"Notes","kind":"confidential","redirect_uris":[…],"post_logout_uris":[],"allowed_scopes":[…],"allowed_audiences":[…],"allow_refresh":true,"enabled":true,"trusted":false,"require_pushed_authorization_requests":false,"backchannel_logout_uri":null,"created_at":"…","updated_at":"…","owner_id":null,"last_used_at":null,"deleted_at":null,"suspended_at":null,"secrets":[{"id":"…","created_at":"…","expires_at":null}]}After,
admin::ClientDetail:{"id":"notes","display_name":"Notes","redirect_uris":[…],"post_logout_uris":[],"allowed_scopes":[…],"allowed_audiences":[…],"allow_refresh":true,"enabled":true,"trusted":false,"require_pushed_authorization_requests":false,"token_endpoint_auth_method":"client_secret_basic","kind":"confidential","created_at":"…","updated_at":"…","secrets":[{"id":"…","created_at":"…","expires_at":null}]}The differences:
token_endpoint_auth_methodis added, asclient listhas it.backchannel_logout_uri,owner_id,last_used_at,suspended_atanddeleted_atare left out when empty instead of printed asnull, as inclient list.sourceorigin-commonpublic API: these items are new:admin::{ClientDetail, SecretLifetime, Recovery, RecoveryState, RecoveryPasskey}.cargo semver-checksreports them as additions.Nothing else changes:
client showwithout--jsonprints the same fields from the same values.ClientRow::from(&ClientDetail)reads the same fieldsclient_rowread from the stored row, becauseadmin::Clientcopies them.user recoveranduser undo-recoveryprint to standard error keeps its JSON: the types moved with their serde attributes unchanged.Docs
docs/dev/operations/administration.mdnow listsclient show(ClientDetail) among the commands whose--jsonprints an admin view.Tests
a_client_detail_extends_the_listed_clientchecks that the detail's JSON is the listed client's plus its four keys, and that it round-trips. No test was removed.Files outside this lane
apps/auth-service/src/lib.rs: dropsClientDetailsfrom the re-exports.apps/auth-service/src/recovery/mod.rs: importsRecoveryStatefromsourceorigin_common::admin. This is the only change to that file.Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)