@openvtc/trust-tasks 0.24.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/vtc/join-requests/wallet-session/start/0.1/payload.d.ts +398 -0
- package/dist/vtc/join-requests/wallet-session/start/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/join-requests/wallet-session/start/0.1/payload.js +220 -0
- package/dist/vtc/join-requests/wallet-session/start/0.1/payload.js.map +1 -0
- package/dist/vtc/join-requests/wallet-session/status/0.1/payload.d.ts +655 -0
- package/dist/vtc/join-requests/wallet-session/status/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/join-requests/wallet-session/status/0.1/payload.js +360 -0
- package/dist/vtc/join-requests/wallet-session/status/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/vtc/join-requests/wallet-session/start/0.1/payload.ts +279 -0
- package/src/vtc/join-requests/wallet-session/status/0.1/payload.ts +454 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/join-requests/wallet-session/start/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { DigestMultibase, Ext } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* An applicant asks the community to open an OpenID4VP 1.0 presentation session for one of its join criteria, so that a wallet which cannot sign Trust Tasks can present credentials as evidence for the applicant's join. The applicant is the document proof's signer, not a payload member. The outer document members are owned by the framework — SPEC §6.3.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTCJoinRequestsWalletSessionStartPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The `requirementsDigest` of the criterion the applicant is gathering evidence for, as vtc/join-requests/manifest/0.3 published it — the same value vtc/join-requests/submit/0.3 carries as its `criterion`. Naming the version, not only the criterion, fixes the DCQL query the wallet is asked to satisfy to the one the applicant read.
|
|
15
|
+
*/
|
|
16
|
+
criterion: DigestMultibase;
|
|
17
|
+
/**
|
|
18
|
+
* An existing join request of the applicant's to record the evidence on. Absent: the community holds the evidence, for a bounded period of its own policy, for the applicant's next vtc/join-requests/submit under the same criterion.
|
|
19
|
+
*/
|
|
20
|
+
requestId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The OpenID4VP 1.0 client identifier prefix the community should identify itself to the wallet with — a DID (`decentralized_identifier`, as swiyu wallets expect) or an X.509 certificate (`x509_hash`, as EUDI wallets expect). Values are OpenID4VP's own and are carried verbatim. Absent: the community's default. A community holding no verifier identity of the requested kind refuses with `verifierNotConfigured`.
|
|
23
|
+
*/
|
|
24
|
+
clientIdPrefix?: "decentralized_identifier" | "x509_hash";
|
|
25
|
+
ext?: Ext;
|
|
26
|
+
}
|
|
27
|
+
export interface VTCJoinRequestsWalletSessionStartResponsePayload {
|
|
28
|
+
/**
|
|
29
|
+
* Opaque, unguessable identifier of the session, carrying at least 128 bits of entropy. The applicant reads the outcome with vtc/join-requests/wallet-session/status under it.
|
|
30
|
+
*/
|
|
31
|
+
sessionId: string;
|
|
32
|
+
/**
|
|
33
|
+
* The OpenID4VP invocation URI for this session, carrying `client_id` and `request_uri`, to be rendered as a QR code or opened as a deep link. Its scheme is the community's choice for the wallet ecosystem it serves — `openid4vp://`, `swiyu-verify://`, `haip-vp://` and others.
|
|
34
|
+
*/
|
|
35
|
+
walletUri: string;
|
|
36
|
+
/**
|
|
37
|
+
* The full OpenID4VP client identifier the community presents to the wallet, prefix included (`decentralized_identifier:did:webvh:…`, `x509_hash:…`). It is the audience the wallet's key-binding JWT will name.
|
|
38
|
+
*/
|
|
39
|
+
clientId: string;
|
|
40
|
+
/**
|
|
41
|
+
* The DCQL query (OpenID4VP 1.0 §6) the wallet will be asked to satisfy: the criterion's published query, unchanged. Opaque here; its members are DCQL's own and keep DCQL's snake_case names.
|
|
42
|
+
*/
|
|
43
|
+
dcqlQuery: {};
|
|
44
|
+
/**
|
|
45
|
+
* When the session closes if no wallet has answered it. Minutes, not hours.
|
|
46
|
+
*/
|
|
47
|
+
expiresAt: string;
|
|
48
|
+
ext?: Ext;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
52
|
+
export type { DigestMultibase, Ext };
|
|
53
|
+
|
|
54
|
+
/** Trust Task type URI. */
|
|
55
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/join-requests/wallet-session/start/0.1" as const;
|
|
56
|
+
|
|
57
|
+
/** Stable alias for this specification's request payload shape. */
|
|
58
|
+
export type Payload = VTCJoinRequestsWalletSessionStartPayload;
|
|
59
|
+
|
|
60
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
61
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/join-requests/wallet-session/start/0.1#response" as const;
|
|
62
|
+
|
|
63
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
64
|
+
export type Response = VTCJoinRequestsWalletSessionStartResponsePayload;
|
|
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/vtc/join-requests/wallet-session/start/0.1",
|
|
78
|
+
"title": "VTC Join-Requests Wallet Session Start — payload",
|
|
79
|
+
"description": "An applicant asks the community to open an OpenID4VP 1.0 presentation session for one of its join criteria, so that a wallet which cannot sign Trust Tasks can present credentials as evidence for the applicant's join. The applicant is the document proof's signer, not a payload member. The outer document members are owned by the framework — SPEC §6.3.",
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": [
|
|
83
|
+
"criterion"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"criterion": {
|
|
87
|
+
"$ref": "#/$defs/DigestMultibase",
|
|
88
|
+
"description": "The `requirementsDigest` of the criterion the applicant is gathering evidence for, as vtc/join-requests/manifest/0.3 published it — the same value vtc/join-requests/submit/0.3 carries as its `criterion`. Naming the version, not only the criterion, fixes the DCQL query the wallet is asked to satisfy to the one the applicant read."
|
|
89
|
+
},
|
|
90
|
+
"requestId": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1,
|
|
93
|
+
"maxLength": 128,
|
|
94
|
+
"description": "An existing join request of the applicant's to record the evidence on. Absent: the community holds the evidence, for a bounded period of its own policy, for the applicant's next vtc/join-requests/submit under the same criterion."
|
|
95
|
+
},
|
|
96
|
+
"clientIdPrefix": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"enum": [
|
|
99
|
+
"decentralized_identifier",
|
|
100
|
+
"x509_hash"
|
|
101
|
+
],
|
|
102
|
+
"description": "The OpenID4VP 1.0 client identifier prefix the community should identify itself to the wallet with — a DID (`decentralized_identifier`, as swiyu wallets expect) or an X.509 certificate (`x509_hash`, as EUDI wallets expect). Values are OpenID4VP's own and are carried verbatim. Absent: the community's default. A community holding no verifier identity of the requested kind refuses with `verifierNotConfigured`."
|
|
103
|
+
},
|
|
104
|
+
"ext": {
|
|
105
|
+
"$ref": "#/$defs/Ext"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"$defs": {
|
|
109
|
+
"Response": {
|
|
110
|
+
"$anchor": "response",
|
|
111
|
+
"title": "VTC Join-Requests Wallet Session Start — response payload",
|
|
112
|
+
"type": "object",
|
|
113
|
+
"additionalProperties": false,
|
|
114
|
+
"required": [
|
|
115
|
+
"sessionId",
|
|
116
|
+
"walletUri",
|
|
117
|
+
"clientId",
|
|
118
|
+
"dcqlQuery",
|
|
119
|
+
"expiresAt"
|
|
120
|
+
],
|
|
121
|
+
"properties": {
|
|
122
|
+
"sessionId": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"minLength": 16,
|
|
125
|
+
"maxLength": 128,
|
|
126
|
+
"description": "Opaque, unguessable identifier of the session, carrying at least 128 bits of entropy. The applicant reads the outcome with vtc/join-requests/wallet-session/status under it."
|
|
127
|
+
},
|
|
128
|
+
"walletUri": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"format": "uri",
|
|
131
|
+
"minLength": 1,
|
|
132
|
+
"maxLength": 4096,
|
|
133
|
+
"description": "The OpenID4VP invocation URI for this session, carrying `client_id` and `request_uri`, to be rendered as a QR code or opened as a deep link. Its scheme is the community's choice for the wallet ecosystem it serves — `openid4vp://`, `swiyu-verify://`, `haip-vp://` and others."
|
|
134
|
+
},
|
|
135
|
+
"clientId": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"minLength": 1,
|
|
138
|
+
"maxLength": 2048,
|
|
139
|
+
"description": "The full OpenID4VP client identifier the community presents to the wallet, prefix included (`decentralized_identifier:did:webvh:…`, `x509_hash:…`). It is the audience the wallet's key-binding JWT will name."
|
|
140
|
+
},
|
|
141
|
+
"dcqlQuery": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"description": "The DCQL query (OpenID4VP 1.0 §6) the wallet will be asked to satisfy: the criterion's published query, unchanged. Opaque here; its members are DCQL's own and keep DCQL's snake_case names."
|
|
144
|
+
},
|
|
145
|
+
"expiresAt": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"format": "date-time",
|
|
148
|
+
"description": "When the session closes if no wallet has answered it. Minutes, not hours."
|
|
149
|
+
},
|
|
150
|
+
"ext": {
|
|
151
|
+
"$ref": "#/$defs/Ext"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"Ext": {
|
|
156
|
+
"title": "Ext",
|
|
157
|
+
"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.",
|
|
158
|
+
"type": "object",
|
|
159
|
+
"minProperties": 1,
|
|
160
|
+
"additionalProperties": true,
|
|
161
|
+
"propertyNames": {
|
|
162
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"DigestMultibase": {
|
|
166
|
+
"title": "DigestMultibase",
|
|
167
|
+
"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`.",
|
|
168
|
+
"type": "string",
|
|
169
|
+
"minLength": 16,
|
|
170
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
171
|
+
"examples": [
|
|
172
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
} as const;
|
|
177
|
+
|
|
178
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
179
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
180
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
181
|
+
"$ref": "#/$defs/Response",
|
|
182
|
+
"$defs": {
|
|
183
|
+
"Response": {
|
|
184
|
+
"$anchor": "response",
|
|
185
|
+
"title": "VTC Join-Requests Wallet Session Start — response payload",
|
|
186
|
+
"type": "object",
|
|
187
|
+
"additionalProperties": false,
|
|
188
|
+
"required": [
|
|
189
|
+
"sessionId",
|
|
190
|
+
"walletUri",
|
|
191
|
+
"clientId",
|
|
192
|
+
"dcqlQuery",
|
|
193
|
+
"expiresAt"
|
|
194
|
+
],
|
|
195
|
+
"properties": {
|
|
196
|
+
"sessionId": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"minLength": 16,
|
|
199
|
+
"maxLength": 128,
|
|
200
|
+
"description": "Opaque, unguessable identifier of the session, carrying at least 128 bits of entropy. The applicant reads the outcome with vtc/join-requests/wallet-session/status under it."
|
|
201
|
+
},
|
|
202
|
+
"walletUri": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"format": "uri",
|
|
205
|
+
"minLength": 1,
|
|
206
|
+
"maxLength": 4096,
|
|
207
|
+
"description": "The OpenID4VP invocation URI for this session, carrying `client_id` and `request_uri`, to be rendered as a QR code or opened as a deep link. Its scheme is the community's choice for the wallet ecosystem it serves — `openid4vp://`, `swiyu-verify://`, `haip-vp://` and others."
|
|
208
|
+
},
|
|
209
|
+
"clientId": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"minLength": 1,
|
|
212
|
+
"maxLength": 2048,
|
|
213
|
+
"description": "The full OpenID4VP client identifier the community presents to the wallet, prefix included (`decentralized_identifier:did:webvh:…`, `x509_hash:…`). It is the audience the wallet's key-binding JWT will name."
|
|
214
|
+
},
|
|
215
|
+
"dcqlQuery": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"description": "The DCQL query (OpenID4VP 1.0 §6) the wallet will be asked to satisfy: the criterion's published query, unchanged. Opaque here; its members are DCQL's own and keep DCQL's snake_case names."
|
|
218
|
+
},
|
|
219
|
+
"expiresAt": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"format": "date-time",
|
|
222
|
+
"description": "When the session closes if no wallet has answered it. Minutes, not hours."
|
|
223
|
+
},
|
|
224
|
+
"ext": {
|
|
225
|
+
"$ref": "#/$defs/Ext"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"Ext": {
|
|
230
|
+
"title": "Ext",
|
|
231
|
+
"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.",
|
|
232
|
+
"type": "object",
|
|
233
|
+
"minProperties": 1,
|
|
234
|
+
"additionalProperties": true,
|
|
235
|
+
"propertyNames": {
|
|
236
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"DigestMultibase": {
|
|
240
|
+
"title": "DigestMultibase",
|
|
241
|
+
"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`.",
|
|
242
|
+
"type": "string",
|
|
243
|
+
"minLength": 16,
|
|
244
|
+
"pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
|
|
245
|
+
"examples": [
|
|
246
|
+
"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
} as const;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
254
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
255
|
+
* per-specification and cannot be derived from the document alone, and
|
|
256
|
+
* item 2 needs the schema this carries.
|
|
257
|
+
*/
|
|
258
|
+
export const SPEC = {
|
|
259
|
+
typeUri: TYPE_URI,
|
|
260
|
+
isBearer: false,
|
|
261
|
+
isProofRequired: true,
|
|
262
|
+
isRecipientRequired: true,
|
|
263
|
+
isIssuedAtRequired: true,
|
|
264
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
265
|
+
} as const;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
269
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
270
|
+
* parties (§7.3 item 5).
|
|
271
|
+
*/
|
|
272
|
+
export const RESPONSE_SPEC = {
|
|
273
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
274
|
+
isBearer: false,
|
|
275
|
+
isProofRequired: true,
|
|
276
|
+
isRecipientRequired: true,
|
|
277
|
+
isIssuedAtRequired: true,
|
|
278
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
279
|
+
} as const;
|