feat: OAuth Connected Accounts — provider-agnostic integration layer#106
Merged
Conversation
…ema and targets FK Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…and token refresh Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nt for managed targets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… for managed targets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d targets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ariables Provider credentials (Azure AD client ID/secret) are now configured via OAUTH_MICROSOFT_CLIENT_ID and OAUTH_MICROSOFT_CLIENT_SECRET env vars. The seed-providers module auto-creates/updates the Microsoft 365 provider on startup. Removed the provider CRUD UI from Settings page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tatic code registry Provider config (OAuth URLs, scopes) is now defined in code. Credentials (client_id, client_secret) come from env vars only — never stored in the database. The integration_providers table, seed-providers module, and provider CRUD service are removed. connected_accounts.provider_id (uuid FK) → provider_type (varchar string) that references the static registry key (e.g. "microsoft_365"). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n, UI improvements - Squash 0013+0014 migrations into single clean migration (no integration_providers table) - Fix slug collision on reconnect by appending account ID suffix - Add Manage Access dialog with switch toggles for API key permissions - Add .superpowers/ to .gitignore - Use /common/ auth URL for personal + work Microsoft accounts - Add Mail.ReadWrite.Shared and Calendars.ReadWrite.Shared scopes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nique constraint, race condition
- updateTarget/deleteTarget now throw Error instead of returning { error }
for managed targets (fixes silent 200 response on API)
- Add unique constraint on (provider_type, email) to prevent duplicate accounts
- Add in-memory mutex to deduplicate concurrent token refresh calls
- Update AGENTS.md with connected accounts architecture
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Architecture
Provider registry:
src/lib/server/providers.ts(static, env vars for credentials)Connected accounts service:
src/lib/server/services/connected-accounts.tsOAuth routes:
src/routes/oauth/authorize/+src/routes/oauth/callback/Key design decisions
integration_providersDB table — providers defined in code, credentials fromOAUTH_MICROSOFT_CLIENT_ID/OAUTH_MICROSOFT_CLIENT_SECRETenv varsapi_requestagainst Graph API, no dedicated calendar toolsupdateTarget/deleteTargetthrow Error for managed targets(provider_type, email)— prevents duplicate accountsTest plan
🤖 Generated with Claude Code