diff --git a/sdk/typescript/src/errors.ts b/sdk/typescript/src/errors.ts index 53d67c7f..6910d81b 100644 --- a/sdk/typescript/src/errors.ts +++ b/sdk/typescript/src/errors.ts @@ -9,7 +9,7 @@ export function errorMessage(error: unknown): string { export function safeErrorMessage(error: unknown): string { const message = errorMessage(error); const recognizableCredential = - /(?:\b(?:sk-(?:proj-)?|github_pat_|gh[pousr]_|npm_)\S+|\b(?:bearer|basic|token)(?:\s|%20|\+)+\S+|:\/\/[^\s/@]+@|-----BEGIN [A-Z ]*PRIVATE KEY(?: BLOCK)?-----)/iu.test( + /(?:\b(?:sk-(?:proj-)?|github_pat_|gh[pousr]_|npm_|lin_api_|fw_)\S+|\b(?:bearer|basic|token)(?:\s|%20|\+)+\S+|:\/\/[^\s/@]+@|-----BEGIN [A-Z ]*PRIVATE KEY(?: BLOCK)?-----)/iu.test( message, ); const assignments = message.matchAll( diff --git a/sdk/typescript/tests-ts/errors.test.ts b/sdk/typescript/tests-ts/errors.test.ts index 35be8c96..06e03e14 100644 --- a/sdk/typescript/tests-ts/errors.test.ts +++ b/sdk/typescript/tests-ts/errors.test.ts @@ -17,6 +17,8 @@ describe("error messages", () => { for (const message of [ "request failed: token=SYNTHETIC_TOKEN", "Authorization: Bearer sk-proj-SYNTHETIC_KEY_123", + "Linear failed for lin_api_SYNTHETIC_SECRET", + "Fireworks failed for fw_SYNTHETIC_SECRET", 'upstream failed: {"clientSecret":"correct horse battery staple"}', JSON.stringify(JSON.stringify({ clientSecret: "SYNTHETIC_SECRET" })), "authorizationHeaderValue=SYNTHETIC_SECRET",