@tdxvolt/volt-client-grpc 0.20.20 → 0.20.27
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 +342 -23
- package/package.json +3 -3
- package/src/volt-client.js +12 -0
- package/src/volt-credential.js +5 -2
- package/src/volt-proto-literals.js +325 -21
package/lib/index.cjs
CHANGED
|
@@ -756,11 +756,14 @@ package tdx.volt_api.data.v1;
|
|
|
756
756
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
757
757
|
import "tdx/volt_api/volt/v1/volt.proto";
|
|
758
758
|
|
|
759
|
-
// The Sqlite Server API provides database management functions.
|
|
760
|
-
// Use the VoltAPI DeleteResource function to delete a database.
|
|
759
|
+
// The Sqlite Server API provides database and view management functions.
|
|
760
|
+
// Use the VoltAPI DeleteResource function to delete a database or data view.
|
|
761
761
|
service SqliteServerAPI {
|
|
762
762
|
// Create a new database resource.
|
|
763
763
|
rpc CreateDatabase(CreateDatabaseRequest) returns (CreateDatabaseResponse);
|
|
764
|
+
|
|
765
|
+
// Create or update a data view resource.
|
|
766
|
+
rpc SaveDataView(SaveDataViewRequest) returns (SaveDataViewResponse);
|
|
764
767
|
}
|
|
765
768
|
|
|
766
769
|
message CreateDatabaseRequest {
|
|
@@ -799,6 +802,55 @@ message CreateDatabaseResponse {
|
|
|
799
802
|
tdx.volt_api.volt.v1.Resource resource = 2;
|
|
800
803
|
}
|
|
801
804
|
|
|
805
|
+
message DataViewParameter {
|
|
806
|
+
// The parameter name referenced in the SQL template.
|
|
807
|
+
string name = 1;
|
|
808
|
+
|
|
809
|
+
// The parameter data type.
|
|
810
|
+
tdx.volt_api.volt.v1.AttributeDataType data_type = 2;
|
|
811
|
+
|
|
812
|
+
// Optional default value for the parameter.
|
|
813
|
+
tdx.volt_api.volt.v1.AttributeValue default_value = 3;
|
|
814
|
+
|
|
815
|
+
// Set when default_value should be applied.
|
|
816
|
+
bool include_default_value = 4;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
message SaveDataViewRequest {
|
|
820
|
+
// Details of the data view to save.
|
|
821
|
+
tdx.volt_api.volt.v1.Resource resource = 1;
|
|
822
|
+
|
|
823
|
+
// Set to indicate this is a new data view.
|
|
824
|
+
bool create = 2;
|
|
825
|
+
|
|
826
|
+
// The id of the folder resource in which a new data view should be created.
|
|
827
|
+
// If omitted, the home folder of the currently authenticated identity will be used.
|
|
828
|
+
string create_in_parent_id = 3;
|
|
829
|
+
|
|
830
|
+
// Set to indicate the resource attributes should be purged before saving the resource.
|
|
831
|
+
bool purge_attributes = 4;
|
|
832
|
+
|
|
833
|
+
// The id of the source database on which this view is based.
|
|
834
|
+
// The authenticated account must have the relevant access to the source database, for example to create a 'SELECT' view the account must have 'volt:database-read' access to the source database. To create an 'INSERT' view the account must have 'volt:database-write' access to the source database.
|
|
835
|
+
string source_database_id = 5;
|
|
836
|
+
|
|
837
|
+
// The SQL template for the view.
|
|
838
|
+
string sql = 6;
|
|
839
|
+
|
|
840
|
+
// Set to allow sub-selects in the view SQL.
|
|
841
|
+
bool allow_sub_select = 7;
|
|
842
|
+
|
|
843
|
+
// Parameters defined for the view SQL template.
|
|
844
|
+
repeated DataViewParameter parameter = 8;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
message SaveDataViewResponse {
|
|
848
|
+
// Details of any error that occurred on the call.
|
|
849
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
850
|
+
|
|
851
|
+
// The saved data view resource.
|
|
852
|
+
tdx.volt_api.volt.v1.Resource resource = 2;
|
|
853
|
+
}
|
|
802
854
|
`;
|
|
803
855
|
const proto_db_sync = `syntax = "proto3";
|
|
804
856
|
|
|
@@ -1570,6 +1622,13 @@ message ResolveDIDRequest {
|
|
|
1570
1622
|
|
|
1571
1623
|
// Set to search all known registries rather than just the local registry.
|
|
1572
1624
|
bool include_registries = 2;
|
|
1625
|
+
|
|
1626
|
+
// Per-DID document version. 0 = latest; 1..N = ordinal in the op log.
|
|
1627
|
+
uint64 version = 3;
|
|
1628
|
+
|
|
1629
|
+
// Milliseconds since epoch. Resolves the document active at that time.
|
|
1630
|
+
// Mutually exclusive with version.
|
|
1631
|
+
uint64 at_timestamp = 4;
|
|
1573
1632
|
}
|
|
1574
1633
|
|
|
1575
1634
|
message ResolveDIDResponse {
|
|
@@ -1708,6 +1767,18 @@ service SyncAPI {
|
|
|
1708
1767
|
|
|
1709
1768
|
// Write a single value to a given synapse JSON path.
|
|
1710
1769
|
rpc WriteSynapsePath(WriteSynapsePathRequest) returns (WriteSynapsePathResponse);
|
|
1770
|
+
|
|
1771
|
+
// List stored versions of a document in a sync database.
|
|
1772
|
+
rpc ListSyncDocumentVersions(ListSyncDocumentVersionsRequest) returns (ListSyncDocumentVersionsResponse);
|
|
1773
|
+
|
|
1774
|
+
// Get a stored version of a document in a sync database.
|
|
1775
|
+
rpc GetSyncDocumentVersion(GetSyncDocumentVersionRequest) returns (GetSyncDocumentVersionResponse);
|
|
1776
|
+
|
|
1777
|
+
// Create a version checkpoint for a document in a sync database.
|
|
1778
|
+
rpc CreateSyncDocumentVersion(CreateSyncDocumentVersionRequest) returns (CreateSyncDocumentVersionResponse);
|
|
1779
|
+
|
|
1780
|
+
// Revert a document in a sync database to a stored version.
|
|
1781
|
+
rpc RevertSyncDocumentVersion(RevertSyncDocumentVersionRequest) returns (RevertSyncDocumentVersionResponse);
|
|
1711
1782
|
}
|
|
1712
1783
|
|
|
1713
1784
|
message CreateSynapseConnectionRequest {
|
|
@@ -1821,8 +1892,8 @@ message SaveSyncDatabaseRequest {
|
|
|
1821
1892
|
// Set to audit all INSERT, UPDATE, and DELETE database operations.
|
|
1822
1893
|
bool write_audit = 7;
|
|
1823
1894
|
|
|
1824
|
-
// By default, yjs updates are periodically
|
|
1825
|
-
bool
|
|
1895
|
+
// By default, yjs updates are periodically compacted. Set this flag to disable compaction. This will reduce the size of the database but will remove the ability to version the documents in the database.
|
|
1896
|
+
bool no_compaction = 8;
|
|
1826
1897
|
|
|
1827
1898
|
// The number of updates to batch before flushing to the database. Defaults to 100.
|
|
1828
1899
|
uint32 batch_size = 9;
|
|
@@ -1859,8 +1930,8 @@ message SaveSynapseRequest {
|
|
|
1859
1930
|
// Set to audit all INSERT, UPDATE, and DELETE synapse operations.
|
|
1860
1931
|
bool write_audit = 7;
|
|
1861
1932
|
|
|
1862
|
-
// By default, yjs updates are periodically
|
|
1863
|
-
bool
|
|
1933
|
+
// By default, yjs updates are periodically compacted. Set this flag to disable compaction. This will reduce the size of the database but will remove the ability to version the documents in the database.
|
|
1934
|
+
bool no_compaction = 8;
|
|
1864
1935
|
}
|
|
1865
1936
|
|
|
1866
1937
|
message SaveSynapseResponse {
|
|
@@ -1897,6 +1968,14 @@ message SetSynapseDocumentMetadataRequest {
|
|
|
1897
1968
|
|
|
1898
1969
|
// Any additional application-specific JSON to attach to the document.
|
|
1899
1970
|
string json = 4;
|
|
1971
|
+
|
|
1972
|
+
// Set to true when the caller intends to write the document's content
|
|
1973
|
+
// separately, after this metadata call (a metadata-first create). The sync
|
|
1974
|
+
// server uses this to defer __hash bootstrapping until the content actually
|
|
1975
|
+
// arrives, so the hash is not computed over an empty document. Leave false
|
|
1976
|
+
// (the default) for empty documents or content-first flows where the content
|
|
1977
|
+
// is already present.
|
|
1978
|
+
bool content_pending = 6;
|
|
1900
1979
|
}
|
|
1901
1980
|
|
|
1902
1981
|
message SetSynapseDocumentMetadataResponse {
|
|
@@ -2052,6 +2131,83 @@ message WriteSynapsePathResponse {
|
|
|
2052
2131
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
2053
2132
|
}
|
|
2054
2133
|
|
|
2134
|
+
message SyncDocumentVersionSummary {
|
|
2135
|
+
// Globally unique version identifier (UUID).
|
|
2136
|
+
string version_id = 1;
|
|
2137
|
+
|
|
2138
|
+
// Milliseconds since Unix epoch when the version was created.
|
|
2139
|
+
uint64 timestamp = 2;
|
|
2140
|
+
|
|
2141
|
+
// Identity that created the version.
|
|
2142
|
+
string identity = 3;
|
|
2143
|
+
|
|
2144
|
+
// Optional user-provided label.
|
|
2145
|
+
string label = 4;
|
|
2146
|
+
|
|
2147
|
+
// Document hash (__hash) at the time of the version, when available.
|
|
2148
|
+
string document_hash = 5;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
message ListSyncDocumentVersionsRequest {
|
|
2152
|
+
// The id of the sync database that contains the document.
|
|
2153
|
+
string database_id = 1;
|
|
2154
|
+
|
|
2155
|
+
// The id of the document.
|
|
2156
|
+
string document_id = 2;
|
|
2157
|
+
|
|
2158
|
+
// Maximum number of versions to return. Defaults to 50.
|
|
2159
|
+
uint32 limit = 3;
|
|
2160
|
+
|
|
2161
|
+
// Number of versions to skip from the newest end.
|
|
2162
|
+
uint32 offset = 4;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
message ListSyncDocumentVersionsResponse {
|
|
2166
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
2167
|
+
repeated SyncDocumentVersionSummary versions = 2;
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
message GetSyncDocumentVersionRequest {
|
|
2171
|
+
string database_id = 1;
|
|
2172
|
+
string document_id = 2;
|
|
2173
|
+
string version_id = 3;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
message GetSyncDocumentVersionResponse {
|
|
2177
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
2178
|
+
SyncDocumentVersionSummary info = 2;
|
|
2179
|
+
|
|
2180
|
+
// Full Yjs v2 document state at this version. Clients materialize locally.
|
|
2181
|
+
bytes state_update = 3;
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
message CreateSyncDocumentVersionRequest {
|
|
2185
|
+
string database_id = 1;
|
|
2186
|
+
string document_id = 2;
|
|
2187
|
+
string label = 3;
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2190
|
+
message CreateSyncDocumentVersionResponse {
|
|
2191
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
2192
|
+
string version_id = 2;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
message RevertSyncDocumentVersionRequest {
|
|
2196
|
+
string database_id = 1;
|
|
2197
|
+
string document_id = 2;
|
|
2198
|
+
string version_id = 3;
|
|
2199
|
+
|
|
2200
|
+
// Optional label for the audit version created after revert.
|
|
2201
|
+
string label = 4;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
message RevertSyncDocumentVersionResponse {
|
|
2205
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
2206
|
+
|
|
2207
|
+
// Version id of the audit checkpoint created after revert.
|
|
2208
|
+
string version_id = 2;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2055
2211
|
`;
|
|
2056
2212
|
const terminal_api = `syntax = "proto3";
|
|
2057
2213
|
|
|
@@ -2061,6 +2217,7 @@ import "tdx/volt_api/volt/v1/status.proto";
|
|
|
2061
2217
|
|
|
2062
2218
|
service TerminalAPI {
|
|
2063
2219
|
// Bidirectional streaming RPC for real-time terminal control and data exchange.
|
|
2220
|
+
// Note that \`volt:command-invoke\` access is required to invoke this API. An optional allow-list of comma-separated commands can be specified in the \`extra\` string of the access policy.
|
|
2064
2221
|
rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
|
|
2065
2222
|
}
|
|
2066
2223
|
|
|
@@ -2237,6 +2394,15 @@ enum SecureMode {
|
|
|
2237
2394
|
SECURE_MODE_TLS = 2;
|
|
2238
2395
|
}
|
|
2239
2396
|
|
|
2397
|
+
// Per-method gRPC rate limit (unary: each RPC; client/bidi streams: first client message only).
|
|
2398
|
+
message GrpcRpcRateLimit {
|
|
2399
|
+
// Full gRPC method path, e.g. "/tdx.volt_api.volt.v1.VoltAPI/SendEmail"
|
|
2400
|
+
string method_full_name = 1;
|
|
2401
|
+
|
|
2402
|
+
// Maximum requests allowed per rolling 60-second window per identity. Zero disables this rule.
|
|
2403
|
+
uint32 max_requests_per_minute = 2;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2240
2406
|
// Encapsulates the various Volt parameters that are configurable by the Volt owner.
|
|
2241
2407
|
message VoltParameters {
|
|
2242
2408
|
string id = 1;
|
|
@@ -2412,6 +2578,9 @@ message VoltParameters {
|
|
|
2412
2578
|
// Number of gRPC event processing threads.
|
|
2413
2579
|
// If unset or zero, the server default thread count is used.
|
|
2414
2580
|
uint32 grpc_num_event_threads = 56;
|
|
2581
|
+
|
|
2582
|
+
// Optional per-method gRPC rate limits (see GrpcRpcRateLimit). Keyed by peer identity or fingerprint.
|
|
2583
|
+
repeated GrpcRpcRateLimit grpc_rpc_rate_limit = 57;
|
|
2415
2584
|
}
|
|
2416
2585
|
|
|
2417
2586
|
message VoltEndpoint {
|
|
@@ -2704,7 +2873,18 @@ message Access {
|
|
|
2704
2873
|
// Requested access.
|
|
2705
2874
|
string access = 10;
|
|
2706
2875
|
|
|
2707
|
-
// Optional extra data.
|
|
2876
|
+
// Optional extra data that further constrains the access being granted. How this string is interpreted depends on the value of \`access\` above:
|
|
2877
|
+
//
|
|
2878
|
+
// - \`volt:api-call\`: a single API method name. The access only applies when the invoked API method matches this value (policy attribute \`volt:action-api-call\`). Leave empty to allow all API methods.
|
|
2879
|
+
//
|
|
2880
|
+
// - \`volt:command-invoke\` (CommandStream API): a comma-separated allow-list of commands. The access is permitted (or denied depending on the rule decision) when the invoked command matches any entry in the list (policy attribute \`volt:action-command\`). A trailing \`*\` acts as a prefix wildcard (e.g. \`/usr/bin/*\` allows any command beginning with \`/usr/bin/\`). Leave empty to allow all commands.
|
|
2881
|
+
// Example: "ls,git,/usr/bin/python3"
|
|
2882
|
+
//
|
|
2883
|
+
// - Otherwise: a comma-separated list of \`[attributeId]|[value]\` pairs, each matched against the named resource attribute (trailing \`*\` acts as a prefix wildcard). The sync-database case below is a specialisation of this general form.
|
|
2884
|
+
//
|
|
2885
|
+
// - Sync databases (\`volt:sync-database\` resources, e.g. with \`volt:database-read\` / \`volt:database-write\` access): a comma-separated list of \`[attributeId]|[value]\` pairs restricting the access to specific documents. Document ids use the \`volt:resource-sync-document-id\` attribute id, so each entry has the form \`volt:resource-sync-document-id|[documentId]\`. A trailing \`*\` on the value acts as a prefix wildcard. Leave empty to target all documents in the database.
|
|
2886
|
+
// Example: "volt:resource-sync-document-id|doc-123,volt:resource-sync-document-id|report-*"
|
|
2887
|
+
//
|
|
2708
2888
|
string extra = 11;
|
|
2709
2889
|
|
|
2710
2890
|
// Assigned decision.
|
|
@@ -2802,6 +2982,27 @@ message Session {
|
|
|
2802
2982
|
|
|
2803
2983
|
SessionStatus status = 10;
|
|
2804
2984
|
}
|
|
2985
|
+
|
|
2986
|
+
message Email {
|
|
2987
|
+
// The email address to send to.
|
|
2988
|
+
repeated string to = 1;
|
|
2989
|
+
|
|
2990
|
+
// The email address to send cc to.
|
|
2991
|
+
repeated string cc = 2;
|
|
2992
|
+
|
|
2993
|
+
// The email address to send bcc to.
|
|
2994
|
+
repeated string bcc = 3;
|
|
2995
|
+
|
|
2996
|
+
// The subject of the email.
|
|
2997
|
+
string subject = 4;
|
|
2998
|
+
|
|
2999
|
+
// The body of the email.
|
|
3000
|
+
string body = 5;
|
|
3001
|
+
|
|
3002
|
+
// The email address to send from.
|
|
3003
|
+
string from = 6;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
2805
3006
|
`;
|
|
2806
3007
|
const volt_api = `syntax = "proto3";
|
|
2807
3008
|
|
|
@@ -2858,8 +3059,9 @@ service VoltAPI {
|
|
|
2858
3059
|
rpc DiscoverServices(DiscoverServicesRequest) returns (DiscoverServicesResponse);
|
|
2859
3060
|
|
|
2860
3061
|
// Get access rule details.
|
|
2861
|
-
// Only rules in which the authenticated identity participates will be retrieved, in addition to any rules that target a resource that is owned by the authenticated identity.
|
|
2862
3062
|
// If the authenticated identity is the Volt root, all rules will be retrieved that match the criteria.
|
|
3063
|
+
// All rules for which the authenticated account has volt:api-call / volt:get-access permission to the rule resource will be retrieved.
|
|
3064
|
+
// Otherwise, only rules in which the authenticated identity participates will be retrieved, in addition to any rules that target a resource that is owned by the authenticated identity.
|
|
2863
3065
|
rpc GetAccess(GetAccessRequest) returns (GetAccessResponse);
|
|
2864
3066
|
|
|
2865
3067
|
// Retrieve identities matching the given criteria.
|
|
@@ -2916,8 +3118,14 @@ service VoltAPI {
|
|
|
2916
3118
|
rpc SaveHttpFileServer(SaveHttpFileServerRequest) returns (SaveHttpFileServerResponse);
|
|
2917
3119
|
|
|
2918
3120
|
// Create or update an HTTP forwarder resource.
|
|
3121
|
+
// This is a privileged API call and requires volt:api-call / volt:save-http-forwarder permission.
|
|
2919
3122
|
rpc SaveHttpForwarder(SaveHttpForwarderRequest) returns (SaveHttpForwarderResponse);
|
|
2920
3123
|
|
|
3124
|
+
// Create or update an OAuth/OIDC client registration (used when this Volt
|
|
3125
|
+
// acts as an OpenID Provider). Clients are stored as \`volt:oidc-client\`
|
|
3126
|
+
// resources.
|
|
3127
|
+
rpc SaveOidcClient(SaveOidcClientRequest) returns (SaveOidcClientResponse);
|
|
3128
|
+
|
|
2921
3129
|
// Create or update an HTTP REST API server.
|
|
2922
3130
|
// This is a privileged API call and requires volt:api-call / volt:save-http-rest-api-server permission.
|
|
2923
3131
|
rpc SaveHttpRestApiServer(SaveHttpRestApiServerRequest) returns (SaveHttpRestApiServerResponse);
|
|
@@ -2950,6 +3158,10 @@ service VoltAPI {
|
|
|
2950
3158
|
// Requires \`volt:session-write\` permission. Authenticated sessions have this privilege by default.
|
|
2951
3159
|
rpc SaveSession(SaveSessionRequest) returns (SaveSessionResponse);
|
|
2952
3160
|
|
|
3161
|
+
// Send an email.
|
|
3162
|
+
// This is a privileged API call and requires volt:api-call / volt:send-email permission.
|
|
3163
|
+
rpc SendEmail(SendEmailRequest) returns (SendEmailResponse);
|
|
3164
|
+
|
|
2953
3165
|
// Set Volt access request decision.
|
|
2954
3166
|
// This is a privileged API call and requires volt:api-call / volt:set-access-request-decision permission.
|
|
2955
3167
|
rpc SetAccessRequestDecision(SetAccessRequestDecisionRequest) returns (SetAccessRequestDecisionResponse);
|
|
@@ -3065,6 +3277,10 @@ message CanAccessResourceRequest {
|
|
|
3065
3277
|
|
|
3066
3278
|
// The type of access that is required.
|
|
3067
3279
|
string access = 4;
|
|
3280
|
+
|
|
3281
|
+
// Optional additional information about the access request.
|
|
3282
|
+
// For volt:api-call, the extra data is the API method lookup, e.g. volt:get-access.
|
|
3283
|
+
string extra = 5;
|
|
3068
3284
|
}
|
|
3069
3285
|
|
|
3070
3286
|
message CanAccessResourceResponse {
|
|
@@ -3900,6 +4116,51 @@ message SaveHttpForwarderRequest {
|
|
|
3900
4116
|
string host = 6;
|
|
3901
4117
|
int32 port = 7;
|
|
3902
4118
|
bool forward_host = 8;
|
|
4119
|
+
|
|
4120
|
+
// Optional path prefix (e.g. "/myapp") for path-based forwarding. May be used
|
|
4121
|
+
// on its own (path forwarding on the Volt's own host) or together with
|
|
4122
|
+
// \`domain\` (sub-domain + path, e.g. sub.acme.com/myapp). At least one of
|
|
4123
|
+
// \`domain\` or \`path\` must be set.
|
|
4124
|
+
string path = 9;
|
|
4125
|
+
|
|
4126
|
+
// When a \`path\` prefix is configured, controls whether that prefix is removed
|
|
4127
|
+
// from the request path before forwarding (standard reverse-proxy behaviour).
|
|
4128
|
+
// Defaults to true when unset: the target then receives the request at its
|
|
4129
|
+
// own root (e.g. "/drive/assets/x.js" -> "/assets/x.js"), which suits plain
|
|
4130
|
+
// static file servers and root-mounted backends. Set to false for targets
|
|
4131
|
+
// that are themselves configured under the same sub-path and expect to
|
|
4132
|
+
// receive the prefix. The \`X-Forwarded-Prefix\` header is always sent.
|
|
4133
|
+
optional bool strip_path = 10;
|
|
4134
|
+
|
|
4135
|
+
// When true, incoming requests to this forwarder must carry a valid
|
|
4136
|
+
// authenticated session (established via the OIDC sign-in flow) and pass the
|
|
4137
|
+
// policy check before being proxied to the target. Unauthenticated requests
|
|
4138
|
+
// are redirected to the configured OpenID Provider. The session is never
|
|
4139
|
+
// exposed to the target (the session cookie is stripped before forwarding).
|
|
4140
|
+
bool auth_enabled = 11;
|
|
4141
|
+
|
|
4142
|
+
// OpenID Provider issuer URL used for discovery
|
|
4143
|
+
// (\`<issuer>/.well-known/openid-configuration\`). May be a Volt acting as an
|
|
4144
|
+
// OpenID Provider, or any external OIDC provider. Required when
|
|
4145
|
+
// \`auth_enabled\` is set.
|
|
4146
|
+
string oidc_issuer = 12;
|
|
4147
|
+
|
|
4148
|
+
// OAuth 2.0 client identifier registered with the OpenID Provider.
|
|
4149
|
+
string oidc_client_id = 13;
|
|
4150
|
+
|
|
4151
|
+
// OAuth 2.0 client secret. Stored encrypted and redacted on read.
|
|
4152
|
+
string oidc_client_secret = 14;
|
|
4153
|
+
|
|
4154
|
+
// Space separated OAuth scopes. Defaults to "openid email" when empty.
|
|
4155
|
+
string oidc_scopes = 15;
|
|
4156
|
+
|
|
4157
|
+
// Optional override for the reserved callback path on the app host. Defaults
|
|
4158
|
+
// to "/__volt-auth/oidc/callback".
|
|
4159
|
+
string oidc_redirect_path = 16;
|
|
4160
|
+
|
|
4161
|
+
// Email verification mode for OIDC-gated sign-in when the OpenID Provider is
|
|
4162
|
+
// a Volt: "link" (default) or "code".
|
|
4163
|
+
string email_verification_mode = 17;
|
|
3903
4164
|
}
|
|
3904
4165
|
|
|
3905
4166
|
message SaveHttpForwarderResponse {
|
|
@@ -3907,6 +4168,33 @@ message SaveHttpForwarderResponse {
|
|
|
3907
4168
|
Resource resource = 2;
|
|
3908
4169
|
}
|
|
3909
4170
|
|
|
4171
|
+
message SaveOidcClientRequest {
|
|
4172
|
+
Resource resource = 1;
|
|
4173
|
+
bool create = 2;
|
|
4174
|
+
string create_in_parent_id = 3;
|
|
4175
|
+
bool purge_attributes = 4;
|
|
4176
|
+
|
|
4177
|
+
// Human-friendly name for the client (also used as resource name when the
|
|
4178
|
+
// resource name is empty).
|
|
4179
|
+
string client_name = 5;
|
|
4180
|
+
|
|
4181
|
+
// OAuth 2.0 client_id. Required.
|
|
4182
|
+
string client_id = 6;
|
|
4183
|
+
|
|
4184
|
+
// OAuth 2.0 client_secret. Stored encrypted and redacted on read. Only
|
|
4185
|
+
// (re)written when non-empty so updates can omit it to keep the existing
|
|
4186
|
+
// secret.
|
|
4187
|
+
string client_secret = 7;
|
|
4188
|
+
|
|
4189
|
+
// Comma- or space-separated list of allowed redirect URIs.
|
|
4190
|
+
string redirect_uris = 8;
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
message SaveOidcClientResponse {
|
|
4194
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
4195
|
+
Resource resource = 2;
|
|
4196
|
+
}
|
|
4197
|
+
|
|
3910
4198
|
message SaveHttpFileServerRequest {
|
|
3911
4199
|
Resource resource = 1;
|
|
3912
4200
|
bool create = 2;
|
|
@@ -3919,6 +4207,7 @@ message SaveHttpFileServerRequest {
|
|
|
3919
4207
|
int32 cache_timeout = 9;
|
|
3920
4208
|
bool catch_all_enabled = 10;
|
|
3921
4209
|
string catch_all = 11;
|
|
4210
|
+
bool dynamic_index_enabled = 12;
|
|
3922
4211
|
}
|
|
3923
4212
|
|
|
3924
4213
|
message SaveHttpFileServerResponse {
|
|
@@ -3935,6 +4224,11 @@ message SaveHttpRestApiServerRequest {
|
|
|
3935
4224
|
int32 port = 6;
|
|
3936
4225
|
bool enabled = 7;
|
|
3937
4226
|
bool cors_enabled = 8;
|
|
4227
|
+
bool is_literal = 9;
|
|
4228
|
+
string literal_json = 10;
|
|
4229
|
+
string database_id = 11;
|
|
4230
|
+
string sql = 12;
|
|
4231
|
+
repeated string parameter = 13;
|
|
3938
4232
|
}
|
|
3939
4233
|
|
|
3940
4234
|
message SaveHttpRestApiServerResponse {
|
|
@@ -3970,6 +4264,29 @@ message SaveSessionResponse {
|
|
|
3970
4264
|
Session session = 2;
|
|
3971
4265
|
}
|
|
3972
4266
|
|
|
4267
|
+
message SendEmailRequest {
|
|
4268
|
+
// The email to send.
|
|
4269
|
+
Email email = 1;
|
|
4270
|
+
}
|
|
4271
|
+
|
|
4272
|
+
message SendEmailResponse {
|
|
4273
|
+
// Details of any error that occurred on the call.
|
|
4274
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
4275
|
+
}
|
|
4276
|
+
|
|
4277
|
+
message SetAccessRequestDecisionRequest {
|
|
4278
|
+
// The id of the access request.
|
|
4279
|
+
string id = 1;
|
|
4280
|
+
|
|
4281
|
+
// The decision to save against the access request.
|
|
4282
|
+
PolicyDecision decision = 2;
|
|
4283
|
+
}
|
|
4284
|
+
|
|
4285
|
+
message SetAccessRequestDecisionResponse {
|
|
4286
|
+
// Details of any error that occurred on the call.
|
|
4287
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
4288
|
+
}
|
|
4289
|
+
|
|
3973
4290
|
message SetPolicyRequest {
|
|
3974
4291
|
// The id of the policy to set.
|
|
3975
4292
|
// Should be either 00000000-0000-0000-0000-000000000000 or 00000000-0000-0000-0000-000000000001 for the first or last custom policy respectively.
|
|
@@ -3997,19 +4314,6 @@ message SetServiceStatusResponse {
|
|
|
3997
4314
|
Resource resource = 2;
|
|
3998
4315
|
}
|
|
3999
4316
|
|
|
4000
|
-
message SetAccessRequestDecisionRequest {
|
|
4001
|
-
// The id of the access request.
|
|
4002
|
-
string id = 1;
|
|
4003
|
-
|
|
4004
|
-
// The decision to save against the access request.
|
|
4005
|
-
PolicyDecision decision = 2;
|
|
4006
|
-
}
|
|
4007
|
-
|
|
4008
|
-
message SetAccessRequestDecisionResponse {
|
|
4009
|
-
// Details of any error that occurred on the call.
|
|
4010
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
4011
|
-
}
|
|
4012
|
-
|
|
4013
4317
|
// This message is emtpy.
|
|
4014
4318
|
message ShutdownRequest {
|
|
4015
4319
|
}
|
|
@@ -5762,7 +6066,10 @@ class VoltCredential {
|
|
|
5762
6066
|
if (!this._voltPublicKey) {
|
|
5763
6067
|
// Extract the public key from the Volt CA cert.
|
|
5764
6068
|
const voltCA = new crypto__default["default"].X509Certificate(this._voltConfig.ca_pem);
|
|
5765
|
-
this._voltPublicKey = voltCA.publicKey.export({
|
|
6069
|
+
this._voltPublicKey = voltCA.publicKey.export({
|
|
6070
|
+
type: "spki",
|
|
6071
|
+
format: "pem"
|
|
6072
|
+
});
|
|
5766
6073
|
}
|
|
5767
6074
|
|
|
5768
6075
|
const voltKey = keyFromPem(this._voltPublicKey).publicKey;
|
|
@@ -5874,7 +6181,7 @@ class VoltCredential {
|
|
|
5874
6181
|
}
|
|
5875
6182
|
|
|
5876
6183
|
saveCache() {
|
|
5877
|
-
this._config = {...this.
|
|
6184
|
+
this._config.credential = {...this._cryptoCache};
|
|
5878
6185
|
const clone = { ...this._config };
|
|
5879
6186
|
if (this._config.p) {
|
|
5880
6187
|
// A passphrase option exists => encrypt the key before writing the cache file.
|
|
@@ -6348,6 +6655,10 @@ class VoltClient extends EventEmitter__default["default"] {
|
|
|
6348
6655
|
return unaryCallInternal.call(this, "SaveSession", request);
|
|
6349
6656
|
}
|
|
6350
6657
|
|
|
6658
|
+
SendEmail(request) {
|
|
6659
|
+
return unaryCallInternal.call(this, "SendEmail", request);
|
|
6660
|
+
}
|
|
6661
|
+
|
|
6351
6662
|
SetAccessRequestDecision(request) {
|
|
6352
6663
|
return unaryCallInternal.call(this, "SetAccessRequestDecision", request);
|
|
6353
6664
|
}
|
|
@@ -6468,6 +6779,10 @@ class VoltClient extends EventEmitter__default["default"] {
|
|
|
6468
6779
|
return unaryCallInternal.call(this, "CreateDatabase", request);
|
|
6469
6780
|
}
|
|
6470
6781
|
|
|
6782
|
+
SaveDataView(request) {
|
|
6783
|
+
return unaryCallInternal.call(this, "SaveDataView", request);
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6471
6786
|
/**
|
|
6472
6787
|
* SqliteDatabaseAPI
|
|
6473
6788
|
*/
|
|
@@ -6577,6 +6892,10 @@ class VoltClient extends EventEmitter__default["default"] {
|
|
|
6577
6892
|
return publishCall.start(grpcClient, request);
|
|
6578
6893
|
}
|
|
6579
6894
|
|
|
6895
|
+
SaveWire(request) {
|
|
6896
|
+
return unaryCallInternal.call(this, "SaveWire", request);
|
|
6897
|
+
}
|
|
6898
|
+
|
|
6580
6899
|
SubscribeWire(request) {
|
|
6581
6900
|
const grpcClient = this.getVoltAPIClient();
|
|
6582
6901
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.20.
|
|
6
|
+
"version": "0.20.27",
|
|
7
7
|
"description": "tdx Volt library for nodejs clients",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"author": "toby.ealden@gmail.com",
|
|
34
34
|
"license": "ISC",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tdxvolt/volt-client-web": "^0.20.
|
|
37
|
-
"@tdxvolt/volt-utility": "^0.20.
|
|
36
|
+
"@tdxvolt/volt-client-web": "^0.20.27",
|
|
37
|
+
"@tdxvolt/volt-utility": "^0.20.27",
|
|
38
38
|
"debug": "^4.1.1",
|
|
39
39
|
"ip": "^1.1.5",
|
|
40
40
|
"jsonwebtoken": "^8.5.1",
|
package/src/volt-client.js
CHANGED
|
@@ -471,6 +471,10 @@ export class VoltClient extends EventEmitter {
|
|
|
471
471
|
return unaryCallInternal.call(this, "SaveSession", request);
|
|
472
472
|
}
|
|
473
473
|
|
|
474
|
+
SendEmail(request) {
|
|
475
|
+
return unaryCallInternal.call(this, "SendEmail", request);
|
|
476
|
+
}
|
|
477
|
+
|
|
474
478
|
SetAccessRequestDecision(request) {
|
|
475
479
|
return unaryCallInternal.call(this, "SetAccessRequestDecision", request);
|
|
476
480
|
}
|
|
@@ -593,6 +597,10 @@ export class VoltClient extends EventEmitter {
|
|
|
593
597
|
return unaryCallInternal.call(this, "CreateDatabase", request);
|
|
594
598
|
}
|
|
595
599
|
|
|
600
|
+
SaveDataView(request) {
|
|
601
|
+
return unaryCallInternal.call(this, "SaveDataView", request);
|
|
602
|
+
}
|
|
603
|
+
|
|
596
604
|
/**
|
|
597
605
|
* SqliteDatabaseAPI
|
|
598
606
|
*/
|
|
@@ -702,6 +710,10 @@ export class VoltClient extends EventEmitter {
|
|
|
702
710
|
return publishCall.start(grpcClient, request);
|
|
703
711
|
}
|
|
704
712
|
|
|
713
|
+
SaveWire(request) {
|
|
714
|
+
return unaryCallInternal.call(this, "SaveWire", request);
|
|
715
|
+
}
|
|
716
|
+
|
|
705
717
|
SubscribeWire(request) {
|
|
706
718
|
const grpcClient = this.getVoltAPIClient();
|
|
707
719
|
|
package/src/volt-credential.js
CHANGED
|
@@ -58,7 +58,10 @@ export class VoltCredential {
|
|
|
58
58
|
if (!this._voltPublicKey) {
|
|
59
59
|
// Extract the public key from the Volt CA cert.
|
|
60
60
|
const voltCA = new crypto.X509Certificate(this._voltConfig.ca_pem);
|
|
61
|
-
this._voltPublicKey = voltCA.publicKey.export({
|
|
61
|
+
this._voltPublicKey = voltCA.publicKey.export({
|
|
62
|
+
type: "spki",
|
|
63
|
+
format: "pem"
|
|
64
|
+
});
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
const voltKey = keyFromPem(this._voltPublicKey).publicKey;
|
|
@@ -170,7 +173,7 @@ export class VoltCredential {
|
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
saveCache() {
|
|
173
|
-
this._config = {...this.
|
|
176
|
+
this._config.credential = {...this._cryptoCache};
|
|
174
177
|
const clone = { ...this._config };
|
|
175
178
|
if (this._config.p) {
|
|
176
179
|
// A passphrase option exists => encrypt the key before writing the cache file.
|
|
@@ -208,11 +208,14 @@ package tdx.volt_api.data.v1;
|
|
|
208
208
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
209
209
|
import "tdx/volt_api/volt/v1/volt.proto";
|
|
210
210
|
|
|
211
|
-
// The Sqlite Server API provides database management functions.
|
|
212
|
-
// Use the VoltAPI DeleteResource function to delete a database.
|
|
211
|
+
// The Sqlite Server API provides database and view management functions.
|
|
212
|
+
// Use the VoltAPI DeleteResource function to delete a database or data view.
|
|
213
213
|
service SqliteServerAPI {
|
|
214
214
|
// Create a new database resource.
|
|
215
215
|
rpc CreateDatabase(CreateDatabaseRequest) returns (CreateDatabaseResponse);
|
|
216
|
+
|
|
217
|
+
// Create or update a data view resource.
|
|
218
|
+
rpc SaveDataView(SaveDataViewRequest) returns (SaveDataViewResponse);
|
|
216
219
|
}
|
|
217
220
|
|
|
218
221
|
message CreateDatabaseRequest {
|
|
@@ -251,6 +254,55 @@ message CreateDatabaseResponse {
|
|
|
251
254
|
tdx.volt_api.volt.v1.Resource resource = 2;
|
|
252
255
|
}
|
|
253
256
|
|
|
257
|
+
message DataViewParameter {
|
|
258
|
+
// The parameter name referenced in the SQL template.
|
|
259
|
+
string name = 1;
|
|
260
|
+
|
|
261
|
+
// The parameter data type.
|
|
262
|
+
tdx.volt_api.volt.v1.AttributeDataType data_type = 2;
|
|
263
|
+
|
|
264
|
+
// Optional default value for the parameter.
|
|
265
|
+
tdx.volt_api.volt.v1.AttributeValue default_value = 3;
|
|
266
|
+
|
|
267
|
+
// Set when default_value should be applied.
|
|
268
|
+
bool include_default_value = 4;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
message SaveDataViewRequest {
|
|
272
|
+
// Details of the data view to save.
|
|
273
|
+
tdx.volt_api.volt.v1.Resource resource = 1;
|
|
274
|
+
|
|
275
|
+
// Set to indicate this is a new data view.
|
|
276
|
+
bool create = 2;
|
|
277
|
+
|
|
278
|
+
// The id of the folder resource in which a new data view should be created.
|
|
279
|
+
// If omitted, the home folder of the currently authenticated identity will be used.
|
|
280
|
+
string create_in_parent_id = 3;
|
|
281
|
+
|
|
282
|
+
// Set to indicate the resource attributes should be purged before saving the resource.
|
|
283
|
+
bool purge_attributes = 4;
|
|
284
|
+
|
|
285
|
+
// The id of the source database on which this view is based.
|
|
286
|
+
// The authenticated account must have the relevant access to the source database, for example to create a 'SELECT' view the account must have 'volt:database-read' access to the source database. To create an 'INSERT' view the account must have 'volt:database-write' access to the source database.
|
|
287
|
+
string source_database_id = 5;
|
|
288
|
+
|
|
289
|
+
// The SQL template for the view.
|
|
290
|
+
string sql = 6;
|
|
291
|
+
|
|
292
|
+
// Set to allow sub-selects in the view SQL.
|
|
293
|
+
bool allow_sub_select = 7;
|
|
294
|
+
|
|
295
|
+
// Parameters defined for the view SQL template.
|
|
296
|
+
repeated DataViewParameter parameter = 8;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
message SaveDataViewResponse {
|
|
300
|
+
// Details of any error that occurred on the call.
|
|
301
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
302
|
+
|
|
303
|
+
// The saved data view resource.
|
|
304
|
+
tdx.volt_api.volt.v1.Resource resource = 2;
|
|
305
|
+
}
|
|
254
306
|
`;
|
|
255
307
|
export const proto_db_sync = `syntax = "proto3";
|
|
256
308
|
|
|
@@ -1022,6 +1074,13 @@ message ResolveDIDRequest {
|
|
|
1022
1074
|
|
|
1023
1075
|
// Set to search all known registries rather than just the local registry.
|
|
1024
1076
|
bool include_registries = 2;
|
|
1077
|
+
|
|
1078
|
+
// Per-DID document version. 0 = latest; 1..N = ordinal in the op log.
|
|
1079
|
+
uint64 version = 3;
|
|
1080
|
+
|
|
1081
|
+
// Milliseconds since epoch. Resolves the document active at that time.
|
|
1082
|
+
// Mutually exclusive with version.
|
|
1083
|
+
uint64 at_timestamp = 4;
|
|
1025
1084
|
}
|
|
1026
1085
|
|
|
1027
1086
|
message ResolveDIDResponse {
|
|
@@ -1160,6 +1219,18 @@ service SyncAPI {
|
|
|
1160
1219
|
|
|
1161
1220
|
// Write a single value to a given synapse JSON path.
|
|
1162
1221
|
rpc WriteSynapsePath(WriteSynapsePathRequest) returns (WriteSynapsePathResponse);
|
|
1222
|
+
|
|
1223
|
+
// List stored versions of a document in a sync database.
|
|
1224
|
+
rpc ListSyncDocumentVersions(ListSyncDocumentVersionsRequest) returns (ListSyncDocumentVersionsResponse);
|
|
1225
|
+
|
|
1226
|
+
// Get a stored version of a document in a sync database.
|
|
1227
|
+
rpc GetSyncDocumentVersion(GetSyncDocumentVersionRequest) returns (GetSyncDocumentVersionResponse);
|
|
1228
|
+
|
|
1229
|
+
// Create a version checkpoint for a document in a sync database.
|
|
1230
|
+
rpc CreateSyncDocumentVersion(CreateSyncDocumentVersionRequest) returns (CreateSyncDocumentVersionResponse);
|
|
1231
|
+
|
|
1232
|
+
// Revert a document in a sync database to a stored version.
|
|
1233
|
+
rpc RevertSyncDocumentVersion(RevertSyncDocumentVersionRequest) returns (RevertSyncDocumentVersionResponse);
|
|
1163
1234
|
}
|
|
1164
1235
|
|
|
1165
1236
|
message CreateSynapseConnectionRequest {
|
|
@@ -1273,8 +1344,8 @@ message SaveSyncDatabaseRequest {
|
|
|
1273
1344
|
// Set to audit all INSERT, UPDATE, and DELETE database operations.
|
|
1274
1345
|
bool write_audit = 7;
|
|
1275
1346
|
|
|
1276
|
-
// By default, yjs updates are periodically
|
|
1277
|
-
bool
|
|
1347
|
+
// By default, yjs updates are periodically compacted. Set this flag to disable compaction. This will reduce the size of the database but will remove the ability to version the documents in the database.
|
|
1348
|
+
bool no_compaction = 8;
|
|
1278
1349
|
|
|
1279
1350
|
// The number of updates to batch before flushing to the database. Defaults to 100.
|
|
1280
1351
|
uint32 batch_size = 9;
|
|
@@ -1311,8 +1382,8 @@ message SaveSynapseRequest {
|
|
|
1311
1382
|
// Set to audit all INSERT, UPDATE, and DELETE synapse operations.
|
|
1312
1383
|
bool write_audit = 7;
|
|
1313
1384
|
|
|
1314
|
-
// By default, yjs updates are periodically
|
|
1315
|
-
bool
|
|
1385
|
+
// By default, yjs updates are periodically compacted. Set this flag to disable compaction. This will reduce the size of the database but will remove the ability to version the documents in the database.
|
|
1386
|
+
bool no_compaction = 8;
|
|
1316
1387
|
}
|
|
1317
1388
|
|
|
1318
1389
|
message SaveSynapseResponse {
|
|
@@ -1349,6 +1420,14 @@ message SetSynapseDocumentMetadataRequest {
|
|
|
1349
1420
|
|
|
1350
1421
|
// Any additional application-specific JSON to attach to the document.
|
|
1351
1422
|
string json = 4;
|
|
1423
|
+
|
|
1424
|
+
// Set to true when the caller intends to write the document's content
|
|
1425
|
+
// separately, after this metadata call (a metadata-first create). The sync
|
|
1426
|
+
// server uses this to defer __hash bootstrapping until the content actually
|
|
1427
|
+
// arrives, so the hash is not computed over an empty document. Leave false
|
|
1428
|
+
// (the default) for empty documents or content-first flows where the content
|
|
1429
|
+
// is already present.
|
|
1430
|
+
bool content_pending = 6;
|
|
1352
1431
|
}
|
|
1353
1432
|
|
|
1354
1433
|
message SetSynapseDocumentMetadataResponse {
|
|
@@ -1504,6 +1583,83 @@ message WriteSynapsePathResponse {
|
|
|
1504
1583
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
1505
1584
|
}
|
|
1506
1585
|
|
|
1586
|
+
message SyncDocumentVersionSummary {
|
|
1587
|
+
// Globally unique version identifier (UUID).
|
|
1588
|
+
string version_id = 1;
|
|
1589
|
+
|
|
1590
|
+
// Milliseconds since Unix epoch when the version was created.
|
|
1591
|
+
uint64 timestamp = 2;
|
|
1592
|
+
|
|
1593
|
+
// Identity that created the version.
|
|
1594
|
+
string identity = 3;
|
|
1595
|
+
|
|
1596
|
+
// Optional user-provided label.
|
|
1597
|
+
string label = 4;
|
|
1598
|
+
|
|
1599
|
+
// Document hash (__hash) at the time of the version, when available.
|
|
1600
|
+
string document_hash = 5;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
message ListSyncDocumentVersionsRequest {
|
|
1604
|
+
// The id of the sync database that contains the document.
|
|
1605
|
+
string database_id = 1;
|
|
1606
|
+
|
|
1607
|
+
// The id of the document.
|
|
1608
|
+
string document_id = 2;
|
|
1609
|
+
|
|
1610
|
+
// Maximum number of versions to return. Defaults to 50.
|
|
1611
|
+
uint32 limit = 3;
|
|
1612
|
+
|
|
1613
|
+
// Number of versions to skip from the newest end.
|
|
1614
|
+
uint32 offset = 4;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
message ListSyncDocumentVersionsResponse {
|
|
1618
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
1619
|
+
repeated SyncDocumentVersionSummary versions = 2;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
message GetSyncDocumentVersionRequest {
|
|
1623
|
+
string database_id = 1;
|
|
1624
|
+
string document_id = 2;
|
|
1625
|
+
string version_id = 3;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
message GetSyncDocumentVersionResponse {
|
|
1629
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
1630
|
+
SyncDocumentVersionSummary info = 2;
|
|
1631
|
+
|
|
1632
|
+
// Full Yjs v2 document state at this version. Clients materialize locally.
|
|
1633
|
+
bytes state_update = 3;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
message CreateSyncDocumentVersionRequest {
|
|
1637
|
+
string database_id = 1;
|
|
1638
|
+
string document_id = 2;
|
|
1639
|
+
string label = 3;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
message CreateSyncDocumentVersionResponse {
|
|
1643
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
1644
|
+
string version_id = 2;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
message RevertSyncDocumentVersionRequest {
|
|
1648
|
+
string database_id = 1;
|
|
1649
|
+
string document_id = 2;
|
|
1650
|
+
string version_id = 3;
|
|
1651
|
+
|
|
1652
|
+
// Optional label for the audit version created after revert.
|
|
1653
|
+
string label = 4;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
message RevertSyncDocumentVersionResponse {
|
|
1657
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
1658
|
+
|
|
1659
|
+
// Version id of the audit checkpoint created after revert.
|
|
1660
|
+
string version_id = 2;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1507
1663
|
`;
|
|
1508
1664
|
export const terminal_api = `syntax = "proto3";
|
|
1509
1665
|
|
|
@@ -1513,6 +1669,7 @@ import "tdx/volt_api/volt/v1/status.proto";
|
|
|
1513
1669
|
|
|
1514
1670
|
service TerminalAPI {
|
|
1515
1671
|
// Bidirectional streaming RPC for real-time terminal control and data exchange.
|
|
1672
|
+
// Note that \`volt:command-invoke\` access is required to invoke this API. An optional allow-list of comma-separated commands can be specified in the \`extra\` string of the access policy.
|
|
1516
1673
|
rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
|
|
1517
1674
|
}
|
|
1518
1675
|
|
|
@@ -1689,6 +1846,15 @@ enum SecureMode {
|
|
|
1689
1846
|
SECURE_MODE_TLS = 2;
|
|
1690
1847
|
}
|
|
1691
1848
|
|
|
1849
|
+
// Per-method gRPC rate limit (unary: each RPC; client/bidi streams: first client message only).
|
|
1850
|
+
message GrpcRpcRateLimit {
|
|
1851
|
+
// Full gRPC method path, e.g. "/tdx.volt_api.volt.v1.VoltAPI/SendEmail"
|
|
1852
|
+
string method_full_name = 1;
|
|
1853
|
+
|
|
1854
|
+
// Maximum requests allowed per rolling 60-second window per identity. Zero disables this rule.
|
|
1855
|
+
uint32 max_requests_per_minute = 2;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1692
1858
|
// Encapsulates the various Volt parameters that are configurable by the Volt owner.
|
|
1693
1859
|
message VoltParameters {
|
|
1694
1860
|
string id = 1;
|
|
@@ -1864,6 +2030,9 @@ message VoltParameters {
|
|
|
1864
2030
|
// Number of gRPC event processing threads.
|
|
1865
2031
|
// If unset or zero, the server default thread count is used.
|
|
1866
2032
|
uint32 grpc_num_event_threads = 56;
|
|
2033
|
+
|
|
2034
|
+
// Optional per-method gRPC rate limits (see GrpcRpcRateLimit). Keyed by peer identity or fingerprint.
|
|
2035
|
+
repeated GrpcRpcRateLimit grpc_rpc_rate_limit = 57;
|
|
1867
2036
|
}
|
|
1868
2037
|
|
|
1869
2038
|
message VoltEndpoint {
|
|
@@ -2156,7 +2325,18 @@ message Access {
|
|
|
2156
2325
|
// Requested access.
|
|
2157
2326
|
string access = 10;
|
|
2158
2327
|
|
|
2159
|
-
// Optional extra data.
|
|
2328
|
+
// Optional extra data that further constrains the access being granted. How this string is interpreted depends on the value of \`access\` above:
|
|
2329
|
+
//
|
|
2330
|
+
// - \`volt:api-call\`: a single API method name. The access only applies when the invoked API method matches this value (policy attribute \`volt:action-api-call\`). Leave empty to allow all API methods.
|
|
2331
|
+
//
|
|
2332
|
+
// - \`volt:command-invoke\` (CommandStream API): a comma-separated allow-list of commands. The access is permitted (or denied depending on the rule decision) when the invoked command matches any entry in the list (policy attribute \`volt:action-command\`). A trailing \`*\` acts as a prefix wildcard (e.g. \`/usr/bin/*\` allows any command beginning with \`/usr/bin/\`). Leave empty to allow all commands.
|
|
2333
|
+
// Example: "ls,git,/usr/bin/python3"
|
|
2334
|
+
//
|
|
2335
|
+
// - Otherwise: a comma-separated list of \`[attributeId]|[value]\` pairs, each matched against the named resource attribute (trailing \`*\` acts as a prefix wildcard). The sync-database case below is a specialisation of this general form.
|
|
2336
|
+
//
|
|
2337
|
+
// - Sync databases (\`volt:sync-database\` resources, e.g. with \`volt:database-read\` / \`volt:database-write\` access): a comma-separated list of \`[attributeId]|[value]\` pairs restricting the access to specific documents. Document ids use the \`volt:resource-sync-document-id\` attribute id, so each entry has the form \`volt:resource-sync-document-id|[documentId]\`. A trailing \`*\` on the value acts as a prefix wildcard. Leave empty to target all documents in the database.
|
|
2338
|
+
// Example: "volt:resource-sync-document-id|doc-123,volt:resource-sync-document-id|report-*"
|
|
2339
|
+
//
|
|
2160
2340
|
string extra = 11;
|
|
2161
2341
|
|
|
2162
2342
|
// Assigned decision.
|
|
@@ -2254,6 +2434,27 @@ message Session {
|
|
|
2254
2434
|
|
|
2255
2435
|
SessionStatus status = 10;
|
|
2256
2436
|
}
|
|
2437
|
+
|
|
2438
|
+
message Email {
|
|
2439
|
+
// The email address to send to.
|
|
2440
|
+
repeated string to = 1;
|
|
2441
|
+
|
|
2442
|
+
// The email address to send cc to.
|
|
2443
|
+
repeated string cc = 2;
|
|
2444
|
+
|
|
2445
|
+
// The email address to send bcc to.
|
|
2446
|
+
repeated string bcc = 3;
|
|
2447
|
+
|
|
2448
|
+
// The subject of the email.
|
|
2449
|
+
string subject = 4;
|
|
2450
|
+
|
|
2451
|
+
// The body of the email.
|
|
2452
|
+
string body = 5;
|
|
2453
|
+
|
|
2454
|
+
// The email address to send from.
|
|
2455
|
+
string from = 6;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2257
2458
|
`;
|
|
2258
2459
|
export const volt_api = `syntax = "proto3";
|
|
2259
2460
|
|
|
@@ -2310,8 +2511,9 @@ service VoltAPI {
|
|
|
2310
2511
|
rpc DiscoverServices(DiscoverServicesRequest) returns (DiscoverServicesResponse);
|
|
2311
2512
|
|
|
2312
2513
|
// Get access rule details.
|
|
2313
|
-
// Only rules in which the authenticated identity participates will be retrieved, in addition to any rules that target a resource that is owned by the authenticated identity.
|
|
2314
2514
|
// If the authenticated identity is the Volt root, all rules will be retrieved that match the criteria.
|
|
2515
|
+
// All rules for which the authenticated account has volt:api-call / volt:get-access permission to the rule resource will be retrieved.
|
|
2516
|
+
// Otherwise, only rules in which the authenticated identity participates will be retrieved, in addition to any rules that target a resource that is owned by the authenticated identity.
|
|
2315
2517
|
rpc GetAccess(GetAccessRequest) returns (GetAccessResponse);
|
|
2316
2518
|
|
|
2317
2519
|
// Retrieve identities matching the given criteria.
|
|
@@ -2368,8 +2570,14 @@ service VoltAPI {
|
|
|
2368
2570
|
rpc SaveHttpFileServer(SaveHttpFileServerRequest) returns (SaveHttpFileServerResponse);
|
|
2369
2571
|
|
|
2370
2572
|
// Create or update an HTTP forwarder resource.
|
|
2573
|
+
// This is a privileged API call and requires volt:api-call / volt:save-http-forwarder permission.
|
|
2371
2574
|
rpc SaveHttpForwarder(SaveHttpForwarderRequest) returns (SaveHttpForwarderResponse);
|
|
2372
2575
|
|
|
2576
|
+
// Create or update an OAuth/OIDC client registration (used when this Volt
|
|
2577
|
+
// acts as an OpenID Provider). Clients are stored as \`volt:oidc-client\`
|
|
2578
|
+
// resources.
|
|
2579
|
+
rpc SaveOidcClient(SaveOidcClientRequest) returns (SaveOidcClientResponse);
|
|
2580
|
+
|
|
2373
2581
|
// Create or update an HTTP REST API server.
|
|
2374
2582
|
// This is a privileged API call and requires volt:api-call / volt:save-http-rest-api-server permission.
|
|
2375
2583
|
rpc SaveHttpRestApiServer(SaveHttpRestApiServerRequest) returns (SaveHttpRestApiServerResponse);
|
|
@@ -2402,6 +2610,10 @@ service VoltAPI {
|
|
|
2402
2610
|
// Requires \`volt:session-write\` permission. Authenticated sessions have this privilege by default.
|
|
2403
2611
|
rpc SaveSession(SaveSessionRequest) returns (SaveSessionResponse);
|
|
2404
2612
|
|
|
2613
|
+
// Send an email.
|
|
2614
|
+
// This is a privileged API call and requires volt:api-call / volt:send-email permission.
|
|
2615
|
+
rpc SendEmail(SendEmailRequest) returns (SendEmailResponse);
|
|
2616
|
+
|
|
2405
2617
|
// Set Volt access request decision.
|
|
2406
2618
|
// This is a privileged API call and requires volt:api-call / volt:set-access-request-decision permission.
|
|
2407
2619
|
rpc SetAccessRequestDecision(SetAccessRequestDecisionRequest) returns (SetAccessRequestDecisionResponse);
|
|
@@ -2517,6 +2729,10 @@ message CanAccessResourceRequest {
|
|
|
2517
2729
|
|
|
2518
2730
|
// The type of access that is required.
|
|
2519
2731
|
string access = 4;
|
|
2732
|
+
|
|
2733
|
+
// Optional additional information about the access request.
|
|
2734
|
+
// For volt:api-call, the extra data is the API method lookup, e.g. volt:get-access.
|
|
2735
|
+
string extra = 5;
|
|
2520
2736
|
}
|
|
2521
2737
|
|
|
2522
2738
|
message CanAccessResourceResponse {
|
|
@@ -3352,6 +3568,51 @@ message SaveHttpForwarderRequest {
|
|
|
3352
3568
|
string host = 6;
|
|
3353
3569
|
int32 port = 7;
|
|
3354
3570
|
bool forward_host = 8;
|
|
3571
|
+
|
|
3572
|
+
// Optional path prefix (e.g. "/myapp") for path-based forwarding. May be used
|
|
3573
|
+
// on its own (path forwarding on the Volt's own host) or together with
|
|
3574
|
+
// \`domain\` (sub-domain + path, e.g. sub.acme.com/myapp). At least one of
|
|
3575
|
+
// \`domain\` or \`path\` must be set.
|
|
3576
|
+
string path = 9;
|
|
3577
|
+
|
|
3578
|
+
// When a \`path\` prefix is configured, controls whether that prefix is removed
|
|
3579
|
+
// from the request path before forwarding (standard reverse-proxy behaviour).
|
|
3580
|
+
// Defaults to true when unset: the target then receives the request at its
|
|
3581
|
+
// own root (e.g. "/drive/assets/x.js" -> "/assets/x.js"), which suits plain
|
|
3582
|
+
// static file servers and root-mounted backends. Set to false for targets
|
|
3583
|
+
// that are themselves configured under the same sub-path and expect to
|
|
3584
|
+
// receive the prefix. The \`X-Forwarded-Prefix\` header is always sent.
|
|
3585
|
+
optional bool strip_path = 10;
|
|
3586
|
+
|
|
3587
|
+
// When true, incoming requests to this forwarder must carry a valid
|
|
3588
|
+
// authenticated session (established via the OIDC sign-in flow) and pass the
|
|
3589
|
+
// policy check before being proxied to the target. Unauthenticated requests
|
|
3590
|
+
// are redirected to the configured OpenID Provider. The session is never
|
|
3591
|
+
// exposed to the target (the session cookie is stripped before forwarding).
|
|
3592
|
+
bool auth_enabled = 11;
|
|
3593
|
+
|
|
3594
|
+
// OpenID Provider issuer URL used for discovery
|
|
3595
|
+
// (\`<issuer>/.well-known/openid-configuration\`). May be a Volt acting as an
|
|
3596
|
+
// OpenID Provider, or any external OIDC provider. Required when
|
|
3597
|
+
// \`auth_enabled\` is set.
|
|
3598
|
+
string oidc_issuer = 12;
|
|
3599
|
+
|
|
3600
|
+
// OAuth 2.0 client identifier registered with the OpenID Provider.
|
|
3601
|
+
string oidc_client_id = 13;
|
|
3602
|
+
|
|
3603
|
+
// OAuth 2.0 client secret. Stored encrypted and redacted on read.
|
|
3604
|
+
string oidc_client_secret = 14;
|
|
3605
|
+
|
|
3606
|
+
// Space separated OAuth scopes. Defaults to "openid email" when empty.
|
|
3607
|
+
string oidc_scopes = 15;
|
|
3608
|
+
|
|
3609
|
+
// Optional override for the reserved callback path on the app host. Defaults
|
|
3610
|
+
// to "/__volt-auth/oidc/callback".
|
|
3611
|
+
string oidc_redirect_path = 16;
|
|
3612
|
+
|
|
3613
|
+
// Email verification mode for OIDC-gated sign-in when the OpenID Provider is
|
|
3614
|
+
// a Volt: "link" (default) or "code".
|
|
3615
|
+
string email_verification_mode = 17;
|
|
3355
3616
|
}
|
|
3356
3617
|
|
|
3357
3618
|
message SaveHttpForwarderResponse {
|
|
@@ -3359,6 +3620,33 @@ message SaveHttpForwarderResponse {
|
|
|
3359
3620
|
Resource resource = 2;
|
|
3360
3621
|
}
|
|
3361
3622
|
|
|
3623
|
+
message SaveOidcClientRequest {
|
|
3624
|
+
Resource resource = 1;
|
|
3625
|
+
bool create = 2;
|
|
3626
|
+
string create_in_parent_id = 3;
|
|
3627
|
+
bool purge_attributes = 4;
|
|
3628
|
+
|
|
3629
|
+
// Human-friendly name for the client (also used as resource name when the
|
|
3630
|
+
// resource name is empty).
|
|
3631
|
+
string client_name = 5;
|
|
3632
|
+
|
|
3633
|
+
// OAuth 2.0 client_id. Required.
|
|
3634
|
+
string client_id = 6;
|
|
3635
|
+
|
|
3636
|
+
// OAuth 2.0 client_secret. Stored encrypted and redacted on read. Only
|
|
3637
|
+
// (re)written when non-empty so updates can omit it to keep the existing
|
|
3638
|
+
// secret.
|
|
3639
|
+
string client_secret = 7;
|
|
3640
|
+
|
|
3641
|
+
// Comma- or space-separated list of allowed redirect URIs.
|
|
3642
|
+
string redirect_uris = 8;
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
message SaveOidcClientResponse {
|
|
3646
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
3647
|
+
Resource resource = 2;
|
|
3648
|
+
}
|
|
3649
|
+
|
|
3362
3650
|
message SaveHttpFileServerRequest {
|
|
3363
3651
|
Resource resource = 1;
|
|
3364
3652
|
bool create = 2;
|
|
@@ -3371,6 +3659,7 @@ message SaveHttpFileServerRequest {
|
|
|
3371
3659
|
int32 cache_timeout = 9;
|
|
3372
3660
|
bool catch_all_enabled = 10;
|
|
3373
3661
|
string catch_all = 11;
|
|
3662
|
+
bool dynamic_index_enabled = 12;
|
|
3374
3663
|
}
|
|
3375
3664
|
|
|
3376
3665
|
message SaveHttpFileServerResponse {
|
|
@@ -3387,6 +3676,11 @@ message SaveHttpRestApiServerRequest {
|
|
|
3387
3676
|
int32 port = 6;
|
|
3388
3677
|
bool enabled = 7;
|
|
3389
3678
|
bool cors_enabled = 8;
|
|
3679
|
+
bool is_literal = 9;
|
|
3680
|
+
string literal_json = 10;
|
|
3681
|
+
string database_id = 11;
|
|
3682
|
+
string sql = 12;
|
|
3683
|
+
repeated string parameter = 13;
|
|
3390
3684
|
}
|
|
3391
3685
|
|
|
3392
3686
|
message SaveHttpRestApiServerResponse {
|
|
@@ -3422,6 +3716,29 @@ message SaveSessionResponse {
|
|
|
3422
3716
|
Session session = 2;
|
|
3423
3717
|
}
|
|
3424
3718
|
|
|
3719
|
+
message SendEmailRequest {
|
|
3720
|
+
// The email to send.
|
|
3721
|
+
Email email = 1;
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3724
|
+
message SendEmailResponse {
|
|
3725
|
+
// Details of any error that occurred on the call.
|
|
3726
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3729
|
+
message SetAccessRequestDecisionRequest {
|
|
3730
|
+
// The id of the access request.
|
|
3731
|
+
string id = 1;
|
|
3732
|
+
|
|
3733
|
+
// The decision to save against the access request.
|
|
3734
|
+
PolicyDecision decision = 2;
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3737
|
+
message SetAccessRequestDecisionResponse {
|
|
3738
|
+
// Details of any error that occurred on the call.
|
|
3739
|
+
tdx.volt_api.volt.v1.Status status = 1;
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3425
3742
|
message SetPolicyRequest {
|
|
3426
3743
|
// The id of the policy to set.
|
|
3427
3744
|
// Should be either 00000000-0000-0000-0000-000000000000 or 00000000-0000-0000-0000-000000000001 for the first or last custom policy respectively.
|
|
@@ -3449,19 +3766,6 @@ message SetServiceStatusResponse {
|
|
|
3449
3766
|
Resource resource = 2;
|
|
3450
3767
|
}
|
|
3451
3768
|
|
|
3452
|
-
message SetAccessRequestDecisionRequest {
|
|
3453
|
-
// The id of the access request.
|
|
3454
|
-
string id = 1;
|
|
3455
|
-
|
|
3456
|
-
// The decision to save against the access request.
|
|
3457
|
-
PolicyDecision decision = 2;
|
|
3458
|
-
}
|
|
3459
|
-
|
|
3460
|
-
message SetAccessRequestDecisionResponse {
|
|
3461
|
-
// Details of any error that occurred on the call.
|
|
3462
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
3463
|
-
}
|
|
3464
|
-
|
|
3465
3769
|
// This message is emtpy.
|
|
3466
3770
|
message ShutdownRequest {
|
|
3467
3771
|
}
|