Add (simple) support for quoted multiline variables in .env files#1748
Add (simple) support for quoted multiline variables in .env files#1748MidasLamb wants to merge 1 commit intogetsops:mainfrom
Conversation
Signed-off-by: Midas Lambrichts <midaslamb@gmail.com>
6d4ba26 to
3ad5e74
Compare
|
Thanks for the quick response @felixfontein ! I quickly went through the issue, and I'd like to point out that this PR does not add a full dotenv parser. becomes after an encryption->decryption cycle. But semantically, these values are actually the same, so this shouldn't be a breaking change. This PR is just meant as a small incremental step to allow for multiline strings, without changing anything else really. In my reasoning the changes introduced here just expand the amount of allowed values, without doing any actual internal changes. The main issue seemed to be with this change: https://github.com/getsops/sops/pull/622/files#diff-c9aa3c7e333fa3bc6fa314822b8da1e449389f6bb14b68608e47d048c4997a08R104, where it adds single quotes unconditionally to values. If you want some additional tests/proof about this addition not being a breaking change in the way the earlier code was (which seems more like a proper dotenv parser, while this is just a slight expansion upon the currently working code.) |
|
While it's definitely true that your implementation comes very close to not breaking backwards compatibility, there are some cases that are broken. One of them you yourself listed. Your claim on "semantically equivalence" is problematic, since there is no well-defined Next to the change you mentioned above, is that if someone already encrypted Right now I don't see a way of adjusting the |
This re-uses almost all previously existing logic, it only changes what constitutes a "line" when parsing the file.
This is not a fully fledged parser (e.g. escaping quotes doesn't work) but it should handle some additional cases now.
Fixes #965