Skip to content

feat(llm): provider auth abstraction — OAuth/device-code/session sign-in + vault-stored refresh, beyond API keys (#10551) - #10982

Merged
mrveiss merged 5 commits into
Dev_new_guifrom
issue-10551
Jul 6, 2026
Merged

mrveiss merged 5 commits into
Dev_new_guifrom
issue-10551

Conversation

@mrveiss

@mrveiss mrveiss commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Thinking Path

Agent-framework epic #10542 (model-choice freedom): providers assumed a per-token API key. Add an auth abstraction so users can use a subscription via OAuth/device-code/session, not only a billed key.

What Changed

llm_shared/provider_auth.py: ProviderAuthStrategy with ApiKeyAuth (backward-compatible default), OAuthAuth (auth-code+PKCE, transparent refresh 5min-before-expiry), DeviceCodeAuth (RFC 8628), SessionAuth. Tokens sealed in the unified-secrets System vault (provider_auth:{provider}:{subject}), never logged, DEK-sprawl-safe upsert. base_provider gains optional auth_strategy + _get_auth_token(); auto-builds ApiKeyAuth from settings so every existing key-based provider keeps working unchanged. api/provider_auth.py: OAuth callback + device-initiate/poll + status/revoke. Frontend ProviderOAuthConnect.vue "Sign in / API key" toggle. Reuses the existing oauth_flow PKCE/exchange/refresh machinery.

Verification

30 tests pass (all strategies, api_key backward-compat, token-never-logged, expired→refresh+vault-upsert). Closes #10551. Live OAuth/device-code round-trip needs a real IdP/provider.

Model Used

Claude Opus 4.8 (senior-backend-engineer subagent).

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

github-actions Bot and others added 4 commits July 6, 2026 08:35
Applied Black, isort, and autoflake to match code-quality checks.
Triggered by workflow auto-fix-formatting.yml.
…(https/host/no-IP/no-redirect) on OAuth/device URLs (#10551 security review)
Applied Black, isort, and autoflake to match code-quality checks.
Triggered by workflow auto-fix-formatting.yml.
@mrveiss
mrveiss merged commit fc6753a into Dev_new_gui Jul 6, 2026
@mrveiss
mrveiss deleted the issue-10551 branch July 6, 2026 08:44
mrveiss added a commit that referenced this pull request Jul 6, 2026
…uth (empty setting names + vault type tag) — clears code-quality on base (#10982 follow-up)
mrveiss added a commit that referenced this pull request Jul 6, 2026
…sc errors on base (#10984)

* fix(ui): MemoryPrivacyPanel — showToast takes positional (message, type), not an object; clears 3 vue-tsc errors on Dev_new_gui

* fix(security): nosec 3 bandit B105/B106 false-positives in provider_auth (empty setting names + vault type tag) — clears code-quality on base (#10982 follow-up)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant