Enbiya Goral
72e903ee88
feat: Add HuaweiCloud KMS support
...
Signed-off-by: Enbiya Goral <100806254+enbiyagoral@users.noreply.github.com >
2025-12-12 09:41:42 +03:00
Felix Fontein
4bd0a14e1f
Address review comments.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-28 07:43:45 +02:00
Felix Fontein
3dda744d8d
Move dotenv.IsComplexValue to stores.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-27 20:37:04 +02:00
Felix Fontein
d893aa148e
Do not put sensitive value into error message when the key can be printed as well.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-27 20:37:04 +02:00
Felix Fontein
6bb6621897
Make SingleValueStore extend Store instead of the other way around.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-27 20:17:14 +02:00
Felix Fontein
ffc1e265bb
Ignore encryption selection options for binary store (and warn when they are used).
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-27 20:17:14 +02:00
billy4479
ba010428ee
Avoid panic when values are numbers
...
When decrypting to dotenv we try to escape new line in the values
without taking into account the possibility that the value could be
something different than a string (e.g. an int).
This used to cause a panic when using `decrypt --output-format dotenv`.
Signed-off-by: billy4479 <giachi.ellero@gmail.com >
2025-09-11 00:07:36 +02:00
Felix Fontein
277805a0f9
Move ValToString to stores.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-09 20:49:20 +02:00
Felix Fontein
816b797ccc
Improve formatting of floats.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-09 20:49:20 +02:00
Felix Fontein
2e2d7d998c
Add tests.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-09 20:49:20 +02:00
Felix Fontein
d67d29fd96
Fix converting integers to strings. Also improve time.Time formatting.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-09-09 20:49:20 +02:00
Sylvain Rabot
0bf4492b7e
Switch from deprecated gopkg.in/yaml.v3 to go.yaml.in/yaml/v3
...
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr >
2025-09-07 17:37:00 +02:00
Felix Fontein
df09e2c119
Also parse floating point numbers if they represent integers.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-07-28 22:13:27 +02:00
Felix Fontein
c30e36ea76
Store floating point number without decimal places.
...
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com >
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-07-28 22:00:48 +02:00
Felix Fontein
23cd77d15c
Fix Shamir threshold encoding for INI and ENV files.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-07-25 14:27:20 +02:00
Felix Fontein
6d4c21860e
Remove reserved keyword check from YAML store's LoadPlainFile().
...
This check hid the better check in cmd/sops/encrypt.go.
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-04-13 15:18:09 +02:00
Felix Fontein
72cebfd8a1
Run 'gofmt -w' on all .go files.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-03-28 20:11:33 +01:00
Charlie Getzen
496b40e2c9
Merge branch 'main' into cg/minimum-sops-config
2025-03-27 23:04:20 -07:00
Felix Fontein
54196f028b
Adjust new test.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2025-02-15 14:25:29 +01:00
Felix Fontein
d9d35e999f
Merge branch 'main' into eof-newline
2025-02-15 14:22:01 +01:00
Felix Fontein
233deecdd0
Merge branch 'main' into fixes
2025-02-15 14:06:42 +01:00
Felix Fontein
424416c9e5
Merge branch 'main' into ini-store-duplicate-sections
2025-02-15 13:58:44 +01:00
Felix Fontein
50b6afc9c2
Merge branch 'main' into eof-newline
2025-02-15 13:54:00 +01:00
Felix Fontein
2463a6f96f
Correctly handle comments during JSON serialization.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2024-12-01 09:19:22 +01:00
Martin Holst Swende
adad27e2d4
stores: test for duplicate keys, reseve keyword (yaml only now)
...
stores/json: use assert
stores/yaml: fix failing test (empty data)
stores/yaml: use assert in tests
unfix error handling and ignore error
Signed-off-by: Martin Holst Swende <martin@swende.se >
2024-09-27 15:58:34 +02:00
Sebastien Duthil
fa545b142d
outputs: add trailing \n at the end of json files
...
Signed-off-by: Sebastien Duthil <duthils@duthils.net >
2024-09-14 09:25:19 -04:00
Tobias Reindl
4249ec2e47
add duplicate section support to ini store
...
Signed-off-by: Tobias Reindl <tobias.reindl@s7-rail.com >
2024-08-27 08:32:46 +02:00
Charlie Getzen
246efde338
chore: omitempty optional metadata to reduce the size of stored config
...
Signed-off-by: Charlie Getzen <charlie_g@regrello.com >
2024-07-31 17:02:42 -05:00
Mitar
f63e844206
Support using comments to select parts to encrypt
...
Signed-off-by: Mitar <mitar.git@tnode.com >
2024-06-27 09:21:08 +02:00
Felix Fontein
daabd14700
Do not use DotEnv store for exec-env.
...
This avoids quoting problems, fixes #784 , and also better handles
various problems that can arise, like '=' in keys and non-string
keys and values.
Signed-off-by: Felix Fontein <felix@fontein.de >
2024-06-15 17:53:38 +02:00
Felix Fontein
00de085c34
Improve comment.
...
Co-authored-by: Devin Stein <devstein@alumni.upenn.edu >
Signed-off-by: Felix Fontein <felix@fontein.de >
2023-12-29 23:22:25 +01:00
Felix Fontein
618b60e99c
Create a constant for the 'sops' metadata key.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2023-12-29 22:55:57 +01:00
Felix Fontein
1bda828b69
Make check whether file contains invalid keys for encryption dependent on output store.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2023-12-29 22:22:01 +01:00
Felix Fontein
56d765a46b
shamir_threshold is an integer.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2023-12-28 17:37:41 +01:00
Lance Rushing
7d90cf2e97
Add comments for new functions
...
Signed-off-by: Lance Rushing <lance@lancerushing.com >
2023-12-28 15:56:07 +01:00
Lance Rushing
c2852846f5
Update comment for more clarity
...
Signed-off-by: Lance Rushing <lance@lancerushing.com >
2023-12-28 15:56:07 +01:00
Lance Rushing
b67a83d408
Move non-string and newline function calls outside of encode/decode
...
Signed-off-by: Lance Rushing <lance@lancerushing.com >
2023-12-28 15:56:07 +01:00
Lance Rushing
32dbc6be13
Add dedicated functions for \n and non string encoding
...
Signed-off-by: Lance Rushing <lance@lancerushing.com >
2023-12-28 15:56:07 +01:00
Lance Rushing
1161ec17a1
Consolidate Flatten/Unflatten pre/post processing
...
Fixes #1353
Consolidate the common json marshalling and \n handing to stores/flatten.go
Make existing functions unexported.
Add casts for MACOnlyEncrypted
Signed-off-by: Lance Rushing <lance@lancerushing.com >
2023-12-28 15:56:07 +01:00
Bastien
42018ef4a5
Add indentation settings for json_binary
...
Signed-off-by: Bastien <bastien.wermeille@gmail.com >
2023-11-24 07:41:14 +01:00
Bastien
8a63bb0d21
Add checks for indentation value
...
Signed-off-by: Bastien <bastien.wermeille@gmail.com >
2023-11-24 07:41:14 +01:00
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
c6dc5267e5
Indentation of json files
...
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com >
2023-11-24 07:41:14 +01:00
Bastien Wermeille
6ad2a82d22
Refactor duplicated code
...
Signed-off-by: Bastien Wermeille <bastien.wermeille@gmail.com >
2023-11-24 07:41:14 +01:00
Bastien Wermeille
d2ee8df5de
Implement feedback
...
Co-authored-by: Felix Fontein <felix@fontein.de >
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
James J. Goodhouse
e9e2346fdd
Add configuration for stores
...
this will allow for setting of parameters specific to each store, such
as indentation level for YAML
Co-authored-by: Bastien Wermeille <bastien.wermeille@gmail.com >
Signed-off-by: James J. Goodhouse <jgoodhouse@newrelic.com >
2023-11-24 07:41:14 +01:00
Mitar
051ce028c9
Support computing MAC only over values which end up encrypted
...
Signed-off-by: Mitar <mitar.git@tnode.com >
2023-11-07 11:59:08 +01:00
Felix Fontein
38ec3f7a52
Handle unhandled errors.
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2023-10-03 09:41:49 +02:00
Felix Fontein
a27e1bddf2
Ignore irrelevant return value (it is always nil).
...
Signed-off-by: Felix Fontein <felix@fontein.de >
2023-10-03 09:41:49 +02:00