YAML: fail loading when timestamp is found#1756
Closed
felixfontein wants to merge 1 commit intogetsops:mainfrom
Closed
YAML: fail loading when timestamp is found#1756felixfontein wants to merge 1 commit intogetsops:mainfrom
felixfontein wants to merge 1 commit intogetsops:mainfrom
Conversation
Contributor
Author
|
An alternative approach would be to convert timestamps to strings before encryption. I don't like that solution either, though, since it is a destructive conversion of content. Maybe the best solution is to implement encryption and decryption of timestamps? |
Contributor
Author
|
Alternative: #1759. |
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.
Right now SOPS does not support timestamps (see also #944), and trying to encrypt a YAML document containing one exits at encryption time (and not load time).
This has the consequence that if you
sops edita YAML file and happen to enter a timestamp, then save and exit to let SOPS encrypt it, then it will successfully load the edited file, thus exit the edit loop, but then fail to encrypt, and exit. Thus you won't get back to the editor with a chance to quote the timestamp.Changing this to a load-time error ensures that you stay in the edit loop and can fix the timestamp in the editor.
(The other formats don't support timetstamps either, so nothing is lost.)
One potential drawback: if the timestamp is not encrypted (due to one of the many options to not encrypt certain values), loading and storing it did work before. (See #944 (comment).) This makes this potentially a breaking change. WDYT?