feat: Add API key authentication for backup tool

- Add get_api_key() and require_api_key() to auth.py
- Add generic key-value settings storage to SettingsStore
- Add test_api_key_auth to verify the implementation
- Uses secrets.compare_digest for timing-safe comparison
- Auto-generates API key on first use and stores in settings DB
This commit is contained in:
2026-05-11 21:25:46 +02:00
parent f912623677
commit 836f733a2e
31 changed files with 2014 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
380698
1778526681407
+6
View File
@@ -0,0 +1,6 @@
# Runtime data
*.db
*.db-journal
*.db-wal
*.db-shm
daemon-state.json
+20
View File
@@ -0,0 +1,20 @@
# Stoneforge Configuration
database: stoneforge.db
sync:
auto_export: true
elements_file: elements.jsonl
dependencies_file: dependencies.jsonl
playbooks:
paths:
- playbooks
identity:
mode: soft
merge:
auto_merge: true
target_branch: stoneforge/review
require_approval: false
workflow:
preset: review
agents:
permission_model: unrestricted
View File
+1
View File
@@ -0,0 +1 @@
{"id":"el-2rt3","type":"entity","createdAt":"2026-05-11T19:11:16.359Z","updatedAt":"2026-05-11T19:20:17.978Z","createdBy":"el-0000","tags":[],"metadata":{"agent":{"agentRole":"director","sessionStatus":"idle","maxConcurrentTasks":1,"channelId":"el-4cua","provider":"opencode","model":"kimi-for-coding/k2p6"}},"name":"director","entityType":"agent"}