feat(dashboard): redesign consumer key management UX - #69
Conversation
Split key creation into a focused two-step dialog (name -> key shown once with copy key / setup blurb). Scope the consumer drawer to the clicked row: keys render as a list with per-row rotate/revoke (and reveal only for recoverable keys), grace period is a human-readable select instead of raw seconds, and settings collapse into a fold. Removes the four duplicate consumer inputs and the permanent legacy reveal section. Adds GET /dashboard/api/keys/list?consumer=... returning hash-only per-key metadata (prefix, status, timestamps, recoverable flag).
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds an admin-only endpoint ChangesDashboard Key Management
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant DrawerJS as Drawer JS
participant DashboardAPI as dashboard_list_keys
participant CALLER_KEYS
User->>DrawerJS: open consumer drawer
DrawerJS->>DashboardAPI: GET /dashboard/api/keys/list?consumer=X
DashboardAPI->>CALLER_KEYS: check plaintext key per sha256_prefix
CALLER_KEYS-->>DashboardAPI: recoverable true/false
DashboardAPI-->>DrawerJS: key metadata list
DrawerJS->>User: render keys list
User->>DrawerJS: click revealKey(prefix)
DrawerJS->>DashboardAPI: request raw key (only if recoverable)
DashboardAPI-->>DrawerJS: plaintext key
DrawerJS->>User: showKeyReady()
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@auth_proxy.py`:
- Line 4093: The rotate action is using the consumer-wide flow rather than a
specific key, so the “Rotate this key” control is misleading. Update
`rotateKey(prefix)` and the `/dashboard/api/keys` request path to either accept
and send a key identifier for row-specific rotation, or change the UI
label/handler so it clearly reflects consumer-scoped rotation. Use the existing
`rotateKey` function, `drawerConsumer`, and the `POST /dashboard/api/keys` call
to keep the behavior and labeling consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d7f10f57-1f1f-4959-a77a-fc9c8fdc883e
📒 Files selected for processing (2)
auth_proxy.pytests/test_auth_proxy_dashboard_full.py
POST /dashboard/api/keys now accepts an optional sha256_prefix with rotate=true: only the matching active key gets expires_at/replaced_at, instead of every active key of the consumer. Unknown prefix returns 404 key_not_found; malformed prefix 400. rotate=true without a prefix keeps the legacy rotate-all behavior. The drawer's per-row Rotate button passes its row's prefix, so 'Rotate this key' is now accurate, and is hidden on keys already rotated out (expires_at pending). Flagged by CodeRabbit on PR #69.
The repo had no pre-merge checks. notify-ci.yml fires on push to main — after the merge button — and only dispatches to the private CI repo; PR checks were CodeRabbit alone, and branch protection required a review but zero status checks. tests/test_antseed_node.py was consequently red for a month across #63/#68/#69/#70/#71 and every one merged. Three jobs: - tests: pytest against a UTF8 Postgres service (SQL_ASCII makes psycopg return TEXT as bytes, which silently voids settings overrides), submodules checked out so the engine-backed tests are real, node present for the sidecar suite. - core-tests: the Lua policy core's unit + golden conformance vectors. - images: build both images, then smoke the artifact. The image smoke is the one that would have caught #95. A green suite proves the REPO is consistent and says nothing about what COPY put in the image — which is exactly how a control.js requiring ./ids.js shipped without it, died at import, and took every wallet endpoint down with a 502. scripts/check_sidecar_modules.js resolves (never executes) each shipped module's local imports inside the built image; verified to reproduce that failure against the old COPY list.
…#96) * ci: gate merges on tests, core conformance and a built-image smoke The repo had no pre-merge checks. notify-ci.yml fires on push to main — after the merge button — and only dispatches to the private CI repo; PR checks were CodeRabbit alone, and branch protection required a review but zero status checks. tests/test_antseed_node.py was consequently red for a month across #63/#68/#69/#70/#71 and every one merged. Three jobs: - tests: pytest against a UTF8 Postgres service (SQL_ASCII makes psycopg return TEXT as bytes, which silently voids settings overrides), submodules checked out so the engine-backed tests are real, node present for the sidecar suite. - core-tests: the Lua policy core's unit + golden conformance vectors. - images: build both images, then smoke the artifact. The image smoke is the one that would have caught #95. A green suite proves the REPO is consistent and says nothing about what COPY put in the image — which is exactly how a control.js requiring ./ids.js shipped without it, died at import, and took every wallet endpoint down with a 502. scripts/check_sidecar_modules.js resolves (never executes) each shipped module's local imports inside the built image; verified to reproduce that failure against the old COPY list. * ci: give the image smoke a database and fail fast on a dead container The router opens a host-store pool at startup, so booting it without Postgres proved only that it can fail to connect. Adds a postgres service to the images job and runs the container with --network host so it can reach it (a bridged container cannot see the runner's localhost). Also drops the '|| true' after docker run: a container that fails to start must fail the job immediately, not fall through to a curl loop that reports the same thing sixty seconds later.
What
Reworks the consumer-key management UI, which was a single drawer doing four jobs (settings, reveal, create/rotate, revoke) with four duplicate "Consumer" text inputs and raw "Grace seconds" jargon.
Backend
New admin-guarded
GET /dashboard/api/keys/list?consumer=...returning hash-only per-key metadata:sha256_prefix,status,created_at,expires_at,replaced_at,revoked_at,recoverable. No raw key material. Existing create/reveal/revoke endpoints unchanged.Tests
pytest tests -q: 462 passed, 2 skipped, 1 failed — the failure is the pre-existingtest_antseed_node.pyNode module-resolution issue, unrelated to this change. Dashboard suite: 66/66, including 4 new tests for the list endpoint (auth required, metadata without raw keys, recoverable flag, consumer validation).Summary by CodeRabbit
New Features
Bug Fixes