Repository navigation
fix(template): never write a rendered path outside the output directory - #185
Merged
Merged
Conversation
…ry (GH-183) Execute requires filepath.IsLocal on every rendered path. A local template skips an escaping file or directory subtree with a warning; a cloned template (specs use <git-url>, or a registry entry with a remote repository) aborts naming every such path, before anything reaches the target.
…H-183) template validate warns about each path that renders outside the output with the schema defaults and sets exit bit 16.
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.
Closes #183
Summary
filepath.IsLocal; a..that stays inside is kept (a/../b/x.txt→b/x.txt)specs use <git-url>, and registered templates whose metadata records a remote repository, sotemplate download+template useis covered) abort naming every escaping path; nothing reaches the targettemplate validatereports escaping paths rendered with the schema defaults and sets the new exit bit16Decisions and skipped steps
--arg,--values, prompt) that makes a path escape is skipped with a warning for local templates, not an error; attributing a rendered path to its input source would need its own design__metadata.jsonis treated as localIsLocalruns after (as the issue specifies) so conditional directories keep working; nothing is written outside the output. Filed as An absolute rendered file name is dropped silently on Unix #184