canship 0.2.1 → 0.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canship",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Static scanner for exposed credentials and open access rules in JS/TS front-end projects. Scans local files without executing project code or making network requests.",
5
5
  "keywords": [
6
6
  "security",
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "files": [
32
32
  "dist",
33
+ "schemas",
33
34
  "README.md",
34
35
  "README-zh-CN.md",
35
36
  "LICENSE"
@@ -42,6 +43,9 @@
42
43
  "dev": "tsup --watch",
43
44
  "typecheck": "tsc --noEmit",
44
45
  "test": "node scripts/run-tests.mjs",
46
+ "evaluate": "tsx scripts/evaluate.ts",
47
+ "evaluate:projects": "tsx scripts/evaluate-projects.ts",
48
+ "test:package": "npm run build && node scripts/package-smoke.mjs",
45
49
  "prepublishOnly": "npm run typecheck && npm run test && npm run build"
46
50
  },
47
51
  "overrides": {
@@ -49,6 +53,7 @@
49
53
  },
50
54
  "devDependencies": {
51
55
  "@types/node": "^24.0.0",
56
+ "ajv": "^8.20.0",
52
57
  "tsup": "^8.3.5",
53
58
  "tsx": "^4.19.2",
54
59
  "typescript": "^5.7.2"
@@ -0,0 +1,95 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "canship scan report v1",
4
+ "type": "object",
5
+ "required": ["schemaVersion", "version", "root", "filesScanned", "durationMs", "partial", "errors", "skipped", "ignored", "ignoredFindings", "ruleSelection", "vendored", "hiddenLikely", "baselineSuppressed", "baselineStale", "findings"],
6
+ "properties": {
7
+ "schemaVersion": { "const": 1 },
8
+ "version": { "type": "string", "minLength": 1 },
9
+ "root": { "type": "string" },
10
+ "filesScanned": { "$ref": "#/definitions/count" },
11
+ "durationMs": { "type": "number", "minimum": 0 },
12
+ "partial": { "type": "boolean" },
13
+ "vendored": { "$ref": "#/definitions/count" },
14
+ "hiddenLikely": { "$ref": "#/definitions/count" },
15
+ "baselineSuppressed": { "$ref": "#/definitions/count" },
16
+ "baselineStale": { "$ref": "#/definitions/count" },
17
+ "excerptsOmitted": { "type": "boolean" },
18
+ "ignored": { "$ref": "#/definitions/strings" },
19
+ "errors": {
20
+ "type": "array",
21
+ "items": {
22
+ "type": "object",
23
+ "required": ["ruleId", "file", "message", "kind"],
24
+ "properties": {
25
+ "ruleId": { "type": "string" },
26
+ "file": { "type": ["string", "null"] },
27
+ "message": { "type": "string" },
28
+ "kind": { "enum": ["crashed", "incomplete"] }
29
+ }
30
+ }
31
+ },
32
+ "skipped": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "object",
36
+ "required": ["path", "reason"],
37
+ "properties": {
38
+ "path": { "type": "string" },
39
+ "reason": { "enum": ["too-large", "unreadable", "directory-unreadable", "binary", "symlink", "nested-repository"] },
40
+ "detail": { "type": "string" }
41
+ }
42
+ }
43
+ },
44
+ "ignoredFindings": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "required": ["file", "line", "ruleId"],
49
+ "properties": {
50
+ "file": { "type": "string" },
51
+ "line": { "type": "integer", "minimum": 1 },
52
+ "ruleId": { "type": "string" }
53
+ }
54
+ }
55
+ },
56
+ "ruleSelection": {
57
+ "anyOf": [
58
+ { "type": "null" },
59
+ {
60
+ "type": "object",
61
+ "required": ["only", "skip", "removed"],
62
+ "properties": {
63
+ "only": { "$ref": "#/definitions/strings" },
64
+ "skip": { "$ref": "#/definitions/strings" },
65
+ "removed": { "$ref": "#/definitions/count" }
66
+ }
67
+ }
68
+ ]
69
+ },
70
+ "findings": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "required": ["ruleId", "severity", "confidence", "title", "file", "line", "excerpt", "why", "fix"],
75
+ "properties": {
76
+ "ruleId": { "type": "string", "minLength": 1 },
77
+ "severity": { "enum": ["P0", "P1", "P2"] },
78
+ "confidence": { "enum": ["certain", "likely"] },
79
+ "title": { "type": "string" },
80
+ "file": { "type": ["string", "null"] },
81
+ "line": { "anyOf": [{ "type": "integer", "minimum": 1 }, { "type": "null" }] },
82
+ "excerpt": { "type": ["string", "null"] },
83
+ "sourceFingerprint": { "type": "string" },
84
+ "why": { "$ref": "#/definitions/strings" },
85
+ "fix": { "$ref": "#/definitions/strings" },
86
+ "humanOnly": { "$ref": "#/definitions/strings" }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "definitions": {
92
+ "count": { "type": "integer", "minimum": 0 },
93
+ "strings": { "type": "array", "items": { "type": "string" } }
94
+ }
95
+ }