YAML: fail loading when timestamp is found #1756
Closed
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 edit
a 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?