fix: scope VTEX ID calls to commerce stable#658
Open
vmourac-vtex wants to merge 1 commit into
Open
Conversation
Route VTEX ID validation through the requesting account commerce stable host to avoid cross-account token validation through the global VTEX ID endpoint. Co-authored-by: Cursor <cursoragent@cursor.com>
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 is the purpose of this pull request?
Scope VTEX ID calls in
@vtex/apito the requesting account commerce stable host instead of the globalvtexid.vtex.com.brhost.What problem is this solving?
This mirrors the
rewritercross-account request fix by validating VTEX ID tokens through{{account}}.vtexcommercestable.com.brandPOST /api/vtexid/credential/validate?an={{account}}, avoiding cross-account token validation through the global VTEX ID endpoint.CODEOWNERS:
@vtex/composable-commerce-sq4.How should this be manually tested?
yarn test ID.test.ts Auth.test.ts --runInBandtslintforID.ts,ID.test.ts,Auth.ts, andAuth.test.tsyarn buildvtexid.vtex.com.brorpub/authenticated/user@vtex/apiintorewriter/nodeand validated negativeinternal.save/internal.saveManyrequests reachedensureAuthorizationinstorecomponents/victormouraVtexIdclientAutCookietoken still needs to be run in a secure shell session withVTEX_ID_TOKENsetKnown repo-wide verification notes:
yarn test --runInBandstill fails in pre-existing OpenTelemetry OTLP resolution and axios ESM parsing suites unrelated to this change.yarn lintstill reports pre-existing repo-wide lint errors; changed files pass scoped lint.Screenshots or example usage
N/A.
Types of changes
Made with Cursor