[10] feat: auth flows and keyring-backed credential storage #37
No reviewers
Labels
No labels
auto-merge
bug
chore
dependency
duplicate
enhancement
upstream-sync
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
OpenCode/Arachne!37
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/10_auth_secrets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #10
Summary
Auth layer for Open WebUI instances: username/password sign-in → JWT, manual API-key registration as equal path, session restore with typed re-login handling, and libsecret-backed credential storage.
Implementation
Core (
crates/core/src/auth.rs):SignInRequest/SignInResponse+SessionUserInfomodels (serde defaults, unknown fields ignored)SecretStoretrait — Core stays headless;InMemoryStoreHandlefor testssign_in(): POST /api/v1/auths/signin, 400 →AuthError::InvalidCredentials, 429 → Http with body preservedregister_api_key(): trims input, rejects empty keys, expires_at None (valid until server says 401)restore_session(): classifies stored secret by "sk-" prefix (JWT vs API key), fetches identity via GET /api/v1/auths/fetch_identity()for identity display after loginAuthSession— tokens never leak into logsUI (
crates/ui/src/secrets.rs):KeyringStoreimplementingSecretStorevia libsecret 0.9 (schemaeu.hobbypunk.Arachne, attribute "account", default collection)Reverse-Proxy design consideration (per ticket): documented in
docs/api/feature-detection.md— proxy sign-in as third auth path, per-instance custom headers,features.auth_trusted_headerindicator, x-api-key fallback viaCUSTOM_API_KEY_HEADER. Full proxy tests in follow-up ticket as planned.Acceptance
Checks
cargo build --workspace --locked✅cargo test -p arachne-core30/30 ✅cargo clippy --workspace --all-targets -- -D warnings✅cargo fmt --check✅Co-Authored-By: OpenCode opencode@noreply.code.hoppe-dev.eu