fix(secrets): scan typed JSON collision values

This commit is contained in:
Mathews-Tom
2026-07-11 22:31:49 +05:30
parent 331e7bea65
commit 2e4e215da2
4 changed files with 73 additions and 6 deletions
+1 -5
View File
@@ -553,10 +553,6 @@ function obfuscateAdvisorMessage(
}
}
function isImageBlock(value: object): value is ImageContent {
return "type" in value && value.type === "image";
}
function collectAdvisorRegexSecretValues(obfuscator: SecretObfuscator, messages: AgentMessage[]): Set<string> {
const values = new Set<string>();
const add = (value: string | undefined): void => {
@@ -574,7 +570,7 @@ function collectAdvisorRegexSecretValues(obfuscator: SecretObfuscator, messages:
for (const item of value) addJsonStrings(item);
return;
}
if (value === null || typeof value !== "object" || isImageBlock(value)) return;
if (value === null || typeof value !== "object") return;
for (const item of Object.values(value)) addJsonStrings(item);
};
const addContent = (content: TextualContent): void => {