diff --git a/cli/src/proto/services/account/v1/mod.rs b/cli/src/proto/services/account/v1/mod.rs index 59c0aa32a..1f810ccc4 100644 --- a/cli/src/proto/services/account/v1/mod.rs +++ b/cli/src/proto/services/account/v1/mod.rs @@ -234,3 +234,127 @@ pub mod account_service_client { } } } +#[doc = r" Generated client implementations."] +pub mod account_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct AccountClient { + inner: tonic::client::Grpc, + } + impl AccountClient { + #[doc = r" Attempt to create a new client by connecting to a given endpoint."] + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl AccountClient + where + T: tonic::client::GrpcService, + T::ResponseBody: Body + Send + 'static, + T::Error: Into, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> AccountClient> + where + F: tonic::service::Interceptor, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + AccountClient::new(InterceptedService::new(inner, interceptor)) + } + #[doc = r" Compress requests with `gzip`."] + #[doc = r""] + #[doc = r" This requires the server to support it otherwise it might respond with an"] + #[doc = r" error."] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + #[doc = r" Enable decompressing responses with `gzip`."] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + #[doc = " Sign in to an already existing account"] + pub async fn sign_in( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/services.account.v1.Account/SignIn"); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " Get account information"] + pub async fn info( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/services.account.v1.Account/Info"); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " List all connected devices"] + pub async fn list_devices( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/services.account.v1.Account/ListDevices"); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " Revoke device access to the account's cloud wallet"] + pub async fn revoke_device( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/services.account.v1.Account/RevokeDevice"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} diff --git a/cli/src/proto/services/universalwallet/v1/mod.rs b/cli/src/proto/services/universalwallet/v1/mod.rs index ff48550d0..a47fdce7e 100644 --- a/cli/src/proto/services/universalwallet/v1/mod.rs +++ b/cli/src/proto/services/universalwallet/v1/mod.rs @@ -47,14 +47,14 @@ pub struct DeleteItemRequest {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteItemResponse {} #[doc = r" Generated client implementations."] -pub mod wallet_service_client { +pub mod universal_wallet_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; #[derive(Debug, Clone)] - pub struct WalletServiceClient { + pub struct UniversalWalletClient { inner: tonic::client::Grpc, } - impl WalletServiceClient { + impl UniversalWalletClient { #[doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect(dst: D) -> Result where @@ -65,7 +65,7 @@ pub mod wallet_service_client { Ok(Self::new(conn)) } } - impl WalletServiceClient + impl UniversalWalletClient where T: tonic::client::GrpcService, T::ResponseBody: Body + Send + 'static, @@ -79,7 +79,7 @@ pub mod wallet_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> WalletServiceClient> + ) -> UniversalWalletClient> where F: tonic::service::Interceptor, T: tonic::codegen::Service< @@ -91,7 +91,7 @@ pub mod wallet_service_client { >>::Error: Into + Send + Sync, { - WalletServiceClient::new(InterceptedService::new(inner, interceptor)) + UniversalWalletClient::new(InterceptedService::new(inner, interceptor)) } #[doc = r" Compress requests with `gzip`."] #[doc = r""] @@ -119,7 +119,7 @@ pub mod wallet_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.universalwallet.v1.WalletService/Search", + "/services.universalwallet.v1.UniversalWallet/Search", ); self.inner.unary(request.into_request(), path, codec).await } @@ -136,7 +136,7 @@ pub mod wallet_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.universalwallet.v1.WalletService/InsertItem", + "/services.universalwallet.v1.UniversalWallet/InsertItem", ); self.inner.unary(request.into_request(), path, codec).await } @@ -153,7 +153,7 @@ pub mod wallet_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.universalwallet.v1.WalletService/Deleteitem", + "/services.universalwallet.v1.UniversalWallet/Deleteitem", ); self.inner.unary(request.into_request(), path, codec).await } diff --git a/cli/src/proto/services/verifiablecredentials/v1/mod.rs b/cli/src/proto/services/verifiablecredentials/v1/mod.rs index 119ea9dd7..077d30120 100644 --- a/cli/src/proto/services/verifiablecredentials/v1/mod.rs +++ b/cli/src/proto/services/verifiablecredentials/v1/mod.rs @@ -64,14 +64,14 @@ pub struct SendResponse { pub status: i32, } #[doc = r" Generated client implementations."] -pub mod credential_client { +pub mod verifiable_credential_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; #[derive(Debug, Clone)] - pub struct CredentialClient { + pub struct VerifiableCredentialClient { inner: tonic::client::Grpc, } - impl CredentialClient { + impl VerifiableCredentialClient { #[doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect(dst: D) -> Result where @@ -82,7 +82,7 @@ pub mod credential_client { Ok(Self::new(conn)) } } - impl CredentialClient + impl VerifiableCredentialClient where T: tonic::client::GrpcService, T::ResponseBody: Body + Send + 'static, @@ -96,7 +96,7 @@ pub mod credential_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> CredentialClient> + ) -> VerifiableCredentialClient> where F: tonic::service::Interceptor, T: tonic::codegen::Service< @@ -108,7 +108,7 @@ pub mod credential_client { >>::Error: Into + Send + Sync, { - CredentialClient::new(InterceptedService::new(inner, interceptor)) + VerifiableCredentialClient::new(InterceptedService::new(inner, interceptor)) } #[doc = r" Compress requests with `gzip`."] #[doc = r""] @@ -135,7 +135,7 @@ pub mod credential_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.verifiablecredentials.v1.Credential/Issue", + "/services.verifiablecredentials.v1.VerifiableCredential/Issue", ); self.inner.unary(request.into_request(), path, codec).await } @@ -151,7 +151,7 @@ pub mod credential_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.verifiablecredentials.v1.Credential/IssueFromTemplate", + "/services.verifiablecredentials.v1.VerifiableCredential/IssueFromTemplate", ); self.inner.unary(request.into_request(), path, codec).await } @@ -167,7 +167,7 @@ pub mod credential_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.verifiablecredentials.v1.Credential/CreateProof", + "/services.verifiablecredentials.v1.VerifiableCredential/CreateProof", ); self.inner.unary(request.into_request(), path, codec).await } @@ -183,7 +183,7 @@ pub mod credential_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.verifiablecredentials.v1.Credential/VerifyProof", + "/services.verifiablecredentials.v1.VerifiableCredential/VerifyProof", ); self.inner.unary(request.into_request(), path, codec).await } @@ -199,7 +199,7 @@ pub mod credential_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/services.verifiablecredentials.v1.Credential/Send", + "/services.verifiablecredentials.v1.VerifiableCredential/Send", ); self.inner.unary(request.into_request(), path, codec).await } diff --git a/cli/src/services/issuer.rs b/cli/src/services/issuer.rs index 6298ab186..5004fbabe 100644 --- a/cli/src/services/issuer.rs +++ b/cli/src/services/issuer.rs @@ -1,6 +1,6 @@ use trinsic::proto::services::common::v1::{json_payload::Json, JsonPayload}; use trinsic::proto::services::verifiablecredentials::v1::{ - credential_client::CredentialClient, CreateProofRequest, IssueRequest, VerifyProofRequest, + verifiable_credential_client::VerifiableCredentialClient, CreateProofRequest, IssueRequest, VerifyProofRequest, }; use trinsic::proto::JsonPretty; use trinsic::utils::{read_file_as_string, write_file}; @@ -28,7 +28,7 @@ async fn issue(args: &IssueArgs, config: DefaultConfig) { let document: trinsic::proto::google::protobuf::Struct = trinsic::proto::google::protobuf::Struct::from_vec(&document).unwrap(); - let mut client = grpc_client_with_auth!(CredentialClient, config); + let mut client = grpc_client_with_auth!(VerifiableCredentialClient, config); let request = tonic::Request::new(IssueRequest { document: Some(JsonPayload { @@ -62,7 +62,7 @@ async fn create_proof(args: &CreateProofArgs, config: DefaultConfig) { let document: trinsic::proto::google::protobuf::Struct = trinsic::proto::google::protobuf::Struct::from_vec(&document).unwrap(); - let mut client = grpc_client_with_auth!(CredentialClient, config); + let mut client = grpc_client_with_auth!(VerifiableCredentialClient, config); let request = tonic::Request::new(CreateProofRequest { reveal_document: Some(JsonPayload { @@ -97,7 +97,7 @@ async fn verify_proof(args: &VerifyProofArgs, config: DefaultConfig) { let document: trinsic::proto::google::protobuf::Struct = trinsic::proto::google::protobuf::Struct::from_vec(&document).unwrap(); - let mut client = grpc_client_with_auth!(CredentialClient, config); + let mut client = grpc_client_with_auth!(VerifiableCredentialClient, config); let request = tonic::Request::new(VerifyProofRequest { proof_document: Some(JsonPayload { diff --git a/cli/src/services/wallet.rs b/cli/src/services/wallet.rs index 99b62bb14..d0edde76b 100644 --- a/cli/src/services/wallet.rs +++ b/cli/src/services/wallet.rs @@ -8,9 +8,9 @@ use trinsic::proto::google::protobuf::Struct; use trinsic::proto::services::common::v1::json_payload::Json; use trinsic::proto::services::common::v1::{JsonPayload, ServerConfig}; use trinsic::proto::services::universalwallet::v1::{ - wallet_service_client::WalletServiceClient, InsertItemRequest, SearchRequest, + universal_wallet_client::UniversalWalletClient, InsertItemRequest, SearchRequest, }; -use trinsic::proto::services::verifiablecredentials::v1::credential_client::CredentialClient; +use trinsic::proto::services::verifiablecredentials::v1::verifiable_credential_client::VerifiableCredentialClient; use trinsic::proto::services::verifiablecredentials::v1::send_request::DeliveryMethod; use trinsic::proto::services::verifiablecredentials::v1::SendRequest; use trinsic::utils::read_file_as_string; @@ -37,7 +37,7 @@ async fn search(args: &SearchArgs, config: DefaultConfig) { .await .expect("Unable to connect to server"); - let mut client = WalletServiceClient::with_interceptor(channel, config); + let mut client = UniversalWalletClient::with_interceptor(channel, config); let request = tonic::Request::new(SearchRequest { query: query.clone(), @@ -74,7 +74,7 @@ async fn insert_item(args: &InsertItemArgs, config: DefaultConfig) { .await .expect("Unable to connect to server"); - let mut client = WalletServiceClient::with_interceptor(channel, config); + let mut client = UniversalWalletClient::with_interceptor(channel, config); let response = client .insert_item(InsertItemRequest { @@ -105,7 +105,7 @@ async fn send(args: &SendArgs, config: DefaultConfig) { .await .expect("Unable to connect to server"); - let mut client = CredentialClient::with_interceptor(channel, config); + let mut client = VerifiableCredentialClient::with_interceptor(channel, config); let response = client .send(SendRequest { diff --git a/dotnet/Trinsic/AccountService.cs b/dotnet/Trinsic/AccountService.cs index 57a5c1be3..606a6b8a5 100644 --- a/dotnet/Trinsic/AccountService.cs +++ b/dotnet/Trinsic/AccountService.cs @@ -5,7 +5,7 @@ using Okapi.Security.V1; using Trinsic.Services.Account.V1; using Trinsic.Services.Common.V1; -using AccountServiceClient = Trinsic.Services.Account.V1.AccountService.AccountServiceClient; +using AccountServiceClient = Trinsic.Services.Account.V1.Account.AccountClient; namespace Trinsic; @@ -14,6 +14,11 @@ namespace Trinsic; /// public class AccountService : ServiceBase { + public AccountService(ServerConfig? serverConfig) + : this(null, serverConfig) + { + } + public AccountService(AccountProfile? accountProfile, ServerConfig? serverConfig) : base(accountProfile, serverConfig) { @@ -28,9 +33,9 @@ public AccountService(AccountProfile? accountProfile, ServerConfig? serverConfig /// /// /// - public async Task<(AccountProfile accountProfile, ConfirmationMethod confirmationMethod)> SignInAsync(AccountDetails details) + public async Task<(AccountProfile accountProfile, ConfirmationMethod confirmationMethod)> SignInAsync(AccountDetails? details = null) { - SignInRequest request = new() { Details = details }; + SignInRequest request = new() { Details = details ?? new AccountDetails() }; SignInResponse response = await Client.SignInAsync(request); @@ -44,18 +49,22 @@ public AccountService(AccountProfile? accountProfile, ServerConfig? serverConfig /// /// /// - public void Unprotect(ref AccountProfile profile, string securityCode) + public static AccountProfile Unprotect(AccountProfile profile, string securityCode) { - UnBlindOberonTokenRequest request = new() { Token = profile.AuthToken }; + var cloned = profile.Clone(); + + UnBlindOberonTokenRequest request = new() { Token = cloned.AuthToken }; request.Blinding.Add(ByteString.CopyFromUtf8(securityCode)); var result = Oberon.UnblindToken(request); - profile.AuthToken = result.Token; - profile.Protection = new() + cloned.AuthToken = result.Token; + cloned.Protection = new() { Enabled = false, Method = ConfirmationMethod.None }; + + return cloned; } /// @@ -64,18 +73,22 @@ public void Unprotect(ref AccountProfile profile, string securityCode) /// /// /// - public void Protect(ref AccountProfile profile, string securityCode) + public static AccountProfile Protect(AccountProfile profile, string securityCode) { - BlindOberonTokenRequest request = new() { Token = profile.AuthToken }; + var cloned = profile.Clone(); + + BlindOberonTokenRequest request = new() { Token = cloned.AuthToken }; request.Blinding.Add(ByteString.CopyFromUtf8(securityCode)); var result = Oberon.BlindToken(request); - profile.AuthToken = result.Token; - profile.Protection = new() + cloned.AuthToken = result.Token; + cloned.Protection = new() { Enabled = true, Method = ConfirmationMethod.Other }; + + return cloned; } /// diff --git a/dotnet/Trinsic/CredentialsService.cs b/dotnet/Trinsic/CredentialsService.cs index be3196e0f..670ee0b82 100644 --- a/dotnet/Trinsic/CredentialsService.cs +++ b/dotnet/Trinsic/CredentialsService.cs @@ -13,10 +13,10 @@ public class CredentialsService : ServiceBase public CredentialsService(AccountProfile accountProfile, ServerConfig? serverConfig = null) : base(accountProfile, serverConfig) { - Client = new Credential.CredentialClient(Channel); + Client = new VerifiableCredential.VerifiableCredentialClient(Channel); } - internal Credential.CredentialClient Client { get; } + internal VerifiableCredential.VerifiableCredentialClient Client { get; } /// /// Signs an input credential diff --git a/dotnet/Trinsic/Trinsic.csproj b/dotnet/Trinsic/Trinsic.csproj index 33cd418e7..6ba26ce21 100644 --- a/dotnet/Trinsic/Trinsic.csproj +++ b/dotnet/Trinsic/Trinsic.csproj @@ -36,7 +36,7 @@ - + diff --git a/dotnet/Trinsic/WalletService.cs b/dotnet/Trinsic/WalletService.cs index 96ab2ff61..7d6de2685 100644 --- a/dotnet/Trinsic/WalletService.cs +++ b/dotnet/Trinsic/WalletService.cs @@ -3,7 +3,7 @@ using Trinsic.Services.UniversalWallet.V1; using Trinsic.Services.Common.V1; using Trinsic.Services.Account.V1; -using WalletServiceClient = Trinsic.Services.UniversalWallet.V1.WalletService.WalletServiceClient; +using WalletServiceClient = Trinsic.Services.UniversalWallet.V1.UniversalWallet.UniversalWalletClient; namespace Trinsic; diff --git a/node/src/CredentialService.ts b/node/src/CredentialService.ts index 88752e80e..77007d657 100644 --- a/node/src/CredentialService.ts +++ b/node/src/CredentialService.ts @@ -1,7 +1,7 @@ import { Struct } from "google-protobuf/google/protobuf/struct_pb"; import ServiceBase from "./ServiceBase"; import { - CredentialClient, + VerifiableCredentialClient, AccountProfile, CreateProofRequest, IssueRequest, @@ -16,12 +16,12 @@ type JavaScriptValue = string | number | boolean | {} | any[]; type JSStruct = { [key: string]: JavaScriptValue }; export class CredentialService extends ServiceBase { - credentialClient: CredentialClient; + credentialClient: VerifiableCredentialClient; constructor(profile: AccountProfile, config: ServerConfig = null) { super(profile, config); - this.credentialClient = new CredentialClient(this.address, this.channelCredentials); + this.credentialClient = new VerifiableCredentialClient(this.address, this.channelCredentials); } public issue(document: any): Promise { diff --git a/node/src/TemplateService.ts b/node/src/TemplateService.ts index 3f4b4256b..a25b8c424 100644 --- a/node/src/TemplateService.ts +++ b/node/src/TemplateService.ts @@ -14,7 +14,7 @@ import { UpdateCredentialTemplateRequest, UpdateCredentialTemplateResponse, } from "./proto"; -import { CredentialClient } from "./proto"; +import { VerifiableCredentialClient } from "./proto"; import { IssueFromTemplateRequest, IssueResponse, JsonPayload } from "./proto"; import { Struct } from "google-protobuf/google/protobuf/struct_pb"; @@ -23,13 +23,13 @@ type JSStruct = { [key: string]: JavaScriptValue }; export class TemplateService extends ServiceBase { client: CredentialTemplatesClient; - credentialClient: CredentialClient; + credentialClient: VerifiableCredentialClient; constructor(config: ServerConfig = null) { super(null, config); this.client = new CredentialTemplatesClient(this.address, this.channelCredentials); - this.credentialClient = new CredentialClient(this.address, this.channelCredentials); + this.credentialClient = new VerifiableCredentialClient(this.address, this.channelCredentials); } public createCredentialTemplate( diff --git a/node/src/WalletService.ts b/node/src/WalletService.ts index afaf3e2a9..284d559ae 100644 --- a/node/src/WalletService.ts +++ b/node/src/WalletService.ts @@ -1,24 +1,22 @@ import { Struct } from "google-protobuf/google/protobuf/struct_pb"; import ServiceBase from "./ServiceBase"; import { - CredentialClient, InsertItemRequest, SearchResponse, SearchRequest, JsonPayload, ServerConfig, AccountProfile, - WalletServiceClient, + UniversalWalletClient, } from "./proto"; export class WalletService extends ServiceBase { - walletClient: WalletServiceClient; - credentialClient: CredentialClient; + walletClient: UniversalWalletClient; constructor(profile: AccountProfile, config: ServerConfig = null) { super(profile, config); - this.walletClient = new WalletServiceClient( + this.walletClient = new UniversalWalletClient( this.address, this.channelCredentials ); diff --git a/node/test/WalletService.test.js b/node/test/WalletService.test.js index 2a60f6bcf..e5df35f27 100644 --- a/node/test/WalletService.test.js +++ b/node/test/WalletService.test.js @@ -1,6 +1,5 @@ const test = require("ava"); -const { WalletService, ProviderService, ServerConfig, AccountService, CredentialService, AccountProfile } = require("../lib"); -const { GenerateKeyRequest } = require("@trinsic/okapi"); +const { WalletService, ServerConfig, AccountService, CredentialService } = require("../lib"); const { Struct } = require("google-protobuf/google/protobuf/struct_pb"); const { InviteRequest } = require("../lib"); const { randomEmail } = require("./helpers/random"); @@ -15,7 +14,7 @@ const config = new ServerConfig().setEndpoint(endpoint).setPort(new Number(port) let profile = null; -test.before(async t => { +test.before(async () => { let service = new AccountService(null, config); let response = await service.signIn(); @@ -40,7 +39,6 @@ test("create new account", async (t) => { }); test("Demo: create wallet, set profile, search records, issue credential", async (t) => { - let accountService = new AccountService(profile, config); // let info = await accountService.info(); diff --git a/proto/services/account/v1/account.proto b/proto/services/account/v1/account.proto index d8514ff4e..687e80525 100644 --- a/proto/services/account/v1/account.proto +++ b/proto/services/account/v1/account.proto @@ -103,6 +103,19 @@ service AccountService { rpc SignIn (SignInRequest) returns (SignInResponse); // rpc SIgnInConfirm (SignInConfirmRequest) returns (SignInConfirmResponse); + // Get account information + rpc Info (InfoRequest) returns (InfoResponse); + // List all connected devices + rpc ListDevices (ListDevicesRequest) returns (ListDevicesResponse); + // Revoke device access to the account's cloud wallet + rpc RevokeDevice (RevokeDeviceRequest) returns (RevokeDeviceResponse); +} + +service Account { + // Sign in to an already existing account + rpc SignIn (SignInRequest) returns (SignInResponse); + // rpc SIgnInConfirm (SignInConfirmRequest) returns (SignInConfirmResponse); + // Get account information rpc Info (InfoRequest) returns (InfoResponse); // List all connected devices diff --git a/proto/services/provider/v1/provider.proto b/proto/services/provider/v1/provider.proto index e79269d2b..d88e281cc 100644 --- a/proto/services/provider/v1/provider.proto +++ b/proto/services/provider/v1/provider.proto @@ -60,32 +60,4 @@ service Provider { rpc Invite(InviteRequest) returns (InviteResponse); rpc InviteWithWorkflow(InviteRequest) returns (InviteResponse); rpc InvitationStatus(InvitationStatusRequest) returns (InvitationStatusResponse); -// rpc CreateCredentialTemplate(CreateCredentialTemplateRequest) returns (CreateCredentialTemplateResponse); -// rpc ListCredentialTemplates(ListCredentialTemplatesRequest) returns (ListCredentialTemplatesResponse); -} - -//service Attributes { -// rpc Create(Attribute) returns (AttributeId); -// rpc Retrieve(AttributeId) returns (Attribute); -// rpc List(google.protobuf.Empty) returns (ListAttributesResponse); -//} - -//service Credentials { -// rpc Issue(IssueCredentialRequest) returns (IssueCredentialResponse); -// rpc List(ListCredentialRequest) returns (ListCredentialResponse); -//} - -//service Organizations { -// rpc Create(CreateOrgRequest) returns (CreateOrgResponse); -// rpc List(ListOrgRequest) returns (ListOrgResponse); -//} -// -//service Presentations { -// rpc GeneratePresentation(GeneratePresentationRequest) returns (GeneratePresentationResponse); -// rpc SubmitPresentation(SubmitPresentationRequest) returns (SubmitPresentationResponse); -//} -// -//service PresentationTemplates { -// rpc Create(CreatePresentationTemplateRequest) returns (CreatePresentationTemplateResponse); -// rpc List(ListPresentationTemplateRequest) returns (ListPresentationTemplateResponse); -//} \ No newline at end of file +} \ No newline at end of file diff --git a/proto/services/universal-wallet/v1/universal-wallet.proto b/proto/services/universal-wallet/v1/universal-wallet.proto index 563bc8243..1667dabc7 100644 --- a/proto/services/universal-wallet/v1/universal-wallet.proto +++ b/proto/services/universal-wallet/v1/universal-wallet.proto @@ -44,7 +44,7 @@ message InsertItemResponse { message DeleteItemRequest {} message DeleteItemResponse {} -service WalletService { +service UniversalWallet { // Search the wallet using a SQL-like syntax rpc Search(SearchRequest) returns (SearchResponse); @@ -54,6 +54,5 @@ service WalletService { // Delete an item from the wallet permanently rpc Deleteitem(DeleteItemRequest) returns (DeleteItemResponse); - } diff --git a/proto/services/verifiable-credentials/v1/verifiable-credentials.proto b/proto/services/verifiable-credentials/v1/verifiable-credentials.proto index 3e1cfa324..c3f2a3401 100644 --- a/proto/services/verifiable-credentials/v1/verifiable-credentials.proto +++ b/proto/services/verifiable-credentials/v1/verifiable-credentials.proto @@ -54,7 +54,7 @@ message SendResponse { services.common.v1.ResponseStatus status = 1; } -service Credential { +service VerifiableCredential { rpc Issue(IssueRequest) returns (IssueResponse); rpc IssueFromTemplate(IssueFromTemplateRequest) returns (IssueResponse); diff --git a/web/src/CredentialService.ts b/web/src/CredentialService.ts index 28d8fdccc..9f3ae5c34 100644 --- a/web/src/CredentialService.ts +++ b/web/src/CredentialService.ts @@ -1,7 +1,7 @@ import { Struct } from "google-protobuf/google/protobuf/struct_pb"; import ServiceBase from "./ServiceBase"; import { - CredentialClient, + VerifiableCredentialClient, AccountProfile, CreateProofRequest, IssueRequest, @@ -16,12 +16,12 @@ type JavaScriptValue = string | number | boolean | {} | any[]; type JSStruct = { [key: string]: JavaScriptValue }; export class CredentialService extends ServiceBase { - credentialClient: CredentialClient; + credentialClient: VerifiableCredentialClient; constructor(profile: AccountProfile, config: ServerConfig = null) { super(profile, config); - this.credentialClient = new CredentialClient(this.address); + this.credentialClient = new VerifiableCredentialClient(this.address); } public issue(document: any): Promise { diff --git a/web/src/WalletService.ts b/web/src/WalletService.ts index 6c85fd867..4bf2c3849 100644 --- a/web/src/WalletService.ts +++ b/web/src/WalletService.ts @@ -1,24 +1,22 @@ import { Struct } from "google-protobuf/google/protobuf/struct_pb"; import ServiceBase from "./ServiceBase"; import { - CredentialClient, InsertItemRequest, SearchResponse, SearchRequest, JsonPayload, ServerConfig, AccountProfile, - WalletServiceClient, + UniversalWalletClient, } from "./proto"; export class WalletService extends ServiceBase { - walletClient: WalletServiceClient; - credentialClient: CredentialClient; + walletClient: UniversalWalletClient; constructor(profile: AccountProfile, config: ServerConfig = null) { super(profile, config); - this.walletClient = new WalletServiceClient(this.address); + this.walletClient = new UniversalWalletClient(this.address); } // must be authorized