-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
token-aware-jsonify: Stringify resolved tokens (#406)
`token-aware-jsonify`, which is currently used to serialize CloudWatch dashboard configuration into a JSON string is expected to return a stringified JSON object. This means that any string within the object must be escaped (e.g. not include "\n" or quotes). The function currently stringifies the primary string but this still leaves room for non-allowed characters in the resolved tokens. For example, if a token resolves to `{ "Fn::Join": [ "", [ "Hello,\nWorld!" ] ] }` then the deploy-time value will be "Hello,\nWorld!" which must be represented in JSON as "Hello,\\nWorld!". This change eagerly stringifies all string values in the resolved tokens. Theoretically this might cause trouble in the case where token strings have special characters AND not emitted, but this seems like a long shot and we optimize for the common case.
- Loading branch information
Elad Ben-Israel
authored
Jul 25, 2018
1 parent
cda89b5
commit 264e6b5
Showing
2 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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