@tdxvolt/volt-client-grpc 0.19.9 → 0.20.1
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 +78 -20
- package/package.json +3 -3
- package/src/volt-client-internal.js +4 -10
- package/src/volt-client.js +4 -2
- package/src/volt-connection.js +2 -2
- package/src/volt-credential.js +2 -1
- package/src/volt-proto-literals.js +66 -5
package/lib/index.cjs
CHANGED
|
@@ -1158,6 +1158,9 @@ message UploadFileResponse {
|
|
|
1158
1158
|
|
|
1159
1159
|
// Reserved for internal use.
|
|
1160
1160
|
bool back_off = 2;
|
|
1161
|
+
|
|
1162
|
+
// Indicates the number of blocks that have been received.
|
|
1163
|
+
uint32 ack = 3;
|
|
1161
1164
|
}
|
|
1162
1165
|
|
|
1163
1166
|
`;
|
|
@@ -1452,6 +1455,9 @@ import "tdx/volt_api/volt/v1/status.proto";
|
|
|
1452
1455
|
import "tdx/volt_api/volt/v1/ssi.proto";
|
|
1453
1456
|
|
|
1454
1457
|
service SsiAPI {
|
|
1458
|
+
// Get a short-lived, one-time token that can be used to authenticate with the Volt and potentially create verifiable credential(s).
|
|
1459
|
+
rpc CreateExchangeToken(CreateExchangeTokenRequest) returns (CreateExchangeTokenResponse);
|
|
1460
|
+
|
|
1455
1461
|
// Delete a DID document or all DID documents originating from a given Volt.
|
|
1456
1462
|
// Requires \`volt:delete-did\` API privilege.
|
|
1457
1463
|
rpc DeleteDID(DeleteDIDRequest) returns (DeleteDIDResponse);
|
|
@@ -1481,6 +1487,22 @@ service SsiAPI {
|
|
|
1481
1487
|
rpc SearchDIDRegistry(SearchDIDRegistryRequest) returns (SearchDIDRegistryResponse);
|
|
1482
1488
|
}
|
|
1483
1489
|
|
|
1490
|
+
message CreateExchangeTokenRequest {
|
|
1491
|
+
// The VC template to use to create a verifiable credential.
|
|
1492
|
+
string vc_template = 1;
|
|
1493
|
+
|
|
1494
|
+
// The time to live for the token, in seconds.
|
|
1495
|
+
uint32 ttl = 2;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
message CreateExchangeTokenResponse {
|
|
1499
|
+
// Details of any error that occurred on the call.
|
|
1500
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
1501
|
+
|
|
1502
|
+
// The one-time token.
|
|
1503
|
+
string token = 2;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1484
1506
|
message DeleteDIDRequest {
|
|
1485
1507
|
// Specify an individual DID as the target of the delete operation, or a Volt to delete all DIDs owned by that Volt.
|
|
1486
1508
|
oneof target {
|
|
@@ -1709,6 +1731,9 @@ message SyncDocumentStart {
|
|
|
1709
1731
|
|
|
1710
1732
|
// Set to true to only receive updates from other clients.
|
|
1711
1733
|
bool read_only = 4;
|
|
1734
|
+
|
|
1735
|
+
// Set to true to downgrade to read-only access if the client does not have write access.
|
|
1736
|
+
bool read_only_fallback = 5;
|
|
1712
1737
|
}
|
|
1713
1738
|
|
|
1714
1739
|
message SyncDocumentUpdate {
|
|
@@ -1742,6 +1767,9 @@ message SyncDocumentResponse {
|
|
|
1742
1767
|
|
|
1743
1768
|
// The sync state of the Volt (remote) document
|
|
1744
1769
|
SyncState sync_state = 4;
|
|
1770
|
+
|
|
1771
|
+
// Set to true if the client is in read-only mode. Only present in the initial response.
|
|
1772
|
+
bool is_read_only = 5;
|
|
1745
1773
|
}
|
|
1746
1774
|
|
|
1747
1775
|
message GetDocumentJSONRequest {
|
|
@@ -1765,38 +1793,56 @@ package tdx.volt_api.volt.v1;
|
|
|
1765
1793
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
1766
1794
|
|
|
1767
1795
|
service TerminalAPI {
|
|
1796
|
+
// Bidirectional streaming RPC for real-time terminal control and data exchange.
|
|
1768
1797
|
rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
|
|
1769
1798
|
}
|
|
1770
1799
|
|
|
1771
1800
|
message TerminalSize {
|
|
1801
|
+
// The number of rows in the terminal.
|
|
1772
1802
|
int32 rows = 1;
|
|
1803
|
+
// The number of columns in the terminal.
|
|
1773
1804
|
int32 cols = 2;
|
|
1774
1805
|
}
|
|
1775
1806
|
|
|
1776
1807
|
message Control {
|
|
1808
|
+
// Optional command to execute on the terminal. If omitted, the default command is \`bash\` on linux and \`zsh\` on macos.
|
|
1777
1809
|
string command = 1;
|
|
1810
|
+
// Optional arguments to pass to the command.
|
|
1778
1811
|
repeated string arg = 2;
|
|
1812
|
+
// Not currently used.
|
|
1779
1813
|
string stop = 3;
|
|
1814
|
+
// Not currently used.
|
|
1780
1815
|
string pause = 4;
|
|
1816
|
+
// Not currently used.
|
|
1781
1817
|
string resume = 5;
|
|
1818
|
+
// Not currently used.
|
|
1782
1819
|
string reset = 6;
|
|
1820
|
+
// Optional terminal size to set.
|
|
1783
1821
|
TerminalSize terminal_size = 7;
|
|
1822
|
+
// If non-zero, a \`kill\` signal will be sent with this value to the running process.
|
|
1784
1823
|
int32 interrupt = 8;
|
|
1785
1824
|
}
|
|
1786
1825
|
|
|
1787
1826
|
message Input {
|
|
1827
|
+
// The data to send to the terminal.
|
|
1788
1828
|
bytes data = 1;
|
|
1789
1829
|
}
|
|
1790
1830
|
|
|
1831
|
+
// The request message must contain either a control message or an input message.
|
|
1791
1832
|
message CommandStreamRequest {
|
|
1792
1833
|
oneof payload {
|
|
1834
|
+
// Control messages can be used to configure and control the terminal.
|
|
1793
1835
|
Control control = 1;
|
|
1836
|
+
// Input messages are used to send data to the terminal.
|
|
1794
1837
|
Input input = 2;
|
|
1795
1838
|
}
|
|
1796
1839
|
}
|
|
1797
1840
|
|
|
1841
|
+
// The response message contains either a status message or stream of bytes.
|
|
1798
1842
|
message CommandStreamResponse {
|
|
1843
|
+
// Details of any error that occurred on the call.
|
|
1799
1844
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
1845
|
+
// Bytes received from the terminal.
|
|
1800
1846
|
bytes data = 2;
|
|
1801
1847
|
}
|
|
1802
1848
|
|
|
@@ -1973,10 +2019,10 @@ message VoltParameters {
|
|
|
1973
2019
|
// Indicates the Volt will be discoverable by clients using the discovery api.
|
|
1974
2020
|
bool discoverable = 16;
|
|
1975
2021
|
|
|
1976
|
-
// Optional challenge code that can be used aid in the process of authenticating clients.
|
|
2022
|
+
// DEPRECATED: Optional challenge code that can be used aid in the process of authenticating clients.
|
|
1977
2023
|
string authenticate_challenge = 18;
|
|
1978
2024
|
|
|
1979
|
-
// Indicates that clients must present the correct challenge code in order to be able to authenticate.
|
|
2025
|
+
// DEPRECATED: Indicates that clients must present the correct challenge code in order to be able to authenticate.
|
|
1980
2026
|
bool require_authenticate_challenge = 19;
|
|
1981
2027
|
|
|
1982
2028
|
// Internal use only.
|
|
@@ -2079,6 +2125,9 @@ message VoltParameters {
|
|
|
2079
2125
|
|
|
2080
2126
|
// The time at which the Volt was started.
|
|
2081
2127
|
uint64 start_time = 50;
|
|
2128
|
+
|
|
2129
|
+
// If set, enables the agent event pool.
|
|
2130
|
+
bool enable_agent_event_pool = 51;
|
|
2082
2131
|
}
|
|
2083
2132
|
|
|
2084
2133
|
message VoltEndpoint {
|
|
@@ -2530,7 +2579,7 @@ service VoltAPI {
|
|
|
2530
2579
|
// The identity will only be retrieved if the authenticated identity has read access to it.
|
|
2531
2580
|
rpc GetIdentity(GetIdentityRequest) returns (GetIdentityResponse);
|
|
2532
2581
|
|
|
2533
|
-
// Gets a one-time token that can be used as a temporary authentication token, for example create
|
|
2582
|
+
// Gets a one-time token that can be used as a temporary authentication token, for example to create a file download link that expires after a certain time.
|
|
2534
2583
|
rpc GetOneTimeToken(GetOneTimeTokenRequest) returns (GetOneTimeTokenResponse);
|
|
2535
2584
|
|
|
2536
2585
|
// Retrieve the Volt parameters.
|
|
@@ -2640,8 +2689,7 @@ message AuthenticateRequest {
|
|
|
2640
2689
|
// A human-readable name of the entity requesting to authenticate.
|
|
2641
2690
|
string client_name = 6;
|
|
2642
2691
|
|
|
2643
|
-
//
|
|
2644
|
-
// This is optional.
|
|
2692
|
+
// Optional challenge code, hashed using SHA-256 and base64 encoded.
|
|
2645
2693
|
string challenge = 7;
|
|
2646
2694
|
|
|
2647
2695
|
// The host name to add as a SAN to the issued certificate.
|
|
@@ -2656,6 +2704,9 @@ message AuthenticateRequest {
|
|
|
2656
2704
|
|
|
2657
2705
|
// Optional additional name to differentiate between multiple sessions for a given client.
|
|
2658
2706
|
string session_name = 11;
|
|
2707
|
+
|
|
2708
|
+
// Optional one-time token to exchange for a session.
|
|
2709
|
+
string exchange_token = 12;
|
|
2659
2710
|
}
|
|
2660
2711
|
|
|
2661
2712
|
message AuthenticateResponse {
|
|
@@ -2745,6 +2796,9 @@ message ConnectHello {
|
|
|
2745
2796
|
// Set to receive notification of resource events.
|
|
2746
2797
|
bool subscribe_resource_events = 4;
|
|
2747
2798
|
|
|
2799
|
+
// Optionally specify which resource events to subscribe to. Only valid if \`subscribe_resource_events\` is set. If omitted or empty, all resource events will be subscribed to.
|
|
2800
|
+
repeated ConnectResourceEvent resource_event_list = 17;
|
|
2801
|
+
|
|
2748
2802
|
// Set this if you are connecting to a relay, i.e. the Volt you are sending to this message is a relay.
|
|
2749
2803
|
// This indicates that you are happy to receive method invocations from clients of the Relay.
|
|
2750
2804
|
// This will usually be set to the \`id\` of your Volt, but in theory any client could receive remote invocation requests in this way.
|
|
@@ -2937,6 +2991,9 @@ message CopyResourceResponse {
|
|
|
2937
2991
|
message DeleteAccessRequest {
|
|
2938
2992
|
// The id of the access rule to delete.
|
|
2939
2993
|
string id = 1;
|
|
2994
|
+
|
|
2995
|
+
// Set to indicate all access rules for the resource should be deleted. The \`id\` field is ignored if this is set.
|
|
2996
|
+
string resource_id = 2;
|
|
2940
2997
|
}
|
|
2941
2998
|
|
|
2942
2999
|
message DeleteAccessResponse {
|
|
@@ -3370,9 +3427,13 @@ message ResourceAttributeQuery {
|
|
|
3370
3427
|
AttributeValue value = 3;
|
|
3371
3428
|
}
|
|
3372
3429
|
|
|
3430
|
+
// Specify one of \`access\` or \`access_list\`.
|
|
3373
3431
|
message SaveAccessRequest {
|
|
3374
3432
|
// Omit \`id\` if creating new access.
|
|
3375
3433
|
Access access = 1;
|
|
3434
|
+
|
|
3435
|
+
// Add multiple access rules in one request. The \`access\` field is ignored if this is non-empty.
|
|
3436
|
+
repeated Access access_list = 2;
|
|
3376
3437
|
}
|
|
3377
3438
|
|
|
3378
3439
|
message SaveAccessResponse {
|
|
@@ -4606,7 +4667,7 @@ function _doConnect(connectHello) {
|
|
|
4606
4667
|
this.call.on("data", (response) => {
|
|
4607
4668
|
switch (response.payload) {
|
|
4608
4669
|
case "ping": {
|
|
4609
|
-
log$3("
|
|
4670
|
+
log$3("received ping [%s]", this._voltClient.config.client_name);
|
|
4610
4671
|
|
|
4611
4672
|
// Received ping response from server => clear timeout.
|
|
4612
4673
|
if (this._pingTimeoutTimer) {
|
|
@@ -4678,7 +4739,7 @@ function _startPingTimer() {
|
|
|
4678
4739
|
// Send next ping to server.
|
|
4679
4740
|
const request = { ping: { timestamp: Date.now() } };
|
|
4680
4741
|
|
|
4681
|
-
log$3("
|
|
4742
|
+
log$3("sending ping [%s]", this._voltClient.config.client_name);
|
|
4682
4743
|
this.call.write(request);
|
|
4683
4744
|
|
|
4684
4745
|
this._pingTimer = 0;
|
|
@@ -4826,10 +4887,7 @@ function findDIDDocumentService(document, serviceType) {
|
|
|
4826
4887
|
return matches;
|
|
4827
4888
|
}
|
|
4828
4889
|
|
|
4829
|
-
async function authenticateInternal(
|
|
4830
|
-
sessionOnly = false,
|
|
4831
|
-
ownDID = false
|
|
4832
|
-
) {
|
|
4890
|
+
async function authenticateInternal(noDID = false, ownDID = false) {
|
|
4833
4891
|
try {
|
|
4834
4892
|
if (!this._credential.cache.ca) {
|
|
4835
4893
|
this._credential.cache.ca = this._voltConfig.ca_pem;
|
|
@@ -4861,17 +4919,14 @@ async function authenticateInternal(
|
|
|
4861
4919
|
};
|
|
4862
4920
|
|
|
4863
4921
|
if (this._credential.cache.challenge_code) {
|
|
4864
|
-
authenticateRequest.challenge =
|
|
4865
|
-
this._credential.cache.key,
|
|
4866
|
-
this._credential.cache.challenge_code
|
|
4867
|
-
);
|
|
4922
|
+
authenticateRequest.challenge = this._credential.cache.challenge_code;
|
|
4868
4923
|
} else {
|
|
4869
4924
|
log$2(
|
|
4870
|
-
"****
|
|
4925
|
+
"****challenge code NOT available**** => not sending challenge signature"
|
|
4871
4926
|
);
|
|
4872
4927
|
}
|
|
4873
4928
|
|
|
4874
|
-
if (
|
|
4929
|
+
if (noDID) {
|
|
4875
4930
|
// We want to create a session-based authentication based simply on our key, rather than a
|
|
4876
4931
|
// fully-blown DID-based authentication.
|
|
4877
4932
|
log$2("creating session-only request");
|
|
@@ -5530,7 +5585,8 @@ class VoltCredential {
|
|
|
5530
5585
|
}
|
|
5531
5586
|
|
|
5532
5587
|
saveCache() {
|
|
5533
|
-
|
|
5588
|
+
this._config = {...this._config, credential: { ...this._cryptoCache } };
|
|
5589
|
+
const clone = { ...this._config };
|
|
5534
5590
|
if (this._config.p) {
|
|
5535
5591
|
// A passphrase option exists => encrypt the key before writing the cache file.
|
|
5536
5592
|
const key = keyFromPem(this._cryptoCache.key);
|
|
@@ -5614,9 +5670,11 @@ class VoltClient extends EventEmitter__default["default"] {
|
|
|
5614
5670
|
* configuration from the config file.
|
|
5615
5671
|
* @param {boolean} [options.ownDID] - whether the Volt should manage the DID - set to
|
|
5616
5672
|
* true if you want to manage the DID yourself
|
|
5673
|
+
* @param {boolean} [options.noDID] - whether to create a key-based authentication session
|
|
5674
|
+
* instead of a DID-based authentication session.
|
|
5617
5675
|
*/
|
|
5618
5676
|
async initialise(config, options = {}) {
|
|
5619
|
-
const { ownDID, didRegistryList, extraConfig } = options;
|
|
5677
|
+
const { ownDID, noDID, didRegistryList, extraConfig } = options;
|
|
5620
5678
|
try {
|
|
5621
5679
|
if (!config) {
|
|
5622
5680
|
throw new Error(
|
|
@@ -5702,7 +5760,7 @@ class VoltClient extends EventEmitter__default["default"] {
|
|
|
5702
5760
|
} else {
|
|
5703
5761
|
// No certificate present in the cache yet => we need to authenticate.
|
|
5704
5762
|
try {
|
|
5705
|
-
isBound = await authenticateInternal.call(this,
|
|
5763
|
+
isBound = await authenticateInternal.call(this, noDID, ownDID);
|
|
5706
5764
|
} catch (bindErr) {
|
|
5707
5765
|
if (bindErr.message === "invalid arguments") {
|
|
5708
5766
|
// This is usually the result of a missing challenge signature or credential.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.20.1",
|
|
7
7
|
"description": "tdx Volt library for nodejs clients",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"author": "toby.ealden@gmail.com",
|
|
34
34
|
"license": "ISC",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tdxvolt/volt-client-web": "^0.
|
|
36
|
+
"@tdxvolt/volt-client-web": "^0.20.4",
|
|
37
37
|
"debug": "^4.1.1",
|
|
38
38
|
"ip": "^1.1.5",
|
|
39
39
|
"jsonwebtoken": "^8.5.1",
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
"protobufjs": "^7.4.0",
|
|
43
43
|
"uuid": "^8.1.0"
|
|
44
44
|
}
|
|
45
|
-
}
|
|
45
|
+
}
|
|
@@ -100,10 +100,7 @@ function findDIDDocumentService(document, serviceType) {
|
|
|
100
100
|
return matches;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export async function authenticateInternal(
|
|
104
|
-
sessionOnly = false,
|
|
105
|
-
ownDID = false
|
|
106
|
-
) {
|
|
103
|
+
export async function authenticateInternal(noDID = false, ownDID = false) {
|
|
107
104
|
try {
|
|
108
105
|
if (!this._credential.cache.ca) {
|
|
109
106
|
this._credential.cache.ca = this._voltConfig.ca_pem;
|
|
@@ -135,17 +132,14 @@ export async function authenticateInternal(
|
|
|
135
132
|
};
|
|
136
133
|
|
|
137
134
|
if (this._credential.cache.challenge_code) {
|
|
138
|
-
authenticateRequest.challenge =
|
|
139
|
-
this._credential.cache.key,
|
|
140
|
-
this._credential.cache.challenge_code
|
|
141
|
-
);
|
|
135
|
+
authenticateRequest.challenge = this._credential.cache.challenge_code;
|
|
142
136
|
} else {
|
|
143
137
|
log(
|
|
144
|
-
"****
|
|
138
|
+
"****challenge code NOT available**** => not sending challenge signature"
|
|
145
139
|
);
|
|
146
140
|
}
|
|
147
141
|
|
|
148
|
-
if (
|
|
142
|
+
if (noDID) {
|
|
149
143
|
// We want to create a session-based authentication based simply on our key, rather than a
|
|
150
144
|
// fully-blown DID-based authentication.
|
|
151
145
|
log("creating session-only request");
|
package/src/volt-client.js
CHANGED
|
@@ -82,9 +82,11 @@ export class VoltClient extends EventEmitter {
|
|
|
82
82
|
* configuration from the config file.
|
|
83
83
|
* @param {boolean} [options.ownDID] - whether the Volt should manage the DID - set to
|
|
84
84
|
* true if you want to manage the DID yourself
|
|
85
|
+
* @param {boolean} [options.noDID] - whether to create a key-based authentication session
|
|
86
|
+
* instead of a DID-based authentication session.
|
|
85
87
|
*/
|
|
86
88
|
async initialise(config, options = {}) {
|
|
87
|
-
const { ownDID, didRegistryList, extraConfig } = options;
|
|
89
|
+
const { ownDID, noDID, didRegistryList, extraConfig } = options;
|
|
88
90
|
try {
|
|
89
91
|
if (!config) {
|
|
90
92
|
throw new Error(
|
|
@@ -170,7 +172,7 @@ export class VoltClient extends EventEmitter {
|
|
|
170
172
|
} else {
|
|
171
173
|
// No certificate present in the cache yet => we need to authenticate.
|
|
172
174
|
try {
|
|
173
|
-
isBound = await authenticateInternal.call(this,
|
|
175
|
+
isBound = await authenticateInternal.call(this, noDID, ownDID);
|
|
174
176
|
} catch (bindErr) {
|
|
175
177
|
if (bindErr.message === "invalid arguments") {
|
|
176
178
|
// This is usually the result of a missing challenge signature or credential.
|
package/src/volt-connection.js
CHANGED
|
@@ -69,7 +69,7 @@ function _doConnect(connectHello) {
|
|
|
69
69
|
this.call.on("data", (response) => {
|
|
70
70
|
switch (response.payload) {
|
|
71
71
|
case "ping": {
|
|
72
|
-
log("
|
|
72
|
+
log("received ping [%s]", this._voltClient.config.client_name);
|
|
73
73
|
|
|
74
74
|
// Received ping response from server => clear timeout.
|
|
75
75
|
if (this._pingTimeoutTimer) {
|
|
@@ -141,7 +141,7 @@ function _startPingTimer() {
|
|
|
141
141
|
// Send next ping to server.
|
|
142
142
|
const request = { ping: { timestamp: Date.now() } };
|
|
143
143
|
|
|
144
|
-
log("
|
|
144
|
+
log("sending ping [%s]", this._voltClient.config.client_name);
|
|
145
145
|
this.call.write(request);
|
|
146
146
|
|
|
147
147
|
this._pingTimer = 0;
|
package/src/volt-credential.js
CHANGED
|
@@ -170,7 +170,8 @@ export class VoltCredential {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
saveCache() {
|
|
173
|
-
|
|
173
|
+
this._config = {...this._config, credential: { ...this._cryptoCache } };
|
|
174
|
+
const clone = { ...this._config };
|
|
174
175
|
if (this._config.p) {
|
|
175
176
|
// A passphrase option exists => encrypt the key before writing the cache file.
|
|
176
177
|
const key = keyFromPem(this._cryptoCache.key);
|
|
@@ -613,6 +613,9 @@ message UploadFileResponse {
|
|
|
613
613
|
|
|
614
614
|
// Reserved for internal use.
|
|
615
615
|
bool back_off = 2;
|
|
616
|
+
|
|
617
|
+
// Indicates the number of blocks that have been received.
|
|
618
|
+
uint32 ack = 3;
|
|
616
619
|
}
|
|
617
620
|
|
|
618
621
|
`;
|
|
@@ -907,6 +910,9 @@ import "tdx/volt_api/volt/v1/status.proto";
|
|
|
907
910
|
import "tdx/volt_api/volt/v1/ssi.proto";
|
|
908
911
|
|
|
909
912
|
service SsiAPI {
|
|
913
|
+
// Get a short-lived, one-time token that can be used to authenticate with the Volt and potentially create verifiable credential(s).
|
|
914
|
+
rpc CreateExchangeToken(CreateExchangeTokenRequest) returns (CreateExchangeTokenResponse);
|
|
915
|
+
|
|
910
916
|
// Delete a DID document or all DID documents originating from a given Volt.
|
|
911
917
|
// Requires \`volt:delete-did\` API privilege.
|
|
912
918
|
rpc DeleteDID(DeleteDIDRequest) returns (DeleteDIDResponse);
|
|
@@ -936,6 +942,22 @@ service SsiAPI {
|
|
|
936
942
|
rpc SearchDIDRegistry(SearchDIDRegistryRequest) returns (SearchDIDRegistryResponse);
|
|
937
943
|
}
|
|
938
944
|
|
|
945
|
+
message CreateExchangeTokenRequest {
|
|
946
|
+
// The VC template to use to create a verifiable credential.
|
|
947
|
+
string vc_template = 1;
|
|
948
|
+
|
|
949
|
+
// The time to live for the token, in seconds.
|
|
950
|
+
uint32 ttl = 2;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
message CreateExchangeTokenResponse {
|
|
954
|
+
// Details of any error that occurred on the call.
|
|
955
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
956
|
+
|
|
957
|
+
// The one-time token.
|
|
958
|
+
string token = 2;
|
|
959
|
+
}
|
|
960
|
+
|
|
939
961
|
message DeleteDIDRequest {
|
|
940
962
|
// Specify an individual DID as the target of the delete operation, or a Volt to delete all DIDs owned by that Volt.
|
|
941
963
|
oneof target {
|
|
@@ -1164,6 +1186,9 @@ message SyncDocumentStart {
|
|
|
1164
1186
|
|
|
1165
1187
|
// Set to true to only receive updates from other clients.
|
|
1166
1188
|
bool read_only = 4;
|
|
1189
|
+
|
|
1190
|
+
// Set to true to downgrade to read-only access if the client does not have write access.
|
|
1191
|
+
bool read_only_fallback = 5;
|
|
1167
1192
|
}
|
|
1168
1193
|
|
|
1169
1194
|
message SyncDocumentUpdate {
|
|
@@ -1197,6 +1222,9 @@ message SyncDocumentResponse {
|
|
|
1197
1222
|
|
|
1198
1223
|
// The sync state of the Volt (remote) document
|
|
1199
1224
|
SyncState sync_state = 4;
|
|
1225
|
+
|
|
1226
|
+
// Set to true if the client is in read-only mode. Only present in the initial response.
|
|
1227
|
+
bool is_read_only = 5;
|
|
1200
1228
|
}
|
|
1201
1229
|
|
|
1202
1230
|
message GetDocumentJSONRequest {
|
|
@@ -1220,38 +1248,56 @@ package tdx.volt_api.volt.v1;
|
|
|
1220
1248
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
1221
1249
|
|
|
1222
1250
|
service TerminalAPI {
|
|
1251
|
+
// Bidirectional streaming RPC for real-time terminal control and data exchange.
|
|
1223
1252
|
rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
|
|
1224
1253
|
}
|
|
1225
1254
|
|
|
1226
1255
|
message TerminalSize {
|
|
1256
|
+
// The number of rows in the terminal.
|
|
1227
1257
|
int32 rows = 1;
|
|
1258
|
+
// The number of columns in the terminal.
|
|
1228
1259
|
int32 cols = 2;
|
|
1229
1260
|
}
|
|
1230
1261
|
|
|
1231
1262
|
message Control {
|
|
1263
|
+
// Optional command to execute on the terminal. If omitted, the default command is \`bash\` on linux and \`zsh\` on macos.
|
|
1232
1264
|
string command = 1;
|
|
1265
|
+
// Optional arguments to pass to the command.
|
|
1233
1266
|
repeated string arg = 2;
|
|
1267
|
+
// Not currently used.
|
|
1234
1268
|
string stop = 3;
|
|
1269
|
+
// Not currently used.
|
|
1235
1270
|
string pause = 4;
|
|
1271
|
+
// Not currently used.
|
|
1236
1272
|
string resume = 5;
|
|
1273
|
+
// Not currently used.
|
|
1237
1274
|
string reset = 6;
|
|
1275
|
+
// Optional terminal size to set.
|
|
1238
1276
|
TerminalSize terminal_size = 7;
|
|
1277
|
+
// If non-zero, a \`kill\` signal will be sent with this value to the running process.
|
|
1239
1278
|
int32 interrupt = 8;
|
|
1240
1279
|
}
|
|
1241
1280
|
|
|
1242
1281
|
message Input {
|
|
1282
|
+
// The data to send to the terminal.
|
|
1243
1283
|
bytes data = 1;
|
|
1244
1284
|
}
|
|
1245
1285
|
|
|
1286
|
+
// The request message must contain either a control message or an input message.
|
|
1246
1287
|
message CommandStreamRequest {
|
|
1247
1288
|
oneof payload {
|
|
1289
|
+
// Control messages can be used to configure and control the terminal.
|
|
1248
1290
|
Control control = 1;
|
|
1291
|
+
// Input messages are used to send data to the terminal.
|
|
1249
1292
|
Input input = 2;
|
|
1250
1293
|
}
|
|
1251
1294
|
}
|
|
1252
1295
|
|
|
1296
|
+
// The response message contains either a status message or stream of bytes.
|
|
1253
1297
|
message CommandStreamResponse {
|
|
1298
|
+
// Details of any error that occurred on the call.
|
|
1254
1299
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
1300
|
+
// Bytes received from the terminal.
|
|
1255
1301
|
bytes data = 2;
|
|
1256
1302
|
}
|
|
1257
1303
|
|
|
@@ -1428,10 +1474,10 @@ message VoltParameters {
|
|
|
1428
1474
|
// Indicates the Volt will be discoverable by clients using the discovery api.
|
|
1429
1475
|
bool discoverable = 16;
|
|
1430
1476
|
|
|
1431
|
-
// Optional challenge code that can be used aid in the process of authenticating clients.
|
|
1477
|
+
// DEPRECATED: Optional challenge code that can be used aid in the process of authenticating clients.
|
|
1432
1478
|
string authenticate_challenge = 18;
|
|
1433
1479
|
|
|
1434
|
-
// Indicates that clients must present the correct challenge code in order to be able to authenticate.
|
|
1480
|
+
// DEPRECATED: Indicates that clients must present the correct challenge code in order to be able to authenticate.
|
|
1435
1481
|
bool require_authenticate_challenge = 19;
|
|
1436
1482
|
|
|
1437
1483
|
// Internal use only.
|
|
@@ -1534,6 +1580,9 @@ message VoltParameters {
|
|
|
1534
1580
|
|
|
1535
1581
|
// The time at which the Volt was started.
|
|
1536
1582
|
uint64 start_time = 50;
|
|
1583
|
+
|
|
1584
|
+
// If set, enables the agent event pool.
|
|
1585
|
+
bool enable_agent_event_pool = 51;
|
|
1537
1586
|
}
|
|
1538
1587
|
|
|
1539
1588
|
message VoltEndpoint {
|
|
@@ -1985,7 +2034,7 @@ service VoltAPI {
|
|
|
1985
2034
|
// The identity will only be retrieved if the authenticated identity has read access to it.
|
|
1986
2035
|
rpc GetIdentity(GetIdentityRequest) returns (GetIdentityResponse);
|
|
1987
2036
|
|
|
1988
|
-
// Gets a one-time token that can be used as a temporary authentication token, for example create
|
|
2037
|
+
// Gets a one-time token that can be used as a temporary authentication token, for example to create a file download link that expires after a certain time.
|
|
1989
2038
|
rpc GetOneTimeToken(GetOneTimeTokenRequest) returns (GetOneTimeTokenResponse);
|
|
1990
2039
|
|
|
1991
2040
|
// Retrieve the Volt parameters.
|
|
@@ -2095,8 +2144,7 @@ message AuthenticateRequest {
|
|
|
2095
2144
|
// A human-readable name of the entity requesting to authenticate.
|
|
2096
2145
|
string client_name = 6;
|
|
2097
2146
|
|
|
2098
|
-
//
|
|
2099
|
-
// This is optional.
|
|
2147
|
+
// Optional challenge code, hashed using SHA-256 and base64 encoded.
|
|
2100
2148
|
string challenge = 7;
|
|
2101
2149
|
|
|
2102
2150
|
// The host name to add as a SAN to the issued certificate.
|
|
@@ -2111,6 +2159,9 @@ message AuthenticateRequest {
|
|
|
2111
2159
|
|
|
2112
2160
|
// Optional additional name to differentiate between multiple sessions for a given client.
|
|
2113
2161
|
string session_name = 11;
|
|
2162
|
+
|
|
2163
|
+
// Optional one-time token to exchange for a session.
|
|
2164
|
+
string exchange_token = 12;
|
|
2114
2165
|
}
|
|
2115
2166
|
|
|
2116
2167
|
message AuthenticateResponse {
|
|
@@ -2200,6 +2251,9 @@ message ConnectHello {
|
|
|
2200
2251
|
// Set to receive notification of resource events.
|
|
2201
2252
|
bool subscribe_resource_events = 4;
|
|
2202
2253
|
|
|
2254
|
+
// Optionally specify which resource events to subscribe to. Only valid if \`subscribe_resource_events\` is set. If omitted or empty, all resource events will be subscribed to.
|
|
2255
|
+
repeated ConnectResourceEvent resource_event_list = 17;
|
|
2256
|
+
|
|
2203
2257
|
// Set this if you are connecting to a relay, i.e. the Volt you are sending to this message is a relay.
|
|
2204
2258
|
// This indicates that you are happy to receive method invocations from clients of the Relay.
|
|
2205
2259
|
// This will usually be set to the \`id\` of your Volt, but in theory any client could receive remote invocation requests in this way.
|
|
@@ -2392,6 +2446,9 @@ message CopyResourceResponse {
|
|
|
2392
2446
|
message DeleteAccessRequest {
|
|
2393
2447
|
// The id of the access rule to delete.
|
|
2394
2448
|
string id = 1;
|
|
2449
|
+
|
|
2450
|
+
// Set to indicate all access rules for the resource should be deleted. The \`id\` field is ignored if this is set.
|
|
2451
|
+
string resource_id = 2;
|
|
2395
2452
|
}
|
|
2396
2453
|
|
|
2397
2454
|
message DeleteAccessResponse {
|
|
@@ -2825,9 +2882,13 @@ message ResourceAttributeQuery {
|
|
|
2825
2882
|
AttributeValue value = 3;
|
|
2826
2883
|
}
|
|
2827
2884
|
|
|
2885
|
+
// Specify one of \`access\` or \`access_list\`.
|
|
2828
2886
|
message SaveAccessRequest {
|
|
2829
2887
|
// Omit \`id\` if creating new access.
|
|
2830
2888
|
Access access = 1;
|
|
2889
|
+
|
|
2890
|
+
// Add multiple access rules in one request. The \`access\` field is ignored if this is non-empty.
|
|
2891
|
+
repeated Access access_list = 2;
|
|
2831
2892
|
}
|
|
2832
2893
|
|
|
2833
2894
|
message SaveAccessResponse {
|