@openvtc/trust-tasks 0.16.6 → 0.16.8
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 +20 -2
- package/dist/_shared/components.d.ts +75 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/rooms/_shared/0.1/room.d.ts +16 -0
- package/dist/rooms/_shared/0.1/room.d.ts.map +1 -0
- package/dist/rooms/_shared/0.1/room.js +6 -0
- package/dist/rooms/_shared/0.1/room.js.map +1 -0
- package/dist/rooms/create/0.1/payload.d.ts +305 -0
- package/dist/rooms/create/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/create/0.1/payload.js +176 -0
- package/dist/rooms/create/0.1/payload.js.map +1 -0
- package/dist/rooms/epoch/mint/0.1/payload.d.ts +385 -0
- package/dist/rooms/epoch/mint/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/epoch/mint/0.1/payload.js +214 -0
- package/dist/rooms/epoch/mint/0.1/payload.js.map +1 -0
- package/dist/rooms/keys/open/0.1/payload.d.ts +323 -0
- package/dist/rooms/keys/open/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/keys/open/0.1/payload.js +171 -0
- package/dist/rooms/keys/open/0.1/payload.js.map +1 -0
- package/dist/rooms/keys/present/0.1/payload.d.ts +306 -0
- package/dist/rooms/keys/present/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/keys/present/0.1/payload.js +165 -0
- package/dist/rooms/keys/present/0.1/payload.js.map +1 -0
- package/dist/rooms/records/get/0.1/payload.d.ts +505 -0
- package/dist/rooms/records/get/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/records/get/0.1/payload.js +279 -0
- package/dist/rooms/records/get/0.1/payload.js.map +1 -0
- package/dist/rooms/records/list/0.1/payload.d.ts +618 -0
- package/dist/rooms/records/list/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/records/list/0.1/payload.js +338 -0
- package/dist/rooms/records/list/0.1/payload.js.map +1 -0
- package/dist/rooms/records/put/0.1/payload.d.ts +591 -0
- package/dist/rooms/records/put/0.1/payload.d.ts.map +1 -0
- package/dist/rooms/records/put/0.1/payload.js +314 -0
- package/dist/rooms/records/put/0.1/payload.js.map +1 -0
- package/dist/vta/backup/abort/1.0/payload.d.ts +262 -0
- package/dist/vta/backup/abort/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/abort/1.0/payload.js +146 -0
- package/dist/vta/backup/abort/1.0/payload.js.map +1 -0
- package/dist/vta/backup/complete-export/1.0/payload.d.ts +262 -0
- package/dist/vta/backup/complete-export/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/complete-export/1.0/payload.js +146 -0
- package/dist/vta/backup/complete-export/1.0/payload.js.map +1 -0
- package/dist/vta/backup/finalize-import/1.0/payload.d.ts +477 -0
- package/dist/vta/backup/finalize-import/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/finalize-import/1.0/payload.js +249 -0
- package/dist/vta/backup/finalize-import/1.0/payload.js.map +1 -0
- package/dist/vta/backup/initiate-export/1.0/payload.d.ts +514 -0
- package/dist/vta/backup/initiate-export/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/initiate-export/1.0/payload.js +267 -0
- package/dist/vta/backup/initiate-export/1.0/payload.js.map +1 -0
- package/dist/vta/backup/initiate-import/1.0/payload.d.ts +510 -0
- package/dist/vta/backup/initiate-import/1.0/payload.d.ts.map +1 -0
- package/dist/vta/backup/initiate-import/1.0/payload.js +266 -0
- package/dist/vta/backup/initiate-import/1.0/payload.js.map +1 -0
- package/dist/vta/management/reload-services/1.0/payload.d.ts +230 -0
- package/dist/vta/management/reload-services/1.0/payload.d.ts.map +1 -0
- package/dist/vta/management/reload-services/1.0/payload.js +130 -0
- package/dist/vta/management/reload-services/1.0/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +83 -0
- package/src/index.ts +14 -0
- package/src/rooms/_shared/0.1/room.ts +17 -0
- package/src/rooms/create/0.1/payload.ts +224 -0
- package/src/rooms/epoch/mint/0.1/payload.ts +262 -0
- package/src/rooms/keys/open/0.1/payload.ts +237 -0
- package/src/rooms/keys/present/0.1/payload.ts +224 -0
- package/src/rooms/records/get/0.1/payload.ts +333 -0
- package/src/rooms/records/list/0.1/payload.ts +397 -0
- package/src/rooms/records/put/0.1/payload.ts +388 -0
- package/src/vta/backup/abort/1.0/payload.ts +191 -0
- package/src/vta/backup/complete-export/1.0/payload.ts +191 -0
- package/src/vta/backup/finalize-import/1.0/payload.ts +333 -0
- package/src/vta/backup/initiate-export/1.0/payload.ts +350 -0
- package/src/vta/backup/initiate-import/1.0/payload.ts +349 -0
- package/src/vta/management/reload-services/1.0/payload.ts +167 -0
package/package.json
CHANGED
|
@@ -260,6 +260,10 @@ export type Version = number;
|
|
|
260
260
|
* A Verifiable Identifier (SPEC §4.8). For a mediator-served account this is the account's controlling DID, carried verbatim and compared by exact string equality. For privacy — and because some mediators key accounts by a one-way hash and never hold the full DID — a stable hash of the DID (e.g. its SHA-256 digest) is an equally valid value here: producer and consumer simply agree on the same opaque identifier and compare by exact string equality. The field carries whichever form the issuing mediator uses.
|
|
261
261
|
*/
|
|
262
262
|
export type Vid = string;
|
|
263
|
+
/**
|
|
264
|
+
* How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything.
|
|
265
|
+
*/
|
|
266
|
+
export type Visibility = "open" | "attributed" | "private";
|
|
263
267
|
|
|
264
268
|
/**
|
|
265
269
|
* The mediator's view of one served account.
|
|
@@ -629,6 +633,34 @@ export interface AuthenticatorAttestationResponseRegistration {
|
|
|
629
633
|
authenticatorAttachment?: "platform" | "cross-platform";
|
|
630
634
|
clientExtensionResults?: {};
|
|
631
635
|
}
|
|
636
|
+
/**
|
|
637
|
+
* What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.
|
|
638
|
+
*/
|
|
639
|
+
export interface AuthorityPresentation {
|
|
640
|
+
/**
|
|
641
|
+
* The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile.
|
|
642
|
+
*/
|
|
643
|
+
membership: string;
|
|
644
|
+
/**
|
|
645
|
+
* The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent.
|
|
646
|
+
*
|
|
647
|
+
* @minItems 1
|
|
648
|
+
* @maxItems 8
|
|
649
|
+
*/
|
|
650
|
+
authority:
|
|
651
|
+
| [string]
|
|
652
|
+
| [string, string]
|
|
653
|
+
| [string, string, string]
|
|
654
|
+
| [string, string, string, string]
|
|
655
|
+
| [string, string, string, string, string]
|
|
656
|
+
| [string, string, string, string, string, string]
|
|
657
|
+
| [string, string, string, string, string, string, string]
|
|
658
|
+
| [string, string, string, string, string, string, string, string];
|
|
659
|
+
/**
|
|
660
|
+
* REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this.
|
|
661
|
+
*/
|
|
662
|
+
subjectBinding?: string;
|
|
663
|
+
}
|
|
632
664
|
/**
|
|
633
665
|
* Unencrypted metadata plus the encrypted payload. The KDF and cipher parameters travel in the clear so a reader can decrypt without knowing this specification's defaults.
|
|
634
666
|
*/
|
|
@@ -2327,6 +2359,40 @@ export interface QueueLimits {
|
|
|
2327
2359
|
*/
|
|
2328
2360
|
receiveQueueLimit?: number;
|
|
2329
2361
|
}
|
|
2362
|
+
/**
|
|
2363
|
+
* What `rooms/records/list` returns. Never the body: ranking happens on the client, and a host that returned every body would make the caller pay for the whole room on every listing.
|
|
2364
|
+
*/
|
|
2365
|
+
export interface RecordMetadata {
|
|
2366
|
+
/**
|
|
2367
|
+
* The record's key within the room. On `attributed` and `private` rooms this MUST be opaque — a random identifier, never a descriptive slug. A key reading `decision/acquire-northwind` defeats the encryption sitting beside it; structured naming belongs inside the sealed body.
|
|
2368
|
+
*/
|
|
2369
|
+
key: string;
|
|
2370
|
+
/**
|
|
2371
|
+
* Server-assigned, monotonic per room.
|
|
2372
|
+
*/
|
|
2373
|
+
version: number;
|
|
2374
|
+
/**
|
|
2375
|
+
* The epoch the record was sealed under. Absent on an `open` room.
|
|
2376
|
+
*/
|
|
2377
|
+
epoch?: number;
|
|
2378
|
+
/**
|
|
2379
|
+
* Curation state. `retracted` is a tombstone: the body is gone, the key and version remain so incremental sync converges and the audit chain stays intact.
|
|
2380
|
+
*/
|
|
2381
|
+
status?: "active" | "deprecated" | "retracted";
|
|
2382
|
+
updatedAt: string;
|
|
2383
|
+
/**
|
|
2384
|
+
* Present only on an `open` room; sealed with the body otherwise.
|
|
2385
|
+
*/
|
|
2386
|
+
title?: string;
|
|
2387
|
+
/**
|
|
2388
|
+
* Present only on an `open` room; sealed with the body otherwise.
|
|
2389
|
+
*/
|
|
2390
|
+
description?: string;
|
|
2391
|
+
/**
|
|
2392
|
+
* The member who wrote it. Present on `open` and `attributed`; on `private` the author is inside the sealed body, where only members can read it.
|
|
2393
|
+
*/
|
|
2394
|
+
author?: string;
|
|
2395
|
+
}
|
|
2330
2396
|
/**
|
|
2331
2397
|
* A passkey already bound to a subject, as listed by `auth/passkey/list` and targeted by `auth/passkey/revoke/*`. This is the auth service's own management view of a credential — not a WebAuthn dictionary — so its members are camelCase per SPEC.md §4.10. The exception is `transports`, whose values are the externally-owned WebAuthn transport tokens and are carried verbatim.
|
|
2332
2398
|
*/
|
|
@@ -2435,6 +2501,23 @@ export interface Context_VtaV0_1 {
|
|
|
2435
2501
|
type: "context";
|
|
2436
2502
|
contextId: string;
|
|
2437
2503
|
}
|
|
2504
|
+
/**
|
|
2505
|
+
* A record as a host stores it on an `attributed` or `private` room. Title, description, body, author and tags are sealed together in one blob rather than separately: splitting them would let a host learn the shape of the material from ciphertext lengths, for no benefit, since a reader decrypts the whole record either way.
|
|
2506
|
+
*/
|
|
2507
|
+
export interface SealedRecord {
|
|
2508
|
+
/**
|
|
2509
|
+
* The sealed record, base64url. Bound by AEAD associated data to `roomId`, `key`, `version` and `epoch`, so a host that relocates it to another key, version, epoch or room produces a mismatch and the open fails. The record cannot be moved undetected even though the host holds every byte of it.
|
|
2510
|
+
*/
|
|
2511
|
+
ciphertext: string;
|
|
2512
|
+
/**
|
|
2513
|
+
* AEAD nonce, base64url.
|
|
2514
|
+
*/
|
|
2515
|
+
nonce: string;
|
|
2516
|
+
/**
|
|
2517
|
+
* The key epoch this record was sealed under. Cleartext because the host must serve the right ciphertext, and bound into the associated data so that relabelling it fails authentication rather than causing a reader to try the wrong key.
|
|
2518
|
+
*/
|
|
2519
|
+
epoch: number;
|
|
2520
|
+
}
|
|
2438
2521
|
export interface ServiceInstance {
|
|
2439
2522
|
/**
|
|
2440
2523
|
* Stable identifier the control plane uses for this instance. SHOULD be derived from the instance's DID (e.g. `did:web:host.example` → `did_web_host_example`) so it survives restarts.
|
package/src/index.ts
CHANGED
|
@@ -202,6 +202,14 @@ export * as RegistryRecordPut_v0_1 from "./registry/record/put/0.1/payload.js";
|
|
|
202
202
|
export * as RegistryRecordQuery_v0_1 from "./registry/record/query/0.1/payload.js";
|
|
203
203
|
export * as RegistryRecordRead_v0_1 from "./registry/record/read/0.1/payload.js";
|
|
204
204
|
export * as RegistryRecordUpdate_v0_1 from "./registry/record/update/0.1/payload.js";
|
|
205
|
+
export * as RoomShared_v0_1 from "./rooms/_shared/0.1/room.js";
|
|
206
|
+
export * as RoomsCreate_v0_1 from "./rooms/create/0.1/payload.js";
|
|
207
|
+
export * as RoomsEpochMint_v0_1 from "./rooms/epoch/mint/0.1/payload.js";
|
|
208
|
+
export * as RoomsKeysOpen_v0_1 from "./rooms/keys/open/0.1/payload.js";
|
|
209
|
+
export * as RoomsKeysPresent_v0_1 from "./rooms/keys/present/0.1/payload.js";
|
|
210
|
+
export * as RoomsRecordsGet_v0_1 from "./rooms/records/get/0.1/payload.js";
|
|
211
|
+
export * as RoomsRecordsList_v0_1 from "./rooms/records/list/0.1/payload.js";
|
|
212
|
+
export * as RoomsRecordsPut_v0_1 from "./rooms/records/put/0.1/payload.js";
|
|
205
213
|
export * as SyncEventShared_v0_1 from "./sync/_shared/0.1/sync-event.js";
|
|
206
214
|
export * as SyncEventShared_v0_2 from "./sync/_shared/0.2/sync-event.js";
|
|
207
215
|
export * as SyncEvent_v0_1 from "./sync/event/0.1/payload.js";
|
|
@@ -277,6 +285,11 @@ export * as VtaAppStateGet_v1_0 from "./vta/app-state/get/1.0/payload.js";
|
|
|
277
285
|
export * as VtaAppStateList_v1_0 from "./vta/app-state/list/1.0/payload.js";
|
|
278
286
|
export * as VtaAppStatePutMany_v1_0 from "./vta/app-state/put-many/1.0/payload.js";
|
|
279
287
|
export * as VtaAppStatePut_v1_0 from "./vta/app-state/put/1.0/payload.js";
|
|
288
|
+
export * as VtaBackupAbort_v1_0 from "./vta/backup/abort/1.0/payload.js";
|
|
289
|
+
export * as VtaBackupCompleteExport_v1_0 from "./vta/backup/complete-export/1.0/payload.js";
|
|
290
|
+
export * as VtaBackupFinalizeImport_v1_0 from "./vta/backup/finalize-import/1.0/payload.js";
|
|
291
|
+
export * as VtaBackupInitiateExport_v1_0 from "./vta/backup/initiate-export/1.0/payload.js";
|
|
292
|
+
export * as VtaBackupInitiateImport_v1_0 from "./vta/backup/initiate-import/1.0/payload.js";
|
|
280
293
|
export * as VtaContextsCreate_v1_0 from "./vta/contexts/create/1.0/payload.js";
|
|
281
294
|
export * as VtaContextsDelete_v1_0 from "./vta/contexts/delete/1.0/payload.js";
|
|
282
295
|
export * as VtaContextsDidTemplatesCreate_v1_0 from "./vta/contexts/did-templates/create/1.0/payload.js";
|
|
@@ -306,6 +319,7 @@ export * as VtaDidTemplatesRender_v1_0 from "./vta/did-templates/render/1.0/payl
|
|
|
306
319
|
export * as VtaDidTemplatesRender_v2_0 from "./vta/did-templates/render/2.0/payload.js";
|
|
307
320
|
export * as VtaDidTemplatesUpdate_v1_0 from "./vta/did-templates/update/1.0/payload.js";
|
|
308
321
|
export * as VtaDidTemplatesUpdate_v2_0 from "./vta/did-templates/update/2.0/payload.js";
|
|
322
|
+
export * as VtaManagementReloadServices_v1_0 from "./vta/management/reload-services/1.0/payload.js";
|
|
309
323
|
export * as VtaMemoryDelete_v0_1 from "./vta/memory/delete/0.1/payload.js";
|
|
310
324
|
export * as VtaMemoryList_v0_1 from "./vta/memory/list/0.1/payload.js";
|
|
311
325
|
export * as VtaMemoryPut_v0_1 from "./vta/memory/put/0.1/payload.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/_shared/0.1/room.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Types shared by the rooms/* family. A room is a DTG node with its own identifier that issues the credentials governing it; a host stores its records and verifies presentations against those credentials, and never maintains a member list of its own.
|
|
8
|
+
*/
|
|
9
|
+
export interface RoomsSharedTypes {
|
|
10
|
+
[k: string]: unknown | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The definitions this shared schema publishes, hoisted to one declaration each.
|
|
15
|
+
* See "../../../_shared/components.js".
|
|
16
|
+
*/
|
|
17
|
+
export type { AuthorityPresentation, RecordMetadata, SealedRecord, Visibility } from "../../../_shared/components.js";
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/create/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, Visibility } from "../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RoomsCreatePayload {
|
|
10
|
+
/**
|
|
11
|
+
* The room's identifier, minted by its owner before this call. A host is told the identifier; it does not assign one, because a room whose identity the host chose could not move to another host.
|
|
12
|
+
*/
|
|
13
|
+
roomId: string;
|
|
14
|
+
visibility: Visibility;
|
|
15
|
+
/**
|
|
16
|
+
* The room's accountable party: the controller of the room's identifier, the issuer of every credential in it, and the party a host addresses about quota, abuse, or lifecycle. Visible at every visibility, including `private` — a room has someone answerable for it.
|
|
17
|
+
*/
|
|
18
|
+
ownerDid: string;
|
|
19
|
+
/**
|
|
20
|
+
* How long the host will hold the room after its epoch lapses without renewal, before storage may be reclaimed. Stated at creation rather than discovered: reclamation that surprises a member is a failure of the design, not of the member.
|
|
21
|
+
*/
|
|
22
|
+
retentionDays?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
25
|
+
*/
|
|
26
|
+
ext?: Ext;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Success response to rooms/create. Type https://trusttasks.org/spec/rooms/create/0.1#response.
|
|
30
|
+
*/
|
|
31
|
+
export interface RoomsCreateResponsePayload {
|
|
32
|
+
roomId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Always 1 for a new room.
|
|
35
|
+
*/
|
|
36
|
+
epoch: number;
|
|
37
|
+
ext?: Ext;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
41
|
+
export type { Ext, Visibility };
|
|
42
|
+
|
|
43
|
+
/** Trust Task type URI. */
|
|
44
|
+
export const TYPE_URI = "https://trusttasks.org/spec/rooms/create/0.1" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's request payload shape. */
|
|
47
|
+
export type Payload = RoomsCreatePayload;
|
|
48
|
+
|
|
49
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
50
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/create/0.1#response" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
53
|
+
export type Response = RoomsCreateResponsePayload;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This specification's payload schema, as a value.
|
|
57
|
+
*
|
|
58
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
59
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
60
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
61
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
62
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
63
|
+
*/
|
|
64
|
+
export const PAYLOAD_SCHEMA = {
|
|
65
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
66
|
+
"$id": "https://trusttasks.org/spec/rooms/create/0.1",
|
|
67
|
+
"title": "Rooms Create — payload",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"roomId",
|
|
72
|
+
"visibility",
|
|
73
|
+
"ownerDid"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"roomId": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The room's identifier, minted by its owner before this call. A host is told the identifier; it does not assign one, because a room whose identity the host chose could not move to another host."
|
|
79
|
+
},
|
|
80
|
+
"visibility": {
|
|
81
|
+
"$ref": "#/$defs/Visibility"
|
|
82
|
+
},
|
|
83
|
+
"ownerDid": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"description": "The room's accountable party: the controller of the room's identifier, the issuer of every credential in it, and the party a host addresses about quota, abuse, or lifecycle. Visible at every visibility, including `private` — a room has someone answerable for it."
|
|
86
|
+
},
|
|
87
|
+
"retentionDays": {
|
|
88
|
+
"type": "integer",
|
|
89
|
+
"minimum": 1,
|
|
90
|
+
"description": "How long the host will hold the room after its epoch lapses without renewal, before storage may be reclaimed. Stated at creation rather than discovered: reclamation that surprises a member is a failure of the design, not of the member."
|
|
91
|
+
},
|
|
92
|
+
"ext": {
|
|
93
|
+
"$ref": "#/$defs/Ext",
|
|
94
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"$defs": {
|
|
98
|
+
"Response": {
|
|
99
|
+
"$anchor": "response",
|
|
100
|
+
"title": "Rooms Create — response payload",
|
|
101
|
+
"description": "Success response to rooms/create. Type https://trusttasks.org/spec/rooms/create/0.1#response.",
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"required": [
|
|
105
|
+
"roomId",
|
|
106
|
+
"epoch"
|
|
107
|
+
],
|
|
108
|
+
"properties": {
|
|
109
|
+
"roomId": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"epoch": {
|
|
113
|
+
"type": "integer",
|
|
114
|
+
"minimum": 1,
|
|
115
|
+
"description": "Always 1 for a new room."
|
|
116
|
+
},
|
|
117
|
+
"ext": {
|
|
118
|
+
"$ref": "#/$defs/Ext"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"Ext": {
|
|
123
|
+
"title": "Ext",
|
|
124
|
+
"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.",
|
|
125
|
+
"type": "object",
|
|
126
|
+
"minProperties": 1,
|
|
127
|
+
"additionalProperties": true,
|
|
128
|
+
"propertyNames": {
|
|
129
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"Visibility": {
|
|
133
|
+
"title": "Visibility",
|
|
134
|
+
"type": "string",
|
|
135
|
+
"enum": [
|
|
136
|
+
"open",
|
|
137
|
+
"attributed",
|
|
138
|
+
"private"
|
|
139
|
+
],
|
|
140
|
+
"description": "How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything."
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} as const;
|
|
144
|
+
|
|
145
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
146
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
147
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
148
|
+
"$ref": "#/$defs/Response",
|
|
149
|
+
"$defs": {
|
|
150
|
+
"Response": {
|
|
151
|
+
"$anchor": "response",
|
|
152
|
+
"title": "Rooms Create — response payload",
|
|
153
|
+
"description": "Success response to rooms/create. Type https://trusttasks.org/spec/rooms/create/0.1#response.",
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"required": [
|
|
157
|
+
"roomId",
|
|
158
|
+
"epoch"
|
|
159
|
+
],
|
|
160
|
+
"properties": {
|
|
161
|
+
"roomId": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"epoch": {
|
|
165
|
+
"type": "integer",
|
|
166
|
+
"minimum": 1,
|
|
167
|
+
"description": "Always 1 for a new room."
|
|
168
|
+
},
|
|
169
|
+
"ext": {
|
|
170
|
+
"$ref": "#/$defs/Ext"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"Ext": {
|
|
175
|
+
"title": "Ext",
|
|
176
|
+
"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.",
|
|
177
|
+
"type": "object",
|
|
178
|
+
"minProperties": 1,
|
|
179
|
+
"additionalProperties": true,
|
|
180
|
+
"propertyNames": {
|
|
181
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"Visibility": {
|
|
185
|
+
"title": "Visibility",
|
|
186
|
+
"type": "string",
|
|
187
|
+
"enum": [
|
|
188
|
+
"open",
|
|
189
|
+
"attributed",
|
|
190
|
+
"private"
|
|
191
|
+
],
|
|
192
|
+
"description": "How much of a room its host can see, fixed at creation and immutable thereafter. `open`: records are cleartext, searchable and fully audited. `attributed`: record content is sealed, and the host still learns which member acted. `private`: content is sealed and membership is presented in zero knowledge, so the host verifies that a member acted without learning which. Immutable because a downgrade cannot un-see cleartext and an upgrade would protect only what came after while presenting as though it protected everything."
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
} as const;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
199
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
200
|
+
* per-specification and cannot be derived from the document alone, and
|
|
201
|
+
* item 2 needs the schema this carries.
|
|
202
|
+
*/
|
|
203
|
+
export const SPEC = {
|
|
204
|
+
typeUri: TYPE_URI,
|
|
205
|
+
isBearer: false,
|
|
206
|
+
isProofRequired: true,
|
|
207
|
+
isRecipientRequired: true,
|
|
208
|
+
isIssuedAtRequired: true,
|
|
209
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
210
|
+
} as const;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
214
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
215
|
+
* parties (§7.3 item 5).
|
|
216
|
+
*/
|
|
217
|
+
export const RESPONSE_SPEC = {
|
|
218
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
219
|
+
isBearer: false,
|
|
220
|
+
isProofRequired: true,
|
|
221
|
+
isRecipientRequired: true,
|
|
222
|
+
isIssuedAtRequired: true,
|
|
223
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
224
|
+
} as const;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/rooms/epoch/mint/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AuthorityPresentation, Ext } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface RoomsEpochMintPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The room whose epoch advances.
|
|
12
|
+
*/
|
|
13
|
+
roomId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The new epoch number, which MUST be exactly one greater than the current one. A host records the number and never learns the key.
|
|
16
|
+
*/
|
|
17
|
+
epoch: number;
|
|
18
|
+
/**
|
|
19
|
+
* Must confer the `admin` action at this room's scope. Restricting epoch minting matters: if any key-holder could mint one, any member could evict any other by declining to seal the new key to them — silently, and with no server-side check possible on a room whose membership the host cannot see.
|
|
20
|
+
*/
|
|
21
|
+
presentation: AuthorityPresentation;
|
|
22
|
+
/**
|
|
23
|
+
* Optional operator-facing rationale, recorded in the room's audit.
|
|
24
|
+
*/
|
|
25
|
+
reason?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
28
|
+
*/
|
|
29
|
+
ext?: Ext;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Success response to rooms/epoch/mint. Type https://trusttasks.org/spec/rooms/epoch/mint/0.1#response.
|
|
33
|
+
*/
|
|
34
|
+
export interface RoomsEpochMintResponsePayload {
|
|
35
|
+
roomId: string;
|
|
36
|
+
epoch: number;
|
|
37
|
+
ext?: Ext;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
41
|
+
export type { AuthorityPresentation, Ext };
|
|
42
|
+
|
|
43
|
+
/** Trust Task type URI. */
|
|
44
|
+
export const TYPE_URI = "https://trusttasks.org/spec/rooms/epoch/mint/0.1" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's request payload shape. */
|
|
47
|
+
export type Payload = RoomsEpochMintPayload;
|
|
48
|
+
|
|
49
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
50
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/epoch/mint/0.1#response" as const;
|
|
51
|
+
|
|
52
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
53
|
+
export type Response = RoomsEpochMintResponsePayload;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This specification's payload schema, as a value.
|
|
57
|
+
*
|
|
58
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
59
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
60
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
61
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
62
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
63
|
+
*/
|
|
64
|
+
export const PAYLOAD_SCHEMA = {
|
|
65
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
66
|
+
"$id": "https://trusttasks.org/spec/rooms/epoch/mint/0.1",
|
|
67
|
+
"title": "Rooms Epoch Mint — payload",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"roomId",
|
|
72
|
+
"epoch",
|
|
73
|
+
"presentation"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"roomId": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The room whose epoch advances."
|
|
79
|
+
},
|
|
80
|
+
"epoch": {
|
|
81
|
+
"type": "integer",
|
|
82
|
+
"minimum": 2,
|
|
83
|
+
"description": "The new epoch number, which MUST be exactly one greater than the current one. A host records the number and never learns the key."
|
|
84
|
+
},
|
|
85
|
+
"presentation": {
|
|
86
|
+
"$ref": "#/$defs/AuthorityPresentation",
|
|
87
|
+
"description": "Must confer the `admin` action at this room's scope. Restricting epoch minting matters: if any key-holder could mint one, any member could evict any other by declining to seal the new key to them — silently, and with no server-side check possible on a room whose membership the host cannot see."
|
|
88
|
+
},
|
|
89
|
+
"reason": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"maxLength": 1024,
|
|
92
|
+
"description": "Optional operator-facing rationale, recorded in the room's audit."
|
|
93
|
+
},
|
|
94
|
+
"ext": {
|
|
95
|
+
"$ref": "#/$defs/Ext",
|
|
96
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"$defs": {
|
|
100
|
+
"Response": {
|
|
101
|
+
"$anchor": "response",
|
|
102
|
+
"title": "Rooms Epoch Mint — response payload",
|
|
103
|
+
"description": "Success response to rooms/epoch/mint. Type https://trusttasks.org/spec/rooms/epoch/mint/0.1#response.",
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": [
|
|
107
|
+
"roomId",
|
|
108
|
+
"epoch"
|
|
109
|
+
],
|
|
110
|
+
"properties": {
|
|
111
|
+
"roomId": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"epoch": {
|
|
115
|
+
"type": "integer",
|
|
116
|
+
"minimum": 2
|
|
117
|
+
},
|
|
118
|
+
"ext": {
|
|
119
|
+
"$ref": "#/$defs/Ext"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"Ext": {
|
|
124
|
+
"title": "Ext",
|
|
125
|
+
"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.",
|
|
126
|
+
"type": "object",
|
|
127
|
+
"minProperties": 1,
|
|
128
|
+
"additionalProperties": true,
|
|
129
|
+
"propertyNames": {
|
|
130
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"AuthorityPresentation": {
|
|
134
|
+
"title": "AuthorityPresentation",
|
|
135
|
+
"type": "object",
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"required": [
|
|
138
|
+
"membership",
|
|
139
|
+
"authority"
|
|
140
|
+
],
|
|
141
|
+
"description": "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.",
|
|
142
|
+
"properties": {
|
|
143
|
+
"membership": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile."
|
|
146
|
+
},
|
|
147
|
+
"authority": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"minItems": 1,
|
|
150
|
+
"maxItems": 8,
|
|
151
|
+
"items": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"description": "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent."
|
|
155
|
+
},
|
|
156
|
+
"subjectBinding": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this."
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
} as const;
|
|
164
|
+
|
|
165
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
166
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
167
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
168
|
+
"$ref": "#/$defs/Response",
|
|
169
|
+
"$defs": {
|
|
170
|
+
"Response": {
|
|
171
|
+
"$anchor": "response",
|
|
172
|
+
"title": "Rooms Epoch Mint — response payload",
|
|
173
|
+
"description": "Success response to rooms/epoch/mint. Type https://trusttasks.org/spec/rooms/epoch/mint/0.1#response.",
|
|
174
|
+
"type": "object",
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"required": [
|
|
177
|
+
"roomId",
|
|
178
|
+
"epoch"
|
|
179
|
+
],
|
|
180
|
+
"properties": {
|
|
181
|
+
"roomId": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
},
|
|
184
|
+
"epoch": {
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"minimum": 2
|
|
187
|
+
},
|
|
188
|
+
"ext": {
|
|
189
|
+
"$ref": "#/$defs/Ext"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"Ext": {
|
|
194
|
+
"title": "Ext",
|
|
195
|
+
"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.",
|
|
196
|
+
"type": "object",
|
|
197
|
+
"minProperties": 1,
|
|
198
|
+
"additionalProperties": true,
|
|
199
|
+
"propertyNames": {
|
|
200
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"AuthorityPresentation": {
|
|
204
|
+
"title": "AuthorityPresentation",
|
|
205
|
+
"type": "object",
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"required": [
|
|
208
|
+
"membership",
|
|
209
|
+
"authority"
|
|
210
|
+
],
|
|
211
|
+
"description": "What a party presents to act on a room. Carries the whole authority chain: a host MUST NOT dereference an authority credential's `parent` to fetch a link it was not given. Resolving over the network would make verification depend on availability, turn every identifier into a request the host can be induced to make against an address the holder chooses, and signal credential use to whoever hosts the identifier.",
|
|
212
|
+
"properties": {
|
|
213
|
+
"membership": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"description": "The presenter's membership credential for this room, or — on a `private` room — a zero-knowledge presentation of it. Serialized per the governing profile."
|
|
216
|
+
},
|
|
217
|
+
"authority": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"minItems": 1,
|
|
220
|
+
"maxItems": 8,
|
|
221
|
+
"items": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
},
|
|
224
|
+
"description": "The authority chain, LEAF FIRST: the first element is the credential being relied on and the last MUST be one issued by the room itself. Every link the presenter relies on is present, because the host will not fetch one. Capped at 8: verification is linear in chain length and runs on every operation, so an unbounded chain is a denial-of-service surface against the host. The known uses need 2 to 3 — a person attenuating to an agent, and that agent to a sub-agent."
|
|
225
|
+
},
|
|
226
|
+
"subjectBinding": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"description": "REQUIRED on a `private` room, where the subject identifier is withheld: a proof that the membership credential and the authority chain's leaf describe the SAME subject. Without it two parties pool credentials — one contributes membership, the other authority — and the combination verifies as a single party holding both. A host MUST refuse a private-room presentation that omits this."
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
} as const;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
237
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
238
|
+
* per-specification and cannot be derived from the document alone, and
|
|
239
|
+
* item 2 needs the schema this carries.
|
|
240
|
+
*/
|
|
241
|
+
export const SPEC = {
|
|
242
|
+
typeUri: TYPE_URI,
|
|
243
|
+
isBearer: false,
|
|
244
|
+
isProofRequired: true,
|
|
245
|
+
isRecipientRequired: true,
|
|
246
|
+
isIssuedAtRequired: true,
|
|
247
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
248
|
+
} as const;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
252
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
253
|
+
* parties (§7.3 item 5).
|
|
254
|
+
*/
|
|
255
|
+
export const RESPONSE_SPEC = {
|
|
256
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
257
|
+
isBearer: false,
|
|
258
|
+
isProofRequired: true,
|
|
259
|
+
isRecipientRequired: true,
|
|
260
|
+
isIssuedAtRequired: true,
|
|
261
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
262
|
+
} as const;
|