@W-22899437 fix: set default OCAPI/WebDAV permissions on VS Code sandbox creation - #614
Merged
Merged
Conversation
…box creation
The VS Code extension's Create Sandbox command sent only {realm, ttl,
analyticsEnabled} and omitted the settings object, so new sandboxes had
no OCAPI/WebDAV permissions for the configured client -- unlike the CLI's
sandbox create. Downstream code deploys and job executions then failed
with authorization errors until permissions were set manually.
Extract the default-permission logic into a shared SDK helper
(buildSandboxSettings) so the CLI and the extension apply the same
defaults. The CLI now delegates to it, and the extension builds settings
from the configured clientId and passes them in the POST body.
…ngs test The custom test values used `as const`, producing readonly tuples that failed the SDK pretest type-check (tsc --noEmit -p test) in CI. Annotate them with the generated OcapiSettings/WebDavSettings types instead.
…ocapi-vscode # Conflicts: # packages/b2c-tooling-sdk/src/index.ts # packages/b2c-tooling-sdk/src/operations/ods/index.ts # packages/b2c-vs-extension/src/sandbox-tree/sandbox-commands.ts
This was referenced Aug 18, 2026
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.
What
The VS Code extension's Create Sandbox command now grants the configured OAuth client the same default OCAPI/WebDAV permissions as the CLI's
b2c sandbox create.The default-permission logic is extracted into a new shared SDK helper
buildSandboxSettings(@salesforce/b2c-tooling-sdk,operations/ods/sandbox-settings.ts), so the CLI and the extension apply identical defaults from one source:/code_versions,/code_versions/*,/jobs/*/executions,/jobs/*/executions/*,/sites/*/cartridges/impex,/cartridges,/staticThe CLI's
sandbox createnow delegates to the helper (behavior unchanged). The extension builds settings from the configuredclientIdand passes them in thePOST /sandboxesbody.Why
Previously the extension sent only
{realm, ttl, analyticsEnabled}and omitted thesettingsobject entirely. Sandboxes created from the extension therefore had no API permissions for the client, so subsequent code deploys and job executions failed with authorization errors until permissions were set manually — inconsistent with the CLI.Testing
dw.json, create a sandbox via the sandbox tree → Create Sandbox, then confirm the client can deploy code / run jobs against the new sandbox without manually granting OCAPI/WebDAV permissions.Fixes W-22899437