fix(compliance): redact extra provider API keys (#10521)

This commit is contained in:
Aman
2026-08-18 07:51:34 -06:00
committed by GitHub
parent daae6e6fb5
commit 9392b30575
3 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1 @@
- **fix(compliance):** redact additional provider API keys from audit-log payloads ([#10521](https://github.com/diegosouzapw/OmniRoute/pull/10521)) — thanks @Zartharas

View File

@@ -111,6 +111,7 @@ const AUDIT_LOG_REQUIRED_COLUMNS: Record<string, string> = {
const SENSITIVE_AUDIT_KEYS = new Set([
"apikey",
"extraapikeys",
"accesstoken",
"refreshtoken",
"idtoken",

View File

@@ -92,6 +92,12 @@ test("compliance audit log supports structured filters, totals and secret redact
nested: {
refreshToken: "refresh-secret",
},
providerSpecificData: {
extraApiKeys: ["sk-extra-1", "sk-extra-2"],
token: "token-secret",
userToken: "user-token-secret",
cookie: "cookie-secret",
},
changedFields: ["defaultModel"],
},
ipAddress: "10.0.0.4",
@@ -133,6 +139,12 @@ test("compliance audit log supports structured filters, totals and secret redact
nested: {
refreshToken: "[redacted]",
},
providerSpecificData: {
extraApiKeys: "[redacted]",
token: "[redacted]",
userToken: "[redacted]",
cookie: "[redacted]",
},
changedFields: ["defaultModel"],
});
assert.deepEqual(updatedEntry.metadata, updatedEntry.details);