@aiguru/google-web-operations 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -38,5 +38,7 @@ GWO_REPORT_TO=ai@aiguru.co.il
38
38
  # Fine-grained token: Contents write + Pull requests write on the site repos.
39
39
  GITHUB_TOKEN=
40
40
 
41
- # --- NPM JS ACCESS TOKEN - gwo-release --------------------
42
- NPM_TOKEN=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
41
+ # --- Publishing ---------------------------------------------------------------
42
+ # The npm publish token is NOT an environment variable of this system and must
43
+ # never be written here or anywhere in the repository: this file is shipped
44
+ # inside the package. It lives only in the GitHub repository secret NPM_TOKEN.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-web-operations",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Google Web Operations: agent-run SEO and GEO operations for client websites. One core, one MCP server, two hosts (Claude Code, Codex).",
5
5
  "author": {
6
6
  "name": "AI Guru"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-web-operations",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Google Web Operations: agent-run SEO and GEO operations for client websites. One core, one MCP server, two hosts (Claude Code, Codex).",
5
5
  "author": {
6
6
  "name": "AI Guru"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiguru/google-web-operations",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Google Web Operations: agent-run SEO and GEO operations for client websites. One core, one MCP server, two hosts (Claude Code, Codex).",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Refuse to build, test or release when a credential sits in a file that the
4
+ * package or the repository would carry.
5
+ *
6
+ * Scans every tracked file and every file the build copies (so .env.example,
7
+ * docs, policies, playbooks and hosts are all covered) for well-known token
8
+ * shapes and for non-empty secret-looking assignments in example env files.
9
+ * Runs inside `npm run check`, so CI and the release workflow fail before
10
+ * anything is packed or published.
11
+ *
12
+ * node tools/check-secrets.ts
13
+ */
14
+ import { execFileSync } from 'node:child_process';
15
+ import { readFileSync, statSync } from 'node:fs';
16
+ import path from 'node:path';
17
+ import { ROOT } from "../packages/core/src/paths.js";
18
+ const PATTERNS = [
19
+ ['npm token', /\bnpm_[A-Za-z0-9]{30,}\b/],
20
+ ['GitHub token', /\b(ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{30,}\b|\bgithub_pat_[A-Za-z0-9_]{40,}\b/],
21
+ ['Google API key', /\bAIza[0-9A-Za-z_-]{30,}\b/],
22
+ ['Google OAuth client secret', /\bGOCSPX-[0-9A-Za-z_-]{20,}\b/],
23
+ ['Resend key', /\bre_[A-Za-z0-9]{20,}\b/],
24
+ ['OpenAI-style key', /\bsk-[A-Za-z0-9_-]{30,}\b/],
25
+ ['private key block', /-----BEGIN [A-Z ]*PRIVATE KEY-----/],
26
+ ];
27
+ /** In *.example env files, any secret-looking variable must be empty. */
28
+ const ENV_ASSIGN = /^\s*([A-Z0-9_]*(TOKEN|KEY|SECRET|PASSWORD)[A-Z0-9_]*)\s*=\s*(\S.*)$/;
29
+ const SKIP = /^(package-lock\.json|.*\.(png|jpg|jpeg|gif|ico|wmf|woff2?|ttf|docx|pdf|tgz))$/i;
30
+ const files = execFileSync('git', ['ls-files', '-z'], { cwd: ROOT, encoding: 'utf8' }).split('\0').filter(Boolean)
31
+ .filter((f) => !SKIP.test(f)).filter((f) => { try {
32
+ return statSync(path.join(ROOT, f)).isFile();
33
+ }
34
+ catch {
35
+ return false;
36
+ } });
37
+ const problems = [];
38
+ for (const f of files) {
39
+ const text = readFileSync(path.join(ROOT, f), 'utf8');
40
+ for (const [name, re] of PATTERNS)
41
+ if (re.test(text))
42
+ problems.push(`${f}: looks like a ${name}`);
43
+ if (/\.env(\.example)?$|\.example\.yaml$/.test(f)) {
44
+ text.split('\n').forEach((line, i) => {
45
+ const m = line.match(ENV_ASSIGN);
46
+ if (m && !/^(GWO_[A-Z_]+|.*=\s*(<|\$\{|""|'')).*/.test(line) && !/^\s*#/.test(line)) {
47
+ // Allow documented placeholders such as ops@aiguru.co.il for non-secret names, refuse real-looking values for secret names.
48
+ if (!/^(GWO_TOKEN_STORE)$/.test(m[1]))
49
+ problems.push(`${f}:${i + 1}: ${m[1]} has a value; example files must leave secrets empty`);
50
+ }
51
+ });
52
+ }
53
+ }
54
+ if (problems.length) {
55
+ console.error('check-secrets: refusing to continue.\n' + problems.map((p) => ' - ' + p).join('\n') +
56
+ '\nRemove the value, rotate the credential, and keep secrets in .env (gitignored), sites/*.secrets.yaml (gitignored) or GitHub repository secrets.');
57
+ process.exit(1);
58
+ }
59
+ console.log(`check-secrets: ${files.length} tracked files clean`);