Skip to content

Track API key last-used dates#171

Merged
jgpruitt merged 1 commit into
mainfrom
jgpruitt/apikey-last-used-on
Jul 17, 2026
Merged

Track API key last-used dates#171
jgpruitt merged 1 commit into
mainfrom
jgpruitt/apikey-last-used-on

Conversation

@jgpruitt

Copy link
Copy Markdown
Collaborator

Summary

  • add day-level api_key.last_used_on metadata and touch_api_key with one-update-per-day semantics
  • record usage after successful API-key auth with a process-local cache, lazy 24-hour flush, and best-effort failure handling
  • expose lastUsedOn through engine/protocol/RPC/CLI and document the field

Tests

  • ./bun test packages/server/middleware/api-key-usage.test.ts
  • ./bun test --timeout 30000 packages/database/core/migrate/migrate.integration.test.ts packages/engine/core/core.integration.test.ts packages/engine/core/db.integration.test.ts packages/server/middleware/authenticate-space.integration.test.ts packages/server/middleware/authenticate-user.integration.test.ts packages/server/rpc/user/api-key.integration.test.ts
  • ./bun run check
  • git diff --check

@jgpruitt
jgpruitt requested review from cevian and murrayju as code owners July 17, 2026 19:43
@jgpruitt jgpruitt self-assigned this Jul 17, 2026
@jgpruitt
jgpruitt merged commit 54e4d7d into main Jul 17, 2026
6 checks passed
@jgpruitt
jgpruitt deleted the jgpruitt/apikey-last-used-on branch July 17, 2026 20:01
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