Add PostgreSQL-backed API key storage

- api_keys.py: Database operations for API clients
  - bcrypt hashing for API keys
  - CRUD operations with full PostgreSQL support
  - Indexes for efficient client_id lookup
  - Soft delete (disable) and hard delete
  - Key regeneration support

- main.py: Wire up database storage
  - Startup/shutdown handlers for DB pool
  - Full admin CRUD endpoints
  - Token exchange uses DB lookup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egregore 2026-02-02 19:54:40 +00:00
parent 7a4907430f
commit 78ee93dbc6
3 changed files with 388 additions and 30 deletions

View file

@ -6,3 +6,4 @@ pyjwt>=2.8.0
bcrypt>=4.0.0
slowapi>=0.1.9
pydantic>=2.0.0
asyncpg>=0.29.0