@openvtc/trust-tasks 0.26.23 → 0.26.24

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.
@@ -31,10 +31,14 @@ export interface VTAPCSVoterRegisterPayload {
31
31
  * The election's manifest, exactly as the community published it. The engine computes its digest itself.
32
32
  */
33
33
  manifest: Manifest;
34
+ /**
35
+ * The DID the election's roll admits the voter as — their membership DID at the community. When given, the engine also returns `ticketDocument`: the request to the community, signed as this DID. It MUST be a DID the engine holds an authentication key of that the caller may act as.
36
+ */
37
+ member?: string;
34
38
  ext?: Ext;
35
39
  }
36
40
  /**
37
- * Exactly the vtc/elections/tickets/issue/0.1 request payload, without its ext: what the client sends the community.
41
+ * Exactly the vtc/elections/tickets/issue/0.1 request payload, without its ext — and, when the request named `member`, that request as a document signed as the member.
38
42
  */
39
43
  export interface VTAPCSVoterRegisterResponsePayload {
40
44
  electionId: ElectionId;
@@ -43,6 +47,7 @@ export interface VTAPCSVoterRegisterResponsePayload {
43
47
  */
44
48
  manifestDigest: DigestMultibase;
45
49
  request: TicketRequest;
50
+ ticketDocument?: TicketDocument;
46
51
  ext?: Ext;
47
52
  }
48
53
  /**
@@ -66,6 +71,31 @@ export interface TicketRequest {
66
71
  proof: string;
67
72
  };
68
73
  }
74
+ /**
75
+ * A complete, signed vtc/elections/tickets/issue/0.1 request document, ready to send to the community unchanged. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.
76
+ */
77
+ export interface TicketDocument {
78
+ id: string;
79
+ type: "https://trusttasks.org/spec/vtc/elections/tickets/issue/0.1";
80
+ /**
81
+ * The request's `member`.
82
+ */
83
+ issuer: string;
84
+ /**
85
+ * The request's `community`.
86
+ */
87
+ recipient: string;
88
+ issuedAt: string;
89
+ expiresAt?: string;
90
+ /**
91
+ * The vtc/elections/tickets/issue/0.1 request payload: `electionId`, `manifestDigest` and `request`, exactly as this response carries them.
92
+ */
93
+ payload: {};
94
+ /**
95
+ * A Data Integrity proof by an `authentication` key of `issuer`.
96
+ */
97
+ proof: {};
98
+ }
69
99
 
70
100
  /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
71
101
  export type { BoardVisibility, ChoiceQuestion, DigestMultibase, ElectionId, Ext, Key, Manifest, Multibase, Question, QuestionOption, RankingQuestion, Revote, RollRule, ScoreQuestion, SecrecyLevel, TextQuestion, Trustees, VotingParameters };
@@ -125,6 +155,13 @@ export const PAYLOAD_SCHEMA = {
125
155
  "$ref": "#/$defs/Manifest",
126
156
  "description": "The election's manifest, exactly as the community published it. The engine computes its digest itself."
127
157
  },
158
+ "member": {
159
+ "type": "string",
160
+ "minLength": 1,
161
+ "maxLength": 2048,
162
+ "pattern": "^did:",
163
+ "description": "The DID the election's roll admits the voter as — their membership DID at the community. When given, the engine also returns `ticketDocument`: the request to the community, signed as this DID. It MUST be a DID the engine holds an authentication key of that the caller may act as."
164
+ },
128
165
  "ext": {
129
166
  "$ref": "#/$defs/Ext"
130
167
  }
@@ -184,7 +221,7 @@ export const PAYLOAD_SCHEMA = {
184
221
  "Response": {
185
222
  "$anchor": "response",
186
223
  "title": "VTA PCS — Voter Register — response payload",
187
- "description": "Exactly the vtc/elections/tickets/issue/0.1 request payload, without its ext: what the client sends the community.",
224
+ "description": "Exactly the vtc/elections/tickets/issue/0.1 request payload, without its ext — and, when the request named `member`, that request as a document signed as the member.",
188
225
  "type": "object",
189
226
  "additionalProperties": false,
190
227
  "required": [
@@ -203,11 +240,65 @@ export const PAYLOAD_SCHEMA = {
203
240
  "request": {
204
241
  "$ref": "#/$defs/TicketRequest"
205
242
  },
243
+ "ticketDocument": {
244
+ "$ref": "#/$defs/TicketDocument"
245
+ },
206
246
  "ext": {
207
247
  "$ref": "#/$defs/Ext"
208
248
  }
209
249
  }
210
250
  },
251
+ "TicketDocument": {
252
+ "title": "TicketDocument",
253
+ "description": "A complete, signed vtc/elections/tickets/issue/0.1 request document, ready to send to the community unchanged. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.",
254
+ "type": "object",
255
+ "required": [
256
+ "id",
257
+ "type",
258
+ "issuer",
259
+ "recipient",
260
+ "issuedAt",
261
+ "payload",
262
+ "proof"
263
+ ],
264
+ "properties": {
265
+ "id": {
266
+ "type": "string",
267
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
268
+ },
269
+ "type": {
270
+ "const": "https://trusttasks.org/spec/vtc/elections/tickets/issue/0.1"
271
+ },
272
+ "issuer": {
273
+ "type": "string",
274
+ "minLength": 1,
275
+ "maxLength": 2048,
276
+ "description": "The request's `member`."
277
+ },
278
+ "recipient": {
279
+ "type": "string",
280
+ "minLength": 1,
281
+ "maxLength": 2048,
282
+ "description": "The request's `community`."
283
+ },
284
+ "issuedAt": {
285
+ "type": "string",
286
+ "format": "date-time"
287
+ },
288
+ "expiresAt": {
289
+ "type": "string",
290
+ "format": "date-time"
291
+ },
292
+ "payload": {
293
+ "type": "object",
294
+ "description": "The vtc/elections/tickets/issue/0.1 request payload: `electionId`, `manifestDigest` and `request`, exactly as this response carries them."
295
+ },
296
+ "proof": {
297
+ "type": "object",
298
+ "description": "A Data Integrity proof by an `authentication` key of `issuer`."
299
+ }
300
+ }
301
+ },
211
302
  "Ext": {
212
303
  "title": "Ext",
213
304
  "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.",
@@ -712,7 +803,7 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
712
803
  "Response": {
713
804
  "$anchor": "response",
714
805
  "title": "VTA PCS — Voter Register — response payload",
715
- "description": "Exactly the vtc/elections/tickets/issue/0.1 request payload, without its ext: what the client sends the community.",
806
+ "description": "Exactly the vtc/elections/tickets/issue/0.1 request payload, without its ext — and, when the request named `member`, that request as a document signed as the member.",
716
807
  "type": "object",
717
808
  "additionalProperties": false,
718
809
  "required": [
@@ -731,11 +822,65 @@ export const RESPONSE_PAYLOAD_SCHEMA = {
731
822
  "request": {
732
823
  "$ref": "#/$defs/TicketRequest"
733
824
  },
825
+ "ticketDocument": {
826
+ "$ref": "#/$defs/TicketDocument"
827
+ },
734
828
  "ext": {
735
829
  "$ref": "#/$defs/Ext"
736
830
  }
737
831
  }
738
832
  },
833
+ "TicketDocument": {
834
+ "title": "TicketDocument",
835
+ "description": "A complete, signed vtc/elections/tickets/issue/0.1 request document, ready to send to the community unchanged. Its payload is validated by that specification's schema; the members fixed here are the ones this task guarantees.",
836
+ "type": "object",
837
+ "required": [
838
+ "id",
839
+ "type",
840
+ "issuer",
841
+ "recipient",
842
+ "issuedAt",
843
+ "payload",
844
+ "proof"
845
+ ],
846
+ "properties": {
847
+ "id": {
848
+ "type": "string",
849
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
850
+ },
851
+ "type": {
852
+ "const": "https://trusttasks.org/spec/vtc/elections/tickets/issue/0.1"
853
+ },
854
+ "issuer": {
855
+ "type": "string",
856
+ "minLength": 1,
857
+ "maxLength": 2048,
858
+ "description": "The request's `member`."
859
+ },
860
+ "recipient": {
861
+ "type": "string",
862
+ "minLength": 1,
863
+ "maxLength": 2048,
864
+ "description": "The request's `community`."
865
+ },
866
+ "issuedAt": {
867
+ "type": "string",
868
+ "format": "date-time"
869
+ },
870
+ "expiresAt": {
871
+ "type": "string",
872
+ "format": "date-time"
873
+ },
874
+ "payload": {
875
+ "type": "object",
876
+ "description": "The vtc/elections/tickets/issue/0.1 request payload: `electionId`, `manifestDigest` and `request`, exactly as this response carries them."
877
+ },
878
+ "proof": {
879
+ "type": "object",
880
+ "description": "A Data Integrity proof by an `authentication` key of `issuer`."
881
+ }
882
+ }
883
+ },
739
884
  "Ext": {
740
885
  "title": "Ext",
741
886
  "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.",