@openvtc/trust-tasks 0.21.13 → 0.21.15

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 (70) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/_shared/components.d.ts +91 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/auth/_shared/0.3/session.d.ts +16 -0
  5. package/dist/auth/_shared/0.3/session.d.ts.map +1 -0
  6. package/dist/auth/_shared/0.3/session.js +6 -0
  7. package/dist/auth/_shared/0.3/session.js.map +1 -0
  8. package/dist/auth/authenticate/0.3/payload.d.ts +852 -0
  9. package/dist/auth/authenticate/0.3/payload.d.ts.map +1 -0
  10. package/dist/auth/authenticate/0.3/payload.js +442 -0
  11. package/dist/auth/authenticate/0.3/payload.js.map +1 -0
  12. package/dist/auth/refresh/0.2/payload.d.ts +729 -0
  13. package/dist/auth/refresh/0.2/payload.d.ts.map +1 -0
  14. package/dist/auth/refresh/0.2/payload.js +392 -0
  15. package/dist/auth/refresh/0.2/payload.js.map +1 -0
  16. package/dist/git-ns/_shared/0.5/git-ns.d.ts +16 -0
  17. package/dist/git-ns/_shared/0.5/git-ns.d.ts.map +1 -0
  18. package/dist/git-ns/_shared/0.5/git-ns.js +6 -0
  19. package/dist/git-ns/_shared/0.5/git-ns.js.map +1 -0
  20. package/dist/git-ns/account/list/0.1/payload.d.ts +598 -0
  21. package/dist/git-ns/account/list/0.1/payload.d.ts.map +1 -0
  22. package/dist/git-ns/account/list/0.1/payload.js +317 -0
  23. package/dist/git-ns/account/list/0.1/payload.js.map +1 -0
  24. package/dist/git-ns/activity/list/0.1/payload.d.ts +642 -0
  25. package/dist/git-ns/activity/list/0.1/payload.d.ts.map +1 -0
  26. package/dist/git-ns/activity/list/0.1/payload.js +343 -0
  27. package/dist/git-ns/activity/list/0.1/payload.js.map +1 -0
  28. package/dist/git-ns/bridge/job/list/0.1/payload.d.ts +697 -0
  29. package/dist/git-ns/bridge/job/list/0.1/payload.d.ts.map +1 -0
  30. package/dist/git-ns/bridge/job/list/0.1/payload.js +386 -0
  31. package/dist/git-ns/bridge/job/list/0.1/payload.js.map +1 -0
  32. package/dist/git-ns/projection/show/0.1/payload.d.ts +705 -0
  33. package/dist/git-ns/projection/show/0.1/payload.d.ts.map +1 -0
  34. package/dist/git-ns/projection/show/0.1/payload.js +377 -0
  35. package/dist/git-ns/projection/show/0.1/payload.js.map +1 -0
  36. package/dist/git-ns/right/issued-by-departed/0.1/payload.d.ts +862 -0
  37. package/dist/git-ns/right/issued-by-departed/0.1/payload.d.ts.map +1 -0
  38. package/dist/git-ns/right/issued-by-departed/0.1/payload.js +487 -0
  39. package/dist/git-ns/right/issued-by-departed/0.1/payload.js.map +1 -0
  40. package/dist/git-ns/right/list/0.1/payload.d.ts +773 -0
  41. package/dist/git-ns/right/list/0.1/payload.d.ts.map +1 -0
  42. package/dist/git-ns/right/list/0.1/payload.js +439 -0
  43. package/dist/git-ns/right/list/0.1/payload.js.map +1 -0
  44. package/dist/index.d.ts +12 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +12 -0
  47. package/dist/index.js.map +1 -1
  48. package/dist/vtc/relationships/revoke/0.2/payload.d.ts +287 -0
  49. package/dist/vtc/relationships/revoke/0.2/payload.d.ts.map +1 -0
  50. package/dist/vtc/relationships/revoke/0.2/payload.js +159 -0
  51. package/dist/vtc/relationships/revoke/0.2/payload.js.map +1 -0
  52. package/dist/vtc/vetting/vetters/resend/0.2/payload.d.ts +254 -0
  53. package/dist/vtc/vetting/vetters/resend/0.2/payload.d.ts.map +1 -0
  54. package/dist/vtc/vetting/vetters/resend/0.2/payload.js +142 -0
  55. package/dist/vtc/vetting/vetters/resend/0.2/payload.js.map +1 -0
  56. package/package.json +1 -1
  57. package/src/_shared/components.ts +91 -0
  58. package/src/auth/_shared/0.3/session.ts +17 -0
  59. package/src/auth/authenticate/0.3/payload.ts +527 -0
  60. package/src/auth/refresh/0.2/payload.ts +444 -0
  61. package/src/git-ns/_shared/0.5/git-ns.ts +17 -0
  62. package/src/git-ns/account/list/0.1/payload.ts +392 -0
  63. package/src/git-ns/activity/list/0.1/payload.ts +430 -0
  64. package/src/git-ns/bridge/job/list/0.1/payload.ts +490 -0
  65. package/src/git-ns/projection/show/0.1/payload.ts +479 -0
  66. package/src/git-ns/right/issued-by-departed/0.1/payload.ts +550 -0
  67. package/src/git-ns/right/list/0.1/payload.ts +493 -0
  68. package/src/index.ts +12 -0
  69. package/src/vtc/relationships/revoke/0.2/payload.ts +209 -0
  70. package/src/vtc/vetting/vetters/resend/0.2/payload.ts +183 -0
@@ -0,0 +1,527 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/auth/authenticate/0.3/payload.schema.json
4
+ */
5
+
6
+ import type { Ext, Session_AuthV0_3 as Session, TokenBundle } from "../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * The subject presents a previously-issued challenge along with the framework `proof` that binds the document to a VID. The proof IS the authentication. 0.3 adds an optional proxied form: `principal` names a party the signer authenticates *as*, distinct from `issuer` (the signer, e.g. a VTA acting on the principal's behalf), together with `delegationEvidence` establishing the entitlement. Absent `principal`, or `principal` equal to `issuer`, is the ordinary auth/authenticate/0.2 form unchanged. 0.3 also carries forward the optional `sessionKey` member from 0.2.
11
+ */
12
+ export interface AuthAuthenticate {
13
+ /**
14
+ * The exact challenge value returned by a prior auth/challenge call. Consumers MUST reject mismatch, expired, or re-used challenges.
15
+ */
16
+ challenge: string;
17
+ /**
18
+ * The sessionId returned alongside the challenge. Consumers use it to look up the server-side challenge binding.
19
+ */
20
+ sessionId: string;
21
+ /**
22
+ * Optional capability tags being requested on the issued tokens. The consumer's authorization layer decides which are granted; the issued TokenBundle's `scope` MAY be a subset.
23
+ */
24
+ scope?: string[];
25
+ /**
26
+ * The VID being authenticated as, when it differs from the signer of this document. Present and unequal to `issuer` marks a *proxied* authenticate: `issuer` is a delegate (typically the principal's VTA) presenting its own proof, and `payload.delegationEvidence` MUST also be present, describing what entitles `issuer` to act for `principal`. Omitted, or equal to `issuer`, is the ordinary case: the signer authenticates as itself, exactly as auth/authenticate/0.2. See Authorization and Security & Privacy.
27
+ */
28
+ principal?: string;
29
+ /**
30
+ * REQUIRED whenever `principal` is present and differs from `issuer`; MUST be omitted otherwise. Describes the evidence that entitles `issuer` to authenticate as `principal`. The framework does not prescribe its shape — see Authorization — but the consumer's policy MUST verify it independently rather than take `issuer`'s claim of entitlement at face value.
31
+ */
32
+ delegationEvidence?: {
33
+ /**
34
+ * Consumer-defined vocabulary naming the evidence class (e.g. "vtaContext", "mandateCredential"). The framework imposes no syntax; an unrecognized `kind` is refused with `auth/authenticate:delegationNotRecognized`.
35
+ */
36
+ kind: string;
37
+ /**
38
+ * The evidence itself, inline — typically a Verifiable Credential or other signed assertion binding `issuer` to `principal`. Opaque to the framework; shape is consumer- or ecosystem-defined by `kind`.
39
+ */
40
+ credential?: {};
41
+ /**
42
+ * Alternative to inlining `credential`: an opaque reference (an id, a URL) to evidence the consumer already holds — for example a previously-registered VTA context binding. Consumer-defined; mutually informative with `credential`, not mutually exclusive — a producer MAY supply both.
43
+ */
44
+ reference?: string;
45
+ /**
46
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
47
+ */
48
+ ext?: Ext;
49
+ };
50
+ /**
51
+ * A did:key VID the producer asks the consumer to bind to the session this authenticate document creates. The producer MUST hold the corresponding private key and SHOULD keep it non-extractable (for example, a WebCrypto non-extractable key). Once bound, the consumer MUST accept a framework `proof` made by this key, with `proofPurpose: authentication`, as the session's `subject` — for this session only, bounded by the session's `expiresAt` and `acr`, and never where a specification requires an `assertionMethod` attestation (SPEC.md §7.2 item 10; see Security & Privacy). Behaves identically whether or not this document is a proxied authenticate. The consumer MAY refuse a key type it does not support with `auth/authenticate:sessionKeyUnsupported`.
52
+ */
53
+ sessionKey?: string;
54
+ /**
55
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
56
+ */
57
+ ext?: Ext;
58
+ }
59
+ /**
60
+ * Issued by the auth service after verifying the proof on the authenticate document (and, for a proxied request, the delegation evidence). Carried in a Trust Task document whose type is https://trusttasks.org/spec/auth/authenticate/0.3#response.
61
+ */
62
+ export interface AuthAuthenticateResponsePayload {
63
+ /**
64
+ * The session the consumer has just created for this subject. `session.subject` is `principal` for a proxied request, `issuer` otherwise; `session.actor` is present and equal to `issuer` only for a proxied request. Carries `sessionKey` when the request bound one.
65
+ */
66
+ session: Session;
67
+ /**
68
+ * Access + optional refresh tokens. Consumers MAY omit a refresh token when their policy doesn't support refresh.
69
+ */
70
+ tokens: TokenBundle;
71
+ /**
72
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
73
+ */
74
+ ext?: Ext;
75
+ }
76
+
77
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
78
+ export type { Ext, Session, TokenBundle };
79
+
80
+ /** Trust Task type URI. */
81
+ export const TYPE_URI = "https://trusttasks.org/spec/auth/authenticate/0.3" as const;
82
+
83
+ /** Stable alias for this specification's request payload shape. */
84
+ export type Payload = AuthAuthenticate;
85
+
86
+ /** Trust Task response type URI (request type URI + "#response"). */
87
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/auth/authenticate/0.3#response" as const;
88
+
89
+ /** Stable alias for this specification's success-response payload shape. */
90
+ export type Response = AuthAuthenticateResponsePayload;
91
+
92
+ /**
93
+ * This specification's payload schema, as a value.
94
+ *
95
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
96
+ * rather than only as a `.json` file because TypeScript types are erased
97
+ * at runtime: without a schema a consumer has nothing to validate, and
98
+ * every REQUIRED payload member is optional in practice. Cross-file
99
+ * `$ref`s are already inlined, so it needs no resolver.
100
+ */
101
+ export const PAYLOAD_SCHEMA = {
102
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
103
+ "$id": "https://trusttasks.org/spec/auth/authenticate/0.3",
104
+ "title": "Auth — Authenticate",
105
+ "description": "The subject presents a previously-issued challenge along with the framework `proof` that binds the document to a VID. The proof IS the authentication. 0.3 adds an optional proxied form: `principal` names a party the signer authenticates *as*, distinct from `issuer` (the signer, e.g. a VTA acting on the principal's behalf), together with `delegationEvidence` establishing the entitlement. Absent `principal`, or `principal` equal to `issuer`, is the ordinary auth/authenticate/0.2 form unchanged. 0.3 also carries forward the optional `sessionKey` member from 0.2.",
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "required": [
109
+ "challenge",
110
+ "sessionId"
111
+ ],
112
+ "properties": {
113
+ "challenge": {
114
+ "type": "string",
115
+ "minLength": 16,
116
+ "description": "The exact challenge value returned by a prior auth/challenge call. Consumers MUST reject mismatch, expired, or re-used challenges."
117
+ },
118
+ "sessionId": {
119
+ "type": "string",
120
+ "minLength": 1,
121
+ "description": "The sessionId returned alongside the challenge. Consumers use it to look up the server-side challenge binding."
122
+ },
123
+ "scope": {
124
+ "type": "array",
125
+ "items": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "description": "Optional capability tags being requested on the issued tokens. The consumer's authorization layer decides which are granted; the issued TokenBundle's `scope` MAY be a subset."
130
+ },
131
+ "principal": {
132
+ "type": "string",
133
+ "pattern": "^did:",
134
+ "maxLength": 2048,
135
+ "description": "The VID being authenticated as, when it differs from the signer of this document. Present and unequal to `issuer` marks a *proxied* authenticate: `issuer` is a delegate (typically the principal's VTA) presenting its own proof, and `payload.delegationEvidence` MUST also be present, describing what entitles `issuer` to act for `principal`. Omitted, or equal to `issuer`, is the ordinary case: the signer authenticates as itself, exactly as auth/authenticate/0.2. See Authorization and Security & Privacy."
136
+ },
137
+ "delegationEvidence": {
138
+ "type": "object",
139
+ "additionalProperties": false,
140
+ "required": [
141
+ "kind"
142
+ ],
143
+ "description": "REQUIRED whenever `principal` is present and differs from `issuer`; MUST be omitted otherwise. Describes the evidence that entitles `issuer` to authenticate as `principal`. The framework does not prescribe its shape — see Authorization — but the consumer's policy MUST verify it independently rather than take `issuer`'s claim of entitlement at face value.",
144
+ "properties": {
145
+ "kind": {
146
+ "type": "string",
147
+ "minLength": 1,
148
+ "maxLength": 64,
149
+ "description": "Consumer-defined vocabulary naming the evidence class (e.g. \"vtaContext\", \"mandateCredential\"). The framework imposes no syntax; an unrecognized `kind` is refused with `auth/authenticate:delegationNotRecognized`."
150
+ },
151
+ "credential": {
152
+ "type": "object",
153
+ "description": "The evidence itself, inline — typically a Verifiable Credential or other signed assertion binding `issuer` to `principal`. Opaque to the framework; shape is consumer- or ecosystem-defined by `kind`."
154
+ },
155
+ "reference": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "maxLength": 2048,
159
+ "description": "Alternative to inlining `credential`: an opaque reference (an id, a URL) to evidence the consumer already holds — for example a previously-registered VTA context binding. Consumer-defined; mutually informative with `credential`, not mutually exclusive — a producer MAY supply both."
160
+ },
161
+ "ext": {
162
+ "$ref": "#/$defs/Ext",
163
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
164
+ }
165
+ }
166
+ },
167
+ "sessionKey": {
168
+ "type": "string",
169
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
170
+ "maxLength": 512,
171
+ "description": "A did:key VID the producer asks the consumer to bind to the session this authenticate document creates. The producer MUST hold the corresponding private key and SHOULD keep it non-extractable (for example, a WebCrypto non-extractable key). Once bound, the consumer MUST accept a framework `proof` made by this key, with `proofPurpose: authentication`, as the session's `subject` — for this session only, bounded by the session's `expiresAt` and `acr`, and never where a specification requires an `assertionMethod` attestation (SPEC.md §7.2 item 10; see Security & Privacy). Behaves identically whether or not this document is a proxied authenticate. The consumer MAY refuse a key type it does not support with `auth/authenticate:sessionKeyUnsupported`."
172
+ },
173
+ "ext": {
174
+ "$ref": "#/$defs/Ext",
175
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
176
+ }
177
+ },
178
+ "$defs": {
179
+ "Response": {
180
+ "$anchor": "response",
181
+ "title": "Auth Authenticate — response payload",
182
+ "description": "Issued by the auth service after verifying the proof on the authenticate document (and, for a proxied request, the delegation evidence). Carried in a Trust Task document whose type is https://trusttasks.org/spec/auth/authenticate/0.3#response.",
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": [
186
+ "session",
187
+ "tokens"
188
+ ],
189
+ "properties": {
190
+ "session": {
191
+ "$ref": "#/$defs/Session",
192
+ "description": "The session the consumer has just created for this subject. `session.subject` is `principal` for a proxied request, `issuer` otherwise; `session.actor` is present and equal to `issuer` only for a proxied request. Carries `sessionKey` when the request bound one."
193
+ },
194
+ "tokens": {
195
+ "$ref": "#/$defs/TokenBundle",
196
+ "description": "Access + optional refresh tokens. Consumers MAY omit a refresh token when their policy doesn't support refresh."
197
+ },
198
+ "ext": {
199
+ "$ref": "#/$defs/Ext",
200
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
201
+ }
202
+ }
203
+ },
204
+ "Ext": {
205
+ "title": "Ext",
206
+ "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.",
207
+ "type": "object",
208
+ "minProperties": 1,
209
+ "additionalProperties": true,
210
+ "propertyNames": {
211
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
212
+ }
213
+ },
214
+ "TokenBundle": {
215
+ "$anchor": "tokenBundle",
216
+ "title": "TokenBundle",
217
+ "description": "An access token (typically short-lived JWT) paired with an optional refresh token (typically long-lived opaque string). The shapes follow OAuth 2.0 (RFC 6749 §5.1) conventions but are not coupled to any particular OAuth profile.",
218
+ "type": "object",
219
+ "additionalProperties": false,
220
+ "required": [
221
+ "accessToken",
222
+ "tokenType",
223
+ "expiresIn"
224
+ ],
225
+ "properties": {
226
+ "accessToken": {
227
+ "type": "string",
228
+ "minLength": 1,
229
+ "description": "Bearer-style access token. Consumers presenting this token to downstream services prove the holder of the original session. Format is consumer-defined — JWT is common, but opaque strings are also valid."
230
+ },
231
+ "refreshToken": {
232
+ "type": "string",
233
+ "minLength": 1,
234
+ "description": "Long-lived token redeemable via auth/refresh for a new access token. MAY be absent when the issuer does not support refresh."
235
+ },
236
+ "tokenType": {
237
+ "type": "string",
238
+ "minLength": 1,
239
+ "description": "Token presentation scheme. Almost always \"Bearer\"; reserved for future schemes."
240
+ },
241
+ "expiresIn": {
242
+ "type": "integer",
243
+ "minimum": 1,
244
+ "description": "Seconds from issuance until the access token expires."
245
+ },
246
+ "refreshExpiresIn": {
247
+ "type": "integer",
248
+ "minimum": 1,
249
+ "description": "Seconds from issuance until the refresh token expires, when one was issued."
250
+ },
251
+ "scope": {
252
+ "type": "array",
253
+ "items": {
254
+ "type": "string",
255
+ "minLength": 1
256
+ },
257
+ "description": "Capability tags effective on this token. Format is consumer-defined; the framework imposes no syntax."
258
+ },
259
+ "ext": {
260
+ "$ref": "#/$defs/Ext",
261
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
262
+ }
263
+ }
264
+ },
265
+ "Session": {
266
+ "$anchor": "session",
267
+ "title": "Session",
268
+ "description": "A logical authentication context bound to a subject. Producers and consumers exchange Session-shaped data in challenge issuance, authentication responses, and introspection (whoami).",
269
+ "type": "object",
270
+ "additionalProperties": false,
271
+ "required": [
272
+ "id",
273
+ "subject",
274
+ "issuedAt",
275
+ "expiresAt"
276
+ ],
277
+ "properties": {
278
+ "id": {
279
+ "type": "string",
280
+ "minLength": 1,
281
+ "description": "Opaque, server-chosen session identifier. Stable for the lifetime of the session. Consumers MUST treat the value as opaque; no structure is implied."
282
+ },
283
+ "subject": {
284
+ "type": "string",
285
+ "minLength": 1,
286
+ "description": "The authenticated party's VID (typically a DID URL). For a session established by a proxied login (auth/authenticate/0.3), this is the *principal* being authenticated as — never the delegate that signed the authenticate document; see `actor`."
287
+ },
288
+ "issuedAt": {
289
+ "type": "string",
290
+ "format": "date-time",
291
+ "description": "ISO-8601 timestamp when the session was created."
292
+ },
293
+ "expiresAt": {
294
+ "type": "string",
295
+ "format": "date-time",
296
+ "description": "ISO-8601 timestamp when the session ceases to be valid. Producers SHOULD refresh before this time; consumers MUST reject after. A consumer honouring `absoluteExpiresAt` MUST NOT advance this value past it, by refresh or any other means."
297
+ },
298
+ "amr": {
299
+ "type": "array",
300
+ "minItems": 1,
301
+ "items": {
302
+ "type": "string",
303
+ "minLength": 1
304
+ },
305
+ "description": "Authentication Methods References per [RFC 8176]. Typical values: \"did\" (challenge-response), \"passkey\" (WebAuthn), \"vta\" (verifiable-trust agent approval). Multi-factor sessions list every method used."
306
+ },
307
+ "acr": {
308
+ "type": "string",
309
+ "description": "Authentication Context Class Reference per [OIDC Core §2]. Profiles define their own values; the recommended set is \"aal1\" (single-factor DID auth), \"aal2\" (a second possession-or-biometric factor confirmed), and \"aal3\" (hardware-bound second factor)."
310
+ },
311
+ "sessionKey": {
312
+ "type": "string",
313
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
314
+ "maxLength": 512,
315
+ "description": "The did:key VID bound to this session by auth/authenticate/0.2 or 0.3, when the producer registered one. Present here so introspection (auth/whoami, auth/sessions/list) can show the binding a client already holds; it is descriptive, not an additional grant — the binding, its scope and its lifetime are governed entirely by the auth/authenticate specification version that established it. Absent when the session was established without a session key, or by a specification version that does not carry one."
316
+ },
317
+ "actor": {
318
+ "type": "string",
319
+ "minLength": 1,
320
+ "maxLength": 2048,
321
+ "description": "The delegate's VID — the party whose `proof` actually authenticated this session — when this session was established by a *proxied* login (auth/authenticate/0.3, `payload.principal` present and distinct from `issuer`). Absent whenever `subject` authenticated with its own key, including every auth/authenticate/0.1 and /0.2 session and an auth/authenticate/0.3 request where `principal` is absent or equals `issuer`. Carrying `actor` separately from `subject` is what lets an audit trail, a revocation, or a response to a compromised delegate name the true acting party without conflating it with the principal it acted for — see auth/authenticate/0.3 Security & Privacy (Correlation)."
322
+ },
323
+ "absoluteExpiresAt": {
324
+ "type": "string",
325
+ "format": "date-time",
326
+ "description": "The instant beyond which this session's `expiresAt` MUST NOT be advanced, by auth/refresh/0.2 or by any other means — an absolute session lifetime set once at authentication and never moved forward. Consumers that impose no such ceiling beyond the session's own rolling `expiresAt` omit this member; its absence is not itself a claim that the session is unbounded, only that this response does not state a bound. See auth/refresh/0.2 Conformance and Security & Privacy for the enforcement rule."
327
+ },
328
+ "ext": {
329
+ "$ref": "#/$defs/Ext",
330
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
331
+ }
332
+ }
333
+ }
334
+ }
335
+ } as const;
336
+
337
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
338
+ export const RESPONSE_PAYLOAD_SCHEMA = {
339
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
340
+ "$ref": "#/$defs/Response",
341
+ "$defs": {
342
+ "Response": {
343
+ "$anchor": "response",
344
+ "title": "Auth Authenticate — response payload",
345
+ "description": "Issued by the auth service after verifying the proof on the authenticate document (and, for a proxied request, the delegation evidence). Carried in a Trust Task document whose type is https://trusttasks.org/spec/auth/authenticate/0.3#response.",
346
+ "type": "object",
347
+ "additionalProperties": false,
348
+ "required": [
349
+ "session",
350
+ "tokens"
351
+ ],
352
+ "properties": {
353
+ "session": {
354
+ "$ref": "#/$defs/Session",
355
+ "description": "The session the consumer has just created for this subject. `session.subject` is `principal` for a proxied request, `issuer` otherwise; `session.actor` is present and equal to `issuer` only for a proxied request. Carries `sessionKey` when the request bound one."
356
+ },
357
+ "tokens": {
358
+ "$ref": "#/$defs/TokenBundle",
359
+ "description": "Access + optional refresh tokens. Consumers MAY omit a refresh token when their policy doesn't support refresh."
360
+ },
361
+ "ext": {
362
+ "$ref": "#/$defs/Ext",
363
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
364
+ }
365
+ }
366
+ },
367
+ "Ext": {
368
+ "title": "Ext",
369
+ "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.",
370
+ "type": "object",
371
+ "minProperties": 1,
372
+ "additionalProperties": true,
373
+ "propertyNames": {
374
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
375
+ }
376
+ },
377
+ "TokenBundle": {
378
+ "$anchor": "tokenBundle",
379
+ "title": "TokenBundle",
380
+ "description": "An access token (typically short-lived JWT) paired with an optional refresh token (typically long-lived opaque string). The shapes follow OAuth 2.0 (RFC 6749 §5.1) conventions but are not coupled to any particular OAuth profile.",
381
+ "type": "object",
382
+ "additionalProperties": false,
383
+ "required": [
384
+ "accessToken",
385
+ "tokenType",
386
+ "expiresIn"
387
+ ],
388
+ "properties": {
389
+ "accessToken": {
390
+ "type": "string",
391
+ "minLength": 1,
392
+ "description": "Bearer-style access token. Consumers presenting this token to downstream services prove the holder of the original session. Format is consumer-defined — JWT is common, but opaque strings are also valid."
393
+ },
394
+ "refreshToken": {
395
+ "type": "string",
396
+ "minLength": 1,
397
+ "description": "Long-lived token redeemable via auth/refresh for a new access token. MAY be absent when the issuer does not support refresh."
398
+ },
399
+ "tokenType": {
400
+ "type": "string",
401
+ "minLength": 1,
402
+ "description": "Token presentation scheme. Almost always \"Bearer\"; reserved for future schemes."
403
+ },
404
+ "expiresIn": {
405
+ "type": "integer",
406
+ "minimum": 1,
407
+ "description": "Seconds from issuance until the access token expires."
408
+ },
409
+ "refreshExpiresIn": {
410
+ "type": "integer",
411
+ "minimum": 1,
412
+ "description": "Seconds from issuance until the refresh token expires, when one was issued."
413
+ },
414
+ "scope": {
415
+ "type": "array",
416
+ "items": {
417
+ "type": "string",
418
+ "minLength": 1
419
+ },
420
+ "description": "Capability tags effective on this token. Format is consumer-defined; the framework imposes no syntax."
421
+ },
422
+ "ext": {
423
+ "$ref": "#/$defs/Ext",
424
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
425
+ }
426
+ }
427
+ },
428
+ "Session": {
429
+ "$anchor": "session",
430
+ "title": "Session",
431
+ "description": "A logical authentication context bound to a subject. Producers and consumers exchange Session-shaped data in challenge issuance, authentication responses, and introspection (whoami).",
432
+ "type": "object",
433
+ "additionalProperties": false,
434
+ "required": [
435
+ "id",
436
+ "subject",
437
+ "issuedAt",
438
+ "expiresAt"
439
+ ],
440
+ "properties": {
441
+ "id": {
442
+ "type": "string",
443
+ "minLength": 1,
444
+ "description": "Opaque, server-chosen session identifier. Stable for the lifetime of the session. Consumers MUST treat the value as opaque; no structure is implied."
445
+ },
446
+ "subject": {
447
+ "type": "string",
448
+ "minLength": 1,
449
+ "description": "The authenticated party's VID (typically a DID URL). For a session established by a proxied login (auth/authenticate/0.3), this is the *principal* being authenticated as — never the delegate that signed the authenticate document; see `actor`."
450
+ },
451
+ "issuedAt": {
452
+ "type": "string",
453
+ "format": "date-time",
454
+ "description": "ISO-8601 timestamp when the session was created."
455
+ },
456
+ "expiresAt": {
457
+ "type": "string",
458
+ "format": "date-time",
459
+ "description": "ISO-8601 timestamp when the session ceases to be valid. Producers SHOULD refresh before this time; consumers MUST reject after. A consumer honouring `absoluteExpiresAt` MUST NOT advance this value past it, by refresh or any other means."
460
+ },
461
+ "amr": {
462
+ "type": "array",
463
+ "minItems": 1,
464
+ "items": {
465
+ "type": "string",
466
+ "minLength": 1
467
+ },
468
+ "description": "Authentication Methods References per [RFC 8176]. Typical values: \"did\" (challenge-response), \"passkey\" (WebAuthn), \"vta\" (verifiable-trust agent approval). Multi-factor sessions list every method used."
469
+ },
470
+ "acr": {
471
+ "type": "string",
472
+ "description": "Authentication Context Class Reference per [OIDC Core §2]. Profiles define their own values; the recommended set is \"aal1\" (single-factor DID auth), \"aal2\" (a second possession-or-biometric factor confirmed), and \"aal3\" (hardware-bound second factor)."
473
+ },
474
+ "sessionKey": {
475
+ "type": "string",
476
+ "pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]+$",
477
+ "maxLength": 512,
478
+ "description": "The did:key VID bound to this session by auth/authenticate/0.2 or 0.3, when the producer registered one. Present here so introspection (auth/whoami, auth/sessions/list) can show the binding a client already holds; it is descriptive, not an additional grant — the binding, its scope and its lifetime are governed entirely by the auth/authenticate specification version that established it. Absent when the session was established without a session key, or by a specification version that does not carry one."
479
+ },
480
+ "actor": {
481
+ "type": "string",
482
+ "minLength": 1,
483
+ "maxLength": 2048,
484
+ "description": "The delegate's VID — the party whose `proof` actually authenticated this session — when this session was established by a *proxied* login (auth/authenticate/0.3, `payload.principal` present and distinct from `issuer`). Absent whenever `subject` authenticated with its own key, including every auth/authenticate/0.1 and /0.2 session and an auth/authenticate/0.3 request where `principal` is absent or equals `issuer`. Carrying `actor` separately from `subject` is what lets an audit trail, a revocation, or a response to a compromised delegate name the true acting party without conflating it with the principal it acted for — see auth/authenticate/0.3 Security & Privacy (Correlation)."
485
+ },
486
+ "absoluteExpiresAt": {
487
+ "type": "string",
488
+ "format": "date-time",
489
+ "description": "The instant beyond which this session's `expiresAt` MUST NOT be advanced, by auth/refresh/0.2 or by any other means — an absolute session lifetime set once at authentication and never moved forward. Consumers that impose no such ceiling beyond the session's own rolling `expiresAt` omit this member; its absence is not itself a claim that the session is unbounded, only that this response does not state a bound. See auth/refresh/0.2 Conformance and Security & Privacy for the enforcement rule."
490
+ },
491
+ "ext": {
492
+ "$ref": "#/$defs/Ext",
493
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
494
+ }
495
+ }
496
+ }
497
+ }
498
+ } as const;
499
+
500
+ /**
501
+ * SPEC.md §7.2 policy for the request variant, from this specification's
502
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
503
+ * per-specification and cannot be derived from the document alone, and
504
+ * item 2 needs the schema this carries.
505
+ */
506
+ export const SPEC = {
507
+ typeUri: TYPE_URI,
508
+ isBearer: false,
509
+ isProofRequired: true,
510
+ isRecipientRequired: true,
511
+ isIssuedAtRequired: true,
512
+ payloadSchema: PAYLOAD_SCHEMA,
513
+ } as const;
514
+
515
+ /**
516
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
517
+ * tracks the *issuer* party's requirement because a response swaps the
518
+ * parties (§7.3 item 5).
519
+ */
520
+ export const RESPONSE_SPEC = {
521
+ typeUri: RESPONSE_TYPE_URI,
522
+ isBearer: false,
523
+ isProofRequired: true,
524
+ isRecipientRequired: true,
525
+ isIssuedAtRequired: true,
526
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
527
+ } as const;