@openvtc/trust-tasks 0.27.8 → 0.28.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/CHANGELOG.md +164 -0
- package/README.md +9 -0
- package/dist/_runtime/codes.d.ts +22 -3
- package/dist/_runtime/codes.d.ts.map +1 -1
- package/dist/_runtime/codes.js +26 -19
- package/dist/_runtime/codes.js.map +1 -1
- package/dist/_runtime/document.d.ts +1 -1
- package/dist/_runtime/document.js +1 -1
- package/dist/_runtime/extends.d.ts +16 -7
- package/dist/_runtime/extends.d.ts.map +1 -1
- package/dist/_runtime/extends.js +44 -35
- package/dist/_runtime/extends.js.map +1 -1
- package/dist/_runtime/index.d.ts +1 -0
- package/dist/_runtime/index.d.ts.map +1 -1
- package/dist/_runtime/index.js +1 -0
- package/dist/_runtime/index.js.map +1 -1
- package/dist/_runtime/type-uri.d.ts +96 -0
- package/dist/_runtime/type-uri.d.ts.map +1 -0
- package/dist/_runtime/type-uri.js +194 -0
- package/dist/_runtime/type-uri.js.map +1 -0
- package/dist/_shared/components.d.ts +39 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +3778 -1257
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3778 -1257
- package/dist/index.js.map +1 -1
- package/dist/policy/_shared/0.4/policy.d.ts +16 -0
- package/dist/policy/_shared/0.4/policy.d.ts.map +1 -0
- package/dist/policy/_shared/0.4/policy.js +6 -0
- package/dist/policy/_shared/0.4/policy.js.map +1 -0
- package/dist/policy/evaluate/0.1/payload.d.ts +4 -4
- package/dist/policy/evaluate/0.1/payload.js +1 -1
- package/dist/policy/evaluate/0.2/payload.d.ts +4 -4
- package/dist/policy/evaluate/0.2/payload.js +1 -1
- package/dist/policy/evaluate/0.3/payload.d.ts +13 -2
- package/dist/policy/evaluate/0.3/payload.d.ts.map +1 -1
- package/dist/policy/evaluate/0.3/payload.js +1 -1
- package/dist/policy/evaluate/0.3/payload.js.map +1 -1
- package/dist/policy/evaluate/0.4/payload.d.ts +1416 -0
- package/dist/policy/evaluate/0.4/payload.d.ts.map +1 -0
- package/dist/policy/evaluate/0.4/payload.js +899 -0
- package/dist/policy/evaluate/0.4/payload.js.map +1 -0
- package/dist/trust-task-error/0.1/payload.d.ts +2 -2
- package/dist/trust-task-error/0.1/payload.js +1 -1
- package/dist/trust-task-error/0.2/payload.d.ts +2 -2
- package/dist/trust-task-error/0.2/payload.js +1 -1
- package/dist/trust-task-error/0.3/payload.d.ts +2 -2
- package/dist/trust-task-error/0.3/payload.js +1 -1
- package/dist/trust-task-error/0.4/payload.d.ts +2 -2
- package/dist/trust-task-error/0.4/payload.js +1 -1
- package/dist/trust-task-error/0.5/payload.d.ts +7 -1
- package/dist/trust-task-error/0.5/payload.d.ts.map +1 -1
- package/dist/trust-task-error/0.5/payload.js +1 -1
- package/dist/trust-task-error/0.5/payload.js.map +1 -1
- package/dist/trust-task-error/0.6/payload.d.ts +199 -0
- package/dist/trust-task-error/0.6/payload.d.ts.map +1 -0
- package/dist/trust-task-error/0.6/payload.js +126 -0
- package/dist/trust-task-error/0.6/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_runtime/codes.ts +27 -21
- package/src/_runtime/document.ts +1 -1
- package/src/_runtime/extends.ts +50 -40
- package/src/_runtime/index.ts +14 -0
- package/src/_runtime/type-uri.ts +252 -0
- package/src/_shared/components.ts +39 -0
- package/src/index.ts +3778 -1257
- package/src/policy/_shared/0.4/policy.ts +17 -0
- package/src/policy/evaluate/0.1/payload.ts +5 -5
- package/src/policy/evaluate/0.2/payload.ts +5 -5
- package/src/policy/evaluate/0.3/payload.ts +14 -3
- package/src/policy/evaluate/0.4/payload.ts +944 -0
- package/src/trust-task-error/0.1/payload.ts +3 -3
- package/src/trust-task-error/0.2/payload.ts +3 -3
- package/src/trust-task-error/0.3/payload.ts +3 -3
- package/src/trust-task-error/0.4/payload.ts +3 -3
- package/src/trust-task-error/0.5/payload.ts +8 -2
- package/src/trust-task-error/0.6/payload.ts +195 -0
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/policy/evaluate/0.4/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AndroidApp_VaultV0_2 as AndroidApp, Companion_DeviceV0_2 as Companion, ConsumerKind_DeviceV0_2 as ConsumerKind, Did_VaultV0_2 as Did, DigestMultibase, Ext, IosApp_VaultV0_2 as IosApp, PolicyDecision_PolicyV0_4 as PolicyDecision, PolicyInput_PolicyV0_3 as PolicyInput, Service_DeviceV0_2 as Service, SiteTarget_VaultV0_2 as SiteTarget, WebOrigin_VaultV0_2 as WebOrigin } from "../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Dry-run a policy decision against a synthetic PolicyInput. Returns the policy decision plus a trace of which policy modules matched and which rules fired. Used by the policy-editor UI to verify changes before save and by admins to diagnose unexpected outcomes. 0.3 evaluates against the generalised PolicyInput (any Trust Task, carrying typeUri + side-effect/exposure classes) and can return the `requireConsent` decision.
|
|
11
|
+
*/
|
|
12
|
+
export interface PolicyEvaluatePayload {
|
|
13
|
+
input: PolicyInput;
|
|
14
|
+
/**
|
|
15
|
+
* Optional — when supplied, evaluate as if this Rego source were active (e.g. preview a pending upsert). The candidate is layered into the evaluator at the priority specified by `candidatePriority` (default 1000) for this call only.
|
|
16
|
+
*/
|
|
17
|
+
candidateModule?: string;
|
|
18
|
+
candidatePriority?: number;
|
|
19
|
+
includeTrace?: boolean;
|
|
20
|
+
ext?: Ext;
|
|
21
|
+
}
|
|
22
|
+
export interface PolicyEvaluateResponsePayload {
|
|
23
|
+
decision: PolicyDecision;
|
|
24
|
+
/**
|
|
25
|
+
* Ids (or `candidate` for the dry-run module) of the policies that returned a non-null decision, in evaluation order. The first is the winning policy.
|
|
26
|
+
*/
|
|
27
|
+
matchedPolicies?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* Rego evaluator trace lines when `includeTrace: true`. Maintainer-defined format; primarily for human debugging.
|
|
30
|
+
*/
|
|
31
|
+
trace?: string[];
|
|
32
|
+
ext?: Ext;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
36
|
+
export type { AndroidApp, Companion, ConsumerKind, Did, DigestMultibase, Ext, IosApp, PolicyDecision, PolicyInput, Service, SiteTarget, WebOrigin };
|
|
37
|
+
|
|
38
|
+
/** Trust Task type URI. */
|
|
39
|
+
export const TYPE_URI = "https://trusttasks.org/spec/policy/evaluate/0.4" as const;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The earlier version of this specification that this one declares it
|
|
43
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
44
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
45
|
+
* `extendsChain` / `readForSpec`.
|
|
46
|
+
*/
|
|
47
|
+
export const EXTENDS: string | null = null;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
51
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
52
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
53
|
+
* Versions").
|
|
54
|
+
*/
|
|
55
|
+
export const DEPRECATION: string | null = null;
|
|
56
|
+
|
|
57
|
+
/** Stable alias for this specification's request payload shape. */
|
|
58
|
+
export type Payload = PolicyEvaluatePayload;
|
|
59
|
+
|
|
60
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
61
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/policy/evaluate/0.4#response" as const;
|
|
62
|
+
|
|
63
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
64
|
+
export type Response = PolicyEvaluateResponsePayload;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* This specification's payload schema, as a value.
|
|
68
|
+
*
|
|
69
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
70
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
71
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
72
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
73
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
74
|
+
*/
|
|
75
|
+
export const PAYLOAD_SCHEMA = {
|
|
76
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
77
|
+
"$id": "https://trusttasks.org/spec/policy/evaluate/0.4",
|
|
78
|
+
"title": "Policy Evaluate — payload",
|
|
79
|
+
"description": "Dry-run a policy decision against a synthetic PolicyInput. Returns the policy decision plus a trace of which policy modules matched and which rules fired. Used by the policy-editor UI to verify changes before save and by admins to diagnose unexpected outcomes. 0.3 evaluates against the generalised PolicyInput (any Trust Task, carrying typeUri + side-effect/exposure classes) and can return the `requireConsent` decision.",
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": [
|
|
83
|
+
"input"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"input": {
|
|
87
|
+
"$ref": "#/$defs/PolicyInput"
|
|
88
|
+
},
|
|
89
|
+
"candidateModule": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"description": "Optional — when supplied, evaluate as if this Rego source were active (e.g. preview a pending upsert). The candidate is layered into the evaluator at the priority specified by `candidatePriority` (default 1000) for this call only."
|
|
92
|
+
},
|
|
93
|
+
"candidatePriority": {
|
|
94
|
+
"type": "integer",
|
|
95
|
+
"minimum": 0,
|
|
96
|
+
"maximum": 1000,
|
|
97
|
+
"default": 1000
|
|
98
|
+
},
|
|
99
|
+
"includeTrace": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"default": false
|
|
102
|
+
},
|
|
103
|
+
"ext": {
|
|
104
|
+
"$ref": "#/$defs/Ext"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"$defs": {
|
|
108
|
+
"Response": {
|
|
109
|
+
"$anchor": "response",
|
|
110
|
+
"title": "Policy Evaluate — response payload",
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": false,
|
|
113
|
+
"required": [
|
|
114
|
+
"decision"
|
|
115
|
+
],
|
|
116
|
+
"properties": {
|
|
117
|
+
"decision": {
|
|
118
|
+
"$ref": "#/$defs/PolicyDecision"
|
|
119
|
+
},
|
|
120
|
+
"matchedPolicies": {
|
|
121
|
+
"type": "array",
|
|
122
|
+
"items": {
|
|
123
|
+
"type": "string"
|
|
124
|
+
},
|
|
125
|
+
"description": "Ids (or `candidate` for the dry-run module) of the policies that returned a non-null decision, in evaluation order. The first is the winning policy."
|
|
126
|
+
},
|
|
127
|
+
"trace": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"maxLength": 1024
|
|
132
|
+
},
|
|
133
|
+
"description": "Rego evaluator trace lines when `includeTrace: true`. Maintainer-defined format; primarily for human debugging."
|
|
134
|
+
},
|
|
135
|
+
"ext": {
|
|
136
|
+
"$ref": "#/$defs/Ext"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"Ext": {
|
|
141
|
+
"title": "Ext",
|
|
142
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
143
|
+
"type": "object",
|
|
144
|
+
"minProperties": 1,
|
|
145
|
+
"additionalProperties": true,
|
|
146
|
+
"propertyNames": {
|
|
147
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"PolicyDecision": {
|
|
151
|
+
"title": "PolicyDecision",
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"required": [
|
|
155
|
+
"decision"
|
|
156
|
+
],
|
|
157
|
+
"properties": {
|
|
158
|
+
"decision": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"enum": [
|
|
161
|
+
"allow",
|
|
162
|
+
"deny",
|
|
163
|
+
"requireStepUp",
|
|
164
|
+
"requireConsent"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"mode": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"enum": [
|
|
170
|
+
"proxy",
|
|
171
|
+
"fill"
|
|
172
|
+
],
|
|
173
|
+
"description": "Vault-flow-specific. When decision == \"allow\" for a proxy-login/release request, whether the maintainer should proxy-login or release-for-fill. Default: proxy. Ignored for other task kinds."
|
|
174
|
+
},
|
|
175
|
+
"stepUp": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"additionalProperties": false,
|
|
178
|
+
"required": [
|
|
179
|
+
"method"
|
|
180
|
+
],
|
|
181
|
+
"properties": {
|
|
182
|
+
"method": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"enum": [
|
|
185
|
+
"webauthnUv",
|
|
186
|
+
"pushApproval",
|
|
187
|
+
"totp"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"ttlSeconds": {
|
|
191
|
+
"type": "integer",
|
|
192
|
+
"minimum": 1
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"description": "When decision == \"requireStepUp\", which method to demand."
|
|
196
|
+
},
|
|
197
|
+
"requireConsent": {
|
|
198
|
+
"type": "object",
|
|
199
|
+
"additionalProperties": false,
|
|
200
|
+
"required": [
|
|
201
|
+
"approverSet",
|
|
202
|
+
"excludeRequester",
|
|
203
|
+
"minApprovals"
|
|
204
|
+
],
|
|
205
|
+
"properties": {
|
|
206
|
+
"approverSet": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"description": "Named set of enrolled approver devices permitted to approve this task (resolved by the enforcement point against its device registry)."
|
|
209
|
+
},
|
|
210
|
+
"excludeRequester": {
|
|
211
|
+
"type": "boolean",
|
|
212
|
+
"description": "REQUIRED, with no default: whether the requester may approve its own request is the community's choice, not this schema's (SPEC §6.6 rule 5). When true, the device that issued the request MUST NOT be accepted as the approver — forcing cross-device approval so a compromised requesting device cannot self-approve."
|
|
213
|
+
},
|
|
214
|
+
"minApprovals": {
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"minimum": 1,
|
|
217
|
+
"description": "REQUIRED, with no default: the quorum is the community's choice, not this schema's (SPEC §6.6 rule 5), and an omitted quorum is malformedRequest rather than one. Number of distinct approvers from the set required before the task may execute."
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"description": "When decision == \"requireConsent\", the approver constraint the enforcement point MUST satisfy — a signed consent decision from the named set, bound to the request's payloadDigest — before executing."
|
|
221
|
+
},
|
|
222
|
+
"ttlSecondsCap": {
|
|
223
|
+
"type": "integer",
|
|
224
|
+
"minimum": 1,
|
|
225
|
+
"maximum": 86400,
|
|
226
|
+
"description": "When decision == \"allow\", maximum lifetime of any issued session blob / released secret."
|
|
227
|
+
},
|
|
228
|
+
"explanation": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"maxLength": 1024,
|
|
231
|
+
"description": "Human-readable explanation for diagnostic display."
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"PolicyInput": {
|
|
236
|
+
"title": "PolicyInput",
|
|
237
|
+
"description": "The structured input fed to a policy evaluator before dispatching a task. Generalised in 0.3 from the vault-flow triad to any Trust Task: `request.typeUri` identifies the task and `request.sideEffects` / `request.exposure` carry the authoritative SPEC §7.3 classifications the evaluator derives from the compiled handler.",
|
|
238
|
+
"type": "object",
|
|
239
|
+
"additionalProperties": false,
|
|
240
|
+
"required": [
|
|
241
|
+
"request",
|
|
242
|
+
"site",
|
|
243
|
+
"contextId",
|
|
244
|
+
"consumer"
|
|
245
|
+
],
|
|
246
|
+
"properties": {
|
|
247
|
+
"request": {
|
|
248
|
+
"type": "object",
|
|
249
|
+
"additionalProperties": false,
|
|
250
|
+
"required": [
|
|
251
|
+
"typeUri",
|
|
252
|
+
"sideEffects",
|
|
253
|
+
"exposure"
|
|
254
|
+
],
|
|
255
|
+
"properties": {
|
|
256
|
+
"typeUri": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"description": "Type URI of the task being authorized — the evaluator's primary discriminator (e.g. https://trusttasks.org/spec/did-management/did/delete/0.1)."
|
|
259
|
+
},
|
|
260
|
+
"kind": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"description": "Optional coarse category retained from 0.2 (`proxyLogin` | `release` | `stepUpResponse` | …) for policies that switch on it. `typeUri` is authoritative in 0.3."
|
|
263
|
+
},
|
|
264
|
+
"subject": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"description": "The identifier the task acts on — the value at the spec's `subjectPath` (usually a DID). The evaluator checks the consumer's authority to act on this subject. Absent for subjectless tasks (discovery, list)."
|
|
267
|
+
},
|
|
268
|
+
"payloadDigest": {
|
|
269
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
270
|
+
"description": "Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the payload, salted with the request challenge, present when a delegated-execution consent flow must bind approval to this exact payload. Absent when no consent binding is in play."
|
|
271
|
+
},
|
|
272
|
+
"sideEffects": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"enum": [
|
|
275
|
+
"none",
|
|
276
|
+
"mutating",
|
|
277
|
+
"destructive"
|
|
278
|
+
],
|
|
279
|
+
"description": "Authoritative integrity class (SPEC §7.3 item 13). The evaluator MUST derive this from the compiled handler it is about to invoke, not from the wire — the registry's declared value is advisory only."
|
|
280
|
+
},
|
|
281
|
+
"exposure": {
|
|
282
|
+
"type": "object",
|
|
283
|
+
"additionalProperties": false,
|
|
284
|
+
"required": [
|
|
285
|
+
"discloses",
|
|
286
|
+
"actsAsSubject"
|
|
287
|
+
],
|
|
288
|
+
"properties": {
|
|
289
|
+
"discloses": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"enum": [
|
|
292
|
+
"none",
|
|
293
|
+
"metadata",
|
|
294
|
+
"secret"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
"actsAsSubject": {
|
|
298
|
+
"type": "boolean"
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"description": "Authoritative exposure class (SPEC §7.3 item 14), likewise derived from the compiled handler. `discloses` is the sensitivity of returned data; `actsAsSubject` is whether the subject's authority is exercised."
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"site": {
|
|
306
|
+
"$ref": "#/$defs/SiteTarget"
|
|
307
|
+
},
|
|
308
|
+
"contextId": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"minLength": 1
|
|
311
|
+
},
|
|
312
|
+
"consumer": {
|
|
313
|
+
"type": "object",
|
|
314
|
+
"additionalProperties": false,
|
|
315
|
+
"required": [
|
|
316
|
+
"did"
|
|
317
|
+
],
|
|
318
|
+
"properties": {
|
|
319
|
+
"did": {
|
|
320
|
+
"type": "string"
|
|
321
|
+
},
|
|
322
|
+
"kind": {
|
|
323
|
+
"$ref": "#/$defs/ConsumerKind"
|
|
324
|
+
},
|
|
325
|
+
"deviceId": {
|
|
326
|
+
"type": "string"
|
|
327
|
+
},
|
|
328
|
+
"lastUserVerificationAt": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"format": "date-time"
|
|
331
|
+
},
|
|
332
|
+
"networkClass": {
|
|
333
|
+
"type": "string",
|
|
334
|
+
"enum": [
|
|
335
|
+
"unknown",
|
|
336
|
+
"home",
|
|
337
|
+
"corp",
|
|
338
|
+
"public",
|
|
339
|
+
"vpn"
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"ConsumerKind": {
|
|
347
|
+
"title": "ConsumerKind",
|
|
348
|
+
"description": "Discriminator: is this consumer a user-driven Companion or a headless Service?",
|
|
349
|
+
"oneOf": [
|
|
350
|
+
{
|
|
351
|
+
"title": "Companion",
|
|
352
|
+
"type": "object",
|
|
353
|
+
"additionalProperties": false,
|
|
354
|
+
"required": [
|
|
355
|
+
"kind",
|
|
356
|
+
"formFactor"
|
|
357
|
+
],
|
|
358
|
+
"properties": {
|
|
359
|
+
"kind": {
|
|
360
|
+
"const": "companion"
|
|
361
|
+
},
|
|
362
|
+
"formFactor": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"enum": [
|
|
365
|
+
"browser",
|
|
366
|
+
"mobile",
|
|
367
|
+
"desktop"
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"title": "Service",
|
|
374
|
+
"type": "object",
|
|
375
|
+
"additionalProperties": false,
|
|
376
|
+
"required": [
|
|
377
|
+
"kind",
|
|
378
|
+
"serviceKind"
|
|
379
|
+
],
|
|
380
|
+
"properties": {
|
|
381
|
+
"kind": {
|
|
382
|
+
"const": "service"
|
|
383
|
+
},
|
|
384
|
+
"serviceKind": {
|
|
385
|
+
"type": "string",
|
|
386
|
+
"enum": [
|
|
387
|
+
"mediator",
|
|
388
|
+
"aiAgent",
|
|
389
|
+
"daemon"
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
"SiteTarget": {
|
|
397
|
+
"title": "SiteTarget",
|
|
398
|
+
"description": "A single binding target for a vault entry. Tagged union over the discriminator `kind`. A VaultEntry's `targets` array MAY mix any number of these.",
|
|
399
|
+
"oneOf": [
|
|
400
|
+
{
|
|
401
|
+
"title": "WebOrigin",
|
|
402
|
+
"type": "object",
|
|
403
|
+
"additionalProperties": false,
|
|
404
|
+
"required": [
|
|
405
|
+
"kind",
|
|
406
|
+
"origin"
|
|
407
|
+
],
|
|
408
|
+
"properties": {
|
|
409
|
+
"kind": {
|
|
410
|
+
"const": "webOrigin"
|
|
411
|
+
},
|
|
412
|
+
"origin": {
|
|
413
|
+
"type": "string",
|
|
414
|
+
"format": "uri",
|
|
415
|
+
"description": "Web origin per RFC 6454 (scheme + host + optional port), e.g. \"https://github.com\". Compared by exact string equality after canonicalisation (lowercase host, default port elided). Consumers wanting subdomain coverage SHOULD add multiple targets, not encode a wildcard."
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"title": "Did",
|
|
421
|
+
"type": "object",
|
|
422
|
+
"additionalProperties": false,
|
|
423
|
+
"required": [
|
|
424
|
+
"kind",
|
|
425
|
+
"did"
|
|
426
|
+
],
|
|
427
|
+
"properties": {
|
|
428
|
+
"kind": {
|
|
429
|
+
"const": "did"
|
|
430
|
+
},
|
|
431
|
+
"did": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"minLength": 1,
|
|
434
|
+
"description": "DID identifying the relying party (e.g. did:web:rp.example). The vault maintainer is responsible for any DID resolution required to act on this entry."
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"title": "IosApp",
|
|
440
|
+
"type": "object",
|
|
441
|
+
"additionalProperties": false,
|
|
442
|
+
"required": [
|
|
443
|
+
"kind",
|
|
444
|
+
"bundleId"
|
|
445
|
+
],
|
|
446
|
+
"properties": {
|
|
447
|
+
"kind": {
|
|
448
|
+
"const": "iosApp"
|
|
449
|
+
},
|
|
450
|
+
"bundleId": {
|
|
451
|
+
"type": "string",
|
|
452
|
+
"minLength": 1,
|
|
453
|
+
"pattern": "^[A-Za-z0-9.-]+$",
|
|
454
|
+
"description": "iOS bundle identifier in reverse-DNS form (e.g. \"com.github.stwalkerster.codehub\"). Compared by exact string equality. Matches when an iOS Companion identifies the requesting app via its bundle id (typically via the OS Credential Manager integration)."
|
|
455
|
+
},
|
|
456
|
+
"teamId": {
|
|
457
|
+
"type": "string",
|
|
458
|
+
"minLength": 1,
|
|
459
|
+
"pattern": "^[A-Z0-9]+$",
|
|
460
|
+
"description": "Optional Apple Developer Team identifier (10-character alphanumeric). When supplied, the maintainer SHOULD also verify the team id of the requesting app before matching — defense in depth against bundle-id squatting on jailbroken devices."
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"title": "AndroidApp",
|
|
466
|
+
"type": "object",
|
|
467
|
+
"additionalProperties": false,
|
|
468
|
+
"required": [
|
|
469
|
+
"kind",
|
|
470
|
+
"packageName",
|
|
471
|
+
"sha256CertFingerprints"
|
|
472
|
+
],
|
|
473
|
+
"properties": {
|
|
474
|
+
"kind": {
|
|
475
|
+
"const": "androidApp"
|
|
476
|
+
},
|
|
477
|
+
"packageName": {
|
|
478
|
+
"type": "string",
|
|
479
|
+
"minLength": 1,
|
|
480
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z][A-Za-z0-9_]*)+$",
|
|
481
|
+
"description": "Android package name in reverse-DNS form (e.g. \"com.github.android\")."
|
|
482
|
+
},
|
|
483
|
+
"sha256CertFingerprints": {
|
|
484
|
+
"type": "array",
|
|
485
|
+
"minItems": 1,
|
|
486
|
+
"items": {
|
|
487
|
+
"type": "string",
|
|
488
|
+
"pattern": "^[0-9A-F]{2}(:[0-9A-F]{2}){31}$"
|
|
489
|
+
},
|
|
490
|
+
"uniqueItems": true,
|
|
491
|
+
"description": "SHA-256 fingerprints of the app's signing certificates, in colon-separated hex (the format `apksigner` and the Play Console emit). At least one fingerprint MUST be present. The maintainer matches when ANY of the provided fingerprints matches the requesting app's signature — this supports apps signed by multiple keys (e.g. during certificate rotation via Play App Signing)."
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
"DigestMultibase": {
|
|
498
|
+
"title": "DigestMultibase",
|
|
499
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
500
|
+
"type": "string",
|
|
501
|
+
"minLength": 16,
|
|
502
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
503
|
+
"examples": [
|
|
504
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
} as const;
|
|
509
|
+
|
|
510
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
511
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
512
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
513
|
+
"$ref": "#/$defs/Response",
|
|
514
|
+
"$defs": {
|
|
515
|
+
"Response": {
|
|
516
|
+
"$anchor": "response",
|
|
517
|
+
"title": "Policy Evaluate — response payload",
|
|
518
|
+
"type": "object",
|
|
519
|
+
"additionalProperties": false,
|
|
520
|
+
"required": [
|
|
521
|
+
"decision"
|
|
522
|
+
],
|
|
523
|
+
"properties": {
|
|
524
|
+
"decision": {
|
|
525
|
+
"$ref": "#/$defs/PolicyDecision"
|
|
526
|
+
},
|
|
527
|
+
"matchedPolicies": {
|
|
528
|
+
"type": "array",
|
|
529
|
+
"items": {
|
|
530
|
+
"type": "string"
|
|
531
|
+
},
|
|
532
|
+
"description": "Ids (or `candidate` for the dry-run module) of the policies that returned a non-null decision, in evaluation order. The first is the winning policy."
|
|
533
|
+
},
|
|
534
|
+
"trace": {
|
|
535
|
+
"type": "array",
|
|
536
|
+
"items": {
|
|
537
|
+
"type": "string",
|
|
538
|
+
"maxLength": 1024
|
|
539
|
+
},
|
|
540
|
+
"description": "Rego evaluator trace lines when `includeTrace: true`. Maintainer-defined format; primarily for human debugging."
|
|
541
|
+
},
|
|
542
|
+
"ext": {
|
|
543
|
+
"$ref": "#/$defs/Ext"
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
"Ext": {
|
|
548
|
+
"title": "Ext",
|
|
549
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
550
|
+
"type": "object",
|
|
551
|
+
"minProperties": 1,
|
|
552
|
+
"additionalProperties": true,
|
|
553
|
+
"propertyNames": {
|
|
554
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
"PolicyDecision": {
|
|
558
|
+
"title": "PolicyDecision",
|
|
559
|
+
"type": "object",
|
|
560
|
+
"additionalProperties": false,
|
|
561
|
+
"required": [
|
|
562
|
+
"decision"
|
|
563
|
+
],
|
|
564
|
+
"properties": {
|
|
565
|
+
"decision": {
|
|
566
|
+
"type": "string",
|
|
567
|
+
"enum": [
|
|
568
|
+
"allow",
|
|
569
|
+
"deny",
|
|
570
|
+
"requireStepUp",
|
|
571
|
+
"requireConsent"
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
"mode": {
|
|
575
|
+
"type": "string",
|
|
576
|
+
"enum": [
|
|
577
|
+
"proxy",
|
|
578
|
+
"fill"
|
|
579
|
+
],
|
|
580
|
+
"description": "Vault-flow-specific. When decision == \"allow\" for a proxy-login/release request, whether the maintainer should proxy-login or release-for-fill. Default: proxy. Ignored for other task kinds."
|
|
581
|
+
},
|
|
582
|
+
"stepUp": {
|
|
583
|
+
"type": "object",
|
|
584
|
+
"additionalProperties": false,
|
|
585
|
+
"required": [
|
|
586
|
+
"method"
|
|
587
|
+
],
|
|
588
|
+
"properties": {
|
|
589
|
+
"method": {
|
|
590
|
+
"type": "string",
|
|
591
|
+
"enum": [
|
|
592
|
+
"webauthnUv",
|
|
593
|
+
"pushApproval",
|
|
594
|
+
"totp"
|
|
595
|
+
]
|
|
596
|
+
},
|
|
597
|
+
"ttlSeconds": {
|
|
598
|
+
"type": "integer",
|
|
599
|
+
"minimum": 1
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"description": "When decision == \"requireStepUp\", which method to demand."
|
|
603
|
+
},
|
|
604
|
+
"requireConsent": {
|
|
605
|
+
"type": "object",
|
|
606
|
+
"additionalProperties": false,
|
|
607
|
+
"required": [
|
|
608
|
+
"approverSet",
|
|
609
|
+
"excludeRequester",
|
|
610
|
+
"minApprovals"
|
|
611
|
+
],
|
|
612
|
+
"properties": {
|
|
613
|
+
"approverSet": {
|
|
614
|
+
"type": "string",
|
|
615
|
+
"description": "Named set of enrolled approver devices permitted to approve this task (resolved by the enforcement point against its device registry)."
|
|
616
|
+
},
|
|
617
|
+
"excludeRequester": {
|
|
618
|
+
"type": "boolean",
|
|
619
|
+
"description": "REQUIRED, with no default: whether the requester may approve its own request is the community's choice, not this schema's (SPEC §6.6 rule 5). When true, the device that issued the request MUST NOT be accepted as the approver — forcing cross-device approval so a compromised requesting device cannot self-approve."
|
|
620
|
+
},
|
|
621
|
+
"minApprovals": {
|
|
622
|
+
"type": "integer",
|
|
623
|
+
"minimum": 1,
|
|
624
|
+
"description": "REQUIRED, with no default: the quorum is the community's choice, not this schema's (SPEC §6.6 rule 5), and an omitted quorum is malformedRequest rather than one. Number of distinct approvers from the set required before the task may execute."
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
"description": "When decision == \"requireConsent\", the approver constraint the enforcement point MUST satisfy — a signed consent decision from the named set, bound to the request's payloadDigest — before executing."
|
|
628
|
+
},
|
|
629
|
+
"ttlSecondsCap": {
|
|
630
|
+
"type": "integer",
|
|
631
|
+
"minimum": 1,
|
|
632
|
+
"maximum": 86400,
|
|
633
|
+
"description": "When decision == \"allow\", maximum lifetime of any issued session blob / released secret."
|
|
634
|
+
},
|
|
635
|
+
"explanation": {
|
|
636
|
+
"type": "string",
|
|
637
|
+
"maxLength": 1024,
|
|
638
|
+
"description": "Human-readable explanation for diagnostic display."
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
"PolicyInput": {
|
|
643
|
+
"title": "PolicyInput",
|
|
644
|
+
"description": "The structured input fed to a policy evaluator before dispatching a task. Generalised in 0.3 from the vault-flow triad to any Trust Task: `request.typeUri` identifies the task and `request.sideEffects` / `request.exposure` carry the authoritative SPEC §7.3 classifications the evaluator derives from the compiled handler.",
|
|
645
|
+
"type": "object",
|
|
646
|
+
"additionalProperties": false,
|
|
647
|
+
"required": [
|
|
648
|
+
"request",
|
|
649
|
+
"site",
|
|
650
|
+
"contextId",
|
|
651
|
+
"consumer"
|
|
652
|
+
],
|
|
653
|
+
"properties": {
|
|
654
|
+
"request": {
|
|
655
|
+
"type": "object",
|
|
656
|
+
"additionalProperties": false,
|
|
657
|
+
"required": [
|
|
658
|
+
"typeUri",
|
|
659
|
+
"sideEffects",
|
|
660
|
+
"exposure"
|
|
661
|
+
],
|
|
662
|
+
"properties": {
|
|
663
|
+
"typeUri": {
|
|
664
|
+
"type": "string",
|
|
665
|
+
"description": "Type URI of the task being authorized — the evaluator's primary discriminator (e.g. https://trusttasks.org/spec/did-management/did/delete/0.1)."
|
|
666
|
+
},
|
|
667
|
+
"kind": {
|
|
668
|
+
"type": "string",
|
|
669
|
+
"description": "Optional coarse category retained from 0.2 (`proxyLogin` | `release` | `stepUpResponse` | …) for policies that switch on it. `typeUri` is authoritative in 0.3."
|
|
670
|
+
},
|
|
671
|
+
"subject": {
|
|
672
|
+
"type": "string",
|
|
673
|
+
"description": "The identifier the task acts on — the value at the spec's `subjectPath` (usually a DID). The evaluator checks the consumer's authority to act on this subject. Absent for subjectless tasks (discovery, list)."
|
|
674
|
+
},
|
|
675
|
+
"payloadDigest": {
|
|
676
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
677
|
+
"description": "Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the payload, salted with the request challenge, present when a delegated-execution consent flow must bind approval to this exact payload. Absent when no consent binding is in play."
|
|
678
|
+
},
|
|
679
|
+
"sideEffects": {
|
|
680
|
+
"type": "string",
|
|
681
|
+
"enum": [
|
|
682
|
+
"none",
|
|
683
|
+
"mutating",
|
|
684
|
+
"destructive"
|
|
685
|
+
],
|
|
686
|
+
"description": "Authoritative integrity class (SPEC §7.3 item 13). The evaluator MUST derive this from the compiled handler it is about to invoke, not from the wire — the registry's declared value is advisory only."
|
|
687
|
+
},
|
|
688
|
+
"exposure": {
|
|
689
|
+
"type": "object",
|
|
690
|
+
"additionalProperties": false,
|
|
691
|
+
"required": [
|
|
692
|
+
"discloses",
|
|
693
|
+
"actsAsSubject"
|
|
694
|
+
],
|
|
695
|
+
"properties": {
|
|
696
|
+
"discloses": {
|
|
697
|
+
"type": "string",
|
|
698
|
+
"enum": [
|
|
699
|
+
"none",
|
|
700
|
+
"metadata",
|
|
701
|
+
"secret"
|
|
702
|
+
]
|
|
703
|
+
},
|
|
704
|
+
"actsAsSubject": {
|
|
705
|
+
"type": "boolean"
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
"description": "Authoritative exposure class (SPEC §7.3 item 14), likewise derived from the compiled handler. `discloses` is the sensitivity of returned data; `actsAsSubject` is whether the subject's authority is exercised."
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
"site": {
|
|
713
|
+
"$ref": "#/$defs/SiteTarget"
|
|
714
|
+
},
|
|
715
|
+
"contextId": {
|
|
716
|
+
"type": "string",
|
|
717
|
+
"minLength": 1
|
|
718
|
+
},
|
|
719
|
+
"consumer": {
|
|
720
|
+
"type": "object",
|
|
721
|
+
"additionalProperties": false,
|
|
722
|
+
"required": [
|
|
723
|
+
"did"
|
|
724
|
+
],
|
|
725
|
+
"properties": {
|
|
726
|
+
"did": {
|
|
727
|
+
"type": "string"
|
|
728
|
+
},
|
|
729
|
+
"kind": {
|
|
730
|
+
"$ref": "#/$defs/ConsumerKind"
|
|
731
|
+
},
|
|
732
|
+
"deviceId": {
|
|
733
|
+
"type": "string"
|
|
734
|
+
},
|
|
735
|
+
"lastUserVerificationAt": {
|
|
736
|
+
"type": "string",
|
|
737
|
+
"format": "date-time"
|
|
738
|
+
},
|
|
739
|
+
"networkClass": {
|
|
740
|
+
"type": "string",
|
|
741
|
+
"enum": [
|
|
742
|
+
"unknown",
|
|
743
|
+
"home",
|
|
744
|
+
"corp",
|
|
745
|
+
"public",
|
|
746
|
+
"vpn"
|
|
747
|
+
]
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
"ConsumerKind": {
|
|
754
|
+
"title": "ConsumerKind",
|
|
755
|
+
"description": "Discriminator: is this consumer a user-driven Companion or a headless Service?",
|
|
756
|
+
"oneOf": [
|
|
757
|
+
{
|
|
758
|
+
"title": "Companion",
|
|
759
|
+
"type": "object",
|
|
760
|
+
"additionalProperties": false,
|
|
761
|
+
"required": [
|
|
762
|
+
"kind",
|
|
763
|
+
"formFactor"
|
|
764
|
+
],
|
|
765
|
+
"properties": {
|
|
766
|
+
"kind": {
|
|
767
|
+
"const": "companion"
|
|
768
|
+
},
|
|
769
|
+
"formFactor": {
|
|
770
|
+
"type": "string",
|
|
771
|
+
"enum": [
|
|
772
|
+
"browser",
|
|
773
|
+
"mobile",
|
|
774
|
+
"desktop"
|
|
775
|
+
]
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"title": "Service",
|
|
781
|
+
"type": "object",
|
|
782
|
+
"additionalProperties": false,
|
|
783
|
+
"required": [
|
|
784
|
+
"kind",
|
|
785
|
+
"serviceKind"
|
|
786
|
+
],
|
|
787
|
+
"properties": {
|
|
788
|
+
"kind": {
|
|
789
|
+
"const": "service"
|
|
790
|
+
},
|
|
791
|
+
"serviceKind": {
|
|
792
|
+
"type": "string",
|
|
793
|
+
"enum": [
|
|
794
|
+
"mediator",
|
|
795
|
+
"aiAgent",
|
|
796
|
+
"daemon"
|
|
797
|
+
]
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
]
|
|
802
|
+
},
|
|
803
|
+
"SiteTarget": {
|
|
804
|
+
"title": "SiteTarget",
|
|
805
|
+
"description": "A single binding target for a vault entry. Tagged union over the discriminator `kind`. A VaultEntry's `targets` array MAY mix any number of these.",
|
|
806
|
+
"oneOf": [
|
|
807
|
+
{
|
|
808
|
+
"title": "WebOrigin",
|
|
809
|
+
"type": "object",
|
|
810
|
+
"additionalProperties": false,
|
|
811
|
+
"required": [
|
|
812
|
+
"kind",
|
|
813
|
+
"origin"
|
|
814
|
+
],
|
|
815
|
+
"properties": {
|
|
816
|
+
"kind": {
|
|
817
|
+
"const": "webOrigin"
|
|
818
|
+
},
|
|
819
|
+
"origin": {
|
|
820
|
+
"type": "string",
|
|
821
|
+
"format": "uri",
|
|
822
|
+
"description": "Web origin per RFC 6454 (scheme + host + optional port), e.g. \"https://github.com\". Compared by exact string equality after canonicalisation (lowercase host, default port elided). Consumers wanting subdomain coverage SHOULD add multiple targets, not encode a wildcard."
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"title": "Did",
|
|
828
|
+
"type": "object",
|
|
829
|
+
"additionalProperties": false,
|
|
830
|
+
"required": [
|
|
831
|
+
"kind",
|
|
832
|
+
"did"
|
|
833
|
+
],
|
|
834
|
+
"properties": {
|
|
835
|
+
"kind": {
|
|
836
|
+
"const": "did"
|
|
837
|
+
},
|
|
838
|
+
"did": {
|
|
839
|
+
"type": "string",
|
|
840
|
+
"minLength": 1,
|
|
841
|
+
"description": "DID identifying the relying party (e.g. did:web:rp.example). The vault maintainer is responsible for any DID resolution required to act on this entry."
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"title": "IosApp",
|
|
847
|
+
"type": "object",
|
|
848
|
+
"additionalProperties": false,
|
|
849
|
+
"required": [
|
|
850
|
+
"kind",
|
|
851
|
+
"bundleId"
|
|
852
|
+
],
|
|
853
|
+
"properties": {
|
|
854
|
+
"kind": {
|
|
855
|
+
"const": "iosApp"
|
|
856
|
+
},
|
|
857
|
+
"bundleId": {
|
|
858
|
+
"type": "string",
|
|
859
|
+
"minLength": 1,
|
|
860
|
+
"pattern": "^[A-Za-z0-9.-]+$",
|
|
861
|
+
"description": "iOS bundle identifier in reverse-DNS form (e.g. \"com.github.stwalkerster.codehub\"). Compared by exact string equality. Matches when an iOS Companion identifies the requesting app via its bundle id (typically via the OS Credential Manager integration)."
|
|
862
|
+
},
|
|
863
|
+
"teamId": {
|
|
864
|
+
"type": "string",
|
|
865
|
+
"minLength": 1,
|
|
866
|
+
"pattern": "^[A-Z0-9]+$",
|
|
867
|
+
"description": "Optional Apple Developer Team identifier (10-character alphanumeric). When supplied, the maintainer SHOULD also verify the team id of the requesting app before matching — defense in depth against bundle-id squatting on jailbroken devices."
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"title": "AndroidApp",
|
|
873
|
+
"type": "object",
|
|
874
|
+
"additionalProperties": false,
|
|
875
|
+
"required": [
|
|
876
|
+
"kind",
|
|
877
|
+
"packageName",
|
|
878
|
+
"sha256CertFingerprints"
|
|
879
|
+
],
|
|
880
|
+
"properties": {
|
|
881
|
+
"kind": {
|
|
882
|
+
"const": "androidApp"
|
|
883
|
+
},
|
|
884
|
+
"packageName": {
|
|
885
|
+
"type": "string",
|
|
886
|
+
"minLength": 1,
|
|
887
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z][A-Za-z0-9_]*)+$",
|
|
888
|
+
"description": "Android package name in reverse-DNS form (e.g. \"com.github.android\")."
|
|
889
|
+
},
|
|
890
|
+
"sha256CertFingerprints": {
|
|
891
|
+
"type": "array",
|
|
892
|
+
"minItems": 1,
|
|
893
|
+
"items": {
|
|
894
|
+
"type": "string",
|
|
895
|
+
"pattern": "^[0-9A-F]{2}(:[0-9A-F]{2}){31}$"
|
|
896
|
+
},
|
|
897
|
+
"uniqueItems": true,
|
|
898
|
+
"description": "SHA-256 fingerprints of the app's signing certificates, in colon-separated hex (the format `apksigner` and the Play Console emit). At least one fingerprint MUST be present. The maintainer matches when ANY of the provided fingerprints matches the requesting app's signature — this supports apps signed by multiple keys (e.g. during certificate rotation via Play App Signing)."
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
]
|
|
903
|
+
},
|
|
904
|
+
"DigestMultibase": {
|
|
905
|
+
"title": "DigestMultibase",
|
|
906
|
+
"description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
|
|
907
|
+
"type": "string",
|
|
908
|
+
"minLength": 16,
|
|
909
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
910
|
+
"examples": [
|
|
911
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
912
|
+
]
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
} as const;
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
919
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
920
|
+
* per-specification and cannot be derived from the document alone, and
|
|
921
|
+
* item 2 needs the schema this carries.
|
|
922
|
+
*/
|
|
923
|
+
export const SPEC = {
|
|
924
|
+
typeUri: TYPE_URI,
|
|
925
|
+
isBearer: false,
|
|
926
|
+
isProofRequired: false,
|
|
927
|
+
isRecipientRequired: true,
|
|
928
|
+
isIssuedAtRequired: false,
|
|
929
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
930
|
+
} as const;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
934
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
935
|
+
* parties (§7.3 item 5).
|
|
936
|
+
*/
|
|
937
|
+
export const RESPONSE_SPEC = {
|
|
938
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
939
|
+
isBearer: false,
|
|
940
|
+
isProofRequired: false,
|
|
941
|
+
isRecipientRequired: true,
|
|
942
|
+
isIssuedAtRequired: false,
|
|
943
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
944
|
+
} as const;
|