Perform Base64 decode before JSON validation in create payloads#1074
Draft
ks-temporal wants to merge 1 commit into
Draft
Perform Base64 decode before JSON validation in create payloads#1074ks-temporal wants to merge 1 commit into
ks-temporal wants to merge 1 commit into
Conversation
Previously, the Base64 decoding was done after JSON validation. This prevented setting --input option with Base64 of JSON value. Base64 decoding is now done before any JSON validation, if encoding indicates json.
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 changed?
Previously, the Base64 decoding was done after JSON validation. This prevented
setting --input option with Base64 of JSON value. Base64 decoding is now done
before any JSON validation, if encoding indicates json.
Why changed?
The --input-base64 boolean flag indicates that the input is in base64. From help:
If the flag is present, then input is not in JSON, and must be supplied as base64
encoded value. If no input-meta is supplied to change the encoding, or is set as
json/plain or similar, then previously, it attempted to validate input as JSON before
base64 decode, which failed.
Checklist
Stability
-o json/-o jsonl) are treated as breaking changesDesign
temporal <noun> <verb>structure (e.g.temporal workflow start)--search-attribute, bad:--index-field)(Experimental)incommands.yamlHelp text (see style guide at the top of
commands.yaml)--namespace, not-n), one flag per lineYourXxxform (YourWorkflowId,YourNamespace)Behavior
Tests
SharedServerSuite)func TestXxx) where applicableManual tests
Setup
Start server, and worker from samples-go for standalone_activity/helloworld
Happy path
The following test should not work previously, but should work after the fix in this PR.
Without the fix:
With the fix: