@tdxvolt/volt-client-grpc 0.16.0-beta.1 → 0.16.0-beta.12
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/README.md +1 -1
- package/lib/index.cjs +444 -407
- package/package.json +2 -4
- package/protobuf/tdx/volt_api/data/v1/sqlite_database_api.proto +49 -13
- package/protobuf/tdx/volt_api/data/v1/sqlite_server_api.proto +3 -0
- package/protobuf/tdx/volt_api/volt/v1/discovery_api.proto +0 -4
- package/protobuf/tdx/volt_api/volt/v1/ssi.proto +31 -5
- package/protobuf/tdx/volt_api/volt/v1/ssi_api.proto +119 -31
- package/protobuf/tdx/volt_api/volt/v1/terminal_api.proto +42 -0
- package/protobuf/tdx/volt_api/volt/v1/volt.proto +141 -134
- package/protobuf/tdx/volt_api/volt/v1/volt_api.proto +138 -234
- package/src/constants.js +3 -5
- package/src/grpc-call.js +142 -51
- package/src/grpc-utils.js +8 -4
- package/src/rpc-invocation.js +94 -46
- package/src/utils.js +4 -119
- package/src/volt-client-internal.js +123 -216
- package/src/volt-client.js +33 -13
- package/src/volt-connection.js +25 -16
- package/src/volt-credential.js +46 -125
|
@@ -8,18 +8,16 @@ import "tdx/volt_api/volt/v1/ssi.proto";
|
|
|
8
8
|
import "tdx/volt_api/volt/v1/volt.proto";
|
|
9
9
|
|
|
10
10
|
// The top-level volt management service.
|
|
11
|
-
// With the exception of `
|
|
12
|
-
// A client certificate can be obtained from the `
|
|
11
|
+
// 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.
|
|
12
|
+
// A client certificate can be obtained from the `Authenticate` method.
|
|
13
13
|
// 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.
|
|
14
14
|
service VoltAPI {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Issues a request to bind to the volt.
|
|
18
|
-
// All clients must successfully bind to the Volt in order to gain any kind of access.
|
|
15
|
+
// Issues a request to authenticate on the volt.
|
|
16
|
+
// All clients must successfully authenticate in order to gain any kind of access.
|
|
19
17
|
// A client certificate is optional for this RPC, if omitted a JWT must be provided in the call metadata.
|
|
20
|
-
// 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-
|
|
21
|
-
// If the
|
|
22
|
-
rpc
|
|
18
|
+
// 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.
|
|
19
|
+
// 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.
|
|
20
|
+
rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse);
|
|
23
21
|
|
|
24
22
|
// Determine if an identity can perform a specific action on a resource.
|
|
25
23
|
// 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.
|
|
@@ -57,10 +55,6 @@ service VoltAPI {
|
|
|
57
55
|
// If the authenticated identity is the Volt root, all rules will be retrieved that match the criteria.
|
|
58
56
|
rpc GetAccess(GetAccessRequest) returns (GetAccessResponse);
|
|
59
57
|
|
|
60
|
-
// Get the bindings for this volt.
|
|
61
|
-
// This is a privileged API call and requires Volt root access.
|
|
62
|
-
rpc GetBindings(GetBindingsRequest) returns (GetBindingsResponse);
|
|
63
|
-
|
|
64
58
|
// Retrieve identities matching the given criteria.
|
|
65
59
|
// Only identities that the authenticated identity has read access to will be retrieved.
|
|
66
60
|
rpc GetIdentities(GetIdentitiesRequest) returns (GetIdentitiesResponse);
|
|
@@ -93,8 +87,8 @@ service VoltAPI {
|
|
|
93
87
|
// Get descendants of a resource.
|
|
94
88
|
rpc GetResourceDescendants(GetResourceDescendantsRequest) returns (GetResourceDescendantsResponse);
|
|
95
89
|
|
|
96
|
-
// Get
|
|
97
|
-
rpc
|
|
90
|
+
// Get sessions.
|
|
91
|
+
rpc GetSessions(GetSessionsRequest) returns (GetSessionsResponse);
|
|
98
92
|
|
|
99
93
|
// Invoke a method.
|
|
100
94
|
// This is primarily for use by Relay connections when proxying invocations.
|
|
@@ -110,8 +104,6 @@ service VoltAPI {
|
|
|
110
104
|
// Create or update an access rule.
|
|
111
105
|
rpc SaveAccess(SaveAccessRequest) returns (SaveAccessResponse);
|
|
112
106
|
|
|
113
|
-
rpc SaveAuthentication(SaveAuthenticationRequest) returns (SaveAuthenticationResponse);
|
|
114
|
-
|
|
115
107
|
// Create or update an identity.
|
|
116
108
|
rpc SaveIdentity(SaveIdentityRequest) returns (SaveIdentityResponse);
|
|
117
109
|
|
|
@@ -129,10 +121,6 @@ service VoltAPI {
|
|
|
129
121
|
// This is a privileged call that requires Volt root access.
|
|
130
122
|
rpc SetAccessRequestDecision(SetAccessRequestDecisionRequest) returns (SetAccessRequestDecisionResponse);
|
|
131
123
|
|
|
132
|
-
// Set Volt binding decision.
|
|
133
|
-
// This is a privileged call that requires Volt root access.
|
|
134
|
-
rpc SetBindingDecision(SetBindingDecisionRequest) returns (SetBindingDecisionResponse);
|
|
135
|
-
|
|
136
124
|
rpc SetPolicy(SetPolicyRequest) returns (SetPolicyResponse);
|
|
137
125
|
|
|
138
126
|
// Set the status of a Volt service.
|
|
@@ -146,45 +134,50 @@ service VoltAPI {
|
|
|
146
134
|
rpc SignVerify(SignVerifyRequest) returns (SignVerifyResponse);
|
|
147
135
|
}
|
|
148
136
|
|
|
149
|
-
// Describes a request to
|
|
137
|
+
// Describes a request to authenticate on a Volt.
|
|
138
|
+
// Present one of the `public_key`, `did_public_key`, `did`, or `did_document` fields.
|
|
150
139
|
message AuthenticateRequest {
|
|
151
140
|
|
|
152
141
|
oneof client_identifier {
|
|
142
|
+
// The client public key in PEM format. The Volt will create a session that is bound to this public key.
|
|
143
|
+
string public_key = 1;
|
|
144
|
+
|
|
145
|
+
// 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.
|
|
146
|
+
// Note this is only valid when a DID has previously been registered using this public key.
|
|
147
|
+
string did_public_key = 2;
|
|
148
|
+
|
|
153
149
|
// An existing DID owned by the client.
|
|
154
|
-
// The JWT presented with the
|
|
155
|
-
string did =
|
|
150
|
+
// The JWT presented with the authenticate call must be signed by the private key corresponding to this DID.
|
|
151
|
+
string did = 3;
|
|
156
152
|
|
|
157
153
|
// If the client doesn't have an existing DID, a DID document can be provided here.
|
|
158
|
-
// The document must include a proof that the client owns the public key given in `public_key`.
|
|
159
154
|
// The Volt will register the DID on behalf of the client.
|
|
160
|
-
// The JWT presented with the
|
|
161
|
-
string did_document =
|
|
162
|
-
|
|
163
|
-
// 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.
|
|
164
|
-
// Note this is only valid when a DID has previously been registered using this public key.
|
|
165
|
-
string public_key = 3;
|
|
155
|
+
// The JWT presented with the authenticate call must be signed by the private key corresponding to this document.
|
|
156
|
+
string did_document = 4;
|
|
166
157
|
}
|
|
167
158
|
|
|
168
159
|
// A base64-encoded signature of the DID document, only required if `did_document` is provided above.
|
|
169
|
-
string did_document_signature =
|
|
160
|
+
string did_document_signature = 5;
|
|
170
161
|
|
|
171
|
-
// A human-readable name of the entity requesting to
|
|
172
|
-
string
|
|
162
|
+
// A human-readable name of the entity requesting to authenticate.
|
|
163
|
+
string client_name = 6;
|
|
173
164
|
|
|
174
165
|
// The volt challenge code, signed by the private key component of the `public_key` field above, and base64 encoded.
|
|
175
166
|
// This is optional.
|
|
176
|
-
string challenge =
|
|
167
|
+
string challenge = 7;
|
|
177
168
|
|
|
178
169
|
// The host name to add as a SAN to the issued certificate.
|
|
179
170
|
// This is optional, if you don't intend to host services with the certificate this can be omitted.
|
|
180
|
-
string host =
|
|
171
|
+
string host = 8;
|
|
181
172
|
|
|
182
173
|
// Optional verifiable credentials describing the client.
|
|
183
|
-
|
|
184
|
-
repeated VerifiablePresentation verifiable_presentation = 8;
|
|
174
|
+
repeated VerifiablePresentation verifiable_presentation = 9;
|
|
185
175
|
|
|
186
176
|
// Reserved for internal use.
|
|
187
|
-
bool purge_aliases =
|
|
177
|
+
bool purge_aliases = 10;
|
|
178
|
+
|
|
179
|
+
// Optional additional name to differentiate between multiple sessions for a given client.
|
|
180
|
+
string session_name = 11;
|
|
188
181
|
}
|
|
189
182
|
|
|
190
183
|
message AuthenticateResponse {
|
|
@@ -193,18 +186,17 @@ message AuthenticateResponse {
|
|
|
193
186
|
|
|
194
187
|
string session_id = 2;
|
|
195
188
|
|
|
196
|
-
// The identity id assigned to this
|
|
197
|
-
|
|
198
|
-
string identity_id = 3;
|
|
189
|
+
// The identity id assigned to this authentication.
|
|
190
|
+
string identity_did = 3;
|
|
199
191
|
|
|
200
192
|
// A certificate issued by the volt CA, binding the request public key to the identity.
|
|
201
|
-
// Only valid for PERMIT
|
|
193
|
+
// Only valid for PERMIT authenticate decisions.
|
|
202
194
|
string cert = 4;
|
|
203
195
|
|
|
204
196
|
// The volt CA chain. This is used by the client in subsequent API calls to secure the connection.
|
|
205
197
|
string chain = 5;
|
|
206
198
|
|
|
207
|
-
// The
|
|
199
|
+
// The authenticate decision.
|
|
208
200
|
PolicyDecision decision = 6;
|
|
209
201
|
|
|
210
202
|
// Reserved for internal use.
|
|
@@ -214,72 +206,6 @@ message AuthenticateResponse {
|
|
|
214
206
|
int64 decision_time = 8;
|
|
215
207
|
}
|
|
216
208
|
|
|
217
|
-
// Describes a request to bind to a volt.
|
|
218
|
-
message BindRequest {
|
|
219
|
-
|
|
220
|
-
oneof client_identifier {
|
|
221
|
-
// An existing DID owned by the client.
|
|
222
|
-
// The JWT presented with the Bind call must be signed by the private key corresponding to this DID.
|
|
223
|
-
string did = 1;
|
|
224
|
-
|
|
225
|
-
// If the client doesn't have an existing DID, a DID document can be provided here.
|
|
226
|
-
// The document must include a proof that the client owns the public key given in `public_key`.
|
|
227
|
-
// The Volt will register the DID on behalf of the client.
|
|
228
|
-
// The JWT presented with the Bind call must be signed by the private key corresponding to this document.
|
|
229
|
-
string did_document = 2;
|
|
230
|
-
|
|
231
|
-
// 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.
|
|
232
|
-
// Note this is only valid when a DID has previously been registered using this public key.
|
|
233
|
-
string public_key = 3;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// A base64-encoded signature of the DID document, only required if `did_document` is provided above.
|
|
237
|
-
string did_document_signature = 4;
|
|
238
|
-
|
|
239
|
-
// A human-readable name of the entity requesting to bind.
|
|
240
|
-
string binding_name = 5;
|
|
241
|
-
|
|
242
|
-
// The volt challenge code, signed by the private key component of the `public_key` field above, and base64 encoded.
|
|
243
|
-
// This is optional.
|
|
244
|
-
string challenge = 6;
|
|
245
|
-
|
|
246
|
-
// The host name to add as a SAN to the issued certificate.
|
|
247
|
-
// This is optional, if you don't intend to host services with the certificate this can be omitted.
|
|
248
|
-
string host = 7;
|
|
249
|
-
|
|
250
|
-
// Optional verifiable credentials describing the client.
|
|
251
|
-
// This is a work in progress.
|
|
252
|
-
repeated VerifiablePresentation verifiable_presentation = 8;
|
|
253
|
-
|
|
254
|
-
// Reserved for internal use.
|
|
255
|
-
bool purge_aliases = 9;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
message BindResponse {
|
|
259
|
-
// Details of any error that occurred on the call.
|
|
260
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
261
|
-
|
|
262
|
-
// The identity id assigned to this binding.
|
|
263
|
-
// Only valid for PERMIT bind decisions.
|
|
264
|
-
string identity_id = 2;
|
|
265
|
-
|
|
266
|
-
// A certificate issued by the volt CA, binding the request public key to the identity.
|
|
267
|
-
// Only valid for PERMIT bind decisions.
|
|
268
|
-
string cert = 3;
|
|
269
|
-
|
|
270
|
-
// The volt CA chain. This is used by the client in subsequent API calls to secure the connection.
|
|
271
|
-
string chain = 4;
|
|
272
|
-
|
|
273
|
-
// The bind decision.
|
|
274
|
-
PolicyDecision decision = 5;
|
|
275
|
-
|
|
276
|
-
// Reserved for internal use.
|
|
277
|
-
int64 request_time = 6;
|
|
278
|
-
|
|
279
|
-
// Reserved for internal use.
|
|
280
|
-
int64 decision_time = 7;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
209
|
message CanAccessResourceRequest {
|
|
284
210
|
oneof subject {
|
|
285
211
|
// The subject of the access request.
|
|
@@ -303,7 +229,7 @@ message CanAccessResourceResponse {
|
|
|
303
229
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
304
230
|
|
|
305
231
|
// The identity subject that the access relates to.
|
|
306
|
-
string
|
|
232
|
+
string identity_did = 2;
|
|
307
233
|
|
|
308
234
|
// Optional identity that issued the access.
|
|
309
235
|
string issuer_id = 3;
|
|
@@ -343,69 +269,51 @@ message ConnectHello {
|
|
|
343
269
|
// Set to receive notification of resource events.
|
|
344
270
|
bool subscribe_resource_events = 3;
|
|
345
271
|
|
|
346
|
-
// Set this to
|
|
347
|
-
// This indicates that
|
|
348
|
-
//
|
|
272
|
+
// Set this if you are connecting to a relay, i.e. the Volt you are sending to this message is a relay.
|
|
273
|
+
// This indicates that you are happy to receive method invocations from clients of the Relay.
|
|
274
|
+
// This will usually be set to the `id` of your Volt, but in theory any client could receive remote invocation requests in this way.
|
|
349
275
|
string relay_id = 4;
|
|
350
276
|
|
|
351
277
|
// A friendly name to present to Relay clients.
|
|
352
278
|
string relay_name = 5;
|
|
353
279
|
|
|
280
|
+
string relay_description = 6;
|
|
281
|
+
|
|
354
282
|
// The certificate authority to present to Relay clients.
|
|
355
|
-
string relay_ca_pem =
|
|
283
|
+
string relay_ca_pem = 7;
|
|
356
284
|
|
|
357
285
|
// Set to indicate the connection is discoverable to other Relay clients.
|
|
358
|
-
bool relay_discoverable =
|
|
286
|
+
bool relay_discoverable = 8;
|
|
359
287
|
|
|
360
288
|
// Set to receive notification of authentication requests.
|
|
361
|
-
bool subscribe_auth_requests =
|
|
289
|
+
bool subscribe_auth_requests = 9;
|
|
362
290
|
|
|
363
|
-
|
|
291
|
+
// Set to indicate the connection will accept method invocation requests.
|
|
292
|
+
bool accept_invocation = 10;
|
|
364
293
|
|
|
365
|
-
|
|
294
|
+
// Set to subscribe to DID registry updates from the peer.
|
|
295
|
+
bool subscribe_did_registry_updates = 11;
|
|
296
|
+
|
|
297
|
+
// The interval at which the client will send ping requests to the target.
|
|
298
|
+
uint32 ping_interval = 12;
|
|
299
|
+
|
|
300
|
+
// The current time on the client.
|
|
301
|
+
uint64 timestamp = 13;
|
|
366
302
|
}
|
|
367
303
|
|
|
368
304
|
message ConnectAcknowledge {
|
|
305
|
+
// A unique identifier for this connection.
|
|
369
306
|
string connection_id = 1;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// A connection ping message.
|
|
373
|
-
message ConnectPing {
|
|
374
|
-
// The time on the originating server.
|
|
375
|
-
uint64 timestamp = 1;
|
|
376
|
-
}
|
|
377
307
|
|
|
378
|
-
//
|
|
379
|
-
|
|
380
|
-
CONNECT_MESSAGE_TYPE_UNKNOWN = 0;
|
|
381
|
-
CONNECT_MESSAGE_TYPE_ORIGINAL = 1;
|
|
382
|
-
CONNECT_MESSAGE_TYPE_ECHO = 2;
|
|
383
|
-
CONNECT_MESSAGE_TYPE_FORWARD = 3;
|
|
384
|
-
}
|
|
308
|
+
// The current time on the Volt.
|
|
309
|
+
uint64 timestamp = 2;
|
|
385
310
|
|
|
386
|
-
//
|
|
387
|
-
|
|
388
|
-
CONNECT_MESSAGE_RELAY_UNKNOWN = 0;
|
|
389
|
-
CONNECT_MESSAGE_RELAY_OUTGOING = 1;
|
|
390
|
-
CONNECT_MESSAGE_RELAY_INCOMING = 2;
|
|
311
|
+
// The interval at which the target will send ping requests to the client.
|
|
312
|
+
uint32 ping_interval = 3;
|
|
391
313
|
}
|
|
392
314
|
|
|
393
|
-
//
|
|
394
|
-
message
|
|
395
|
-
string id = 1;
|
|
396
|
-
string thread_id = 2;
|
|
397
|
-
string to_id = 3;
|
|
398
|
-
string to_identity_id = 4;
|
|
399
|
-
string to_name = 5;
|
|
400
|
-
string message = 6;
|
|
401
|
-
uint64 timestamp = 7;
|
|
402
|
-
string from_id = 8;
|
|
403
|
-
string from_identity_id = 9;
|
|
404
|
-
string from_name = 10;
|
|
405
|
-
|
|
406
|
-
repeated string receipt = 11;
|
|
407
|
-
ConnectMessageType message_type = 12;
|
|
408
|
-
ConnectMessageRelay message_relay = 13;
|
|
315
|
+
// A connection ping message - intentionally empty.
|
|
316
|
+
message ConnectPing {
|
|
409
317
|
}
|
|
410
318
|
|
|
411
319
|
message ConnectGoodbye {
|
|
@@ -455,11 +363,13 @@ message ConnectDIDRegistryUpdate {
|
|
|
455
363
|
|
|
456
364
|
message ConnectEvent {
|
|
457
365
|
oneof event {
|
|
366
|
+
// An authentication request event.
|
|
458
367
|
ConnectAuthRequest connect_auth_request = 1;
|
|
459
368
|
|
|
460
369
|
// A resource event notification, such as updated or deleted.
|
|
461
370
|
ConnectResource connect_resource = 2;
|
|
462
371
|
|
|
372
|
+
// A DID registry entry update.
|
|
463
373
|
ConnectDIDRegistryUpdate did_registry_update = 3;
|
|
464
374
|
}
|
|
465
375
|
}
|
|
@@ -473,9 +383,6 @@ message ConnectRequest {
|
|
|
473
383
|
// Indicates the client is closing the connection.
|
|
474
384
|
ConnectGoodbye goodbye = 2;
|
|
475
385
|
|
|
476
|
-
// Reserved for internal use.
|
|
477
|
-
ConnectMessage msg = 3;
|
|
478
|
-
|
|
479
386
|
// Clients should periodically send ping requests to the target to confirm the stream is still live.
|
|
480
387
|
ConnectPing ping = 4;
|
|
481
388
|
|
|
@@ -504,9 +411,6 @@ message ConnectResponse {
|
|
|
504
411
|
// Notifies clients of various events on the Volt.
|
|
505
412
|
ConnectEvent evt = 4;
|
|
506
413
|
|
|
507
|
-
// Reserved for internal use.
|
|
508
|
-
ConnectMessage msg = 5;
|
|
509
|
-
|
|
510
414
|
// Periodic ping response.
|
|
511
415
|
ConnectPing ping = 6;
|
|
512
416
|
|
|
@@ -595,8 +499,11 @@ message DiscoverServicesRequest {
|
|
|
595
499
|
// Set to indicate that offline services should be included in the response.
|
|
596
500
|
bool include_offline = 2;
|
|
597
501
|
|
|
502
|
+
// Set to include the service attributes in the response.
|
|
503
|
+
bool include_attributes = 3;
|
|
504
|
+
|
|
598
505
|
// Set to include the service protobuf in the response.
|
|
599
|
-
bool include_protobuf =
|
|
506
|
+
bool include_protobuf = 4;
|
|
600
507
|
}
|
|
601
508
|
|
|
602
509
|
message DiscoverServicesResponse {
|
|
@@ -612,7 +519,7 @@ message GetAccessRequest {
|
|
|
612
519
|
string resource_id = 1;
|
|
613
520
|
|
|
614
521
|
// The identity id that is the subject of the access rule. If omitted, all identities will be considered.
|
|
615
|
-
string
|
|
522
|
+
string identity_did = 2;
|
|
616
523
|
|
|
617
524
|
// The issuer of the access rule. If omitted, all issuers will be considered.
|
|
618
525
|
string issuer_id = 3;
|
|
@@ -632,22 +539,6 @@ message GetAccessResponse {
|
|
|
632
539
|
repeated Access access = 2;
|
|
633
540
|
}
|
|
634
541
|
|
|
635
|
-
message GetBindingsRequest {
|
|
636
|
-
// The fingerprint of the binding subject. If omitted, all bindings are retrieved.
|
|
637
|
-
string fingerprint = 1;
|
|
638
|
-
|
|
639
|
-
// The decision of the binding. If omitted, all binding decisions are retrieved.
|
|
640
|
-
PolicyDecision decision = 2;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
message GetBindingsResponse {
|
|
644
|
-
// Details of any error that occurred on the call.
|
|
645
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
646
|
-
|
|
647
|
-
// The bindings that match the criteria.
|
|
648
|
-
repeated Binding binding = 2;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
542
|
message GetIdentitiesRequest {
|
|
652
543
|
// Optional name of the identity.
|
|
653
544
|
// Use '*' to perform a wildcard search.
|
|
@@ -666,11 +557,11 @@ message GetIdentitiesResponse {
|
|
|
666
557
|
repeated Identity identity = 2;
|
|
667
558
|
}
|
|
668
559
|
|
|
669
|
-
// One of `
|
|
560
|
+
// One of `identity_did` or `fingerprint` must be populated.
|
|
670
561
|
message GetIdentityRequest {
|
|
671
562
|
oneof lookup {
|
|
672
563
|
// The id of the identity to retrieve.
|
|
673
|
-
string
|
|
564
|
+
string identity_did = 1;
|
|
674
565
|
// The public key fingerprint of the identity to retrieve.
|
|
675
566
|
string fingerprint = 2;
|
|
676
567
|
}
|
|
@@ -728,8 +619,11 @@ message GetResourceRequest {
|
|
|
728
619
|
// The id of the resource to retrieve.
|
|
729
620
|
string resource_id = 1;
|
|
730
621
|
|
|
622
|
+
// Set to include the resource attributes in the response.
|
|
623
|
+
bool include_attributes = 2;
|
|
624
|
+
|
|
731
625
|
// Set to include service description protobuf in the response, if applicable.
|
|
732
|
-
bool include_protobuf =
|
|
626
|
+
bool include_protobuf = 3;
|
|
733
627
|
}
|
|
734
628
|
|
|
735
629
|
message GetResourceResponse {
|
|
@@ -769,14 +663,22 @@ message GetResourcesRequest {
|
|
|
769
663
|
bool combine_terms_exclusive = 9;
|
|
770
664
|
|
|
771
665
|
// Attributes to search by.
|
|
772
|
-
// n.b. currently this API is mutually exclusive in that if any attribute queries are specified the rpc will only search on those attributes, ignoring any parameters defined above.
|
|
773
666
|
repeated ResourceAttributeQuery attribute = 10;
|
|
774
667
|
|
|
775
668
|
// If set, will return resources where *any of* the attribute queries apply, otherwise will only return resources where *all of* the attribute queries apply.
|
|
776
669
|
bool any_of = 11;
|
|
777
670
|
|
|
671
|
+
// Set to include the resource attributes in the response.
|
|
672
|
+
bool include_attributes = 12;
|
|
673
|
+
|
|
778
674
|
// Set to include service description protobuf in the response where applicable.
|
|
779
|
-
bool include_protobuf =
|
|
675
|
+
bool include_protobuf = 13;
|
|
676
|
+
|
|
677
|
+
// Only retrieve resources that have been modified after the given timestamp. Default is 0, which means all resources will be returned.
|
|
678
|
+
uint64 modified_since = 14;
|
|
679
|
+
|
|
680
|
+
// Limit the number of resources returned. Default is 0, which means all resources will be returned.
|
|
681
|
+
uint32 limit = 15;
|
|
780
682
|
}
|
|
781
683
|
|
|
782
684
|
message GetResourcesResponse {
|
|
@@ -802,6 +704,12 @@ message GetResourceAncestorsRequest {
|
|
|
802
704
|
|
|
803
705
|
// Optional - can be used to determine if a resource is an ancestor.
|
|
804
706
|
string ancestor_id = 5;
|
|
707
|
+
|
|
708
|
+
// Set to include the service attributes in the response.
|
|
709
|
+
bool include_attributes = 6;
|
|
710
|
+
|
|
711
|
+
// Set to include the service protobuf in the response.
|
|
712
|
+
bool include_protobuf = 7;
|
|
805
713
|
}
|
|
806
714
|
|
|
807
715
|
message GetResourceAncestorsResponse {
|
|
@@ -834,6 +742,15 @@ message GetResourceDescendantsRequest {
|
|
|
834
742
|
|
|
835
743
|
// Restrict to a specific named resource.
|
|
836
744
|
string name = 7;
|
|
745
|
+
|
|
746
|
+
// Only retrieve resources that have been modified after the given timestamp. Default is 0, which means all resources will be returned.
|
|
747
|
+
uint64 modified_since = 8;
|
|
748
|
+
|
|
749
|
+
// Set to include the service attributes in the response.
|
|
750
|
+
bool include_attributes = 9;
|
|
751
|
+
|
|
752
|
+
// Set to include the service protobuf in the response.
|
|
753
|
+
bool include_protobuf = 10;
|
|
837
754
|
}
|
|
838
755
|
|
|
839
756
|
message GetResourceDescendantsResponse {
|
|
@@ -844,66 +761,87 @@ message GetResourceDescendantsResponse {
|
|
|
844
761
|
repeated Resource descendant = 2;
|
|
845
762
|
}
|
|
846
763
|
|
|
847
|
-
message
|
|
764
|
+
message GetSessionsRequest {
|
|
848
765
|
string id = 1;
|
|
849
766
|
|
|
850
|
-
string
|
|
767
|
+
string identity_did = 2;
|
|
768
|
+
|
|
769
|
+
string identity_name = 3;
|
|
770
|
+
|
|
771
|
+
SessionStatus status = 4;
|
|
851
772
|
}
|
|
852
773
|
|
|
853
|
-
message
|
|
774
|
+
message GetSessionsResponse {
|
|
854
775
|
// Details of any error that occurred on the call.
|
|
855
776
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
856
777
|
|
|
857
778
|
repeated Session session = 2;
|
|
858
779
|
}
|
|
859
780
|
|
|
781
|
+
message InvokeRequestKeyExchange {
|
|
782
|
+
bytes nonce = 1;
|
|
783
|
+
|
|
784
|
+
bytes encryption_key = 2;
|
|
785
|
+
|
|
786
|
+
bytes signature = 3;
|
|
787
|
+
}
|
|
788
|
+
|
|
860
789
|
message InvokeRequest {
|
|
861
790
|
// Client-assigned identifier for the request. Will be used to match responses and any subsequent requests.
|
|
862
791
|
uint64 invoke_id = 1;
|
|
863
792
|
|
|
864
|
-
//
|
|
865
|
-
// This contains the key and iv used to encrypt the payload, which only the token audience can access because the key and iv are themselves encrypted using the public key of the invocation target.
|
|
793
|
+
// 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.
|
|
866
794
|
string token = 2;
|
|
867
795
|
|
|
868
|
-
// The DID of the target
|
|
796
|
+
// The DID of the target at each hop of the path to the service.
|
|
869
797
|
// This is used by Relays to route the request.
|
|
870
|
-
repeated string target_did =
|
|
798
|
+
repeated string target_did = 4;
|
|
871
799
|
|
|
800
|
+
// The initialisation vector for the request payload encryption. This should be a random 16 byte value, that is different for each request.
|
|
801
|
+
bytes iv = 5;
|
|
802
|
+
|
|
803
|
+
// One of the following payloads will be present in a given InvokeRequest message.
|
|
872
804
|
oneof request_payload {
|
|
873
805
|
// A serialised and encrypted instance of `RemoteResponse` in pure binary format.
|
|
874
|
-
bytes payload =
|
|
806
|
+
bytes payload = 6;
|
|
875
807
|
|
|
876
808
|
// A serialised and encrypted instance of `RemoteResponse` as serialised JSON.
|
|
877
|
-
|
|
809
|
+
bytes json_payload = 7;
|
|
878
810
|
}
|
|
879
811
|
|
|
880
812
|
// Indicates the client has ended the invocation.
|
|
881
|
-
bool client_end =
|
|
813
|
+
bool client_end = 8;
|
|
882
814
|
|
|
883
815
|
// Reserved for internal use.
|
|
884
|
-
uint32 hop_index =
|
|
816
|
+
uint32 hop_index = 9;
|
|
885
817
|
|
|
886
818
|
// Reserved for internal use.
|
|
887
|
-
string target_service_id =
|
|
819
|
+
string target_service_id = 10;
|
|
888
820
|
}
|
|
889
821
|
|
|
890
822
|
message InvokeResponse {
|
|
891
823
|
// The invocation id to match the originating request.
|
|
892
824
|
uint64 invoke_id = 1;
|
|
893
825
|
|
|
826
|
+
InvokeRequestKeyExchange key_exchange = 2;
|
|
827
|
+
|
|
828
|
+
// The initialisation vector for the response payload encryption. This will be a random 16 byte value, that is different for each response.
|
|
829
|
+
bytes iv = 4;
|
|
830
|
+
|
|
831
|
+
// One of the following payloads will be present in a given InvokeResponse message.
|
|
894
832
|
oneof response_payload {
|
|
895
833
|
// A serialised and encrypted instance of `RemoteRequest` in pure binary format.
|
|
896
|
-
bytes payload =
|
|
834
|
+
bytes payload = 5;
|
|
897
835
|
|
|
898
836
|
// A serialised and encrypted instance of `RemoteRequest` as serialised JSON.
|
|
899
|
-
|
|
837
|
+
bytes json_payload = 6;
|
|
900
838
|
|
|
901
839
|
// Details of any error that occurred on the call.
|
|
902
|
-
tdx.volt_api.volt.v1.Status status =
|
|
840
|
+
tdx.volt_api.volt.v1.Status status = 7;
|
|
903
841
|
}
|
|
904
842
|
|
|
905
843
|
// Indicates the server has ended the invocation.
|
|
906
|
-
bool server_end =
|
|
844
|
+
bool server_end = 8;
|
|
907
845
|
}
|
|
908
846
|
|
|
909
847
|
message MoveResourceRequest {
|
|
@@ -938,7 +876,7 @@ message RequestAccessResponse {
|
|
|
938
876
|
string resource_id = 2;
|
|
939
877
|
|
|
940
878
|
// The identity attempting access.
|
|
941
|
-
string
|
|
879
|
+
string identity_did = 3;
|
|
942
880
|
|
|
943
881
|
// The identity of the issuer of the access.
|
|
944
882
|
string issuer_id = 4;
|
|
@@ -975,27 +913,6 @@ message SaveAccessResponse {
|
|
|
975
913
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
976
914
|
}
|
|
977
915
|
|
|
978
|
-
message SaveAuthenticationRequest {
|
|
979
|
-
string id = 1;
|
|
980
|
-
|
|
981
|
-
string identity_id = 2;
|
|
982
|
-
|
|
983
|
-
string identity_did = 3;
|
|
984
|
-
|
|
985
|
-
string public_key = 4;
|
|
986
|
-
|
|
987
|
-
string encrypt_key = 5;
|
|
988
|
-
|
|
989
|
-
string encrypt_iv = 6;
|
|
990
|
-
|
|
991
|
-
PolicyDecision decision = 7;
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
message SaveAuthenticationResponse {
|
|
995
|
-
// Details of any error that occurred on the call.
|
|
996
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
916
|
message SaveIdentityRequest {
|
|
1000
917
|
// Details of the identity to save.
|
|
1001
918
|
Identity identity = 1;
|
|
@@ -1124,19 +1041,6 @@ message SetAccessRequestDecisionResponse {
|
|
|
1124
1041
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
1125
1042
|
}
|
|
1126
1043
|
|
|
1127
|
-
message SetBindingDecisionRequest {
|
|
1128
|
-
// The fingerprint of the bind request.
|
|
1129
|
-
string fingerprint = 1;
|
|
1130
|
-
|
|
1131
|
-
// The policy decision to assign to the bind request.
|
|
1132
|
-
PolicyDecision decision = 2;
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
message SetBindingDecisionResponse {
|
|
1136
|
-
// Details of any error that occurred on the call.
|
|
1137
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
1044
|
// This message is emtpy.
|
|
1141
1045
|
message ShutdownRequest {
|
|
1142
1046
|
}
|
package/src/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line import/prefer-default-export
|
|
2
2
|
export const constants = {
|
|
3
|
-
authTokenName: "
|
|
3
|
+
authTokenName: "volt-token",
|
|
4
4
|
collectionOperation: {
|
|
5
5
|
add: "ADD",
|
|
6
6
|
remove: "REMOVE",
|
|
@@ -23,9 +23,9 @@ export const constants = {
|
|
|
23
23
|
],
|
|
24
24
|
userIdOID: "0.9.2342.19200300.100.1.1"
|
|
25
25
|
},
|
|
26
|
-
defaultDIDHostName: "
|
|
26
|
+
defaultDIDHostName: "tdxvolt.com",
|
|
27
27
|
didServiceType: {
|
|
28
|
-
voltConfig: "
|
|
28
|
+
voltConfig: "volt-discovery"
|
|
29
29
|
},
|
|
30
30
|
identityType: {
|
|
31
31
|
did: "did",
|
|
@@ -36,8 +36,6 @@ export const constants = {
|
|
|
36
36
|
online: "online",
|
|
37
37
|
unknown: "unknown"
|
|
38
38
|
},
|
|
39
|
-
publicKeyPrefix: "-----BEGIN PUBLIC KEY-----",
|
|
40
|
-
privateKeyPrefix: "-----BEGIN RSA PRIVATE KEY-----",
|
|
41
39
|
privateEncryptedKeyPrefix: "-----BEGIN ENCRYPTED PRIVATE KEY-----",
|
|
42
40
|
resource: {
|
|
43
41
|
identity: "ident",
|