refactor: update gRPC client to use new request types

This commit is contained in:
Prad Nukala
2024-10-18 15:10:09 -04:00
parent a0a5f0c7e0
commit 3ad6036eb8
13 changed files with 793 additions and 1055 deletions
+4 -4
View File
@@ -10,22 +10,22 @@ option go_package = "github.com/onsonr/sonr/x/did/types";
service Query {
// Params queries all parameters of the module.
rpc Params(QueryRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/params";
option (google.api.http).get = "/did/v1/params";
}
// Resolve queries the DID document by its id.
rpc Resolve(QueryRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/{did}";
option (google.api.http).get = "/did/v1/{did}";
}
// Sign signs a message with the DID document
rpc Sign(QuerySignRequest) returns (QuerySignResponse) {
option (google.api.http).post = "/did/{did}/sign";
option (google.api.http).post = "/did/v1/{did}/sign";
}
// Verify verifies a message with the DID document
rpc Verify(QueryVerifyRequest) returns (QueryVerifyResponse) {
option (google.api.http).post = "/did/{did}/verify";
option (google.api.http).post = "/did/v1/{did}/verify";
}
}
+9 -12
View File
@@ -21,14 +21,14 @@ service Query {
// Allocate initializes a Target Vault available for claims with a compatible
// Authentication mechanism. The default authentication mechanism is WebAuthn.
rpc Allocate(AllocateRequest) returns (AllocateResponse) {
option (google.api.http).get = "/vault/v1/allocate/{origin}/{subject}";
rpc Allocate(QueryAllocateRequest) returns (QueryAllocateResponse) {
option (google.api.http).get = "/vault/v1/allocate";
}
// Sync queries the DID document by its id. And returns the required PKL
// information
rpc Sync(SyncRequest) returns (SyncResponse) {
option (google.api.http).post = "/vault/v1/sync-initial";
rpc Sync(QuerySyncRequest) returns (QuerySyncResponse) {
option (google.api.http).get = "/vault/v1/sync-initial";
}
}
@@ -50,14 +50,11 @@ message QuerySchemaResponse {
Schema schema = 1;
}
// AllocateRequest is the request type for the Allocate RPC method.
message AllocateRequest {
string origin = 1;
string subject = 2;
}
// QueryAllocateRequest is the request type for the Allocate RPC method.
message QueryAllocateRequest {}
// AllocateResponse is the response type for the Allocate RPC method.
message AllocateResponse {
message QueryAllocateResponse {
bool success = 1;
string cid = 2;
string macaroon = 3;
@@ -66,12 +63,12 @@ message AllocateResponse {
}
// SyncRequest is the request type for the Sync RPC method.
message SyncRequest {
message QuerySyncRequest {
string did = 1;
}
// SyncResponse is the response type for the Sync RPC method.
message SyncResponse {
message QuerySyncResponse {
bool success = 1;
// Schema is the DID document.