Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
},
"dependencies": {
"@next/env": "16.2.10",
"@supabase/ssr": "^0.12.0",
"@supabase/ssr": "^0.12.3",
"@supabase/supabase-js": "^2.108.2",
"exceljs": "^4.4.0",
"jszip": "^3.10.1",
Expand Down
12 changes: 9 additions & 3 deletions scripts/check-client-bundle-secrets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ const forbiddenMarkers = [
"OPENAI_ORG_ID",
"OPENAI_PROJECT_ID",
"RAG_QUERY_HASH_SECRET",
"sb_secret_",
// Match an actual secret *value* (prefix + a long token), not the bare "sb_secret_"
// prefix string. @supabase/supabase-js's own browser client code legitimately ships
// that literal prefix (isNewApiKey()/checkApiKeyFormat() in its fetch helpers, used to
// detect new-format Supabase API keys) — that string alone is not a leaked secret.
/\bsb_secret_[A-Za-z0-9_-]{20,}\b/,
"sk-proj-",
"sk-svcacct-",
];
Expand Down Expand Up @@ -47,9 +51,11 @@ const offenders = new Map();
for (const file of [...textFiles(publicRoot), ...textFiles(clientBuildRoot)]) {
const content = readFileSync(file, "utf8");
for (const marker of forbiddenMarkers) {
if (content.includes(marker)) {
const matchedText =
marker instanceof RegExp ? content.match(marker)?.[0] : content.includes(marker) ? marker : null;
if (matchedText) {
const relativePath = relative(projectRoot, file).replaceAll("\\", "/");
offenders.set(`${relativePath}\0${marker}`, { marker, relativePath });
offenders.set(`${relativePath}\0${matchedText}`, { marker: matchedText, relativePath });
Comment thread
BigSimmo marked this conversation as resolved.
}
}
}
Expand Down