@homenshum/convex-mcp-nodebench 0.9.2 → 0.9.3
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/dist/index.js
CHANGED
|
@@ -97,16 +97,17 @@ function auditAuthorization(convexDir) {
|
|
|
97
97
|
withoutAuth++;
|
|
98
98
|
// Critical: public mutation/action with DB writes but no auth
|
|
99
99
|
if ((ft === "mutation" || ft === "action") && hasDbWrite) {
|
|
100
|
+
const sensitiveHint = isSensitiveName ? ` Name "${funcName}" suggests a destructive operation.` : "";
|
|
100
101
|
issues.push({
|
|
101
102
|
severity: "critical",
|
|
102
103
|
location: `${relativePath}:${i + 1}`,
|
|
103
104
|
functionName: funcName,
|
|
104
|
-
message: `Public ${ft} "${funcName}" writes to DB without auth check. Any client can call this
|
|
105
|
+
message: `Public ${ft} "${funcName}" writes to DB without auth check. Any client can call this.${sensitiveHint}`,
|
|
105
106
|
fix: `Add: const identity = await ctx.auth.getUserIdentity(); if (!identity) throw new Error("Not authenticated");`,
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
else if (isSensitiveName) {
|
|
110
|
+
// Only flag sensitive name separately if not already caught by DB-write check
|
|
110
111
|
issues.push({
|
|
111
112
|
severity: "critical",
|
|
112
113
|
location: `${relativePath}:${i + 1}`,
|
|
@@ -35,6 +35,46 @@ function auditDataModeling(convexDir) {
|
|
|
35
35
|
tableNames.add(m[1]);
|
|
36
36
|
totalTables++;
|
|
37
37
|
}
|
|
38
|
+
// Detect spread-imported table providers (e.g. ...authTables adds "users", "sessions")
|
|
39
|
+
// Strategy 1: Known spreads from popular Convex packages
|
|
40
|
+
const knownSpreads = {
|
|
41
|
+
authTables: ["users", "authSessions", "authAccounts", "authRefreshTokens", "authVerificationCodes", "authRateLimits", "authVerifiers"],
|
|
42
|
+
};
|
|
43
|
+
// Strategy 2: Parse inline comments next to spreads for table name hints
|
|
44
|
+
// e.g. ...authTables, // `users`, `sessions`
|
|
45
|
+
const spreadCommentPattern = /\.\.\.(\w+)\s*,?\s*\/\/\s*(.+)/g;
|
|
46
|
+
let sm;
|
|
47
|
+
while ((sm = spreadCommentPattern.exec(content)) !== null) {
|
|
48
|
+
const spreadName = sm[1];
|
|
49
|
+
const comment = sm[2];
|
|
50
|
+
// Extract backtick-quoted or quoted table names from comment
|
|
51
|
+
const commentTables = [...comment.matchAll(/[`"'](\w+)[`"']/g)].map(m => m[1]);
|
|
52
|
+
// Merge known + comment-discovered tables
|
|
53
|
+
const tables = new Set([
|
|
54
|
+
...(knownSpreads[spreadName] ?? []),
|
|
55
|
+
...commentTables,
|
|
56
|
+
]);
|
|
57
|
+
for (const t of tables) {
|
|
58
|
+
if (!tableNames.has(t)) {
|
|
59
|
+
tableNames.add(t);
|
|
60
|
+
totalTables++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Strategy 3: If no comment matched, still apply known spreads
|
|
65
|
+
const simpleSpreadPattern = /\.\.\.(\w+)/g;
|
|
66
|
+
let sm2;
|
|
67
|
+
while ((sm2 = simpleSpreadPattern.exec(content)) !== null) {
|
|
68
|
+
const tables = knownSpreads[sm2[1]];
|
|
69
|
+
if (tables) {
|
|
70
|
+
for (const t of tables) {
|
|
71
|
+
if (!tableNames.has(t)) {
|
|
72
|
+
tableNames.add(t);
|
|
73
|
+
totalTables++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
38
78
|
// Per-table analysis
|
|
39
79
|
let currentTable = "";
|
|
40
80
|
let tableStartLine = 0;
|
|
@@ -75,7 +75,7 @@ function buildSarif(projectDir, auditTypes, limit) {
|
|
|
75
75
|
tool: {
|
|
76
76
|
driver: {
|
|
77
77
|
name: "convex-mcp-nodebench",
|
|
78
|
-
version: "0.9.
|
|
78
|
+
version: "0.9.3",
|
|
79
79
|
informationUri: "https://www.npmjs.com/package/@homenshum/convex-mcp-nodebench",
|
|
80
80
|
rules: [...rulesMap.values()],
|
|
81
81
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homenshum/convex-mcp-nodebench",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "Convex-specific MCP server applying NodeBench self-instruct diligence patterns to Convex development. Schema audit, function compliance, deployment gates, persistent gotcha DB, and methodology guidance. Complements Context7 (raw docs) and official Convex MCP (deployment introspection) with structured verification workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|