fix(core): authorize relative external paths#37839
Open
H-TTTTT wants to merge 1 commit into
Open
Conversation
Relative paths that lexically escape the active Location (e.g. `../sibling/file`) were rejected before permission evaluation, so a valid patch against an approved external sibling target failed with an empty error and never reached `external_directory` authorization. Resolve relative mutation paths from the active Location and route any external target through the existing `external_directory` -> leaf approval flow, matching V1 behavior. Drop the now-unused `relative_escape` reason. Fixes anomalyco#37687
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.
Issue for this PR
Fixes #37687
Type of change
What does this PR do?
A relative mutation path that lexically escapes the active Location (e.g.
../sibling/file) was rejected before permission evaluation, so a validapply_patch/editagainst an approved external sibling target failed with an empty durable error instead of routing throughexternal_directoryauthorization.Relative paths now resolve from the active Location, and any external target flows through the existing
external_directory-> leaf approval path. The unusedrelative_escapereason is removed.Ports the V2 fix (#37689) to
dev.How did you verify your code works?
bun test test/location-mutation.test.ts— 10 passed (the relative-escape case now assertsexternal_directoryauthorization).bun run typecheckinpackages/core.Checklist