diff --git a/cmd/changes_submit_plan.go b/cmd/changes_submit_plan.go index 7055e78e..4557a3fd 100644 --- a/cmd/changes_submit_plan.go +++ b/cmd/changes_submit_plan.go @@ -53,7 +53,7 @@ func maskAllData(attributes map[string]any) map[string]any { if mv, ok := v.(map[string]any); ok { attributes[k] = maskAllData(mv) } else { - attributes[k] = "REDACTED" + attributes[k] = "(sensitive value)" } } return attributes @@ -62,7 +62,7 @@ func maskAllData(attributes map[string]any) map[string]any { // maskSensitiveData masks every entry in attributes that is set to true in sensitive. returns the redacted attributes func maskSensitiveData(attributes, sensitive any) any { if sensitive == true { - return "REDACTED" + return "(sensitive value)" } else if sensitiveMap, ok := sensitive.(map[string]any); ok { if attributesMap, ok := attributes.(map[string]any); ok { result := map[string]any{} @@ -71,12 +71,12 @@ func maskSensitiveData(attributes, sensitive any) any { } return result } else { - return "REDACTED (type mismatch)" + return "(sensitive value) (type mismatch)" } } else if sensitiveArr, ok := sensitive.([]any); ok { if attributesArr, ok := attributes.([]any); ok { if len(sensitiveArr) != len(attributesArr) { - return "REDACTED (len mismatch)" + return "(sensitive value) (len mismatch)" } result := make([]any, len(attributesArr)) for i, v := range attributesArr { @@ -84,7 +84,7 @@ func maskSensitiveData(attributes, sensitive any) any { } return result } else { - return "REDACTED (type mismatch)" + return "(sensitive value) (type mismatch)" } } return attributes diff --git a/cmd/changes_submit_plan_test.go b/cmd/changes_submit_plan_test.go index 3706e6a3..ee655f70 100644 --- a/cmd/changes_submit_plan_test.go +++ b/cmd/changes_submit_plan_test.go @@ -44,7 +44,7 @@ func TestMaskSensitiveData(t *testing.T) { require.Equal(t, map[string]any{ - "foo": "REDACTED", + "foo": "(sensitive value)", }, maskSensitiveData( map[string]any{ @@ -68,7 +68,7 @@ func TestMaskSensitiveData(t *testing.T) { require.Equal(t, map[string]any{ - "foo": "REDACTED", + "foo": "(sensitive value)", }, maskSensitiveData( map[string]any{ @@ -78,7 +78,7 @@ func TestMaskSensitiveData(t *testing.T) { require.Equal(t, map[string]any{ - "foo": map[string]any{"key": "REDACTED"}, + "foo": map[string]any{"key": "(sensitive value)"}, }, maskSensitiveData( map[string]any{ @@ -102,7 +102,7 @@ func TestMaskSensitiveData(t *testing.T) { require.Equal(t, map[string]any{ - "foo": "REDACTED", + "foo": "(sensitive value)", }, maskSensitiveData( map[string]any{ @@ -112,7 +112,7 @@ func TestMaskSensitiveData(t *testing.T) { require.Equal(t, map[string]any{ - "foo": []any{"one", "REDACTED"}, + "foo": []any{"one", "(sensitive value)"}, }, maskSensitiveData( map[string]any{