@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
|
@@ -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;
|
|
166
|
-
|
|
167
|
-
// Optional challenge code that can be used aid in the process of verifying clients attempting to bind to the Volt.
|
|
168
|
-
string bind_challenge = 18;
|
|
173
|
+
// Optional challenge code that can be used aid in the process of authenticating clients.
|
|
174
|
+
string authenticate_challenge = 18;
|
|
169
175
|
|
|
170
|
-
// Indicates that clients must present the correct challenge code in order to be able to
|
|
171
|
-
bool
|
|
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,84 @@ 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;
|
|
239
276
|
}
|
|
240
277
|
|
|
241
278
|
message VoltEndpoint {
|
|
242
279
|
// The globally unique Volt id.
|
|
243
280
|
string id = 1;
|
|
244
281
|
|
|
245
|
-
// Optional owner credential, base 64 encoded.
|
|
246
|
-
string owner_credential = 2;
|
|
247
|
-
|
|
248
282
|
// Human-readable name of the Volt.
|
|
249
283
|
string display_name = 3;
|
|
250
284
|
|
|
251
285
|
// The actual host/ip the volt is physically running on (might be a local ip if behind firewall).
|
|
252
286
|
string local_address = 4;
|
|
253
287
|
|
|
288
|
+
// The address of the endpoint HTTP server.
|
|
289
|
+
string http_address = 5;
|
|
290
|
+
|
|
254
291
|
// 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 =
|
|
292
|
+
string relay_address = 6;
|
|
256
293
|
|
|
257
294
|
// The root certificate of the Relay instance referred to in `relay_address`.
|
|
258
|
-
string relay_ca_pem =
|
|
295
|
+
string relay_ca_pem = 7;
|
|
259
296
|
|
|
260
297
|
// The self-signed certificate used by the volt to sign client certificates.
|
|
261
|
-
string ca_pem =
|
|
298
|
+
string ca_pem = 8;
|
|
262
299
|
|
|
263
300
|
// The Volt public key in PEM format.
|
|
264
|
-
string public_key =
|
|
301
|
+
string public_key = 9;
|
|
265
302
|
|
|
266
303
|
// The base58 fingerprint of the Volt public key.
|
|
267
|
-
string fingerprint =
|
|
304
|
+
string fingerprint = 10;
|
|
268
305
|
|
|
269
306
|
// The online status of the Volt.
|
|
270
|
-
OnlineStatus online_status =
|
|
307
|
+
OnlineStatus online_status = 11;
|
|
271
308
|
|
|
272
309
|
// Set to indicate that this Volt acts as a Relay.
|
|
273
|
-
bool has_relay =
|
|
310
|
+
bool has_relay = 12;
|
|
311
|
+
|
|
312
|
+
Version api_version = 13;
|
|
274
313
|
|
|
275
|
-
|
|
314
|
+
string description = 14;
|
|
276
315
|
}
|
|
277
316
|
|
|
278
317
|
// Internal use only.
|
|
@@ -306,10 +345,11 @@ enum ServiceHostType {
|
|
|
306
345
|
|
|
307
346
|
// Describes a Volt service.
|
|
308
347
|
message ServiceDescription {
|
|
348
|
+
// The configuration used by the host of this service.
|
|
309
349
|
ServiceHostType host_type = 1;
|
|
310
350
|
|
|
311
351
|
// 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
|
|
352
|
+
// 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
353
|
// 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
354
|
// This will be empty if the service is a built-in Volt service.
|
|
315
355
|
string host_client_id = 2;
|
|
@@ -334,6 +374,9 @@ message ServiceDescription {
|
|
|
334
374
|
// The connection id currently used to host this service.
|
|
335
375
|
string host_connection_id = 8;
|
|
336
376
|
|
|
377
|
+
// Internal use only.
|
|
378
|
+
string host_session_id = 9;
|
|
379
|
+
|
|
337
380
|
// The discovery mode.
|
|
338
381
|
DiscoveryMode discoverable = 10;
|
|
339
382
|
|
|
@@ -414,10 +457,10 @@ message Resource {
|
|
|
414
457
|
string owner = 101;
|
|
415
458
|
|
|
416
459
|
// Creation timestamp, milliseconds since epoch.
|
|
417
|
-
|
|
460
|
+
uint64 created = 105;
|
|
418
461
|
|
|
419
462
|
// Last modification timestamp, milliseconds since epoch.
|
|
420
|
-
|
|
463
|
+
uint64 modified = 106;
|
|
421
464
|
|
|
422
465
|
// Not in use.
|
|
423
466
|
ResourceStatus status = 108;
|
|
@@ -442,23 +485,19 @@ message Resource {
|
|
|
442
485
|
// 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
486
|
repeated string alias = 115;
|
|
444
487
|
|
|
488
|
+
// The hash of the resource content contained in the store.
|
|
489
|
+
string content_hash = 116;
|
|
490
|
+
|
|
445
491
|
// Not yet supported.
|
|
446
492
|
repeated Resource child = 200;
|
|
447
493
|
}
|
|
448
494
|
|
|
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
495
|
message IdentityAlias {
|
|
457
496
|
// The alias id.
|
|
458
497
|
uint32 id = 1;
|
|
459
498
|
|
|
460
499
|
// The corresponding identity id.
|
|
461
|
-
string
|
|
500
|
+
string identity_did = 2;
|
|
462
501
|
|
|
463
502
|
// The actual alias, e.g. a common name or key fingerprint.
|
|
464
503
|
string alias = 3;
|
|
@@ -475,8 +514,8 @@ message IdentityAlias {
|
|
|
475
514
|
// The identity that issued this alias.
|
|
476
515
|
string issuer_id = 7;
|
|
477
516
|
|
|
478
|
-
// Indicates if this alias has an
|
|
479
|
-
PolicyDecision
|
|
517
|
+
// Indicates if this alias has an authenticate policy decision assigned.
|
|
518
|
+
PolicyDecision authenticate = 8;
|
|
480
519
|
|
|
481
520
|
// Optional description of this alias.
|
|
482
521
|
string description = 9;
|
|
@@ -489,68 +528,6 @@ message Identity {
|
|
|
489
528
|
repeated IdentityAlias alias = 2;
|
|
490
529
|
}
|
|
491
530
|
|
|
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
531
|
message Access {
|
|
555
532
|
string id = 1;
|
|
556
533
|
|
|
@@ -566,8 +543,13 @@ message Access {
|
|
|
566
543
|
// The kind of resource.
|
|
567
544
|
repeated string resource_kind = 5;
|
|
568
545
|
|
|
569
|
-
|
|
570
|
-
|
|
546
|
+
oneof subject {
|
|
547
|
+
// The identity attempting access.
|
|
548
|
+
string identity_did = 6;
|
|
549
|
+
|
|
550
|
+
// The JSON path array for looking up verifiable credentials.
|
|
551
|
+
string credential_lookup = 9;
|
|
552
|
+
}
|
|
571
553
|
|
|
572
554
|
// A human-readable short identifier of the subject.
|
|
573
555
|
string identity_name = 7;
|
|
@@ -575,35 +557,37 @@ message Access {
|
|
|
575
557
|
// The kind of identity.
|
|
576
558
|
repeated string identity_kind = 8;
|
|
577
559
|
|
|
578
|
-
string issuer_id =
|
|
560
|
+
string issuer_id = 10;
|
|
579
561
|
|
|
580
|
-
string issuer_name =
|
|
562
|
+
string issuer_name = 11;
|
|
581
563
|
|
|
582
|
-
repeated string issuer_kind =
|
|
564
|
+
repeated string issuer_kind = 12;
|
|
583
565
|
|
|
584
566
|
// Requested access.
|
|
585
|
-
string access =
|
|
567
|
+
string access = 13;
|
|
586
568
|
|
|
587
569
|
// Assigned decision.
|
|
588
|
-
PolicyDecision decision =
|
|
570
|
+
PolicyDecision decision = 14;
|
|
589
571
|
|
|
590
|
-
bool recursive =
|
|
572
|
+
bool recursive = 15;
|
|
591
573
|
|
|
592
574
|
// Time at which the request was made.
|
|
593
|
-
int64 request_time =
|
|
575
|
+
int64 request_time = 16;
|
|
594
576
|
|
|
595
577
|
// Time at which the decision was taken.
|
|
596
|
-
int64 decision_time =
|
|
578
|
+
int64 decision_time = 17;
|
|
597
579
|
|
|
598
580
|
// Counter of number times this access was requested.
|
|
599
|
-
uint32 request_count =
|
|
581
|
+
uint32 request_count = 18;
|
|
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
|
|