fix: 完成商务迁移复核与接口优化并清理历史资料
This commit is contained in:
@@ -59,3 +59,16 @@ func TestPaymentIntegrationConfigUsesRouteLevelSummary(t *testing.T) {
|
||||
t.Fatal("payment test route was not recognized as sensitive")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCertificateAliasesAreRedactedInNestedPayloads(t *testing.T) {
|
||||
raw := []byte(`{"config":{"app_cert_content":"secret-cert","keys":[{"key_content":"secret-key"}],"cert_path":"private-file","template_content":"keep"}}`)
|
||||
got := redactJSON(raw, "application/json", 4096)
|
||||
for _, secret := range []string{"secret-cert", "secret-key", "private-file"} {
|
||||
if strings.Contains(got, secret) {
|
||||
t.Fatalf("certificate alias leaked: %s", got)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(got, `"template_content":"keep"`) {
|
||||
t.Fatal("ordinary content was masked")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user