Replaces the single per-user DRF token with named, individually-revocable
API keys, so you can run one key per agent and cut off a leaked one without
disrupting the others.
- New ApiKey model (user, name, dbk_-prefixed key, created_at, last_used_at).
Data migration copies every existing authtoken 1:1 into a "default" named
key with the same value, so no client (incl. the sibling test project's
hardcoded test-user key) needs reconfiguring.
- Auth (resolve_token_user) resolves against ApiKey and stamps last_used_at,
throttled to one write/minute.
- Settings -> API Keys: table with name/key/created/last-used + per-row
revoke and a create form; keys viewable on demand. Settings -> Account now
links here; Settings -> Users issues a named initial key.
- Gated provisioning API for test installations: GET/POST /api/keys and
DELETE /api/keys/{id}, controlled by DAYBOOK_KEY_PROVISIONING_API (unset ->
follows DEBUG, so off in deployment). Advertised via key_provisioning_api
in /api/capabilities; 403 when disabled.
- Docs (api/deployment/quickstart/posting-helper), SKILL.md, and env.example
updated from "token / Settings -> Account" to "key / Settings -> API Keys".
- Tests: new API + UI suites for keys; existing token-based tests moved to
ApiKey. Full suite 129 passing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
1.8 KiB
Python
29 lines
1.8 KiB
Python
from django.urls import path
|
|
|
|
from . import views
|
|
|
|
|
|
urlpatterns = [
|
|
path("", views.feed, name="feed"),
|
|
path("feed/older", views.feed_older, name="feed-older"),
|
|
path("a/<str:artifact_id>/read", views.mark_artifact_read, name="artifact-mark-read"),
|
|
path("a/<str:artifact_id>/keep", views.toggle_artifact_keep, name="artifact-toggle-keep"),
|
|
path("a/<str:artifact_id>/share", views.toggle_artifact_share, name="artifact-toggle-share"),
|
|
path("a/<str:artifact_id>", views.artifact_view, name="artifact"),
|
|
path("s/<str:share_token>", views.shared_artifact_view, name="artifact-shared"),
|
|
path("assets/<str:asset_id>", views.asset_view, name="asset"),
|
|
path("api/assets", views.AssetUploadView.as_view(), name="asset-upload-api"),
|
|
path("api/capabilities", views.CapabilitiesView.as_view(), name="capabilities-api"),
|
|
path("api/skill", views.SkillView.as_view(), name="skill-api"),
|
|
path("api/keys", views.ApiKeyListCreateView.as_view(), name="api-keys"),
|
|
path("api/keys/<int:key_id>", views.ApiKeyDetailView.as_view(), name="api-key-detail"),
|
|
path("api/artifacts", views.ArtifactListCreateView.as_view(), name="artifact-api"),
|
|
path("api/artifacts/<str:artifact_id>", views.ArtifactDetailView.as_view(), name="artifact-detail-api"),
|
|
path("settings/", views.settings_home, name="settings-home"),
|
|
path("settings/account/", views.settings_account, name="settings-account"),
|
|
path("settings/api-keys/", views.settings_api_keys, name="settings-api-keys"),
|
|
path("settings/users/", views.settings_users, name="settings-users"),
|
|
path("settings/demo-data/", views.settings_demo_data, name="settings-demo-data"),
|
|
path("settings/storage/", views.settings_storage, name="settings-storage"),
|
|
path("settings/about/", views.settings_about, name="settings-about"),
|
|
]
|