@tdxvolt/volt-client-grpc 0.18.3 → 0.18.5

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 (29) hide show
  1. package/lib/index.cjs +3208 -181
  2. package/package.json +5 -3
  3. package/scripts/generate-proto-assets.js +71 -0
  4. package/src/constants.js +2 -1
  5. package/src/grpc-call.js +7 -3
  6. package/src/proto-package-definition.js +184 -0
  7. package/src/proto-utils.js +40 -111
  8. package/src/volt-client-internal.js +5 -30
  9. package/src/volt-client.js +0 -57
  10. package/src/volt-proto-literals.js +2985 -0
  11. package/protobuf/README.md +0 -4
  12. package/protobuf/tdx/volt_api/data/v1/sqlite.proto +0 -43
  13. package/protobuf/tdx/volt_api/data/v1/sqlite_database_api.proto +0 -153
  14. package/protobuf/tdx/volt_api/data/v1/sqlite_server_api.proto +0 -50
  15. package/protobuf/tdx/volt_api/relay/v1/proxy_api.proto +0 -9
  16. package/protobuf/tdx/volt_api/relay/v1/relay_api.proto +0 -78
  17. package/protobuf/tdx/volt_api/sync/v1/sync.proto +0 -57
  18. package/protobuf/tdx/volt_api/volt/v1/discovery_api.proto +0 -35
  19. package/protobuf/tdx/volt_api/volt/v1/file.proto +0 -17
  20. package/protobuf/tdx/volt_api/volt/v1/file_api.proto +0 -165
  21. package/protobuf/tdx/volt_api/volt/v1/remote.proto +0 -93
  22. package/protobuf/tdx/volt_api/volt/v1/spark_api.proto +0 -121
  23. package/protobuf/tdx/volt_api/volt/v1/ssi.proto +0 -66
  24. package/protobuf/tdx/volt_api/volt/v1/ssi_api.proto +0 -214
  25. package/protobuf/tdx/volt_api/volt/v1/status.proto +0 -15
  26. package/protobuf/tdx/volt_api/volt/v1/terminal_api.proto +0 -42
  27. package/protobuf/tdx/volt_api/volt/v1/volt.proto +0 -666
  28. package/protobuf/tdx/volt_api/volt/v1/volt_api.proto +0 -1082
  29. package/protobuf/tdx/volt_api/volt/v1/wire_api.proto +0 -56
@@ -0,0 +1,2985 @@
1
+ /**
2
+ * This file is generated by the 'generate-proto-assets.js' script.
3
+ * Do not modify this file directly.
4
+ */
5
+
6
+ export const sqlite = `syntax = "proto3";
7
+
8
+ package tdx.volt_api.data.v1;
9
+
10
+ // Just reflect SQLite types for now.
11
+ enum DataType {
12
+ DATA_TYPE_UNKNOWN = 0;
13
+ DATA_TYPE_TEXT = 1;
14
+ DATA_TYPE_INTEGER = 2;
15
+ DATA_TYPE_REAL = 3;
16
+ DATA_TYPE_BLOB = 4;
17
+ DATA_TYPE_NULL = 5;
18
+ }
19
+
20
+ message Column {
21
+ string name = 1;
22
+ string description = 2;
23
+ DataType type = 3;
24
+ }
25
+
26
+ message Schema {
27
+ string name = 1;
28
+ string description = 2;
29
+ repeated Column column = 3;
30
+ }
31
+
32
+ message Variant {
33
+ oneof data {
34
+ string text = 1;
35
+ int64 integer = 2;
36
+ double real = 3;
37
+ bytes blob = 4;
38
+ bool null = 5;
39
+ }
40
+ }
41
+
42
+ message RowHeader {
43
+ repeated Column column = 1;
44
+ }
45
+
46
+ message VariantRow {
47
+ repeated Variant column = 1;
48
+ }
49
+ `;
50
+ export const sqlite_database_api = `syntax = "proto3";
51
+
52
+ package tdx.volt_api.data.v1;
53
+
54
+ import "tdx/volt_api/volt/v1/status.proto";
55
+ import "tdx/volt_api/data/v1/sqlite.proto";
56
+ import "tdx/volt_api/volt/v1/volt.proto";
57
+
58
+ // The Sqlite Database API exposes functions that enable clients to manipulate data in a given Volt database.
59
+ // Use the Sqlite Server API to create the database resource.
60
+ service SqliteDatabaseAPI {
61
+ // Execute multiple SQL statements in a single transaction via a single RPC.
62
+ rpc BulkUpdate(SqlBulkUpdateRequest) returns (SqlBulkUpdateResponse);
63
+
64
+ // Execute a single SQL statement. Any valid SQL is accepted. In order to execute non-SELECT statements, the caller must have the "write" permission.
65
+ rpc Execute(stream SqlExecuteRequest) returns (stream SqlExecuteResponse);
66
+
67
+ // Import CSV data into a table.
68
+ // The import handler will inspect the incoming CSV data, infer the columns and data types required, and create and populate the SQL table.
69
+ // The CSV must contain a header row containing the column names and at least one row of data so that the types can be inferred.
70
+ // The importer assumes all data in any given CSV file relates to a single table.
71
+ // The data can either be streamed in chunks or retrieved from an existing resource.
72
+ // If the data is streamed in chunks, the client must call the Close() method on the stream to indicate that it has finished.
73
+ rpc ImportCSV(stream SqlImportCSVRequest) returns (stream SqlImportCSVResponse);
74
+ }
75
+
76
+ message SqlBulkUpdateRequest {
77
+ // The id of the database to update.
78
+ string database_id = 1;
79
+
80
+ // The SQL statements to execute. The statements will be executed within a transaction and will be committed if all statements succeed.
81
+ // Bear in mind the maximum size limit of a single message is 64MB, and around 1MB seems to be optimal in terms of performance.
82
+ repeated string statement = 2;
83
+ }
84
+
85
+ message SqlBulkUpdateResponse {
86
+ // Details of any error that occurred on the call.
87
+ tdx.volt_api.volt.v1.Status status = 1;
88
+ }
89
+
90
+ message SqlExecuteStart {
91
+ // The id of the database to execute on.
92
+ string database_id = 1;
93
+
94
+ // Set to start a transaction. If not set, each statement will be executed in its own transaction.
95
+ bool transaction = 2;
96
+
97
+ // The SQL statement to execute.
98
+ string statement = 3;
99
+
100
+ // This can be used to limit the number of rows returned by \`SELECT\` statements to avoid overloading a client. It is similar to using 'LIMIT/OFFSET' clauses on the 'SELECT' statement, but this method is easier to manage and the entire result set will be prepared on the Volt, and the client can then page through it by sending successive messages.
101
+ uint32 page_size = 4;
102
+
103
+ // Set to indicate that the query will be cancelled if the client disconnects.
104
+ // This is useful for long running queries, where it might be desirable for the client to be able to cancel the request before all the data is received. However this requires a worker thread to be allocated to the query until it completes, which may affect performance and limit the number of concurrent queries that can be executed due to file handle limitations.
105
+ // Only applicable to \`SELECT\` statements, ignored otherwise.
106
+ bool can_cancel = 5;
107
+
108
+ //The values to set for each parameter defined in a database view.
109
+ //This field is only relevant to 'query' databases, i.e. those with kind \`tdx:sqlite-view\`.
110
+ //The values in the map should be keyed by parameter name.
111
+ // A query may have no parameters defined, in which case leave this field empty.
112
+ map<string, tdx.volt_api.volt.v1.AttributeValue> parameter = 6;
113
+ }
114
+
115
+ // Intentionally empty.
116
+ message SqlExecuteNext {
117
+ }
118
+
119
+ // Ends the call.
120
+ message SqlExecuteEnd {
121
+ // Set to commit the transaction. If not set, the transaction will be rolled back.
122
+ bool commit_transaction = 1;
123
+ }
124
+
125
+ message SqlExecuteRequest {
126
+ oneof payload {
127
+ // Initialise the request with the database id and whether to execute within a transaction.
128
+ // Also includes the SQL statement to execute.
129
+ SqlExecuteStart start = 2;
130
+
131
+ // To retrieve subsequent pages, send a \`next\` request.
132
+ SqlExecuteNext next = 3;
133
+
134
+ // To end the call, send an \`end\` request. Only really necessary for transaction-based calls, otherwise clients can just close the stream.
135
+ SqlExecuteEnd end = 4;
136
+ }
137
+ }
138
+
139
+ // One of the following fields will be present in any given message.
140
+ message SqlExecuteResponse {
141
+ oneof payload {
142
+ // A status will be sent on error.
143
+ tdx.volt_api.volt.v1.Status status = 1;
144
+
145
+ // The initial response for SELECT statements will be a header containing the column names and types.
146
+ RowHeader header = 2;
147
+
148
+ // Each row in the result set will be sent as a VariantRow.
149
+ VariantRow row = 3;
150
+
151
+ // NYI - For INSERT/UPDATE statements the number of affected rows will be sent.
152
+ uint32 affected_rows = 4;
153
+ }
154
+ }
155
+
156
+ message SqlImportCSVConfiguration {
157
+ // The target database resource id, which must already exist, and the authenticated account must have write access to the resource.
158
+ string database_id = 1;
159
+
160
+ // The target table name.
161
+ string table_name = 2;
162
+
163
+ // Not yet implemented - flag indicating that data is to be inserted into an existing table.
164
+ bool create_table = 3;
165
+
166
+ // Optional - when not sending the data via this RPC, this should contain the id of a resource that contains the CSV data. If set, the authenticated account must have read access to the resource.
167
+ string source_resource_id = 4;
168
+
169
+ // Optional - the interval to receive progress updates, in number of rows. E.g. set to 1000 to receive progress updates every 1000 rows. Set to 0 to disable progress updates.
170
+ uint32 progress_interval = 5;
171
+
172
+ // The number of rows scanned to infer the schema. Set to 0 to scan the entire file.
173
+ uint32 schema_scan_limit = 6;
174
+ }
175
+
176
+ // Each message must contain one and only one of the following fields.
177
+ message SqlImportCSVRequest {
178
+ oneof payload {
179
+ // The initial request must contain the configuration parameters for the import.
180
+ SqlImportCSVConfiguration configuration = 1;
181
+
182
+ // Set to indicate that the upload is complete.
183
+ bool upload_complete = 2;
184
+
185
+ // Subsequent requests may contain the data to be imported, unless importing from an existing resource that contains the CSV data. It is recommended that the block size is less than 1MB.
186
+ bytes block = 3;
187
+
188
+ // Set to abort the import.
189
+ bool abort = 4;
190
+ }
191
+ }
192
+
193
+ message SqlImportCSVResponse {
194
+ // The status will contain any error info.
195
+ tdx.volt_api.volt.v1.Status status = 1;
196
+
197
+ // The number of rows processed - this will be sent after every \`progress_interval\` rows.
198
+ int64 row_count = 2;
199
+
200
+ // The total number of rows to be imported.
201
+ int64 total_rows = 3;
202
+ }
203
+ `;
204
+ export const sqlite_server_api = `syntax = "proto3";
205
+
206
+ package tdx.volt_api.data.v1;
207
+
208
+ import "tdx/volt_api/volt/v1/status.proto";
209
+ import "tdx/volt_api/volt/v1/volt.proto";
210
+
211
+ // The Sqlite Server API provides database management functions.
212
+ // Use the VoltAPI DeleteResource function to delete a database.
213
+ service SqliteServerAPI {
214
+ // Create a new database resource.
215
+ rpc CreateDatabase(CreateDatabaseRequest) returns (CreateDatabaseResponse);
216
+ }
217
+
218
+ message CreateDatabaseRequest {
219
+ // The name of the database to create.
220
+ string name = 1;
221
+
222
+ // Optional - the id of the folder resource in which to create the database. If omitted, the callers home folder is used.
223
+ string create_in_parent_id = 2;
224
+
225
+ // Set to encrypt the database. The encryption key will be generated by the server, the internal Volt server uses the root volt key.
226
+ bool encrypted = 3;
227
+
228
+ // Set to audit all SELECT database operations.
229
+ bool read_audit = 4;
230
+
231
+ // Set to audit all INSERT, UPDATE, and DELETE database operations.
232
+ bool write_audit = 5;
233
+
234
+ // The discovery mode of the underlying Volt resource.
235
+ tdx.volt_api.volt.v1.DiscoveryMode discoverable = 6;
236
+
237
+ // Alias(es) that can be used to refer to the database rather than the id.
238
+ // Each alias must be unique to the Volt, this is enforced by the API.
239
+ // No format restrictions are currently applied to alias, but this may change in future, for the time being it makes sense to stick to alphanumeric characters and '_' or '-'.
240
+ repeated string alias = 7;
241
+
242
+ // Optional description of the database.
243
+ string description = 8;
244
+ }
245
+
246
+ message CreateDatabaseResponse {
247
+ // Any error message will be returned here.
248
+ tdx.volt_api.volt.v1.Status status = 1;
249
+
250
+ // The new database resource on success.
251
+ tdx.volt_api.volt.v1.Resource resource = 2;
252
+ }
253
+
254
+ `;
255
+ export const proxy_api = `syntax = "proto3";
256
+
257
+ package tdx.volt_api.relay.v1;
258
+
259
+ // Placeholder API for the proxy.
260
+ // Methods are injected into this service at runtime
261
+ // when a remote volt connects via the RelayAPI.
262
+ service ProxyAPI {
263
+ }`;
264
+ export const relay_api = `syntax = "proto3";
265
+
266
+ package tdx.volt_api.relay.v1;
267
+
268
+ import "tdx/volt_api/volt/v1/status.proto";
269
+ import "tdx/volt_api/volt/v1/remote.proto";
270
+ import "tdx/volt_api/volt/v1/volt.proto";
271
+
272
+ service RelayAPI {
273
+ // Retrieve the list of Volts available on the Relay Volt.
274
+ rpc GetVoltEndpoint(GetVoltEndpointRequest) returns (GetVoltEndpointResponse);
275
+
276
+ // This is the actual tunnel stream.
277
+ // Note although this API semantically describes the tunnel stream, it isn't actually implemented anywhere. It is used by client libraries to easily serialise tunnel payloads.
278
+ rpc Tunnel(stream tdx.volt_api.volt.v1.RemoteRequest) returns (stream tdx.volt_api.volt.v1.RemoteResponse);
279
+
280
+ // This is the tunnel stream for cloud-based tunnels.
281
+ rpc CloudTunnel(stream TunnelRequest) returns (stream TunnelResponse);
282
+ }
283
+
284
+ message GetVoltEndpointRequest {
285
+ // Optional - if omitted a list of all volts known to the authenticated
286
+ // account will be returned.
287
+ oneof filter {
288
+ // Filter on the owning identity.
289
+ string owner_id = 2;
290
+ // Filter on volt id.
291
+ string volt_id = 1;
292
+ }
293
+ }
294
+
295
+ message GetVoltEndpointResponse {
296
+ tdx.volt_api.volt.v1.Status status = 1;
297
+ repeated tdx.volt_api.volt.v1.VoltEndpoint endpoint = 2;
298
+ }
299
+
300
+ message TunnelStart {
301
+ uint32 preferred_port = 1;
302
+ string address = 2;
303
+ string public_key = 3;
304
+ string fingerprint = 4;
305
+ string ca_pem = 5;
306
+ string volt_version = 6;
307
+ }
308
+
309
+ message TunnelServiceControl {
310
+ string resource_id = 1;
311
+ string service_name = 2;
312
+ tdx.volt_api.volt.v1.ServiceDescription service_description = 3;
313
+ }
314
+
315
+ message TunnelControl {
316
+ oneof msg {
317
+ TunnelStart start = 2;
318
+ TunnelServiceControl add_service = 3;
319
+ TunnelServiceControl remove_service = 4;
320
+ }
321
+ }
322
+
323
+ message TunnelRequest {
324
+ oneof payload {
325
+ tdx.volt_api.volt.v1.RemotePing ping = 1;
326
+ TunnelControl control = 2;
327
+ tdx.volt_api.volt.v1.MethodPayload method_payload = 3;
328
+ tdx.volt_api.volt.v1.MethodEnd method_end = 4;
329
+ tdx.volt_api.volt.v1.HttpResponse http_response = 5;
330
+ }
331
+ }
332
+
333
+ message TunnelResponse {
334
+ oneof payload {
335
+ tdx.volt_api.volt.v1.RemotePing ping = 1;
336
+ tdx.volt_api.volt.v1.MethodInvoke method_invoke = 2;
337
+ tdx.volt_api.volt.v1.MethodPayload method_payload = 3;
338
+ tdx.volt_api.volt.v1.MethodEnd method_end = 4;
339
+ tdx.volt_api.volt.v1.HttpRequest http_request = 5;
340
+ }
341
+ }
342
+ `;
343
+ export const sync = `syntax = "proto3";
344
+
345
+ package tdx.volt_api.sync.v1;
346
+
347
+ // Wraps arbitrary protobuf messages, with an index into the \`ProtobufSyncConfigurationHeader\` to indicate the specific message type this message wraps.
348
+ message ProtobufSyncWrapper {
349
+ oneof header_lookup {
350
+ // The index number of the header for this message type in the Volt logger configuration file.
351
+ uint32 header_index = 1;
352
+
353
+ // The name of the header for this message type, will be used to lookup against the \`id\` field in \`ProtobufSyncConfiguration\`.
354
+ // This will incur an overhead in terms of the packet size, but might be preferrable if volume is low or managing the header index is difficult.
355
+ string header_id = 2;
356
+ }
357
+
358
+ // The message payload, in serialised protobuf binary format.
359
+ // n.b. the serialisation should **not** be length-prefixed.
360
+ bytes payload = 3;
361
+ }
362
+
363
+ // Describes a single message type.
364
+ // A set of one or more of these messages is specified in \`ProtobufSyncConfigurationHeader\`.
365
+ message ProtobufSyncConfiguration {
366
+ // Optional id to associate with this configuration.
367
+ // This can be used in the \`header_id\` field of \`ProtobufSyncWrapper\` above to reference the configuration.
368
+ // If omitted the numerical index of the configuration in \`ProtobufSyncConfigurationHeader\` will be used instead.
369
+ string id = 1;
370
+
371
+ // The actual protobuf definition text.
372
+ // Copy and paste the source protobuf definition from the \`.proto\` file.
373
+ // Only simple protobuf structures are currently supported, e.g. no imports from other packages etc.
374
+ string message_proto = 2;
375
+
376
+ // The name of the message within \`message_proto\` above that represents the data to be sync'd, e.g. \`TCPDumpPacket\`.
377
+ string message_name = 3;
378
+
379
+ // The name of the table within the target database into which the message data for this type should be written.
380
+ string table_name = 4;
381
+ }
382
+
383
+ // This message is written at the beginning of every file to be ingested using the \`protoDbSync\` utility.
384
+ // It contains a \`header\` entry for each message type that may appear in the file.
385
+ // If the \`volt logger\` command is used, it will create this header automatically based on the configuration it's given.
386
+ message ProtobufSyncConfigurationHeader {
387
+ // This should ideally be a persistent UUID, at minimum it must be unique within the set of types of file any given instance of \`protoDbSync\` is processing in a given folder.
388
+ // It is used to match up orphaned or split packets that might occur when receiving data from a wire, for example, if a log file is rotated midway through a packet arriving on the wire.
389
+ // This id should persist for the life time of the set of data it describes, i.e. if a wire publication is stopped and restarted at some later point, the same id should be used if possible.
390
+ string id = 1;
391
+
392
+ // The set of possible configurations that can appear in any given protobuf sync data file.
393
+ // A serialised instance of this message must appear at the top of each data file.
394
+ // Each subsequent serialised message in the data file must be an instance of \`ProtobufSyncWrapper\`, and the \`header_lookup\` field refers to an entry in this list.
395
+ repeated ProtobufSyncConfiguration configuration = 2;
396
+
397
+ // Optional maximum size of the serialised messages, this doesn't need to be exact and the default is 64K if omitted.
398
+ int32 maximum_message_size = 3;
399
+ }`;
400
+ export const discovery_api = `syntax = "proto3";
401
+
402
+ package tdx.volt_api.volt.v1;
403
+
404
+ import "tdx/volt_api/volt/v1/status.proto";
405
+ import "tdx/volt_api/volt/v1/volt.proto";
406
+
407
+ // The public Volt discovery service.
408
+ // This is exposed by the Volt battery over an INSECURE grpc channel.
409
+ // This insecurity is ameliorated by the fact that discovered Volts return signatures of their challenge code and owner credential.
410
+ // Note that only Volts that have explicitly set 'discoverable' in the Volt settings will be discovered.
411
+ service DiscoveryAPI {
412
+ rpc Discover(DiscoverRequest) returns (DiscoverResponse) {};
413
+ }
414
+
415
+ message DiscoverRequest {
416
+ // Set to require that only Volts that expose a Relay be included in the response.
417
+ bool require_relay = 1;
418
+ }
419
+
420
+ message SignedEndpoint {
421
+ // The discovered Volt endpoint information.
422
+ tdx.volt_api.volt.v1.VoltEndpoint endpoint = 1;
423
+
424
+ // The discovered Volt's challenge code, signed by the Volt private key and base64 encoded.
425
+ // If a client knows the Volt challenge code by some out-of-band means, it can use the Volt public key (contained in the endpoint information above) to determine that the discovered Volt also knows the same challenge code.
426
+ string challenge_signature = 2;
427
+ }
428
+
429
+ message DiscoverResponse {
430
+ tdx.volt_api.volt.v1.Status status = 1;
431
+
432
+ // A list of endpoints that match the request criteria.
433
+ repeated SignedEndpoint endpoint = 2;
434
+ }
435
+ `;
436
+ export const file = `syntax = "proto3";
437
+
438
+ package tdx.volt_api.volt.v1;
439
+
440
+ message File {
441
+ string file_path = 1;
442
+ string absolute_path = 2;
443
+ string file_name = 3;
444
+ string extension = 4;
445
+ uint64 size = 5;
446
+ string media_type = 6;
447
+ bool is_directory = 7;
448
+ uint64 modified = 8;
449
+
450
+ string resource_id = 100;
451
+ string owner_resource_id = 101;
452
+ }`;
453
+ export const file_api = `syntax = "proto3";
454
+
455
+ package tdx.volt_api.volt.v1;
456
+
457
+ import "tdx/volt_api/volt/v1/status.proto";
458
+ import "tdx/volt_api/volt/v1/file.proto";
459
+
460
+ // The File API exposes basic file management functions.
461
+ service FileAPI {
462
+
463
+ // Download from file resource.
464
+ rpc DownloadFile(DownloadFileRequest) returns (stream DownloadFileResponse);
465
+
466
+ // Get file resource metadata.
467
+ rpc GetFile(GetFileRequest) returns (GetFileResponse);
468
+
469
+ // Get the content of a file.
470
+ // Note this rpc will fail if the size of the file content is greater than 64MB, in which case use DownloadFile instead.
471
+ rpc GetFileContent(GetFileContentRequest) returns (GetFileContentResponse);
472
+
473
+ // Get the file resource metadata of all descendants of a given file resource.
474
+ rpc GetFileDescendants(GetFileDescendantsRequest) returns (GetFileDescendantsResponse);
475
+
476
+ // Set the content of a file.
477
+ // Note this rpc will fail if the size of the file content is greater than 64MB, in which case use UploadFile instead.
478
+ rpc SetFileContent(SetFileContentRequest) returns (SetFileContentResponse);
479
+
480
+ // Upload data to a file resource.
481
+ rpc UploadFile(stream UploadFileRequest) returns (stream UploadFileResponse);
482
+ }
483
+
484
+ message DownloadFileRequest {
485
+ // The id of the resource to download.
486
+ string resource_id = 1;
487
+
488
+ // This is required for linked folders, and represents the relative path to the source file from the base folder.
489
+ string file_path = 2;
490
+ }
491
+
492
+ // The response stream will contain one or more of the following messages.
493
+ // Each response message will contain one of the following fields.
494
+ message DownloadFileResponse {
495
+ oneof payload {
496
+ // A chunk of file data.
497
+ bytes block = 1;
498
+
499
+ // A status will be sent when the file is completely downloaded, or if an error occurs.
500
+ tdx.volt_api.volt.v1.Status status = 2;
501
+ }
502
+ }
503
+
504
+ message GetFileRequest {
505
+ // The resource id of the base folder.
506
+ string resource_id = 1;
507
+
508
+ // Optional - the path to the file, relative to the base folder. Required for linked folders.
509
+ string file_path = 2;
510
+ }
511
+
512
+ message GetFileResponse {
513
+ // Details of any error that occurred on the call.
514
+ tdx.volt_api.volt.v1.Status status = 1;
515
+
516
+ // The file metadata.
517
+ File file = 2;
518
+ }
519
+
520
+ message GetFileContentRequest {
521
+ // The resource id of the base folder.
522
+ string resource_id = 1;
523
+
524
+ // Optional - the path to the file, relative to the base folder. Required for linked folders.
525
+ string file_path = 2;
526
+ }
527
+
528
+ message GetFileContentResponse {
529
+ // Details of any error that occurred on the call.
530
+ tdx.volt_api.volt.v1.Status status = 1;
531
+
532
+ // The file content.
533
+ bytes content = 2;
534
+ }
535
+
536
+ message GetFileDescendantsRequest {
537
+ // The resource id of the base folder.
538
+ string resource_id = 1;
539
+
540
+ // For linked files, this is the relative path to the 'parent' file from the base folder.
541
+ string file_path = 2;
542
+
543
+ // Optional - only match descendants of the given kind.
544
+ string extension = 3;
545
+
546
+ // Optional - can be used to determine if a resource is a descendant.
547
+ string descendant_id = 5;
548
+ }
549
+
550
+ message GetFileDescendantsResponse {
551
+ // Details of any error that occurred on the call.
552
+ tdx.volt_api.volt.v1.Status status = 1;
553
+
554
+ // The list of descendants.
555
+ repeated File descendant = 2;
556
+ }
557
+
558
+ message SetFileContentRequest {
559
+ // The resource id of the base folder.
560
+ string resource_id = 1;
561
+
562
+ // Optional - the path to the file, relative to the base folder. Required for linked folders.
563
+ string file_path = 2;
564
+
565
+ // Optional store name to use.
566
+ // If specified, this will be used to extract the extension to set as a resource 'kind', e.g. tdx:ext:json.
567
+ // If not specified, the extension will be taken from the name of the target resource.
568
+ string store_name = 3;
569
+
570
+ bytes content = 4;
571
+ }
572
+
573
+ message SetFileContentResponse {
574
+ // Details of any error that occurred on the call.
575
+ tdx.volt_api.volt.v1.Status status = 1;
576
+ }
577
+
578
+ message UploadFileStart {
579
+ // The resource to upload to, required.
580
+ string resource_id = 1;
581
+
582
+ // Optional store name to use.
583
+ // If specified, this will be used to extract the extension to set as a resource 'kind', e.g. tdx:ext:json.
584
+ // If not specified, the extension will be taken from the name of the target resource.
585
+ string store_name = 2;
586
+
587
+ // Optionally set streaming mode.
588
+ // When in streaming mode, data is written directly to the resource.
589
+ // Otherwise, data is written to a temporary file and then copied over once the upload completes successfully.
590
+ bool streaming_mode = 3;
591
+
592
+ // Optional, truncates the file prior to beginning the upload. This is only really relevant if 'streaming_mode' is set.
593
+ bool truncate = 4;
594
+
595
+ // Optional, buffer will flush after each write.
596
+ bool eager_flush = 5;
597
+ }
598
+
599
+ // One of the following fields must be present.
600
+ message UploadFileRequest {
601
+ oneof payload {
602
+ // Describes the file upload, should only be sent as first message.
603
+ UploadFileStart start = 1;
604
+
605
+ // The next block of data.
606
+ bytes block = 2;
607
+ }
608
+ }
609
+
610
+ message UploadFileResponse {
611
+ // Details of any error that occurred on the call.
612
+ tdx.volt_api.volt.v1.Status status = 1;
613
+
614
+ // Reserved for internal use.
615
+ bool back_off = 2;
616
+ }
617
+
618
+ `;
619
+ export const remote = `syntax = "proto3";
620
+
621
+ package tdx.volt_api.volt.v1;
622
+
623
+ message HttpInvoke {
624
+ string host = 1;
625
+ int32 port = 2;
626
+ string method = 3;
627
+ string url = 4;
628
+ string version = 5;
629
+ map <string, string> headers = 6;
630
+ bytes body = 7;
631
+ }
632
+
633
+ message HttpPayload {
634
+ bytes chunk = 1;
635
+ oneof end_ {
636
+ bool end = 2;
637
+ }
638
+ oneof error_ {
639
+ int32 error = 3;
640
+ }
641
+ }
642
+
643
+ message HttpRequest {
644
+ uint64 id = 1;
645
+ oneof payload {
646
+ HttpInvoke http_invoke = 2;
647
+ HttpPayload http_payload = 3;
648
+ }
649
+ }
650
+
651
+ message HttpResponse {
652
+ uint64 id = 1;
653
+ HttpPayload http_payload = 7;
654
+ }
655
+
656
+ enum MethodType {
657
+ METHOD_TYPE_UNKNOWN = 0;
658
+ METHOD_TYPE_UNARY = 1;
659
+ METHOD_TYPE_CLIENT_STREAM = 2;
660
+ METHOD_TYPE_SERVER_STREAM = 3;
661
+ METHOD_TYPE_BIDI = 4;
662
+ }
663
+
664
+ message MethodInvoke {
665
+ uint64 id = 1;
666
+ string service_id = 2;
667
+ string method_name = 3;
668
+ MethodType method_type = 4;
669
+ oneof invoke_request {
670
+ bytes request = 6;
671
+ string json_request = 7;
672
+ }
673
+ }
674
+
675
+ message MethodPayload {
676
+ uint64 id = 1;
677
+ oneof method_payload {
678
+ bytes payload = 2;
679
+ string json_payload = 3;
680
+ }
681
+ }
682
+
683
+ message MethodEnd {
684
+ uint64 id = 1;
685
+ bool ended = 4;
686
+ string error = 5;
687
+ int32 error_code = 6;
688
+ }
689
+
690
+ message RemotePing {
691
+ uint64 timestamp = 1;
692
+ }
693
+
694
+ message RemoteRequest {
695
+ oneof payload {
696
+ RemotePing ping = 1;
697
+ MethodPayload method_payload = 3;
698
+ MethodEnd method_end = 4;
699
+ HttpResponse http_response = 5;
700
+ }
701
+ }
702
+
703
+ message RemoteResponse {
704
+ oneof payload {
705
+ RemotePing ping = 1;
706
+ MethodInvoke method_invoke = 2;
707
+ MethodPayload method_payload = 3;
708
+ MethodEnd method_end = 4;
709
+ HttpRequest http_request = 5;
710
+ }
711
+ }
712
+ `;
713
+ export const spark_api = `syntax = "proto3";
714
+
715
+ package tdx.volt_api.volt.v1;
716
+
717
+ import "tdx/volt_api/volt/v1/status.proto";
718
+
719
+ // The Spark API allows clients to start and communicate with Spark VMs.
720
+ service SparkAPI {
721
+ // Start or connect to a spark VM and establish a long-lived communication channel.
722
+ rpc Spark(stream SparkRequest) returns (stream SparkResponse);
723
+
724
+ // Get details of running spark VMs.
725
+ rpc GetSpark(GetSparkRequest) returns (GetSparkResponse);
726
+ }
727
+
728
+ // Start a resource-hosted spark.
729
+ // Provenance is determined from the resource owner.
730
+ message StartSparkResource {
731
+ // The id of the resource containing the VM byte code.
732
+ string resource_id = 1;
733
+
734
+ // JSON-encoded payload to parameterise the spark.
735
+ string payload = 2;
736
+
737
+ // Envelope signature.
738
+ string signature = 3;
739
+ }
740
+
741
+ // Start a spark from byte code included in the payload, along with issuer/developer claims and signature.
742
+ message StartSparkAdhoc {
743
+ // Ad-hoc byte code of VM to run.
744
+ bytes byte_code = 1;
745
+
746
+ // Verifiable credentials associated with this spark.
747
+ repeated string credential = 2;
748
+
749
+ // Envelope signature.
750
+ string signature = 3;
751
+
752
+ // JSON-encoded payload to parameterise the spark.
753
+ string payload = 4;
754
+ }
755
+
756
+ // Send commands and payloads to communicate with a running spark.
757
+ message SparkCommand {
758
+ // Optional id to associate with this command.
759
+ // If this is omitted, an id will be assigned and returned in the command acknowledgement.
760
+ string command_id = 1;
761
+
762
+ // The command to send to the spark.
763
+ string command = 2;
764
+
765
+ // The command payload.
766
+ string payload = 3;
767
+
768
+ // Command verifiable credential.
769
+ string credential = 4;
770
+
771
+ // Command signature.
772
+ string signature = 5;
773
+ }
774
+
775
+ // The request must contain one of the messages indicated below.
776
+ message SparkRequest {
777
+ oneof payload {
778
+ StartSparkResource start_resource = 1;
779
+ StartSparkAdhoc start_adhoc = 2;
780
+ SparkCommand command = 3;
781
+ }
782
+ }
783
+
784
+ // Receive events and payload from a running spark.
785
+ message SparkData {
786
+ // The command id to which this data corresponds.
787
+ string command_id = 1;
788
+
789
+ oneof payload {
790
+ // Acknowledges receipt of a spark command.
791
+ bool acknowledge = 2;
792
+
793
+ // Indicates the command has completed.
794
+ bool ended = 3;
795
+
796
+ // Will contain error details on command failure.
797
+ string error = 4;
798
+
799
+ // Data emitted by a command, usually in stringified JSON format.
800
+ string data = 5;
801
+ }
802
+ }
803
+
804
+ // Details of a spark instance.
805
+ message SparkInstance {
806
+ // The UUID assigned to the spark instance.
807
+ string spark_id = 1;
808
+ }
809
+
810
+ // The response will contain one of the messages indicated below.
811
+ message SparkResponse {
812
+ oneof payload {
813
+ // Details of any error that occurred on the call.
814
+ tdx.volt_api.volt.v1.Status status = 1;
815
+
816
+ // Details of the spark instance, sent in response to a start command.
817
+ SparkInstance spark_instance = 2;
818
+
819
+ // Payload data emitted by the spark.
820
+ SparkData spark_data = 3;
821
+ }
822
+ }
823
+
824
+ message GetSparkRequest {
825
+ string spark_id = 1;
826
+ }
827
+
828
+ // One of the following fields will be present in the response.
829
+ message GetSparkResponse {
830
+ // Details of any error that occurred on the call.
831
+ tdx.volt_api.volt.v1.Status status = 1;
832
+ }
833
+
834
+ `;
835
+ export const ssi = `syntax = "proto3";
836
+
837
+ package tdx.volt_api.volt.v1;
838
+
839
+ message DIDRegistryUpdate {
840
+ // The id of the update.
841
+ // Reserved for internal use.
842
+ uint64 id = 1;
843
+
844
+ // The id of the identity.
845
+ string did = 2;
846
+
847
+ // The type of update, either "add", "update" or "delete".
848
+ string operation = 3;
849
+
850
+ // The DID document contained in the update.
851
+ string document = 4;
852
+
853
+ // The hash of DID document.
854
+ // This is for internal use in comparisons.
855
+ string hash = 5;
856
+
857
+ // The signature of the update.
858
+ string update_signature = 6;
859
+
860
+ // The timestamp of this update.
861
+ uint64 timestamp = 7;
862
+
863
+ // The vector clocks for this DID.
864
+ // The vector clocks are a map of the peer ID to the id of the last update received for this DID.
865
+ map<string, uint64> vector_clock = 8;
866
+
867
+ // The id of the Volt that first created this DID.
868
+ string origin_volt = 9;
869
+
870
+ // Optional description of this document, this is not part of the DID document or signature.
871
+ string description = 10;
872
+ }
873
+
874
+ message VerifiablePresentation {
875
+ // The credential JSON.
876
+ string credential_json = 1;
877
+
878
+ // A signature of the credential JSON. The signature should usually be that of the credential subject.
879
+ string signature = 2;
880
+ }
881
+
882
+ message VerifiableCredential {
883
+ // The credential id. Leave empty when creating a new credential.
884
+ string id = 1;
885
+
886
+ // The credential status, either "pending", "verified", or "revoked".
887
+ string status = 2;
888
+
889
+ // The credential types.
890
+ repeated string type = 3;
891
+
892
+ // The DID of the issuer.
893
+ string issuer_id = 4;
894
+
895
+ // The JSON of the credential subject.
896
+ string subject_json = 5;
897
+
898
+ // The full JSON of the credential.
899
+ string json = 6;
900
+ }
901
+ `;
902
+ export const ssi_api = `syntax = "proto3";
903
+
904
+ package tdx.volt_api.volt.v1;
905
+
906
+ import "tdx/volt_api/volt/v1/status.proto";
907
+ import "tdx/volt_api/volt/v1/ssi.proto";
908
+
909
+ service SsiAPI {
910
+ // Delete a DID document or all DID documents originating from a given Volt.
911
+ // Requires \`volt:delete-did\` API privilege.
912
+ rpc DeleteDID(DeleteDIDRequest) returns (DeleteDIDResponse);
913
+
914
+ // Get all updates to the DID registry since the specified timestamp.
915
+ // Internal use only.
916
+ rpc GetDIDRegistryUpdates(GetDIDRegistryUpdatesRequest) returns (GetDIDRegistryUpdatesResponse);
917
+
918
+ // Import a verifiable credential.
919
+ rpc ImportCredential(ImportCredentialRequest) returns (ImportCredentialResponse);
920
+
921
+ // Parse a verifiable credential from a URL or a verifiable presentation.
922
+ rpc ParseCredential(ParseCredentialRequest) returns (ParseCredentialResponse);
923
+
924
+ // Resolve a DID to a DID document.
925
+ rpc ResolveDID(ResolveDIDRequest) returns (ResolveDIDResponse);
926
+
927
+ // Register a DID document.
928
+ // This is intended for use by the DID registry when synchronising with other registries.
929
+ // To register a new DID document, it is recommended to use the VoltAPI Authenticate method.
930
+ rpc RegisterDIDDocument(RegisterDIDDocumentRequest) returns (RegisterDIDDocumentResponse);
931
+
932
+ // Save a verifiable credential.
933
+ rpc SaveCredential(SaveCredentialRequest) returns (SaveCredentialResponse);
934
+
935
+ // Search the DID registry.
936
+ rpc SearchDIDRegistry(SearchDIDRegistryRequest) returns (SearchDIDRegistryResponse);
937
+ }
938
+
939
+ message DeleteDIDRequest {
940
+ // Specify an individual DID as the target of the delete operation, or a Volt to delete all DIDs owned by that Volt.
941
+ oneof target {
942
+ // The id of the identity to delete.
943
+ string did = 1;
944
+
945
+ // Force delete of all DIDs owned by the specified Volt.
946
+ string origin_volt = 2;
947
+ }
948
+
949
+ // Optional passphrase of the DID controller key. Required if the key is encrypted.
950
+ string key_passphrase = 3;
951
+ }
952
+
953
+ message DeleteDIDResponse {
954
+ // Details of any error that occurred on the call.
955
+ tdx.volt_api.volt.v1.Status status = 1;
956
+ }
957
+
958
+ message GetDIDRegistryUpdatesRequest {
959
+ // The id of the last update received.
960
+ // All updates since this id will be returned, limited to the maximum number of updates specified in the request.
961
+ // To fully synchronise, clients should continue calling this method until the response contains no updates.
962
+ // If this is the first call, then this should be set to 0.
963
+ uint64 since_id = 1;
964
+
965
+ // The maximum number of updates to return, defaults to 1000.
966
+ uint32 max_updates = 2;
967
+
968
+ // Filter by origin volt.
969
+ string origin_volt = 3;
970
+ }
971
+
972
+ message GetDIDRegistryUpdatesResponse {
973
+ // Details of any error that occurred on the call.
974
+ tdx.volt_api.volt.v1.Status status = 1;
975
+
976
+ // The updates.
977
+ repeated DIDRegistryUpdate update = 2;
978
+ }
979
+
980
+ message ImportCredentialRequest {
981
+ // Optional id of existing credential to import into. If not specified, a new credential will be created.
982
+ string id = 1;
983
+
984
+ // The JSON representation of the credential.
985
+ string json = 2;
986
+
987
+ // Optional id of the folder resource to save the credential in. This is ignored if the id field is specified.
988
+ string create_in_parent_id = 3;
989
+
990
+ // Optional description of the credential.
991
+ string description = 4;
992
+ }
993
+
994
+ message ImportCredentialResponse {
995
+ // Details of any error that occurred on the call.
996
+ tdx.volt_api.volt.v1.Status status = 1;
997
+
998
+ // The id assigned to the credential.
999
+ string id = 2;
1000
+ }
1001
+
1002
+ message ParseCredentialRequest {
1003
+ // Details of the credential to parse.
1004
+ oneof credential {
1005
+ // A presentation of the verifiable credential.
1006
+ // The presentation doesn't need to be signed, but if it is, the signature will be verified using the public key provided in the request.
1007
+ VerifiablePresentation verifiable_presentation = 1;
1008
+
1009
+ // A URL to a verifiable credential.
1010
+ // Not yet implemented.
1011
+ string url = 2;
1012
+ }
1013
+
1014
+ // Optional public key to use to verify the presentation signature.
1015
+ string presentation_public_key = 3;
1016
+ }
1017
+
1018
+ message ParseCredentialResponse {
1019
+ // Details of any error that occurred on the call.
1020
+ tdx.volt_api.volt.v1.Status status = 1;
1021
+
1022
+ // The parsed credential details.
1023
+ VerifiableCredential verifiable_credential = 2;
1024
+ }
1025
+
1026
+ message ResolveDIDRequest {
1027
+ // The DID to resolve.
1028
+ string did = 1;
1029
+
1030
+ // Set to search all known registries rather than just the local registry.
1031
+ bool include_registries = 2;
1032
+ }
1033
+
1034
+ message ResolveDIDResponse {
1035
+ // Details of any error that occurred on the call.
1036
+ tdx.volt_api.volt.v1.Status status = 1;
1037
+
1038
+ // The JSON representation of the DID document.
1039
+ string did_document = 2;
1040
+
1041
+ // The signature used to save this version of the DID document.
1042
+ string update_signature = 3;
1043
+
1044
+ // The DID of the Volt that saved this version of the DID document.
1045
+ string origin_volt = 4;
1046
+
1047
+ // Optional description associated with the DID document.
1048
+ string description = 5;
1049
+ }
1050
+
1051
+ message RegisterDIDDocumentRequest {
1052
+ bool create = 1;
1053
+
1054
+ // The DID document to save.
1055
+ DIDRegistryUpdate did_update = 2;
1056
+
1057
+ // When updating an existing DID document, it is necessary to include a signature of the document JSON, signed by the DID document's current owner.
1058
+ string update_signature = 3;
1059
+ }
1060
+
1061
+ message RegisterDIDDocumentResponse {
1062
+ // Details of any error that occurred on the call.
1063
+ tdx.volt_api.volt.v1.Status status = 1;
1064
+
1065
+ DIDRegistryUpdate did_document = 2;
1066
+ }
1067
+
1068
+ message SaveCredentialRequest {
1069
+ // A human-readable description of the credential.
1070
+ string description = 1;
1071
+
1072
+ // Details of the credential to save.
1073
+ VerifiableCredential verifiable_credential = 2;
1074
+
1075
+ // Optional id of the folder resource to save the credential in.
1076
+ string create_in_parent_id = 3;
1077
+ }
1078
+
1079
+ message SaveCredentialResponse {
1080
+ // Details of any error that occurred on the call.
1081
+ tdx.volt_api.volt.v1.Status status = 1;
1082
+
1083
+ // The id assigned to the credential.
1084
+ string id = 2;
1085
+
1086
+ // The JSON representation of the credential.
1087
+ string json = 3;
1088
+ }
1089
+
1090
+ message SearchDIDRegistryRequest {
1091
+ oneof filter {
1092
+ // Filter by DID itself. This is a prefix match, so searching for 'did:volt:123' will match 'did:volt:1234'. You can also exclude the 'did:volt:' prefix.
1093
+ string did_filter = 1;
1094
+
1095
+ // Filter by the (optional) description attached to the DID document. This will match any DID document whose description contains the specified string, for example 'John' will match 'John Smith', 'Elton John' and 'Jasper Johns-Frederick'.
1096
+ string description_filter = 2;
1097
+
1098
+ // Filter by the origin Volt. This will match any DID document whose origin Volt matches exactly the given DID.
1099
+ string origin_filter = 3;
1100
+ }
1101
+
1102
+ // The page number to retrieve, defaults to 1.
1103
+ uint32 page_number = 4;
1104
+
1105
+ // The number of results per page, defaults to 100.
1106
+ uint32 page_size = 5;
1107
+ }
1108
+
1109
+ message SearchDIDRegistryResponse {
1110
+ // Details of any error that occurred on the call.
1111
+ tdx.volt_api.volt.v1.Status status = 1;
1112
+
1113
+ // The DID documents that matched the search criteria.
1114
+ repeated DIDRegistryUpdate did_document = 2;
1115
+ }
1116
+ `;
1117
+ export const status = `syntax = "proto3";
1118
+
1119
+ package tdx.volt_api.volt.v1;
1120
+
1121
+ message Status {
1122
+ // A simple error code that can be easily handled by the client.
1123
+ // Mirrors the grpc StatusCode enum, 0 => OK
1124
+ int32 code = 1;
1125
+
1126
+ // A developer-facing human-readable error message in English. It should both explain the error and offer an actionable resolution to it.
1127
+ string message = 2;
1128
+
1129
+ // Long form error description.
1130
+ string description = 3;
1131
+ }
1132
+ `;
1133
+ export const terminal_api = `syntax = "proto3";
1134
+
1135
+ package tdx.volt_api.volt.v1;
1136
+
1137
+ import "tdx/volt_api/volt/v1/status.proto";
1138
+
1139
+ service TerminalAPI {
1140
+ rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
1141
+ }
1142
+
1143
+ message TerminalSize {
1144
+ int32 rows = 1;
1145
+ int32 cols = 2;
1146
+ }
1147
+
1148
+ message Control {
1149
+ string command = 1;
1150
+ repeated string arg = 2;
1151
+ string stop = 3;
1152
+ string pause = 4;
1153
+ string resume = 5;
1154
+ string reset = 6;
1155
+ TerminalSize terminal_size = 7;
1156
+ int32 interrupt = 8;
1157
+ }
1158
+
1159
+ message Input {
1160
+ bytes data = 1;
1161
+ }
1162
+
1163
+ message CommandStreamRequest {
1164
+ oneof payload {
1165
+ Control control = 1;
1166
+ Input input = 2;
1167
+ }
1168
+ }
1169
+
1170
+ message CommandStreamResponse {
1171
+ tdx.volt_api.volt.v1.Status status = 1;
1172
+ bytes data = 2;
1173
+ }
1174
+
1175
+ `;
1176
+ export const volt = `syntax = "proto3";
1177
+
1178
+ package tdx.volt_api.volt.v1;
1179
+
1180
+ enum DiscoveryMode {
1181
+ DISCOVERY_MODE_UNKNOWN = 0;
1182
+
1183
+ // Only local identities with explicit policy PERMIT can discover.
1184
+ DISCOVERY_MODE_TRUSTED = 1;
1185
+
1186
+ // Any bound local identity can discover.
1187
+ DISCOVERY_MODE_PUBLIC = 2;
1188
+
1189
+ // Only identities with explicit policy PERMIT can discover, and the service will be available to local and non-local (Relayed) clients.
1190
+ DISCOVERY_MODE_TRUSTED_GLOBAL = 3;
1191
+
1192
+ // Any bound identity can discover, and the service will be available to local and non-local (Relayed) clients.
1193
+ DISCOVERY_MODE_PUBLIC_GLOBAL = 4;
1194
+ }
1195
+
1196
+ enum OnlineStatus {
1197
+ ONLINE_STATUS_UNKNOWN = 0;
1198
+ ONLINE_STATUS_ONLINE = 1;
1199
+ ONLINE_STATUS_OFFLINE = 2;
1200
+ }
1201
+
1202
+ // Not used ATM.
1203
+ enum ResourceStatus {
1204
+ RESOURCE_STATUS_UNKNOWN = 0;
1205
+ RESOURCE_STATUS_LIVE = 1;
1206
+ RESOURCE_STATUS_INACTIVE = 2;
1207
+ RESOURCE_STATUS_DELETED = 999;
1208
+ }
1209
+
1210
+ // Not used ATM.
1211
+ enum ShareMode {
1212
+ SHARE_MODE_UNKNOWN = 0;
1213
+ SHARE_MODE_TRUSTED = 1;
1214
+ SHARE_MODE_PUBLIC_READ = 2;
1215
+ }
1216
+
1217
+ // @todo currently this must align with AuthorisationDecision enum in policy library, but some of the values are irrelevant outside of the public API so we need a public-facing enum and some translation.
1218
+ enum PolicyDecision {
1219
+ POLICY_DECISION_UNKNOWN = 0;
1220
+ POLICY_DECISION_PROMPT = 1;
1221
+ POLICY_DECISION_PERMIT = 2;
1222
+ POLICY_DECISION_DENY = 3;
1223
+ POLICY_DECISION_INDETERMINATE = 4;
1224
+ POLICY_DECISION_NOT_APPLICABLE = 5;
1225
+ POLICY_DECISION_APPLICABLE = 6;
1226
+ POLICY_DECISION_PENDING = 7;
1227
+ }
1228
+
1229
+ // Attribute data types.
1230
+ enum AttributeDataType {
1231
+ ATTRIBUTE_DATA_TYPE_UNKNOWN = 0;
1232
+ ATTRIBUTE_DATA_TYPE_STRING = 1;
1233
+ ATTRIBUTE_DATA_TYPE_INTEGER = 2;
1234
+ ATTRIBUTE_DATA_TYPE_REAL = 3;
1235
+ ATTRIBUTE_DATA_TYPE_BOOLEAN = 4;
1236
+ ATTRIBUTE_DATA_TYPE_BYTES = 5;
1237
+
1238
+ ATTRIBUTE_DATA_TYPE_IDENTITY = 100;
1239
+ ATTRIBUTE_DATA_TYPE_RESOURCE = 101;
1240
+ }
1241
+
1242
+ // Represents an outbound connection from a Volt to a remote service that will act as a proxy for that Volt.
1243
+ // This enables Volts to bypass firewall and NATs.
1244
+ // Example - connection from a Volt to a Relay Volt running on the public internet, such as tdxvolt.com
1245
+ message ProxyConnection {
1246
+ // Unique connection id.
1247
+ string id = 1;
1248
+
1249
+ // A human-readable name for the connection.
1250
+ string name = 2;
1251
+
1252
+ // The remote address of the proxy service.
1253
+ string address = 3;
1254
+
1255
+ // The certificate authority of the proxy service.
1256
+ string ca_pem = 4;
1257
+
1258
+ // Indicates this connection is enabled.
1259
+ bool enabled = 5;
1260
+
1261
+ // Indicates this connection is currently in use.
1262
+ bool connected = 6;
1263
+
1264
+ // Indicates that this connection will handle HTTP proxying as well as GRPC.
1265
+ bool enable_http_proxy = 8;
1266
+
1267
+ // Set to indicate the Volt API itself is not automatically exposed to the connection.
1268
+ bool disable_volt_api = 9;
1269
+
1270
+ // Optional challenge that can be presented in the authentication request.
1271
+ string challenge = 10;
1272
+
1273
+ // The id of the target Volt that this connection is bound to.
1274
+ string target_id = 11;
1275
+
1276
+ // Indicates that this connection hosts a DID registry that we should synchronise with.
1277
+ bool sync_did_registry = 12;
1278
+
1279
+ // The id of the last DID registry operation that was synchronised.
1280
+ uint64 did_registry_sync_id = 13;
1281
+
1282
+ // Indicates that this connection hosts a DID registry that we should synchronise with.
1283
+ bool sync_vc_registry = 14;
1284
+
1285
+ // The timestamp of the last VC registry operation that was synchronised.
1286
+ uint64 vc_registry_sync_timestamp = 15;
1287
+
1288
+ string session_id = 16;
1289
+
1290
+ string certificate = 17;
1291
+ }
1292
+
1293
+ enum SecureMode {
1294
+ SECURE_MODE_UNKNOWN = 0;
1295
+ SECURE_MODE_INSECURE = 1;
1296
+ SECURE_MODE_TLS = 2;
1297
+ }
1298
+
1299
+ // Encapsulates the various Volt parameters that are configurable by the Volt owner.
1300
+ message VoltParameters {
1301
+ string id = 1;
1302
+
1303
+ // The name of the Volt.
1304
+ string name = 2;
1305
+
1306
+ // Human-readable description of the Volt.
1307
+ string description = 3;
1308
+
1309
+ // The database driver in use.
1310
+ string db_driver = 4;
1311
+
1312
+ // The local file path location of the Volt storage.
1313
+ string location = 5;
1314
+
1315
+ // The key strategy in use, this determines how the root key is stored.
1316
+ string key_strategy = 6;
1317
+
1318
+ // The identifier for the key, the semantics depend on the key strategy in use.
1319
+ string key_id = 7;
1320
+
1321
+ // The Volt certificate authority.
1322
+ string ca_pem = 8;
1323
+
1324
+ // The Volt API server certificate.
1325
+ string cert_pem = 9;
1326
+
1327
+ // Optional hostname of the Volt if using DNS or a static IP address, e.g. tdxvolt.com
1328
+ string fixed_host = 10;
1329
+
1330
+ // Port to use for hosting the Volt management service.
1331
+ int32 grpc_port = 11;
1332
+
1333
+ // Port to use for hosting the Volt grpc service.
1334
+ int32 http_port = 12;
1335
+
1336
+ // The Volt http server key file path.
1337
+ string http_key_path = 13;
1338
+
1339
+ // The Volt http server certificate file path.
1340
+ string http_cert_path = 14;
1341
+
1342
+ // The Volt http server certificate authority chain file path.
1343
+ string http_ca_path = 15;
1344
+
1345
+ // Indicates the Volt will be discoverable by clients using the discovery api.
1346
+ bool discoverable = 16;
1347
+
1348
+ // Optional challenge code that can be used aid in the process of authenticating clients.
1349
+ string authenticate_challenge = 18;
1350
+
1351
+ // Indicates that clients must present the correct challenge code in order to be able to authenticate.
1352
+ bool require_authenticate_challenge = 19;
1353
+
1354
+ // Internal use only.
1355
+ bool confirm_stop = 20;
1356
+
1357
+ // Internal use only.
1358
+ bool auto_start = 21;
1359
+
1360
+ // Internal use only.
1361
+ bool enable_messaging = 22;
1362
+
1363
+ // Set to indicate this Volt acts as a Relay.
1364
+ // This means this Volt can act as a proxy for other Volts (or in fact any client) that connect to it.
1365
+ bool has_relay = 23;
1366
+
1367
+ // Set to run the Relay open to any client, i.e. clients can utilise the Relay without first authenticating.
1368
+ bool relay_open = 24;
1369
+
1370
+ // Determines if the Volt HTTP server is enabled.
1371
+ bool enable_http_server = 25;
1372
+
1373
+ // Determines whether the HTTP server employs TLS.
1374
+ bool http_server_secure = 26;
1375
+
1376
+ // Determines whether the HTTP server supports forwarding.
1377
+ bool enable_http_forwarding = 27;
1378
+
1379
+ // Determines if the Volt REST API is exposed via the HTTP server.
1380
+ bool enable_http_api = 28;
1381
+
1382
+ // Determines if the Volt Websocket API is exposed via the HTTP server.
1383
+ bool enable_websocket_api = 29;
1384
+
1385
+ // The hostname:port at which the Volt API is currently running.
1386
+ string address = 30;
1387
+
1388
+ // Set to indicate the Volt file store is encrypted.
1389
+ bool encrypt_file_store = 31;
1390
+
1391
+ // This is a unique connection id.
1392
+ // Indicates that these parameters refer to a connection to a remote Volt rather than a local Volt.
1393
+ string connection_id = 32;
1394
+
1395
+ // The certificate authority of the Relay if this is a remote connection via a Relay.
1396
+ string relay_ca_pem = 33;
1397
+
1398
+ // Optional override of the http address, rather than using the default of fixed_host:http_port.
1399
+ // This is useful if the Volt is behind a firewall or NAT, and the http server is listening on a different port
1400
+ // from 80 or 443 but this is hidden by the proxy. For example, if the \`fixed_host\` is \`coreid.com\` and http server is
1401
+ // listening on 2115, but the proxy is forwarding 443 to 2115, then the http_address_override would be set to
1402
+ // \`https://coreid.com\`.
1403
+ string http_address_override = 34;
1404
+
1405
+ // An optional alias that can be used to refer to the Volt rather than the \`id\` field.
1406
+ // This alias must be unique within the scope of the Battery in which the Volt is stored.
1407
+ string alias = 35;
1408
+
1409
+ // The runtime version this Volt is running.
1410
+ Version version = 36;
1411
+
1412
+ // If set, indicates that any client that provides the correct challenge during authentication will automatically be approved to access the Volt.
1413
+ bool approve_on_challenge = 37;
1414
+
1415
+ // If set, indicates that any client that proves ownership of a DID known to the Volt will automatically be approved to access the Volt.
1416
+ bool approve_on_did = 38;
1417
+
1418
+ // If set, indicates that clients can register DIDs with this Volt.
1419
+ bool enable_did_registry = 39;
1420
+
1421
+ // Zero or more URLs of trusted peer DID registries.
1422
+ repeated string did_registry = 40;
1423
+
1424
+ // If set, enables outbound SMTP.
1425
+ bool enable_outbound_smtp = 41;
1426
+
1427
+ // The SMTP host to use for sending emails.
1428
+ string outbound_smtp_host = 42;
1429
+
1430
+ // The SMTP port to use for sending emails.
1431
+ uint32 outbound_smtp_port = 43;
1432
+
1433
+ // The SMTP username to use for sending emails.
1434
+ string outbound_smtp_user = 44;
1435
+
1436
+ // The SMTP password to use for sending emails.
1437
+ string outbound_smtp_password = 45;
1438
+
1439
+ // If set, enables sessions that authenticate using credentials rather than a DID to create resources in the 'anonymous' system folder.
1440
+ bool enable_anonymous_create = 46;
1441
+
1442
+ // The decision to apply to all authentication requests that do not match any other policy.
1443
+ // The default is PROMPT.
1444
+ PolicyDecision catch_all_auth_decision = 47;
1445
+
1446
+ // If set, enables caching of policy decisions.
1447
+ bool enable_policy_cache = 48;
1448
+
1449
+ // If set, enables the terminal API.
1450
+ bool enable_terminal = 49;
1451
+
1452
+ // The time at which the Volt was started.
1453
+ uint64 start_time = 50;
1454
+ }
1455
+
1456
+ message VoltEndpoint {
1457
+ // The globally unique Volt id.
1458
+ string id = 1;
1459
+
1460
+ // Human-readable name of the Volt.
1461
+ string display_name = 3;
1462
+
1463
+ // The actual host/ip the volt is physically running on (might be a local ip if behind firewall).
1464
+ string local_address = 4;
1465
+
1466
+ // The address of the endpoint HTTP server.
1467
+ string http_address = 5;
1468
+
1469
+ // The global (Relay) address of the volt. Any given volt may be advertising on more than one Relay instance. The value given here will depend on the Relay instance that handled the endpoint query response.
1470
+ string relay_address = 6;
1471
+
1472
+ // The root certificate of the Relay instance referred to in \`relay_address\`.
1473
+ string relay_ca_pem = 7;
1474
+
1475
+ // The self-signed certificate used by the volt to sign client certificates.
1476
+ string ca_pem = 8;
1477
+
1478
+ // The Volt public key in PEM format.
1479
+ string public_key = 9;
1480
+
1481
+ // The base58 fingerprint of the Volt public key.
1482
+ string fingerprint = 10;
1483
+
1484
+ // The online status of the Volt.
1485
+ OnlineStatus online_status = 11;
1486
+
1487
+ // Indicates that this Volt acts as a Relay.
1488
+ bool has_relay = 12;
1489
+
1490
+ // The API version supported by the endpoint.
1491
+ Version api_version = 13;
1492
+
1493
+ // Optional description of the endpoint.
1494
+ string description = 14;
1495
+
1496
+ // The list of DID registries that this Volt trusts.
1497
+ repeated string did_registry = 15;
1498
+ }
1499
+
1500
+ // Internal use only.
1501
+ message MethodDescription {
1502
+ string path = 1;
1503
+ bool client_streaming = 2;
1504
+ bool server_streaming = 3;
1505
+ }
1506
+
1507
+ // Describes a single protobuf file for use in ServiceDescription.
1508
+ message ProtoFile {
1509
+ // The path name of the proto file, relative to the 'root' of the namespace, e.g. "tdx/volt_api/volt/v1/volt.proto".
1510
+ string file_path = 1;
1511
+
1512
+ // The actual protobuf file contents.
1513
+ string protobuf = 2;
1514
+
1515
+ // Optional - the service(s) contained in this protobuf file, if omitted here they will be loaded dynamically from the protobuf.
1516
+ repeated string service_name = 3;
1517
+ }
1518
+
1519
+ enum ServiceHostType {
1520
+ SERVICE_HOST_TYPE_UNKNOWN = 0;
1521
+ // A built-in service hosted by the Volt.
1522
+ SERVICE_HOST_TYPE_BUILTIN = 1;
1523
+ // A service hosted by a grpc server other than the Volt.
1524
+ SERVICE_HOST_TYPE_SERVER = 2;
1525
+ // A service hosted by a Volt client via a relay connection, i.e. the service is not exposed by a server as such, rather a Volt client implements the service and a Volt acts as a proxy, calling back to the client to implement the methods.
1526
+ SERVICE_HOST_TYPE_RELAYED = 3;
1527
+ }
1528
+
1529
+ // Describes a Volt service.
1530
+ message ServiceDescription {
1531
+ // The configuration used by the host of this service.
1532
+ ServiceHostType host_type = 1;
1533
+
1534
+ // The identity of the client that is exposing the service.
1535
+ // For example, if a third party is exposing a database service via a Volt, it will first authenticate and obtain a client DID and credentials in order to be able to create service resource(s).
1536
+ // Any resources that are owned by this client will be marked as online if the client itself is online, i.e. has a live connection to the Volt.
1537
+ // This will be empty if the service is a built-in Volt service.
1538
+ string host_client_id = 2;
1539
+
1540
+ // The id of the resource that holds the protobuf definition for this resource.
1541
+ // For example, if a third party is exposing a database service via a Volt, it will create a service resource that holds details of the protobuf methods exposed by the service.
1542
+ // For built-in services, i.e. those hosted by the Volt, this will set to the Volt id.
1543
+ string host_service_id = 3;
1544
+
1545
+ // The address of the grpc server hosting this service.
1546
+ // Only relevant to grpc-hosted services.
1547
+ string host_address = 4;
1548
+
1549
+ // The certificate authority (chain) that signed the service server certificate.
1550
+ // This is only relevant to grpc-hosted services.
1551
+ string host_ca_pem = 5;
1552
+
1553
+ // The public key of the service host, which is used to encrypt payloads.
1554
+ // This may change as the service comes and goes online.
1555
+ string host_public_key = 6;
1556
+
1557
+ // The connection id currently used to host this service.
1558
+ string host_connection_id = 8;
1559
+
1560
+ // Internal use only.
1561
+ string host_session_id = 9;
1562
+
1563
+ // The discovery mode.
1564
+ DiscoveryMode discoverable = 10;
1565
+
1566
+ // The ping timestamp of the server hosting this service.
1567
+ int64 ping_timestamp = 11;
1568
+
1569
+ // The protobuf definitions of the APIs exposed by this service.
1570
+ repeated ProtoFile proto_file = 12;
1571
+
1572
+ // The fully qualified names of the protobuf services, for example tdx.volt_api.webcam.v1.WebcamControlAPI.
1573
+ repeated string service_api = 13;
1574
+
1575
+ // Internal use only.
1576
+ repeated MethodDescription method = 100;
1577
+ }
1578
+
1579
+ // Attribute value will be one of the following fields, depending on the data type.
1580
+ message AttributeValue {
1581
+ oneof value {
1582
+ string string = 1;
1583
+ int64 integer = 2;
1584
+ double real = 3;
1585
+ bool boolean = 4;
1586
+ bytes bytes = 5;
1587
+ }
1588
+ }
1589
+
1590
+ // A resource attribute enables storing arbitrary data associated with a resource.
1591
+ message ResourceAttribute {
1592
+ uint32 id = 1;
1593
+
1594
+ string attribute_id = 2;
1595
+
1596
+ string resource_id = 3;
1597
+
1598
+ AttributeDataType data_type = 4;
1599
+
1600
+ repeated AttributeValue value = 5;
1601
+ }
1602
+
1603
+ // Using \`major\` and \`minor\` here upsets the GNU C Library, so we add a \`version_\` prefix.
1604
+ message Version {
1605
+ uint32 version_major = 1;
1606
+ uint32 version_minor = 2;
1607
+ uint32 version_patch = 3;
1608
+ }
1609
+
1610
+ // The core Resource metadata schema.
1611
+ message Resource {
1612
+ // The globally unique resource id.
1613
+ string id = 1;
1614
+
1615
+ // Optional description.
1616
+ string description = 2;
1617
+
1618
+ // Human-readable resource name.
1619
+ string name = 4;
1620
+
1621
+ // Not in use.
1622
+ ShareMode share_mode = 5;
1623
+
1624
+ // The id of the Volt that hosts this resource.
1625
+ string volt_id = 7;
1626
+
1627
+ // Optional description of any services exposed by this resource.
1628
+ ServiceDescription service_description = 8;
1629
+
1630
+ // Attributes assigned to the resource.
1631
+ repeated ResourceAttribute attribute = 9;
1632
+
1633
+ // The version of the platform.
1634
+ Version platform_version = 10;
1635
+
1636
+ // The resource version.
1637
+ uint64 version = 11;
1638
+
1639
+ // The identity of the resource owner.
1640
+ string owner = 101;
1641
+
1642
+ // Creation timestamp, milliseconds since epoch.
1643
+ uint64 created = 105;
1644
+
1645
+ // Last modification timestamp, milliseconds since epoch.
1646
+ uint64 modified = 106;
1647
+
1648
+ // Not in use.
1649
+ ResourceStatus status = 108;
1650
+
1651
+ // The taxonomy of the resource.
1652
+ repeated string kind = 110;
1653
+
1654
+ // The online status.
1655
+ // For most kinds of resource this indicates that the server hosting the resource is online, the exception being identity resources, in which case the status reflects whether or not the identity has a live connection.
1656
+ // All built-in resources are hosted by the Volt itself and are therefore always online when the Volt is running.
1657
+ // Resources hosted by external servers are online if the server itself is online and has registered the resource as online using \`setServiceStatus\`.
1658
+ OnlineStatus online_status = 111;
1659
+
1660
+ // The size of the resource store in bytes.
1661
+ uint64 size = 113;
1662
+
1663
+ // The path to the resource store.
1664
+ string store = 114;
1665
+
1666
+ // Alias(es) that can be used to refer to the resource rather than the id.
1667
+ // Each alias must be unique to the Volt, this is enforced by the API.
1668
+ // No format restrictions are currently applied to alias, but this may change in future, for the time being it makes sense to stick to alphanumeric characters and '_' or '-'.
1669
+ repeated string alias = 115;
1670
+
1671
+ // The hash of the resource content contained in the store.
1672
+ string content_hash = 116;
1673
+
1674
+ // Not yet supported.
1675
+ repeated Resource child = 200;
1676
+ }
1677
+
1678
+ message IdentityAlias {
1679
+ // The alias id.
1680
+ uint32 id = 1;
1681
+
1682
+ // The corresponding identity id.
1683
+ string identity_did = 2;
1684
+
1685
+ // The actual alias, e.g. a common name or key fingerprint.
1686
+ string alias = 3;
1687
+
1688
+ // This will only be populated if alias_type == tdx:public-key
1689
+ string public_key = 4;
1690
+
1691
+ // This will only be populated if alias_type == tdx:public-key, and the key is stored in the Volt.
1692
+ string private_key = 5;
1693
+
1694
+ // The alias type, for example public key, email, phone number etc.
1695
+ string alias_type = 6;
1696
+
1697
+ // The identity that issued this alias.
1698
+ string issuer_id = 7;
1699
+
1700
+ // Indicates if this alias has an authenticate policy decision assigned.
1701
+ PolicyDecision authenticate = 8;
1702
+
1703
+ // Optional description of this alias.
1704
+ string description = 9;
1705
+ }
1706
+
1707
+ // A Volt identity encompasses a Resource and a set of identity aliases.
1708
+ message Identity {
1709
+ Resource resource = 1;
1710
+
1711
+ repeated IdentityAlias alias = 2;
1712
+ }
1713
+
1714
+ message Access {
1715
+ string id = 1;
1716
+
1717
+ // The resource being accessed.
1718
+ string resource_id = 2;
1719
+
1720
+ // A human-readable short identifier of the resource.
1721
+ string resource_name = 3;
1722
+
1723
+ // The identity that owns the resource.
1724
+ string resource_owner = 4;
1725
+
1726
+ // The kind of resource.
1727
+ repeated string resource_kind = 5;
1728
+
1729
+ oneof subject {
1730
+ // The identity attempting access.
1731
+ string identity_did = 6;
1732
+
1733
+ // The JSON path array for looking up verifiable credentials.
1734
+ string credential_lookup = 7;
1735
+ }
1736
+
1737
+ // A human-readable short identifier of the subject.
1738
+ string identity_name = 8;
1739
+
1740
+ // The kind of identity.
1741
+ repeated string identity_kind = 9;
1742
+
1743
+ // Requested access.
1744
+ string access = 10;
1745
+
1746
+ // Optional extra data.
1747
+ string extra = 11;
1748
+
1749
+ // Assigned decision.
1750
+ PolicyDecision decision = 12;
1751
+
1752
+ bool recursive = 13;
1753
+
1754
+ // Time at which the request was made.
1755
+ int64 request_time = 14;
1756
+
1757
+ // Time at which the decision was taken.
1758
+ int64 decision_time = 15;
1759
+
1760
+ // Counter of number times this access was requested.
1761
+ uint32 request_count = 16;
1762
+ }
1763
+
1764
+ enum SessionStatus {
1765
+ SESSION_STATUS_UNKNOWN = 0;
1766
+ SESSION_STATUS_PENDING = 1;
1767
+ SESSION_STATUS_LIVE = 2;
1768
+ SESSION_STATUS_EXPIRED = 3;
1769
+ SESSION_STATUS_REVOKED = 4;
1770
+ SESSION_STATUS_REJECTED = 5;
1771
+ }
1772
+
1773
+ message SessionCredential {
1774
+ // The alias id.
1775
+ uint32 id = 1;
1776
+
1777
+ // The corresponding session id.
1778
+ string session_id = 2;
1779
+
1780
+ // The credential type, for example public key, verifiable credential, challenge etc.
1781
+ string credential_type = 4;
1782
+
1783
+ // Optional description of this credential.
1784
+ string description = 5;
1785
+
1786
+ // The id of the verifiable credential, if the credential type is volt:vc-claim.
1787
+ string vc_id = 6;
1788
+
1789
+ // The verifiable credential in JSON format, if the credential type is volt:vc-claim.
1790
+ string vc_json = 7;
1791
+
1792
+ // The subject id extracted from the \`vc_json\` field.
1793
+ string vc_subject_id = 8;
1794
+
1795
+ // The issuer id extracted from the \`vc_json\` field.
1796
+ string vc_issuer_id = 9;
1797
+
1798
+ // The comma-separated type(s) extracted from the \`vc_json\` field.
1799
+ string vc_type = 10;
1800
+
1801
+ // The challenge string, if the credential type is volt:challenge.
1802
+ string challenge = 11;
1803
+
1804
+ // The key fingerprint, if the credential type is volt:public-key.
1805
+ string key_fingerprint = 12;
1806
+
1807
+ // The PEM-encoded public key, if the credential type is volt:public-key.
1808
+ string public_key = 13;
1809
+
1810
+ // Optional PEM-encoded private key, if the credential type is volt:public-key. Only used for ephemeral REST-base sessions created dynamically after OTP authentication.
1811
+ string private_key = 14;
1812
+
1813
+ // Type-specific extra data stored with the credential.
1814
+ string extra = 15;
1815
+
1816
+ // More type-specific data stored with the credential.
1817
+ string extra_2 = 16;
1818
+ }
1819
+
1820
+ message Session {
1821
+ string id = 1;
1822
+
1823
+ string identity_did = 2;
1824
+
1825
+ string identity_name = 3;
1826
+
1827
+ string ip = 4;
1828
+
1829
+ uint64 created = 5;
1830
+
1831
+ uint64 modified = 6;
1832
+
1833
+ uint64 expires = 7;
1834
+
1835
+ repeated SessionCredential credential = 8;
1836
+
1837
+ string origin = 9;
1838
+
1839
+ SessionStatus status = 10;
1840
+ }
1841
+
1842
+ `;
1843
+ export const volt_api = `syntax = "proto3";
1844
+
1845
+ package tdx.volt_api.volt.v1;
1846
+
1847
+ import "tdx/volt_api/volt/v1/status.proto";
1848
+ import "tdx/volt_api/volt/v1/remote.proto";
1849
+ import "tdx/volt_api/volt/v1/ssi.proto";
1850
+ import "tdx/volt_api/volt/v1/volt.proto";
1851
+
1852
+ // The top-level volt management service.
1853
+ // With the exception of \`Authenticate\`, all RPCs on this service must submit either a valid client certificate signed by the volt CA, or a signed JWT.
1854
+ // A client certificate can be obtained from the \`Authenticate\` method.
1855
+ // All methods include a \`tdx.volt_api.volt.v1.Status\` in the response. If the status contains a non-OK error code the client should assume the remainder of the message is invalid, unless otherwise indicated in the response documentation.
1856
+ service VoltAPI {
1857
+ // Issues a request to authenticate on the volt.
1858
+ // All clients must successfully authenticate in order to gain any kind of access.
1859
+ // A client certificate is optional for this RPC, if omitted a JWT must be provided in the call metadata.
1860
+ // If the client plans to register one or more services with the Volt, it should use the 'host' field of the request so that the returned certificate has the appropriate SAN extension in place. Note that if the client IP address changes it will be necessary to re-authenticate the client and obtain a new certificate.
1861
+ // If the authenticate decision is 'permit', the response contains various details that should be persisted by the client, including the unique identifier assigned by the Volt and a signed client certificate along with the Volt CA certificate.
1862
+ rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse);
1863
+
1864
+ // Determine if an identity can perform a specific action on a resource.
1865
+ // Third party services can use this to interrogate the Volt policy and determine if a client has permission to perform a certain action on a resource.
1866
+ rpc CanAccessResource(CanAccessResourceRequest) returns (CanAccessResourceResponse);
1867
+
1868
+ rpc CheckCompatibility(CheckCompatibilityRequest) returns (CheckCompatibilityResponse);
1869
+
1870
+ // Creates a long-lived, bi-directional connection to the Volt.
1871
+ // The connection stream serves several purposes, including remote invocations via a Relay, Volt event notifications, pings and service registration management.
1872
+ // A connection stream is required in order for a client to be able to register services with the Volt.
1873
+ // When the stream is closed, any services registered on it will be set to offline.
1874
+ rpc Connect(stream ConnectRequest) returns (stream ConnectResponse);
1875
+
1876
+ // Copy a resource from one folder to another.
1877
+ // The resource metadata, attributes and store are copied.
1878
+ // The shares attributed to the resource are **not** currently copied.
1879
+ // n.b. Copy resources between Volts is not supported by this API. This is achieved by creating an API instance for the source and target Volts, getting the resource from the source and creating it on the target.
1880
+ rpc CopyResource(CopyResourceRequest) returns (CopyResourceResponse);
1881
+
1882
+ // Remove a custom access rule, such as a file share.
1883
+ rpc DeleteAccess(DeleteAccessRequest) returns (DeleteAccessResponse);
1884
+
1885
+ // Delete a resource from this volt.
1886
+ rpc DeleteResource(DeleteResourceRequest) returns (DeleteResourceResponse);
1887
+
1888
+ // Discover services running on this volt.
1889
+ // Lookup is done via the exposed serviceAPI, e.g. tdx.volt_api.data.v1.SqliteServerAPI.
1890
+ rpc DiscoverServices(DiscoverServicesRequest) returns (DiscoverServicesResponse);
1891
+
1892
+ // Get access rule details.
1893
+ // Only rules in which the authenticated identity participates will be retrieved, in addition to any rules that target a resource that is owned by the authenticated identity.
1894
+ // If the authenticated identity is the Volt root, all rules will be retrieved that match the criteria.
1895
+ rpc GetAccess(GetAccessRequest) returns (GetAccessResponse);
1896
+
1897
+ // Retrieve identities matching the given criteria.
1898
+ // Only identities that the authenticated identity has read access to will be retrieved.
1899
+ rpc GetIdentities(GetIdentitiesRequest) returns (GetIdentitiesResponse);
1900
+
1901
+ // Get details of a specific identity.
1902
+ // The identity will only be retrieved if the authenticated identity has read access to it.
1903
+ rpc GetIdentity(GetIdentityRequest) returns (GetIdentityResponse);
1904
+
1905
+ // Gets a one-time token that can be used as a temporary authentication token, for example create an file download link that expires after a certain time.
1906
+ rpc GetOneTimeToken(GetOneTimeTokenRequest) returns (GetOneTimeTokenResponse);
1907
+
1908
+ // Retrieve the Volt parameters.
1909
+ // This is a privileged API call and requires Volt root access.
1910
+ rpc GetParameters(GetParametersRequest) returns (GetParametersResponse);
1911
+
1912
+ // Retrieve the active Volt policy.
1913
+ // This is a privileged API call and requires Volt root access.
1914
+ rpc GetPolicy(GetPolicyRequest) returns (GetPolicyResponse);
1915
+
1916
+ // Get resource from this volt.
1917
+ rpc GetResource(GetResourceRequest) returns (GetResourceResponse);
1918
+
1919
+ // Get resources from this volt.
1920
+ rpc GetResources(GetResourcesRequest) returns (GetResourcesResponse);
1921
+
1922
+ // Get ancestors of a resource.
1923
+ rpc GetResourceAncestors(GetResourceAncestorsRequest) returns (GetResourceAncestorsResponse);
1924
+
1925
+ // Get descendants of a resource.
1926
+ rpc GetResourceDescendants(GetResourceDescendantsRequest) returns (GetResourceDescendantsResponse);
1927
+
1928
+ // Get sessions.
1929
+ rpc GetSessions(GetSessionsRequest) returns (GetSessionsResponse);
1930
+
1931
+ // Invoke a method.
1932
+ // This is primarily for use by Relay connections when proxying invocations.
1933
+ rpc Invoke(stream InvokeRequest) returns (stream InvokeResponse);
1934
+
1935
+ // Move a resource from one folder to another.
1936
+ rpc MoveResource(MoveResourceRequest) returns (MoveResourceResponse);
1937
+
1938
+ // Request access to a resource.
1939
+ // The subject of the access is assumed to be the identity of the currently authenticated peer.
1940
+ rpc RequestAccess(RequestAccessRequest) returns (RequestAccessResponse);
1941
+
1942
+ // Create or update an access rule.
1943
+ rpc SaveAccess(SaveAccessRequest) returns (SaveAccessResponse);
1944
+
1945
+ // Create or update a static file HTTP server.
1946
+ rpc SaveHttpFileServer(SaveResourceRequest) returns (SaveResourceResponse);
1947
+
1948
+ // Create or update an HTTP REST API server.
1949
+ rpc SaveHttpApiServer(SaveResourceRequest) returns (SaveResourceResponse);
1950
+
1951
+ // Create or update an identity.
1952
+ rpc SaveIdentity(SaveIdentityRequest) returns (SaveIdentityResponse);
1953
+
1954
+ // Create or update a mirrored link resource.
1955
+ rpc SaveMirroredLink(SaveResourceRequest) returns (SaveResourceResponse);
1956
+
1957
+ // Update Volt parameters.
1958
+ // This is a privileged call that requires Volt root access.
1959
+ rpc SaveParameters(SaveParametersRequest) returns (SaveParametersResponse);
1960
+
1961
+ // Create or update resource in this volt.
1962
+ rpc SaveResource(SaveResourceRequest) returns (SaveResourceResponse);
1963
+
1964
+ // Create or update a symbolic link resource.
1965
+ rpc SaveSymbolicLink(SaveResourceRequest) returns (SaveResourceResponse);
1966
+
1967
+ // Save a session.
1968
+ rpc SaveSession(SaveSessionRequest) returns (SaveSessionResponse);
1969
+
1970
+ // Set Volt access request decision.
1971
+ // This is a privileged call that requires Volt root access.
1972
+ rpc SetAccessRequestDecision(SetAccessRequestDecisionRequest) returns (SetAccessRequestDecisionResponse);
1973
+
1974
+ rpc SetPolicy(SetPolicyRequest) returns (SetPolicyResponse);
1975
+
1976
+ // Set the status of a Volt service.
1977
+ rpc SetServiceStatus(SetServiceStatusRequest) returns (SetServiceStatusResponse);
1978
+
1979
+ // Used to shutdown remote Volts.
1980
+ // This is a privileged call that requires Volt root access.
1981
+ rpc Shutdown(ShutdownRequest) returns (ShutdownResponse);
1982
+
1983
+ // Sign or verify an arbitrary message using the Volt key.
1984
+ rpc SignVerify(SignVerifyRequest) returns (SignVerifyResponse);
1985
+ }
1986
+
1987
+ // Describes a request to authenticate on a Volt.
1988
+ // Present one of the \`public_key\`, \`did_public_key\`, \`did\`, or \`did_document\` fields.
1989
+ message AuthenticateRequest {
1990
+
1991
+ oneof client_identifier {
1992
+ // The client public key in PEM format. The Volt will create a session that is bound to this public key.
1993
+ string public_key = 1;
1994
+
1995
+ // The client public key - must be in PEM format. If the client DID is lost or unknown for some reason, providing the public key here will allow the Volt to match it with the previously registered DID.
1996
+ // Note this is only valid when a DID has previously been registered using this public key.
1997
+ string did_public_key = 2;
1998
+
1999
+ // An existing DID owned by the client.
2000
+ // The JWT presented with the authenticate call must be signed by the private key corresponding to this DID.
2001
+ string did = 3;
2002
+
2003
+ // If the client doesn't have an existing DID, a DID document can be provided here.
2004
+ // The Volt will register the DID on behalf of the client.
2005
+ // The JWT presented with the authenticate call must be signed by the private key corresponding to this document.
2006
+ string did_document = 4;
2007
+ }
2008
+
2009
+ // A base64-encoded signature of the DID document, only required if \`did_document\` is provided above.
2010
+ string did_document_signature = 5;
2011
+
2012
+ // A human-readable name of the entity requesting to authenticate.
2013
+ string client_name = 6;
2014
+
2015
+ // The volt challenge code, signed by the private key component of the \`public_key\` field above, and base64 encoded.
2016
+ // This is optional.
2017
+ string challenge = 7;
2018
+
2019
+ // The host name to add as a SAN to the issued certificate.
2020
+ // This is optional, if you don't intend to host services with the certificate this can be omitted.
2021
+ string host = 8;
2022
+
2023
+ // Optional verifiable credentials describing the client.
2024
+ repeated VerifiablePresentation verifiable_presentation = 9;
2025
+
2026
+ // Reserved for internal use.
2027
+ bool purge_aliases = 10;
2028
+
2029
+ // Optional additional name to differentiate between multiple sessions for a given client.
2030
+ string session_name = 11;
2031
+ }
2032
+
2033
+ message AuthenticateResponse {
2034
+ // Details of any error that occurred on the call.
2035
+ tdx.volt_api.volt.v1.Status status = 1;
2036
+
2037
+ // The unique session identifier assigned to this authentication.
2038
+ // This should be persisted by the client, and submitted with all subsequent API calls as part of the call metadata.
2039
+ string session_id = 2;
2040
+
2041
+ // The identity id assigned to this authentication.
2042
+ string identity_did = 3;
2043
+
2044
+ // A certificate issued by the volt CA, binding the request public key to the identity.
2045
+ // Only valid for PERMIT authenticate decisions.
2046
+ string cert = 4;
2047
+
2048
+ // The volt CA chain. This is used by the client in subsequent API calls to secure the connection.
2049
+ string chain = 5;
2050
+
2051
+ // The authenticate decision.
2052
+ PolicyDecision decision = 6;
2053
+
2054
+ // Reserved for internal use.
2055
+ int64 request_time = 7;
2056
+
2057
+ // Reserved for internal use.
2058
+ int64 decision_time = 8;
2059
+ }
2060
+
2061
+ message CanAccessResourceRequest {
2062
+ oneof subject {
2063
+ // The subject of the access request.
2064
+ // This is optional, and if omitted will default to the authenticated account.
2065
+ string token = 1;
2066
+
2067
+ // The subject of the access request.
2068
+ // This is optional, and if omitted will default to the authenticated account.
2069
+ string cert = 2;
2070
+ }
2071
+
2072
+ // The resource in question.
2073
+ string resource_id = 3;
2074
+
2075
+ // The type of access that is required.
2076
+ string access = 4;
2077
+ }
2078
+
2079
+ message CanAccessResourceResponse {
2080
+ // Details of any error that occurred on the call.
2081
+ tdx.volt_api.volt.v1.Status status = 1;
2082
+
2083
+ // The identity subject that the access relates to.
2084
+ string identity_did = 2;
2085
+
2086
+ // The resource the access relates to.
2087
+ string resource_id = 4;
2088
+
2089
+ // The access type.
2090
+ string access = 5;
2091
+
2092
+ // The policy decision for this access request.
2093
+ PolicyDecision decision = 6;
2094
+ }
2095
+
2096
+ message CheckCompatibilityRequest {
2097
+ // The client platform API version.
2098
+ Version version = 1;
2099
+ }
2100
+
2101
+ message CheckCompatibilityResponse {
2102
+ // Details of any error that occurred on the call.
2103
+ tdx.volt_api.volt.v1.Status status = 1;
2104
+
2105
+ // The target Volt API version.
2106
+ Version version = 2;
2107
+ }
2108
+
2109
+ // All fields in this message are optional, send an empty message if necessary.
2110
+ message ConnectHello {
2111
+ // Optionally specify the grpc server address of the client. Only used if the client is a Volt (or service).
2112
+ string address = 1;
2113
+
2114
+ // Set to automatically make **all** services owned by the calling identity online.
2115
+ bool online_services = 3;
2116
+
2117
+ // Set to receive notification of resource events.
2118
+ bool subscribe_resource_events = 4;
2119
+
2120
+ // Set this if you are connecting to a relay, i.e. the Volt you are sending to this message is a relay.
2121
+ // This indicates that you are happy to receive method invocations from clients of the Relay.
2122
+ // This will usually be set to the \`id\` of your Volt, but in theory any client could receive remote invocation requests in this way.
2123
+ string relay_id = 5;
2124
+
2125
+ // A friendly name to present to Relay clients.
2126
+ string relay_name = 6;
2127
+
2128
+ string relay_description = 7;
2129
+
2130
+ // The certificate authority to present to Relay clients.
2131
+ string relay_ca_pem = 8;
2132
+
2133
+ // Set to indicate the connection is discoverable to other Relay clients.
2134
+ bool relay_discoverable = 9;
2135
+
2136
+ // Optionally specify the address of the HTTP server to use for HTTP proxying. If set, a relay will forward HTTP requests to this address from the subdomain that matches the client's DID.
2137
+ string relay_http_address = 10;
2138
+
2139
+ // Set to receive notification of authentication requests.
2140
+ bool subscribe_auth_requests = 11;
2141
+
2142
+ // Set to indicate the connection will accept method invocation requests.
2143
+ bool accept_invocation = 12;
2144
+
2145
+ // Set to subscribe to DID registry updates from the peer.
2146
+ bool subscribe_did_registry_updates = 13;
2147
+
2148
+ // The interval at which the client will send ping requests to the target.
2149
+ uint32 ping_interval = 14;
2150
+
2151
+ // The current time on the client.
2152
+ uint64 timestamp = 15;
2153
+
2154
+ // Optionally specify the DID registries supported.
2155
+ repeated string did_registry = 16;
2156
+ }
2157
+
2158
+ message ConnectAcknowledge {
2159
+ // A unique identifier for this connection.
2160
+ string connection_id = 1;
2161
+
2162
+ // The current time on the Volt.
2163
+ uint64 timestamp = 2;
2164
+
2165
+ // The interval at which the target will send ping requests to the client.
2166
+ uint32 ping_interval = 3;
2167
+ }
2168
+
2169
+ // A connection ping message - intentionally empty.
2170
+ message ConnectPing {
2171
+ }
2172
+
2173
+ message ConnectGoodbye {
2174
+ // Details of any error that occurred on the call.
2175
+ tdx.volt_api.volt.v1.Status status = 1;
2176
+
2177
+ // Set if the connection was ended gracefully, as opposed to errored.
2178
+ bool ended = 2;
2179
+ }
2180
+
2181
+ message ConnectRelay {
2182
+ // Indicates the Relay connection status.
2183
+ bool connected = 1;
2184
+ }
2185
+
2186
+ enum ConnectResourceEvent {
2187
+ CONNECT_RESOURCE_EVENT_UNKNOWN = 0;
2188
+ CONNECT_RESOURCE_EVENT_CREATE = 1;
2189
+ CONNECT_RESOURCE_EVENT_UPDATE = 2;
2190
+ CONNECT_RESOURCE_EVENT_DELETE = 3;
2191
+ CONNECT_RESOURCE_EVENT_CREATE_CHILD = 4;
2192
+ CONNECT_RESOURCE_EVENT_DELETE_CHILD = 5;
2193
+ CONNECT_RESOURCE_EVENT_DATABASE_WRITE = 6;
2194
+ }
2195
+
2196
+ message ConnectResource {
2197
+ // The type of resource event that has occurred.
2198
+ ConnectResourceEvent event = 1;
2199
+
2200
+ // Details of the resource.
2201
+ Resource resource = 2;
2202
+ }
2203
+
2204
+ message ConnectAuthRequest {
2205
+ Session session = 1;
2206
+
2207
+ string context = 5;
2208
+
2209
+ string challenge = 6;
2210
+
2211
+ uint64 timestamp = 7;
2212
+ }
2213
+
2214
+ message ConnectDIDRegistryUpdate {
2215
+ DIDRegistryUpdate update = 1;
2216
+ }
2217
+
2218
+ message ConnectEvent {
2219
+ oneof event {
2220
+ // An authentication request event.
2221
+ ConnectAuthRequest connect_auth_request = 1;
2222
+
2223
+ // A resource event notification, such as updated or deleted.
2224
+ ConnectResource connect_resource = 2;
2225
+
2226
+ // A DID registry entry update.
2227
+ ConnectDIDRegistryUpdate did_registry_update = 3;
2228
+ }
2229
+ }
2230
+
2231
+ // One of the following payloads will be present in a given ConnectRequest message.
2232
+ message ConnectRequest {
2233
+ oneof payload {
2234
+ // A ConnectHello message is the first message a client sends to the target upon successfully starting the call.
2235
+ ConnectHello hello = 1;
2236
+
2237
+ // Indicates the client is closing the connection.
2238
+ ConnectGoodbye goodbye = 2;
2239
+
2240
+ // Clients should periodically send ping requests to the target to confirm the stream is still live.
2241
+ ConnectPing ping = 4;
2242
+
2243
+ // Send invocation responses back to the caller.
2244
+ // n.b. The 'request' and 'response' semantics are inverted with remote invocations because the Relayed connection is established by a request **from** the 'target' Volt to the Relay. Hence any invocation on behalf of a client of the Relay involves sending a **response** back down the Relay connection to the 'target' Volt.
2245
+ InvokeResponse invoke_response = 5;
2246
+
2247
+ // Send HTTP response back to the originating request.
2248
+ // n.b. The 'request' and 'response' semantics are inverted with HTTP proxying for the same reason as \`invoke_response\` above.
2249
+ HttpResponse http_response = 6;
2250
+ }
2251
+ }
2252
+
2253
+ // One of the following payloads will be present in a given ConnectResponse message.
2254
+ message ConnectResponse {
2255
+ // Details of any error that occurred on the call.
2256
+ tdx.volt_api.volt.v1.Status status = 1;
2257
+
2258
+ oneof payload {
2259
+ // Server response to initial handshake.
2260
+ ConnectAcknowledge acknowledge = 2;
2261
+
2262
+ // Indicates the server is ending the connection.
2263
+ ConnectGoodbye goodbye = 3;
2264
+
2265
+ // Notifies clients of various events on the Volt.
2266
+ ConnectEvent evt = 4;
2267
+
2268
+ // Periodic ping response.
2269
+ ConnectPing ping = 6;
2270
+
2271
+ // Send an invocation request to a remote target.
2272
+ // n.b. The 'request' and 'response' semantics are inverted for remote invocations because the Relayed connection is established by a request **from** the 'target' Volt to the Relay. Hence any invocation on behalf of a client of the Relay involves sending a **response** back down the Relay connection to the 'target' Volt.
2273
+ InvokeRequest invoke_request = 7;
2274
+
2275
+ // Send an HTTP request to a remote target.
2276
+ // n.b. The 'request' and 'response' semantics are inverted for HTTP requests for the same reason as \`invoke_request\` above.
2277
+ HttpRequest http_request = 8;
2278
+ }
2279
+ }
2280
+
2281
+ enum CopyResourceMode {
2282
+ COPY_RESOURCE_MODE_UNKNOWN = 0;
2283
+ COPY_RESOURCE_MODE_COPY = 1;
2284
+ COPY_RESOURCE_MODE_LINK = 2;
2285
+ }
2286
+
2287
+ message CopyResourceRequest {
2288
+ // The id of the resource to copy.
2289
+ string resource_id = 1;
2290
+
2291
+ // The id of the resource to receive the new copy.
2292
+ string to_resource_id = 2;
2293
+
2294
+ // The copy mode to use.
2295
+ CopyResourceMode mode = 3;
2296
+
2297
+ // Indicates if all descendants of the resource should be copied too. Only relevant for COPY_RESOURCE_MODE_COPY mode.
2298
+ bool recursive = 4;
2299
+
2300
+ // The parent resource to link from, only relevant for COPY_RESOURCE_MODE_LINK mode.
2301
+ string from_resource_id = 5;
2302
+ }
2303
+
2304
+ message CopyResourceResponse {
2305
+ // Details of any error that occurred on the call.
2306
+ tdx.volt_api.volt.v1.Status status = 1;
2307
+ }
2308
+
2309
+ message DeleteAccessRequest {
2310
+ // The id of the access rule to delete.
2311
+ string id = 1;
2312
+ }
2313
+
2314
+ message DeleteAccessResponse {
2315
+ // Details of any error that occurred on the call.
2316
+ tdx.volt_api.volt.v1.Status status = 1;
2317
+ }
2318
+
2319
+ message DeleteResourceRequest {
2320
+ // The resource to delete.
2321
+ string resource_id = 1;
2322
+
2323
+ // Set to indicate all descendant resources should also be deleted.
2324
+ // If this is not set and the resource has descendants, the call will fail.
2325
+ bool recursive = 2;
2326
+
2327
+ // Set to attempt to unlink the resource from this parent resource, rather than completely delete it.
2328
+ // The resource will be removed as a descendant from the \`parent_id\` resource. If the resource is has more than one parent, it will not be removed from those other parents.
2329
+ // Note that if the resource's only parent is \`parent_id\` it will be removed from that parent and deleted as normal.
2330
+ string parent_id = 3;
2331
+ }
2332
+
2333
+ message DeleteResourceResponse {
2334
+ // Details of any error that occurred on the call.
2335
+ tdx.volt_api.volt.v1.Status status = 1;
2336
+ }
2337
+
2338
+ message DiscoverServicesRequest {
2339
+ // List the service APIs that should be discovered.
2340
+ // The response will include services that match **any of** the terms given.
2341
+ // Use of '*' to indicate wildcards is supported.
2342
+ repeated string service_api = 1;
2343
+
2344
+ // Set to indicate that offline services should be included in the response.
2345
+ bool include_offline = 2;
2346
+
2347
+ // Set to include the service attributes in the response.
2348
+ bool include_attributes = 3;
2349
+
2350
+ // Set to include the service protobuf in the response.
2351
+ bool include_protobuf = 4;
2352
+ }
2353
+
2354
+ message DiscoverServicesResponse {
2355
+ // Details of any error that occurred on the call.
2356
+ tdx.volt_api.volt.v1.Status status = 1;
2357
+
2358
+ // The services that were discovered.
2359
+ repeated Resource resource = 2;
2360
+ }
2361
+
2362
+ message GetAccessRequest {
2363
+ // The resource id that is the target of the access rule. If omitted, all resources will be considered.
2364
+ string resource_id = 1;
2365
+
2366
+ // The identity id that is the subject of the access rule. If omitted, all identities will be considered.
2367
+ string identity_did = 2;
2368
+
2369
+ // The type of access to retrieve, if omitted all access will be considered.
2370
+ string access = 4;
2371
+
2372
+ // The type of decision, if omitted all decisions will be considered.
2373
+ PolicyDecision decision = 5;
2374
+ }
2375
+
2376
+ message GetAccessResponse {
2377
+ // Details of any error that occurred on the call.
2378
+ tdx.volt_api.volt.v1.Status status = 1;
2379
+
2380
+ // The access rules that match the criteria.
2381
+ repeated Access access = 2;
2382
+ }
2383
+
2384
+ message GetIdentitiesRequest {
2385
+ // Optional name of the identity.
2386
+ // Use '*' to perform a wildcard search.
2387
+ // If omitted all identities will be retrieved.
2388
+ string name = 1;
2389
+
2390
+ // The identity alias criteria, if omitted all identities will be considered.
2391
+ IdentityAlias alias = 2;
2392
+ }
2393
+
2394
+ message GetIdentitiesResponse {
2395
+ // Details of any error that occurred on the call.
2396
+ tdx.volt_api.volt.v1.Status status = 1;
2397
+
2398
+ // The identity list that matched the criteria.
2399
+ repeated Identity identity = 2;
2400
+ }
2401
+
2402
+ // One of \`identity_did\` or \`fingerprint\` must be populated.
2403
+ message GetIdentityRequest {
2404
+ oneof lookup {
2405
+ // The id of the identity to retrieve.
2406
+ string identity_did = 1;
2407
+ // The public key fingerprint of the identity to retrieve.
2408
+ string fingerprint = 2;
2409
+ }
2410
+ }
2411
+
2412
+ message GetIdentityResponse {
2413
+ // Details of any error that occurred on the call.
2414
+ tdx.volt_api.volt.v1.Status status = 1;
2415
+
2416
+ // The identity details.
2417
+ Identity identity = 2;
2418
+ }
2419
+
2420
+ message GetOneTimeTokenRequest {
2421
+ // Optional token TTL, in seconds. Default is 10 seconds.
2422
+ int32 ttl = 1;
2423
+ }
2424
+
2425
+ message GetOneTimeTokenResponse {
2426
+ // Details of any error that occurred on the call.
2427
+ tdx.volt_api.volt.v1.Status status = 1;
2428
+
2429
+ // The one-time token.
2430
+ string token = 2;
2431
+ }
2432
+
2433
+ // This an empty message.
2434
+ message GetParametersRequest {
2435
+ }
2436
+
2437
+ message GetParametersResponse {
2438
+ // Details of any error that occurred on the call.
2439
+ tdx.volt_api.volt.v1.Status status = 1;
2440
+
2441
+ // The retrieved Volt parameters.
2442
+ VoltParameters parameters = 2;
2443
+ }
2444
+
2445
+ // This an empty message.
2446
+ message GetPolicyRequest {
2447
+ // Set to only retrieve the custom policy document.
2448
+ bool custom_policy = 1;
2449
+ }
2450
+
2451
+ message GetPolicyResponse {
2452
+ // Details of any error that occurred on the call.
2453
+ tdx.volt_api.volt.v1.Status status = 1;
2454
+
2455
+ // The live policy in JSON format.
2456
+ string policy = 2;
2457
+ }
2458
+
2459
+ message GetResourceRequest {
2460
+ // The id of the resource to retrieve.
2461
+ string resource_id = 1;
2462
+
2463
+ // Set to include the resource attributes in the response.
2464
+ bool include_attributes = 2;
2465
+
2466
+ // Set to include service description protobuf in the response, if applicable.
2467
+ bool include_protobuf = 3;
2468
+ }
2469
+
2470
+ message GetResourceResponse {
2471
+ // Details of any error that occurred on the call.
2472
+ tdx.volt_api.volt.v1.Status status = 1;
2473
+
2474
+ // The retrieved resource metadata.
2475
+ Resource resource = 2;
2476
+ }
2477
+
2478
+ // By default, the lookup is performed by combining the criteria below in the form:
2479
+ // (id = id[0] or id = id[1]) and (name = name[0] or name = name[1]) etc...
2480
+ // To combine using 'or' rather than 'and', set the \`combine_terms_exclusive\` flag.
2481
+ // Also see note below regarding attributes.
2482
+ message GetResourcesRequest {
2483
+ repeated string id = 1;
2484
+
2485
+ // Wildcards permitted.
2486
+ repeated string name = 2;
2487
+
2488
+ // Wildcards permitted.
2489
+ repeated string description = 3;
2490
+
2491
+ // Wildcards permitted.
2492
+ repeated string kind = 4;
2493
+
2494
+ repeated string parent_id = 5;
2495
+
2496
+ // Wildcards permitted.
2497
+ repeated string service_api = 6;
2498
+
2499
+ repeated string owner = 7;
2500
+
2501
+ repeated string store = 8;
2502
+
2503
+ // Indicates that the above terms should be combined using 'or' rather than 'and' (the default).
2504
+ bool combine_terms_exclusive = 9;
2505
+
2506
+ // Attributes to search by.
2507
+ repeated ResourceAttributeQuery attribute = 10;
2508
+
2509
+ // If set, will return resources where *any of* the attribute queries apply, otherwise will only return resources where *all of* the attribute queries apply.
2510
+ bool any_of = 11;
2511
+
2512
+ // Set to include the resource attributes in the response.
2513
+ bool include_attributes = 12;
2514
+
2515
+ // Set to include service description protobuf in the response where applicable.
2516
+ bool include_protobuf = 13;
2517
+
2518
+ // Only retrieve resources that have been modified after the given timestamp. Default is 0, which means all resources will be returned.
2519
+ uint64 modified_since = 14;
2520
+
2521
+ // Limit the number of resources returned. Default is 0, which means all resources will be returned.
2522
+ uint32 limit = 15;
2523
+ }
2524
+
2525
+ message GetResourcesResponse {
2526
+ // Details of any error that occurred on the call.
2527
+ tdx.volt_api.volt.v1.Status status = 1;
2528
+
2529
+ // The list of resources that match the lookup.
2530
+ repeated Resource resource = 2;
2531
+ }
2532
+
2533
+ message GetResourceAncestorsRequest {
2534
+ // The resource id whose ancestors will be retrieved.
2535
+ string resource_id = 1;
2536
+
2537
+ // Optional - if set the resource_id resource will be included in the set of resources returned.
2538
+ bool include_resource_id = 2;
2539
+
2540
+ // Optional - restrict the depth search, e.g. for immediate parents depth = 1
2541
+ int32 depth = 3;
2542
+
2543
+ // Optional - only match ancestors of the given kind.
2544
+ string ancestor_kind = 4;
2545
+
2546
+ // Optional - can be used to determine if a resource is an ancestor.
2547
+ string ancestor_id = 5;
2548
+
2549
+ // Set to include the service attributes in the response.
2550
+ bool include_attributes = 6;
2551
+
2552
+ // Set to include the service protobuf in the response.
2553
+ bool include_protobuf = 7;
2554
+ }
2555
+
2556
+ message GetResourceAncestorsResponse {
2557
+ // Details of any error that occurred on the call.
2558
+ tdx.volt_api.volt.v1.Status status = 1;
2559
+
2560
+ // The retrieved ancestors.
2561
+ repeated Resource ancestor = 2;
2562
+ }
2563
+
2564
+ message GetResourceDescendantsRequest {
2565
+ // The resource id whose descendants will be retrieved.
2566
+ string resource_id = 1;
2567
+
2568
+ // Optional - if set, the fully populated \`resource_id\` resource (i.e. the parent) will be included in the set of resources returned.
2569
+ bool include_resource_id = 2;
2570
+
2571
+ // Optional - restrict the depth search, e.g. for immediate children depth = 1
2572
+ int32 depth = 3;
2573
+
2574
+ // Optional - only match descendants of the given kind.
2575
+ // If multiple kinds are given, resources matching **any of** the kinds will be included.
2576
+ repeated string descendant_kind = 4;
2577
+
2578
+ // Optional - can be used to determine if a resource is a descendant.
2579
+ string descendant_id = 5;
2580
+
2581
+ // Optional - restrict to descendants of a given parent, for use in multi-parent hierarchies.
2582
+ string parent_id = 6;
2583
+
2584
+ // Restrict to a specific named resource.
2585
+ string name = 7;
2586
+
2587
+ // Only retrieve resources that have been modified after the given timestamp. Default is 0, which means all resources will be returned.
2588
+ uint64 modified_since = 8;
2589
+
2590
+ // Set to include the service attributes in the response.
2591
+ bool include_attributes = 9;
2592
+
2593
+ // Set to include the service protobuf in the response.
2594
+ bool include_protobuf = 10;
2595
+ }
2596
+
2597
+ message GetResourceDescendantsResponse {
2598
+ // Details of any error that occurred on the call.
2599
+ tdx.volt_api.volt.v1.Status status = 1;
2600
+
2601
+ // The retrieved descendants.
2602
+ repeated Resource descendant = 2;
2603
+ }
2604
+
2605
+ message GetSessionsRequest {
2606
+ string id = 1;
2607
+
2608
+ string identity_did = 2;
2609
+
2610
+ string identity_name = 3;
2611
+
2612
+ SessionStatus status = 4;
2613
+ }
2614
+
2615
+ message GetSessionsResponse {
2616
+ // Details of any error that occurred on the call.
2617
+ tdx.volt_api.volt.v1.Status status = 1;
2618
+
2619
+ repeated Session session = 2;
2620
+ }
2621
+
2622
+ message InvokeRequestKeyExchange {
2623
+ bytes nonce = 1;
2624
+
2625
+ bytes encryption_key = 2;
2626
+
2627
+ bytes signature = 3;
2628
+ }
2629
+
2630
+ message InvokeRequest {
2631
+ // Client-assigned identifier for the request. Will be used to match responses and any subsequent requests.
2632
+ uint64 invoke_id = 1;
2633
+
2634
+ // Optional client token to use for the invocation. This is for use by the websocket proxy and is only necessary on the first request of the rpc.
2635
+ string token = 2;
2636
+
2637
+ // The DID of the target at each hop of the path to the service.
2638
+ // This is used by Relays to route the request.
2639
+ repeated string target_did = 4;
2640
+
2641
+ // The initialisation vector for the request payload encryption. This should be a random 16 byte value, that is different for each request.
2642
+ bytes iv = 5;
2643
+
2644
+ // One of the following payloads will be present in a given InvokeRequest message.
2645
+ oneof request_payload {
2646
+ // A serialised and encrypted instance of \`RemoteResponse\` in pure binary format.
2647
+ bytes payload = 6;
2648
+
2649
+ // A serialised and encrypted instance of \`RemoteResponse\` as serialised JSON.
2650
+ bytes json_payload = 7;
2651
+ }
2652
+
2653
+ // Indicates the client has ended the invocation.
2654
+ bool client_end = 8;
2655
+
2656
+ // Reserved for internal use.
2657
+ uint32 hop_index = 9;
2658
+
2659
+ // Reserved for internal use.
2660
+ string target_service_id = 10;
2661
+ }
2662
+
2663
+ message InvokeResponse {
2664
+ // The invocation id to match the originating request.
2665
+ uint64 invoke_id = 1;
2666
+
2667
+ InvokeRequestKeyExchange key_exchange = 2;
2668
+
2669
+ // The initialisation vector for the response payload encryption. This will be a random 16 byte value, that is different for each response.
2670
+ bytes iv = 4;
2671
+
2672
+ // One of the following payloads will be present in a given InvokeResponse message.
2673
+ oneof response_payload {
2674
+ // A serialised and encrypted instance of \`RemoteRequest\` in pure binary format.
2675
+ bytes payload = 5;
2676
+
2677
+ // A serialised and encrypted instance of \`RemoteRequest\` as serialised JSON.
2678
+ bytes json_payload = 6;
2679
+
2680
+ // Details of any error that occurred on the call.
2681
+ tdx.volt_api.volt.v1.Status status = 7;
2682
+ }
2683
+
2684
+ // Indicates the server has ended the invocation.
2685
+ bool server_end = 8;
2686
+ }
2687
+
2688
+ message MoveResourceRequest {
2689
+ // The id of the resource to move.
2690
+ string resource_id = 1;
2691
+
2692
+ // The resource the parent folder to move the resource from.
2693
+ string from_resource_id = 2;
2694
+
2695
+ // The target folder to move the resource into.
2696
+ string to_resource_id = 3;
2697
+ }
2698
+
2699
+ message MoveResourceResponse {
2700
+ // Details of any error that occurred on the call.
2701
+ tdx.volt_api.volt.v1.Status status = 1;
2702
+ }
2703
+
2704
+ message RequestAccessRequest {
2705
+ // The target resource id.
2706
+ string resource_id = 1;
2707
+
2708
+ // The type of access requested.
2709
+ string access = 3;
2710
+ }
2711
+
2712
+ message RequestAccessResponse {
2713
+ // Details of any error that occurred on the call.
2714
+ tdx.volt_api.volt.v1.Status status = 1;
2715
+
2716
+ // The resource being accessed.
2717
+ string resource_id = 2;
2718
+
2719
+ // The identity attempting access.
2720
+ string identity_did = 3;
2721
+
2722
+ // Requested access.
2723
+ string access = 5;
2724
+
2725
+ // Assigned decision.
2726
+ PolicyDecision decision = 6;
2727
+
2728
+ // Time at which the request was made.
2729
+ int64 request_time = 7;
2730
+
2731
+ // Time at which the decision was taken.
2732
+ int64 decision_time = 8;
2733
+
2734
+ // Counter of number times this access was requested.
2735
+ int32 request_count = 9;
2736
+ }
2737
+
2738
+ message ResourceAttributeQuery {
2739
+ string attribute_id = 1;
2740
+ AttributeDataType data_type = 2;
2741
+ AttributeValue value = 3;
2742
+ }
2743
+
2744
+ message SaveAccessRequest {
2745
+ // Omit \`id\` if creating new access.
2746
+ Access access = 1;
2747
+ }
2748
+
2749
+ message SaveAccessResponse {
2750
+ // Details of any error that occurred on the call.
2751
+ tdx.volt_api.volt.v1.Status status = 1;
2752
+ }
2753
+
2754
+ message SaveIdentityRequest {
2755
+ // Details of the identity to save.
2756
+ Identity identity = 1;
2757
+
2758
+ // Set to indicate this is a new identity.
2759
+ bool create = 2;
2760
+
2761
+ // The list of aliases that should be removed.
2762
+ // For example, this allows a simple form of key rotation whereby an existing public key alias is replaced by a new one while still maintaining the same root identity id.
2763
+ repeated IdentityAlias delete_alias = 3;
2764
+
2765
+ // Reserved for system use.
2766
+ string create_in_parent_id = 4;
2767
+
2768
+ // Set to indicate the identity aliases should be purged before saving the identity.
2769
+ // If the \`identity\` field contains aliases they will be saved after the purge.
2770
+ // If the \`identity\` field does not contain aliases this effectively deletes all aliases for this identity.
2771
+ // This allows you to selectively update aliases if required, i.e. don't set this flag and include a single alias in the update.
2772
+ bool purge_aliases = 5;
2773
+
2774
+ string did_document = 6;
2775
+
2776
+ // The signature of the identity did document, if present.
2777
+ string did_update_signature = 7;
2778
+ }
2779
+
2780
+ message SaveIdentityResponse {
2781
+ // Details of any error that occurred on the call.
2782
+ tdx.volt_api.volt.v1.Status status = 1;
2783
+
2784
+ // The updated identity details.
2785
+ Identity identity = 2;
2786
+ }
2787
+
2788
+ message SaveParametersRequest {
2789
+ // The updated parameters.
2790
+ VoltParameters parameters = 1;
2791
+
2792
+ // The current root key passphrase. Only necessary if changes are being made to the Volt key.
2793
+ string key_passphrase = 2;
2794
+
2795
+ // The new root key passphrase. Only necessary if changes are being made to the Volt key.
2796
+ string new_key_passphrase = 3;
2797
+ }
2798
+
2799
+ message SaveParametersResponse {
2800
+ // Details of any errors that occurred on the call.
2801
+ tdx.volt_api.volt.v1.Status status = 1;
2802
+
2803
+ // The updated Volt parameters.
2804
+ VoltParameters parameters = 2;
2805
+
2806
+ // If set, the client will need to reconnect (usually because the key has changed).
2807
+ bool reconnect = 3;
2808
+ }
2809
+
2810
+ message SaveResourceRequest {
2811
+ // Details of the resource to save.
2812
+ Resource resource = 1;
2813
+
2814
+ // Set to indicate this is a new resource.
2815
+ bool create = 2;
2816
+
2817
+ // The id of the folder resource in which a new resource should be created.
2818
+ // If omitted, the home folder of the currently authenticated identity will be used.
2819
+ string create_in_parent_id = 3;
2820
+
2821
+ // Set to indicate the resource attributes should be purged before saving the resource.
2822
+ // If the \`resource\` field contains attributes they will be saved after the purge.
2823
+ // If the \`resource\` field does not contain attributes this effectively deletes all attributes for this resource.
2824
+ // This allows you to selectively update attributes if required, i.e. don't set this flag and include a single attribute in the update.
2825
+ bool purge_attributes = 4;
2826
+ }
2827
+
2828
+ message SaveResourceResponse {
2829
+ // Details of any error that occurred on the call.
2830
+ tdx.volt_api.volt.v1.Status status = 1;
2831
+
2832
+ // The updated resource.
2833
+ Resource resource = 2;
2834
+ }
2835
+
2836
+ message SaveSessionRequest {
2837
+ Session session = 1;
2838
+ }
2839
+
2840
+ message SaveSessionResponse {
2841
+ // Details of any error that occurred on the call.
2842
+ tdx.volt_api.volt.v1.Status status = 1;
2843
+
2844
+ Session session = 2;
2845
+ }
2846
+
2847
+ message SetPolicyRequest {
2848
+ string custom_policy = 1;
2849
+ }
2850
+
2851
+ message SetPolicyResponse {
2852
+ // Details of any error that occurred on the call.
2853
+ tdx.volt_api.volt.v1.Status status = 1;
2854
+ }
2855
+
2856
+ message SetServiceStatusRequest {
2857
+ // The service description details.
2858
+ Resource service = 2;
2859
+ }
2860
+
2861
+ message SetServiceStatusResponse {
2862
+ // Details of any error that occurred on the call.
2863
+ tdx.volt_api.volt.v1.Status status = 1;
2864
+
2865
+ // The updated service resource details.
2866
+ Resource resource = 2;
2867
+ }
2868
+
2869
+ message SetAccessRequestDecisionRequest {
2870
+ // The id of the access request.
2871
+ string id = 1;
2872
+
2873
+ // The decision to save against the access request.
2874
+ PolicyDecision decision = 2;
2875
+ }
2876
+
2877
+ message SetAccessRequestDecisionResponse {
2878
+ // Details of any error that occurred on the call.
2879
+ tdx.volt_api.volt.v1.Status status = 1;
2880
+ }
2881
+
2882
+ // This message is emtpy.
2883
+ message ShutdownRequest {
2884
+ }
2885
+
2886
+ message ShutdownResponse {
2887
+ // Details of any error that occurred on the call.
2888
+ tdx.volt_api.volt.v1.Status status = 1;
2889
+ }
2890
+
2891
+ message SignVerifyRequest {
2892
+ // Set to indicate this is a request to verify rather than sign.
2893
+ bool verify = 1;
2894
+
2895
+ // Set to indicate the signature should be base64 encoded in the response.
2896
+ // Only valid when signing.
2897
+ bool encode = 2;
2898
+
2899
+ // The message to sign.
2900
+ // Only valid when signing.
2901
+ string message = 3;
2902
+
2903
+ oneof digest {
2904
+ // The digest in raw binary form.
2905
+ // Only valid if verifying.
2906
+ bytes digest_raw = 4;
2907
+
2908
+ // The digest encoded using base64.
2909
+ // Only valid if verifying.
2910
+ string digest_encoded = 5;
2911
+ }
2912
+ }
2913
+
2914
+ // Note that if verification was successful the response will be empty (there is no error and no digest is returned).
2915
+ message SignVerifyResponse {
2916
+ // Details of any error that occurred on the call.
2917
+ tdx.volt_api.volt.v1.Status status = 1;
2918
+
2919
+ oneof payload {
2920
+ // The signature in raw binary form.
2921
+ bytes digest = 2;
2922
+
2923
+ // The signature encoded using base64.
2924
+ string digest_encoded = 3;
2925
+ }
2926
+ }
2927
+ `;
2928
+ export const wire_api = `syntax = "proto3";
2929
+
2930
+ package tdx.volt_api.volt.v1;
2931
+
2932
+ import "tdx/volt_api/volt/v1/status.proto";
2933
+
2934
+ // The Wire API allows clients to subscribe and publish to Volt wire resources.
2935
+ service WireAPI {
2936
+ // Establishes a client-streaming call to the wire resource.
2937
+ rpc PublishWire(stream PublishWireRequest) returns (stream PublishWireResponse);
2938
+
2939
+ // Establishes a bi-directional streaming call to the wire resource.
2940
+ // Although we're only really interested in receiving data from the wire, a bi-directional stream is required so that we can gracefully stop the subscription.
2941
+ rpc SubscribeWire(stream SubscribeWireRequest) returns (stream SubscribeWireResponse);
2942
+ }
2943
+
2944
+ // Because the publish RPC is streaming, the policy will not be checked until the first message arrives. This can mean that the \`PublishWire\` call appears to succeed but then fails after the first attempt to publish a message.
2945
+ // To avoid this, clients can immediately send a message with the \`wire_id\` set and no \`chunk\` set. This will establish that the correct permissions are in place and fail fast if not.
2946
+ message PublishWireRequest {
2947
+ // Only necessary in the first payload.
2948
+ string wire_id = 1;
2949
+
2950
+ // The chunk of data to publish.
2951
+ bytes chunk = 2;
2952
+
2953
+ // Whether to persist the chunk.
2954
+ // This is only valid if the wire is configured to persist messages, i.e. the \`volt:wire-persist\` attribute is true.
2955
+ bool do_not_persist = 3;
2956
+ }
2957
+
2958
+ message PublishWireResponse {
2959
+ // Details of any error that occurred on the call.
2960
+ tdx.volt_api.volt.v1.Status status = 1;
2961
+ }
2962
+
2963
+ // The request must include one of the following fields.
2964
+ message SubscribeWireRequest {
2965
+ oneof payload {
2966
+ // The wire id, only required for the first message.
2967
+ string wire_id = 1;
2968
+ // Request to stop the subscription.
2969
+ bool stop = 2;
2970
+ }
2971
+ }
2972
+
2973
+ // One of the following fields will be present in the response.
2974
+ message SubscribeWireResponse {
2975
+ oneof payload {
2976
+ // Details of any error that occured on the call.
2977
+ tdx.volt_api.volt.v1.Status status = 1;
2978
+
2979
+ // Data received from the wire.
2980
+ bytes chunk = 2;
2981
+ }
2982
+ }
2983
+
2984
+ `;
2985
+ export const voltProtos = [sqlite, sqlite_database_api, sqlite_server_api, proxy_api, relay_api, sync, discovery_api, file, file_api, remote, spark_api, ssi, ssi_api, status, terminal_api, volt, volt_api, wire_api];