@openvtc/trust-tasks 0.19.1 → 0.19.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.
- package/CHANGELOG.md +67 -0
- package/dist/_shared/components.d.ts +4 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/keys/create/0.1/payload.d.ts +20 -0
- package/dist/keys/create/0.1/payload.d.ts.map +1 -1
- package/dist/keys/create/0.1/payload.js +10 -0
- package/dist/keys/create/0.1/payload.js.map +1 -1
- package/dist/keys/import/0.1/payload.d.ts +20 -0
- package/dist/keys/import/0.1/payload.d.ts.map +1 -1
- package/dist/keys/import/0.1/payload.js +10 -0
- package/dist/keys/import/0.1/payload.js.map +1 -1
- package/dist/keys/list/0.1/payload.d.ts +20 -0
- package/dist/keys/list/0.1/payload.d.ts.map +1 -1
- package/dist/keys/list/0.1/payload.js +10 -0
- package/dist/keys/list/0.1/payload.js.map +1 -1
- package/dist/keys/set-exportability/0.1/payload.d.ts +560 -0
- package/dist/keys/set-exportability/0.1/payload.d.ts.map +1 -0
- package/dist/keys/set-exportability/0.1/payload.js +330 -0
- package/dist/keys/set-exportability/0.1/payload.js.map +1 -0
- package/dist/keys/show/0.1/payload.d.ts +20 -0
- package/dist/keys/show/0.1/payload.d.ts.map +1 -1
- package/dist/keys/show/0.1/payload.js +10 -0
- package/dist/keys/show/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +4 -0
- package/src/index.ts +1 -0
- package/src/keys/create/0.1/payload.ts +10 -0
- package/src/keys/import/0.1/payload.ts +10 -0
- package/src/keys/list/0.1/payload.ts +10 -0
- package/src/keys/set-exportability/0.1/payload.ts +371 -0
- package/src/keys/show/0.1/payload.ts +10 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/keys/set-exportability/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { Ext, KeyOrigin, KeyRecord, KeyStatus, KeyType } from "../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* Names one key and the exportability it should carry afterwards. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
|
|
8
|
+
*/
|
|
9
|
+
export interface KeysSetExportabilityPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The key whose exportability changes. Custodian-scoped, as everywhere in `keys/*`.
|
|
12
|
+
*/
|
|
13
|
+
keyId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The state the key should be in when this request succeeds — not a delta. `false` asks the custodian to refuse every future export of the key; `true` asks it to allow them again. Stated absolutely so a repeat of the same request is a no-op rather than a toggle: a producer that retried a lost reply must not discover it has undone itself.
|
|
16
|
+
*/
|
|
17
|
+
exportable: boolean;
|
|
18
|
+
ext?: Ext;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The success response: the key record as it now stands. Returning the whole record rather than an acknowledgement lets a producer confirm the state it asked for without a second round trip. Wrapped in `key` to match the rest of the family (`keys/show`, `keys/create`). Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/set-exportability/0.1#response.
|
|
22
|
+
*/
|
|
23
|
+
export interface KeysSetExportabilityResponsePayload {
|
|
24
|
+
/**
|
|
25
|
+
* The record the custodian now holds. Never null — a request naming a key the custodian does not hold is `keys:notFound`, not a successful answer with no record. This differs from `keys/show`, where 'no such key' is a legitimate success.
|
|
26
|
+
*/
|
|
27
|
+
key: KeyRecord;
|
|
28
|
+
}
|
|
29
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
30
|
+
export type { Ext, KeyOrigin, KeyRecord, KeyStatus, KeyType };
|
|
31
|
+
/** Trust Task type URI. */
|
|
32
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/keys/set-exportability/0.1";
|
|
33
|
+
/** Stable alias for this specification's request payload shape. */
|
|
34
|
+
export type Payload = KeysSetExportabilityPayload;
|
|
35
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
36
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/keys/set-exportability/0.1#response";
|
|
37
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
38
|
+
export type Response = KeysSetExportabilityResponsePayload;
|
|
39
|
+
/**
|
|
40
|
+
* This specification's payload schema, as a value.
|
|
41
|
+
*
|
|
42
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
43
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
44
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
45
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
46
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
47
|
+
*/
|
|
48
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
49
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
50
|
+
readonly $id: "https://trusttasks.org/spec/keys/set-exportability/0.1";
|
|
51
|
+
readonly title: "Keys Set Exportability — payload";
|
|
52
|
+
readonly description: "Names one key and the exportability it should carry afterwards. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
53
|
+
readonly type: "object";
|
|
54
|
+
readonly additionalProperties: false;
|
|
55
|
+
readonly required: readonly ["keyId", "exportable"];
|
|
56
|
+
readonly properties: {
|
|
57
|
+
readonly keyId: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly minLength: 1;
|
|
60
|
+
readonly description: "The key whose exportability changes. Custodian-scoped, as everywhere in `keys/*`.";
|
|
61
|
+
};
|
|
62
|
+
readonly exportable: {
|
|
63
|
+
readonly type: "boolean";
|
|
64
|
+
readonly description: "The state the key should be in when this request succeeds — not a delta. `false` asks the custodian to refuse every future export of the key; `true` asks it to allow them again. Stated absolutely so a repeat of the same request is a no-op rather than a toggle: a producer that retried a lost reply must not discover it has undone itself.";
|
|
65
|
+
};
|
|
66
|
+
readonly ext: {
|
|
67
|
+
readonly $ref: "#/$defs/Ext";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
readonly $defs: {
|
|
71
|
+
readonly Response: {
|
|
72
|
+
readonly $anchor: "response";
|
|
73
|
+
readonly title: "Keys Set Exportability — response payload";
|
|
74
|
+
readonly description: "The success response: the key record as it now stands. Returning the whole record rather than an acknowledgement lets a producer confirm the state it asked for without a second round trip. Wrapped in `key` to match the rest of the family (`keys/show`, `keys/create`). Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/set-exportability/0.1#response.";
|
|
75
|
+
readonly type: "object";
|
|
76
|
+
readonly additionalProperties: false;
|
|
77
|
+
readonly required: readonly ["key"];
|
|
78
|
+
readonly properties: {
|
|
79
|
+
readonly key: {
|
|
80
|
+
readonly description: "The record the custodian now holds. Never null — a request naming a key the custodian does not hold is `keys:notFound`, not a successful answer with no record. This differs from `keys/show`, where 'no such key' is a legitimate success.";
|
|
81
|
+
readonly $ref: "#/$defs/KeyRecord";
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
readonly KeyRecord: {
|
|
86
|
+
readonly title: "KeyRecord";
|
|
87
|
+
readonly type: "object";
|
|
88
|
+
readonly additionalProperties: false;
|
|
89
|
+
readonly required: readonly ["keyId", "keyType", "status", "publicKey", "createdAt"];
|
|
90
|
+
readonly properties: {
|
|
91
|
+
readonly keyId: {
|
|
92
|
+
readonly type: "string";
|
|
93
|
+
readonly minLength: 1;
|
|
94
|
+
readonly description: "Maintainer-scoped identifier for the key. Stable for the key's lifetime except through an explicit `keys/rename`.";
|
|
95
|
+
};
|
|
96
|
+
readonly keyType: {
|
|
97
|
+
readonly $ref: "#/$defs/KeyType";
|
|
98
|
+
};
|
|
99
|
+
readonly status: {
|
|
100
|
+
readonly $ref: "#/$defs/KeyStatus";
|
|
101
|
+
};
|
|
102
|
+
readonly publicKey: {
|
|
103
|
+
readonly type: "string";
|
|
104
|
+
readonly minLength: 1;
|
|
105
|
+
readonly description: "The public half, multibase-encoded. The private half is never carried by any keys/* response.";
|
|
106
|
+
};
|
|
107
|
+
readonly derivationPath: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly description: "Hierarchical-deterministic path the key was derived at, when `origin` is `derived`. Absent for imported keys, which have no path.";
|
|
110
|
+
};
|
|
111
|
+
readonly seedId: {
|
|
112
|
+
readonly type: "integer";
|
|
113
|
+
readonly minimum: 0;
|
|
114
|
+
readonly description: "Identifier of the seed the key was derived from, when the maintainer holds more than one. Absent for imported keys.";
|
|
115
|
+
};
|
|
116
|
+
readonly origin: {
|
|
117
|
+
readonly $ref: "#/$defs/KeyOrigin";
|
|
118
|
+
};
|
|
119
|
+
readonly label: {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
readonly maxLength: 256;
|
|
122
|
+
readonly description: "Optional human-readable label. Operator-facing only; carries no authorization meaning.";
|
|
123
|
+
};
|
|
124
|
+
readonly exportable: {
|
|
125
|
+
readonly type: "boolean";
|
|
126
|
+
readonly description: "Whether the private half may be released to a caller. `false` means the custodian refuses every export of this key and can only be asked to *use* it — signing, key agreement — so the material never leaves. **Absence means the key may be exported.** That is the permissive reading, and it is deliberate: it is what every record written before this member existed already meant, so a custodian adding the member cannot silently retract access to keys its callers already hold. A consumer MUST NOT infer the converse — absence is not a statement that export was considered and allowed. Marking a key non-exportable does not make it unrecoverable: a custodian's own whole-store backup is a different mechanism from an export to a caller, and this member does not speak to it.";
|
|
127
|
+
readonly $comment: "No JSON Schema `default` is declared here on purpose. A declared default is materialised by the generated bindings — the field becomes non-optional with a serde default — so an absent member reappears as an explicit `true` on re-serialisation, which breaks round-trip idempotence for every record written before this member existed. The permissive reading is stated in prose above, where a binding cannot act on it.";
|
|
128
|
+
};
|
|
129
|
+
readonly contextId: {
|
|
130
|
+
readonly type: "string";
|
|
131
|
+
readonly description: "Scope the key belongs to. **Absence is not 'every scope'** — a key with no context is reachable only by a caller with unrestricted authority over the maintainer, which is the more restrictive reading, and a consumer that treats absence as a wildcard inverts the guarantee.";
|
|
132
|
+
};
|
|
133
|
+
readonly createdAt: {
|
|
134
|
+
readonly type: "string";
|
|
135
|
+
readonly format: "date-time";
|
|
136
|
+
readonly description: "RFC 3339 timestamp at which the key was created or imported.";
|
|
137
|
+
};
|
|
138
|
+
readonly updatedAt: {
|
|
139
|
+
readonly type: "string";
|
|
140
|
+
readonly format: "date-time";
|
|
141
|
+
readonly description: "RFC 3339 timestamp of the last change to the record (rename, revocation).";
|
|
142
|
+
};
|
|
143
|
+
readonly ext: {
|
|
144
|
+
readonly $ref: "#/$defs/Ext";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly KeyOrigin: {
|
|
149
|
+
readonly title: "KeyOrigin";
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
152
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
153
|
+
readonly default: "derived";
|
|
154
|
+
};
|
|
155
|
+
readonly KeyStatus: {
|
|
156
|
+
readonly title: "KeyStatus";
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
readonly enum: readonly ["active", "revoked"];
|
|
159
|
+
readonly description: "Lifecycle state. Only an `active` key may be named in a signing request; a `revoked` key is retained so historic signatures remain attributable, and MUST NOT be reactivated.";
|
|
160
|
+
};
|
|
161
|
+
readonly KeyType: {
|
|
162
|
+
readonly title: "KeyType";
|
|
163
|
+
readonly type: "string";
|
|
164
|
+
readonly enum: readonly ["ed25519", "x25519", "p256"];
|
|
165
|
+
readonly description: "Cryptographic algorithm the key material belongs to. `ed25519` signs (EdDSA), `x25519` performs key agreement and never signs, `p256` signs (ES256).";
|
|
166
|
+
};
|
|
167
|
+
readonly Ext: {
|
|
168
|
+
readonly title: "Ext";
|
|
169
|
+
readonly 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.";
|
|
170
|
+
readonly type: "object";
|
|
171
|
+
readonly minProperties: 1;
|
|
172
|
+
readonly additionalProperties: true;
|
|
173
|
+
readonly propertyNames: {
|
|
174
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
180
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
181
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
182
|
+
readonly $ref: "#/$defs/Response";
|
|
183
|
+
readonly $defs: {
|
|
184
|
+
readonly Response: {
|
|
185
|
+
readonly $anchor: "response";
|
|
186
|
+
readonly title: "Keys Set Exportability — response payload";
|
|
187
|
+
readonly description: "The success response: the key record as it now stands. Returning the whole record rather than an acknowledgement lets a producer confirm the state it asked for without a second round trip. Wrapped in `key` to match the rest of the family (`keys/show`, `keys/create`). Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/set-exportability/0.1#response.";
|
|
188
|
+
readonly type: "object";
|
|
189
|
+
readonly additionalProperties: false;
|
|
190
|
+
readonly required: readonly ["key"];
|
|
191
|
+
readonly properties: {
|
|
192
|
+
readonly key: {
|
|
193
|
+
readonly description: "The record the custodian now holds. Never null — a request naming a key the custodian does not hold is `keys:notFound`, not a successful answer with no record. This differs from `keys/show`, where 'no such key' is a legitimate success.";
|
|
194
|
+
readonly $ref: "#/$defs/KeyRecord";
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
readonly KeyRecord: {
|
|
199
|
+
readonly title: "KeyRecord";
|
|
200
|
+
readonly type: "object";
|
|
201
|
+
readonly additionalProperties: false;
|
|
202
|
+
readonly required: readonly ["keyId", "keyType", "status", "publicKey", "createdAt"];
|
|
203
|
+
readonly properties: {
|
|
204
|
+
readonly keyId: {
|
|
205
|
+
readonly type: "string";
|
|
206
|
+
readonly minLength: 1;
|
|
207
|
+
readonly description: "Maintainer-scoped identifier for the key. Stable for the key's lifetime except through an explicit `keys/rename`.";
|
|
208
|
+
};
|
|
209
|
+
readonly keyType: {
|
|
210
|
+
readonly $ref: "#/$defs/KeyType";
|
|
211
|
+
};
|
|
212
|
+
readonly status: {
|
|
213
|
+
readonly $ref: "#/$defs/KeyStatus";
|
|
214
|
+
};
|
|
215
|
+
readonly publicKey: {
|
|
216
|
+
readonly type: "string";
|
|
217
|
+
readonly minLength: 1;
|
|
218
|
+
readonly description: "The public half, multibase-encoded. The private half is never carried by any keys/* response.";
|
|
219
|
+
};
|
|
220
|
+
readonly derivationPath: {
|
|
221
|
+
readonly type: "string";
|
|
222
|
+
readonly description: "Hierarchical-deterministic path the key was derived at, when `origin` is `derived`. Absent for imported keys, which have no path.";
|
|
223
|
+
};
|
|
224
|
+
readonly seedId: {
|
|
225
|
+
readonly type: "integer";
|
|
226
|
+
readonly minimum: 0;
|
|
227
|
+
readonly description: "Identifier of the seed the key was derived from, when the maintainer holds more than one. Absent for imported keys.";
|
|
228
|
+
};
|
|
229
|
+
readonly origin: {
|
|
230
|
+
readonly $ref: "#/$defs/KeyOrigin";
|
|
231
|
+
};
|
|
232
|
+
readonly label: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
readonly maxLength: 256;
|
|
235
|
+
readonly description: "Optional human-readable label. Operator-facing only; carries no authorization meaning.";
|
|
236
|
+
};
|
|
237
|
+
readonly exportable: {
|
|
238
|
+
readonly type: "boolean";
|
|
239
|
+
readonly description: "Whether the private half may be released to a caller. `false` means the custodian refuses every export of this key and can only be asked to *use* it — signing, key agreement — so the material never leaves. **Absence means the key may be exported.** That is the permissive reading, and it is deliberate: it is what every record written before this member existed already meant, so a custodian adding the member cannot silently retract access to keys its callers already hold. A consumer MUST NOT infer the converse — absence is not a statement that export was considered and allowed. Marking a key non-exportable does not make it unrecoverable: a custodian's own whole-store backup is a different mechanism from an export to a caller, and this member does not speak to it.";
|
|
240
|
+
readonly $comment: "No JSON Schema `default` is declared here on purpose. A declared default is materialised by the generated bindings — the field becomes non-optional with a serde default — so an absent member reappears as an explicit `true` on re-serialisation, which breaks round-trip idempotence for every record written before this member existed. The permissive reading is stated in prose above, where a binding cannot act on it.";
|
|
241
|
+
};
|
|
242
|
+
readonly contextId: {
|
|
243
|
+
readonly type: "string";
|
|
244
|
+
readonly description: "Scope the key belongs to. **Absence is not 'every scope'** — a key with no context is reachable only by a caller with unrestricted authority over the maintainer, which is the more restrictive reading, and a consumer that treats absence as a wildcard inverts the guarantee.";
|
|
245
|
+
};
|
|
246
|
+
readonly createdAt: {
|
|
247
|
+
readonly type: "string";
|
|
248
|
+
readonly format: "date-time";
|
|
249
|
+
readonly description: "RFC 3339 timestamp at which the key was created or imported.";
|
|
250
|
+
};
|
|
251
|
+
readonly updatedAt: {
|
|
252
|
+
readonly type: "string";
|
|
253
|
+
readonly format: "date-time";
|
|
254
|
+
readonly description: "RFC 3339 timestamp of the last change to the record (rename, revocation).";
|
|
255
|
+
};
|
|
256
|
+
readonly ext: {
|
|
257
|
+
readonly $ref: "#/$defs/Ext";
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
readonly KeyOrigin: {
|
|
262
|
+
readonly title: "KeyOrigin";
|
|
263
|
+
readonly type: "string";
|
|
264
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
265
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
266
|
+
readonly default: "derived";
|
|
267
|
+
};
|
|
268
|
+
readonly KeyStatus: {
|
|
269
|
+
readonly title: "KeyStatus";
|
|
270
|
+
readonly type: "string";
|
|
271
|
+
readonly enum: readonly ["active", "revoked"];
|
|
272
|
+
readonly description: "Lifecycle state. Only an `active` key may be named in a signing request; a `revoked` key is retained so historic signatures remain attributable, and MUST NOT be reactivated.";
|
|
273
|
+
};
|
|
274
|
+
readonly KeyType: {
|
|
275
|
+
readonly title: "KeyType";
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
readonly enum: readonly ["ed25519", "x25519", "p256"];
|
|
278
|
+
readonly description: "Cryptographic algorithm the key material belongs to. `ed25519` signs (EdDSA), `x25519` performs key agreement and never signs, `p256` signs (ES256).";
|
|
279
|
+
};
|
|
280
|
+
readonly Ext: {
|
|
281
|
+
readonly title: "Ext";
|
|
282
|
+
readonly 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.";
|
|
283
|
+
readonly type: "object";
|
|
284
|
+
readonly minProperties: 1;
|
|
285
|
+
readonly additionalProperties: true;
|
|
286
|
+
readonly propertyNames: {
|
|
287
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
294
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
295
|
+
* per-specification and cannot be derived from the document alone, and
|
|
296
|
+
* item 2 needs the schema this carries.
|
|
297
|
+
*/
|
|
298
|
+
export declare const SPEC: {
|
|
299
|
+
readonly typeUri: "https://trusttasks.org/spec/keys/set-exportability/0.1";
|
|
300
|
+
readonly isBearer: false;
|
|
301
|
+
readonly isProofRequired: true;
|
|
302
|
+
readonly isRecipientRequired: true;
|
|
303
|
+
readonly isIssuedAtRequired: true;
|
|
304
|
+
readonly payloadSchema: {
|
|
305
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
306
|
+
readonly $id: "https://trusttasks.org/spec/keys/set-exportability/0.1";
|
|
307
|
+
readonly title: "Keys Set Exportability — payload";
|
|
308
|
+
readonly description: "Names one key and the exportability it should carry afterwards. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.";
|
|
309
|
+
readonly type: "object";
|
|
310
|
+
readonly additionalProperties: false;
|
|
311
|
+
readonly required: readonly ["keyId", "exportable"];
|
|
312
|
+
readonly properties: {
|
|
313
|
+
readonly keyId: {
|
|
314
|
+
readonly type: "string";
|
|
315
|
+
readonly minLength: 1;
|
|
316
|
+
readonly description: "The key whose exportability changes. Custodian-scoped, as everywhere in `keys/*`.";
|
|
317
|
+
};
|
|
318
|
+
readonly exportable: {
|
|
319
|
+
readonly type: "boolean";
|
|
320
|
+
readonly description: "The state the key should be in when this request succeeds — not a delta. `false` asks the custodian to refuse every future export of the key; `true` asks it to allow them again. Stated absolutely so a repeat of the same request is a no-op rather than a toggle: a producer that retried a lost reply must not discover it has undone itself.";
|
|
321
|
+
};
|
|
322
|
+
readonly ext: {
|
|
323
|
+
readonly $ref: "#/$defs/Ext";
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
readonly $defs: {
|
|
327
|
+
readonly Response: {
|
|
328
|
+
readonly $anchor: "response";
|
|
329
|
+
readonly title: "Keys Set Exportability — response payload";
|
|
330
|
+
readonly description: "The success response: the key record as it now stands. Returning the whole record rather than an acknowledgement lets a producer confirm the state it asked for without a second round trip. Wrapped in `key` to match the rest of the family (`keys/show`, `keys/create`). Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/set-exportability/0.1#response.";
|
|
331
|
+
readonly type: "object";
|
|
332
|
+
readonly additionalProperties: false;
|
|
333
|
+
readonly required: readonly ["key"];
|
|
334
|
+
readonly properties: {
|
|
335
|
+
readonly key: {
|
|
336
|
+
readonly description: "The record the custodian now holds. Never null — a request naming a key the custodian does not hold is `keys:notFound`, not a successful answer with no record. This differs from `keys/show`, where 'no such key' is a legitimate success.";
|
|
337
|
+
readonly $ref: "#/$defs/KeyRecord";
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
readonly KeyRecord: {
|
|
342
|
+
readonly title: "KeyRecord";
|
|
343
|
+
readonly type: "object";
|
|
344
|
+
readonly additionalProperties: false;
|
|
345
|
+
readonly required: readonly ["keyId", "keyType", "status", "publicKey", "createdAt"];
|
|
346
|
+
readonly properties: {
|
|
347
|
+
readonly keyId: {
|
|
348
|
+
readonly type: "string";
|
|
349
|
+
readonly minLength: 1;
|
|
350
|
+
readonly description: "Maintainer-scoped identifier for the key. Stable for the key's lifetime except through an explicit `keys/rename`.";
|
|
351
|
+
};
|
|
352
|
+
readonly keyType: {
|
|
353
|
+
readonly $ref: "#/$defs/KeyType";
|
|
354
|
+
};
|
|
355
|
+
readonly status: {
|
|
356
|
+
readonly $ref: "#/$defs/KeyStatus";
|
|
357
|
+
};
|
|
358
|
+
readonly publicKey: {
|
|
359
|
+
readonly type: "string";
|
|
360
|
+
readonly minLength: 1;
|
|
361
|
+
readonly description: "The public half, multibase-encoded. The private half is never carried by any keys/* response.";
|
|
362
|
+
};
|
|
363
|
+
readonly derivationPath: {
|
|
364
|
+
readonly type: "string";
|
|
365
|
+
readonly description: "Hierarchical-deterministic path the key was derived at, when `origin` is `derived`. Absent for imported keys, which have no path.";
|
|
366
|
+
};
|
|
367
|
+
readonly seedId: {
|
|
368
|
+
readonly type: "integer";
|
|
369
|
+
readonly minimum: 0;
|
|
370
|
+
readonly description: "Identifier of the seed the key was derived from, when the maintainer holds more than one. Absent for imported keys.";
|
|
371
|
+
};
|
|
372
|
+
readonly origin: {
|
|
373
|
+
readonly $ref: "#/$defs/KeyOrigin";
|
|
374
|
+
};
|
|
375
|
+
readonly label: {
|
|
376
|
+
readonly type: "string";
|
|
377
|
+
readonly maxLength: 256;
|
|
378
|
+
readonly description: "Optional human-readable label. Operator-facing only; carries no authorization meaning.";
|
|
379
|
+
};
|
|
380
|
+
readonly exportable: {
|
|
381
|
+
readonly type: "boolean";
|
|
382
|
+
readonly description: "Whether the private half may be released to a caller. `false` means the custodian refuses every export of this key and can only be asked to *use* it — signing, key agreement — so the material never leaves. **Absence means the key may be exported.** That is the permissive reading, and it is deliberate: it is what every record written before this member existed already meant, so a custodian adding the member cannot silently retract access to keys its callers already hold. A consumer MUST NOT infer the converse — absence is not a statement that export was considered and allowed. Marking a key non-exportable does not make it unrecoverable: a custodian's own whole-store backup is a different mechanism from an export to a caller, and this member does not speak to it.";
|
|
383
|
+
readonly $comment: "No JSON Schema `default` is declared here on purpose. A declared default is materialised by the generated bindings — the field becomes non-optional with a serde default — so an absent member reappears as an explicit `true` on re-serialisation, which breaks round-trip idempotence for every record written before this member existed. The permissive reading is stated in prose above, where a binding cannot act on it.";
|
|
384
|
+
};
|
|
385
|
+
readonly contextId: {
|
|
386
|
+
readonly type: "string";
|
|
387
|
+
readonly description: "Scope the key belongs to. **Absence is not 'every scope'** — a key with no context is reachable only by a caller with unrestricted authority over the maintainer, which is the more restrictive reading, and a consumer that treats absence as a wildcard inverts the guarantee.";
|
|
388
|
+
};
|
|
389
|
+
readonly createdAt: {
|
|
390
|
+
readonly type: "string";
|
|
391
|
+
readonly format: "date-time";
|
|
392
|
+
readonly description: "RFC 3339 timestamp at which the key was created or imported.";
|
|
393
|
+
};
|
|
394
|
+
readonly updatedAt: {
|
|
395
|
+
readonly type: "string";
|
|
396
|
+
readonly format: "date-time";
|
|
397
|
+
readonly description: "RFC 3339 timestamp of the last change to the record (rename, revocation).";
|
|
398
|
+
};
|
|
399
|
+
readonly ext: {
|
|
400
|
+
readonly $ref: "#/$defs/Ext";
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
readonly KeyOrigin: {
|
|
405
|
+
readonly title: "KeyOrigin";
|
|
406
|
+
readonly type: "string";
|
|
407
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
408
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
409
|
+
readonly default: "derived";
|
|
410
|
+
};
|
|
411
|
+
readonly KeyStatus: {
|
|
412
|
+
readonly title: "KeyStatus";
|
|
413
|
+
readonly type: "string";
|
|
414
|
+
readonly enum: readonly ["active", "revoked"];
|
|
415
|
+
readonly description: "Lifecycle state. Only an `active` key may be named in a signing request; a `revoked` key is retained so historic signatures remain attributable, and MUST NOT be reactivated.";
|
|
416
|
+
};
|
|
417
|
+
readonly KeyType: {
|
|
418
|
+
readonly title: "KeyType";
|
|
419
|
+
readonly type: "string";
|
|
420
|
+
readonly enum: readonly ["ed25519", "x25519", "p256"];
|
|
421
|
+
readonly description: "Cryptographic algorithm the key material belongs to. `ed25519` signs (EdDSA), `x25519` performs key agreement and never signs, `p256` signs (ES256).";
|
|
422
|
+
};
|
|
423
|
+
readonly Ext: {
|
|
424
|
+
readonly title: "Ext";
|
|
425
|
+
readonly 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.";
|
|
426
|
+
readonly type: "object";
|
|
427
|
+
readonly minProperties: 1;
|
|
428
|
+
readonly additionalProperties: true;
|
|
429
|
+
readonly propertyNames: {
|
|
430
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
438
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
439
|
+
* parties (§7.3 item 5).
|
|
440
|
+
*/
|
|
441
|
+
export declare const RESPONSE_SPEC: {
|
|
442
|
+
readonly typeUri: "https://trusttasks.org/spec/keys/set-exportability/0.1#response";
|
|
443
|
+
readonly isBearer: false;
|
|
444
|
+
readonly isProofRequired: true;
|
|
445
|
+
readonly isRecipientRequired: true;
|
|
446
|
+
readonly isIssuedAtRequired: true;
|
|
447
|
+
readonly payloadSchema: {
|
|
448
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
449
|
+
readonly $ref: "#/$defs/Response";
|
|
450
|
+
readonly $defs: {
|
|
451
|
+
readonly Response: {
|
|
452
|
+
readonly $anchor: "response";
|
|
453
|
+
readonly title: "Keys Set Exportability — response payload";
|
|
454
|
+
readonly description: "The success response: the key record as it now stands. Returning the whole record rather than an acknowledgement lets a producer confirm the state it asked for without a second round trip. Wrapped in `key` to match the rest of the family (`keys/show`, `keys/create`). Carried in a Trust Task document whose type is https://trusttasks.org/spec/keys/set-exportability/0.1#response.";
|
|
455
|
+
readonly type: "object";
|
|
456
|
+
readonly additionalProperties: false;
|
|
457
|
+
readonly required: readonly ["key"];
|
|
458
|
+
readonly properties: {
|
|
459
|
+
readonly key: {
|
|
460
|
+
readonly description: "The record the custodian now holds. Never null — a request naming a key the custodian does not hold is `keys:notFound`, not a successful answer with no record. This differs from `keys/show`, where 'no such key' is a legitimate success.";
|
|
461
|
+
readonly $ref: "#/$defs/KeyRecord";
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
readonly KeyRecord: {
|
|
466
|
+
readonly title: "KeyRecord";
|
|
467
|
+
readonly type: "object";
|
|
468
|
+
readonly additionalProperties: false;
|
|
469
|
+
readonly required: readonly ["keyId", "keyType", "status", "publicKey", "createdAt"];
|
|
470
|
+
readonly properties: {
|
|
471
|
+
readonly keyId: {
|
|
472
|
+
readonly type: "string";
|
|
473
|
+
readonly minLength: 1;
|
|
474
|
+
readonly description: "Maintainer-scoped identifier for the key. Stable for the key's lifetime except through an explicit `keys/rename`.";
|
|
475
|
+
};
|
|
476
|
+
readonly keyType: {
|
|
477
|
+
readonly $ref: "#/$defs/KeyType";
|
|
478
|
+
};
|
|
479
|
+
readonly status: {
|
|
480
|
+
readonly $ref: "#/$defs/KeyStatus";
|
|
481
|
+
};
|
|
482
|
+
readonly publicKey: {
|
|
483
|
+
readonly type: "string";
|
|
484
|
+
readonly minLength: 1;
|
|
485
|
+
readonly description: "The public half, multibase-encoded. The private half is never carried by any keys/* response.";
|
|
486
|
+
};
|
|
487
|
+
readonly derivationPath: {
|
|
488
|
+
readonly type: "string";
|
|
489
|
+
readonly description: "Hierarchical-deterministic path the key was derived at, when `origin` is `derived`. Absent for imported keys, which have no path.";
|
|
490
|
+
};
|
|
491
|
+
readonly seedId: {
|
|
492
|
+
readonly type: "integer";
|
|
493
|
+
readonly minimum: 0;
|
|
494
|
+
readonly description: "Identifier of the seed the key was derived from, when the maintainer holds more than one. Absent for imported keys.";
|
|
495
|
+
};
|
|
496
|
+
readonly origin: {
|
|
497
|
+
readonly $ref: "#/$defs/KeyOrigin";
|
|
498
|
+
};
|
|
499
|
+
readonly label: {
|
|
500
|
+
readonly type: "string";
|
|
501
|
+
readonly maxLength: 256;
|
|
502
|
+
readonly description: "Optional human-readable label. Operator-facing only; carries no authorization meaning.";
|
|
503
|
+
};
|
|
504
|
+
readonly exportable: {
|
|
505
|
+
readonly type: "boolean";
|
|
506
|
+
readonly description: "Whether the private half may be released to a caller. `false` means the custodian refuses every export of this key and can only be asked to *use* it — signing, key agreement — so the material never leaves. **Absence means the key may be exported.** That is the permissive reading, and it is deliberate: it is what every record written before this member existed already meant, so a custodian adding the member cannot silently retract access to keys its callers already hold. A consumer MUST NOT infer the converse — absence is not a statement that export was considered and allowed. Marking a key non-exportable does not make it unrecoverable: a custodian's own whole-store backup is a different mechanism from an export to a caller, and this member does not speak to it.";
|
|
507
|
+
readonly $comment: "No JSON Schema `default` is declared here on purpose. A declared default is materialised by the generated bindings — the field becomes non-optional with a serde default — so an absent member reappears as an explicit `true` on re-serialisation, which breaks round-trip idempotence for every record written before this member existed. The permissive reading is stated in prose above, where a binding cannot act on it.";
|
|
508
|
+
};
|
|
509
|
+
readonly contextId: {
|
|
510
|
+
readonly type: "string";
|
|
511
|
+
readonly description: "Scope the key belongs to. **Absence is not 'every scope'** — a key with no context is reachable only by a caller with unrestricted authority over the maintainer, which is the more restrictive reading, and a consumer that treats absence as a wildcard inverts the guarantee.";
|
|
512
|
+
};
|
|
513
|
+
readonly createdAt: {
|
|
514
|
+
readonly type: "string";
|
|
515
|
+
readonly format: "date-time";
|
|
516
|
+
readonly description: "RFC 3339 timestamp at which the key was created or imported.";
|
|
517
|
+
};
|
|
518
|
+
readonly updatedAt: {
|
|
519
|
+
readonly type: "string";
|
|
520
|
+
readonly format: "date-time";
|
|
521
|
+
readonly description: "RFC 3339 timestamp of the last change to the record (rename, revocation).";
|
|
522
|
+
};
|
|
523
|
+
readonly ext: {
|
|
524
|
+
readonly $ref: "#/$defs/Ext";
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
};
|
|
528
|
+
readonly KeyOrigin: {
|
|
529
|
+
readonly title: "KeyOrigin";
|
|
530
|
+
readonly type: "string";
|
|
531
|
+
readonly enum: readonly ["derived", "imported", "internal"];
|
|
532
|
+
readonly description: "Where the private key came from. `derived` means the maintainer generated it from a seed it holds and can reproduce it from `derivationPath`; `imported` means it arrived from outside and exists only as stored material; `internal` means the maintainer generated it from a CSPRNG and it is reproducible from nothing at all. The distinction is operationally load-bearing: a `derived` key survives a seed restore, an `imported` one is lost unless it was backed up separately, and an `internal` one cannot be recovered by any means once the maintainer's storage is gone. This member is also the only way a consumer can confirm that a `keys/create` request for an `internal` key was honoured rather than silently downgraded to a derived one — see that specification's `internal` member.";
|
|
533
|
+
readonly default: "derived";
|
|
534
|
+
};
|
|
535
|
+
readonly KeyStatus: {
|
|
536
|
+
readonly title: "KeyStatus";
|
|
537
|
+
readonly type: "string";
|
|
538
|
+
readonly enum: readonly ["active", "revoked"];
|
|
539
|
+
readonly description: "Lifecycle state. Only an `active` key may be named in a signing request; a `revoked` key is retained so historic signatures remain attributable, and MUST NOT be reactivated.";
|
|
540
|
+
};
|
|
541
|
+
readonly KeyType: {
|
|
542
|
+
readonly title: "KeyType";
|
|
543
|
+
readonly type: "string";
|
|
544
|
+
readonly enum: readonly ["ed25519", "x25519", "p256"];
|
|
545
|
+
readonly description: "Cryptographic algorithm the key material belongs to. `ed25519` signs (EdDSA), `x25519` performs key agreement and never signs, `p256` signs (ES256).";
|
|
546
|
+
};
|
|
547
|
+
readonly Ext: {
|
|
548
|
+
readonly title: "Ext";
|
|
549
|
+
readonly 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
|
+
readonly type: "object";
|
|
551
|
+
readonly minProperties: 1;
|
|
552
|
+
readonly additionalProperties: true;
|
|
553
|
+
readonly propertyNames: {
|
|
554
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../src/keys/set-exportability/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAGpG;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,kHAAkH;AAClH,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAE9D,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,wDAAiE,CAAC;AAE1F,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAElD,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,iEAA0E,CAAC;AAE5G,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,mCAAmC,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwJjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkI1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhB,CAAC"}
|