deepdebug-local-agent 1.3.0 → 1.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/.github/workflows/deploy-gcp.yml +58 -26
- package/CHANGELOG.md +6 -0
- package/docs/la-protocol-v2.md +68 -0
- package/package.json +2 -1
- package/scripts/sync-la-protocol-v2-contract.mjs +58 -0
- package/src/la-protocol-v2/chunks.js +45 -0
- package/src/la-protocol-v2/config.js +27 -0
- package/src/la-protocol-v2/content.js +57 -0
- package/src/la-protocol-v2/contract/CONTRACT_SOURCE.json +81 -0
- package/src/la-protocol-v2/contract/README.md +103 -0
- package/src/la-protocol-v2/contract/ack.schema.json +51 -0
- package/src/la-protocol-v2/contract/alert.schema.json +62 -0
- package/src/la-protocol-v2/contract/approval.decision.schema.json +57 -0
- package/src/la-protocol-v2/contract/audit.event.schema.json +86 -0
- package/src/la-protocol-v2/contract/config.update.schema.json +73 -0
- package/src/la-protocol-v2/contract/content.request.schema.json +110 -0
- package/src/la-protocol-v2/contract/content.response.schema.json +90 -0
- package/src/la-protocol-v2/contract/defs.schema.json +191 -0
- package/src/la-protocol-v2/contract/envelope.schema.json +89 -0
- package/src/la-protocol-v2/contract/error.schema.json +59 -0
- package/src/la-protocol-v2/contract/heartbeat.schema.json +100 -0
- package/src/la-protocol-v2/contract/hello.schema.json +111 -0
- package/src/la-protocol-v2/contract/incident.candidate.schema.json +102 -0
- package/src/la-protocol-v2/contract/index.json +166 -0
- package/src/la-protocol-v2/contract/job.assign.schema.json +212 -0
- package/src/la-protocol-v2/contract/job.cancel.schema.json +52 -0
- package/src/la-protocol-v2/contract/job.event.schema.json +115 -0
- package/src/la-protocol-v2/contract/job.result.schema.json +100 -0
- package/src/la-protocol-v2/contract/log.stats.schema.json +79 -0
- package/src/la-protocol-v2/contract/ready.schema.json +106 -0
- package/src/la-protocol-v2/contract/register.schema.json +92 -0
- package/src/la-protocol-v2/contract/scan.upload.schema.json +59 -0
- package/src/la-protocol-v2/contract/scan.uploaded.schema.json +51 -0
- package/src/la-protocol-v2/contract/webhook.forward.schema.json +69 -0
- package/src/la-protocol-v2/contract.js +90 -0
- package/src/la-protocol-v2/errors.js +34 -0
- package/src/la-protocol-v2/index.js +8 -0
- package/src/la-protocol-v2/link.js +93 -0
- package/src/la-protocol-v2/runtime.js +72 -0
- package/src/la-protocol-v2/session.js +650 -0
- package/src/la-protocol-v2/strict-json.js +47 -0
- package/src/server.js +22 -4
- package/test/contract/la-protocol-v2/vectors/ack.vectors.json +149 -0
- package/test/contract/la-protocol-v2/vectors/alert.vectors.json +101 -0
- package/test/contract/la-protocol-v2/vectors/approval.decision.vectors.json +165 -0
- package/test/contract/la-protocol-v2/vectors/audit.event.vectors.json +156 -0
- package/test/contract/la-protocol-v2/vectors/config.update.vectors.json +189 -0
- package/test/contract/la-protocol-v2/vectors/content.request.vectors.json +325 -0
- package/test/contract/la-protocol-v2/vectors/content.response.vectors.json +413 -0
- package/test/contract/la-protocol-v2/vectors/cross-type.vectors.json +260 -0
- package/test/contract/la-protocol-v2/vectors/error.vectors.json +179 -0
- package/test/contract/la-protocol-v2/vectors/heartbeat.vectors.json +109 -0
- package/test/contract/la-protocol-v2/vectors/hello.vectors.json +224 -0
- package/test/contract/la-protocol-v2/vectors/incident.candidate.vectors.json +186 -0
- package/test/contract/la-protocol-v2/vectors/job.assign.vectors.json +631 -0
- package/test/contract/la-protocol-v2/vectors/job.cancel.vectors.json +133 -0
- package/test/contract/la-protocol-v2/vectors/job.event.vectors.json +233 -0
- package/test/contract/la-protocol-v2/vectors/job.result.vectors.json +137 -0
- package/test/contract/la-protocol-v2/vectors/log.stats.vectors.json +137 -0
- package/test/contract/la-protocol-v2/vectors/ready.vectors.json +177 -0
- package/test/contract/la-protocol-v2/vectors/register.vectors.json +399 -0
- package/test/contract/la-protocol-v2/vectors/scan.upload.vectors.json +137 -0
- package/test/contract/la-protocol-v2/vectors/scan.uploaded.vectors.json +101 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-agent-mismatch.json +140 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-after-last.json +200 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-byte-length-mismatch.json +174 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-last-flag.json +200 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-out-of-order.json +200 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-total-changes.json +200 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-clock-skew.json +46 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-event-before-ready.json +72 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-first-frame-not-register.json +48 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-frame-over-48kib.json +141 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-la-sends-job-assign.json +173 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-params-raw-differs-from-payload.json +172 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-payload-above-limit.json +174 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-resume-restarts-seq.json +144 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-seq-gap.json +166 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-seq-repeated.json +166 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-sig-tenant-mismatch.json +172 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-signature-warn-with-enforce-required.json +77 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-tenant-mismatch.json +140 -0
- package/test/contract/la-protocol-v2/vectors/traces/invalid-type-outside-allowlist.json +140 -0
- package/test/contract/la-protocol-v2/vectors/traces/valid-content-chunks-in-order.json +224 -0
- package/test/contract/la-protocol-v2/vectors/traces/valid-handshake-and-job.json +266 -0
- package/test/contract/la-protocol-v2/vectors/traces/valid-resume-continues-seq.json +168 -0
- package/test/contract/la-protocol-v2/vectors/traces/valid-retransmit-is-idempotent.json +193 -0
- package/test/contract/la-protocol-v2/vectors/webhook.forward.vectors.json +170 -0
- package/test/la-protocol-v2/contract.test.js +131 -0
- package/test/la-protocol-v2/helpers/la-rig.js +83 -0
- package/test/la-protocol-v2/helpers/reference-cp.js +349 -0
- package/test/la-protocol-v2/helpers/spawn-agent.js +35 -0
- package/test/la-protocol-v2/link.test.js +141 -0
- package/test/la-protocol-v2/session-inbound.test.js +279 -0
- package/test/la-protocol-v2/session-outbound.test.js +382 -0
- package/test/la-protocol-v2/traces.test.js +270 -0
- package/test/la-protocol-v2/tunnel-e2e.test.js +124 -0
- package/tools/graphify-validation/extras/README.md +19 -0
- package/tools/graphify-validation/extras/bymethod.py +35 -0
- package/tools/graphify-validation/extras/docker/Dockerfile +16 -0
- package/tools/graphify-validation/extras/docker/inner.sh +7 -0
- package/tools/graphify-validation/extras/g10.py +59 -0
- package/tools/graphify-validation/extras/g3aug.py +49 -0
- package/tools/graphify-validation/extras/hybrid.py +34 -0
- package/tools/graphify-validation/extras/truth2.py +44 -0
- package/tools/interop/LaV2NodeInteropTest.java +266 -0
- package/tools/interop/README.md +21 -0
- package/tools/interop/la-interop-client.mjs +97 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.visionhammer.io/la-protocol-v2/ack.schema.json",
|
|
4
|
+
"title": "LA protocol v2: ack (both)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "envelope.schema.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "ack"
|
|
14
|
+
},
|
|
15
|
+
"payload": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"ackSeq": {
|
|
20
|
+
"$ref": "defs.schema.json#/$defs/seq"
|
|
21
|
+
},
|
|
22
|
+
"status": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": [
|
|
25
|
+
"accepted",
|
|
26
|
+
"duplicate",
|
|
27
|
+
"rejected"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"errorCode": {
|
|
31
|
+
"$ref": "defs.schema.json#/$defs/errorCode"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": [
|
|
35
|
+
"ackSeq",
|
|
36
|
+
"status"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"seq": {
|
|
40
|
+
"const": 0
|
|
41
|
+
},
|
|
42
|
+
"chunk": false,
|
|
43
|
+
"sig": false,
|
|
44
|
+
"paramsRaw": false,
|
|
45
|
+
"agentId": true
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"payload",
|
|
49
|
+
"agentId"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.visionhammer.io/la-protocol-v2/alert.schema.json",
|
|
4
|
+
"title": "LA protocol v2: alert (la->cp)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "envelope.schema.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "alert"
|
|
14
|
+
},
|
|
15
|
+
"payload": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"code": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"la_degraded",
|
|
23
|
+
"index_stale",
|
|
24
|
+
"disk_low",
|
|
25
|
+
"signature_warn",
|
|
26
|
+
"queue_full",
|
|
27
|
+
"clock_skew"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"severity": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"enum": [
|
|
33
|
+
"warning",
|
|
34
|
+
"critical"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"value": {
|
|
38
|
+
"type": "integer",
|
|
39
|
+
"minimum": 0,
|
|
40
|
+
"maximum": 9007199254740991
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": [
|
|
44
|
+
"code",
|
|
45
|
+
"severity"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"seq": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": 1,
|
|
51
|
+
"maximum": 9007199254740991
|
|
52
|
+
},
|
|
53
|
+
"chunk": false,
|
|
54
|
+
"sig": false,
|
|
55
|
+
"paramsRaw": false,
|
|
56
|
+
"agentId": true
|
|
57
|
+
},
|
|
58
|
+
"required": [
|
|
59
|
+
"payload",
|
|
60
|
+
"agentId"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.visionhammer.io/la-protocol-v2/approval.decision.schema.json",
|
|
4
|
+
"title": "LA protocol v2: approval.decision (cp->la)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "envelope.schema.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "approval.decision"
|
|
14
|
+
},
|
|
15
|
+
"payload": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"approvalId": {
|
|
20
|
+
"$ref": "defs.schema.json#/$defs/uuid"
|
|
21
|
+
},
|
|
22
|
+
"decision": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": [
|
|
25
|
+
"approved",
|
|
26
|
+
"denied"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"token": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"minLength": 1,
|
|
32
|
+
"maxLength": 4096,
|
|
33
|
+
"pattern": "^vhapr1\\.[A-Za-z0-9_-]{1,64}\\.[A-Za-z0-9_-]{1,2048}\\.[A-Za-z0-9_-]{1,512}$",
|
|
34
|
+
"x-large-metadata": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"required": [
|
|
38
|
+
"approvalId",
|
|
39
|
+
"decision",
|
|
40
|
+
"token"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"seq": {
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"minimum": 1,
|
|
46
|
+
"maximum": 9007199254740991
|
|
47
|
+
},
|
|
48
|
+
"chunk": false,
|
|
49
|
+
"sig": true,
|
|
50
|
+
"paramsRaw": true
|
|
51
|
+
},
|
|
52
|
+
"required": [
|
|
53
|
+
"payload",
|
|
54
|
+
"sig",
|
|
55
|
+
"paramsRaw"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.visionhammer.io/la-protocol-v2/audit.event.schema.json",
|
|
4
|
+
"title": "LA protocol v2: audit.event (la->cp)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "envelope.schema.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "audit.event"
|
|
14
|
+
},
|
|
15
|
+
"payload": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"action": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"policy_decision",
|
|
23
|
+
"approval_requested",
|
|
24
|
+
"redaction",
|
|
25
|
+
"content_served",
|
|
26
|
+
"config_applied"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"decision": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"enum": [
|
|
32
|
+
"allow",
|
|
33
|
+
"deny",
|
|
34
|
+
"require_human",
|
|
35
|
+
"n/a"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"actionType": {
|
|
39
|
+
"$ref": "defs.schema.json#/$defs/shortId"
|
|
40
|
+
},
|
|
41
|
+
"toolName": {
|
|
42
|
+
"$ref": "defs.schema.json#/$defs/shortId"
|
|
43
|
+
},
|
|
44
|
+
"requestHash": {
|
|
45
|
+
"$ref": "defs.schema.json#/$defs/sha256"
|
|
46
|
+
},
|
|
47
|
+
"redactionSummary": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"properties": {
|
|
51
|
+
"rules": {
|
|
52
|
+
"type": "integer",
|
|
53
|
+
"minimum": 0,
|
|
54
|
+
"maximum": 100000
|
|
55
|
+
},
|
|
56
|
+
"matches": {
|
|
57
|
+
"type": "integer",
|
|
58
|
+
"minimum": 0,
|
|
59
|
+
"maximum": 100000000
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": [
|
|
63
|
+
"rules",
|
|
64
|
+
"matches"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"required": [
|
|
69
|
+
"action"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"seq": {
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"minimum": 1,
|
|
75
|
+
"maximum": 9007199254740991
|
|
76
|
+
},
|
|
77
|
+
"chunk": false,
|
|
78
|
+
"sig": false,
|
|
79
|
+
"paramsRaw": false,
|
|
80
|
+
"agentId": true
|
|
81
|
+
},
|
|
82
|
+
"required": [
|
|
83
|
+
"payload",
|
|
84
|
+
"agentId"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.visionhammer.io/la-protocol-v2/config.update.schema.json",
|
|
4
|
+
"title": "LA protocol v2: config.update (cp->la)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "envelope.schema.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "config.update"
|
|
14
|
+
},
|
|
15
|
+
"payload": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"flags": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"maxItems": 64,
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"properties": {
|
|
26
|
+
"name": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1,
|
|
29
|
+
"maxLength": 64,
|
|
30
|
+
"pattern": "^[a-z0-9]+([._-][a-z0-9]+)*$"
|
|
31
|
+
},
|
|
32
|
+
"enabled": {
|
|
33
|
+
"type": "boolean"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"name",
|
|
38
|
+
"enabled"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"dlpRulesetSha256": {
|
|
43
|
+
"$ref": "defs.schema.json#/$defs/sha256"
|
|
44
|
+
},
|
|
45
|
+
"minLaVersion": {
|
|
46
|
+
"$ref": "defs.schema.json#/$defs/semver"
|
|
47
|
+
},
|
|
48
|
+
"retentionDays": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": 1,
|
|
51
|
+
"maximum": 3650
|
|
52
|
+
},
|
|
53
|
+
"dataPlaneMode": {
|
|
54
|
+
"$ref": "defs.schema.json#/$defs/dataPlaneMode"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"minProperties": 1
|
|
58
|
+
},
|
|
59
|
+
"seq": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 1,
|
|
62
|
+
"maximum": 9007199254740991
|
|
63
|
+
},
|
|
64
|
+
"chunk": false,
|
|
65
|
+
"sig": true,
|
|
66
|
+
"paramsRaw": true
|
|
67
|
+
},
|
|
68
|
+
"required": [
|
|
69
|
+
"payload",
|
|
70
|
+
"sig",
|
|
71
|
+
"paramsRaw"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.visionhammer.io/la-protocol-v2/content.request.schema.json",
|
|
4
|
+
"title": "LA protocol v2: content.request (cp->la)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "envelope.schema.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "content.request"
|
|
14
|
+
},
|
|
15
|
+
"payload": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"kind": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"incident.detail",
|
|
23
|
+
"incident.stack",
|
|
24
|
+
"file",
|
|
25
|
+
"diff",
|
|
26
|
+
"log.window",
|
|
27
|
+
"log.groups",
|
|
28
|
+
"chat.session",
|
|
29
|
+
"wiki.page",
|
|
30
|
+
"job.stream",
|
|
31
|
+
"job.timeline",
|
|
32
|
+
"approval.detail",
|
|
33
|
+
"report"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"ref": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"minLength": 1,
|
|
39
|
+
"maxLength": 512,
|
|
40
|
+
"pattern": "^[^\\u0000-\\u001f]{1,512}$"
|
|
41
|
+
},
|
|
42
|
+
"range": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"properties": {
|
|
46
|
+
"offset": {
|
|
47
|
+
"type": "integer",
|
|
48
|
+
"minimum": 0,
|
|
49
|
+
"maximum": 2097152
|
|
50
|
+
},
|
|
51
|
+
"length": {
|
|
52
|
+
"type": "integer",
|
|
53
|
+
"minimum": 1,
|
|
54
|
+
"maximum": 2097152
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"offset",
|
|
59
|
+
"length"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"limit": {
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"minimum": 1,
|
|
65
|
+
"maximum": 1000
|
|
66
|
+
},
|
|
67
|
+
"actor": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"properties": {
|
|
71
|
+
"userId": {
|
|
72
|
+
"$ref": "defs.schema.json#/$defs/shortId"
|
|
73
|
+
},
|
|
74
|
+
"role": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"enum": [
|
|
77
|
+
"viewer",
|
|
78
|
+
"member",
|
|
79
|
+
"admin",
|
|
80
|
+
"root"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"userId",
|
|
86
|
+
"role"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": [
|
|
91
|
+
"kind",
|
|
92
|
+
"ref",
|
|
93
|
+
"actor"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"seq": {
|
|
97
|
+
"type": "integer",
|
|
98
|
+
"minimum": 1,
|
|
99
|
+
"maximum": 9007199254740991
|
|
100
|
+
},
|
|
101
|
+
"chunk": false,
|
|
102
|
+
"sig": true,
|
|
103
|
+
"paramsRaw": true
|
|
104
|
+
},
|
|
105
|
+
"required": [
|
|
106
|
+
"payload",
|
|
107
|
+
"sig",
|
|
108
|
+
"paramsRaw"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.visionhammer.io/la-protocol-v2/content.response.schema.json",
|
|
4
|
+
"title": "LA protocol v2: content.response (la->cp)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "envelope.schema.json"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"type": {
|
|
13
|
+
"const": "content.response"
|
|
14
|
+
},
|
|
15
|
+
"payload": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"status": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"ok",
|
|
23
|
+
"error",
|
|
24
|
+
"not_found",
|
|
25
|
+
"forbidden"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"errorCode": {
|
|
29
|
+
"$ref": "defs.schema.json#/$defs/errorCode"
|
|
30
|
+
},
|
|
31
|
+
"contentType": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"enum": [
|
|
34
|
+
"text/plain",
|
|
35
|
+
"text/markdown",
|
|
36
|
+
"text/x-diff",
|
|
37
|
+
"application/json",
|
|
38
|
+
"application/zip",
|
|
39
|
+
"application/octet-stream"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"encoding": {
|
|
43
|
+
"const": "base64"
|
|
44
|
+
},
|
|
45
|
+
"data": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"minLength": 0,
|
|
48
|
+
"maxLength": 43692,
|
|
49
|
+
"pattern": "^[A-Za-z0-9+/]*={0,2}$",
|
|
50
|
+
"x-content-class": "relay"
|
|
51
|
+
},
|
|
52
|
+
"byteLength": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"minimum": 0,
|
|
55
|
+
"maximum": 32768
|
|
56
|
+
},
|
|
57
|
+
"totalBytes": {
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"minimum": 0,
|
|
60
|
+
"maximum": 2097152
|
|
61
|
+
},
|
|
62
|
+
"sha256": {
|
|
63
|
+
"$ref": "defs.schema.json#/$defs/sha256"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"required": [
|
|
67
|
+
"status",
|
|
68
|
+
"encoding",
|
|
69
|
+
"data",
|
|
70
|
+
"byteLength"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"seq": {
|
|
74
|
+
"type": "integer",
|
|
75
|
+
"minimum": 1,
|
|
76
|
+
"maximum": 9007199254740991
|
|
77
|
+
},
|
|
78
|
+
"sig": false,
|
|
79
|
+
"paramsRaw": false,
|
|
80
|
+
"chunk": true,
|
|
81
|
+
"requestId": true,
|
|
82
|
+
"agentId": true
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"payload",
|
|
86
|
+
"chunk",
|
|
87
|
+
"requestId",
|
|
88
|
+
"agentId"
|
|
89
|
+
]
|
|
90
|
+
}
|