@openvtc/trust-tasks 0.24.1 → 0.24.2

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/_shared/components.d.ts +55 -2
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +4 -0
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +4 -0
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +4 -0
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +4 -0
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +2 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/keys/sign-csr/0.1/payload.d.ts +729 -0
  25. package/dist/keys/sign-csr/0.1/payload.d.ts.map +1 -0
  26. package/dist/keys/sign-csr/0.1/payload.js +280 -0
  27. package/dist/keys/sign-csr/0.1/payload.js.map +1 -0
  28. package/dist/keys/sign-jws/0.1/payload.d.ts +352 -0
  29. package/dist/keys/sign-jws/0.1/payload.d.ts.map +1 -0
  30. package/dist/keys/sign-jws/0.1/payload.js +207 -0
  31. package/dist/keys/sign-jws/0.1/payload.js.map +1 -0
  32. package/dist/rooms/_shared/0.1/blobs.d.ts +1 -1
  33. package/dist/rooms/_shared/0.1/blobs.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/src/_shared/components.ts +57 -0
  36. package/src/device/list/0.1/payload.ts +4 -0
  37. package/src/device/list/0.2/payload.ts +4 -0
  38. package/src/device/register/0.1/payload.ts +4 -0
  39. package/src/device/register/0.2/payload.ts +4 -0
  40. package/src/index.ts +2 -0
  41. package/src/keys/sign-csr/0.1/payload.ts +646 -0
  42. package/src/keys/sign-jws/0.1/payload.ts +271 -0
  43. package/src/rooms/_shared/0.1/blobs.ts +1 -1
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/keys/sign-jws/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A request for a compact JWS (RFC 7515) made with a key the custodian holds. The producer supplies the protected header members it wants and the payload; the custodian sets `alg` from the key, serialises both itself, and signs the JWS signing input with no framing of its own. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export type KeysSignJWSPayload = {
13
+ /**
14
+ * Identifier of the key to sign with, as `keys/show` describes it. The key MUST be `active` and of a type with a JOSE signature algorithm.
15
+ */
16
+ keyId: string;
17
+ /**
18
+ * Protected header members the producer wants in the JWS — `typ`, `kid`, `x5c`, `cty`, or a profile's own (swiyu's `profile_version`). Member names and values are JOSE's and the profile's, carried verbatim. The custodian adds `alg` itself and refuses `alg`, `crit`, `b64`, `jwk`, `jku` and `x5u` (see the specification's Conformance section). Absent means a header of `alg` alone.
19
+ */
20
+ header?: {};
21
+ /**
22
+ * The JWS payload, as a JSON object — for an OpenID4VP request object or any other JWT, its claims set. The custodian serialises it (RFC 8785) and base64url-encodes the result. Exactly one of `payload` and `payloadBase64Url` is present.
23
+ */
24
+ payload?: {};
25
+ /**
26
+ * The JWS payload as bytes, for a payload that is not a JSON object, base64url-encoded without padding. The custodian uses this string as the payload segment unchanged, after checking it is the canonical encoding of the bytes it decodes to. Exactly one of `payload` and `payloadBase64Url` is present.
27
+ */
28
+ payloadBase64Url?: string;
29
+ /**
30
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
31
+ */
32
+ ext?: Ext;
33
+ } & {
34
+ [k: string]: unknown | undefined;
35
+ };
36
+
37
+ /**
38
+ * The success response to a keys/sign-jws request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/sign-jws/0.1#response. Failures use trust-task-error, not this shape.
39
+ */
40
+ export interface KeysSignJWSResponsePayload {
41
+ /**
42
+ * The key that produced the signature. Echoed so a response separated from its request is still attributable.
43
+ */
44
+ keyId: string;
45
+ /**
46
+ * The JOSE algorithm the custodian chose from the key's type and wrote into the header: `EdDSA` for `ed25519`, `ES256` for `p256`, `ES256K` for a secp256k1 key, `ML-DSA-44` and `ML-DSA-65` for `mldsa44` and `mldsa65`. Externally owned, carried verbatim.
47
+ */
48
+ alg: "EdDSA" | "ES256" | "ES256K" | "ML-DSA-44" | "ML-DSA-65";
49
+ /**
50
+ * The JWS in compact serialisation: BASE64URL(header) '.' BASE64URL(payload) '.' BASE64URL(signature), unpadded. For ECDSA the signature is the fixed-width `r || s` of RFC 7518 §3.4, not DER.
51
+ */
52
+ jws: string;
53
+ ext?: Ext;
54
+ }
55
+
56
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
57
+ export type { Ext };
58
+
59
+ /** Trust Task type URI. */
60
+ export const TYPE_URI = "https://trusttasks.org/spec/keys/sign-jws/0.1" as const;
61
+
62
+ /** Stable alias for this specification's request payload shape. */
63
+ export type Payload = KeysSignJWSPayload;
64
+
65
+ /** Trust Task response type URI (request type URI + "#response"). */
66
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/keys/sign-jws/0.1#response" as const;
67
+
68
+ /** Stable alias for this specification's success-response payload shape. */
69
+ export type Response = KeysSignJWSResponsePayload;
70
+
71
+ /**
72
+ * This specification's payload schema, as a value.
73
+ *
74
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
75
+ * rather than only as a `.json` file because TypeScript types are erased
76
+ * at runtime: without a schema a consumer has nothing to validate, and
77
+ * every REQUIRED payload member is optional in practice. Cross-file
78
+ * `$ref`s are already inlined, so it needs no resolver.
79
+ */
80
+ export const PAYLOAD_SCHEMA = {
81
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
82
+ "$id": "https://trusttasks.org/spec/keys/sign-jws/0.1",
83
+ "title": "Keys — Sign JWS — payload",
84
+ "description": "A request for a compact JWS (RFC 7515) made with a key the custodian holds. The producer supplies the protected header members it wants and the payload; the custodian sets `alg` from the key, serialises both itself, and signs the JWS signing input with no framing of its own. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": [
88
+ "keyId"
89
+ ],
90
+ "oneOf": [
91
+ {
92
+ "required": [
93
+ "payload"
94
+ ],
95
+ "not": {
96
+ "required": [
97
+ "payloadBase64Url"
98
+ ]
99
+ }
100
+ },
101
+ {
102
+ "required": [
103
+ "payloadBase64Url"
104
+ ],
105
+ "not": {
106
+ "required": [
107
+ "payload"
108
+ ]
109
+ }
110
+ }
111
+ ],
112
+ "properties": {
113
+ "keyId": {
114
+ "type": "string",
115
+ "minLength": 1,
116
+ "description": "Identifier of the key to sign with, as `keys/show` describes it. The key MUST be `active` and of a type with a JOSE signature algorithm."
117
+ },
118
+ "header": {
119
+ "type": "object",
120
+ "maxProperties": 32,
121
+ "description": "Protected header members the producer wants in the JWS — `typ`, `kid`, `x5c`, `cty`, or a profile's own (swiyu's `profile_version`). Member names and values are JOSE's and the profile's, carried verbatim. The custodian adds `alg` itself and refuses `alg`, `crit`, `b64`, `jwk`, `jku` and `x5u` (see the specification's Conformance section). Absent means a header of `alg` alone."
122
+ },
123
+ "payload": {
124
+ "type": "object",
125
+ "description": "The JWS payload, as a JSON object — for an OpenID4VP request object or any other JWT, its claims set. The custodian serialises it (RFC 8785) and base64url-encodes the result. Exactly one of `payload` and `payloadBase64Url` is present."
126
+ },
127
+ "payloadBase64Url": {
128
+ "type": "string",
129
+ "minLength": 2,
130
+ "pattern": "^[A-Za-z0-9_-]+$",
131
+ "description": "The JWS payload as bytes, for a payload that is not a JSON object, base64url-encoded without padding. The custodian uses this string as the payload segment unchanged, after checking it is the canonical encoding of the bytes it decodes to. Exactly one of `payload` and `payloadBase64Url` is present."
132
+ },
133
+ "ext": {
134
+ "$ref": "#/$defs/Ext",
135
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
136
+ }
137
+ },
138
+ "$defs": {
139
+ "Response": {
140
+ "$anchor": "response",
141
+ "title": "Keys — Sign JWS — response payload",
142
+ "description": "The success response to a keys/sign-jws request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/sign-jws/0.1#response. Failures use trust-task-error, not this shape.",
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "required": [
146
+ "keyId",
147
+ "alg",
148
+ "jws"
149
+ ],
150
+ "properties": {
151
+ "keyId": {
152
+ "type": "string",
153
+ "description": "The key that produced the signature. Echoed so a response separated from its request is still attributable."
154
+ },
155
+ "alg": {
156
+ "type": "string",
157
+ "enum": [
158
+ "EdDSA",
159
+ "ES256",
160
+ "ES256K",
161
+ "ML-DSA-44",
162
+ "ML-DSA-65"
163
+ ],
164
+ "description": "The JOSE algorithm the custodian chose from the key's type and wrote into the header: `EdDSA` for `ed25519`, `ES256` for `p256`, `ES256K` for a secp256k1 key, `ML-DSA-44` and `ML-DSA-65` for `mldsa44` and `mldsa65`. Externally owned, carried verbatim."
165
+ },
166
+ "jws": {
167
+ "type": "string",
168
+ "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",
169
+ "description": "The JWS in compact serialisation: BASE64URL(header) '.' BASE64URL(payload) '.' BASE64URL(signature), unpadded. For ECDSA the signature is the fixed-width `r || s` of RFC 7518 §3.4, not DER."
170
+ },
171
+ "ext": {
172
+ "$ref": "#/$defs/Ext"
173
+ }
174
+ }
175
+ },
176
+ "Ext": {
177
+ "title": "Ext",
178
+ "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.",
179
+ "type": "object",
180
+ "minProperties": 1,
181
+ "additionalProperties": true,
182
+ "propertyNames": {
183
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
184
+ }
185
+ }
186
+ }
187
+ } as const;
188
+
189
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
190
+ export const RESPONSE_PAYLOAD_SCHEMA = {
191
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
192
+ "$ref": "#/$defs/Response",
193
+ "$defs": {
194
+ "Response": {
195
+ "$anchor": "response",
196
+ "title": "Keys — Sign JWS — response payload",
197
+ "description": "The success response to a keys/sign-jws request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/sign-jws/0.1#response. Failures use trust-task-error, not this shape.",
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": [
201
+ "keyId",
202
+ "alg",
203
+ "jws"
204
+ ],
205
+ "properties": {
206
+ "keyId": {
207
+ "type": "string",
208
+ "description": "The key that produced the signature. Echoed so a response separated from its request is still attributable."
209
+ },
210
+ "alg": {
211
+ "type": "string",
212
+ "enum": [
213
+ "EdDSA",
214
+ "ES256",
215
+ "ES256K",
216
+ "ML-DSA-44",
217
+ "ML-DSA-65"
218
+ ],
219
+ "description": "The JOSE algorithm the custodian chose from the key's type and wrote into the header: `EdDSA` for `ed25519`, `ES256` for `p256`, `ES256K` for a secp256k1 key, `ML-DSA-44` and `ML-DSA-65` for `mldsa44` and `mldsa65`. Externally owned, carried verbatim."
220
+ },
221
+ "jws": {
222
+ "type": "string",
223
+ "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",
224
+ "description": "The JWS in compact serialisation: BASE64URL(header) '.' BASE64URL(payload) '.' BASE64URL(signature), unpadded. For ECDSA the signature is the fixed-width `r || s` of RFC 7518 §3.4, not DER."
225
+ },
226
+ "ext": {
227
+ "$ref": "#/$defs/Ext"
228
+ }
229
+ }
230
+ },
231
+ "Ext": {
232
+ "title": "Ext",
233
+ "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.",
234
+ "type": "object",
235
+ "minProperties": 1,
236
+ "additionalProperties": true,
237
+ "propertyNames": {
238
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
239
+ }
240
+ }
241
+ }
242
+ } as const;
243
+
244
+ /**
245
+ * SPEC.md §7.2 policy for the request variant, from this specification's
246
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
247
+ * per-specification and cannot be derived from the document alone, and
248
+ * item 2 needs the schema this carries.
249
+ */
250
+ export const SPEC = {
251
+ typeUri: TYPE_URI,
252
+ isBearer: false,
253
+ isProofRequired: true,
254
+ isRecipientRequired: true,
255
+ isIssuedAtRequired: true,
256
+ payloadSchema: PAYLOAD_SCHEMA,
257
+ } as const;
258
+
259
+ /**
260
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
261
+ * tracks the *issuer* party's requirement because a response swaps the
262
+ * parties (§7.3 item 5).
263
+ */
264
+ export const RESPONSE_SPEC = {
265
+ typeUri: RESPONSE_TYPE_URI,
266
+ isBearer: false,
267
+ isProofRequired: false,
268
+ isRecipientRequired: true,
269
+ isIssuedAtRequired: true,
270
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
271
+ } as const;
@@ -14,4 +14,4 @@ export interface RoomsSharedFileAndBlobTypes {
14
14
  * The definitions this shared schema publishes, hoisted to one declaration each.
15
15
  * See "../../../_shared/components.js".
16
16
  */
17
- export type { BlobManifest, BlobRef, RoomLimits, ScopeLimits, TransferId, Usage } from "../../../_shared/components.js";
17
+ export type { BlobManifest, BlobRef, FileManifest, RoomLimits, ScopeLimits, TransferId, Usage } from "../../../_shared/components.js";