Skip to content

Commit d893aa1

Browse files
committed
Do not put sensitive value into error message when the key can be printed as well.
Signed-off-by: Felix Fontein <[email protected]>
1 parent 2ade87b commit d893aa1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cmd/sops/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func main() {
242242
var env []string
243243
for _, item := range tree.Branches[0] {
244244
if dotenv.IsComplexValue(item.Value) {
245-
return cli.NewExitError(fmt.Errorf("cannot use complex value in environment: %s", item.Value), codes.ErrorGeneric)
245+
return cli.NewExitError(fmt.Errorf("cannot use complex value in environment; key is %s", item.Key), codes.ErrorGeneric)
246246
}
247247
if _, ok := item.Key.(sops.Comment); ok {
248248
continue

stores/dotenv/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (store *Store) EmitPlainFile(in sops.TreeBranches) ([]byte, error) {
139139
buffer := bytes.Buffer{}
140140
for _, item := range in[0] {
141141
if IsComplexValue(item.Value) {
142-
return nil, fmt.Errorf("cannot use complex value in dotenv file: %s", item.Value)
142+
return nil, fmt.Errorf("cannot use complex value in dotenv file; key is %s", item.Key)
143143
}
144144
var line string
145145
if comment, ok := item.Key.(sops.Comment); ok {

0 commit comments

Comments
 (0)