@methiu/raigal 0.2.6 → 0.2.7
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/LICENSE +6 -1
- package/README.md +18 -23
- package/THIRD_PARTY_NOTICES.md +70 -0
- package/dist/cli.js +169 -70
- package/dist/index.js +168 -69
- package/dist/{json-DxIA7CCt.js → json-B2Kc7_rw.js} +1 -1
- package/dist/mcp.js +150 -53
- package/dist/{sarif-Cu7Rm1Ma.js → sarif-CpMse0iL.js} +1 -1
- package/dist/{version-DtOeK-2T.js → version-CXMYu17z.js} +1 -1
- package/package.json +7 -4
- package/scripts/check-tarball-keys.mjs +26 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@methiu/raigal",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Raigal CLI: a code-quality and security gate for AI-written code. Runs formatting, lint, code-quality, AI-pattern, architecture and security checks across 10 language targets and scores each change from 0 to 100.",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
|
10
10
|
"raigal": "dist/cli.js",
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
16
|
"scripts",
|
|
17
|
-
"tools/jb"
|
|
17
|
+
"tools/jb",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"THIRD_PARTY_NOTICES.md"
|
|
18
20
|
],
|
|
19
21
|
"exports": {
|
|
20
22
|
".": {
|
|
@@ -81,7 +83,8 @@
|
|
|
81
83
|
"cpp"
|
|
82
84
|
],
|
|
83
85
|
"author": {
|
|
84
|
-
"name": "
|
|
86
|
+
"name": "Raigal",
|
|
87
|
+
"email": "matei@raigal.dev",
|
|
85
88
|
"url": "https://raigal.dev"
|
|
86
89
|
},
|
|
87
90
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -11,6 +11,15 @@ const ALLOWED_KEYS = new Set([]);
|
|
|
11
11
|
const PH_KEY_PREFIX = `${"p" + "h" + "c"}_`;
|
|
12
12
|
const PH_KEY_PATTERN = new RegExp(`${PH_KEY_PREFIX}[A-Za-z0-9_-]{20,}`, "g");
|
|
13
13
|
|
|
14
|
+
// Signing-key and issuer overrides must never reach the published package.
|
|
15
|
+
const FORBIDDEN_STRINGS = [
|
|
16
|
+
"RAIGAL_PUBLIC_KEY",
|
|
17
|
+
"RAIGAL_KEY_ID",
|
|
18
|
+
"RAIGAL_ISSUER",
|
|
19
|
+
"RAIGAL_TEST_PUBLIC_KEY",
|
|
20
|
+
"RAIGAL_TEST_KEY_ID",
|
|
21
|
+
];
|
|
22
|
+
|
|
14
23
|
const ROOT_DIR = path.resolve(import.meta.dirname, "..");
|
|
15
24
|
|
|
16
25
|
const walkDirectory = (dir, callback) => {
|
|
@@ -60,11 +69,20 @@ try {
|
|
|
60
69
|
|
|
61
70
|
// 3. Scan all extracted files for unapproved PostHog keys
|
|
62
71
|
const unauthorizedKeys = [];
|
|
72
|
+
const forbiddenHits = [];
|
|
63
73
|
|
|
64
74
|
walkDirectory(packageDir, (filePath) => {
|
|
65
75
|
// Only check text / script / metadata files
|
|
66
76
|
try {
|
|
67
77
|
const content = fs.readFileSync(filePath, "utf-8");
|
|
78
|
+
const relFile = path.relative(packageDir, filePath).split(path.sep).join("/");
|
|
79
|
+
if (relFile.startsWith("dist/")) {
|
|
80
|
+
for (const needle of FORBIDDEN_STRINGS) {
|
|
81
|
+
if (content.includes(needle)) {
|
|
82
|
+
forbiddenHits.push({ needle, file: relFile });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
68
86
|
const matches = content.match(PH_KEY_PATTERN);
|
|
69
87
|
if (matches) {
|
|
70
88
|
for (const match of matches) {
|
|
@@ -87,6 +105,14 @@ try {
|
|
|
87
105
|
process.exit(1);
|
|
88
106
|
}
|
|
89
107
|
|
|
108
|
+
if (forbiddenHits.length > 0) {
|
|
109
|
+
console.error("Tarball key check FAILED: signing-key overrides found in package:");
|
|
110
|
+
for (const item of forbiddenHits) {
|
|
111
|
+
console.error(` - "${item.needle}" in file "${item.file}"`);
|
|
112
|
+
}
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
|
|
90
116
|
console.log("Tarball key check passed: No unauthorized PostHog keys found in package.");
|
|
91
117
|
process.exit(0);
|
|
92
118
|
} catch (err) {
|