Repository navigation
fix(vtex): always authenticate masterdata createDocument - #1688
Conversation
VTEX now rejects anonymous writes to /api/dataentities. createDocument defaulted to vcsDeprecated, which never sends App Key/Token. Use vcs (same base URL, sends credentials when configured) for every request and deprecate isPrivateEntity, now ignored. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Tagging OptionsShould a new tag be published when this PR is merged?
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
What
vtex/actions/masterdata/createDocumentnow always calls Master Data throughvcs, which sendsX-VTEX-API-AppKey/X-VTEX-API-AppTokenwhen the VTEX app has them configured.Why
VTEX is rejecting anonymous writes to
/api/dataentities. By default (isPrivateEntityunset) this action went throughvcsDeprecated, which never sends App Key/Token — only the shopper's cookie — so document creation started failing.defaultVisibility = "private"(not invokable from the browser), so always using the store credentials does not expose them.updateDocumentandsearchDocumentsalready usevcs— no change.isPrivateEntityis kept inPropsas@deprecated/@hideand ignored, so existing blocks and TS callers don't break.Impact on sites
acronymand whitelist fields, since writes now carry store credentials.Testing
deno task check(fmt, lint, check) passes.🤖 Generated with Claude Code
Summary by cubic
Fixes
createDocumentso Master Data writes always go throughvcs, which sends the app's App Key/Token when configured, because VTEX now rejects anonymous writes to/api/dataentities. TheisPrivateEntityprop is deprecated and ignored;vcsDeprecatedis no longer used.Impact
acronymand whitelist fields since writes now carry store credentials.Written for commit e0beadc. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Deprecation