laranex-schema-viewer-ui 0.3.0 → 0.4.0
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/README.md +5 -0
- package/contract/allowlist.schema.json +62 -0
- package/contract/conformance/scan/allowlist-crlf.json +61 -0
- package/contract/conformance/scan/allowlist-exact.json +61 -0
- package/contract/conformance/scan/allowlist-include-cycle.json +72 -0
- package/contract/conformance/scan/allowlist-include-root.json +72 -0
- package/contract/conformance/scan/allowlist-invalid.json +66 -0
- package/contract/conformance/scan/allowlist-missing-include.json +67 -0
- package/contract/conformance/scan/allowlist-moved.json +76 -0
- package/contract/conformance/scan/allowlist-stale-entry.json +74 -0
- package/contract/conformance/scan/allowlist-tampered.json +61 -0
- package/contract/conformance/scan/embedded-json-parse-bundle.json +50 -0
- package/contract/conformance/scan/embedded-object-literal-bundle.json +50 -0
- package/contract/conformance/scan/embedded-offline-html.json +50 -0
- package/contract/conformance/scan/embedded-source-map.json +50 -0
- package/contract/conformance/scan/embedded-viewer-global.json +50 -0
- package/contract/conformance/scan/history-path-at-commit.json +108 -0
- package/contract/conformance/scan/near-miss-contract-format.json +46 -0
- package/contract/conformance/scan/near-miss-depth-7.json +40 -0
- package/contract/conformance/scan/near-miss-gate-format.json +46 -0
- package/contract/conformance/scan/near-miss-javascript-in-tree.json +40 -0
- package/contract/conformance/scan/near-miss-no-connections-json.json +40 -0
- package/contract/conformance/scan/near-miss-numeric-version.json +40 -0
- package/contract/conformance/scan/near-miss-viewer-global-without-schema.json +40 -0
- package/contract/conformance/scan/negative-gate-report.json +40 -0
- package/contract/conformance/scan/negative-json-schemas.json +46 -0
- package/contract/conformance/scan/negative-package-manifests.json +64 -0
- package/contract/conformance/scan/negative-validator-code.json +40 -0
- package/contract/conformance/scan/negative-viewer-manifest.json +46 -0
- package/contract/conformance/scan/positive-byte-order-mark.json +50 -0
- package/contract/conformance/scan/positive-canonical.json +50 -0
- package/contract/conformance/scan/positive-compact.json +50 -0
- package/contract/conformance/scan/positive-legacy-laravel-envelope.json +50 -0
- package/contract/conformance/scan/positive-legacy-node-v1.json +50 -0
- package/contract/conformance/scan/positive-legacy-python-v1.json +50 -0
- package/contract/conformance/scan/positive-nested-depth-3.json +50 -0
- package/contract/conformance/scan/positive-nested-depth-6.json +50 -0
- package/contract/conformance/scan/positive-nested-in-array.json +50 -0
- package/contract/conformance/scan/positive-nested-legacy.json +50 -0
- package/contract/conformance/scan/positive-version-1-0.json +50 -0
- package/contract/conformance/scan/positive-version-3-0.json +50 -0
- package/contract/conformance/scan/precedence-clean.json +40 -0
- package/contract/conformance/scan/precedence-confirmed-over-uncertain.json +65 -0
- package/contract/conformance/scan/precedence-incomplete-over-confirmed.json +67 -0
- package/contract/conformance/scan/uncertain-html-fragment.json +65 -0
- package/contract/conformance/scan/uncertain-truncated-format.json +50 -0
- package/contract/conformance/scan/uncertain-truncated-json.json +50 -0
- package/contract/scan-report.schema.json +218 -0
- package/contract/scan.mjs +355 -0
- package/contract/synthetic.json +370 -0
- package/dist/lib/contract-ZsLKbScP.js +803 -0
- package/dist/lib/contract-ZsLKbScP.js.map +1 -0
- package/dist/lib/contract.js +3 -3
- package/dist/lib/{export-L1rzMCoW.js → export-oCZEaixp.js} +2 -2
- package/dist/lib/{export-L1rzMCoW.js.map → export-oCZEaixp.js.map} +1 -1
- package/dist/lib/export.js +1 -1
- package/dist/lib/index.js +1982 -1982
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/{validate-BF7eATfB.js → validate-B1oz49AC.js} +281 -278
- package/dist/lib/validate-B1oz49AC.js.map +1 -0
- package/dist/types/contract/index.d.ts +1 -0
- package/dist/types/contract/scan.d.ts +114 -0
- package/dist/types/contract/sha256.d.ts +1 -0
- package/dist/viewer/app.js +20 -20
- package/dist/viewer/index.html +1 -1
- package/dist/viewer/manifest.json +6 -6
- package/dist/viewer/offline.js +42 -42
- package/docs/contract.md +153 -1
- package/docs/integration.md +6 -1
- package/package.json +1 -1
- package/dist/lib/contract-C2tN-NIP.js +0 -409
- package/dist/lib/contract-C2tN-NIP.js.map +0 -1
- package/dist/lib/validate-BF7eATfB.js.map +0 -1
package/README.md
CHANGED
|
@@ -26,6 +26,11 @@ The viewer displays the comparisons, migration tracks and inferred associations
|
|
|
26
26
|
Migrations tabs, difference marks on the diagram, inferred marks on foreign-key edges) and never computes them; see
|
|
27
27
|
[docs/views.md](docs/views.md).
|
|
28
28
|
|
|
29
|
+
The viewer is a development-only tool: never expose it or its snapshots in production, and require authentication
|
|
30
|
+
even in local development. [docs/embedding.md](docs/embedding.md) shows how to add it to an existing React, Next.js,
|
|
31
|
+
Vue, Angular, FastAPI or Node.js application as a protected development page; [docs/security.md](docs/security.md) is
|
|
32
|
+
the policy.
|
|
33
|
+
|
|
29
34
|
Hosts without Node.js serve `node_modules/laranex-schema-viewer-ui/dist/viewer/` as static files (including its
|
|
30
35
|
`favicon.svg` and `favicon.ico`) with a `snapshot.json` beside `index.html`, or use
|
|
31
36
|
`<laranex-schema-viewer src="snapshot.json">`. Using the viewer (layout, connections, line ends, column details,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://laranex.github.io/schema-viewer-ui/laranex-schema-allowlist/1.0.json",
|
|
4
|
+
"title": "laranex-schema-allowlist 1.0",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"format": {
|
|
8
|
+
"const": "laranex-schema-allowlist"
|
|
9
|
+
},
|
|
10
|
+
"version": {
|
|
11
|
+
"const": "1.0"
|
|
12
|
+
},
|
|
13
|
+
"entries": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"properties": {
|
|
18
|
+
"path": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"pattern": "^(?!/)(?!.*//)(?!.*/$)(?!(.*/)?\\.\\.?(/|$))[^\\\\\\u0000]+$"
|
|
21
|
+
},
|
|
22
|
+
"sha256": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"path",
|
|
29
|
+
"sha256"
|
|
30
|
+
],
|
|
31
|
+
"additionalProperties": false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"include": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"path": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^(?!/)(?!.*//)(?!.*/$)(?!(.*/)?\\.\\.?(/|$))[^\\\\\\u0000]+$"
|
|
42
|
+
},
|
|
43
|
+
"root": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"pattern": "^\\.$|^(?!/)(?!.*//)(?!.*/$)(?!(.*/)?\\.\\.?(/|$))[^\\\\\\u0000]+$"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"required": [
|
|
49
|
+
"path",
|
|
50
|
+
"root"
|
|
51
|
+
],
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"required": [
|
|
57
|
+
"format",
|
|
58
|
+
"version",
|
|
59
|
+
"entries"
|
|
60
|
+
],
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The digest reads CRLF as LF, so a Windows checkout matches",
|
|
3
|
+
"expected": {
|
|
4
|
+
"counts": {
|
|
5
|
+
"allowed": 1,
|
|
6
|
+
"confirmed": 0,
|
|
7
|
+
"files": 1,
|
|
8
|
+
"incomplete": 0,
|
|
9
|
+
"moved": 0,
|
|
10
|
+
"stale": 0,
|
|
11
|
+
"tampered": 0,
|
|
12
|
+
"uncertain": 0
|
|
13
|
+
},
|
|
14
|
+
"errors": [],
|
|
15
|
+
"exitCode": 0,
|
|
16
|
+
"findings": [
|
|
17
|
+
{
|
|
18
|
+
"commit": null,
|
|
19
|
+
"kind": "document",
|
|
20
|
+
"path": "tests/fixtures/windows.json",
|
|
21
|
+
"reason": "document",
|
|
22
|
+
"scope": "tracked",
|
|
23
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f",
|
|
24
|
+
"status": "allowed"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"format": "laranex-schema-scan",
|
|
28
|
+
"limit": 67108864,
|
|
29
|
+
"scopes": [
|
|
30
|
+
"tracked"
|
|
31
|
+
],
|
|
32
|
+
"version": "1.0"
|
|
33
|
+
},
|
|
34
|
+
"input": {
|
|
35
|
+
"allowlist": ".laranex-schema-allowlist.json",
|
|
36
|
+
"allowlists": {
|
|
37
|
+
".laranex-schema-allowlist.json": {
|
|
38
|
+
"entries": [
|
|
39
|
+
{
|
|
40
|
+
"path": "tests/fixtures/windows.json",
|
|
41
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"format": "laranex-schema-allowlist",
|
|
45
|
+
"version": "1.0"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
{
|
|
50
|
+
"commit": null,
|
|
51
|
+
"content": "{\r\n \"comparisons\": [],\r\n \"connections\": [\r\n {\r\n \"coverage\": {\r\n \"database\": {\r\n \"complete\": false,\r\n \"features\": {\r\n \"checkConstraints\": \"partial\",\r\n \"columnTypes\": \"complete\",\r\n \"columns\": \"complete\",\r\n \"comments\": \"not_applicable\",\r\n \"defaults\": \"complete\",\r\n \"foreignKeys\": \"complete\",\r\n \"includedColumns\": \"not_applicable\",\r\n \"indexExpressions\": \"complete\",\r\n \"indexPredicates\": \"complete\",\r\n \"indexes\": \"complete\",\r\n \"models\": \"not_applicable\",\r\n \"primaryKeys\": \"complete\",\r\n \"referentialActions\": \"complete\",\r\n \"relationships\": \"not_applicable\",\r\n \"tables\": \"complete\",\r\n \"uniqueConstraints\": \"complete\"\r\n },\r\n \"schemas\": null\r\n },\r\n \"declared\": null\r\n },\r\n \"defaultSchema\": null,\r\n \"driver\": \"sqlite\",\r\n \"id\": \"connection:main\",\r\n \"name\": \"main\",\r\n \"tables\": [\r\n {\r\n \"columns\": [\r\n {\r\n \"autoIncrement\": true,\r\n \"collation\": null,\r\n \"comment\": null,\r\n \"default\": null,\r\n \"enum\": null,\r\n \"generated\": null,\r\n \"name\": \"id\",\r\n \"note\": null,\r\n \"nullable\": false,\r\n \"ormDefault\": null,\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"timezone\": null,\r\n \"type\": \"INTEGER\",\r\n \"typeName\": \"integer\"\r\n },\r\n {\r\n \"autoIncrement\": false,\r\n \"collation\": \"NOCASE\",\r\n \"comment\": null,\r\n \"default\": null,\r\n \"enum\": null,\r\n \"generated\": null,\r\n \"name\": \"title\",\r\n \"note\": null,\r\n \"nullable\": false,\r\n \"ormDefault\": null,\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"timezone\": null,\r\n \"type\": \"TEXT\",\r\n \"typeName\": \"text\"\r\n },\r\n {\r\n \"autoIncrement\": false,\r\n \"collation\": null,\r\n \"comment\": null,\r\n \"default\": null,\r\n \"enum\": null,\r\n \"generated\": null,\r\n \"name\": \"slug\",\r\n \"note\": null,\r\n \"nullable\": false,\r\n \"ormDefault\": null,\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"timezone\": null,\r\n \"type\": \"TEXT\",\r\n \"typeName\": \"text\"\r\n },\r\n {\r\n \"autoIncrement\": false,\r\n \"collation\": null,\r\n \"comment\": null,\r\n \"default\": {\r\n \"kind\": \"literal\",\r\n \"value\": \"0\"\r\n },\r\n \"enum\": null,\r\n \"generated\": null,\r\n \"name\": \"archived\",\r\n \"note\": null,\r\n \"nullable\": false,\r\n \"ormDefault\": null,\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"timezone\": null,\r\n \"type\": \"INTEGER\",\r\n \"typeName\": \"integer\"\r\n }\r\n ],\r\n \"comment\": null,\r\n \"constraints\": [\r\n {\r\n \"columns\": [\r\n \"slug\"\r\n ],\r\n \"expression\": null,\r\n \"id\": \"sqlite:main.notes:constraint:notes_slug\",\r\n \"kind\": \"unique\",\r\n \"name\": \"notes_slug\",\r\n \"provenance\": [\r\n \"database\"\r\n ]\r\n },\r\n {\r\n \"columns\": [\r\n \"archived\"\r\n ],\r\n \"expression\": \"archived IN (0, 1)\",\r\n \"id\": \"sqlite:main.notes:constraint:notes_archived_flag\",\r\n \"kind\": \"check\",\r\n \"name\": \"notes_archived_flag\",\r\n \"provenance\": [\r\n \"database\"\r\n ]\r\n }\r\n ],\r\n \"foreignKeys\": [],\r\n \"id\": \"sqlite:main.notes\",\r\n \"indexes\": [\r\n {\r\n \"backs\": {\r\n \"constraint\": \"sqlite:main.notes:constraint:notes_slug\",\r\n \"kind\": \"unique_constraint\"\r\n },\r\n \"expression\": false,\r\n \"id\": \"sqlite:main.notes:index:sqlite_autoindex_notes_1\",\r\n \"included\": [],\r\n \"method\": null,\r\n \"name\": \"sqlite_autoindex_notes_1\",\r\n \"partial\": false,\r\n \"parts\": [\r\n {\r\n \"collation\": null,\r\n \"column\": \"slug\",\r\n \"expression\": null,\r\n \"length\": null,\r\n \"nulls\": null,\r\n \"opclass\": null,\r\n \"order\": null\r\n }\r\n ],\r\n \"predicate\": null,\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"unique\": true\r\n },\r\n {\r\n \"backs\": null,\r\n \"expression\": false,\r\n \"id\": \"sqlite:main.notes:index:notes_active_title\",\r\n \"included\": [],\r\n \"method\": null,\r\n \"name\": \"notes_active_title\",\r\n \"partial\": true,\r\n \"parts\": [\r\n {\r\n \"collation\": null,\r\n \"column\": \"title\",\r\n \"expression\": null,\r\n \"length\": null,\r\n \"nulls\": null,\r\n \"opclass\": null,\r\n \"order\": null\r\n }\r\n ],\r\n \"predicate\": \"archived = 0\",\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"unique\": false\r\n },\r\n {\r\n \"backs\": null,\r\n \"expression\": true,\r\n \"id\": \"sqlite:main.notes:index:notes_lower_title\",\r\n \"included\": [],\r\n \"method\": null,\r\n \"name\": \"notes_lower_title\",\r\n \"partial\": false,\r\n \"parts\": [\r\n {\r\n \"collation\": null,\r\n \"column\": null,\r\n \"expression\": \"lower(title)\",\r\n \"length\": null,\r\n \"nulls\": null,\r\n \"opclass\": null,\r\n \"order\": null\r\n }\r\n ],\r\n \"predicate\": null,\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"unique\": false\r\n },\r\n {\r\n \"backs\": null,\r\n \"expression\": false,\r\n \"id\": \"sqlite:main.notes:index:notes_title_nocase\",\r\n \"included\": [],\r\n \"method\": null,\r\n \"name\": \"notes_title_nocase\",\r\n \"partial\": false,\r\n \"parts\": [\r\n {\r\n \"collation\": \"NOCASE\",\r\n \"column\": \"title\",\r\n \"expression\": null,\r\n \"length\": null,\r\n \"nulls\": null,\r\n \"opclass\": null,\r\n \"order\": \"desc\"\r\n }\r\n ],\r\n \"predicate\": null,\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"unique\": false\r\n }\r\n ],\r\n \"name\": \"notes\",\r\n \"note\": null,\r\n \"owner\": {\r\n \"kind\": \"application\",\r\n \"package\": null\r\n },\r\n \"primaryKey\": [\r\n \"id\"\r\n ],\r\n \"provenance\": [\r\n \"database\"\r\n ],\r\n \"schema\": null\r\n }\r\n ]\r\n }\r\n ],\r\n \"derivedLinks\": [],\r\n \"diagnostics\": [\r\n {\r\n \"category\": \"inspection\",\r\n \"certainty\": \"certain\",\r\n \"id\": \"necb2896ad42f5c2c\",\r\n \"kind\": \"unsupported_metadata\",\r\n \"message\": \"Check constraints were read from the table SQL; unnamed checks get generated names.\",\r\n \"severity\": \"info\",\r\n \"subject\": {\r\n \"columns\": null,\r\n \"id\": \"connection:main\",\r\n \"label\": \"main\",\r\n \"type\": \"connection\"\r\n }\r\n }\r\n ],\r\n \"format\": \"laranex-schema\",\r\n \"generator\": {\r\n \"name\": \"contract-fixtures\",\r\n \"orm\": null\r\n },\r\n \"inferredAssociations\": [],\r\n \"links\": [],\r\n \"migrations\": [],\r\n \"models\": [],\r\n \"note\": null,\r\n \"relationships\": [],\r\n \"source\": \"database\",\r\n \"version\": \"2.0\"\r\n}\r\n",
|
|
52
|
+
"path": "tests/fixtures/windows.json",
|
|
53
|
+
"scope": "tracked"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"limit": null,
|
|
57
|
+
"scopes": [
|
|
58
|
+
"tracked"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "A document listed with its path and digest is allowed",
|
|
3
|
+
"expected": {
|
|
4
|
+
"counts": {
|
|
5
|
+
"allowed": 1,
|
|
6
|
+
"confirmed": 0,
|
|
7
|
+
"files": 1,
|
|
8
|
+
"incomplete": 0,
|
|
9
|
+
"moved": 0,
|
|
10
|
+
"stale": 0,
|
|
11
|
+
"tampered": 0,
|
|
12
|
+
"uncertain": 0
|
|
13
|
+
},
|
|
14
|
+
"errors": [],
|
|
15
|
+
"exitCode": 0,
|
|
16
|
+
"findings": [
|
|
17
|
+
{
|
|
18
|
+
"commit": null,
|
|
19
|
+
"kind": "document",
|
|
20
|
+
"path": "tests/fixtures/schema.json",
|
|
21
|
+
"reason": "document",
|
|
22
|
+
"scope": "tracked",
|
|
23
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f",
|
|
24
|
+
"status": "allowed"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"format": "laranex-schema-scan",
|
|
28
|
+
"limit": 67108864,
|
|
29
|
+
"scopes": [
|
|
30
|
+
"tracked"
|
|
31
|
+
],
|
|
32
|
+
"version": "1.0"
|
|
33
|
+
},
|
|
34
|
+
"input": {
|
|
35
|
+
"allowlist": ".laranex-schema-allowlist.json",
|
|
36
|
+
"allowlists": {
|
|
37
|
+
".laranex-schema-allowlist.json": {
|
|
38
|
+
"entries": [
|
|
39
|
+
{
|
|
40
|
+
"path": "tests/fixtures/schema.json",
|
|
41
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"format": "laranex-schema-allowlist",
|
|
45
|
+
"version": "1.0"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
{
|
|
50
|
+
"commit": null,
|
|
51
|
+
"content": "{\n \"comparisons\": [],\n \"connections\": [\n {\n \"coverage\": {\n \"database\": {\n \"complete\": false,\n \"features\": {\n \"checkConstraints\": \"partial\",\n \"columnTypes\": \"complete\",\n \"columns\": \"complete\",\n \"comments\": \"not_applicable\",\n \"defaults\": \"complete\",\n \"foreignKeys\": \"complete\",\n \"includedColumns\": \"not_applicable\",\n \"indexExpressions\": \"complete\",\n \"indexPredicates\": \"complete\",\n \"indexes\": \"complete\",\n \"models\": \"not_applicable\",\n \"primaryKeys\": \"complete\",\n \"referentialActions\": \"complete\",\n \"relationships\": \"not_applicable\",\n \"tables\": \"complete\",\n \"uniqueConstraints\": \"complete\"\n },\n \"schemas\": null\n },\n \"declared\": null\n },\n \"defaultSchema\": null,\n \"driver\": \"sqlite\",\n \"id\": \"connection:main\",\n \"name\": \"main\",\n \"tables\": [\n {\n \"columns\": [\n {\n \"autoIncrement\": true,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"id\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": \"NOCASE\",\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"title\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"slug\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": {\n \"kind\": \"literal\",\n \"value\": \"0\"\n },\n \"enum\": null,\n \"generated\": null,\n \"name\": \"archived\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n }\n ],\n \"comment\": null,\n \"constraints\": [\n {\n \"columns\": [\n \"slug\"\n ],\n \"expression\": null,\n \"id\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique\",\n \"name\": \"notes_slug\",\n \"provenance\": [\n \"database\"\n ]\n },\n {\n \"columns\": [\n \"archived\"\n ],\n \"expression\": \"archived IN (0, 1)\",\n \"id\": \"sqlite:main.notes:constraint:notes_archived_flag\",\n \"kind\": \"check\",\n \"name\": \"notes_archived_flag\",\n \"provenance\": [\n \"database\"\n ]\n }\n ],\n \"foreignKeys\": [],\n \"id\": \"sqlite:main.notes\",\n \"indexes\": [\n {\n \"backs\": {\n \"constraint\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique_constraint\"\n },\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:sqlite_autoindex_notes_1\",\n \"included\": [],\n \"method\": null,\n \"name\": \"sqlite_autoindex_notes_1\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"slug\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": true\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_active_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_active_title\",\n \"partial\": true,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": \"archived = 0\",\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": true,\n \"id\": \"sqlite:main.notes:index:notes_lower_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_lower_title\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": null,\n \"expression\": \"lower(title)\",\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_title_nocase\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_title_nocase\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": \"NOCASE\",\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": \"desc\"\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n }\n ],\n \"name\": \"notes\",\n \"note\": null,\n \"owner\": {\n \"kind\": \"application\",\n \"package\": null\n },\n \"primaryKey\": [\n \"id\"\n ],\n \"provenance\": [\n \"database\"\n ],\n \"schema\": null\n }\n ]\n }\n ],\n \"derivedLinks\": [],\n \"diagnostics\": [\n {\n \"category\": \"inspection\",\n \"certainty\": \"certain\",\n \"id\": \"necb2896ad42f5c2c\",\n \"kind\": \"unsupported_metadata\",\n \"message\": \"Check constraints were read from the table SQL; unnamed checks get generated names.\",\n \"severity\": \"info\",\n \"subject\": {\n \"columns\": null,\n \"id\": \"connection:main\",\n \"label\": \"main\",\n \"type\": \"connection\"\n }\n }\n ],\n \"format\": \"laranex-schema\",\n \"generator\": {\n \"name\": \"contract-fixtures\",\n \"orm\": null\n },\n \"inferredAssociations\": [],\n \"links\": [],\n \"migrations\": [],\n \"models\": [],\n \"note\": null,\n \"relationships\": [],\n \"source\": \"database\",\n \"version\": \"2.0\"\n}\n",
|
|
52
|
+
"path": "tests/fixtures/schema.json",
|
|
53
|
+
"scope": "tracked"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"limit": null,
|
|
57
|
+
"scopes": [
|
|
58
|
+
"tracked"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "An allowlist that includes itself fails the scan",
|
|
3
|
+
"expected": {
|
|
4
|
+
"counts": {
|
|
5
|
+
"allowed": 1,
|
|
6
|
+
"confirmed": 0,
|
|
7
|
+
"files": 1,
|
|
8
|
+
"incomplete": 0,
|
|
9
|
+
"moved": 0,
|
|
10
|
+
"stale": 0,
|
|
11
|
+
"tampered": 0,
|
|
12
|
+
"uncertain": 0
|
|
13
|
+
},
|
|
14
|
+
"errors": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "allowlist_invalid",
|
|
17
|
+
"message": "Allowlist .laranex-schema-allowlist.json includes itself"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"exitCode": 2,
|
|
21
|
+
"findings": [
|
|
22
|
+
{
|
|
23
|
+
"commit": null,
|
|
24
|
+
"kind": "document",
|
|
25
|
+
"path": "tests/fixtures/schema.json",
|
|
26
|
+
"reason": "document",
|
|
27
|
+
"scope": "tracked",
|
|
28
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f",
|
|
29
|
+
"status": "allowed"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"format": "laranex-schema-scan",
|
|
33
|
+
"limit": 67108864,
|
|
34
|
+
"scopes": [
|
|
35
|
+
"tracked"
|
|
36
|
+
],
|
|
37
|
+
"version": "1.0"
|
|
38
|
+
},
|
|
39
|
+
"input": {
|
|
40
|
+
"allowlist": ".laranex-schema-allowlist.json",
|
|
41
|
+
"allowlists": {
|
|
42
|
+
".laranex-schema-allowlist.json": {
|
|
43
|
+
"entries": [
|
|
44
|
+
{
|
|
45
|
+
"path": "tests/fixtures/schema.json",
|
|
46
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"format": "laranex-schema-allowlist",
|
|
50
|
+
"include": [
|
|
51
|
+
{
|
|
52
|
+
"path": ".laranex-schema-allowlist.json",
|
|
53
|
+
"root": "."
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"version": "1.0"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"files": [
|
|
60
|
+
{
|
|
61
|
+
"commit": null,
|
|
62
|
+
"content": "{\n \"comparisons\": [],\n \"connections\": [\n {\n \"coverage\": {\n \"database\": {\n \"complete\": false,\n \"features\": {\n \"checkConstraints\": \"partial\",\n \"columnTypes\": \"complete\",\n \"columns\": \"complete\",\n \"comments\": \"not_applicable\",\n \"defaults\": \"complete\",\n \"foreignKeys\": \"complete\",\n \"includedColumns\": \"not_applicable\",\n \"indexExpressions\": \"complete\",\n \"indexPredicates\": \"complete\",\n \"indexes\": \"complete\",\n \"models\": \"not_applicable\",\n \"primaryKeys\": \"complete\",\n \"referentialActions\": \"complete\",\n \"relationships\": \"not_applicable\",\n \"tables\": \"complete\",\n \"uniqueConstraints\": \"complete\"\n },\n \"schemas\": null\n },\n \"declared\": null\n },\n \"defaultSchema\": null,\n \"driver\": \"sqlite\",\n \"id\": \"connection:main\",\n \"name\": \"main\",\n \"tables\": [\n {\n \"columns\": [\n {\n \"autoIncrement\": true,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"id\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": \"NOCASE\",\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"title\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"slug\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": {\n \"kind\": \"literal\",\n \"value\": \"0\"\n },\n \"enum\": null,\n \"generated\": null,\n \"name\": \"archived\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n }\n ],\n \"comment\": null,\n \"constraints\": [\n {\n \"columns\": [\n \"slug\"\n ],\n \"expression\": null,\n \"id\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique\",\n \"name\": \"notes_slug\",\n \"provenance\": [\n \"database\"\n ]\n },\n {\n \"columns\": [\n \"archived\"\n ],\n \"expression\": \"archived IN (0, 1)\",\n \"id\": \"sqlite:main.notes:constraint:notes_archived_flag\",\n \"kind\": \"check\",\n \"name\": \"notes_archived_flag\",\n \"provenance\": [\n \"database\"\n ]\n }\n ],\n \"foreignKeys\": [],\n \"id\": \"sqlite:main.notes\",\n \"indexes\": [\n {\n \"backs\": {\n \"constraint\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique_constraint\"\n },\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:sqlite_autoindex_notes_1\",\n \"included\": [],\n \"method\": null,\n \"name\": \"sqlite_autoindex_notes_1\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"slug\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": true\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_active_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_active_title\",\n \"partial\": true,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": \"archived = 0\",\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": true,\n \"id\": \"sqlite:main.notes:index:notes_lower_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_lower_title\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": null,\n \"expression\": \"lower(title)\",\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_title_nocase\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_title_nocase\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": \"NOCASE\",\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": \"desc\"\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n }\n ],\n \"name\": \"notes\",\n \"note\": null,\n \"owner\": {\n \"kind\": \"application\",\n \"package\": null\n },\n \"primaryKey\": [\n \"id\"\n ],\n \"provenance\": [\n \"database\"\n ],\n \"schema\": null\n }\n ]\n }\n ],\n \"derivedLinks\": [],\n \"diagnostics\": [\n {\n \"category\": \"inspection\",\n \"certainty\": \"certain\",\n \"id\": \"necb2896ad42f5c2c\",\n \"kind\": \"unsupported_metadata\",\n \"message\": \"Check constraints were read from the table SQL; unnamed checks get generated names.\",\n \"severity\": \"info\",\n \"subject\": {\n \"columns\": null,\n \"id\": \"connection:main\",\n \"label\": \"main\",\n \"type\": \"connection\"\n }\n }\n ],\n \"format\": \"laranex-schema\",\n \"generator\": {\n \"name\": \"contract-fixtures\",\n \"orm\": null\n },\n \"inferredAssociations\": [],\n \"links\": [],\n \"migrations\": [],\n \"models\": [],\n \"note\": null,\n \"relationships\": [],\n \"source\": \"database\",\n \"version\": \"2.0\"\n}\n",
|
|
63
|
+
"path": "tests/fixtures/schema.json",
|
|
64
|
+
"scope": "tracked"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"limit": null,
|
|
68
|
+
"scopes": [
|
|
69
|
+
"tracked"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "An included allowlist's entries apply under its root",
|
|
3
|
+
"expected": {
|
|
4
|
+
"counts": {
|
|
5
|
+
"allowed": 1,
|
|
6
|
+
"confirmed": 0,
|
|
7
|
+
"files": 1,
|
|
8
|
+
"incomplete": 0,
|
|
9
|
+
"moved": 0,
|
|
10
|
+
"stale": 0,
|
|
11
|
+
"tampered": 0,
|
|
12
|
+
"uncertain": 0
|
|
13
|
+
},
|
|
14
|
+
"errors": [],
|
|
15
|
+
"exitCode": 0,
|
|
16
|
+
"findings": [
|
|
17
|
+
{
|
|
18
|
+
"commit": null,
|
|
19
|
+
"kind": "document",
|
|
20
|
+
"path": "vendor/pkg/contract/fixtures/valid/schema.json",
|
|
21
|
+
"reason": "document",
|
|
22
|
+
"scope": "tracked",
|
|
23
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f",
|
|
24
|
+
"status": "allowed"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"format": "laranex-schema-scan",
|
|
28
|
+
"limit": 67108864,
|
|
29
|
+
"scopes": [
|
|
30
|
+
"tracked"
|
|
31
|
+
],
|
|
32
|
+
"version": "1.0"
|
|
33
|
+
},
|
|
34
|
+
"input": {
|
|
35
|
+
"allowlist": ".laranex-schema-allowlist.json",
|
|
36
|
+
"allowlists": {
|
|
37
|
+
".laranex-schema-allowlist.json": {
|
|
38
|
+
"entries": [],
|
|
39
|
+
"format": "laranex-schema-allowlist",
|
|
40
|
+
"include": [
|
|
41
|
+
{
|
|
42
|
+
"path": "vendor/pkg/contract/synthetic.json",
|
|
43
|
+
"root": "vendor/pkg"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"version": "1.0"
|
|
47
|
+
},
|
|
48
|
+
"vendor/pkg/contract/synthetic.json": {
|
|
49
|
+
"entries": [
|
|
50
|
+
{
|
|
51
|
+
"path": "contract/fixtures/valid/schema.json",
|
|
52
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"format": "laranex-schema-allowlist",
|
|
56
|
+
"version": "1.0"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"files": [
|
|
60
|
+
{
|
|
61
|
+
"commit": null,
|
|
62
|
+
"content": "{\n \"comparisons\": [],\n \"connections\": [\n {\n \"coverage\": {\n \"database\": {\n \"complete\": false,\n \"features\": {\n \"checkConstraints\": \"partial\",\n \"columnTypes\": \"complete\",\n \"columns\": \"complete\",\n \"comments\": \"not_applicable\",\n \"defaults\": \"complete\",\n \"foreignKeys\": \"complete\",\n \"includedColumns\": \"not_applicable\",\n \"indexExpressions\": \"complete\",\n \"indexPredicates\": \"complete\",\n \"indexes\": \"complete\",\n \"models\": \"not_applicable\",\n \"primaryKeys\": \"complete\",\n \"referentialActions\": \"complete\",\n \"relationships\": \"not_applicable\",\n \"tables\": \"complete\",\n \"uniqueConstraints\": \"complete\"\n },\n \"schemas\": null\n },\n \"declared\": null\n },\n \"defaultSchema\": null,\n \"driver\": \"sqlite\",\n \"id\": \"connection:main\",\n \"name\": \"main\",\n \"tables\": [\n {\n \"columns\": [\n {\n \"autoIncrement\": true,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"id\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": \"NOCASE\",\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"title\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"slug\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": {\n \"kind\": \"literal\",\n \"value\": \"0\"\n },\n \"enum\": null,\n \"generated\": null,\n \"name\": \"archived\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n }\n ],\n \"comment\": null,\n \"constraints\": [\n {\n \"columns\": [\n \"slug\"\n ],\n \"expression\": null,\n \"id\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique\",\n \"name\": \"notes_slug\",\n \"provenance\": [\n \"database\"\n ]\n },\n {\n \"columns\": [\n \"archived\"\n ],\n \"expression\": \"archived IN (0, 1)\",\n \"id\": \"sqlite:main.notes:constraint:notes_archived_flag\",\n \"kind\": \"check\",\n \"name\": \"notes_archived_flag\",\n \"provenance\": [\n \"database\"\n ]\n }\n ],\n \"foreignKeys\": [],\n \"id\": \"sqlite:main.notes\",\n \"indexes\": [\n {\n \"backs\": {\n \"constraint\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique_constraint\"\n },\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:sqlite_autoindex_notes_1\",\n \"included\": [],\n \"method\": null,\n \"name\": \"sqlite_autoindex_notes_1\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"slug\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": true\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_active_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_active_title\",\n \"partial\": true,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": \"archived = 0\",\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": true,\n \"id\": \"sqlite:main.notes:index:notes_lower_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_lower_title\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": null,\n \"expression\": \"lower(title)\",\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_title_nocase\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_title_nocase\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": \"NOCASE\",\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": \"desc\"\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n }\n ],\n \"name\": \"notes\",\n \"note\": null,\n \"owner\": {\n \"kind\": \"application\",\n \"package\": null\n },\n \"primaryKey\": [\n \"id\"\n ],\n \"provenance\": [\n \"database\"\n ],\n \"schema\": null\n }\n ]\n }\n ],\n \"derivedLinks\": [],\n \"diagnostics\": [\n {\n \"category\": \"inspection\",\n \"certainty\": \"certain\",\n \"id\": \"necb2896ad42f5c2c\",\n \"kind\": \"unsupported_metadata\",\n \"message\": \"Check constraints were read from the table SQL; unnamed checks get generated names.\",\n \"severity\": \"info\",\n \"subject\": {\n \"columns\": null,\n \"id\": \"connection:main\",\n \"label\": \"main\",\n \"type\": \"connection\"\n }\n }\n ],\n \"format\": \"laranex-schema\",\n \"generator\": {\n \"name\": \"contract-fixtures\",\n \"orm\": null\n },\n \"inferredAssociations\": [],\n \"links\": [],\n \"migrations\": [],\n \"models\": [],\n \"note\": null,\n \"relationships\": [],\n \"source\": \"database\",\n \"version\": \"2.0\"\n}\n",
|
|
63
|
+
"path": "vendor/pkg/contract/fixtures/valid/schema.json",
|
|
64
|
+
"scope": "tracked"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"limit": null,
|
|
68
|
+
"scopes": [
|
|
69
|
+
"tracked"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "An invalid allowlist fails the scan, which still reports what it found",
|
|
3
|
+
"expected": {
|
|
4
|
+
"counts": {
|
|
5
|
+
"allowed": 0,
|
|
6
|
+
"confirmed": 1,
|
|
7
|
+
"files": 1,
|
|
8
|
+
"incomplete": 0,
|
|
9
|
+
"moved": 0,
|
|
10
|
+
"stale": 0,
|
|
11
|
+
"tampered": 0,
|
|
12
|
+
"uncertain": 0
|
|
13
|
+
},
|
|
14
|
+
"errors": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "allowlist_invalid",
|
|
17
|
+
"message": "Allowlist .laranex-schema-allowlist.json: $.entries[0].path: \"/abs/schema.json\" does not match ^(?!/)(?!.*//)(?!.*/$)(?!(.*/)?\\.\\.?(/|$))[^\\\\\\u0000]+$"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"exitCode": 2,
|
|
21
|
+
"findings": [
|
|
22
|
+
{
|
|
23
|
+
"commit": null,
|
|
24
|
+
"kind": "document",
|
|
25
|
+
"path": "tests/fixtures/schema.json",
|
|
26
|
+
"reason": "document",
|
|
27
|
+
"scope": "tracked",
|
|
28
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f",
|
|
29
|
+
"status": "confirmed"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"format": "laranex-schema-scan",
|
|
33
|
+
"limit": 67108864,
|
|
34
|
+
"scopes": [
|
|
35
|
+
"tracked"
|
|
36
|
+
],
|
|
37
|
+
"version": "1.0"
|
|
38
|
+
},
|
|
39
|
+
"input": {
|
|
40
|
+
"allowlist": ".laranex-schema-allowlist.json",
|
|
41
|
+
"allowlists": {
|
|
42
|
+
".laranex-schema-allowlist.json": {
|
|
43
|
+
"entries": [
|
|
44
|
+
{
|
|
45
|
+
"path": "/abs/schema.json",
|
|
46
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"format": "laranex-schema-allowlist",
|
|
50
|
+
"version": "1.0"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
{
|
|
55
|
+
"commit": null,
|
|
56
|
+
"content": "{\n \"comparisons\": [],\n \"connections\": [\n {\n \"coverage\": {\n \"database\": {\n \"complete\": false,\n \"features\": {\n \"checkConstraints\": \"partial\",\n \"columnTypes\": \"complete\",\n \"columns\": \"complete\",\n \"comments\": \"not_applicable\",\n \"defaults\": \"complete\",\n \"foreignKeys\": \"complete\",\n \"includedColumns\": \"not_applicable\",\n \"indexExpressions\": \"complete\",\n \"indexPredicates\": \"complete\",\n \"indexes\": \"complete\",\n \"models\": \"not_applicable\",\n \"primaryKeys\": \"complete\",\n \"referentialActions\": \"complete\",\n \"relationships\": \"not_applicable\",\n \"tables\": \"complete\",\n \"uniqueConstraints\": \"complete\"\n },\n \"schemas\": null\n },\n \"declared\": null\n },\n \"defaultSchema\": null,\n \"driver\": \"sqlite\",\n \"id\": \"connection:main\",\n \"name\": \"main\",\n \"tables\": [\n {\n \"columns\": [\n {\n \"autoIncrement\": true,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"id\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": \"NOCASE\",\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"title\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"slug\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": {\n \"kind\": \"literal\",\n \"value\": \"0\"\n },\n \"enum\": null,\n \"generated\": null,\n \"name\": \"archived\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n }\n ],\n \"comment\": null,\n \"constraints\": [\n {\n \"columns\": [\n \"slug\"\n ],\n \"expression\": null,\n \"id\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique\",\n \"name\": \"notes_slug\",\n \"provenance\": [\n \"database\"\n ]\n },\n {\n \"columns\": [\n \"archived\"\n ],\n \"expression\": \"archived IN (0, 1)\",\n \"id\": \"sqlite:main.notes:constraint:notes_archived_flag\",\n \"kind\": \"check\",\n \"name\": \"notes_archived_flag\",\n \"provenance\": [\n \"database\"\n ]\n }\n ],\n \"foreignKeys\": [],\n \"id\": \"sqlite:main.notes\",\n \"indexes\": [\n {\n \"backs\": {\n \"constraint\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique_constraint\"\n },\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:sqlite_autoindex_notes_1\",\n \"included\": [],\n \"method\": null,\n \"name\": \"sqlite_autoindex_notes_1\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"slug\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": true\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_active_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_active_title\",\n \"partial\": true,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": \"archived = 0\",\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": true,\n \"id\": \"sqlite:main.notes:index:notes_lower_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_lower_title\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": null,\n \"expression\": \"lower(title)\",\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_title_nocase\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_title_nocase\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": \"NOCASE\",\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": \"desc\"\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n }\n ],\n \"name\": \"notes\",\n \"note\": null,\n \"owner\": {\n \"kind\": \"application\",\n \"package\": null\n },\n \"primaryKey\": [\n \"id\"\n ],\n \"provenance\": [\n \"database\"\n ],\n \"schema\": null\n }\n ]\n }\n ],\n \"derivedLinks\": [],\n \"diagnostics\": [\n {\n \"category\": \"inspection\",\n \"certainty\": \"certain\",\n \"id\": \"necb2896ad42f5c2c\",\n \"kind\": \"unsupported_metadata\",\n \"message\": \"Check constraints were read from the table SQL; unnamed checks get generated names.\",\n \"severity\": \"info\",\n \"subject\": {\n \"columns\": null,\n \"id\": \"connection:main\",\n \"label\": \"main\",\n \"type\": \"connection\"\n }\n }\n ],\n \"format\": \"laranex-schema\",\n \"generator\": {\n \"name\": \"contract-fixtures\",\n \"orm\": null\n },\n \"inferredAssociations\": [],\n \"links\": [],\n \"migrations\": [],\n \"models\": [],\n \"note\": null,\n \"relationships\": [],\n \"source\": \"database\",\n \"version\": \"2.0\"\n}\n",
|
|
57
|
+
"path": "tests/fixtures/schema.json",
|
|
58
|
+
"scope": "tracked"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"limit": null,
|
|
62
|
+
"scopes": [
|
|
63
|
+
"tracked"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "An include that cannot be read fails the scan",
|
|
3
|
+
"expected": {
|
|
4
|
+
"counts": {
|
|
5
|
+
"allowed": 0,
|
|
6
|
+
"confirmed": 1,
|
|
7
|
+
"files": 1,
|
|
8
|
+
"incomplete": 0,
|
|
9
|
+
"moved": 0,
|
|
10
|
+
"stale": 0,
|
|
11
|
+
"tampered": 0,
|
|
12
|
+
"uncertain": 0
|
|
13
|
+
},
|
|
14
|
+
"errors": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "allowlist_invalid",
|
|
17
|
+
"message": "Allowlist missing.json could not be read as JSON"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"exitCode": 2,
|
|
21
|
+
"findings": [
|
|
22
|
+
{
|
|
23
|
+
"commit": null,
|
|
24
|
+
"kind": "document",
|
|
25
|
+
"path": "tests/fixtures/schema.json",
|
|
26
|
+
"reason": "document",
|
|
27
|
+
"scope": "tracked",
|
|
28
|
+
"sha256": "f61a153f159990f0f067b0ba2fd86447c6b31e9d4866af2997686a56cfa9904f",
|
|
29
|
+
"status": "confirmed"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"format": "laranex-schema-scan",
|
|
33
|
+
"limit": 67108864,
|
|
34
|
+
"scopes": [
|
|
35
|
+
"tracked"
|
|
36
|
+
],
|
|
37
|
+
"version": "1.0"
|
|
38
|
+
},
|
|
39
|
+
"input": {
|
|
40
|
+
"allowlist": ".laranex-schema-allowlist.json",
|
|
41
|
+
"allowlists": {
|
|
42
|
+
".laranex-schema-allowlist.json": {
|
|
43
|
+
"entries": [],
|
|
44
|
+
"format": "laranex-schema-allowlist",
|
|
45
|
+
"include": [
|
|
46
|
+
{
|
|
47
|
+
"path": "missing.json",
|
|
48
|
+
"root": "."
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"version": "1.0"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
{
|
|
56
|
+
"commit": null,
|
|
57
|
+
"content": "{\n \"comparisons\": [],\n \"connections\": [\n {\n \"coverage\": {\n \"database\": {\n \"complete\": false,\n \"features\": {\n \"checkConstraints\": \"partial\",\n \"columnTypes\": \"complete\",\n \"columns\": \"complete\",\n \"comments\": \"not_applicable\",\n \"defaults\": \"complete\",\n \"foreignKeys\": \"complete\",\n \"includedColumns\": \"not_applicable\",\n \"indexExpressions\": \"complete\",\n \"indexPredicates\": \"complete\",\n \"indexes\": \"complete\",\n \"models\": \"not_applicable\",\n \"primaryKeys\": \"complete\",\n \"referentialActions\": \"complete\",\n \"relationships\": \"not_applicable\",\n \"tables\": \"complete\",\n \"uniqueConstraints\": \"complete\"\n },\n \"schemas\": null\n },\n \"declared\": null\n },\n \"defaultSchema\": null,\n \"driver\": \"sqlite\",\n \"id\": \"connection:main\",\n \"name\": \"main\",\n \"tables\": [\n {\n \"columns\": [\n {\n \"autoIncrement\": true,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"id\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": \"NOCASE\",\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"title\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": null,\n \"enum\": null,\n \"generated\": null,\n \"name\": \"slug\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"TEXT\",\n \"typeName\": \"text\"\n },\n {\n \"autoIncrement\": false,\n \"collation\": null,\n \"comment\": null,\n \"default\": {\n \"kind\": \"literal\",\n \"value\": \"0\"\n },\n \"enum\": null,\n \"generated\": null,\n \"name\": \"archived\",\n \"note\": null,\n \"nullable\": false,\n \"ormDefault\": null,\n \"provenance\": [\n \"database\"\n ],\n \"timezone\": null,\n \"type\": \"INTEGER\",\n \"typeName\": \"integer\"\n }\n ],\n \"comment\": null,\n \"constraints\": [\n {\n \"columns\": [\n \"slug\"\n ],\n \"expression\": null,\n \"id\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique\",\n \"name\": \"notes_slug\",\n \"provenance\": [\n \"database\"\n ]\n },\n {\n \"columns\": [\n \"archived\"\n ],\n \"expression\": \"archived IN (0, 1)\",\n \"id\": \"sqlite:main.notes:constraint:notes_archived_flag\",\n \"kind\": \"check\",\n \"name\": \"notes_archived_flag\",\n \"provenance\": [\n \"database\"\n ]\n }\n ],\n \"foreignKeys\": [],\n \"id\": \"sqlite:main.notes\",\n \"indexes\": [\n {\n \"backs\": {\n \"constraint\": \"sqlite:main.notes:constraint:notes_slug\",\n \"kind\": \"unique_constraint\"\n },\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:sqlite_autoindex_notes_1\",\n \"included\": [],\n \"method\": null,\n \"name\": \"sqlite_autoindex_notes_1\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"slug\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": true\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_active_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_active_title\",\n \"partial\": true,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": \"archived = 0\",\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": true,\n \"id\": \"sqlite:main.notes:index:notes_lower_title\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_lower_title\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": null,\n \"column\": null,\n \"expression\": \"lower(title)\",\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": null\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n },\n {\n \"backs\": null,\n \"expression\": false,\n \"id\": \"sqlite:main.notes:index:notes_title_nocase\",\n \"included\": [],\n \"method\": null,\n \"name\": \"notes_title_nocase\",\n \"partial\": false,\n \"parts\": [\n {\n \"collation\": \"NOCASE\",\n \"column\": \"title\",\n \"expression\": null,\n \"length\": null,\n \"nulls\": null,\n \"opclass\": null,\n \"order\": \"desc\"\n }\n ],\n \"predicate\": null,\n \"provenance\": [\n \"database\"\n ],\n \"unique\": false\n }\n ],\n \"name\": \"notes\",\n \"note\": null,\n \"owner\": {\n \"kind\": \"application\",\n \"package\": null\n },\n \"primaryKey\": [\n \"id\"\n ],\n \"provenance\": [\n \"database\"\n ],\n \"schema\": null\n }\n ]\n }\n ],\n \"derivedLinks\": [],\n \"diagnostics\": [\n {\n \"category\": \"inspection\",\n \"certainty\": \"certain\",\n \"id\": \"necb2896ad42f5c2c\",\n \"kind\": \"unsupported_metadata\",\n \"message\": \"Check constraints were read from the table SQL; unnamed checks get generated names.\",\n \"severity\": \"info\",\n \"subject\": {\n \"columns\": null,\n \"id\": \"connection:main\",\n \"label\": \"main\",\n \"type\": \"connection\"\n }\n }\n ],\n \"format\": \"laranex-schema\",\n \"generator\": {\n \"name\": \"contract-fixtures\",\n \"orm\": null\n },\n \"inferredAssociations\": [],\n \"links\": [],\n \"migrations\": [],\n \"models\": [],\n \"note\": null,\n \"relationships\": [],\n \"source\": \"database\",\n \"version\": \"2.0\"\n}\n",
|
|
58
|
+
"path": "tests/fixtures/schema.json",
|
|
59
|
+
"scope": "tracked"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"limit": null,
|
|
63
|
+
"scopes": [
|
|
64
|
+
"tracked"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|