Skip to content

feat(api): manage API keys by non-secret ID - #85

Merged
koitococobot[bot] merged 2 commits into
mainfrom
feat/api-key-id-management
Nov 24, 2026
Merged

koitococobot[bot] merged 2 commits into
mainfrom
feat/api-key-id-management

Conversation

@koitococobot

@koitococobot koitococobot Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add admin-only ID endpoints for soft revocation and historical token usage. Distinguish repeat revocation from an unknown ID, and keep generation and Embeddings totals separate from live rate-limit buckets.
  • Return the ID on manual issuance as well; preserve the existing external-ID ensure behavior and legacy endpoints. No database migration.
  • Log route templates instead of raw URLs, and remove plaintext API keys from database, usage, rate-limit, Embeddings, and initialization diagnostics.

Verification

  • Backend TypeScript check passed (cd backend && bun run check).
  • Isolated HTTP smoke with PostgreSQL and Redis passed: admin authorization, unknown IDs, repeat revocation, inference 401 after revocation, retained per-key historical totals, and no synthetic credentials in access or debug logs.
  • The baseline full suite was not green: four existing search compiler assertions failed, and one suite could not load without a PostgreSQL connection.

Closes #84

Add ID-based revocation and separate historical generation and embedding totals.
Remove plaintext credentials from request, database, usage, and initialization logs.

Refs #84
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a27dffb0-9e32-4ea7-aa58-b6821ad00e28

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

Declare the already locked OpenAPI types in the backend workspace so Bun resolves one Elysia instance for the app and Swagger.
Resolve ID route and usage handler lint findings revealed after type checking passes.
@koitococobot
koitococobot Bot merged commit 7bd9027 into main Nov 24, 2026
2 checks passed
@koitococobot
koitococobot Bot deleted the feat/api-key-id-management branch November 24, 2026 01:16
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.

支持按非秘密 ID 撤销 API Key 和查询历史用量,并对日志脱敏

1 participant