1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

Do not put sensitive value into error message when the key can be printed as well.

Signed-off-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Felix Fontein
2025-09-27 10:59:13 +02:00
parent 2ade87bd6f
commit d893aa148e
2 changed files with 2 additions and 2 deletions

View File

@@ -242,7 +242,7 @@ func main() {
var env []string
for _, item := range tree.Branches[0] {
if dotenv.IsComplexValue(item.Value) {
return cli.NewExitError(fmt.Errorf("cannot use complex value in environment: %s", item.Value), codes.ErrorGeneric)
return cli.NewExitError(fmt.Errorf("cannot use complex value in environment; key is %s", item.Key), codes.ErrorGeneric)
}
if _, ok := item.Key.(sops.Comment); ok {
continue

View File

@@ -139,7 +139,7 @@ func (store *Store) EmitPlainFile(in sops.TreeBranches) ([]byte, error) {
buffer := bytes.Buffer{}
for _, item := range in[0] {
if IsComplexValue(item.Value) {
return nil, fmt.Errorf("cannot use complex value in dotenv file: %s", item.Value)
return nil, fmt.Errorf("cannot use complex value in dotenv file; key is %s", item.Key)
}
var line string
if comment, ok := item.Key.(sops.Comment); ok {