@openvtc/trust-tasks 0.12.11 → 0.12.13

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.
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/auth/recognise/0.2/payload.schema.json
4
+ */
5
+ /** Trust Task type URI. */
6
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/auth/recognise/0.2";
7
+ /** Trust Task response type URI (request type URI + "#response"). */
8
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/auth/recognise/0.2#response";
9
+ /**
10
+ * This specification's payload schema, as a value.
11
+ *
12
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
13
+ * rather than only as a `.json` file because TypeScript types are erased
14
+ * at runtime: without a schema a consumer has nothing to validate, and
15
+ * every REQUIRED payload member is optional in practice. Cross-file
16
+ * `$ref`s are already inlined, so it needs no resolver.
17
+ */
18
+ export const PAYLOAD_SCHEMA = {
19
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
20
+ "$id": "https://trusttasks.org/spec/vtc/auth/recognise/0.2",
21
+ "title": "VTC Auth Recognise — payload",
22
+ "type": "object",
23
+ "additionalProperties": false,
24
+ "required": [
25
+ "presentation"
26
+ ],
27
+ "properties": {
28
+ "presentation": {
29
+ "type": "object",
30
+ "description": "A holder-signed W3C Verifiable Presentation embedding the foreign membership and endorsement credentials in `verifiableCredential`.\n\nThe holder proof MUST use `proofPurpose: authentication`, MUST commit to the single-use `nonce` issued by `vtc/auth/recognise/challenge`, and MUST name the recognising community's DID as `domain`. A consumer MUST verify the holder proof, verify each embedded credential's issuer proof, and refuse unless the presentation's holder is the credentials' subject."
31
+ },
32
+ "ext": {
33
+ "$ref": "#/$defs/Ext"
34
+ }
35
+ },
36
+ "$defs": {
37
+ "Response": {
38
+ "$anchor": "response",
39
+ "title": "VTC Auth Recognise — response payload",
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": [
43
+ "sessionId",
44
+ "data"
45
+ ],
46
+ "properties": {
47
+ "sessionId": {
48
+ "type": "string",
49
+ "pattern": "^xc-",
50
+ "description": "A cross-community session id (xc-<uuid>), distinguishing it from local-member sessions."
51
+ },
52
+ "data": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": [
56
+ "accessToken",
57
+ "accessExpiresAt",
58
+ "foreignIssuerDid",
59
+ "mappedRole"
60
+ ],
61
+ "properties": {
62
+ "accessToken": {
63
+ "type": "string"
64
+ },
65
+ "accessExpiresAt": {
66
+ "type": "integer",
67
+ "minimum": 0,
68
+ "description": "Unix-seconds expiry, clamped to min(local default, earliest of the vec/vmc validUntil)."
69
+ },
70
+ "foreignIssuerDid": {
71
+ "type": "string"
72
+ },
73
+ "mappedRole": {
74
+ "type": "string",
75
+ "description": "The LOCAL role from cross_community_roles policy — not the foreign role."
76
+ }
77
+ }
78
+ },
79
+ "ext": {
80
+ "$ref": "#/$defs/Ext"
81
+ }
82
+ }
83
+ },
84
+ "Ext": {
85
+ "title": "Ext",
86
+ "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.",
87
+ "type": "object",
88
+ "minProperties": 1,
89
+ "additionalProperties": true,
90
+ "propertyNames": {
91
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
92
+ }
93
+ }
94
+ }
95
+ };
96
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
97
+ export const RESPONSE_PAYLOAD_SCHEMA = {
98
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
99
+ "$ref": "#/$defs/Response",
100
+ "$defs": {
101
+ "Response": {
102
+ "$anchor": "response",
103
+ "title": "VTC Auth Recognise — response payload",
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "sessionId",
108
+ "data"
109
+ ],
110
+ "properties": {
111
+ "sessionId": {
112
+ "type": "string",
113
+ "pattern": "^xc-",
114
+ "description": "A cross-community session id (xc-<uuid>), distinguishing it from local-member sessions."
115
+ },
116
+ "data": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": [
120
+ "accessToken",
121
+ "accessExpiresAt",
122
+ "foreignIssuerDid",
123
+ "mappedRole"
124
+ ],
125
+ "properties": {
126
+ "accessToken": {
127
+ "type": "string"
128
+ },
129
+ "accessExpiresAt": {
130
+ "type": "integer",
131
+ "minimum": 0,
132
+ "description": "Unix-seconds expiry, clamped to min(local default, earliest of the vec/vmc validUntil)."
133
+ },
134
+ "foreignIssuerDid": {
135
+ "type": "string"
136
+ },
137
+ "mappedRole": {
138
+ "type": "string",
139
+ "description": "The LOCAL role from cross_community_roles policy — not the foreign role."
140
+ }
141
+ }
142
+ },
143
+ "ext": {
144
+ "$ref": "#/$defs/Ext"
145
+ }
146
+ }
147
+ },
148
+ "Ext": {
149
+ "title": "Ext",
150
+ "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.",
151
+ "type": "object",
152
+ "minProperties": 1,
153
+ "additionalProperties": true,
154
+ "propertyNames": {
155
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
156
+ }
157
+ }
158
+ }
159
+ };
160
+ /**
161
+ * SPEC.md §7.2 policy for the request variant, from this specification's
162
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
163
+ * per-specification and cannot be derived from the document alone, and
164
+ * item 2 needs the schema this carries.
165
+ */
166
+ export const SPEC = {
167
+ typeUri: TYPE_URI,
168
+ isBearer: false,
169
+ isProofRequired: false,
170
+ isRecipientRequired: true,
171
+ payloadSchema: PAYLOAD_SCHEMA,
172
+ };
173
+ /**
174
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
175
+ * tracks the *issuer* party's requirement because a response swaps the
176
+ * parties (§7.3 item 5).
177
+ */
178
+ export const RESPONSE_SPEC = {
179
+ typeUri: RESPONSE_TYPE_URI,
180
+ isBearer: false,
181
+ isProofRequired: false,
182
+ isRecipientRequired: true,
183
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
184
+ };
185
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/vtc/auth/recognise/0.2/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqCH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,oDAA6D,CAAC;AAKtF,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,6DAAsE,CAAC;AAKxG;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,oDAAoD;IAC3D,OAAO,EAAE,8BAA8B;IACvC,MAAM,EAAE,QAAQ;IAChB,sBAAsB,EAAE,KAAK;IAC7B,UAAU,EAAE;QACV,cAAc;KACf;IACD,YAAY,EAAE;QACZ,cAAc,EAAE;YACd,MAAM,EAAE,QAAQ;YAChB,aAAa,EAAE,+eAA+e;SAC/f;QACD,KAAK,EAAE;YACL,MAAM,EAAE,aAAa;SACtB;KACF;IACD,OAAO,EAAE;QACP,UAAU,EAAE;YACV,SAAS,EAAE,UAAU;YACrB,OAAO,EAAE,uCAAuC;YAChD,MAAM,EAAE,QAAQ;YAChB,sBAAsB,EAAE,KAAK;YAC7B,UAAU,EAAE;gBACV,WAAW;gBACX,MAAM;aACP;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE;oBACX,MAAM,EAAE,QAAQ;oBAChB,SAAS,EAAE,MAAM;oBACjB,aAAa,EAAE,yFAAyF;iBACzG;gBACD,MAAM,EAAE;oBACN,MAAM,EAAE,QAAQ;oBAChB,sBAAsB,EAAE,KAAK;oBAC7B,UAAU,EAAE;wBACV,aAAa;wBACb,iBAAiB;wBACjB,kBAAkB;wBACl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