Repository navigation
Conversation
Serve GET, POST, PUT and DELETE on /organizations/{organization_id}/connected_accounts/{slug}.
An organization holds one account per provider with user_id null, apart from any its members
hold. Import and update name the acting member in user_id, who must be an active member.
Accounts now report established_by_user_id, cleared when that user is deleted. Deleting an
organization deletes its accounts and its members' accounts scoped to it. The connectedAccounts
seed takes owner: organization.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe the organization-owned rules in prose, as the other behavior sections do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
An overlapping import otherwise misses the other's write and both answer 201. Cover the members' scoped accounts in the organization-delete cascade test, and say plainly that ending a membership does not clear credentials, unlike production. Co-Authored-By: Claude Opus 5.5 <[email protected]>
As CLAUDE.md asks, and cite production's invalidation when the establishing member leaves. Co-Authored-By: Claude Opus 5.5 <[email protected]>
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryAdds organization-owned connected accounts alongside user-owned accounts.
No actionable issues were found. Tests were inspected, not run. Explicit boundaries from
|
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
GET|POST|PUT|DELETE /organizations/{organization_id}/connected_accounts/{slug}.user_id: null, apart from any accounts its members hold.POSTandPUTtake the acting member inuser_id, who must be an active member of the organization.established_by_user_id: the member who imported an organization's account, or who was seeded as establishing it. It isnullon a user's own account, and becomesnullwhen that member is deleted.pipes.connected_account.disconnected. Before, the members' scoped accounts were left behind.connectedAccountsseed takesowner: organization, withemailoptional to name who established the account.POSTandPUTread the account after awaiting the body, so two overlapping imports give one 201 and one 409.insertConnectedAccountreplaces the insert that the user import and the seed each spelled outimportedFieldsbuilds the fields an import takes from its body, andupdateAccountis thePUTboth paths use.docs/behavior.mdunder "Pipes / Connected Apps", anddocs/seeding.mddescribe the updated behaviors.Behaviour
POSTorPUTwithoutuser_id422POSTorPUTwhoseuser_idis not an active member403POSTwhen the organization already has an account for the provider409 conflictBoundary
connection_intent,connected_account_id,supports_multiple_connections) is not supported.Verification
Full suite: 1908 pass, 0 fail.
bun run typecheck,bun run lint,bun run fmt:checkandbun run gen:supportedare clean. New tests inconnected-accounts.spec.tscover the four verbs, membership, overlapping imports, the organization-delete cascade, the establisher after a user delete, and seeding and its validation.Resolves part of #176 .