Repository navigation
Commit 4999772
feat: dynamic config, setup wizard, API key lifecycle, observability, and security hardening
Major platform improvements across all layers:
Backend:
- Dynamic configuration system (system_settings table + DynamicConfig service + Redis Pub/Sub sync)
- First-run setup wizard API (POST /api/setup/initialize with rate limiting and race condition protection)
- API key lifecycle: rotation with grace period, inactivity timeout, auto-disable, background enforcement task
- Prometheus metrics endpoint (GET /metrics on gateway port)
- Enhanced health checks (/health/live, /health/ready with 503 on failure, /api/health with latency stats)
- Three-state circuit breaker (Closed → Open → HalfOpen) with metrics
- Retry with exponential backoff and jitter
- Data retention background task (daily cleanup of expired records)
- Settings CRUD API (GET/PATCH /api/admin/settings) with input validation
Security:
- JWT secret minimum 32 chars with entropy check, 30s clock skew leeway
- CSP headers on console port
- Startup dependency validation (PG/Redis/keys) with clear error messages
- Setup endpoint rate limiting (5/min) and DB double-check against race conditions
- Team membership validation on API key creation
- Content filter pattern validation (500 max, severity enum, size limits)
- PII pattern regex compilation check (100 max, 1000 char limit)
- Soft-delete for users/providers/api_keys (deleted_at column)
- API key auth supports rotation grace period + deleted_at filter
- Account deletion changed to soft-delete with session revocation
Frontend:
- Setup wizard page (5-step onboarding with i18n)
- Editable settings page (7 tabs: General, Auth, Gateway, Security, Budget, API Keys, Data)
- API key lifecycle UI (rotate, edit, status badges, expiry warnings, expiring-soon filter)
Testing:
- 121 backend tests (config validation, settings validation, JWT TTL, content filter, PII redactor, retry)
- 25 frontend tests across 5 files (setup wizard, API keys, settings, API client, login)
Documentation:
- Updated all 16 doc files (README, architecture, API reference, configuration, security, deployment guide)
- New: secret-rotation.md, rewritten web/README.md
- Updated .env examples with dynamic config notes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent fe202c9 commit 4999772
63 files changed
Lines changed: 6671 additions & 520 deletions
File tree
- crates
- auth/src
- common/src
- models
- gateway
- src
- server
- src
- handlers
- middleware
- tasks
- docs
- en
- zh-CN
- migrations
- web
- src
- i18n
- lib
- routes
- admin
- gateway
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
67 | 73 | | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
| 84 | + | |
| 85 | + | |
71 | 86 | | |
72 | | - | |
| 87 | + | |
73 | 88 | | |
74 | 89 | | |
75 | 90 | | |
| |||
100 | 115 | | |
101 | 116 | | |
102 | 117 | | |
103 | | - | |
| 118 | + | |
104 | 119 | | |
105 | 120 | | |
106 | 121 | | |
| |||
119 | 134 | | |
120 | 135 | | |
121 | 136 | | |
122 | | - | |
| 137 | + | |
123 | 138 | | |
124 | 139 | | |
125 | 140 | | |
| |||
134 | 149 | | |
135 | 150 | | |
136 | 151 | | |
137 | | - | |
138 | | - | |
| 152 | + | |
| 153 | + | |
139 | 154 | | |
140 | 155 | | |
141 | 156 | | |
| |||
0 commit comments