Skip to content

fix(oauth): clamp client ownership on single-workspace hosts - #1854

Closed
Adityakk9031 wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
Adityakk9031:fix/single-workspace-oauth-client-owner
Closed

fix(oauth): clamp client ownership on single-workspace hosts#1854
Adityakk9031 wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
Adityakk9031:fix/single-workspace-oauth-client-owner

Conversation

@Adityakk9031

Copy link
Copy Markdown
Contributor

Summary

On single-workspace hosts (local/desktop), all connections are org-scoped (LOCAL_CONNECTION_OWNER = "org"). Previously, oauth.clients.create, oauth.clients.registerDynamic, and oauth.createClient accepted owner: "user" clients, but those clients were categorically unusable because local connections were org-scoped and the cross-owner guard rejected them with cloud-specific wording ("A Workspace connection must use a Workspace app.").

This PR:

  1. Adds singleWorkspace?: boolean to ExecutorConfig (defaulting to true when subject === "local" or explicitly set).
  2. Clamps owner: "user" to owner: "org" in createClient, registerDynamicClient, and core tools (oauth.clients.create, oauth.clients.registerDynamic, oauth.clients.createHandoff, oauth.clients.remove) on single-workspace hosts.
  3. Allows local connections on single-workspace hosts to use existing/legacy client rows without throwing the cross-owner error.
  4. Adds test coverage in packages/core/sdk/src/oauth-flow.test.ts and packages/core/sdk/src/executor.test.ts.

Closes #1850.

@Adityakk9031

Copy link
Copy Markdown
Contributor Author

@RhysSullivan Hey, I noticed the six PRs were closed without any comments, so I wanted to understand what I should change for future contributions. Were the changes not aligned with the project's current direction, or is there a contribution process I should follow before opening PRs?

I’d appreciate any feedback so I can avoid submitting changes that aren't useful to the project.

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.

Single-workspace hosts allow creating user-scoped OAuth clients that can never be used

2 participants