Adrian Utrilla
9998e16c3e
Merge pull request #491 from adrianosela/golint
...
Address Go Lint messages
2019-07-16 11:36:51 +02:00
Adriano
4d4891588d
address comments
2019-07-11 10:47:43 -07:00
Adriano
4b99fa18b3
go lint
2019-07-11 10:30:32 -07:00
Adriano
87adc130eb
code cleanup [1/5] - go fmt
2019-07-08 09:46:36 -07:00
Adrian Utrilla
2712e3770f
Merge branch 'master' into consolidate-example-trees
2019-02-27 22:03:21 +01:00
Adrian Utrilla
d77ae5b1be
Add comment support to dotenv store
2019-01-23 11:07:05 +01:00
Adrian Utrilla
bbf17b3d84
Consolidate example trees
2019-01-23 10:54:27 +01:00
mark kelly
eb7b22a4a0
Merge branch 'master' into master
2019-01-14 10:44:55 +00:00
Mark Kelly
7605dd76b1
Added aws_profile
...
* Decrypt
* Command Line
* Master Key
* Encrypt
* .sops.yaml
2019-01-11 17:11:43 +00:00
Patrick Armstrong
9b364dccef
Added ini file example.
...
Note that this adds both a example file to the top level of the
repository, as well as special case handling of the Example file when
doing a sops -i newfile.ini, since the ini store doesn't support the
tree structure of the existing example.
2019-01-10 21:36:16 -08:00
Patrick Armstrong
d3375f8753
Ran gofmt/goimports on ini store files.
2019-01-10 21:36:16 -08:00
Patrick Armstrong
dc4a697500
Switched ini to same flattening scheme as .env implementation
2019-01-10 21:36:16 -08:00
Patrick Armstrong
c70c52be58
Added support for ini files
2019-01-10 21:36:16 -08:00
James Robson
dfa150bf75
Add multidoc encrypt/decrypt for YAML sources
2018-11-21 09:00:49 -07:00
Adrian Utrilla
2a99f0411e
Add test for dotenv EmitValue
2018-10-31 18:19:55 -04:00
Joost Cassee
f84673fd22
Apply small stylistic changes in flatten.go
2018-10-31 22:44:08 +01:00
Adrian Utrilla
9b45e33cbd
Refactor flattening and unflattening code
2018-10-31 16:01:17 -04:00
Joost Cassee
a05f8627c7
Flatten sops metadata into variables
2018-10-31 15:08:25 +01:00
Joost Cassee
5fc86c12fa
Implement flattened metadata for dotenv files
...
This commit contains a bug in the metadata handling.
2018-10-30 16:55:00 +01:00
Joost Cassee
39fbb27c2c
Implement dotenv store.EmitValue function
2018-10-30 15:01:15 +01:00
Adrian Utrilla
f475b5cecd
Cast input bytes to string when creating a TreeItem
2018-10-30 08:12:52 -04:00
Joost Cassee
700455adff
Refactor the code base on review comments
...
- Ran goimports on store.go and store_test.go.
- LoadPlainFile uses bytes.Split.
2018-10-30 09:53:02 +01:00
Joost Cassee
985943c037
Attempt to output metadata items
2018-10-29 23:49:10 +01:00
Joost Cassee
eadef71162
Rename "env" store to "dotenv"
2018-10-29 21:50:13 +01:00
Joost Cassee
d45c23c0e3
Revert change to stores/stores.go
2018-10-29 21:34:42 +01:00
Joost Cassee
0cc9bd3ebc
Add .env store implementation
2018-10-29 16:07:55 +01:00
Calle Pettersson
9fa4f0e90e
Add support for Azure Key Vault
2018-06-17 22:50:30 +02:00
AJ Bahnken
3265a66cd3
Handle escaping in original json ( #357 )
...
* Handle escaping in original json
* Replace conditional magic with proper json encoding call for key
* swap TestDecodeJSONWithEscaping with new TestEncodeJSONWithEscaping
* fix copy/paste typo
2018-06-01 12:47:27 -07: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
Dov Reshef
ed934575ee
Address review comments
2018-04-08 17:53:54 +03:00
Dov Reshef
efd8521436
added the --encrypted-suffix option
2018-04-08 12:43:43 +03:00
Mohit Agarwal
591d5c4154
Don't consider io.EOF returned by Decoder.Token as error
...
[`Decoder.Token`](https://golang.org/pkg/encoding/json/#Decoder.Token )
returns nil, io.EOF at the input stream.
This caused the output json to have no "data" key for an input
containing a number:
```
{
"sops": {
"kms": null,
"gcp_kms": null,
"lastmodified": "2018-01-14T14:51:51Z",
"mac": "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gC80OHzIeBK4C/heu/gfuKjuYWI4MLlPiuN6e+yoFT+\nR75GX1GgqTWP52gwxstEibTQ7n9zl6/gUeQ1/T+QOFDfajpawb8+xxyx4kjOzPnh\nU4MA\n=VSfw\n-----END PGP MESSAGE-----",
"fp": "C8F69F5F7059C32B3328DFE48BE9D15D0B0D06EB"
}
],
"unencrypted_suffix": "_unencrypted",
"version": "3.0.0"
}
}
```
After the change:
```
{
"data": "ENC[AES256_GCM,data:PVw=,iv:cCDbWu1jdYkCIUcF/BtZGBs6mSWtdTI5ZF/A/i7RxIY=,tag:sFtal0nSo2koPDxnaKxLgA==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"lastmodified": "2018-01-14T14:52:38Z",
"mac": "ENC[AES256_GCM,data:BOyvRlaMKIGRcNOnmBGnN/Qz7i/l6Lhl5lx1OJ1VMb6nhuKkhCySktGVYOElUTgLc3CDKLfELNKiID2i6HKAkSAWQyYC1tIPAQTcBtnVd2Pt7Adzz8i8JFzWT+sc5rKLCOljnXwcXsxbmhrWwfQFj57wVWkvZTRNLfNZkcMnykw=,iv:JxCILR1qxAk391tTmLf/hXlr1L/JQWqhLbFHYR04HjI=,tag:0LSWWPWEBeK1Gm2mi4UBNA==,type:str]",
"pgp": [
{
"created_at": "2018-01-14T14:52:38Z",
"enc": "-----BEGIN PGP MESSAGE-----\n\nwcFMA90gOM45xlRNARAAR+FmJBwY4gnpUUZSwWRrwJ+PLhBzVXoIfZ2zqhk+gkvl\nGZyi62mCM5ZVoVPf8Pw+a9cQi+IzJHgKEOT/6PIp1chw7DhnoGbFJExcE3inniou\nlLo2pFTRH5jTvCE3yIIR/l1b9VMrtnOcZuYx9SobLjIv4wKtY1gMkbmrG2IDLmMT\n9QYM/MT/aCcUA/u6bYz8+ZjAS7NUEifji/SkZkYlL1tdCEdiHU/Cl4gScOhqcIsK\nGWGa+1jnxnYOmYq3FDMb90RSPgU8xkzl9EQIInF2t4K3Zj7E+9J93Y7N2udpNGah\nebPwxS4VTCLl1p69q9+nhO8rn9ySjeTjIoJwPoNDzWVowQEmUPZCTz+A28RKi02l\nGsuYxCzD5aF8cRhZbLk882fCAo77U9TiYYa00cq8kTqnCpZmtp3BevrdWTswJwin\n/TID0DOflahzj7iUP8MAVI2nzGosmCWEFiVONWq2l2z7ND78Y65G/d5hM3zv71U/\n1z0B8zzxZSbFFTV2YjADwWdizpeXJFJuVdynCQdPxt8qfNZVXcQfIHmYwh4M3k3U\nv5yV491mwCPNAJAoBaNJoKLnXx3ae4Aic4s2sF3V+AKK6rNiWtuAWsyjuwzmTse2\ntQisNTez5m+6r5seC7YvC2i9Vb2DNzqYn4M/13tHjxpPrNxdCGNneM1FKG8a03nS\n4AHk5BBSjhL9oc/o7zf8AsoFdeE2A+BR4KnhNXbg2eJlJCnO4IvlzVv3wYVwmh5W\nfyHqIQAX3ICb43o6Vo2/AGANvM5BdA3gX+ToyYFHsSMttWLz4zAUJWe04pRx0/rh\n73EA\n=0ON2\n-----END PGP MESSAGE-----",
"fp": "C8F69F5F7059C32B3328DFE48BE9D15D0B0D06EB"
}
],
"unencrypted_suffix": "_unencrypted",
"version": "3.0.0"
}
}
```
Fixes #235
2018-01-14 20:41:37 +05:30
Adrian Utrilla
14a55401d3
Fix metadata not found returning the wrong error
2017-10-03 14:51:59 -07:00
Adrian Utrilla
e5f5812f59
Merge branch 'master' into gcloud-kms
2017-09-19 14:35:48 -07:00
Adrian Utrilla
c7c94e9dc8
Merge branch 'master' into gcloud-kms
2017-09-18 09:27:06 -07:00
Adrian Utrilla
aeaa726b5f
Show error message when decrypting SOPS1 JSON files
2017-09-18 09:18:36 -07:00
Calin Don
15ea81dbd2
Add keyservice support
2017-09-18 12:48:37 +03:00
Adrian Utrilla
7911bb1542
Merge branch 'master' into yaml-list-comments
2017-09-15 19:29:06 -07:00
Adrian Utrilla
08a4c7e657
Add documentation to all main packages
2017-09-12 20:01:12 -07:00
Adrian Utrilla
63708c6485
Refer to Shamir threshold as threshold instead of quorum
2017-09-12 10:58:53 -07:00
Adrian Utrilla
93570b20d7
Fix golint errors
2017-09-12 09:59:23 -07:00
Adrian Utrilla
7d194dda4a
Reorder store structs to match old order
2017-09-11 13:08:21 -07:00
Adrian Utrilla
4f4968f32e
Make GroupQuorum an int
2017-08-29 13:21:34 -07:00
Adrian Utrilla
eb00619d0d
Make Metadata.ShamirQuorum an uint
...
The quorum should never be negative.
2017-08-29 12:59:50 -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