@openvtc/trust-tasks 0.17.11 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/dist/_shared/components.d.ts +34 -2
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/rooms/_shared/0.1/room.d.ts +1 -1
  9. package/dist/rooms/_shared/0.1/room.d.ts.map +1 -1
  10. package/dist/rooms/epoch/chain/0.1/payload.d.ts +4 -4
  11. package/dist/rooms/epoch/chain/0.1/payload.js +2 -2
  12. package/dist/rooms/epoch/chain/0.1/payload.js.map +1 -1
  13. package/dist/rooms/epoch/mint/0.1/payload.d.ts +4 -4
  14. package/dist/rooms/epoch/mint/0.1/payload.js +2 -2
  15. package/dist/rooms/epoch/mint/0.1/payload.js.map +1 -1
  16. package/dist/rooms/keys/present/0.2/payload.d.ts +378 -0
  17. package/dist/rooms/keys/present/0.2/payload.d.ts.map +1 -0
  18. package/dist/rooms/keys/present/0.2/payload.js +212 -0
  19. package/dist/rooms/keys/present/0.2/payload.js.map +1 -0
  20. package/dist/rooms/owner/claim/0.1/payload.d.ts +4 -4
  21. package/dist/rooms/owner/claim/0.1/payload.js +2 -2
  22. package/dist/rooms/owner/claim/0.1/payload.js.map +1 -1
  23. package/dist/rooms/owner/issue-authority/0.2/payload.d.ts +315 -0
  24. package/dist/rooms/owner/issue-authority/0.2/payload.d.ts.map +1 -0
  25. package/dist/rooms/owner/issue-authority/0.2/payload.js +174 -0
  26. package/dist/rooms/owner/issue-authority/0.2/payload.js.map +1 -0
  27. package/dist/rooms/owner/transfer/0.1/payload.d.ts +4 -4
  28. package/dist/rooms/owner/transfer/0.1/payload.js +2 -2
  29. package/dist/rooms/owner/transfer/0.1/payload.js.map +1 -1
  30. package/dist/rooms/records/curate/0.1/payload.d.ts +4 -4
  31. package/dist/rooms/records/curate/0.1/payload.js +2 -2
  32. package/dist/rooms/records/curate/0.1/payload.js.map +1 -1
  33. package/dist/rooms/records/get/0.1/payload.d.ts +241 -27
  34. package/dist/rooms/records/get/0.1/payload.d.ts.map +1 -1
  35. package/dist/rooms/records/get/0.1/payload.js +128 -12
  36. package/dist/rooms/records/get/0.1/payload.js.map +1 -1
  37. package/dist/rooms/records/list/0.1/payload.d.ts +8 -8
  38. package/dist/rooms/records/list/0.1/payload.js +4 -4
  39. package/dist/rooms/records/list/0.1/payload.js.map +1 -1
  40. package/dist/rooms/records/put/0.1/payload.d.ts +4 -4
  41. package/dist/rooms/records/put/0.1/payload.js +2 -2
  42. package/dist/rooms/records/put/0.1/payload.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/_shared/components.ts +34 -2
  45. package/src/index.ts +2 -0
  46. package/src/rooms/_shared/0.1/room.ts +1 -1
  47. package/src/rooms/epoch/chain/0.1/payload.ts +2 -2
  48. package/src/rooms/epoch/mint/0.1/payload.ts +2 -2
  49. package/src/rooms/keys/present/0.2/payload.ts +261 -0
  50. package/src/rooms/owner/claim/0.1/payload.ts +2 -2
  51. package/src/rooms/owner/issue-authority/0.2/payload.ts +234 -0
  52. package/src/rooms/owner/transfer/0.1/payload.ts +2 -2
  53. package/src/rooms/records/curate/0.1/payload.ts +2 -2
  54. package/src/rooms/records/get/0.1/payload.ts +157 -15
  55. package/src/rooms/records/list/0.1/payload.ts +4 -4
  56. package/src/rooms/records/put/0.1/payload.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openvtc/trust-tasks",
3
- "version": "0.17.11",
3
+ "version": "0.18.1",
4
4
  "description": "Generated TypeScript bindings for the Trust Tasks framework registry.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -93,7 +93,7 @@ export type CredentialId = string;
93
93
  *
94
94
  * **The construction is normative**, because two hosts that compute different roots over the same room make every comparison meaningless:
95
95
  * 1. Take every record the room holds — including tombstones, which are records — and order them by `key` using unsigned byte order.
96
- * 2. Leaf: `SHA-256(0x00 || JCS(record))`, where JCS is the RFC 8785 canonicalization of the record as this family's `RecordMetadata` plus its stored content, and `0x00` is RFC 6962's leaf-domain prefix.
96
+ * 2. Leaf: `SHA-256(0x00 || JCS(record))`, where the record is a `CommittedRecord` that definition fixes the members exactly, and this step used to name a *projection* instead, which two implementations could read two ways — JCS is its RFC 8785 canonicalization, and `0x00` is RFC 6962's leaf-domain prefix.
97
97
  * 3. Internal node: `SHA-256(0x01 || left || right)`.
98
98
  * 4. A level with an odd number of nodes promotes the last one unchanged. It MUST NOT be duplicated: duplicating makes a tree of n leaves collide with one of n+1 whose last is repeated, so two different rooms commit to the same root.
99
99
  * 5. A room holding no records commits to `SHA-256("")`, a distinguished value rather than zeroes — a root of zeroes is what an uninitialised buffer looks like, and an empty room is a real state a host must be able to commit to honestly.
@@ -101,6 +101,8 @@ export type CredentialId = string;
101
101
  * The leaf covers the whole record rather than its body, and that is deliberate: a host that could flip `status` from active to retracted, move `pinned`, or rewrite `author` on an `attributed` room would rewrite what the room means without touching a byte of ciphertext. The **plaintext is never involved** — on the sealed tiers the host holds ciphertext and commits to exactly what it stores.
102
102
  *
103
103
  * The commitment is over the **whole room**, never over the page being returned. A page-scoped root is one a host satisfies by construction and could never fail.
104
+ *
105
+ * Proving that a *particular* record sits under this root is a separate question, answered by `RecordTrace` on a single-record read. A commitment catches a host that equivocates; a trace binds one record to what the host committed to. Neither is the other, and a reader wanting completeness needs both plus a root it did not get from the host it is checking.
104
106
  */
105
107
  export type DataCommitment = DigestMultibase;
106
108
  /**
@@ -274,6 +276,36 @@ export type Provenance =
274
276
  * A device's platform push channel — the body the device registers with its push GATEWAY (push wake-up binding, https://trusttasks.org/binding/push/0.1; modeled on Aries RFC 0699/0734). The gateway holds this token and returns an opaque WakeHandle in exchange; the token is held by the gateway ONLY, never by the mediator or the maintainer/VTA. The gateway uses it to send a contentless wake-up when an authorized trigger asks — the push payload never carries Trust Task content. Tagged union over the discriminator `platform`.
275
277
  */
276
278
  export type PushRegistration = Apns | Fcm | WebPush;
279
+ /**
280
+ * The path from one record's leaf to the room's `DataCommitment` — a Merkle inclusion proof, in the vocabulary this work already uses for it.
281
+ *
282
+ * **It is not called `proof`** because in this framework that word is taken: `proof` is the document's data-integrity proof (SPEC §7.3), and a payload member of the same name in the same document invites reading one for the other. The two are not interchangeable and the confusion would be silent.
283
+ *
284
+ * **To verify**, given the `CommittedRecord` reassembled from the same response:
285
+ * 1. `h = SHA-256(0x00 || JCS(record))` — the leaf, by `DataCommitment` step 2.
286
+ * 2. For each step in order: `h = SHA-256(0x01 || sibling || h)` when `siblingIsLeft` is true, and `SHA-256(0x01 || h || sibling)` when it is false.
287
+ * 3. `h` **MUST** equal the `dataCommitment` **carried in the same response**. Not one from an earlier read, and not one from a listing: a room moves, and a trace is only ever a statement about the tree it was cut from. A host **MUST** compute the trace and the commitment from the same snapshot.
288
+ *
289
+ * An **empty array is valid** and is not the same as an absent member. It says the room holds exactly one record, whose leaf is the root; absence of `trace` says the host offered no trace at all.
290
+ *
291
+ * A trace is **not** always `ceil(log2 n)` steps. A level that promotes an odd node unchanged (`DataCommitment` step 4) contributes no step for that node, so a reader must follow the steps it was given rather than count them against a tree size it assumed.
292
+ *
293
+ * `maxItems` bounds a tree of 2⁶⁴ records. Verification cost is the reader's and the array is the host's, so the ceiling is stated rather than left to whoever writes the loop.
294
+ *
295
+ * **What a trace does not prove.** It binds a record to a root. It says nothing about whether that root is the room's — only comparing the root against one the host did not choose does that, exactly as `DataCommitment` describes. A reader that verifies a trace against a root received in the same breath has checked the host's arithmetic and nothing else. The two mechanisms answer different questions and neither substitutes for the other.
296
+ *
297
+ * @maxItems 64
298
+ */
299
+ export type RecordTrace = {
300
+ /**
301
+ * The sibling node's hash — a leaf hash or an internal node hash of this room's record tree, encoded exactly as `DataCommitment` is. A digest over **bytes**, produced by one of the two prefixed constructions in `DataCommitment`, not over a JSON document.
302
+ */
303
+ sibling: DigestMultibase;
304
+ /**
305
+ * Whether the sibling is the **left** child of the parent; the node being proved is the other one. Concatenation order is the whole of what a Merkle proof asserts, so this bit is load-bearing — inverting it on a single step yields a different root, and a reader that infers it from the record's position has assumed a tree shape the host never stated.
306
+ */
307
+ siblingIsLeft: boolean;
308
+ }[];
277
309
  /**
278
310
  * Whether the record asserts an authorization or a recognition relationship.
279
311
  */
@@ -834,7 +866,7 @@ export interface AuthenticatorAttestationResponseRegistration {
834
866
  clientExtensionResults?: {};
835
867
  }
836
868
  /**
837
- * 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.
869
+ * 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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.
838
870
  */
839
871
  export interface AuthorityPresentation {
840
872
  /**
package/src/index.ts CHANGED
@@ -243,11 +243,13 @@ export * as RoomsKeysKeyPackage_v0_1 from "./rooms/keys/key-package/0.1/payload.
243
243
  export * as RoomsKeysList_v0_1 from "./rooms/keys/list/0.1/payload.js";
244
244
  export * as RoomsKeysOpen_v0_1 from "./rooms/keys/open/0.1/payload.js";
245
245
  export * as RoomsKeysPresent_v0_1 from "./rooms/keys/present/0.1/payload.js";
246
+ export * as RoomsKeysPresent_v0_2 from "./rooms/keys/present/0.2/payload.js";
246
247
  export * as RoomsKeysSeal_v0_1 from "./rooms/keys/seal/0.1/payload.js";
247
248
  export * as RoomsKeysWelcome_v0_1 from "./rooms/keys/welcome/0.1/payload.js";
248
249
  export * as RoomsOwnerClaim_v0_1 from "./rooms/owner/claim/0.1/payload.js";
249
250
  export * as RoomsOwnerInvite_v0_1 from "./rooms/owner/invite/0.1/payload.js";
250
251
  export * as RoomsOwnerIssueAuthority_v0_1 from "./rooms/owner/issue-authority/0.1/payload.js";
252
+ export * as RoomsOwnerIssueAuthority_v0_2 from "./rooms/owner/issue-authority/0.2/payload.js";
251
253
  export * as RoomsOwnerIssueMembership_v0_1 from "./rooms/owner/issue-membership/0.1/payload.js";
252
254
  export * as RoomsOwnerRegister_v0_1 from "./rooms/owner/register/0.1/payload.js";
253
255
  export * as RoomsOwnerTransfer_v0_1 from "./rooms/owner/transfer/0.1/payload.js";
@@ -14,4 +14,4 @@ export interface RoomsSharedTypes {
14
14
  * The definitions this shared schema publishes, hoisted to one declaration each.
15
15
  * See "../../../_shared/components.js".
16
16
  */
17
- export type { AuthorityPresentation, DataCommitment, EpochLink, RecordMetadata, RetentionPolicy, SealedRecord, Visibility } from "../../../_shared/components.js";
17
+ export type { AuthorityPresentation, DataCommitment, EpochLink, RecordMetadata, RecordTrace, RetentionPolicy, SealedRecord, Visibility } from "../../../_shared/components.js";
@@ -170,7 +170,7 @@ export const PAYLOAD_SCHEMA = {
170
170
  "membership",
171
171
  "authority"
172
172
  ],
173
- "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.",
173
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
174
174
  "properties": {
175
175
  "membership": {
176
176
  "type": "string",
@@ -269,7 +269,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
269
269
  "membership",
270
270
  "authority"
271
271
  ],
272
- "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.",
272
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
273
273
  "properties": {
274
274
  "membership": {
275
275
  "type": "string",
@@ -173,7 +173,7 @@ export const PAYLOAD_SCHEMA = {
173
173
  "membership",
174
174
  "authority"
175
175
  ],
176
- "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.",
176
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
177
177
  "properties": {
178
178
  "membership": {
179
179
  "type": "string",
@@ -269,7 +269,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
269
269
  "membership",
270
270
  "authority"
271
271
  ],
272
- "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.",
272
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
273
273
  "properties": {
274
274
  "membership": {
275
275
  "type": "string",
@@ -0,0 +1,261 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/present/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { AuthorityPresentation, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * An agent asks the party holding its principal's room credentials to produce a presentation for one room operation. The credentials never cross to the agent; only the presentation does, and it is bound to the operation it was asked for and to the agent that asked.
11
+ */
12
+ export interface RoomsKeysPresentPayload {
13
+ /**
14
+ * The room to present for.
15
+ */
16
+ roomId: string;
17
+ /**
18
+ * The action the presentation must confer. Named here so the produced presentation can be scoped to it: a presentation minted for `read` should not be reusable for `write`, and a holder that mints one covering everything has handed the agent its own standing.
19
+ */
20
+ action: "read" | "write" | "curate" | "admin";
21
+ /**
22
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
23
+ */
24
+ ext?: Ext;
25
+ }
26
+ /**
27
+ * Success response to rooms/keys/present. Type https://trusttasks.org/spec/rooms/keys/present/0.2#response.
28
+ */
29
+ export interface RoomsKeysPresentResponsePayload {
30
+ /**
31
+ * The presentation to send to the host. Its authority chain grants to the CALLER, who is the only party that can present it — see the task's Security & Privacy section.
32
+ */
33
+ presentation: AuthorityPresentation;
34
+ /**
35
+ * When the presentation stops being accepted, so a caller can avoid presenting a stale one.
36
+ */
37
+ expiresAt?: string;
38
+ ext?: Ext;
39
+ }
40
+
41
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
42
+ export type { AuthorityPresentation, Ext };
43
+
44
+ /** Trust Task type URI. */
45
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/present/0.2" as const;
46
+
47
+ /** Stable alias for this specification's request payload shape. */
48
+ export type Payload = RoomsKeysPresentPayload;
49
+
50
+ /** Trust Task response type URI (request type URI + "#response"). */
51
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/present/0.2#response" as const;
52
+
53
+ /** Stable alias for this specification's success-response payload shape. */
54
+ export type Response = RoomsKeysPresentResponsePayload;
55
+
56
+ /**
57
+ * This specification's payload schema, as a value.
58
+ *
59
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
60
+ * rather than only as a `.json` file because TypeScript types are erased
61
+ * at runtime: without a schema a consumer has nothing to validate, and
62
+ * every REQUIRED payload member is optional in practice. Cross-file
63
+ * `$ref`s are already inlined, so it needs no resolver.
64
+ */
65
+ export const PAYLOAD_SCHEMA = {
66
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
67
+ "$id": "https://trusttasks.org/spec/rooms/keys/present/0.2",
68
+ "title": "Rooms Keys Present — payload",
69
+ "description": "An agent asks the party holding its principal's room credentials to produce a presentation for one room operation. The credentials never cross to the agent; only the presentation does, and it is bound to the operation it was asked for and to the agent that asked.",
70
+ "type": "object",
71
+ "additionalProperties": false,
72
+ "required": [
73
+ "roomId",
74
+ "action"
75
+ ],
76
+ "properties": {
77
+ "roomId": {
78
+ "type": "string",
79
+ "description": "The room to present for."
80
+ },
81
+ "action": {
82
+ "type": "string",
83
+ "enum": [
84
+ "read",
85
+ "write",
86
+ "curate",
87
+ "admin"
88
+ ],
89
+ "description": "The action the presentation must confer. Named here so the produced presentation can be scoped to it: a presentation minted for `read` should not be reusable for `write`, and a holder that mints one covering everything has handed the agent its own standing."
90
+ },
91
+ "ext": {
92
+ "$ref": "#/$defs/Ext",
93
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
94
+ }
95
+ },
96
+ "$defs": {
97
+ "Response": {
98
+ "$anchor": "response",
99
+ "title": "Rooms Keys Present — response payload",
100
+ "description": "Success response to rooms/keys/present. Type https://trusttasks.org/spec/rooms/keys/present/0.2#response.",
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": [
104
+ "presentation"
105
+ ],
106
+ "properties": {
107
+ "presentation": {
108
+ "$ref": "#/$defs/AuthorityPresentation",
109
+ "description": "The presentation to send to the host. Its authority chain grants to the CALLER, who is the only party that can present it — see the task's Security & Privacy section."
110
+ },
111
+ "expiresAt": {
112
+ "type": "string",
113
+ "format": "date-time",
114
+ "description": "When the presentation stops being accepted, so a caller can avoid presenting a stale one."
115
+ },
116
+ "ext": {
117
+ "$ref": "#/$defs/Ext"
118
+ }
119
+ }
120
+ },
121
+ "Ext": {
122
+ "title": "Ext",
123
+ "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.",
124
+ "type": "object",
125
+ "minProperties": 1,
126
+ "additionalProperties": true,
127
+ "propertyNames": {
128
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
129
+ }
130
+ },
131
+ "AuthorityPresentation": {
132
+ "title": "AuthorityPresentation",
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": [
136
+ "membership",
137
+ "authority"
138
+ ],
139
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
140
+ "properties": {
141
+ "membership": {
142
+ "type": "string",
143
+ "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."
144
+ },
145
+ "authority": {
146
+ "type": "array",
147
+ "minItems": 1,
148
+ "maxItems": 8,
149
+ "items": {
150
+ "type": "string"
151
+ },
152
+ "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."
153
+ },
154
+ "subjectBinding": {
155
+ "type": "string",
156
+ "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."
157
+ }
158
+ }
159
+ }
160
+ }
161
+ } as const;
162
+
163
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
164
+ export const RESPONSE_PAYLOAD_SCHEMA = {
165
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
166
+ "$ref": "#/$defs/Response",
167
+ "$defs": {
168
+ "Response": {
169
+ "$anchor": "response",
170
+ "title": "Rooms Keys Present — response payload",
171
+ "description": "Success response to rooms/keys/present. Type https://trusttasks.org/spec/rooms/keys/present/0.2#response.",
172
+ "type": "object",
173
+ "additionalProperties": false,
174
+ "required": [
175
+ "presentation"
176
+ ],
177
+ "properties": {
178
+ "presentation": {
179
+ "$ref": "#/$defs/AuthorityPresentation",
180
+ "description": "The presentation to send to the host. Its authority chain grants to the CALLER, who is the only party that can present it — see the task's Security & Privacy section."
181
+ },
182
+ "expiresAt": {
183
+ "type": "string",
184
+ "format": "date-time",
185
+ "description": "When the presentation stops being accepted, so a caller can avoid presenting a stale one."
186
+ },
187
+ "ext": {
188
+ "$ref": "#/$defs/Ext"
189
+ }
190
+ }
191
+ },
192
+ "Ext": {
193
+ "title": "Ext",
194
+ "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.",
195
+ "type": "object",
196
+ "minProperties": 1,
197
+ "additionalProperties": true,
198
+ "propertyNames": {
199
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
200
+ }
201
+ },
202
+ "AuthorityPresentation": {
203
+ "title": "AuthorityPresentation",
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": [
207
+ "membership",
208
+ "authority"
209
+ ],
210
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
211
+ "properties": {
212
+ "membership": {
213
+ "type": "string",
214
+ "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."
215
+ },
216
+ "authority": {
217
+ "type": "array",
218
+ "minItems": 1,
219
+ "maxItems": 8,
220
+ "items": {
221
+ "type": "string"
222
+ },
223
+ "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."
224
+ },
225
+ "subjectBinding": {
226
+ "type": "string",
227
+ "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."
228
+ }
229
+ }
230
+ }
231
+ }
232
+ } as const;
233
+
234
+ /**
235
+ * SPEC.md §7.2 policy for the request variant, from this specification's
236
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
237
+ * per-specification and cannot be derived from the document alone, and
238
+ * item 2 needs the schema this carries.
239
+ */
240
+ export const SPEC = {
241
+ typeUri: TYPE_URI,
242
+ isBearer: false,
243
+ isProofRequired: true,
244
+ isRecipientRequired: true,
245
+ isIssuedAtRequired: true,
246
+ payloadSchema: PAYLOAD_SCHEMA,
247
+ } as const;
248
+
249
+ /**
250
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
251
+ * tracks the *issuer* party's requirement because a response swaps the
252
+ * parties (§7.3 item 5).
253
+ */
254
+ export const RESPONSE_SPEC = {
255
+ typeUri: RESPONSE_TYPE_URI,
256
+ isBearer: false,
257
+ isProofRequired: true,
258
+ isRecipientRequired: true,
259
+ isIssuedAtRequired: true,
260
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
261
+ } as const;
@@ -144,7 +144,7 @@ export const PAYLOAD_SCHEMA = {
144
144
  "membership",
145
145
  "authority"
146
146
  ],
147
- "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.",
147
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
148
148
  "properties": {
149
149
  "membership": {
150
150
  "type": "string",
@@ -214,7 +214,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
214
214
  "membership",
215
215
  "authority"
216
216
  ],
217
- "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.",
217
+ "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. A host MUST bind the presenter to the chain's leaf. A chain that verifies is evidence that authority was conferred on somebody; it is not evidence that the party presenting it is that somebody. The leaf's subject MUST equal the party the host authenticated for this request — an identity the transport established or a document `proof` proved, never one named in a payload. A host that omits this check authorizes every captured presentation, and the omission is silent, because the chain still verifies.",
218
218
  "properties": {
219
219
  "membership": {
220
220
  "type": "string",