11 lines
449 B
Go
11 lines
449 B
Go
package secrets
|
|
|
|
import "testing"
|
|
|
|
func TestRedactDiagnosticFieldsNeverReturnsKnownCredentialFields(t *testing.T) {
|
|
fields := RedactDiagnosticFields(map[string]string{"Authorization": "Bearer value", "control_plane_service_token": "value", "status": "PASS"})
|
|
if fields["Authorization"] != Redacted || fields["control_plane_service_token"] != Redacted || fields["status"] != "PASS" {
|
|
t.Fatalf("unexpected diagnostic redaction: %#v", fields)
|
|
}
|
|
}
|