* Fix binary file bug double encryption prevention
The `ensureNoMetadata` function was incorrectly implemented and called
LoadEncryptedFile on the InputStore and checked whether the returned error was
MetadataNotFound or not. In the case where loading the input file as an encrypted
file would fail (e.g. due to syntax errors), it would incorrectly report the file as
having a "sops" branch. When using the binary mode, it would try to load the file as
an encrypted binary file (which is expected to be JSON), which would fail, thus
triggering this error.
* Add functional test for binary file roundtrip
SOPS failed to decrypt empty comments before after they were encrypted because they
would look like:
`#ENC[AES256_GCM,data:,iv:NVQvG25goSE7xi6U/QjRNtJBwr/VfChezSptI8GFsQk=,tag:yyYIW/hiIZ1qK1GEo8vHpA==,type:comment]`
Note the empty "data" value.
SOPS would fail to decrypt those and show them to the user "encrypted" when
decrypting the file.
* Implement auditing support
* Document auditing
* Address review comments
* Change log level for errors reading audit config
* Disable auditors during tests
* Make changes to docs suggested by @jvehent
* Code review fixes to init() in audit.go
* Implement encrypt audit event
* Include filepath in Tree created from sops/encrypt/encrypt
* Fix changes in audit.go to stay with current style
* Implement RotateEvent within rotate command
* github.com/lib/pq vendor dependencies
* Always get current user in PostgresAuditor.Handle()
* Initial CR fixes + gofmt
* gofmt
* fixed placement of audit event in rotate()
* Moved to a single table for audit events.
* Revert "Moved to a single table for audit events."
This reverts commit 7e7817e8a1.
* Remove audit tables delete protection rules
* Move to a single audit_event table with action column
* Remove unnecessary tree declaration
* Refactor Store interface to reflect operations SOPS performs
Previously the Store interface tried to mimic the Marshaler and Unmarshaler
interfaces. This was a mistake, as it meant Stores had no idea whether the files they
were loading were encrypted or not.
Partially fixes#334
* Add regression test for loading plain JSON file with binary store