@tdxvolt/volt-client-grpc 0.16.0-beta.10 → 0.16.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/index.cjs +431 -455
- 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 +146 -139
- package/protobuf/tdx/volt_api/volt/v1/volt_api.proto +165 -270
- 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 +5 -119
- package/src/volt-client-internal.js +106 -73
- package/src/volt-client.js +33 -12
- package/src/volt-connection.js +22 -12
- package/src/volt-credential.js +37 -124
|
@@ -92,17 +92,27 @@ message ProxyConnection {
|
|
|
92
92
|
// Set to indicate the Volt API itself is not automatically exposed to the connection.
|
|
93
93
|
bool disable_volt_api = 9;
|
|
94
94
|
|
|
95
|
-
// Optional challenge that can be presented in the
|
|
95
|
+
// Optional challenge that can be presented in the authentication request.
|
|
96
96
|
string challenge = 10;
|
|
97
97
|
|
|
98
|
+
// The id of the target Volt that this connection is bound to.
|
|
99
|
+
string target_id = 11;
|
|
100
|
+
|
|
98
101
|
// Indicates that this connection hosts a DID registry that we should synchronise with.
|
|
99
|
-
bool sync_did_registry =
|
|
102
|
+
bool sync_did_registry = 12;
|
|
100
103
|
|
|
101
104
|
// The id of the last DID registry operation that was synchronised.
|
|
102
|
-
uint64 did_registry_sync_id =
|
|
105
|
+
uint64 did_registry_sync_id = 13;
|
|
103
106
|
|
|
104
|
-
//
|
|
105
|
-
|
|
107
|
+
// Indicates that this connection hosts a DID registry that we should synchronise with.
|
|
108
|
+
bool sync_vc_registry = 14;
|
|
109
|
+
|
|
110
|
+
// The timestamp of the last VC registry operation that was synchronised.
|
|
111
|
+
uint64 vc_registry_sync_timestamp = 15;
|
|
112
|
+
|
|
113
|
+
string session_id = 16;
|
|
114
|
+
|
|
115
|
+
string certificate = 17;
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
enum SecureMode {
|
|
@@ -160,15 +170,11 @@ message VoltParameters {
|
|
|
160
170
|
// Indicates the Volt will be discoverable by clients using the discovery api.
|
|
161
171
|
bool discoverable = 16;
|
|
162
172
|
|
|
163
|
-
// Optional
|
|
164
|
-
|
|
165
|
-
string owner_credential = 17;
|
|
173
|
+
// Optional challenge code that can be used aid in the process of authenticating clients.
|
|
174
|
+
string authenticate_challenge = 18;
|
|
166
175
|
|
|
167
|
-
//
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// Indicates that clients must present the correct challenge code in order to be able to bind to the Volt.
|
|
171
|
-
bool require_bind_challenge = 19;
|
|
176
|
+
// Indicates that clients must present the correct challenge code in order to be able to authenticate.
|
|
177
|
+
bool require_authenticate_challenge = 19;
|
|
172
178
|
|
|
173
179
|
// Internal use only.
|
|
174
180
|
bool confirm_stop = 20;
|
|
@@ -183,7 +189,7 @@ message VoltParameters {
|
|
|
183
189
|
// This means this Volt can act as a proxy for other Volts (or in fact any client) that connect to it.
|
|
184
190
|
bool has_relay = 23;
|
|
185
191
|
|
|
186
|
-
// Set to run the Relay open to any client, i.e. clients can utilise the Relay without first
|
|
192
|
+
// Set to run the Relay open to any client, i.e. clients can utilise the Relay without first authenticating.
|
|
187
193
|
bool relay_open = 24;
|
|
188
194
|
|
|
189
195
|
// Determines if the Volt HTTP server is enabled.
|
|
@@ -228,51 +234,87 @@ message VoltParameters {
|
|
|
228
234
|
// The runtime version this Volt is running.
|
|
229
235
|
Version version = 36;
|
|
230
236
|
|
|
231
|
-
// If set, indicates that any client that provides the correct challenge
|
|
237
|
+
// If set, indicates that any client that provides the correct challenge during authentication will automatically be approved to access the Volt.
|
|
232
238
|
bool approve_on_challenge = 37;
|
|
233
239
|
|
|
234
|
-
//
|
|
235
|
-
bool
|
|
240
|
+
// If set, indicates that any client that proves ownership of a DID known to the Volt will automatically be approved to access the Volt.
|
|
241
|
+
bool approve_on_did = 38;
|
|
242
|
+
|
|
243
|
+
// If set, indicates that clients can register DIDs with this Volt.
|
|
244
|
+
bool enable_did_registry = 39;
|
|
236
245
|
|
|
237
246
|
// Zero or more URLs of trusted peer DID registries.
|
|
238
247
|
repeated string did_registry = 40;
|
|
248
|
+
|
|
249
|
+
// If set, enables outbound SMTP.
|
|
250
|
+
bool enable_outbound_smtp = 41;
|
|
251
|
+
|
|
252
|
+
// The SMTP host to use for sending emails.
|
|
253
|
+
string outbound_smtp_host = 42;
|
|
254
|
+
|
|
255
|
+
// The SMTP port to use for sending emails.
|
|
256
|
+
uint32 outbound_smtp_port = 43;
|
|
257
|
+
|
|
258
|
+
// The SMTP username to use for sending emails.
|
|
259
|
+
string outbound_smtp_user = 44;
|
|
260
|
+
|
|
261
|
+
// The SMTP password to use for sending emails.
|
|
262
|
+
string outbound_smtp_password = 45;
|
|
263
|
+
|
|
264
|
+
// If set, enables sessions that authenticate using credentials rather than a DID to create resources in the 'anonymous' system folder.
|
|
265
|
+
bool enable_anonymous_create = 46;
|
|
266
|
+
|
|
267
|
+
// The decision to apply to all authentication requests that do not match any other policy.
|
|
268
|
+
// The default is PROMPT.
|
|
269
|
+
PolicyDecision catch_all_auth_decision = 47;
|
|
270
|
+
|
|
271
|
+
// If set, enables caching of policy decisions.
|
|
272
|
+
bool enable_policy_cache = 48;
|
|
273
|
+
|
|
274
|
+
// If set, enables the terminal API.
|
|
275
|
+
bool enable_terminal = 49;
|
|
276
|
+
|
|
277
|
+
// The time at which the Volt was started.
|
|
278
|
+
uint64 start_time = 50;
|
|
239
279
|
}
|
|
240
280
|
|
|
241
281
|
message VoltEndpoint {
|
|
242
282
|
// The globally unique Volt id.
|
|
243
283
|
string id = 1;
|
|
244
284
|
|
|
245
|
-
// Optional owner credential, base 64 encoded.
|
|
246
|
-
string owner_credential = 2;
|
|
247
|
-
|
|
248
285
|
// Human-readable name of the Volt.
|
|
249
286
|
string display_name = 3;
|
|
250
287
|
|
|
251
288
|
// The actual host/ip the volt is physically running on (might be a local ip if behind firewall).
|
|
252
289
|
string local_address = 4;
|
|
253
290
|
|
|
291
|
+
// The address of the endpoint HTTP server.
|
|
292
|
+
string http_address = 5;
|
|
293
|
+
|
|
254
294
|
// 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.
|
|
255
|
-
string relay_address =
|
|
295
|
+
string relay_address = 6;
|
|
256
296
|
|
|
257
297
|
// The root certificate of the Relay instance referred to in `relay_address`.
|
|
258
|
-
string relay_ca_pem =
|
|
298
|
+
string relay_ca_pem = 7;
|
|
259
299
|
|
|
260
300
|
// The self-signed certificate used by the volt to sign client certificates.
|
|
261
|
-
string ca_pem =
|
|
301
|
+
string ca_pem = 8;
|
|
262
302
|
|
|
263
303
|
// The Volt public key in PEM format.
|
|
264
|
-
string public_key =
|
|
304
|
+
string public_key = 9;
|
|
265
305
|
|
|
266
306
|
// The base58 fingerprint of the Volt public key.
|
|
267
|
-
string fingerprint =
|
|
307
|
+
string fingerprint = 10;
|
|
268
308
|
|
|
269
309
|
// The online status of the Volt.
|
|
270
|
-
OnlineStatus online_status =
|
|
310
|
+
OnlineStatus online_status = 11;
|
|
271
311
|
|
|
272
312
|
// Set to indicate that this Volt acts as a Relay.
|
|
273
|
-
bool has_relay =
|
|
313
|
+
bool has_relay = 12;
|
|
274
314
|
|
|
275
|
-
Version api_version =
|
|
315
|
+
Version api_version = 13;
|
|
316
|
+
|
|
317
|
+
string description = 14;
|
|
276
318
|
}
|
|
277
319
|
|
|
278
320
|
// Internal use only.
|
|
@@ -306,10 +348,11 @@ enum ServiceHostType {
|
|
|
306
348
|
|
|
307
349
|
// Describes a Volt service.
|
|
308
350
|
message ServiceDescription {
|
|
351
|
+
// The configuration used by the host of this service.
|
|
309
352
|
ServiceHostType host_type = 1;
|
|
310
353
|
|
|
311
354
|
// The identity of the client that is exposing the service.
|
|
312
|
-
// For example, if a third party is exposing a database service via a Volt, it will first
|
|
355
|
+
// 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).
|
|
313
356
|
// 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.
|
|
314
357
|
// This will be empty if the service is a built-in Volt service.
|
|
315
358
|
string host_client_id = 2;
|
|
@@ -334,6 +377,9 @@ message ServiceDescription {
|
|
|
334
377
|
// The connection id currently used to host this service.
|
|
335
378
|
string host_connection_id = 8;
|
|
336
379
|
|
|
380
|
+
// Internal use only.
|
|
381
|
+
string host_session_id = 9;
|
|
382
|
+
|
|
337
383
|
// The discovery mode.
|
|
338
384
|
DiscoveryMode discoverable = 10;
|
|
339
385
|
|
|
@@ -414,10 +460,10 @@ message Resource {
|
|
|
414
460
|
string owner = 101;
|
|
415
461
|
|
|
416
462
|
// Creation timestamp, milliseconds since epoch.
|
|
417
|
-
|
|
463
|
+
uint64 created = 105;
|
|
418
464
|
|
|
419
465
|
// Last modification timestamp, milliseconds since epoch.
|
|
420
|
-
|
|
466
|
+
uint64 modified = 106;
|
|
421
467
|
|
|
422
468
|
// Not in use.
|
|
423
469
|
ResourceStatus status = 108;
|
|
@@ -442,23 +488,19 @@ message Resource {
|
|
|
442
488
|
// 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 '-'.
|
|
443
489
|
repeated string alias = 115;
|
|
444
490
|
|
|
491
|
+
// The hash of the resource content contained in the store.
|
|
492
|
+
string content_hash = 116;
|
|
493
|
+
|
|
445
494
|
// Not yet supported.
|
|
446
495
|
repeated Resource child = 200;
|
|
447
496
|
}
|
|
448
497
|
|
|
449
|
-
enum IdentityType {
|
|
450
|
-
IDENTITY_TYPE_UNKNOWN = 0;
|
|
451
|
-
IDENTITY_TYPE_USER = 1;
|
|
452
|
-
IDENTITY_TYPE_AUTHORITY = 2;
|
|
453
|
-
IDENTITY_TYPE_GROUP = 3;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
498
|
message IdentityAlias {
|
|
457
499
|
// The alias id.
|
|
458
500
|
uint32 id = 1;
|
|
459
501
|
|
|
460
502
|
// The corresponding identity id.
|
|
461
|
-
string
|
|
503
|
+
string identity_did = 2;
|
|
462
504
|
|
|
463
505
|
// The actual alias, e.g. a common name or key fingerprint.
|
|
464
506
|
string alias = 3;
|
|
@@ -475,8 +517,8 @@ message IdentityAlias {
|
|
|
475
517
|
// The identity that issued this alias.
|
|
476
518
|
string issuer_id = 7;
|
|
477
519
|
|
|
478
|
-
// Indicates if this alias has an
|
|
479
|
-
PolicyDecision
|
|
520
|
+
// Indicates if this alias has an authenticate policy decision assigned.
|
|
521
|
+
PolicyDecision authenticate = 8;
|
|
480
522
|
|
|
481
523
|
// Optional description of this alias.
|
|
482
524
|
string description = 9;
|
|
@@ -489,68 +531,6 @@ message Identity {
|
|
|
489
531
|
repeated IdentityAlias alias = 2;
|
|
490
532
|
}
|
|
491
533
|
|
|
492
|
-
enum BindCredentialType {
|
|
493
|
-
BIND_CREDENTIAL_TYPE_UNKNOWN = 0;
|
|
494
|
-
BIND_CREDENTIAL_TYPE_OWNER = 1;
|
|
495
|
-
BIND_CREDENTIAL_TYPE_X509 = 2;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
message BindCredential {
|
|
499
|
-
BindCredentialType credential_type = 1;
|
|
500
|
-
string issuer_id = 2;
|
|
501
|
-
string issuer_name = 3;
|
|
502
|
-
string issuer_fingerprint = 4;
|
|
503
|
-
string issuer_public_key = 5;
|
|
504
|
-
PolicyDecision decision = 6;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
message Binding {
|
|
508
|
-
// The bind request public key fingerprint.
|
|
509
|
-
string fingerprint = 1;
|
|
510
|
-
|
|
511
|
-
// The bind request public key.
|
|
512
|
-
string public_key = 2;
|
|
513
|
-
|
|
514
|
-
// A human-readable short identifier of the binding.
|
|
515
|
-
string friendly_name = 3;
|
|
516
|
-
|
|
517
|
-
// The host name to add as a SAN to the issued certificate. See also `ip`.
|
|
518
|
-
string host = 4;
|
|
519
|
-
|
|
520
|
-
// The IP address to add as a SAN to the issued certificate as an alternative
|
|
521
|
-
// to `host`.
|
|
522
|
-
string ip = 5;
|
|
523
|
-
|
|
524
|
-
// Counter of number times a binding was requested.
|
|
525
|
-
uint32 request_count = 6;
|
|
526
|
-
|
|
527
|
-
int64 request_time = 7;
|
|
528
|
-
|
|
529
|
-
int64 decision_time = 8;
|
|
530
|
-
|
|
531
|
-
// The policy decision assigned to this binding.
|
|
532
|
-
PolicyDecision decision = 9;
|
|
533
|
-
|
|
534
|
-
// The identity id associated with this binding.
|
|
535
|
-
// Only valid if the bind request has been permitted.
|
|
536
|
-
string identity_id = 10;
|
|
537
|
-
|
|
538
|
-
string status = 11;
|
|
539
|
-
|
|
540
|
-
// All credentials supplied as part of bind request.
|
|
541
|
-
repeated BindCredential credential = 12;
|
|
542
|
-
|
|
543
|
-
// The chosen 'owner' credential.
|
|
544
|
-
BindCredential owner_credential = 14;
|
|
545
|
-
|
|
546
|
-
// Set if the bind request presented a valid challenge code.
|
|
547
|
-
bool volt_challenge = 15;
|
|
548
|
-
|
|
549
|
-
string did_document = 16;
|
|
550
|
-
|
|
551
|
-
string did_document_signature = 17;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
534
|
message Access {
|
|
555
535
|
string id = 1;
|
|
556
536
|
|
|
@@ -566,44 +546,48 @@ message Access {
|
|
|
566
546
|
// The kind of resource.
|
|
567
547
|
repeated string resource_kind = 5;
|
|
568
548
|
|
|
569
|
-
|
|
570
|
-
|
|
549
|
+
oneof subject {
|
|
550
|
+
// The identity attempting access.
|
|
551
|
+
string identity_did = 6;
|
|
552
|
+
|
|
553
|
+
// The JSON path array for looking up verifiable credentials.
|
|
554
|
+
string credential_lookup = 7;
|
|
555
|
+
}
|
|
571
556
|
|
|
572
557
|
// A human-readable short identifier of the subject.
|
|
573
|
-
string identity_name =
|
|
558
|
+
string identity_name = 8;
|
|
574
559
|
|
|
575
560
|
// The kind of identity.
|
|
576
|
-
repeated string identity_kind =
|
|
577
|
-
|
|
578
|
-
string issuer_id = 9;
|
|
579
|
-
|
|
580
|
-
string issuer_name = 10;
|
|
581
|
-
|
|
582
|
-
repeated string issuer_kind = 11;
|
|
561
|
+
repeated string identity_kind = 9;
|
|
583
562
|
|
|
584
563
|
// Requested access.
|
|
585
|
-
string access =
|
|
564
|
+
string access = 10;
|
|
565
|
+
|
|
566
|
+
// Optional extra data.
|
|
567
|
+
string extra = 11;
|
|
586
568
|
|
|
587
569
|
// Assigned decision.
|
|
588
|
-
PolicyDecision decision =
|
|
570
|
+
PolicyDecision decision = 12;
|
|
589
571
|
|
|
590
|
-
bool recursive =
|
|
572
|
+
bool recursive = 13;
|
|
591
573
|
|
|
592
574
|
// Time at which the request was made.
|
|
593
|
-
int64 request_time =
|
|
575
|
+
int64 request_time = 14;
|
|
594
576
|
|
|
595
577
|
// Time at which the decision was taken.
|
|
596
|
-
int64 decision_time =
|
|
578
|
+
int64 decision_time = 15;
|
|
597
579
|
|
|
598
580
|
// Counter of number times this access was requested.
|
|
599
|
-
uint32 request_count =
|
|
581
|
+
uint32 request_count = 16;
|
|
600
582
|
}
|
|
601
583
|
|
|
602
584
|
enum SessionStatus {
|
|
603
585
|
SESSION_STATUS_UNKNOWN = 0;
|
|
604
586
|
SESSION_STATUS_PENDING = 1;
|
|
605
|
-
|
|
606
|
-
|
|
587
|
+
SESSION_STATUS_LIVE = 2;
|
|
588
|
+
SESSION_STATUS_EXPIRED = 3;
|
|
589
|
+
SESSION_STATUS_REVOKED = 4;
|
|
590
|
+
SESSION_STATUS_REJECTED = 5;
|
|
607
591
|
}
|
|
608
592
|
|
|
609
593
|
message SessionCredential {
|
|
@@ -613,42 +597,65 @@ message SessionCredential {
|
|
|
613
597
|
// The corresponding session id.
|
|
614
598
|
string session_id = 2;
|
|
615
599
|
|
|
616
|
-
// The
|
|
617
|
-
string credential = 3;
|
|
618
|
-
|
|
619
|
-
// The credential type, for example public key, email, phone number etc.
|
|
600
|
+
// The credential type, for example public key, verifiable credential, challenge etc.
|
|
620
601
|
string credential_type = 4;
|
|
621
602
|
|
|
622
|
-
//
|
|
623
|
-
string
|
|
603
|
+
// Optional description of this credential.
|
|
604
|
+
string description = 5;
|
|
624
605
|
|
|
625
|
-
//
|
|
626
|
-
string
|
|
606
|
+
// The id of the verifiable credential, if the credential type is volt:vc-claim.
|
|
607
|
+
string vc_id = 6;
|
|
608
|
+
|
|
609
|
+
// The verifiable credential in JSON format, if the credential type is volt:vc-claim.
|
|
610
|
+
string vc_json = 7;
|
|
611
|
+
|
|
612
|
+
// The subject id extracted from the `vc_json` field.
|
|
613
|
+
string vc_subject_id = 8;
|
|
614
|
+
|
|
615
|
+
// The issuer id extracted from the `vc_json` field.
|
|
616
|
+
string vc_issuer_id = 9;
|
|
617
|
+
|
|
618
|
+
// The comma-separated type(s) extracted from the `vc_json` field.
|
|
619
|
+
string vc_type = 10;
|
|
620
|
+
|
|
621
|
+
// The challenge string, if the credential type is volt:challenge.
|
|
622
|
+
string challenge = 11;
|
|
623
|
+
|
|
624
|
+
// The key fingerprint, if the credential type is volt:public-key.
|
|
625
|
+
string key_fingerprint = 12;
|
|
626
|
+
|
|
627
|
+
// The PEM-encoded public key, if the credential type is volt:public-key.
|
|
628
|
+
string public_key = 13;
|
|
629
|
+
|
|
630
|
+
// 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.
|
|
631
|
+
string private_key = 14;
|
|
627
632
|
|
|
628
633
|
// Type-specific extra data stored with the credential.
|
|
629
|
-
string extra =
|
|
634
|
+
string extra = 15;
|
|
630
635
|
|
|
631
636
|
// More type-specific data stored with the credential.
|
|
632
|
-
string extra_2 =
|
|
637
|
+
string extra_2 = 16;
|
|
633
638
|
}
|
|
634
639
|
|
|
635
640
|
message Session {
|
|
636
641
|
string id = 1;
|
|
637
642
|
|
|
638
|
-
|
|
643
|
+
string identity_did = 2;
|
|
644
|
+
|
|
645
|
+
string identity_name = 3;
|
|
639
646
|
|
|
640
|
-
string
|
|
647
|
+
string ip = 4;
|
|
641
648
|
|
|
642
|
-
|
|
649
|
+
uint64 created = 5;
|
|
643
650
|
|
|
644
|
-
|
|
651
|
+
uint64 modified = 6;
|
|
645
652
|
|
|
646
|
-
|
|
653
|
+
uint64 expires = 7;
|
|
647
654
|
|
|
648
|
-
|
|
655
|
+
repeated SessionCredential credential = 8;
|
|
649
656
|
|
|
650
|
-
|
|
657
|
+
string origin = 9;
|
|
651
658
|
|
|
652
|
-
SessionStatus status =
|
|
659
|
+
SessionStatus status = 10;
|
|
653
660
|
}
|
|
654
661
|
|