diff --git a/components/engine/api/server/middleware/debug_test.go b/components/engine/api/server/middleware/debug_test.go index a64b73e0d7..3d78d7e084 100644 --- a/components/engine/api/server/middleware/debug_test.go +++ b/components/engine/api/server/middleware/debug_test.go @@ -23,7 +23,6 @@ func TestMaskSecretKeys(t *testing.T) { input: map[string]interface{}{"Data": "foo", "Name": "name", "Labels": map[string]interface{}{}}, expected: map[string]interface{}{"Data": "*****", "Name": "name", "Labels": map[string]interface{}{}}, }, - { path: "/secrets/create?key=val", input: map[string]interface{}{"Data": "foo", "Name": "name", "Labels": map[string]interface{}{}}, @@ -32,8 +31,13 @@ func TestMaskSecretKeys(t *testing.T) { { path: "/v1.30/some/other/path", input: map[string]interface{}{ - "password": "pass", + "password": "pass", + "secret": "secret", + "jointoken": "jointoken", + "unlockkey": "unlockkey", + "signingcakey": "signingcakey", "other": map[string]interface{}{ + "password": "pass", "secret": "secret", "jointoken": "jointoken", "unlockkey": "unlockkey", @@ -41,8 +45,13 @@ func TestMaskSecretKeys(t *testing.T) { }, }, expected: map[string]interface{}{ - "password": "*****", + "password": "*****", + "secret": "*****", + "jointoken": "*****", + "unlockkey": "*****", + "signingcakey": "*****", "other": map[string]interface{}{ + "password": "*****", "secret": "*****", "jointoken": "*****", "unlockkey": "*****", @@ -50,6 +59,21 @@ func TestMaskSecretKeys(t *testing.T) { }, }, }, + { + path: "/v1.30/some/other/path", + input: map[string]interface{}{ + "PASSWORD": "pass", + "other": map[string]interface{}{ + "PASSWORD": "pass", + }, + }, + expected: map[string]interface{}{ + "PASSWORD": "*****", + "other": map[string]interface{}{ + "PASSWORD": "*****", + }, + }, + }, } for _, testcase := range tests {