@tdxvolt/volt-client-grpc 0.1.1 → 0.11.0
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.
- package/lib/index.cjs +1927 -1694
- package/package.json +2 -2
- package/protobuf/tdx/volt_api/data/v1/sqlite.proto +13 -13
- package/protobuf/tdx/volt_api/data/v1/sqlite_database_api.proto +8 -0
- package/protobuf/tdx/volt_api/data/v1/sqlite_server_api.proto +5 -0
- package/protobuf/tdx/volt_api/{tunnel → relay}/v1/proxy_api.proto +2 -2
- package/protobuf/tdx/volt_api/{tunnel/v1/tunnel_api.proto → relay/v1/relay_api.proto} +6 -5
- package/protobuf/tdx/volt_api/sync/v1/sync.proto +49 -6
- package/protobuf/tdx/volt_api/volt/v1/discovery_api.proto +3 -3
- package/protobuf/tdx/volt_api/volt/v1/file_api.proto +47 -1
- package/protobuf/tdx/volt_api/volt/v1/spark_api.proto +121 -0
- package/protobuf/tdx/volt_api/volt/v1/volt.proto +33 -25
- package/protobuf/tdx/volt_api/volt/v1/volt_api.proto +78 -45
- package/protobuf/tdx/volt_api/volt/v1/wire_api.proto +8 -6
- package/src/constants.js +72 -72
- package/src/grpc-call.js +269 -242
- package/src/grpc-utils.js +212 -176
- package/src/index.js +1 -1
- package/src/proto-utils.js +68 -51
- package/src/utils.js +66 -66
- package/src/volt-client-internal.js +323 -253
- package/src/volt-client.js +545 -489
- package/src/volt-connection.js +144 -135
- package/src/volt-credential.js +237 -0
- package/src/tunnel.pb.js +0 -0
- package/src/volt-crypto.js +0 -213
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.11.0",
|
|
7
7
|
"description": "tdx Volt library for nodejs clients",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": {
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"node-forge": "^0.9.0",
|
|
48
48
|
"uuid": "^8.1.0"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|
|
@@ -3,19 +3,19 @@ syntax = "proto3";
|
|
|
3
3
|
package tdx.volt_api.data.v1;
|
|
4
4
|
|
|
5
5
|
// Just reflect SQLite types for now.
|
|
6
|
-
enum
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
enum DataType {
|
|
7
|
+
DATA_TYPE_UNKNOWN = 0;
|
|
8
|
+
DATA_TYPE_TEXT = 1;
|
|
9
|
+
DATA_TYPE_INTEGER = 2;
|
|
10
|
+
DATA_TYPE_REAL = 3;
|
|
11
|
+
DATA_TYPE_BLOB = 4;
|
|
12
|
+
DATA_TYPE_NULL = 5;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
message Column {
|
|
16
16
|
string name = 1;
|
|
17
17
|
string description = 2;
|
|
18
|
-
|
|
18
|
+
DataType type = 3;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
message Schema {
|
|
@@ -25,12 +25,12 @@ message Schema {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
message Variant {
|
|
28
|
-
ColumnType type = 1;
|
|
29
28
|
oneof data {
|
|
30
|
-
string text =
|
|
31
|
-
int64 integer =
|
|
32
|
-
double real =
|
|
33
|
-
bytes blob =
|
|
29
|
+
string text = 1;
|
|
30
|
+
int64 integer = 2;
|
|
31
|
+
double real = 3;
|
|
32
|
+
bytes blob = 4;
|
|
33
|
+
bool null = 5;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -4,6 +4,7 @@ package tdx.volt_api.data.v1;
|
|
|
4
4
|
|
|
5
5
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
6
|
import "tdx/volt_api/data/v1/sqlite.proto";
|
|
7
|
+
import "tdx/volt_api/volt/v1/volt.proto";
|
|
7
8
|
|
|
8
9
|
// The Sqlite Database API exposes functions that enable clients to manipulate data in a given Volt database.
|
|
9
10
|
// Use the Sqlite Server API to create the database resource.
|
|
@@ -45,8 +46,15 @@ message SqlExecuteRequest {
|
|
|
45
46
|
|
|
46
47
|
// 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.
|
|
47
48
|
uint32 page_size = 3;
|
|
49
|
+
|
|
50
|
+
// The list of values to set for each parameter defined in a database query.
|
|
51
|
+
// This field is only relevant to 'query' databases, i.e. those with kind `tdx:sqlite-query`.
|
|
52
|
+
// The values in the list should be in the same order as the parameters defined by the query attributes.
|
|
53
|
+
// A query may have no parameters defined, in which case leave this field empty.
|
|
54
|
+
repeated tdx.volt_api.volt.v1.AttributeValue parameter = 4;
|
|
48
55
|
}
|
|
49
56
|
|
|
57
|
+
// One of the following fields will be present in any given message.
|
|
50
58
|
message SqlExecuteResponse {
|
|
51
59
|
oneof payload {
|
|
52
60
|
// A status will be sent on error.
|
|
@@ -30,6 +30,11 @@ message CreateDatabaseRequest {
|
|
|
30
30
|
|
|
31
31
|
// The discovery mode of the underlying Volt resource.
|
|
32
32
|
tdx.volt_api.volt.v1.DiscoveryMode discoverable = 6;
|
|
33
|
+
|
|
34
|
+
// Alias(es) that can be used to refer to the database rather than the id.
|
|
35
|
+
// Each alias must be unique to the Volt, this is enforced by the API.
|
|
36
|
+
// 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 '-'.
|
|
37
|
+
repeated string alias = 7;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
message CreateDatabaseResponse {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
|
-
package tdx.volt_api.
|
|
3
|
+
package tdx.volt_api.relay.v1;
|
|
4
4
|
|
|
5
5
|
// Placeholder API for the proxy.
|
|
6
6
|
// Methods are injected into this service at runtime
|
|
7
|
-
// when a remote volt connects via the
|
|
7
|
+
// when a remote volt connects via the RelayAPI.
|
|
8
8
|
service ProxyAPI {
|
|
9
9
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
|
-
package tdx.volt_api.
|
|
3
|
+
package tdx.volt_api.relay.v1;
|
|
4
4
|
|
|
5
5
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
6
|
import "tdx/volt_api/volt/v1/remote.proto";
|
|
7
7
|
import "tdx/volt_api/volt/v1/volt.proto";
|
|
8
8
|
|
|
9
|
-
service
|
|
10
|
-
// Retrieve the list of Volts available on the
|
|
9
|
+
service RelayAPI {
|
|
10
|
+
// Retrieve the list of Volts available on the Relay Volt or cloud-based tunnel.
|
|
11
11
|
rpc GetVoltEndpoint(GetVoltEndpointRequest) returns (GetVoltEndpointResponse);
|
|
12
12
|
|
|
13
13
|
// This is the actual tunnel stream.
|
|
14
|
+
// 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.
|
|
14
15
|
rpc Tunnel(stream tdx.volt_api.volt.v1.RemoteRequest) returns (stream tdx.volt_api.volt.v1.RemoteResponse);
|
|
15
16
|
|
|
16
17
|
// This is the tunnel stream for cloud-based tunnels.
|
|
@@ -30,12 +31,12 @@ message GetVoltEndpointRequest {
|
|
|
30
31
|
|
|
31
32
|
message GetVoltEndpointResponse {
|
|
32
33
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
33
|
-
repeated tdx.volt_api.volt.v1.VoltEndpoint
|
|
34
|
+
repeated tdx.volt_api.volt.v1.VoltEndpoint endpoint = 2;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
message TunnelStart {
|
|
37
38
|
uint32 preferred_port = 1;
|
|
38
|
-
string
|
|
39
|
+
string address = 2;
|
|
39
40
|
string public_key = 3;
|
|
40
41
|
string fingerprint = 4;
|
|
41
42
|
string ca_pem = 5;
|
|
@@ -2,13 +2,56 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package tdx.volt_api.sync.v1;
|
|
4
4
|
|
|
5
|
+
// Wraps arbitrary protobuf messages, with an index into the `ProtobufSyncConfigurationHeader` to indicate the specific message type this message wraps.
|
|
6
|
+
message ProtobufSyncWrapper {
|
|
7
|
+
oneof header_lookup {
|
|
8
|
+
// The index number of the header for this message type in the Volt logger configuration file.
|
|
9
|
+
uint32 header_index = 1;
|
|
10
|
+
|
|
11
|
+
// The name of the header for this message type, will be used to lookup against the `id` field in `ProtobufSyncConfiguration`.
|
|
12
|
+
// 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.
|
|
13
|
+
string header_id = 2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// The message payload, in serialised protobuf binary format.
|
|
17
|
+
// n.b. the serialisation should **not** be length-prefixed.
|
|
18
|
+
bytes payload = 3;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Describes a single message type.
|
|
22
|
+
// A set of one or more of these messages is specified in `ProtobufSyncConfigurationHeader`.
|
|
5
23
|
message ProtobufSyncConfiguration {
|
|
24
|
+
// Optional id to associate with this configuration.
|
|
25
|
+
// This can be used in the `header_id` field of `ProtobufSyncWrapper` above to reference the configuration.
|
|
26
|
+
// If omitted the numerical index of the configuration in `ProtobufSyncConfigurationHeader` will be used instead.
|
|
27
|
+
string id = 1;
|
|
28
|
+
|
|
6
29
|
// The actual protobuf definition text.
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
string
|
|
10
|
-
|
|
11
|
-
|
|
30
|
+
// Copy and paste the source protobuf definition from the `.proto` file.
|
|
31
|
+
// Only simple protobuf structures are currently supported, e.g. no imports from other packages etc.
|
|
32
|
+
string message_proto = 2;
|
|
33
|
+
|
|
34
|
+
// The name of the message within `message_proto` above that represents the data to be sync'd, e.g. `TCPDumpPacket`.
|
|
35
|
+
string message_name = 3;
|
|
36
|
+
|
|
37
|
+
// The name of the table within the target database into which the message data for this type should be written.
|
|
38
|
+
string table_name = 4;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// This message is written at the beginning of every file to be ingested using the `protoDbSync` utility.
|
|
42
|
+
// It contains a `header` entry for each message type that may appear in the file.
|
|
43
|
+
// If the `volt logger` command is used, it will create this header automatically based on the configuration it's given.
|
|
44
|
+
message ProtobufSyncConfigurationHeader {
|
|
45
|
+
// 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.
|
|
46
|
+
// 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.
|
|
47
|
+
// 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.
|
|
48
|
+
string id = 1;
|
|
49
|
+
|
|
50
|
+
// The set of possible configurations that can appear in any given protobuf sync data file.
|
|
51
|
+
// A serialised instance of this message must appear at the top of each data file.
|
|
52
|
+
// 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.
|
|
53
|
+
repeated ProtobufSyncConfiguration configuration = 2;
|
|
54
|
+
|
|
12
55
|
// Optional maximum size of the serialised messages, this doesn't need to be exact and the default is 64K if omitted.
|
|
13
|
-
int32 maximum_message_size =
|
|
56
|
+
int32 maximum_message_size = 3;
|
|
14
57
|
}
|
|
@@ -14,8 +14,8 @@ service DiscoveryAPI {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
message DiscoverRequest {
|
|
17
|
-
// Set to require that only Volts that expose a
|
|
18
|
-
bool
|
|
17
|
+
// Set to require that only Volts that expose a Relay be included in the response.
|
|
18
|
+
bool require_relay = 1;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
message SignedEndpoint {
|
|
@@ -35,5 +35,5 @@ message DiscoverResponse {
|
|
|
35
35
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
36
36
|
|
|
37
37
|
// A list of endpoints that match the request criteria.
|
|
38
|
-
repeated SignedEndpoint
|
|
38
|
+
repeated SignedEndpoint endpoint = 2;
|
|
39
39
|
}
|
|
@@ -14,9 +14,17 @@ service FileAPI {
|
|
|
14
14
|
// Get file resource metadata.
|
|
15
15
|
rpc GetFile(GetFileRequest) returns (GetFileResponse);
|
|
16
16
|
|
|
17
|
+
// Get the content of a file.
|
|
18
|
+
// Note this rpc will fail if the size of the file content is greater than 64MB, in which case use DownloadFile instead.
|
|
19
|
+
rpc GetFileContent(GetFileContentRequest) returns (GetFileContentResponse);
|
|
20
|
+
|
|
17
21
|
// Get the file resource metadata of all descendants of a given file resource.
|
|
18
22
|
rpc GetFileDescendants(GetFileDescendantsRequest) returns (GetFileDescendantsResponse);
|
|
19
23
|
|
|
24
|
+
// Set the content of a file.
|
|
25
|
+
// Note this rpc will fail if the size of the file content is greater than 64MB, in which case use UploadFile instead.
|
|
26
|
+
rpc SetFileContent(SetFileContentRequest) returns (SetFileContentResponse);
|
|
27
|
+
|
|
20
28
|
// Upload data to a file resource.
|
|
21
29
|
rpc UploadFile(stream UploadFileRequest) returns (stream UploadFileResponse);
|
|
22
30
|
}
|
|
@@ -55,6 +63,22 @@ message GetFileResponse {
|
|
|
55
63
|
File file = 2;
|
|
56
64
|
}
|
|
57
65
|
|
|
66
|
+
message GetFileContentRequest {
|
|
67
|
+
// The resource id of the base folder.
|
|
68
|
+
string resource_id = 1;
|
|
69
|
+
|
|
70
|
+
// Optional - the path to the file, relative to the base folder. Required for linked folders.
|
|
71
|
+
string file_path = 2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message GetFileContentResponse {
|
|
75
|
+
// Details of any error that occurred on the call.
|
|
76
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
77
|
+
|
|
78
|
+
// The file content.
|
|
79
|
+
bytes content = 2;
|
|
80
|
+
}
|
|
81
|
+
|
|
58
82
|
message GetFileDescendantsRequest {
|
|
59
83
|
// The resource id of the base folder.
|
|
60
84
|
string resource_id = 1;
|
|
@@ -74,7 +98,27 @@ message GetFileDescendantsResponse {
|
|
|
74
98
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
75
99
|
|
|
76
100
|
// The list of descendants.
|
|
77
|
-
repeated File
|
|
101
|
+
repeated File descendant = 2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message SetFileContentRequest {
|
|
105
|
+
// The resource id of the base folder.
|
|
106
|
+
string resource_id = 1;
|
|
107
|
+
|
|
108
|
+
// Optional - the path to the file, relative to the base folder. Required for linked folders.
|
|
109
|
+
string file_path = 2;
|
|
110
|
+
|
|
111
|
+
// Optional store name to use.
|
|
112
|
+
// If specified, this will be used to extract the extension to set as a resource 'kind', e.g. tdx:ext:json.
|
|
113
|
+
// If not specified, the extension will be taken from the name of the target resource.
|
|
114
|
+
string store_name = 3;
|
|
115
|
+
|
|
116
|
+
bytes content = 4;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message SetFileContentResponse {
|
|
120
|
+
// Details of any error that occurred on the call.
|
|
121
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
78
122
|
}
|
|
79
123
|
|
|
80
124
|
message UploadFileStart {
|
|
@@ -82,6 +126,8 @@ message UploadFileStart {
|
|
|
82
126
|
string resource_id = 1;
|
|
83
127
|
|
|
84
128
|
// Optional store name to use.
|
|
129
|
+
// If specified, this will be used to extract the extension to set as a resource 'kind', e.g. tdx:ext:json.
|
|
130
|
+
// If not specified, the extension will be taken from the name of the target resource.
|
|
85
131
|
string store_name = 2;
|
|
86
132
|
|
|
87
133
|
// Optionally set streaming mode.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package tdx.volt_api.volt.v1;
|
|
4
|
+
|
|
5
|
+
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
|
+
|
|
7
|
+
// The Spark API allows clients to start and communicate with Spark VMs.
|
|
8
|
+
service SparkAPI {
|
|
9
|
+
// Start or connect to a spark VM and establish a long-lived communication channel.
|
|
10
|
+
rpc Spark(stream SparkRequest) returns (stream SparkResponse);
|
|
11
|
+
|
|
12
|
+
// Get details of running spark VMs.
|
|
13
|
+
rpc GetSpark(GetSparkRequest) returns (GetSparkResponse);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Start a resource-hosted spark.
|
|
17
|
+
// Provenance is determined from the resource owner.
|
|
18
|
+
message StartSparkResource {
|
|
19
|
+
// The id of the resource containing the VM byte code.
|
|
20
|
+
string resource_id = 1;
|
|
21
|
+
|
|
22
|
+
// JSON-encoded payload to parameterise the spark.
|
|
23
|
+
string payload = 2;
|
|
24
|
+
|
|
25
|
+
// Envelope signature.
|
|
26
|
+
string signature = 3;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Start a spark from byte code included in the payload, along with issuer/developer claims and signature.
|
|
30
|
+
message StartSparkAdhoc {
|
|
31
|
+
// Ad-hoc byte code of VM to run.
|
|
32
|
+
bytes byte_code = 1;
|
|
33
|
+
|
|
34
|
+
// Verifiable credentials associated with this spark.
|
|
35
|
+
repeated string credential = 2;
|
|
36
|
+
|
|
37
|
+
// Envelope signature.
|
|
38
|
+
string signature = 3;
|
|
39
|
+
|
|
40
|
+
// JSON-encoded payload to parameterise the spark.
|
|
41
|
+
string payload = 4;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Send commands and payloads to communicate with a running spark.
|
|
45
|
+
message SparkCommand {
|
|
46
|
+
// Optional id to associate with this command.
|
|
47
|
+
// If this is omitted, an id will be assigned and returned in the command acknowledgement.
|
|
48
|
+
string command_id = 1;
|
|
49
|
+
|
|
50
|
+
// The command to send to the spark.
|
|
51
|
+
string command = 2;
|
|
52
|
+
|
|
53
|
+
// The command payload.
|
|
54
|
+
string payload = 3;
|
|
55
|
+
|
|
56
|
+
// Command verifiable credential.
|
|
57
|
+
string credential = 4;
|
|
58
|
+
|
|
59
|
+
// Command signature.
|
|
60
|
+
string signature = 5;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// The request must contain one of the messages indicated below.
|
|
64
|
+
message SparkRequest {
|
|
65
|
+
oneof payload {
|
|
66
|
+
StartSparkResource start_resource = 1;
|
|
67
|
+
StartSparkAdhoc start_adhoc = 2;
|
|
68
|
+
SparkCommand command = 3;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Receive events and payload from a running spark.
|
|
73
|
+
message SparkData {
|
|
74
|
+
// The command id to which this data corresponds.
|
|
75
|
+
string command_id = 1;
|
|
76
|
+
|
|
77
|
+
oneof payload {
|
|
78
|
+
// Acknowledges receipt of a spark command.
|
|
79
|
+
bool acknowledge = 2;
|
|
80
|
+
|
|
81
|
+
// Indicates the command has completed.
|
|
82
|
+
bool ended = 3;
|
|
83
|
+
|
|
84
|
+
// Will contain error details on command failure.
|
|
85
|
+
string error = 4;
|
|
86
|
+
|
|
87
|
+
// Data emitted by a command, usually in stringified JSON format.
|
|
88
|
+
string data = 5;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Details of a spark instance.
|
|
93
|
+
message SparkInstance {
|
|
94
|
+
// The UUID assigned to the spark instance.
|
|
95
|
+
string spark_id = 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// The response will contain one of the messages indicated below.
|
|
99
|
+
message SparkResponse {
|
|
100
|
+
oneof payload {
|
|
101
|
+
// Details of any error that occurred on the call.
|
|
102
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
103
|
+
|
|
104
|
+
// Details of the spark instance, sent in response to a start command.
|
|
105
|
+
SparkInstance spark_instance = 2;
|
|
106
|
+
|
|
107
|
+
// Payload data emitted by the spark.
|
|
108
|
+
SparkData spark_data = 3;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
message GetSparkRequest {
|
|
113
|
+
string spark_id = 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// One of the following fields will be present in the response.
|
|
117
|
+
message GetSparkResponse {
|
|
118
|
+
// Details of any error that occurred on the call.
|
|
119
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
@@ -11,10 +11,10 @@ enum DiscoveryMode {
|
|
|
11
11
|
// Any bound local identity can discover.
|
|
12
12
|
DISCOVERY_MODE_PUBLIC = 2;
|
|
13
13
|
|
|
14
|
-
// Only identities with explicit policy PERMIT can discover, and the service will be available to local and non-local (
|
|
14
|
+
// Only identities with explicit policy PERMIT can discover, and the service will be available to local and non-local (Relayed) clients.
|
|
15
15
|
DISCOVERY_MODE_TRUSTED_GLOBAL = 3;
|
|
16
16
|
|
|
17
|
-
// Any bound identity can discover, and the service will be available to local and non-local (
|
|
17
|
+
// Any bound identity can discover, and the service will be available to local and non-local (Relayed) clients.
|
|
18
18
|
DISCOVERY_MODE_PUBLIC_GLOBAL = 4;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -53,8 +53,8 @@ enum ShareMode {
|
|
|
53
53
|
|
|
54
54
|
// Represents an outbound connection from a Volt to a remote service that will act as a proxy for that Volt.
|
|
55
55
|
// This enables Volts to bypass firewall and NATs.
|
|
56
|
-
// Example 1 - connection from a Volt to the cloud-based Volt tunnel at
|
|
57
|
-
// Example 2 - connection from a Volt to
|
|
56
|
+
// Example 1 - connection from a Volt to the cloud-based Volt tunnel at cloud.tdxvolt.com
|
|
57
|
+
// Example 2 - connection from a Volt to Relay Volt running on the public internet, such as tdxvolt.com
|
|
58
58
|
message ProxyConnection {
|
|
59
59
|
// Unique connection id.
|
|
60
60
|
string id = 1;
|
|
@@ -74,7 +74,7 @@ message ProxyConnection {
|
|
|
74
74
|
// Indicates this connection is currently in use.
|
|
75
75
|
bool connected = 6;
|
|
76
76
|
|
|
77
|
-
// Indicates this is a connection to a cloud-based tunnel, rather than to
|
|
77
|
+
// Indicates this is a connection to a cloud-based tunnel, rather than to a Relay Volt.
|
|
78
78
|
bool is_cloud_connection = 7;
|
|
79
79
|
|
|
80
80
|
// Indicates that this connection will handle HTTP proxying as well as GRPC.
|
|
@@ -82,6 +82,9 @@ message ProxyConnection {
|
|
|
82
82
|
|
|
83
83
|
// Set to indicate the Volt API itself is not automatically exposed to the connection.
|
|
84
84
|
bool disable_volt_api = 9;
|
|
85
|
+
|
|
86
|
+
// Optional challenge that can be presented in the bind phase when initialising the connection.
|
|
87
|
+
string challenge = 10;
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
enum SecureMode {
|
|
@@ -158,12 +161,12 @@ message VoltParameters {
|
|
|
158
161
|
// Internal use only.
|
|
159
162
|
bool enable_messaging = 22;
|
|
160
163
|
|
|
161
|
-
// Set to indicate this Volt
|
|
164
|
+
// Set to indicate this Volt acts as a Relay.
|
|
162
165
|
// This means this Volt can act as a proxy for other Volts (or in fact any client) that connect to it.
|
|
163
|
-
bool
|
|
166
|
+
bool has_relay = 23;
|
|
164
167
|
|
|
165
|
-
// Set to run the
|
|
166
|
-
bool
|
|
168
|
+
// Set to run the Relay open to any client, i.e. clients can utilise the Relay without first binding to this Volt.
|
|
169
|
+
bool relay_open = 24;
|
|
167
170
|
|
|
168
171
|
// Determines if the Volt HTTP server is enabled.
|
|
169
172
|
bool enable_http_server = 25;
|
|
@@ -190,11 +193,11 @@ message VoltParameters {
|
|
|
190
193
|
// Indicates that these parameters refer to a connection to a remote Volt rather than a local Volt.
|
|
191
194
|
string connection_id = 32;
|
|
192
195
|
|
|
193
|
-
// The certificate authority of the
|
|
194
|
-
string
|
|
196
|
+
// The certificate authority of the Relay if this is a remote connection via a Relay.
|
|
197
|
+
string relay_ca_pem = 33;
|
|
195
198
|
|
|
196
199
|
// Set to indicate this is a remote connection to a Volt via a cloud tunnel.
|
|
197
|
-
bool
|
|
200
|
+
bool is_cloud_relay = 34;
|
|
198
201
|
|
|
199
202
|
// An optional alias that can be used to refer to the Volt rather than the `id` field.
|
|
200
203
|
// This alias must be unique within the scope of the Battery in which the Volt is stored.
|
|
@@ -214,11 +217,11 @@ message VoltEndpoint {
|
|
|
214
217
|
// The actual host/ip the volt is physically running on (might be a local ip if behind firewall).
|
|
215
218
|
string local_address = 4;
|
|
216
219
|
|
|
217
|
-
// The global (
|
|
218
|
-
string
|
|
220
|
+
// 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.
|
|
221
|
+
string relay_address = 5;
|
|
219
222
|
|
|
220
|
-
// The root certificate of the
|
|
221
|
-
string
|
|
223
|
+
// The root certificate of the Relay instance referred to in `relay_address`.
|
|
224
|
+
string relay_ca_pem = 6;
|
|
222
225
|
|
|
223
226
|
// The self-signed certificate used by the volt to sign client certificates.
|
|
224
227
|
string ca_pem = 7;
|
|
@@ -232,8 +235,10 @@ message VoltEndpoint {
|
|
|
232
235
|
// The online status of the Volt.
|
|
233
236
|
OnlineStatus online_status = 10;
|
|
234
237
|
|
|
235
|
-
// Set to indicate that this Volt
|
|
236
|
-
bool
|
|
238
|
+
// Set to indicate that this Volt acts as a Relay.
|
|
239
|
+
bool has_relay = 11;
|
|
240
|
+
|
|
241
|
+
Version api_version = 12;
|
|
237
242
|
}
|
|
238
243
|
|
|
239
244
|
// Internal use only.
|
|
@@ -260,8 +265,8 @@ message ServiceDescription {
|
|
|
260
265
|
// The id of the server resource that is hosting this service.
|
|
261
266
|
string server_id = 1;
|
|
262
267
|
|
|
263
|
-
// The
|
|
264
|
-
string
|
|
268
|
+
// The address of the grpc server hosting this service.
|
|
269
|
+
string address = 2;
|
|
265
270
|
|
|
266
271
|
// The discovery mode.
|
|
267
272
|
DiscoveryMode discoverable = 4;
|
|
@@ -279,7 +284,7 @@ message ServiceDescription {
|
|
|
279
284
|
string ca_pem = 8;
|
|
280
285
|
|
|
281
286
|
// Internal use only.
|
|
282
|
-
repeated MethodDescription
|
|
287
|
+
repeated MethodDescription method = 100;
|
|
283
288
|
}
|
|
284
289
|
|
|
285
290
|
// Resource attribute data types.
|
|
@@ -316,7 +321,7 @@ message ResourceAttribute {
|
|
|
316
321
|
|
|
317
322
|
AttributeDataType data_type = 4;
|
|
318
323
|
|
|
319
|
-
repeated AttributeValue
|
|
324
|
+
repeated AttributeValue value = 5;
|
|
320
325
|
}
|
|
321
326
|
|
|
322
327
|
// Using `major` and `minor` here upsets the GNU C Library, so we add a `version_` prefix.
|
|
@@ -347,7 +352,7 @@ message Resource {
|
|
|
347
352
|
ServiceDescription service_description = 8;
|
|
348
353
|
|
|
349
354
|
// Attributes assigned to the resource.
|
|
350
|
-
repeated ResourceAttribute
|
|
355
|
+
repeated ResourceAttribute attribute = 9;
|
|
351
356
|
|
|
352
357
|
// The version of the platform.
|
|
353
358
|
Version platform_version = 10;
|
|
@@ -382,10 +387,13 @@ message Resource {
|
|
|
382
387
|
// The path to the resource store.
|
|
383
388
|
string store = 114;
|
|
384
389
|
|
|
390
|
+
// Alias(es) that can be used to refer to the resource rather than the id.
|
|
391
|
+
// Each alias must be unique to the Volt, this is enforced by the API.
|
|
392
|
+
// 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 '-'.
|
|
385
393
|
repeated string alias = 115;
|
|
386
394
|
|
|
387
395
|
// Not yet supported.
|
|
388
|
-
repeated Resource
|
|
396
|
+
repeated Resource child = 200;
|
|
389
397
|
}
|
|
390
398
|
|
|
391
399
|
enum IdentityType {
|
|
@@ -444,7 +452,7 @@ message IdentityAlias {
|
|
|
444
452
|
// A Volt identity encompasses a Resource and a set of identity aliases.
|
|
445
453
|
message Identity {
|
|
446
454
|
Resource resource = 1;
|
|
447
|
-
repeated IdentityAlias
|
|
455
|
+
repeated IdentityAlias alias = 2;
|
|
448
456
|
}
|
|
449
457
|
|
|
450
458
|
enum BindCredentialType {
|