chef-vault icon indicating copy to clipboard operation
chef-vault copied to clipboard

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

Open jkimalane opened this issue 4 years ago • 4 comments

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

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • [x] I have read the CONTRIBUTING document.
  • [ ] I have run the pre-merge tests locally and they pass.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.
  • [ ] All commits have been signed-off for the Developer Certificate of Origin.

jkimalane avatar Dec 02 '21 15:12 jkimalane

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

schrd avatar Dec 15 '22 08:12 schrd

@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 avatar Jun 13 '23 17:06 splatteredbits

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

splatteredbits avatar Jun 13 '23 17:06 splatteredbits