Skip to content

Let admins list and revoke project API keys - #358

Merged
dipeshbabu merged 1 commit into
mainfrom
feat/api-key-revocation
Nov 20, 2026
Merged

dipeshbabu merged 1 commit into
mainfrom
feat/api-key-revocation

Conversation

@dipeshbabu

Copy link
Copy Markdown
Owner

Follow-up to #357. On a shared server a leaked project key could not be revoked without editing the database, and signed-in dashboard sessions never re-checked their key.

Revocation

  • Both stores: `list_api_keys(project_id)` (prefix, name, created/last-used, never key values or hashes) and `revoke_api_key(project_id, prefix)` (deletes only that project's keys with the 10-char prefix; validates the prefix).
  • Admin-only routes: `GET /v1/api-keys?project_id=` and `DELETE /v1/api-keys/{prefix}?project_id=` (401 without admin key or with a project key, 404 when nothing matches, 422 for a malformed prefix).
  • `AgentLoopClient.list_api_keys` / `revoke_api_key` (admin header only, path-quoted prefix); CLI `list-api-keys`, `revoke-api-key`, `remote-list-api-keys`, `remote-revoke-api-key`.

Dashboard (project mode)

  • Sessions re-verify their key at least every 60 s and sign out with a notice when it was revoked or moved to another project.
  • The Ingest page offers only uploads into the signed-in project; demo generators that write into the host's shared `runs/` are hidden.

Tests: store contract (SQLite + Postgres in CI) incl. cross-project revoke refusal; server routes and that a revoked key gets 401; client URL/header scope; CLI; dashboard session recheck and Ingest page. 218 related tests pass locally. Docs: PRODUCTION, CLOUD_DEPLOY (Revoke a key), DASHBOARD, API_VERSIONING, changelog.

🤖 Generated with Claude Code

A leaked project key could not be revoked without editing the database,
and signed-in dashboard sessions never re-checked their key. Both stores
gain list_api_keys and revoke_api_key (by project and prefix), exposed as
admin-only GET/DELETE /v1/api-keys routes, AgentLoopClient methods and
local and remote CLI commands; listings never include key values.
Project-mode dashboard sessions re-verify their key every minute and
sign out when it is revoked, and shared dashboards no longer offer demo
generators that write files on the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

Copy link
Copy Markdown

AgentLoop replay self-test

This required repository check evaluates generated synthetic demo traces. It tests the replay and CI machinery; it does not show that this PR improves application performance.

AgentLoop CI Report

  • Status: passed
  • Replay: Replay passed: latency improvement 69.66%, cost improvement 78.82%, retry delta -1.
  • Merge recommendation: synthetic self-test only; assess application traces before merge
  • Findings: 1 total, 0 high severity, 1 patchable

Performance Gates

Gate Status Detail
latency_regression pass 0.00% regression <= 0.00% allowed
cost_regression pass 0.00% regression <= 0.00% allowed
latency_improvement pass 69.66% improvement >= 20.00% required
cost_improvement pass 78.82% improvement >= 5.00% required
retry_non_increase pass 0 candidate retries <= 1 baseline retries

Trace inputs

This comparison includes synthetic data. It does not establish application performance gains from a pull request.

Side Run ID Path Synthetic marker Source
baseline run_2380600325bf46cd runs/research_agent_baseline.json yes agentloop_demo
candidate run_5f89e986434947af runs/research_agent_optimized.json yes agentloop_demo

Metric Impact

Metric Impact
Latency improvement 69.66%
Cost improvement 78.82%
Retry delta -1
Candidate schema validity not provided
Candidate quality score not provided

Top Findings

Finding Severity Type Rewrite
al_cache_context_cd4df522e8e6: Cache repeated prompt/context prefix medium cache_context Move stable instructions into cached prefixes, summaries, or framework-level memory instead of resending full text.

@dipeshbabu
dipeshbabu merged commit 581c419 into main Nov 20, 2026
26 checks passed
@dipeshbabu
dipeshbabu deleted the feat/api-key-revocation branch November 20, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant