@openvtc/trust-tasks 0.22.5 → 0.22.7

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 (199) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/_shared/components.d.ts +434 -1
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/acl/_shared/0.1/acl-entry.d.ts +1 -1
  5. package/dist/acl/_shared/0.1/acl-entry.d.ts.map +1 -1
  6. package/dist/acl/_shared/0.2/acl-entry.d.ts +22 -0
  7. package/dist/acl/_shared/0.2/acl-entry.d.ts.map +1 -0
  8. package/dist/acl/_shared/0.2/acl-entry.js +6 -0
  9. package/dist/acl/_shared/0.2/acl-entry.js.map +1 -0
  10. package/dist/acl/change-role/0.1/payload.d.ts +1 -1
  11. package/dist/acl/change-role/0.1/payload.d.ts.map +1 -1
  12. package/dist/acl/change-role/0.2/payload.d.ts +1679 -0
  13. package/dist/acl/change-role/0.2/payload.d.ts.map +1 -0
  14. package/dist/acl/change-role/0.2/payload.js +955 -0
  15. package/dist/acl/change-role/0.2/payload.js.map +1 -0
  16. package/dist/acl/grant/0.1/payload.d.ts +1 -1
  17. package/dist/acl/grant/0.1/payload.d.ts.map +1 -1
  18. package/dist/acl/grant/0.2/payload.d.ts +1649 -0
  19. package/dist/acl/grant/0.2/payload.d.ts.map +1 -0
  20. package/dist/acl/grant/0.2/payload.js +942 -0
  21. package/dist/acl/grant/0.2/payload.js.map +1 -0
  22. package/dist/acl/list/0.1/payload.d.ts +1 -1
  23. package/dist/acl/list/0.1/payload.d.ts.map +1 -1
  24. package/dist/acl/list/0.2/payload.d.ts +1853 -0
  25. package/dist/acl/list/0.2/payload.d.ts.map +1 -0
  26. package/dist/acl/list/0.2/payload.js +1041 -0
  27. package/dist/acl/list/0.2/payload.js.map +1 -0
  28. package/dist/acl/revoke/0.1/payload.d.ts +1 -1
  29. package/dist/acl/revoke/0.1/payload.d.ts.map +1 -1
  30. package/dist/acl/revoke/0.2/payload.d.ts +1844 -0
  31. package/dist/acl/revoke/0.2/payload.d.ts.map +1 -0
  32. package/dist/acl/revoke/0.2/payload.js +1052 -0
  33. package/dist/acl/revoke/0.2/payload.js.map +1 -0
  34. package/dist/acl/show/0.1/payload.d.ts +1 -1
  35. package/dist/acl/show/0.1/payload.d.ts.map +1 -1
  36. package/dist/acl/show/0.2/payload.d.ts +1689 -0
  37. package/dist/acl/show/0.2/payload.d.ts.map +1 -0
  38. package/dist/acl/show/0.2/payload.js +968 -0
  39. package/dist/acl/show/0.2/payload.js.map +1 -0
  40. package/dist/acl/swap-key/0.1/payload.d.ts +1 -1
  41. package/dist/acl/swap-key/0.1/payload.d.ts.map +1 -1
  42. package/dist/acl/update/0.1/payload.d.ts +1 -1
  43. package/dist/acl/update/0.1/payload.d.ts.map +1 -1
  44. package/dist/acl/update/0.2/payload.d.ts +1784 -0
  45. package/dist/acl/update/0.2/payload.d.ts.map +1 -0
  46. package/dist/acl/update/0.2/payload.js +1005 -0
  47. package/dist/acl/update/0.2/payload.js.map +1 -0
  48. package/dist/auth/signing-key/authorize/0.1/payload.d.ts +199 -0
  49. package/dist/auth/signing-key/authorize/0.1/payload.d.ts.map +1 -0
  50. package/dist/auth/signing-key/authorize/0.1/payload.js +108 -0
  51. package/dist/auth/signing-key/authorize/0.1/payload.js.map +1 -0
  52. package/dist/auth/signing-key/enroll/0.2/payload.d.ts +569 -0
  53. package/dist/auth/signing-key/enroll/0.2/payload.d.ts.map +1 -0
  54. package/dist/auth/signing-key/enroll/0.2/payload.js +315 -0
  55. package/dist/auth/signing-key/enroll/0.2/payload.js.map +1 -0
  56. package/dist/auth/step-up/approve-request/0.4/payload.d.ts +672 -0
  57. package/dist/auth/step-up/approve-request/0.4/payload.d.ts.map +1 -0
  58. package/dist/auth/step-up/approve-request/0.4/payload.js +373 -0
  59. package/dist/auth/step-up/approve-request/0.4/payload.js.map +1 -0
  60. package/dist/auth/step-up/approve-response/0.6/payload.d.ts +974 -0
  61. package/dist/auth/step-up/approve-response/0.6/payload.d.ts.map +1 -0
  62. package/dist/auth/step-up/approve-response/0.6/payload.js +552 -0
  63. package/dist/auth/step-up/approve-response/0.6/payload.js.map +1 -0
  64. package/dist/auth/step-up/approver/_shared/0.1/approver.d.ts +16 -0
  65. package/dist/auth/step-up/approver/_shared/0.1/approver.d.ts.map +1 -0
  66. package/dist/auth/step-up/approver/_shared/0.1/approver.js +6 -0
  67. package/dist/auth/step-up/approver/_shared/0.1/approver.js.map +1 -0
  68. package/dist/auth/step-up/approver/attest/0.1/payload.d.ts +174 -0
  69. package/dist/auth/step-up/approver/attest/0.1/payload.d.ts.map +1 -0
  70. package/dist/auth/step-up/approver/attest/0.1/payload.js +97 -0
  71. package/dist/auth/step-up/approver/attest/0.1/payload.js.map +1 -0
  72. package/dist/auth/step-up/approver/enroll/0.1/payload.d.ts +503 -0
  73. package/dist/auth/step-up/approver/enroll/0.1/payload.d.ts.map +1 -0
  74. package/dist/auth/step-up/approver/enroll/0.1/payload.js +285 -0
  75. package/dist/auth/step-up/approver/enroll/0.1/payload.js.map +1 -0
  76. package/dist/auth/step-up/approver/invite/0.1/payload.d.ts +375 -0
  77. package/dist/auth/step-up/approver/invite/0.1/payload.d.ts.map +1 -0
  78. package/dist/auth/step-up/approver/invite/0.1/payload.js +200 -0
  79. package/dist/auth/step-up/approver/invite/0.1/payload.js.map +1 -0
  80. package/dist/auth/step-up/approver/list/0.1/payload.d.ts +477 -0
  81. package/dist/auth/step-up/approver/list/0.1/payload.d.ts.map +1 -0
  82. package/dist/auth/step-up/approver/list/0.1/payload.js +272 -0
  83. package/dist/auth/step-up/approver/list/0.1/payload.js.map +1 -0
  84. package/dist/auth/step-up/approver/redeem/finish/0.1/payload.d.ts +512 -0
  85. package/dist/auth/step-up/approver/redeem/finish/0.1/payload.d.ts.map +1 -0
  86. package/dist/auth/step-up/approver/redeem/finish/0.1/payload.js +290 -0
  87. package/dist/auth/step-up/approver/redeem/finish/0.1/payload.js.map +1 -0
  88. package/dist/auth/step-up/approver/redeem/start/0.1/payload.d.ts +343 -0
  89. package/dist/auth/step-up/approver/redeem/start/0.1/payload.d.ts.map +1 -0
  90. package/dist/auth/step-up/approver/redeem/start/0.1/payload.js +187 -0
  91. package/dist/auth/step-up/approver/redeem/start/0.1/payload.js.map +1 -0
  92. package/dist/auth/step-up/approver/revoke/0.1/payload.d.ts +534 -0
  93. package/dist/auth/step-up/approver/revoke/0.1/payload.d.ts.map +1 -0
  94. package/dist/auth/step-up/approver/revoke/0.1/payload.js +301 -0
  95. package/dist/auth/step-up/approver/revoke/0.1/payload.js.map +1 -0
  96. package/dist/index.d.ts +33 -0
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +33 -0
  99. package/dist/index.js.map +1 -1
  100. package/dist/task-consent/decision/0.2/payload.d.ts +775 -0
  101. package/dist/task-consent/decision/0.2/payload.d.ts.map +1 -0
  102. package/dist/task-consent/decision/0.2/payload.js +450 -0
  103. package/dist/task-consent/decision/0.2/payload.js.map +1 -0
  104. package/dist/vtc/admin/actions/_shared/0.1/action.d.ts +24 -0
  105. package/dist/vtc/admin/actions/_shared/0.1/action.d.ts.map +1 -0
  106. package/dist/vtc/admin/actions/_shared/0.1/action.js +6 -0
  107. package/dist/vtc/admin/actions/_shared/0.1/action.js.map +1 -0
  108. package/dist/vtc/admin/actions/acknowledge/0.1/payload.d.ts +1012 -0
  109. package/dist/vtc/admin/actions/acknowledge/0.1/payload.d.ts.map +1 -0
  110. package/dist/vtc/admin/actions/acknowledge/0.1/payload.js +636 -0
  111. package/dist/vtc/admin/actions/acknowledge/0.1/payload.js.map +1 -0
  112. package/dist/vtc/admin/actions/cancel/0.1/payload.d.ts +1026 -0
  113. package/dist/vtc/admin/actions/cancel/0.1/payload.d.ts.map +1 -0
  114. package/dist/vtc/admin/actions/cancel/0.1/payload.js +641 -0
  115. package/dist/vtc/admin/actions/cancel/0.1/payload.js.map +1 -0
  116. package/dist/vtc/admin/actions/list/0.1/payload.d.ts +1200 -0
  117. package/dist/vtc/admin/actions/list/0.1/payload.d.ts.map +1 -0
  118. package/dist/vtc/admin/actions/list/0.1/payload.js +726 -0
  119. package/dist/vtc/admin/actions/list/0.1/payload.js.map +1 -0
  120. package/dist/vtc/admin/actions/show/0.1/payload.d.ts +1012 -0
  121. package/dist/vtc/admin/actions/show/0.1/payload.d.ts.map +1 -0
  122. package/dist/vtc/admin/actions/show/0.1/payload.js +636 -0
  123. package/dist/vtc/admin/actions/show/0.1/payload.js.map +1 -0
  124. package/dist/vtc/install/claim/finish/0.3/payload.d.ts +379 -0
  125. package/dist/vtc/install/claim/finish/0.3/payload.d.ts.map +1 -0
  126. package/dist/vtc/install/claim/finish/0.3/payload.js +205 -0
  127. package/dist/vtc/install/claim/finish/0.3/payload.js.map +1 -0
  128. package/dist/vtc/install/claim/start/0.3/payload.d.ts +368 -0
  129. package/dist/vtc/install/claim/start/0.3/payload.d.ts.map +1 -0
  130. package/dist/vtc/install/claim/start/0.3/payload.js +201 -0
  131. package/dist/vtc/install/claim/start/0.3/payload.js.map +1 -0
  132. package/dist/vtc/members/authority-reduced-notice/0.1/payload.d.ts +208 -0
  133. package/dist/vtc/members/authority-reduced-notice/0.1/payload.d.ts.map +1 -0
  134. package/dist/vtc/members/authority-reduced-notice/0.1/payload.js +112 -0
  135. package/dist/vtc/members/authority-reduced-notice/0.1/payload.js.map +1 -0
  136. package/dist/vtc/roles/_shared/0.1/role.d.ts +16 -0
  137. package/dist/vtc/roles/_shared/0.1/role.d.ts.map +1 -0
  138. package/dist/vtc/roles/_shared/0.1/role.js +6 -0
  139. package/dist/vtc/roles/_shared/0.1/role.js.map +1 -0
  140. package/dist/vtc/roles/define/0.1/payload.d.ts +703 -0
  141. package/dist/vtc/roles/define/0.1/payload.d.ts.map +1 -0
  142. package/dist/vtc/roles/define/0.1/payload.js +371 -0
  143. package/dist/vtc/roles/define/0.1/payload.js.map +1 -0
  144. package/dist/vtc/roles/delete/0.1/payload.d.ts +281 -0
  145. package/dist/vtc/roles/delete/0.1/payload.d.ts.map +1 -0
  146. package/dist/vtc/roles/delete/0.1/payload.js +152 -0
  147. package/dist/vtc/roles/delete/0.1/payload.js.map +1 -0
  148. package/dist/vtc/roles/list/0.1/payload.d.ts +639 -0
  149. package/dist/vtc/roles/list/0.1/payload.d.ts.map +1 -0
  150. package/dist/vtc/roles/list/0.1/payload.js +345 -0
  151. package/dist/vtc/roles/list/0.1/payload.js.map +1 -0
  152. package/dist/vtc/roles/show/0.1/payload.d.ts +651 -0
  153. package/dist/vtc/roles/show/0.1/payload.d.ts.map +1 -0
  154. package/dist/vtc/roles/show/0.1/payload.js +351 -0
  155. package/dist/vtc/roles/show/0.1/payload.js.map +1 -0
  156. package/package.json +1 -1
  157. package/src/_shared/components.ts +440 -1
  158. package/src/acl/_shared/0.1/acl-entry.ts +1 -1
  159. package/src/acl/_shared/0.2/acl-entry.ts +23 -0
  160. package/src/acl/change-role/0.1/payload.ts +1 -1
  161. package/src/acl/change-role/0.2/payload.ts +1011 -0
  162. package/src/acl/grant/0.1/payload.ts +1 -1
  163. package/src/acl/grant/0.2/payload.ts +990 -0
  164. package/src/acl/list/0.1/payload.ts +1 -1
  165. package/src/acl/list/0.2/payload.ts +1125 -0
  166. package/src/acl/revoke/0.1/payload.ts +1 -1
  167. package/src/acl/revoke/0.2/payload.ts +1122 -0
  168. package/src/acl/show/0.1/payload.ts +1 -1
  169. package/src/acl/show/0.2/payload.ts +1016 -0
  170. package/src/acl/swap-key/0.1/payload.ts +1 -1
  171. package/src/acl/update/0.1/payload.ts +1 -1
  172. package/src/acl/update/0.2/payload.ts +1094 -0
  173. package/src/auth/signing-key/authorize/0.1/payload.ts +141 -0
  174. package/src/auth/signing-key/enroll/0.2/payload.ts +365 -0
  175. package/src/auth/step-up/approve-request/0.4/payload.ts +461 -0
  176. package/src/auth/step-up/approve-response/0.6/payload.ts +648 -0
  177. package/src/auth/step-up/approver/_shared/0.1/approver.ts +17 -0
  178. package/src/auth/step-up/approver/attest/0.1/payload.ts +135 -0
  179. package/src/auth/step-up/approver/enroll/0.1/payload.ts +329 -0
  180. package/src/auth/step-up/approver/invite/0.1/payload.ts +258 -0
  181. package/src/auth/step-up/approver/list/0.1/payload.ts +318 -0
  182. package/src/auth/step-up/approver/redeem/finish/0.1/payload.ts +337 -0
  183. package/src/auth/step-up/approver/redeem/start/0.1/payload.ts +241 -0
  184. package/src/auth/step-up/approver/revoke/0.1/payload.ts +352 -0
  185. package/src/index.ts +33 -0
  186. package/src/task-consent/decision/0.2/payload.ts +537 -0
  187. package/src/vtc/admin/actions/_shared/0.1/action.ts +25 -0
  188. package/src/vtc/admin/actions/acknowledge/0.1/payload.ts +671 -0
  189. package/src/vtc/admin/actions/cancel/0.1/payload.ts +680 -0
  190. package/src/vtc/admin/actions/list/0.1/payload.ts +795 -0
  191. package/src/vtc/admin/actions/show/0.1/payload.ts +671 -0
  192. package/src/vtc/install/claim/finish/0.3/payload.ts +253 -0
  193. package/src/vtc/install/claim/start/0.3/payload.ts +256 -0
  194. package/src/vtc/members/authority-reduced-notice/0.1/payload.ts +162 -0
  195. package/src/vtc/roles/_shared/0.1/role.ts +17 -0
  196. package/src/vtc/roles/define/0.1/payload.ts +435 -0
  197. package/src/vtc/roles/delete/0.1/payload.ts +200 -0
  198. package/src/vtc/roles/list/0.1/payload.ts +389 -0
  199. package/src/vtc/roles/show/0.1/payload.ts +399 -0
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/auth/signing-key/authorize/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { DeviceLabel, Ext, SigningKeyDid, SigningKeyScope } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * The terms of one signing-key enrolment, signed by the identity the key will act for. Exactly the payload of the auth/signing-key/enroll/0.2 document that carries this one as its `authorization`, with that member removed; the consumer compares the two and refuses any difference. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface AuthSigningKeyAuthorizePayload {
13
+ signingKeyDid: SigningKeyDid;
14
+ /**
15
+ * The identity authorizing the delegation. Equal to the document's `issuer`: the identity signs for itself.
16
+ */
17
+ identityDid: string;
18
+ scope: SigningKeyScope;
19
+ deviceLabel?: DeviceLabel;
20
+ /**
21
+ * The lifetime the enrolment requests, as in auth/signing-key/enroll/0.2.
22
+ */
23
+ expiresAt?: string;
24
+ /**
25
+ * The identity's active key the enrolment replaces, as in auth/signing-key/enroll/0.2. Signed here so an authorization to add a key cannot be reused to remove one.
26
+ */
27
+ replaces?: SigningKeyDid;
28
+ ext?: Ext;
29
+ }
30
+
31
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
32
+ export type { DeviceLabel, Ext, SigningKeyDid, SigningKeyScope };
33
+
34
+ /** Trust Task type URI. */
35
+ export const TYPE_URI = "https://trusttasks.org/spec/auth/signing-key/authorize/0.1" as const;
36
+
37
+ /** Stable alias for this specification's request payload shape. */
38
+ export type Payload = AuthSigningKeyAuthorizePayload;
39
+
40
+ /**
41
+ * This specification's payload schema, as a value.
42
+ *
43
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
44
+ * rather than only as a `.json` file because TypeScript types are erased
45
+ * at runtime: without a schema a consumer has nothing to validate, and
46
+ * every REQUIRED payload member is optional in practice. Cross-file
47
+ * `$ref`s are already inlined, so it needs no resolver.
48
+ */
49
+ export const PAYLOAD_SCHEMA = {
50
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
51
+ "$id": "https://trusttasks.org/spec/auth/signing-key/authorize/0.1",
52
+ "title": "Auth — Signing Key Authorize — payload",
53
+ "description": "The terms of one signing-key enrolment, signed by the identity the key will act for. Exactly the payload of the auth/signing-key/enroll/0.2 document that carries this one as its `authorization`, with that member removed; the consumer compares the two and refuses any difference. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": [
57
+ "signingKeyDid",
58
+ "identityDid",
59
+ "scope"
60
+ ],
61
+ "properties": {
62
+ "signingKeyDid": {
63
+ "$ref": "#/$defs/SigningKeyDid"
64
+ },
65
+ "identityDid": {
66
+ "type": "string",
67
+ "pattern": "^did:",
68
+ "minLength": 5,
69
+ "maxLength": 2048,
70
+ "description": "The identity authorizing the delegation. Equal to the document's `issuer`: the identity signs for itself."
71
+ },
72
+ "scope": {
73
+ "$ref": "#/$defs/SigningKeyScope"
74
+ },
75
+ "deviceLabel": {
76
+ "$ref": "#/$defs/DeviceLabel"
77
+ },
78
+ "expiresAt": {
79
+ "type": "string",
80
+ "format": "date-time",
81
+ "description": "The lifetime the enrolment requests, as in auth/signing-key/enroll/0.2."
82
+ },
83
+ "replaces": {
84
+ "$ref": "#/$defs/SigningKeyDid",
85
+ "description": "The identity's active key the enrolment replaces, as in auth/signing-key/enroll/0.2. Signed here so an authorization to add a key cannot be reused to remove one."
86
+ },
87
+ "ext": {
88
+ "$ref": "#/$defs/Ext"
89
+ }
90
+ },
91
+ "$defs": {
92
+ "Ext": {
93
+ "title": "Ext",
94
+ "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.",
95
+ "type": "object",
96
+ "minProperties": 1,
97
+ "additionalProperties": true,
98
+ "propertyNames": {
99
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
100
+ }
101
+ },
102
+ "SigningKeyDid": {
103
+ "title": "SigningKeyDid",
104
+ "type": "string",
105
+ "minLength": 9,
106
+ "maxLength": 256,
107
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
108
+ "description": "The delegated key, as a `did:key` — an Ed25519 multikey (`z6Mk…`) derived from the public half of a keypair the holder generated for itself, typically a non-extractable browser key. `did:key` only, because its document is a function of the key and resolves with no network: a key whose DID document could be rewritten after enrolment is not the key that was enrolled."
109
+ },
110
+ "DeviceLabel": {
111
+ "title": "DeviceLabel",
112
+ "type": "string",
113
+ "minLength": 1,
114
+ "maxLength": 128,
115
+ "description": "A human-readable name for where the key lives, chosen by the enrolling identity — e.g. `Work laptop — Chrome`. Read by that identity and by administrators deciding which key to revoke; retained with the delegation. Free text authored by the enrolling identity, untrusted, and attributed to it wherever it is rendered. Absent rather than invented when none was chosen: an invented label is indistinguishable from a chosen one to somebody deciding which key to revoke."
116
+ },
117
+ "SigningKeyScope": {
118
+ "title": "SigningKeyScope",
119
+ "type": "string",
120
+ "enum": [
121
+ "console"
122
+ ],
123
+ "description": "What a delegated key may be accepted for. `console`: the operations an administration console performs on the identity's behalf, authorized by the identity's own standing. Never an approver's signature on a consent or approval decision, whatever the scope: those require an `assertionMethod` key of the approver's own DID document, which a delegated key never is. A closed enumeration so a consumer cannot be asked for a scope it does not define; a later version adds values."
124
+ }
125
+ }
126
+ } as const;
127
+
128
+ /**
129
+ * SPEC.md §7.2 policy for the request variant, from this specification's
130
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
131
+ * per-specification and cannot be derived from the document alone, and
132
+ * item 2 needs the schema this carries.
133
+ */
134
+ export const SPEC = {
135
+ typeUri: TYPE_URI,
136
+ isBearer: false,
137
+ isProofRequired: true,
138
+ isRecipientRequired: true,
139
+ isIssuedAtRequired: true,
140
+ payloadSchema: PAYLOAD_SCHEMA,
141
+ } as const;
@@ -0,0 +1,365 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/auth/signing-key/enroll/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { DeviceLabel, Ext, SigningKey, SigningKeyDid, SigningKeyScope } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A freshly generated key asks to be enrolled as a signing-key delegation of an identity: documents it signs will be authorized by that identity's standing. The document is issued and proved by the key being enrolled, which is the proof that the enrolling party holds it; the identity it will act for is named in the payload and is established by the authority evidence the consumer requires — an operation-bound step-up, or the identity's own signed `authorization` — never by the key's own signature. Optionally replaces one of the identity's active keys in the same step. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface AuthSigningKeyEnrollPayload {
13
+ signingKeyDid: SigningKeyDid;
14
+ /**
15
+ * The identity the key will act for — the DID whose standing a document signed by the key is authorized by. Naming it is not claiming it: the consumer establishes that the enrolling party controls this identity from separate authority evidence (Authorization).
16
+ */
17
+ identityDid: string;
18
+ scope: SigningKeyScope;
19
+ deviceLabel?: DeviceLabel;
20
+ /**
21
+ * A requested lifetime for the delegation. The consumer sets the delegation's actual expiry — no later than this, and no later than its own cap — and returns it; absent means the consumer's default lifetime. MUST be in the future when the consumer executes the task.
22
+ */
23
+ expiresAt?: string;
24
+ /**
25
+ * An active delegation of the same identity to revoke in the same step as this enrolment. For a holder at the consumer's cap on active keys, whose other keys live on devices it no longer has: one authorized enrolment swaps a key out rather than needing a working key to revoke one first. Covered by the authority evidence like every other member, so evidence for adding a key cannot be reused to remove one.
26
+ */
27
+ replaces?: SigningKeyDid;
28
+ /**
29
+ * A complete, signed auth/signing-key/authorize/0.1 Trust Task document by which `identityDid` itself authorizes this enrolment: its payload is this payload with `authorization` removed. When present and valid it is the authority evidence of control over `identityDid`, in place of an operation-bound step-up. The consumer verifies it as a document in its own right — envelope, proof and payload against that specification's schemas — and over the members exactly as received: its proof covers every member, including ones this schema does not name, so it is deliberately an open object here rather than a typed one a binding could narrow.
30
+ */
31
+ authorization?: {};
32
+ ext?: Ext;
33
+ }
34
+ /**
35
+ * The delegation as stored. From this point a document the key signs is authorized by the identity's standing, read at execution time.
36
+ */
37
+ export interface AuthSigningKeyEnrollResponsePayload {
38
+ signingKey: SigningKey;
39
+ ext?: Ext;
40
+ }
41
+
42
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
43
+ export type { DeviceLabel, Ext, SigningKey, SigningKeyDid, SigningKeyScope };
44
+
45
+ /** Trust Task type URI. */
46
+ export const TYPE_URI = "https://trusttasks.org/spec/auth/signing-key/enroll/0.2" as const;
47
+
48
+ /** Stable alias for this specification's request payload shape. */
49
+ export type Payload = AuthSigningKeyEnrollPayload;
50
+
51
+ /** Trust Task response type URI (request type URI + "#response"). */
52
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/auth/signing-key/enroll/0.2#response" as const;
53
+
54
+ /** Stable alias for this specification's success-response payload shape. */
55
+ export type Response = AuthSigningKeyEnrollResponsePayload;
56
+
57
+ /**
58
+ * This specification's payload schema, as a value.
59
+ *
60
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
61
+ * rather than only as a `.json` file because TypeScript types are erased
62
+ * at runtime: without a schema a consumer has nothing to validate, and
63
+ * every REQUIRED payload member is optional in practice. Cross-file
64
+ * `$ref`s are already inlined, so it needs no resolver.
65
+ */
66
+ export const PAYLOAD_SCHEMA = {
67
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
68
+ "$id": "https://trusttasks.org/spec/auth/signing-key/enroll/0.2",
69
+ "title": "Auth — Signing Key Enroll — payload",
70
+ "description": "A freshly generated key asks to be enrolled as a signing-key delegation of an identity: documents it signs will be authorized by that identity's standing. The document is issued and proved by the key being enrolled, which is the proof that the enrolling party holds it; the identity it will act for is named in the payload and is established by the authority evidence the consumer requires — an operation-bound step-up, or the identity's own signed `authorization` — never by the key's own signature. Optionally replaces one of the identity's active keys in the same step. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "signingKeyDid",
75
+ "identityDid",
76
+ "scope"
77
+ ],
78
+ "properties": {
79
+ "signingKeyDid": {
80
+ "$ref": "#/$defs/SigningKeyDid"
81
+ },
82
+ "identityDid": {
83
+ "type": "string",
84
+ "pattern": "^did:",
85
+ "minLength": 5,
86
+ "maxLength": 2048,
87
+ "description": "The identity the key will act for — the DID whose standing a document signed by the key is authorized by. Naming it is not claiming it: the consumer establishes that the enrolling party controls this identity from separate authority evidence (Authorization)."
88
+ },
89
+ "scope": {
90
+ "$ref": "#/$defs/SigningKeyScope"
91
+ },
92
+ "deviceLabel": {
93
+ "$ref": "#/$defs/DeviceLabel"
94
+ },
95
+ "expiresAt": {
96
+ "type": "string",
97
+ "format": "date-time",
98
+ "description": "A requested lifetime for the delegation. The consumer sets the delegation's actual expiry — no later than this, and no later than its own cap — and returns it; absent means the consumer's default lifetime. MUST be in the future when the consumer executes the task."
99
+ },
100
+ "replaces": {
101
+ "$ref": "#/$defs/SigningKeyDid",
102
+ "description": "An active delegation of the same identity to revoke in the same step as this enrolment. For a holder at the consumer's cap on active keys, whose other keys live on devices it no longer has: one authorized enrolment swaps a key out rather than needing a working key to revoke one first. Covered by the authority evidence like every other member, so evidence for adding a key cannot be reused to remove one."
103
+ },
104
+ "authorization": {
105
+ "type": "object",
106
+ "description": "A complete, signed auth/signing-key/authorize/0.1 Trust Task document by which `identityDid` itself authorizes this enrolment: its payload is this payload with `authorization` removed. When present and valid it is the authority evidence of control over `identityDid`, in place of an operation-bound step-up. The consumer verifies it as a document in its own right — envelope, proof and payload against that specification's schemas — and over the members exactly as received: its proof covers every member, including ones this schema does not name, so it is deliberately an open object here rather than a typed one a binding could narrow."
107
+ },
108
+ "ext": {
109
+ "$ref": "#/$defs/Ext"
110
+ }
111
+ },
112
+ "$defs": {
113
+ "Response": {
114
+ "$anchor": "response",
115
+ "title": "Auth — Signing Key Enroll — response payload",
116
+ "description": "The delegation as stored. From this point a document the key signs is authorized by the identity's standing, read at execution time.",
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": [
120
+ "signingKey"
121
+ ],
122
+ "properties": {
123
+ "signingKey": {
124
+ "$ref": "#/$defs/SigningKey"
125
+ },
126
+ "ext": {
127
+ "$ref": "#/$defs/Ext"
128
+ }
129
+ }
130
+ },
131
+ "Ext": {
132
+ "title": "Ext",
133
+ "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.",
134
+ "type": "object",
135
+ "minProperties": 1,
136
+ "additionalProperties": true,
137
+ "propertyNames": {
138
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
139
+ }
140
+ },
141
+ "SigningKey": {
142
+ "title": "SigningKey",
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "required": [
146
+ "signingKeyDid",
147
+ "identityDid",
148
+ "scope",
149
+ "createdAt",
150
+ "expiresAt",
151
+ "active"
152
+ ],
153
+ "description": "One signing-key delegation, as its holder sees it. A delegation confers nothing of its own: it names an identity that already holds whatever standing it holds, and a document signed by the key is authorized by that identity's standing read at execution time.",
154
+ "properties": {
155
+ "signingKeyDid": {
156
+ "$ref": "#/$defs/SigningKeyDid"
157
+ },
158
+ "identityDid": {
159
+ "type": "string",
160
+ "pattern": "^did:",
161
+ "minLength": 5,
162
+ "maxLength": 2048,
163
+ "description": "The identity the key acts for. Included so a holder need not infer it."
164
+ },
165
+ "scope": {
166
+ "$ref": "#/$defs/SigningKeyScope"
167
+ },
168
+ "deviceLabel": {
169
+ "$ref": "#/$defs/DeviceLabel"
170
+ },
171
+ "createdAt": {
172
+ "type": "string",
173
+ "format": "date-time",
174
+ "description": "When the delegation was enrolled."
175
+ },
176
+ "expiresAt": {
177
+ "type": "string",
178
+ "format": "date-time",
179
+ "description": "When the delegation stops authorizing documents. Always present: the consumer sets it at enrolment and caps it at its own maximum lifetime, whatever the producer asked for, so no delegation outlives the consumer's policy."
180
+ },
181
+ "lastUsedAt": {
182
+ "type": "string",
183
+ "format": "date-time",
184
+ "description": "When the delegation last authorized a document, as far as the consumer recorded. A usability signal for choosing which key to revoke, recorded best-effort; its absence does not mean the key was never used."
185
+ },
186
+ "revokedAt": {
187
+ "type": "string",
188
+ "format": "date-time",
189
+ "description": "When the delegation was revoked. A revoked delegation authorizes nothing and its key cannot be enrolled again."
190
+ },
191
+ "active": {
192
+ "type": "boolean",
193
+ "description": "Whether the delegation authorizes documents right now: not revoked and not past `expiresAt`. Computed by the consumer with the predicate its verifier applies, so a holder does not re-implement it and disagree."
194
+ }
195
+ }
196
+ },
197
+ "DeviceLabel": {
198
+ "title": "DeviceLabel",
199
+ "type": "string",
200
+ "minLength": 1,
201
+ "maxLength": 128,
202
+ "description": "A human-readable name for where the key lives, chosen by the enrolling identity — e.g. `Work laptop — Chrome`. Read by that identity and by administrators deciding which key to revoke; retained with the delegation. Free text authored by the enrolling identity, untrusted, and attributed to it wherever it is rendered. Absent rather than invented when none was chosen: an invented label is indistinguishable from a chosen one to somebody deciding which key to revoke."
203
+ },
204
+ "SigningKeyScope": {
205
+ "title": "SigningKeyScope",
206
+ "type": "string",
207
+ "enum": [
208
+ "console"
209
+ ],
210
+ "description": "What a delegated key may be accepted for. `console`: the operations an administration console performs on the identity's behalf, authorized by the identity's own standing. Never an approver's signature on a consent or approval decision, whatever the scope: those require an `assertionMethod` key of the approver's own DID document, which a delegated key never is. A closed enumeration so a consumer cannot be asked for a scope it does not define; a later version adds values."
211
+ },
212
+ "SigningKeyDid": {
213
+ "title": "SigningKeyDid",
214
+ "type": "string",
215
+ "minLength": 9,
216
+ "maxLength": 256,
217
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
218
+ "description": "The delegated key, as a `did:key` — an Ed25519 multikey (`z6Mk…`) derived from the public half of a keypair the holder generated for itself, typically a non-extractable browser key. `did:key` only, because its document is a function of the key and resolves with no network: a key whose DID document could be rewritten after enrolment is not the key that was enrolled."
219
+ }
220
+ }
221
+ } as const;
222
+
223
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
224
+ export const RESPONSE_PAYLOAD_SCHEMA = {
225
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
226
+ "$ref": "#/$defs/Response",
227
+ "$defs": {
228
+ "Response": {
229
+ "$anchor": "response",
230
+ "title": "Auth — Signing Key Enroll — response payload",
231
+ "description": "The delegation as stored. From this point a document the key signs is authorized by the identity's standing, read at execution time.",
232
+ "type": "object",
233
+ "additionalProperties": false,
234
+ "required": [
235
+ "signingKey"
236
+ ],
237
+ "properties": {
238
+ "signingKey": {
239
+ "$ref": "#/$defs/SigningKey"
240
+ },
241
+ "ext": {
242
+ "$ref": "#/$defs/Ext"
243
+ }
244
+ }
245
+ },
246
+ "Ext": {
247
+ "title": "Ext",
248
+ "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.",
249
+ "type": "object",
250
+ "minProperties": 1,
251
+ "additionalProperties": true,
252
+ "propertyNames": {
253
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
254
+ }
255
+ },
256
+ "SigningKey": {
257
+ "title": "SigningKey",
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "required": [
261
+ "signingKeyDid",
262
+ "identityDid",
263
+ "scope",
264
+ "createdAt",
265
+ "expiresAt",
266
+ "active"
267
+ ],
268
+ "description": "One signing-key delegation, as its holder sees it. A delegation confers nothing of its own: it names an identity that already holds whatever standing it holds, and a document signed by the key is authorized by that identity's standing read at execution time.",
269
+ "properties": {
270
+ "signingKeyDid": {
271
+ "$ref": "#/$defs/SigningKeyDid"
272
+ },
273
+ "identityDid": {
274
+ "type": "string",
275
+ "pattern": "^did:",
276
+ "minLength": 5,
277
+ "maxLength": 2048,
278
+ "description": "The identity the key acts for. Included so a holder need not infer it."
279
+ },
280
+ "scope": {
281
+ "$ref": "#/$defs/SigningKeyScope"
282
+ },
283
+ "deviceLabel": {
284
+ "$ref": "#/$defs/DeviceLabel"
285
+ },
286
+ "createdAt": {
287
+ "type": "string",
288
+ "format": "date-time",
289
+ "description": "When the delegation was enrolled."
290
+ },
291
+ "expiresAt": {
292
+ "type": "string",
293
+ "format": "date-time",
294
+ "description": "When the delegation stops authorizing documents. Always present: the consumer sets it at enrolment and caps it at its own maximum lifetime, whatever the producer asked for, so no delegation outlives the consumer's policy."
295
+ },
296
+ "lastUsedAt": {
297
+ "type": "string",
298
+ "format": "date-time",
299
+ "description": "When the delegation last authorized a document, as far as the consumer recorded. A usability signal for choosing which key to revoke, recorded best-effort; its absence does not mean the key was never used."
300
+ },
301
+ "revokedAt": {
302
+ "type": "string",
303
+ "format": "date-time",
304
+ "description": "When the delegation was revoked. A revoked delegation authorizes nothing and its key cannot be enrolled again."
305
+ },
306
+ "active": {
307
+ "type": "boolean",
308
+ "description": "Whether the delegation authorizes documents right now: not revoked and not past `expiresAt`. Computed by the consumer with the predicate its verifier applies, so a holder does not re-implement it and disagree."
309
+ }
310
+ }
311
+ },
312
+ "DeviceLabel": {
313
+ "title": "DeviceLabel",
314
+ "type": "string",
315
+ "minLength": 1,
316
+ "maxLength": 128,
317
+ "description": "A human-readable name for where the key lives, chosen by the enrolling identity — e.g. `Work laptop — Chrome`. Read by that identity and by administrators deciding which key to revoke; retained with the delegation. Free text authored by the enrolling identity, untrusted, and attributed to it wherever it is rendered. Absent rather than invented when none was chosen: an invented label is indistinguishable from a chosen one to somebody deciding which key to revoke."
318
+ },
319
+ "SigningKeyScope": {
320
+ "title": "SigningKeyScope",
321
+ "type": "string",
322
+ "enum": [
323
+ "console"
324
+ ],
325
+ "description": "What a delegated key may be accepted for. `console`: the operations an administration console performs on the identity's behalf, authorized by the identity's own standing. Never an approver's signature on a consent or approval decision, whatever the scope: those require an `assertionMethod` key of the approver's own DID document, which a delegated key never is. A closed enumeration so a consumer cannot be asked for a scope it does not define; a later version adds values."
326
+ },
327
+ "SigningKeyDid": {
328
+ "title": "SigningKeyDid",
329
+ "type": "string",
330
+ "minLength": 9,
331
+ "maxLength": 256,
332
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
333
+ "description": "The delegated key, as a `did:key` — an Ed25519 multikey (`z6Mk…`) derived from the public half of a keypair the holder generated for itself, typically a non-extractable browser key. `did:key` only, because its document is a function of the key and resolves with no network: a key whose DID document could be rewritten after enrolment is not the key that was enrolled."
334
+ }
335
+ }
336
+ } as const;
337
+
338
+ /**
339
+ * SPEC.md §7.2 policy for the request variant, from this specification's
340
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
341
+ * per-specification and cannot be derived from the document alone, and
342
+ * item 2 needs the schema this carries.
343
+ */
344
+ export const SPEC = {
345
+ typeUri: TYPE_URI,
346
+ isBearer: false,
347
+ isProofRequired: true,
348
+ isRecipientRequired: true,
349
+ isIssuedAtRequired: true,
350
+ payloadSchema: PAYLOAD_SCHEMA,
351
+ } as const;
352
+
353
+ /**
354
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
355
+ * tracks the *issuer* party's requirement because a response swaps the
356
+ * parties (§7.3 item 5).
357
+ */
358
+ export const RESPONSE_SPEC = {
359
+ typeUri: RESPONSE_TYPE_URI,
360
+ isBearer: false,
361
+ isProofRequired: false,
362
+ isRecipientRequired: true,
363
+ isIssuedAtRequired: true,
364
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
365
+ } as const;