chef / chef-vault

Securely manage passwords, certs, and other secrets in Chef
Apache License 2.0
406 stars 158 forks source link

attempt to fix once and for all the issue with json validation introduced with version 4.0.13 #384

Open jkimalane opened 2 years ago

jkimalane commented 2 years ago

Attempt to fix once and for all the issue with json validation introduced with version 4.0.13

Change introduced with version 4.0.13 breaks loading of perfectly valid json data into the Chef vault.

Description

Amended methods printable?(string) and validate_json(json) so that json string which contains whitespaces or \n or \r escape sequences are marked as valid.

Perfectly valid json object (read from a file) now validates without triggering an exception or displaying a warning message.

{
"dummy": "aaaa\naaaa\n"
}

Related Issue

https://github.com/chef/chef-vault/issues/379

Types of changes

Checklist:

schrd commented 1 year ago

Who is reviewing pull requests in this project? We are affected by the same problem. @nikhil2611

splatteredbits commented 1 year ago

@jkimalane Any chance you can also remove the value from the warning message? Vault is supposed to protect secrets, so they shouldn't be printed to the output.

splatteredbits commented 1 year ago

@jkimalane Also, this PR needs a developer certificate of origin.