v2: API keys management pages#1106
Merged
Merged
Conversation
List, create, and one-time-plaintext-disclosure subpages for the v2 SPA. - /v2/api-keys — Active/Revoked tabs over a shared DataTable. Search by name/prefix/actor. Dropdown action triggers a revoke confirm dialog that wires straight into useRevokeAPIKey. - /v2/api-keys/new — shadcn Form + RHF + zod. Scope and actor type pick via OptionCard-wrapped RadioGroup. Plaintext is stashed in sessionStorage and the user is bounced to /created. - /v2/api-keys/created — Card with one-time-copy plaintext input, X-API-Key usage hint, and a one-line "stored as SHA-256 hash" warning. Storage clears on unmount or "Done" click. Adds the radio-group shadcn primitive and a sandbox specimen so the component shows up in the gallery. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Wire the apiKeysSearchSchema to URL state (status + q) — refresh now preserves the tab/search like the comment promised. Matches connections.tsx idiom. - Drop the triple `as CreateAPIKeyResult` cast in api-key-form by awaiting mutateAsync directly and toasting inline; no behavior change. - Flatten the nested-ternary emptyState into a small renderEmptyState helper with early returns. - Use shadcn <Input readOnly> on /api-keys/created instead of a hand-styled <input>. - Memoize the filtered row set; clear the "copied" setTimeout on unmount to avoid late setState on a torn-down component. - Replace `typeof ShieldCheck` / `typeof Bot` with LucideIcon; drop unreachable ?? Bot fallback in ActorBadge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # web/src/main.tsx
# Conflicts: # web/src/api/types.ts # web/src/main.tsx
Owner
Author
Merge activity
|
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
Build out the v2 SPA's API keys surface — list page, new-key form, and one-time plaintext disclosure subpage. Drops the user into the same conventions as the rest of v2 (shadcn primitives, RHF + zod, shared
DataTable,withMutationToast)./v2/api-keys— Active / Revoked tabs over the sharedDataTable, with name/prefix/actor search. Per-row dropdown opens a revoke confirm dialog that wires straight intouseRevokeAPIKey. Read-only sessions hit the existingApiErrorpath becauseGET /api/v1/api-keysrequires write scope./v2/api-keys/new— shadcnForm+ RHF + zod. Scope and actor type areOptionCard-wrappedRadioGrouptiles so the choice reads as a deliberate decision rather than a buried dropdown. Optional actor display name lets you label an integration ("Claude — Ricardo's laptop") without renaming the key itself./v2/api-keys/created—Cardwith a one-time-copy plaintext input, anX-API-Keyusage hint, and a one-line "stored as SHA-256 hash" warning. Plaintext lives insessionStorageso a refresh mid-copy isn't fatal; it clears on unmount or on "I've saved it — done".New shadcn primitive (
radio-group) added via the CLI plus a sandbox specimen so the component is discoverable in the gallery.Screens
List — Active / Revoked tabs, search, per-row actions (desktop / tablet / mobile):
New key form (desktop):
New key form — responsive composite:
Key created — one-time plaintext disclosure:
Test plan
bun run lint(tsc --noEmit) — cleanbun run build— clean/v2/api-keys,/v2/api-keys/new,/v2/api-keys/createdin headless Chromium against a locally-builtbreadbox serveon port 8083/createdRadioGroupspecimen renders in/v2/sandbox→ Primitives🤖 Generated with Claude Code