Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: match escaped Figma keys

ogsamratfe467ffeabae
diff --git a/apps/server/src/context/PARITY.sha256 b/apps/server/src/context/PARITY.sha256
index 38358503..a7aa28bc 100644
--- a/apps/server/src/context/PARITY.sha256
+++ b/apps/server/src/context/PARITY.sha256
@@ -13,8 +13,8 @@ d772119f2785b6926cd765a44589c171542d5e79b3677bfa076851775d794480 outside.ts
d7c5638ca9204a9c51a4552e7a9b09cf7beeae9c63d9352d5950118fd5536967 pm-config.ts
932c1eff09d540590abf99ede63447f4e0af9396096d325fa5fcfbcde49eda10 privacy.ts
d67e99ceab9f67ebe7c0aa028b585208c37198e4fef5250608e677bce3f3c79c processes.ts
-2f94eb21c1649be8c87f8c987d8d43bc6eb0fa7a80f318c615a92ab92df23d88 redact-policy.ts
-c338bc867048adc9677bd7312e7f2a47b638c5e71a7602bbda7e7b9f6e2dca56 redact-vectors.json
+cfd03804064892ef86ab8dc9c0aa5c76b376e9fb1b9aacaf256dd08f04339789 redact-policy.ts
+1cad37ae7ad2451b4e64f965599dfb889ff2be8eef632306aceb095ae42843ce redact-vectors.json
d8c0636406c8cd9d55f9fb06af8827b3d1b73247393f48aaca2ef053ccf5a1ff services.ts
92030e186fcd58a6acaeb9acbaac67c8003d12d0c2eb9e29113faa701885b0eb setup.ts
d51d434283f757f0ed45bb6996a74fb5bf9e1d56f34146e99df3c392cde5ea19 shell-aliases.ts
diff --git a/apps/server/src/context/redact-policy.ts b/apps/server/src/context/redact-policy.ts
index 70918225..09933cae 100644
--- a/apps/server/src/context/redact-policy.ts
+++ b/apps/server/src/context/redact-policy.ts
@@ -293,14 +293,18 @@ const TOKEN_RULES: TokenRule[] = [
{ name: "github_pat", gate: "github_pat_", pattern: token(String.raw`github_pat_[A-Za-z0-9_]{60,}`) },
{ name: "gitlab_token", gate: "glpat-", pattern: token(String.raw`glpat-[A-Za-z0-9_-]{20,}`) },
// Figma: personal access tokens (figd_), OAuth tokens (figu_, figur_).
- { name: "figma_token", gate: /fig(?:d|u|ur)_/, pattern: token(String.raw`fig(?:d|u|ur)_[A-Za-z0-9_-]{20,}`) },
+ // Also markdown-escaped (`figd\_...\_...`, as Figma tool output writes them) and that again inside a JSON
+ // string (`figd\\_`): the escapes before `_` and `-` go with the token.
+ { name: "figma_token", gate: /fig(?:d|u|ur)\\*_/, pattern: token(String.raw`fig(?:d|u|ur)\\*_(?:[A-Za-z0-9]|\\*[_-]){20,}`) },
{ name: "slack_token", gate: /xox[abprs]-/, pattern: token(String.raw`xox[abprs]-[A-Za-z0-9-]{10,}`) },
{ name: "slack_webhook", gate: "hooks.slack.com", pattern: /(https:\/\/hooks\.slack\.com\/services\/T[A-Z0-9]+\/B[A-Z0-9]+\/)([A-Za-z0-9]{20,})/g, keep: 1 },
{ name: "discord_webhook", gate: "/api/webhooks/", pattern: /(https:\/\/(?:canary\.|ptb\.)?discord(?:app)?\.com\/api\/webhooks\/\d+\/)([A-Za-z0-9_-]{50,})/g, keep: 1 },
{ name: "google_api_key", gate: "AIza", pattern: token(String.raw`AIza[0-9A-Za-z_-]{35}(?![0-9A-Za-z_-])`) },
{ name: "stripe_key", gate: /[sr]k_live_/, pattern: token(String.raw`[sr]k_live_[A-Za-z0-9]{16,}`) },
{ name: "stripe_webhook", gate: "whsec_", pattern: token(String.raw`whsec_[A-Za-z0-9+/=]{24,}`) },
- { name: "anthropic_key", gate: "sk-ant-", pattern: token(String.raw`sk-ant-(?:api|admin)\d\d-[A-Za-z0-9_-]{32,}`) },
+ // Console keys (api, admin) and Claude subscription OAuth tokens (oat: access, ort: refresh).
+ { name: "anthropic_key", gate: "sk-ant-", pattern: token(String.raw`sk-ant-(?:api|admin|oat|ort)\d\d-[A-Za-z0-9_-]{32,}`) },
+ { name: "openrouter_key", gate: "sk-or-v1-", pattern: token(String.raw`sk-or-v1-[0-9a-f]{64}(?![0-9A-Za-z])`) },
{ name: "openai_key", gate: "sk-", pattern: token(String.raw`sk-(?:proj|svcacct|admin)-[A-Za-z0-9_-]{40,}|sk-[A-Za-z0-9]{48}(?![A-Za-z0-9])`), check: (m) => shannonEntropy(m) >= 3.5 },
{ name: "npm_token", gate: "npm_", pattern: token(String.raw`npm_[A-Za-z0-9]{36}(?![A-Za-z0-9])`) },
{ name: "pypi_token", gate: "pypi-AgE", pattern: token(String.raw`pypi-AgE[A-Za-z0-9_-]{50,}`) },
@@ -491,8 +495,8 @@ function redactAwsSecrets(text: string, hidden: string, tally: Tally, nearContex
return changed ? lines.join("\n") : text;
}
-function redactTokens(text: string, hidden: string, tally: Tally, spans: Array<[number, number]>): string {
- for (const rule of TOKEN_RULES) {
+function redactTokens(text: string, hidden: string, tally: Tally, spans: Array<[number, number]>, rules: TokenRule[] = TOKEN_RULES): string {
+ for (const rule of rules) {
if (!gateOpen(rule.gate, text)) continue;
rule.pattern.lastIndex = 0;
text = text.replace(rule.pattern, (...args: unknown[]) => {
@@ -508,9 +512,128 @@ function redactTokens(text: string, hidden: string, tally: Tally, spans: Array<[
return text;
}
-const AUTH_HEADER = /(?<![A-Za-z0-9_])((?:Bearer|Basic)[ \t]+)([A-Za-z0-9_.~+/=-]{16,})/gi;
+// --- command lines and headers -------------------------------------------
+
+// A flag's value: quoted, or one word (no quote, shell operator, bracket,
+// brace, backtick or backslash: `${...}`, `{pw}`, `$(...)` and escapes are
+// never a literal).
+const FLAG_VALUE = String.raw`(?:"([^"\r\n\\]{1,256})"|'([^'\r\n\\]{1,256})'|([^\s"'\x60;|&<>(){}\\]{1,256}))`;
+// `--password X`, `--password=X`, `--db-password=X`, `--passwd X`: the value of a flag named for a
+// password. Never `--password-stdin` or `--password-file` (the name goes on), nor a flag after it.
+const PASSWORD_FLAG = new RegExp(String.raw`(?<![\w-])(--(?:[A-Za-z0-9]+-)*pass(?:wd|word))(=|[ \t]+)` + FLAG_VALUE, "gi");
+// A MySQL or MariaDB client on the line: there `-pX` (attached) is the password (`-p X` asks for it, X the database).
+const MYSQL_CLIENT = /(?<![\w.-])(?:mysql(?:dump|admin|import|check|show|pump|sh)?|mariadb(?:-?dump|-?admin|-?import|-?check)?)(?:\.exe)?(?=["'\s])/gi;
+const MYSQL_PASSWORD = /(?<=[\s"'])-p([^\s"'\x60;|&<>(){}\\-][^\s"'\x60;|&<>(){}\\]{0,255})/g;
+// curl's `-u user:pass`, `-uuser:pass`, `--user user:pass` (the user kept).
+const CURL_COMMAND = /(?<![\w.-])curl(?:\.exe)?(?=["'\s])/gi;
+const CURL_USER = /(?<=[\s"'])(-u[ \t]*|--user(?:=|[ \t]+))(["']?)([^\s:"'\x60;|&<>(){}\\$]*):([^\s"'\x60;|&<>(){}\\]{1,256})\2/g;
+// The end of one command on a line (the next one may be any other program).
+const COMMAND_END = /[\r\n;|&]|\\n/;
+
+/** A flag or header value that is no literal: a reference, a placeholder, a template, another flag, a constant's name. */
+function commandPlaceholder(value: string): boolean {
+ return value.length < 3 || value !== value.trim() || value.startsWith("-") || value.startsWith("[REDACTED") || /[{}$\x60]/.test(value)
+ || isReference(value) || isPlaceholder(value) || CONSTANT_NAME.test(value) || urlPasswordPlaceholder(value) || /^<[^>]*>$/.test(value);
+}
+
+/** Replaces `pattern`'s value group in the part of each line that follows a `command` word (up to the command's end). */
+function afterCommand(text: string, command: RegExp, rewrite: (segment: string) => string): string {
+ command.lastIndex = 0;
+ let out = "";
+ let at = 0;
+ for (let match = command.exec(text); match; match = command.exec(text)) {
+ const start = match.index + match[0].length;
+ if (start < at) continue;
+ const rest = text.slice(start);
+ const end = COMMAND_END.exec(rest);
+ const stop = start + (end ? end.index : rest.length);
+ out += text.slice(at, start) + rewrite(text.slice(start, stop));
+ at = stop;
+ command.lastIndex = Math.max(command.lastIndex, stop);
+ }
+ return at === 0 ? text : out + text.slice(at);
+}
+
+/**
+ * Passwords on a command line: `--password X` / `--password=X` (any
+ * program), `-pX` after a MySQL or MariaDB client, the password of curl's
+ * `-u user:pass`. The flag and the user stay.
+ */
+export function redactCommandSecrets(text: string, hidden: string, tally: { count: number; rules?: Record<string, number> }, spans: Array<[number, number]> = opaqueSpans(text)): string {
+ const mark = (rule: string) => {
+ tally.count += 1;
+ if (tally.rules) tally.rules[rule] = (tally.rules[rule] ?? 0) + 1;
+ };
+ if (/pass(?:wd|word)/i.test(text)) {
+ PASSWORD_FLAG.lastIndex = 0;
+ text = text.replace(PASSWORD_FLAG, (match: string, flag: string, sep: string, dq: string | undefined, sq: string | undefined, bare: string | undefined, offset: number) => {
+ const value = dq ?? sq ?? bare ?? "";
+ if (commandPlaceholder(value) || insideOpaque(spans, offset, offset + match.length)) return match;
+ // `--password mydb` (Postgres tools: a flag without a value), `the --password option`: a plain
+ // lower-case word after a space is no password; after `=`, or quoted, any literal is.
+ if (sep !== "=" && bare !== undefined && /^[a-z]+$/.test(value)) return match;
+ mark("password_flag");
+ const quote = dq !== undefined ? '"' : sq !== undefined ? "'" : "";
+ return `${flag}${sep}${quote}${hidden}${quote}`;
+ });
+ }
+ if (/mysql|mariadb/i.test(text)) {
+ text = afterCommand(text, MYSQL_CLIENT, (segment) => segment.replace(MYSQL_PASSWORD, (match: string, value: string) => {
+ if (commandPlaceholder(value)) return match;
+ mark("mysql_password");
+ return `-p${hidden}`;
+ }));
+ }
+ if (/curl/i.test(text)) {
+ text = afterCommand(text, CURL_COMMAND, (segment) => segment.replace(CURL_USER, (match: string, flag: string, quote: string, user: string, password: string) => {
+ if (commandPlaceholder(password) || isReference(user)) return match;
+ mark("curl_user_password");
+ return `${flag}${quote}${user}:${hidden}${quote}`;
+ }));
+ }
+ return text;
+}
+
+// `Authorization: Token|Basic|Bearer <value>` (a header, a JSON key, an `-H` argument): the
+// header names a credential, so a shorter or plainer value counts than on its own.
+// A value may hold markdown-escaped `_` / `-` (`abc\_def`, `abc\\_def` inside a JSON string): the escapes go with it.
+const AUTHORIZATION_HEADER = /(?<![A-Za-z0-9_-])((?:proxy-)?authorization["']?[ \t]*[:=][ \t]*["']?[ \t]*(?:Token|Basic|Bearer)[ \t]+)((?:[A-Za-z0-9.~+/=:]|\\*[_-]){8,})(?![A-Za-z0-9_.~+/=:-]|\\+[_-])/gi;
+
+/** The value of an `Authorization: Token|Basic|Bearer` header (the scheme kept). */
+export function redactAuthorizationHeaders(text: string, hidden: string, tally: { count: number; rules?: Record<string, number> }, spans: Array<[number, number]> = opaqueSpans(text)): string {
+ if (!/authorization/i.test(text)) return text;
+ AUTHORIZATION_HEADER.lastIndex = 0;
+ return text.replace(AUTHORIZATION_HEADER, (match: string, prefix: string, value: string, offset: number) => {
+ const bare = value.replace(/\\/g, "");
+ if (commandPlaceholder(bare) || shannonEntropy(bare) < 2.5 || insideOpaque(spans, offset, offset + match.length)) return match;
+ tally.count += 1;
+ if (tally.rules) tally.rules.authorization_header = (tally.rules.authorization_header ?? 0) + 1;
+ return `${prefix}${hidden}`;
+ });
+}
+
+/** Token shapes the uploader's old rules lack (they run there too: redactClientGaps). */
+const GAP_TOKEN_RULES = ["gitlab_token", "npm_token", "pypi_token", "huggingface_token", "anthropic_key", "openrouter_key", "figma_token"];
+
+/**
+ * What the old rules (workspace-sync.ts, before the server turns v3 on)
+ * add from these: command-line passwords, `Authorization` header values
+ * and the token shapes in GAP_TOKEN_RULES.
+ */
+export function redactClientGaps(input: string, hidden = REDACTED): { text: string; count: number } {
+ const tally: Tally = { count: 0, rules: {} };
+ if (!input) return { text: input, count: 0 };
+ let text = redactCommandSecrets(input, hidden, tally);
+ text = redactAuthorizationHeaders(text, hidden, tally);
+ text = redactTokens(text, hidden, tally, opaqueSpans(text), TOKEN_RULES.filter((rule) => GAP_TOKEN_RULES.includes(rule.name)));
+ return { text, count: tally.count };
+}
+
+// A value may hold markdown-escaped `_` / `-`: the escapes go with it.
+const AUTH_HEADER = /(?<![A-Za-z0-9_])((?:Bearer|Basic)[ \t]+)((?:[A-Za-z0-9.~+/=]|\\*[_-]){16,})/gi;
-function authSecret(token: string): boolean {
+function authSecret(value: string): boolean {
+ const token = value.replace(/\\/g, "");
if (shannonEntropy(token) < 3.0 || isPlaceholder(token)) return false;
if (/\d/.test(token)) return true;
return token.length >= 20 && /[a-z]/.test(token) && /[A-Z]/.test(token) && !IDENTIFIER_VALUE.test(token);
@@ -529,8 +652,10 @@ function redactAuthHeaders(text: string, hidden: string, tally: Tally, spans: Ar
* Removes credentials from free text (a trace string, a file, a diff), the
* name always kept: private key bodies, URL passwords, secret-named values
* that look generated (any value in a credential file), AWS secrets beside
- * their key id, known token shapes and `Bearer`/`Basic` values. Nothing
- * inside a `data:` URI or a base64 blob is touched.
+ * their key id, known token shapes, command-line passwords (`--password X`,
+ * MySQL's `-pX`, curl's `-u user:pass`), `Authorization: Token|Basic|Bearer`
+ * header values and `Bearer`/`Basic` values. Nothing inside a `data:` URI or
+ * a base64 blob is touched.
*/
export function redactCredentials(input: string, options: CredentialOptions = {}): { text: string; count: number; rules: Record<string, number> } {
const tally: Tally = { count: 0, rules: {} };
@@ -546,6 +671,8 @@ export function redactCredentials(input: string, options: CredentialOptions = {}
const nearAws = options.awsContext === true || (options.context !== undefined && AWS_CONTEXT.test(options.context));
text = redactAwsSecrets(text, hidden, tally, nearAws, opaqueSpans(text));
text = redactTokens(text, hidden, tally, opaqueSpans(text));
+ text = redactCommandSecrets(text, hidden, tally, opaqueSpans(text));
+ text = redactAuthorizationHeaders(text, hidden, tally, opaqueSpans(text));
if (/bearer|basic/i.test(text)) text = redactAuthHeaders(text, hidden, tally, opaqueSpans(text));
return { text, count: tally.count, rules: tally.rules };
}
diff --git a/apps/server/src/context/redact-vectors.json b/apps/server/src/context/redact-vectors.json
index 68a3bc81..e0a4c534 100644
--- a/apps/server/src/context/redact-vectors.json
+++ b/apps/server/src/context/redact-vectors.json
@@ -489,10 +489,227 @@
"expect": null,
"same": true
},
+ {
+ "name": "password flag with =",
+ "input": "pg_dump --password=Tr0ub4dor --host db.internal",
+ "expect": "pg_dump --password=[REDACTED] --host db.internal"
+ },
+ {
+ "name": "password flag with a space",
+ "input": "myapp migrate --password Hunter22 --user admin",
+ "expect": "myapp migrate --password [REDACTED] --user admin"
+ },
+ {
+ "name": "password flag quoted",
+ "input": "myapp --password \"correct horse battery\"",
+ "expect": "myapp --password \"[REDACTED]\""
+ },
+ {
+ "name": "named password flag",
+ "input": "helm install db --db-password=s3cr3tValue",
+ "expect": "helm install db --db-password=[REDACTED]"
+ },
+ {
+ "name": "mysql -p attached",
+ "input": "mysql -u root -pS3cretPass shop < dump.sql",
+ "expect": "mysql -u root -p[REDACTED] shop < dump.sql"
+ },
+ {
+ "name": "mysql -p inside docker exec",
+ "input": "docker exec db mysql -uroot -prootpw -e 'select 1'",
+ "expect": "docker exec db mysql -uroot -p[REDACTED] -e 'select 1'"
+ },
+ {
+ "name": "mysqldump -p",
+ "input": "mysqldump -u app -pApp_2024! appdb > out.sql",
+ "expect": "mysqldump -u app -p[REDACTED] appdb > out.sql"
+ },
+ {
+ "name": "curl -u user:pass",
+ "input": "curl -u admin:Sup3rS3cret https://api.example.com/v1/items",
+ "expect": "curl -u admin:[REDACTED] https://api.example.com/v1/items"
+ },
+ {
+ "name": "curl --user user:pass",
+ "input": "curl -s --user deploy:hunter22 https://ci.example.com/job",
+ "expect": "curl -s --user deploy:[REDACTED] https://ci.example.com/job"
+ },
+ {
+ "name": "curl -uuser:pass attached",
+ "input": "curl -uadmin:Pa55word https://example.com",
+ "expect": "curl -uadmin:[REDACTED] https://example.com"
+ },
+ {
+ "name": "curl -u quoted",
+ "input": "curl -u 'svc:Zx9pLm2q' https://example.com",
+ "expect": "curl -u 'svc:[REDACTED]' https://example.com"
+ },
+ {
+ "name": "authorization token header",
+ "input": "curl -H \"Authorization: Token 9944b0919⟨+⟩9c62bcf9418ad846dd0e4bbdfc6ee4b\" https://api.example.com",
+ "expect": "curl -H \"Authorization: Token [REDACTED]\" https://api.example.com"
+ },
+ {
+ "name": "authorization basic header, short",
+ "input": "Authorization: Basic dXNlcjpwYXNz",
+ "expect": "Authorization: Basic [REDACTED]"
+ },
+ {
+ "name": "authorization token in a JSON header map",
+ "input": "{\"Authorization\": \"Token abcd1234efgh5678\"}",
+ "expect": "{\"Authorization\": \"Token [REDACTED]\"}",
+ "mode": "source"
+ },
+ {
+ "name": "anthropic oauth access token",
+ "input": "export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-⟨+⟩a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7R8s9T0u1V2w3X4y5Z6-_AbCd",
+ "expect": "export CLAUDE_CODE_OAUTH_TOKEN=[REDACTED]"
+ },
+ {
+ "name": "anthropic oauth token in text",
+ "input": "token sk-ant-oat01-⟨+⟩a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7R8s9T0u1V2w3X4y5Z6-_AbCd here",
+ "expect": "token [REDACTED] here"
+ },
+ {
+ "name": "openrouter key",
+ "input": "use sk-or-v1-⟨+⟩0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef now",
+ "expect": "use [REDACTED] now"
+ },
+ {
+ "name": "npm token in text",
+ "input": "npm config set //registry.npmjs.org/:_authToken npm_⟨+⟩a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7R8",
+ "expect": "npm config set //registry.npmjs.org/:_authToken [REDACTED]"
+ },
+ {
+ "name": "gitlab token on a command line",
+ "input": "glab auth login --hostname gitlab.com --token glpat-⟨+⟩a1B2c3D4e5F6g7H8i9J0",
+ "expect": "glab auth login --hostname gitlab.com --token [REDACTED]"
+ },
+ {
+ "name": "huggingface token",
+ "input": "huggingface-cli login --token hf_⟨+⟩a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7",
+ "expect": "huggingface-cli login --token [REDACTED]"
+ },
+ {
+ "name": "pypi token",
+ "input": "twine upload -u __token__ dist/* # pypi-AgEIcHlwaS5vcmc⟨+⟩a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6q7R8s9T0u1V2w3X4",
+ "expect": "twine upload -u __token__ dist/* # [REDACTED]"
+ },
+ {
+ "name": "password-stdin kept",
+ "input": "echo \"$PW\" | docker login --password-stdin -u me ghcr.io",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "password-file kept",
+ "input": "restic --password-file=/run/secrets/restic backup .",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "password flag in prose kept",
+ "input": "Use the --password option to set it.",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "postgres --password without a value kept",
+ "input": "pg_dump --password mydb > out.sql",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "password flag reference kept",
+ "input": "deploy --password \"$DB_PASSWORD\" --password=${PASS}",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "password flag placeholder kept",
+ "input": "deploy --password <password> --password=YOUR_PASSWORD",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "password flag in code kept",
+ "input": "parser.add_argument(\"--password\", help=\"the password\")\ncmd = \"--password=\" + pw + \" --user=\" + user\nargs = f\"--password={pw}\"",
+ "expect": null,
+ "mode": "source",
+ "same": true
+ },
+ {
+ "name": "mysql -p prompt kept",
+ "input": "mysql -u root -p shop",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "-p of other programs kept",
+ "input": "mkdir -p build && gcc -pthread -o app main.c && docker run -p3306:3306 mysql:8 && ssh -p 2222 host && pytest -pno:cacheprovider",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "curl -u reference kept",
+ "input": "curl -u \"$USER:$TOKEN\" https://example.com && curl -u user: https://example.com",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "curl user-agent kept",
+ "input": "curl --user-agent 'Mozilla/5.0 (X11; Linux)' -u $CREDS https://example.com",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "authorization template kept",
+ "input": "Authorization: Token {{ api_token }}\nAuthorization: Basic ${CREDS}",
+ "expect": null,
+ "same": true
+ },
+ {
+ "name": "authorization in code kept",
+ "input": "headers = {\"Authorization\": f\"Token {api_key}\"}\nreq.set(\"Authorization: Token \" + token)",
+ "expect": null,
+ "mode": "source",
+ "same": true
+ },
+ {
+ "name": "short token prefixes kept",
+ "input": "sk-ant-oat01-short npm_install hf_hub_download glpat-x pypi-simple sk-or-v1-abc",
+ "expect": null,
+ "same": true
+ },
{
"name": "figma tokens",
"input": "personal fig⟨+⟩d_Q3x9Lm2Pz7Kd4Vt8Rb1Nw6Hy0Cs5Fj-AbCdEfGh oauth fig⟨+⟩u_Z8y7X6w5V4u3T2s1R0q9P8o7N6m5L4k and fig⟨+⟩ur_K4j3H2g1F0e9D8c7B6a5Z4y3X2w1V0u kept: configd_abcdefghijklmnopqrstuvwxyz figd_short",
"expect": "personal [REDACTED] oauth [REDACTED] and [REDACTED] kept: configd_abcdefghijklmnopqrstuvwxyz figd_short"
+ },
+ {
+ "name": "figma token markdown-escaped",
+ "input": "text=\"Continue. fig⟨+⟩d\\_CUCHECK\\_Q3x9Lm2Pz7Kd4Vt8Rb1Nw6Hy0Cs5Fj4AbCdEfGh\" and fig⟨+⟩u\\_Q3x9Lm2Pz7Kd4Vt8Rb1Nw6Hy0Cs5Fj",
+ "expect": "text=\"Continue. [REDACTED]\" and [REDACTED]"
+ },
+ {
+ "name": "figma token escaped inside a JSON string",
+ "input": "{\"output\":\"name fig⟨+⟩d\\\\_CUCHECK\\\\_Q3x9Lm2Pz7Kd4Vt8Rb1Nw6Hy0Cs5Fj4AbCdEfGh\\\\nnext\"}",
+ "expect": "{\"output\":\"name [REDACTED]\\\\nnext\"}"
+ },
+ {
+ "name": "bearer header with an escaped figma token",
+ "input": "authorization: Bearer fig⟨+⟩d\\_CUCHECK\\_Q3x9Lm2Pz7Kd4Vt8Rb1Nw6Hy0Cs5Fj4AbCdEfGh)",
+ "expect": "authorization: Bearer [REDACTED])"
+ },
+ {
+ "name": "bearer value with escaped underscores",
+ "input": "curl -H \"X-Auth: Bearer ab12\\_Cd34\\_Ef56Gh78Ij90Kl\" https://api.example.com",
+ "expect": "curl -H \"X-Auth: Bearer [REDACTED]\" https://api.example.com"
+ },
+ {
+ "name": "escaped placeholders and short figma names kept",
+ "input": "Bearer YOUR\\_ACCESS\\_TOKEN\\_HERE and figd\\_short and my\\_figd\\_abcdefghijklmnopqrstuvwxyz and plain\\_snake\\_case\\_words",
+ "same": true
}
]
}
\ No newline at end of file