Граф коммитов

29 Коммитов

Автор SHA1 Сообщение Дата
Bastien Wermeille 755c16d49c Allow no indent at all for json store
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
2023-11-24 07:41:14 +01:00
Bastien Wermeille 303fdd8f37 Add cli indent option for yaml store
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com>
2023-11-24 07:41:14 +01:00
Lars Lehtonen b6808f83d8 decrypt: fix dropped error
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2023-09-30 12:50:44 +02:00
Hidde Beydals eeaf9f76d5
*: address various simple `staticcheck` warnings
Deprecation of `io/ioutil`, removal of unused functions, possible nil
pointer dereference, and other tiny nits.

There are (many) more, but these would require their own (commit)
context.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-17 00:16:40 +02:00
Hidde Beydals ca0e15eda3
*: solve `go vet` errors
```
stores/dotenv/store.go:74:12: github.com/getsops/sops/v3.Comment struct literal uses unkeyed fields
stores/dotenv/store_test.go:29:10: github.com/getsops/sops/v3.Comment struct literal uses unkeyed fields
keyservice/server.go:149:9: assignment copies lock value to key: github.com/getsops/sops/v3/keyservice.Key contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex
keyservice/server.go:206:20: call of ks.prompt copies lock value: github.com/getsops/sops/v3/keyservice.Key contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex
keyservice/server.go:214:22: keyToString passes lock by value: github.com/getsops/sops/v3/keyservice.Key contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex
keyservice/server.go:231:29: prompt passes lock by value: github.com/getsops/sops/v3/keyservice.Key contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex
keyservice/server.go:232:27: call of keyToString copies lock value: github.com/getsops/sops/v3/keyservice.Key contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex
keyservice/server.go:251:9: assignment copies lock value to key: github.com/getsops/sops/v3/keyservice.Key contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex
keyservice/server.go:308:20: call of ks.prompt copies lock value: github.com/getsops/sops/v3/keyservice.Key contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex
stores/yaml/store_test.go:27:11: github.com/getsops/sops/v3.Comment struct literal uses unkeyed fields
stores/yaml/store_test.go:39:11: github.com/getsops/sops/v3.Comment struct literal uses unkeyed fields
stores/yaml/store_test.go:107:5: github.com/getsops/sops/v3.Comment struct literal uses unkeyed fields
stores/yaml/store_test.go:139:13: github.com/getsops/sops/v3.Comment struct literal uses unkeyed fields
decrypt/example_test.go:34:1: ExampleDecryptFile refers to unknown identifier: DecryptFile
```

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-17 00:14:20 +02:00
Hidde Beydals f2a1d4c782
Rename Go module to `github.com/getsops/sops/v3`
This commit renames the Go module from `go.mozilla.org/sops/v3` to
`github.com/getsops/sops/v3` without a major version bump, to align
with new stewardship.

For more information around this change, refer to
https://github.com/getsops/sops/issues/1246.

For a one-liner to change the `go.mod` and any import paths in your
Go project making use of this module, run:

```
find /path/to/repo -type f \( -name "*.go" -o -name "go.mod" \) -exec sed -i 's|go.mozilla.org/sops/v3|github.com/getsops/sops/v3|g' {} \;
find /path/to/repo -type f \( -name "*.go" -o -name "go.mod" \) -exec sed -i '' 's|go.mozilla.org/sops/v3|github.com/getsops/sops/v3|g' {} \;
```

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-31 22:51:36 +02:00
Mikhail Katychev 0f2ebcf7ff
added wrap verb to outputs (#817) 2021-02-17 22:21:20 +01:00
AJ Bahnken 8e21de8dbc
Upgrade sops to go 1.13 (#566) 2019-11-18 10:06:58 -08:00
Damien Nozay 4376ac973c add formats 2019-10-22 12:49:09 -07:00
Damien Nozay 559b27c01f mv formats around 2019-10-22 11:52:35 -07:00
Damien Nozay a03712f086 use enum 2019-10-22 08:14:20 -07:00
Damien Nozay dad8100da8 fix for #548 2019-10-16 11:48:43 -07:00
Adriano 3fc4b0a723
code cleanup [2/5] - go vet 2019-07-08 09:47:18 -07:00
James Robson dfa150bf75 Add multidoc encrypt/decrypt for YAML sources 2018-11-21 09:00:49 -07:00
Joost Cassee eadef71162 Rename "env" store to "dotenv" 2018-10-29 21:50:13 +01:00
Joost Cassee 0cc9bd3ebc Add .env store implementation 2018-10-29 16:07:55 +01:00
Adrian Utrilla 1ffc93dfb6
Refactor Store interface to reflect operations SOPS performs (#335)
* 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
2018-04-20 10:13:46 +02:00
Adrian Utrilla 20046c1b48
Merge branch 'master' into logging 2017-09-16 17:59:00 -07:00
Adrian Utrilla 3811698f54
Encapsulate stash inside cipher 2017-09-12 22:10:53 -07:00
Adrian Utrilla 08a4c7e657
Add documentation to all main packages 2017-09-12 20:01:12 -07:00
Adrian Utrilla 55c7174713
Use logrus features for better logging 2017-09-07 10:49:27 -07:00
Adrian Utrilla 17d5d6b65c
Move all loggers to logrus 2017-09-06 17:36:39 -07:00
Adrian Utrilla a9582158d2
Revert UnmarshalMetadata returning pointer 2017-08-29 12:16:00 -07:00
Adrian Utrilla 13b70024d0
Refactor metadata marshalling
**IMPORTANT** This breaks compatibility of the file format in 1.x for
json files, due to the version being encoded as a number in json files.
The fix for this is easy, however. One can either use a previous version
of sops in the range [2.0.0, 2.0.9] to edit the file, or one can manually edit
the encrypted file and change the version from a number to a string

Previously we basically hand-converted the metadata struct into a map
which we then passed to the stores. Now, we convert the metadata struct
to a "serialization" struct, which the stores serialize
2017-08-23 17:10:39 -07:00
Adrian Utrilla 486a9c8b4c Revert "Fix IV size and constant-time MAC comparison" 2017-08-08 18:18:26 -07:00
Neil Madden 08effe3e15 Do not include computed MAC value in error message 2017-08-04 11:28:08 +01:00
Neil Madden 05bdd6f4b1 Constant-time MAC tag comparison 2017-08-04 11:05:26 +01:00
Julien Vehent 294072fc42
Return standard errors in the decrypt package 2017-03-23 13:38:59 -04:00
Julien Vehent f07e773800
Add decryption helper and example usage 2017-01-22 10:55:52 -05:00