Repository navigation
WKS-3612 - Escape server-supplied action metadata in jf worker init templates - #73
Merged
Merged
Conversation
vitaliil-jfrog
approved these changes
Nov 4, 2026
This branch is waiting to be deployed
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
jf worker initnow JSON-encodes every value it writes intomanifest.json, and rejects anexecutionRequestTypefrom the actions metadata that is not a valid TypeScript identifier.Why
The scaffold templates were rendered with
text/template, which does no escaping. A value containing a quote could change the structure of the generatedmanifest.json(for example, add or override keys). Generating a normal manifest gives exactly the same output as before.Changes
commands/common/cmd_io.go: a sharedTemplateFuncswith ajsonfunction (json.Marshal).commands/templates/manifest.json_template: the worker name, action, project key and application values go through{{json ...}}.commands/init_cmd.go: the templates are parsed withTemplateFuncs. A non-identifierexecutionRequestTypeis rejected before any file is written.commands/common/test_commons.go: the expected-output helper uses the same funcs.commands/init_cmd_test.go: three new cases:applicationgives valid JSON withsourceCodePathunchanged;Testing
make testpasses. The existing golden-output tests are unchanged.initagainst a local stub actions server with crafted metadata: the manifest stays valid, and the values are kept literally.initfor every listed action, thentest-run,deploy,listandrm. The scaffold output is identical tomain.