|
Add API token auth system for headless/micro clients
Backend: - navi/auth/_ddl.py: add api_tokens table with boot-time migration - navi/auth/deps.py: _resolve_user now falls back to X-Api-Token header and ?api_token query param for WebSocket auth - navi/auth/__init__.py: add ApiToken pydantic model - navi/api/routes/api_tokens.py: CRUD endpoints (POST/GET/DELETE) - navi/main.py: wire api_tokens router Frontend: - webclient/src/App.vue: add #settings hash routing - webclient/src/components/settings/: SettingsView, ApiKeysPanel, CreateKeyModal with copy-to-clipboard flow - webclient/src/api/index.js: token CRUD API functions - webclient/src/stores/apiTokens.js: Pinia store - webclient/src/components/sidebar/AppSidebar.vue: settings link - webclient/src/composables/useWebSocket.js: append ?api_token= when localStorage token is present Tests: - tests/unit/auth/test_api_tokens.py: 10 unit tests covering token resolution (header + query param), revoke, missing/revoked tokens, orphan users, and CRUD endpoints Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
|---|
|
|
| navi/api/routes/api_tokens.py 0 → 100644 |
|---|
| navi/auth/__init__.py |
|---|
| navi/auth/_ddl.py |
|---|
| navi/auth/deps.py |
|---|
| navi/main.py |
|---|
| tests/unit/auth/test_api_tokens.py 0 → 100644 |
|---|
| webclient/dist/assets/index-BLRp95NP.js 0 → 100644 |
|---|
|
Not supported
|
| webclient/dist/assets/index-BPcN01j5.js 100644 → 0 |
|---|
|
Not supported
|
| webclient/dist/assets/index-CWzYkHtH.css 100644 → 0 |
|---|
| webclient/dist/assets/index-Wyt5c1oU.css 0 → 100644 |
|---|
| webclient/dist/index.html |
|---|
| webclient/src/App.vue |
|---|
| webclient/src/api/index.js |
|---|
| webclient/src/components/settings/ApiKeysPanel.vue 0 → 100644 |
|---|
| webclient/src/components/settings/CreateKeyModal.vue 0 → 100644 |
|---|
| webclient/src/components/settings/SettingsView.vue 0 → 100644 |
|---|
| webclient/src/components/sidebar/AppSidebar.vue |
|---|
| webclient/src/composables/useWebSocket.js |
|---|
| webclient/src/stores/apiTokens.js 0 → 100644 |
|---|