Skip to content

Reject source writes to personal scopes; visible target selector in add-source forms#511

Draft
RhysSullivan wants to merge 1 commit intors/cloud-workspaces-10-sources-sidebarfrom
rs/cloud-workspaces-11-source-target
Draft

Reject source writes to personal scopes; visible target selector in add-source forms#511
RhysSullivan wants to merge 1 commit intors/cloud-workspaces-10-sources-sidebarfrom
rs/cloud-workspaces-11-source-target

Conversation

@RhysSullivan
Copy link
Copy Markdown
Owner

Source-definition writes can only target shareable scopes (org or
workspace). Personal scopes (user_org_* / user_workspace_*) are
reserved for credentials, connections, and policies in the v1 product
model. The SDK now raises InvalidSourceWriteTargetError when
ctx.core.sources.register is called with a personal scope; the
openapi / mcp / graphql / google-discovery API groups expose this as a
422 on their addSource/addSpec endpoints so clients see a typed
recoverable error rather than a 500.

UI: every add-source form now mounts a SourceTargetSelector shared
component (packages/react/src/plugins/source-target-selector.tsx) that
renders Workspace / Global options and passes the selected scope id
explicitly to the underlying API call. The selector defaults to the
URL context's active write scope and skips personal scopes, so the
caller never invents a default that the SDK would reject.

The cloud test harness covers the legal write paths (workspace and org
targets from workspace context). The personal-scope rejection has SDK
test coverage in executor.test.ts; the HTTP layer wires the same
error through with httpApiStatus: 422.

…dd-source forms

Source-definition writes can only target shareable scopes (org or
workspace). Personal scopes (`user_org_*` / `user_workspace_*`) are
reserved for credentials, connections, and policies in the v1 product
model. The SDK now raises `InvalidSourceWriteTargetError` when
`ctx.core.sources.register` is called with a personal scope; the
openapi / mcp / graphql / google-discovery API groups expose this as a
422 on their addSource/addSpec endpoints so clients see a typed
recoverable error rather than a 500.

UI: every add-source form now mounts a `SourceTargetSelector` shared
component (`packages/react/src/plugins/source-target-selector.tsx`) that
renders Workspace / Global options and passes the selected scope id
explicitly to the underlying API call. The selector defaults to the
URL context's active write scope and skips personal scopes, so the
caller never invents a default that the SDK would reject.

The cloud test harness covers the legal write paths (workspace and org
targets from workspace context). The personal-scope rejection has SDK
test coverage in `executor.test.ts`; the HTTP layer wires the same
error through with `httpApiStatus: 422`.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing d05d7cb Commit Preview URL

Branch Preview URL
May 04 2026, 05:10 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud d05d7cb May 04 2026, 05:10 PM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@511

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@511

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@511

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@511

@executor-js/storage-core

npm i https://pkg.pr.new/@executor-js/storage-core@511

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@511

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@511

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@511

@executor-js/plugin-google-discovery

npm i https://pkg.pr.new/@executor-js/plugin-google-discovery@511

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@511

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@511

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@511

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@511

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@511

executor

npm i https://pkg.pr.new/executor@511

commit: d05d7cb

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