diff --git a/services/identity/src/service.rs b/services/identity/src/service.rs --- a/services/identity/src/service.rs +++ b/services/identity/src/service.rs @@ -40,8 +40,8 @@ registration_request::Data::PakeRegistrationUploadAndCredentialRequest, registration_response::Data::PakeLoginResponse as PakeRegistrationLoginResponse, registration_response::Data::PakeRegistrationResponse, GetUserIdRequest, - GetUserIdResponse, LoginRequest, LoginResponse, - PakeLoginRequest as PakeLoginRequestStruct, + GetUserIdResponse, GetUserPublicKeyRequest, GetUserPublicKeyResponse, + LoginRequest, LoginResponse, PakeLoginRequest as PakeLoginRequestStruct, PakeLoginResponse as PakeLoginResponseStruct, RegistrationRequest, RegistrationResponse, VerifyUserTokenRequest, VerifyUserTokenResponse, WalletLoginRequest as WalletLoginRequestStruct, @@ -377,6 +377,14 @@ let response = Response::new(GetUserIdResponse { user_id }); Ok(response) } + + #[instrument(skip(self))] + async fn get_user_public_key( + &self, + request: Request, + ) -> Result, Status> { + unimplemented!() + } } async fn put_token_helper( diff --git a/shared/protos/_generated/identity.grpc.pb.h b/shared/protos/_generated/identity.grpc.pb.h --- a/shared/protos/_generated/identity.grpc.pb.h +++ b/shared/protos/_generated/identity.grpc.pb.h @@ -72,6 +72,15 @@ std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserIDResponse>> PrepareAsyncGetUserID(::grpc::ClientContext* context, const ::identity::GetUserIDRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserIDResponse>>(PrepareAsyncGetUserIDRaw(context, request, cq)); } + // Called by keyservers to get the public key corresponding to a given user ID + // and device ID + virtual ::grpc::Status GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::identity::GetUserPublicKeyResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserPublicKeyResponse>> AsyncGetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserPublicKeyResponse>>(AsyncGetUserPublicKeyRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserPublicKeyResponse>> PrepareAsyncGetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserPublicKeyResponse>>(PrepareAsyncGetUserPublicKeyRaw(context, request, cq)); + } class async_interface { public: virtual ~async_interface() {} @@ -86,6 +95,10 @@ // address or username virtual void GetUserID(::grpc::ClientContext* context, const ::identity::GetUserIDRequest* request, ::identity::GetUserIDResponse* response, std::function) = 0; virtual void GetUserID(::grpc::ClientContext* context, const ::identity::GetUserIDRequest* request, ::identity::GetUserIDResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + // Called by keyservers to get the public key corresponding to a given user ID + // and device ID + virtual void GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response, std::function) = 0; + virtual void GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; }; typedef class async_interface experimental_async_interface; virtual class async_interface* async() { return nullptr; } @@ -101,6 +114,8 @@ virtual ::grpc::ClientAsyncResponseReaderInterface< ::identity::VerifyUserTokenResponse>* PrepareAsyncVerifyUserTokenRaw(::grpc::ClientContext* context, const ::identity::VerifyUserTokenRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserIDResponse>* AsyncGetUserIDRaw(::grpc::ClientContext* context, const ::identity::GetUserIDRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserIDResponse>* PrepareAsyncGetUserIDRaw(::grpc::ClientContext* context, const ::identity::GetUserIDRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserPublicKeyResponse>* AsyncGetUserPublicKeyRaw(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::identity::GetUserPublicKeyResponse>* PrepareAsyncGetUserPublicKeyRaw(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) = 0; }; class Stub final : public StubInterface { public: @@ -137,6 +152,13 @@ std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::identity::GetUserIDResponse>> PrepareAsyncGetUserID(::grpc::ClientContext* context, const ::identity::GetUserIDRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::identity::GetUserIDResponse>>(PrepareAsyncGetUserIDRaw(context, request, cq)); } + ::grpc::Status GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::identity::GetUserPublicKeyResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>> AsyncGetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>>(AsyncGetUserPublicKeyRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>> PrepareAsyncGetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>>(PrepareAsyncGetUserPublicKeyRaw(context, request, cq)); + } class async final : public StubInterface::async_interface { public: @@ -146,6 +168,8 @@ void VerifyUserToken(::grpc::ClientContext* context, const ::identity::VerifyUserTokenRequest* request, ::identity::VerifyUserTokenResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void GetUserID(::grpc::ClientContext* context, const ::identity::GetUserIDRequest* request, ::identity::GetUserIDResponse* response, std::function) override; void GetUserID(::grpc::ClientContext* context, const ::identity::GetUserIDRequest* request, ::identity::GetUserIDResponse* response, ::grpc::ClientUnaryReactor* reactor) override; + void GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response, std::function) override; + void GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response, ::grpc::ClientUnaryReactor* reactor) override; private: friend class Stub; explicit async(Stub* stub): stub_(stub) { } @@ -167,10 +191,13 @@ ::grpc::ClientAsyncResponseReader< ::identity::VerifyUserTokenResponse>* PrepareAsyncVerifyUserTokenRaw(::grpc::ClientContext* context, const ::identity::VerifyUserTokenRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::identity::GetUserIDResponse>* AsyncGetUserIDRaw(::grpc::ClientContext* context, const ::identity::GetUserIDRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::identity::GetUserIDResponse>* PrepareAsyncGetUserIDRaw(::grpc::ClientContext* context, const ::identity::GetUserIDRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>* AsyncGetUserPublicKeyRaw(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>* PrepareAsyncGetUserPublicKeyRaw(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) override; const ::grpc::internal::RpcMethod rpcmethod_RegisterUser_; const ::grpc::internal::RpcMethod rpcmethod_LoginUser_; const ::grpc::internal::RpcMethod rpcmethod_VerifyUserToken_; const ::grpc::internal::RpcMethod rpcmethod_GetUserID_; + const ::grpc::internal::RpcMethod rpcmethod_GetUserPublicKey_; }; static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); @@ -187,6 +214,9 @@ // Called by users and keyservers to get userID corresponding to a wallet // address or username virtual ::grpc::Status GetUserID(::grpc::ServerContext* context, const ::identity::GetUserIDRequest* request, ::identity::GetUserIDResponse* response); + // Called by keyservers to get the public key corresponding to a given user ID + // and device ID + virtual ::grpc::Status GetUserPublicKey(::grpc::ServerContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response); }; template class WithAsyncMethod_RegisterUser : public BaseClass { @@ -268,7 +298,27 @@ ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); } }; - typedef WithAsyncMethod_RegisterUser > > > AsyncService; + template + class WithAsyncMethod_GetUserPublicKey : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_GetUserPublicKey() { + ::grpc::Service::MarkMethodAsync(4); + } + ~WithAsyncMethod_GetUserPublicKey() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetUserPublicKey(::grpc::ServerContext* /*context*/, const ::identity::GetUserPublicKeyRequest* /*request*/, ::identity::GetUserPublicKeyResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetUserPublicKey(::grpc::ServerContext* context, ::identity::GetUserPublicKeyRequest* request, ::grpc::ServerAsyncResponseWriter< ::identity::GetUserPublicKeyResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_RegisterUser > > > > AsyncService; template class WithCallbackMethod_RegisterUser : public BaseClass { private: @@ -369,7 +419,34 @@ virtual ::grpc::ServerUnaryReactor* GetUserID( ::grpc::CallbackServerContext* /*context*/, const ::identity::GetUserIDRequest* /*request*/, ::identity::GetUserIDResponse* /*response*/) { return nullptr; } }; - typedef WithCallbackMethod_RegisterUser > > > CallbackService; + template + class WithCallbackMethod_GetUserPublicKey : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_GetUserPublicKey() { + ::grpc::Service::MarkMethodCallback(4, + new ::grpc::internal::CallbackUnaryHandler< ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response) { return this->GetUserPublicKey(context, request, response); }));} + void SetMessageAllocatorFor_GetUserPublicKey( + ::grpc::MessageAllocator< ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); + static_cast<::grpc::internal::CallbackUnaryHandler< ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_GetUserPublicKey() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetUserPublicKey(::grpc::ServerContext* /*context*/, const ::identity::GetUserPublicKeyRequest* /*request*/, ::identity::GetUserPublicKeyResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetUserPublicKey( + ::grpc::CallbackServerContext* /*context*/, const ::identity::GetUserPublicKeyRequest* /*request*/, ::identity::GetUserPublicKeyResponse* /*response*/) { return nullptr; } + }; + typedef WithCallbackMethod_RegisterUser > > > > CallbackService; typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_RegisterUser : public BaseClass { @@ -440,6 +517,23 @@ } }; template + class WithGenericMethod_GetUserPublicKey : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_GetUserPublicKey() { + ::grpc::Service::MarkMethodGeneric(4); + } + ~WithGenericMethod_GetUserPublicKey() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetUserPublicKey(::grpc::ServerContext* /*context*/, const ::identity::GetUserPublicKeyRequest* /*request*/, ::identity::GetUserPublicKeyResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template class WithRawMethod_RegisterUser : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} @@ -520,6 +614,26 @@ } }; template + class WithRawMethod_GetUserPublicKey : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_GetUserPublicKey() { + ::grpc::Service::MarkMethodRaw(4); + } + ~WithRawMethod_GetUserPublicKey() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetUserPublicKey(::grpc::ServerContext* /*context*/, const ::identity::GetUserPublicKeyRequest* /*request*/, ::identity::GetUserPublicKeyResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetUserPublicKey(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template class WithRawCallbackMethod_RegisterUser : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} @@ -610,6 +724,28 @@ ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template + class WithRawCallbackMethod_GetUserPublicKey : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_GetUserPublicKey() { + ::grpc::Service::MarkMethodRawCallback(4, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetUserPublicKey(context, request, response); })); + } + ~WithRawCallbackMethod_GetUserPublicKey() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetUserPublicKey(::grpc::ServerContext* /*context*/, const ::identity::GetUserPublicKeyRequest* /*request*/, ::identity::GetUserPublicKeyResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetUserPublicKey( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template class WithStreamedUnaryMethod_VerifyUserToken : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} @@ -663,9 +799,36 @@ // replace default version of method with streamed unary virtual ::grpc::Status StreamedGetUserID(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::identity::GetUserIDRequest,::identity::GetUserIDResponse>* server_unary_streamer) = 0; }; - typedef WithStreamedUnaryMethod_VerifyUserToken > StreamedUnaryService; + template + class WithStreamedUnaryMethod_GetUserPublicKey : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_GetUserPublicKey() { + ::grpc::Service::MarkMethodStreamed(4, + new ::grpc::internal::StreamedUnaryHandler< + ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse>* streamer) { + return this->StreamedGetUserPublicKey(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_GetUserPublicKey() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetUserPublicKey(::grpc::ServerContext* /*context*/, const ::identity::GetUserPublicKeyRequest* /*request*/, ::identity::GetUserPublicKeyResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetUserPublicKey(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::identity::GetUserPublicKeyRequest,::identity::GetUserPublicKeyResponse>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_VerifyUserToken > > StreamedUnaryService; typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_VerifyUserToken > StreamedService; + typedef WithStreamedUnaryMethod_VerifyUserToken > > StreamedService; }; } // namespace identity diff --git a/shared/protos/_generated/identity.grpc.pb.cc b/shared/protos/_generated/identity.grpc.pb.cc --- a/shared/protos/_generated/identity.grpc.pb.cc +++ b/shared/protos/_generated/identity.grpc.pb.cc @@ -26,6 +26,7 @@ "/identity.IdentityService/LoginUser", "/identity.IdentityService/VerifyUserToken", "/identity.IdentityService/GetUserID", + "/identity.IdentityService/GetUserPublicKey", }; std::unique_ptr< IdentityService::Stub> IdentityService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { @@ -39,6 +40,7 @@ , rpcmethod_LoginUser_(IdentityService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::BIDI_STREAMING, channel) , rpcmethod_VerifyUserToken_(IdentityService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) , rpcmethod_GetUserID_(IdentityService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_GetUserPublicKey_(IdentityService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) {} ::grpc::ClientReaderWriter< ::identity::RegistrationRequest, ::identity::RegistrationResponse>* IdentityService::Stub::RegisterUserRaw(::grpc::ClientContext* context) { @@ -119,6 +121,29 @@ return result; } +::grpc::Status IdentityService::Stub::GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::identity::GetUserPublicKeyResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetUserPublicKey_, context, request, response); +} + +void IdentityService::Stub::async::GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetUserPublicKey_, context, request, response, std::move(f)); +} + +void IdentityService::Stub::async::GetUserPublicKey(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetUserPublicKey_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>* IdentityService::Stub::PrepareAsyncGetUserPublicKeyRaw(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::identity::GetUserPublicKeyResponse, ::identity::GetUserPublicKeyRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetUserPublicKey_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::identity::GetUserPublicKeyResponse>* IdentityService::Stub::AsyncGetUserPublicKeyRaw(::grpc::ClientContext* context, const ::identity::GetUserPublicKeyRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncGetUserPublicKeyRaw(context, request, cq); + result->StartCall(); + return result; +} + IdentityService::Service::Service() { AddMethod(new ::grpc::internal::RpcServiceMethod( IdentityService_method_names[0], @@ -160,6 +185,16 @@ ::identity::GetUserIDResponse* resp) { return service->GetUserID(ctx, req, resp); }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + IdentityService_method_names[4], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< IdentityService::Service, ::identity::GetUserPublicKeyRequest, ::identity::GetUserPublicKeyResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](IdentityService::Service* service, + ::grpc::ServerContext* ctx, + const ::identity::GetUserPublicKeyRequest* req, + ::identity::GetUserPublicKeyResponse* resp) { + return service->GetUserPublicKey(ctx, req, resp); + }, this))); } IdentityService::Service::~Service() { @@ -191,6 +226,13 @@ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } +::grpc::Status IdentityService::Service::GetUserPublicKey(::grpc::ServerContext* context, const ::identity::GetUserPublicKeyRequest* request, ::identity::GetUserPublicKeyResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + } // namespace identity diff --git a/shared/protos/_generated/identity.pb.h b/shared/protos/_generated/identity.pb.h --- a/shared/protos/_generated/identity.pb.h +++ b/shared/protos/_generated/identity.pb.h @@ -47,7 +47,7 @@ PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[15] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[17] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; @@ -62,6 +62,12 @@ class GetUserIDResponse; struct GetUserIDResponseDefaultTypeInternal; extern GetUserIDResponseDefaultTypeInternal _GetUserIDResponse_default_instance_; +class GetUserPublicKeyRequest; +struct GetUserPublicKeyRequestDefaultTypeInternal; +extern GetUserPublicKeyRequestDefaultTypeInternal _GetUserPublicKeyRequest_default_instance_; +class GetUserPublicKeyResponse; +struct GetUserPublicKeyResponseDefaultTypeInternal; +extern GetUserPublicKeyResponseDefaultTypeInternal _GetUserPublicKeyResponse_default_instance_; class LoginRequest; struct LoginRequestDefaultTypeInternal; extern LoginRequestDefaultTypeInternal _LoginRequest_default_instance_; @@ -105,6 +111,8 @@ PROTOBUF_NAMESPACE_OPEN template<> ::identity::GetUserIDRequest* Arena::CreateMaybeMessage<::identity::GetUserIDRequest>(Arena*); template<> ::identity::GetUserIDResponse* Arena::CreateMaybeMessage<::identity::GetUserIDResponse>(Arena*); +template<> ::identity::GetUserPublicKeyRequest* Arena::CreateMaybeMessage<::identity::GetUserPublicKeyRequest>(Arena*); +template<> ::identity::GetUserPublicKeyResponse* Arena::CreateMaybeMessage<::identity::GetUserPublicKeyResponse>(Arena*); template<> ::identity::LoginRequest* Arena::CreateMaybeMessage<::identity::LoginRequest>(Arena*); template<> ::identity::LoginResponse* Arena::CreateMaybeMessage<::identity::LoginResponse>(Arena*); template<> ::identity::PakeCredentialRequestAndUserID* Arena::CreateMaybeMessage<::identity::PakeCredentialRequestAndUserID>(Arena*); @@ -2870,6 +2878,312 @@ mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_identity_2eproto; }; +// ------------------------------------------------------------------- + +class GetUserPublicKeyRequest PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:identity.GetUserPublicKeyRequest) */ { + public: + inline GetUserPublicKeyRequest() : GetUserPublicKeyRequest(nullptr) {} + virtual ~GetUserPublicKeyRequest(); + explicit constexpr GetUserPublicKeyRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GetUserPublicKeyRequest(const GetUserPublicKeyRequest& from); + GetUserPublicKeyRequest(GetUserPublicKeyRequest&& from) noexcept + : GetUserPublicKeyRequest() { + *this = ::std::move(from); + } + + inline GetUserPublicKeyRequest& operator=(const GetUserPublicKeyRequest& from) { + CopyFrom(from); + return *this; + } + inline GetUserPublicKeyRequest& operator=(GetUserPublicKeyRequest&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const GetUserPublicKeyRequest& default_instance() { + return *internal_default_instance(); + } + static inline const GetUserPublicKeyRequest* internal_default_instance() { + return reinterpret_cast( + &_GetUserPublicKeyRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + friend void swap(GetUserPublicKeyRequest& a, GetUserPublicKeyRequest& b) { + a.Swap(&b); + } + inline void Swap(GetUserPublicKeyRequest* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetUserPublicKeyRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline GetUserPublicKeyRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + GetUserPublicKeyRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const GetUserPublicKeyRequest& from); + void MergeFrom(const GetUserPublicKeyRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetUserPublicKeyRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "identity.GetUserPublicKeyRequest"; + } + protected: + explicit GetUserPublicKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + return ::descriptor_table_identity_2eproto_metadata_getter(kIndexInFileMessages); + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kUserIDFieldNumber = 1, + kDeviceIDFieldNumber = 2, + }; + // string userID = 1; + void clear_userid(); + const std::string& userid() const; + void set_userid(const std::string& value); + void set_userid(std::string&& value); + void set_userid(const char* value); + void set_userid(const char* value, size_t size); + std::string* mutable_userid(); + std::string* release_userid(); + void set_allocated_userid(std::string* userid); + private: + const std::string& _internal_userid() const; + void _internal_set_userid(const std::string& value); + std::string* _internal_mutable_userid(); + public: + + // string deviceID = 2; + void clear_deviceid(); + const std::string& deviceid() const; + void set_deviceid(const std::string& value); + void set_deviceid(std::string&& value); + void set_deviceid(const char* value); + void set_deviceid(const char* value, size_t size); + std::string* mutable_deviceid(); + std::string* release_deviceid(); + void set_allocated_deviceid(std::string* deviceid); + private: + const std::string& _internal_deviceid() const; + void _internal_set_deviceid(const std::string& value); + std::string* _internal_mutable_deviceid(); + public: + + // @@protoc_insertion_point(class_scope:identity.GetUserPublicKeyRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr userid_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr deviceid_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_identity_2eproto; +}; +// ------------------------------------------------------------------- + +class GetUserPublicKeyResponse PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:identity.GetUserPublicKeyResponse) */ { + public: + inline GetUserPublicKeyResponse() : GetUserPublicKeyResponse(nullptr) {} + virtual ~GetUserPublicKeyResponse(); + explicit constexpr GetUserPublicKeyResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GetUserPublicKeyResponse(const GetUserPublicKeyResponse& from); + GetUserPublicKeyResponse(GetUserPublicKeyResponse&& from) noexcept + : GetUserPublicKeyResponse() { + *this = ::std::move(from); + } + + inline GetUserPublicKeyResponse& operator=(const GetUserPublicKeyResponse& from) { + CopyFrom(from); + return *this; + } + inline GetUserPublicKeyResponse& operator=(GetUserPublicKeyResponse&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const GetUserPublicKeyResponse& default_instance() { + return *internal_default_instance(); + } + static inline const GetUserPublicKeyResponse* internal_default_instance() { + return reinterpret_cast( + &_GetUserPublicKeyResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + friend void swap(GetUserPublicKeyResponse& a, GetUserPublicKeyResponse& b) { + a.Swap(&b); + } + inline void Swap(GetUserPublicKeyResponse* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetUserPublicKeyResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline GetUserPublicKeyResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + GetUserPublicKeyResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const GetUserPublicKeyResponse& from); + void MergeFrom(const GetUserPublicKeyResponse& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetUserPublicKeyResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "identity.GetUserPublicKeyResponse"; + } + protected: + explicit GetUserPublicKeyResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + return ::descriptor_table_identity_2eproto_metadata_getter(kIndexInFileMessages); + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPublicKeyFieldNumber = 1, + }; + // string publicKey = 1; + void clear_publickey(); + const std::string& publickey() const; + void set_publickey(const std::string& value); + void set_publickey(std::string&& value); + void set_publickey(const char* value); + void set_publickey(const char* value, size_t size); + std::string* mutable_publickey(); + std::string* release_publickey(); + void set_allocated_publickey(std::string* publickey); + private: + const std::string& _internal_publickey() const; + void _internal_set_publickey(const std::string& value); + std::string* _internal_mutable_publickey(); + public: + + // @@protoc_insertion_point(class_scope:identity.GetUserPublicKeyResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_identity_2eproto; +}; // =================================================================== @@ -5507,6 +5821,197 @@ // @@protoc_insertion_point(field_set_allocated:identity.GetUserIDResponse.userID) } +// ------------------------------------------------------------------- + +// GetUserPublicKeyRequest + +// string userID = 1; +inline void GetUserPublicKeyRequest::clear_userid() { + userid_.ClearToEmpty(); +} +inline const std::string& GetUserPublicKeyRequest::userid() const { + // @@protoc_insertion_point(field_get:identity.GetUserPublicKeyRequest.userID) + return _internal_userid(); +} +inline void GetUserPublicKeyRequest::set_userid(const std::string& value) { + _internal_set_userid(value); + // @@protoc_insertion_point(field_set:identity.GetUserPublicKeyRequest.userID) +} +inline std::string* GetUserPublicKeyRequest::mutable_userid() { + // @@protoc_insertion_point(field_mutable:identity.GetUserPublicKeyRequest.userID) + return _internal_mutable_userid(); +} +inline const std::string& GetUserPublicKeyRequest::_internal_userid() const { + return userid_.Get(); +} +inline void GetUserPublicKeyRequest::_internal_set_userid(const std::string& value) { + + userid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); +} +inline void GetUserPublicKeyRequest::set_userid(std::string&& value) { + + userid_.Set( + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:identity.GetUserPublicKeyRequest.userID) +} +inline void GetUserPublicKeyRequest::set_userid(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + userid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); + // @@protoc_insertion_point(field_set_char:identity.GetUserPublicKeyRequest.userID) +} +inline void GetUserPublicKeyRequest::set_userid(const char* value, + size_t size) { + + userid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:identity.GetUserPublicKeyRequest.userID) +} +inline std::string* GetUserPublicKeyRequest::_internal_mutable_userid() { + + return userid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); +} +inline std::string* GetUserPublicKeyRequest::release_userid() { + // @@protoc_insertion_point(field_release:identity.GetUserPublicKeyRequest.userID) + return userid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void GetUserPublicKeyRequest::set_allocated_userid(std::string* userid) { + if (userid != nullptr) { + + } else { + + } + userid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), userid, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:identity.GetUserPublicKeyRequest.userID) +} + +// string deviceID = 2; +inline void GetUserPublicKeyRequest::clear_deviceid() { + deviceid_.ClearToEmpty(); +} +inline const std::string& GetUserPublicKeyRequest::deviceid() const { + // @@protoc_insertion_point(field_get:identity.GetUserPublicKeyRequest.deviceID) + return _internal_deviceid(); +} +inline void GetUserPublicKeyRequest::set_deviceid(const std::string& value) { + _internal_set_deviceid(value); + // @@protoc_insertion_point(field_set:identity.GetUserPublicKeyRequest.deviceID) +} +inline std::string* GetUserPublicKeyRequest::mutable_deviceid() { + // @@protoc_insertion_point(field_mutable:identity.GetUserPublicKeyRequest.deviceID) + return _internal_mutable_deviceid(); +} +inline const std::string& GetUserPublicKeyRequest::_internal_deviceid() const { + return deviceid_.Get(); +} +inline void GetUserPublicKeyRequest::_internal_set_deviceid(const std::string& value) { + + deviceid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); +} +inline void GetUserPublicKeyRequest::set_deviceid(std::string&& value) { + + deviceid_.Set( + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:identity.GetUserPublicKeyRequest.deviceID) +} +inline void GetUserPublicKeyRequest::set_deviceid(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + deviceid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); + // @@protoc_insertion_point(field_set_char:identity.GetUserPublicKeyRequest.deviceID) +} +inline void GetUserPublicKeyRequest::set_deviceid(const char* value, + size_t size) { + + deviceid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:identity.GetUserPublicKeyRequest.deviceID) +} +inline std::string* GetUserPublicKeyRequest::_internal_mutable_deviceid() { + + return deviceid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); +} +inline std::string* GetUserPublicKeyRequest::release_deviceid() { + // @@protoc_insertion_point(field_release:identity.GetUserPublicKeyRequest.deviceID) + return deviceid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void GetUserPublicKeyRequest::set_allocated_deviceid(std::string* deviceid) { + if (deviceid != nullptr) { + + } else { + + } + deviceid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), deviceid, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:identity.GetUserPublicKeyRequest.deviceID) +} + +// ------------------------------------------------------------------- + +// GetUserPublicKeyResponse + +// string publicKey = 1; +inline void GetUserPublicKeyResponse::clear_publickey() { + publickey_.ClearToEmpty(); +} +inline const std::string& GetUserPublicKeyResponse::publickey() const { + // @@protoc_insertion_point(field_get:identity.GetUserPublicKeyResponse.publicKey) + return _internal_publickey(); +} +inline void GetUserPublicKeyResponse::set_publickey(const std::string& value) { + _internal_set_publickey(value); + // @@protoc_insertion_point(field_set:identity.GetUserPublicKeyResponse.publicKey) +} +inline std::string* GetUserPublicKeyResponse::mutable_publickey() { + // @@protoc_insertion_point(field_mutable:identity.GetUserPublicKeyResponse.publicKey) + return _internal_mutable_publickey(); +} +inline const std::string& GetUserPublicKeyResponse::_internal_publickey() const { + return publickey_.Get(); +} +inline void GetUserPublicKeyResponse::_internal_set_publickey(const std::string& value) { + + publickey_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); +} +inline void GetUserPublicKeyResponse::set_publickey(std::string&& value) { + + publickey_.Set( + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:identity.GetUserPublicKeyResponse.publicKey) +} +inline void GetUserPublicKeyResponse::set_publickey(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + publickey_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); + // @@protoc_insertion_point(field_set_char:identity.GetUserPublicKeyResponse.publicKey) +} +inline void GetUserPublicKeyResponse::set_publickey(const char* value, + size_t size) { + + publickey_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:identity.GetUserPublicKeyResponse.publicKey) +} +inline std::string* GetUserPublicKeyResponse::_internal_mutable_publickey() { + + return publickey_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); +} +inline std::string* GetUserPublicKeyResponse::release_publickey() { + // @@protoc_insertion_point(field_release:identity.GetUserPublicKeyResponse.publicKey) + return publickey_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void GetUserPublicKeyResponse::set_allocated_publickey(std::string* publickey) { + if (publickey != nullptr) { + + } else { + + } + publickey_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), publickey, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:identity.GetUserPublicKeyResponse.publicKey) +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ @@ -5538,6 +6043,10 @@ // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/shared/protos/_generated/identity.pb.cc b/shared/protos/_generated/identity.pb.cc --- a/shared/protos/_generated/identity.pb.cc +++ b/shared/protos/_generated/identity.pb.cc @@ -213,8 +213,33 @@ }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetUserIDResponseDefaultTypeInternal _GetUserIDResponse_default_instance_; +constexpr GetUserPublicKeyRequest::GetUserPublicKeyRequest( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : userid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) + , deviceid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +struct GetUserPublicKeyRequestDefaultTypeInternal { + constexpr GetUserPublicKeyRequestDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~GetUserPublicKeyRequestDefaultTypeInternal() {} + union { + GetUserPublicKeyRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetUserPublicKeyRequestDefaultTypeInternal _GetUserPublicKeyRequest_default_instance_; +constexpr GetUserPublicKeyResponse::GetUserPublicKeyResponse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) + : publickey_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){} +struct GetUserPublicKeyResponseDefaultTypeInternal { + constexpr GetUserPublicKeyResponseDefaultTypeInternal() + : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} + ~GetUserPublicKeyResponseDefaultTypeInternal() {} + union { + GetUserPublicKeyResponse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetUserPublicKeyResponseDefaultTypeInternal _GetUserPublicKeyResponse_default_instance_; } // namespace identity -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_identity_2eproto[15]; +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_identity_2eproto[17]; static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_identity_2eproto[1]; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_identity_2eproto = nullptr; @@ -337,6 +362,19 @@ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ PROTOBUF_FIELD_OFFSET(::identity::GetUserIDResponse, userid_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::identity::GetUserPublicKeyRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::identity::GetUserPublicKeyRequest, userid_), + PROTOBUF_FIELD_OFFSET(::identity::GetUserPublicKeyRequest, deviceid_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::identity::GetUserPublicKeyResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::identity::GetUserPublicKeyResponse, publickey_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(::identity::PakeRegistrationRequestAndUserID)}, @@ -354,6 +392,8 @@ { 99, -1, sizeof(::identity::VerifyUserTokenResponse)}, { 105, -1, sizeof(::identity::GetUserIDRequest)}, { 112, -1, sizeof(::identity::GetUserIDResponse)}, + { 118, -1, sizeof(::identity::GetUserPublicKeyRequest)}, + { 125, -1, sizeof(::identity::GetUserPublicKeyResponse)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -372,6 +412,8 @@ reinterpret_cast(&::identity::_VerifyUserTokenResponse_default_instance_), reinterpret_cast(&::identity::_GetUserIDRequest_default_instance_), reinterpret_cast(&::identity::_GetUserIDResponse_default_instance_), + reinterpret_cast(&::identity::_GetUserPublicKeyRequest_default_instance_), + reinterpret_cast(&::identity::_GetUserPublicKeyResponse_default_instance_), }; const char descriptor_table_protodef_identity_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -419,21 +461,26 @@ "thType\030\001 \001(\0162#.identity.GetUserIDRequest" ".AuthType\022\020\n\010userInfo\030\002 \001(\t\"$\n\010AuthType\022" "\014\n\010PASSWORD\020\000\022\n\n\006WALLET\020\001\"#\n\021GetUserIDRe" - "sponse\022\016\n\006userID\030\001 \001(\t2\314\002\n\017IdentityServi" - "ce\022S\n\014RegisterUser\022\035.identity.Registrati" - "onRequest\032\036.identity.RegistrationRespons" - "e\"\000(\0010\001\022B\n\tLoginUser\022\026.identity.LoginReq" - "uest\032\027.identity.LoginResponse\"\000(\0010\001\022X\n\017V" - "erifyUserToken\022 .identity.VerifyUserToke" - "nRequest\032!.identity.VerifyUserTokenRespo" - "nse\"\000\022F\n\tGetUserID\022\032.identity.GetUserIDR" - "equest\032\033.identity.GetUserIDResponse\"\000b\006p" - "roto3" + "sponse\022\016\n\006userID\030\001 \001(\t\";\n\027GetUserPublicK" + "eyRequest\022\016\n\006userID\030\001 \001(\t\022\020\n\010deviceID\030\002 " + "\001(\t\"-\n\030GetUserPublicKeyResponse\022\021\n\tpubli" + "cKey\030\001 \001(\t2\251\003\n\017IdentityService\022S\n\014Regist" + "erUser\022\035.identity.RegistrationRequest\032\036." + "identity.RegistrationResponse\"\000(\0010\001\022B\n\tL" + "oginUser\022\026.identity.LoginRequest\032\027.ident" + "ity.LoginResponse\"\000(\0010\001\022X\n\017VerifyUserTok" + "en\022 .identity.VerifyUserTokenRequest\032!.i" + "dentity.VerifyUserTokenResponse\"\000\022F\n\tGet" + "UserID\022\032.identity.GetUserIDRequest\032\033.ide" + "ntity.GetUserIDResponse\"\000\022[\n\020GetUserPubl" + "icKey\022!.identity.GetUserPublicKeyRequest" + "\032\".identity.GetUserPublicKeyResponse\"\000b\006" + "proto3" ; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_identity_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_identity_2eproto = { - false, false, 2125, descriptor_table_protodef_identity_2eproto, "identity.proto", - &descriptor_table_identity_2eproto_once, nullptr, 0, 15, + false, false, 2326, descriptor_table_protodef_identity_2eproto, "identity.proto", + &descriptor_table_identity_2eproto_once, nullptr, 0, 17, schemas, file_default_instances, TableStruct_identity_2eproto::offsets, file_level_metadata_identity_2eproto, file_level_enum_descriptors_identity_2eproto, file_level_service_descriptors_identity_2eproto, }; @@ -4584,6 +4631,444 @@ } +// =================================================================== + +class GetUserPublicKeyRequest::_Internal { + public: +}; + +GetUserPublicKeyRequest::GetUserPublicKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:identity.GetUserPublicKeyRequest) +} +GetUserPublicKeyRequest::GetUserPublicKeyRequest(const GetUserPublicKeyRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + userid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_userid().empty()) { + userid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_userid(), + GetArena()); + } + deviceid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_deviceid().empty()) { + deviceid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_deviceid(), + GetArena()); + } + // @@protoc_insertion_point(copy_constructor:identity.GetUserPublicKeyRequest) +} + +void GetUserPublicKeyRequest::SharedCtor() { +userid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +deviceid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +GetUserPublicKeyRequest::~GetUserPublicKeyRequest() { + // @@protoc_insertion_point(destructor:identity.GetUserPublicKeyRequest) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void GetUserPublicKeyRequest::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + userid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + deviceid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void GetUserPublicKeyRequest::ArenaDtor(void* object) { + GetUserPublicKeyRequest* _this = reinterpret_cast< GetUserPublicKeyRequest* >(object); + (void)_this; +} +void GetUserPublicKeyRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void GetUserPublicKeyRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void GetUserPublicKeyRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:identity.GetUserPublicKeyRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + userid_.ClearToEmpty(); + deviceid_.ClearToEmpty(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GetUserPublicKeyRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string userID = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + auto str = _internal_mutable_userid(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "identity.GetUserPublicKeyRequest.userID")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string deviceID = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + auto str = _internal_mutable_deviceid(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "identity.GetUserPublicKeyRequest.deviceID")); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* GetUserPublicKeyRequest::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:identity.GetUserPublicKeyRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string userID = 1; + if (this->userid().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_userid().data(), static_cast(this->_internal_userid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "identity.GetUserPublicKeyRequest.userID"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_userid(), target); + } + + // string deviceID = 2; + if (this->deviceid().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_deviceid().data(), static_cast(this->_internal_deviceid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "identity.GetUserPublicKeyRequest.deviceID"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_deviceid(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:identity.GetUserPublicKeyRequest) + return target; +} + +size_t GetUserPublicKeyRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:identity.GetUserPublicKeyRequest) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string userID = 1; + if (this->userid().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_userid()); + } + + // string deviceID = 2; + if (this->deviceid().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_deviceid()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetUserPublicKeyRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:identity.GetUserPublicKeyRequest) + GOOGLE_DCHECK_NE(&from, this); + const GetUserPublicKeyRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:identity.GetUserPublicKeyRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:identity.GetUserPublicKeyRequest) + MergeFrom(*source); + } +} + +void GetUserPublicKeyRequest::MergeFrom(const GetUserPublicKeyRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:identity.GetUserPublicKeyRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.userid().size() > 0) { + _internal_set_userid(from._internal_userid()); + } + if (from.deviceid().size() > 0) { + _internal_set_deviceid(from._internal_deviceid()); + } +} + +void GetUserPublicKeyRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:identity.GetUserPublicKeyRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetUserPublicKeyRequest::CopyFrom(const GetUserPublicKeyRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:identity.GetUserPublicKeyRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetUserPublicKeyRequest::IsInitialized() const { + return true; +} + +void GetUserPublicKeyRequest::InternalSwap(GetUserPublicKeyRequest* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + userid_.Swap(&other->userid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + deviceid_.Swap(&other->deviceid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GetUserPublicKeyRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +class GetUserPublicKeyResponse::_Internal { + public: +}; + +GetUserPublicKeyResponse::GetUserPublicKeyResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:identity.GetUserPublicKeyResponse) +} +GetUserPublicKeyResponse::GetUserPublicKeyResponse(const GetUserPublicKeyResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + publickey_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_publickey().empty()) { + publickey_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_publickey(), + GetArena()); + } + // @@protoc_insertion_point(copy_constructor:identity.GetUserPublicKeyResponse) +} + +void GetUserPublicKeyResponse::SharedCtor() { +publickey_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +GetUserPublicKeyResponse::~GetUserPublicKeyResponse() { + // @@protoc_insertion_point(destructor:identity.GetUserPublicKeyResponse) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void GetUserPublicKeyResponse::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + publickey_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void GetUserPublicKeyResponse::ArenaDtor(void* object) { + GetUserPublicKeyResponse* _this = reinterpret_cast< GetUserPublicKeyResponse* >(object); + (void)_this; +} +void GetUserPublicKeyResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void GetUserPublicKeyResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} + +void GetUserPublicKeyResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:identity.GetUserPublicKeyResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + publickey_.ClearToEmpty(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GetUserPublicKeyResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string publicKey = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + auto str = _internal_mutable_publickey(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "identity.GetUserPublicKeyResponse.publicKey")); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* GetUserPublicKeyResponse::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:identity.GetUserPublicKeyResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string publicKey = 1; + if (this->publickey().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_publickey().data(), static_cast(this->_internal_publickey().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "identity.GetUserPublicKeyResponse.publicKey"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_publickey(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:identity.GetUserPublicKeyResponse) + return target; +} + +size_t GetUserPublicKeyResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:identity.GetUserPublicKeyResponse) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string publicKey = 1; + if (this->publickey().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_publickey()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetUserPublicKeyResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:identity.GetUserPublicKeyResponse) + GOOGLE_DCHECK_NE(&from, this); + const GetUserPublicKeyResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:identity.GetUserPublicKeyResponse) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:identity.GetUserPublicKeyResponse) + MergeFrom(*source); + } +} + +void GetUserPublicKeyResponse::MergeFrom(const GetUserPublicKeyResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:identity.GetUserPublicKeyResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.publickey().size() > 0) { + _internal_set_publickey(from._internal_publickey()); + } +} + +void GetUserPublicKeyResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:identity.GetUserPublicKeyResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetUserPublicKeyResponse::CopyFrom(const GetUserPublicKeyResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:identity.GetUserPublicKeyResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetUserPublicKeyResponse::IsInitialized() const { + return true; +} + +void GetUserPublicKeyResponse::InternalSwap(GetUserPublicKeyResponse* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + publickey_.Swap(&other->publickey_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GetUserPublicKeyResponse::GetMetadata() const { + return GetMetadataStatic(); +} + + // @@protoc_insertion_point(namespace_scope) } // namespace identity PROTOBUF_NAMESPACE_OPEN @@ -4632,6 +5117,12 @@ template<> PROTOBUF_NOINLINE ::identity::GetUserIDResponse* Arena::CreateMaybeMessage< ::identity::GetUserIDResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::identity::GetUserIDResponse >(arena); } +template<> PROTOBUF_NOINLINE ::identity::GetUserPublicKeyRequest* Arena::CreateMaybeMessage< ::identity::GetUserPublicKeyRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::identity::GetUserPublicKeyRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::identity::GetUserPublicKeyResponse* Arena::CreateMaybeMessage< ::identity::GetUserPublicKeyResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::identity::GetUserPublicKeyResponse >(arena); +} PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) diff --git a/shared/protos/_generated/tunnelbroker.grpc.pb.h b/shared/protos/_generated/tunnelbroker.grpc.pb.h --- a/shared/protos/_generated/tunnelbroker.grpc.pb.h +++ b/shared/protos/_generated/tunnelbroker.grpc.pb.h @@ -93,6 +93,8 @@ return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::tunnelbroker::GetResponse>>(PrepareAsyncGetRaw(context, request, cq)); } // Replacing Send and Get with a single bidirectional streaming RPC + // The client should provide the valid `sessionID` identifier + // from the `NewSession` in the stream request metadata std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::tunnelbroker::MessageToTunnelbroker, ::tunnelbroker::MessageToClient>> MessagesStream(::grpc::ClientContext* context) { return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::tunnelbroker::MessageToTunnelbroker, ::tunnelbroker::MessageToClient>>(MessagesStreamRaw(context)); } @@ -125,6 +127,8 @@ virtual void Send(::grpc::ClientContext* context, const ::tunnelbroker::SendRequest* request, ::google::protobuf::Empty* response, ::grpc::ClientUnaryReactor* reactor) = 0; virtual void Get(::grpc::ClientContext* context, const ::tunnelbroker::GetRequest* request, ::grpc::ClientReadReactor< ::tunnelbroker::GetResponse>* reactor) = 0; // Replacing Send and Get with a single bidirectional streaming RPC + // The client should provide the valid `sessionID` identifier + // from the `NewSession` in the stream request metadata virtual void MessagesStream(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::tunnelbroker::MessageToTunnelbroker,::tunnelbroker::MessageToClient>* reactor) = 0; }; typedef class async_interface experimental_async_interface; @@ -288,6 +292,8 @@ virtual ::grpc::Status Send(::grpc::ServerContext* context, const ::tunnelbroker::SendRequest* request, ::google::protobuf::Empty* response); virtual ::grpc::Status Get(::grpc::ServerContext* context, const ::tunnelbroker::GetRequest* request, ::grpc::ServerWriter< ::tunnelbroker::GetResponse>* writer); // Replacing Send and Get with a single bidirectional streaming RPC + // The client should provide the valid `sessionID` identifier + // from the `NewSession` in the stream request metadata virtual ::grpc::Status MessagesStream(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::tunnelbroker::MessageToClient, ::tunnelbroker::MessageToTunnelbroker>* stream); }; template diff --git a/shared/protos/_generated/tunnelbroker.pb.h b/shared/protos/_generated/tunnelbroker.pb.h --- a/shared/protos/_generated/tunnelbroker.pb.h +++ b/shared/protos/_generated/tunnelbroker.pb.h @@ -2222,9 +2222,9 @@ return *internal_default_instance(); } enum DataCase { - kMessagesToSend = 2, - kProcessedMessages = 3, - kNewNotifyToken = 4, + kMessagesToSend = 1, + kProcessedMessages = 2, + kNewNotifyToken = 3, DATA_NOT_SET = 0, }; @@ -2303,28 +2303,11 @@ // accessors ------------------------------------------------------- enum : int { - kSessionIDFieldNumber = 1, - kMessagesToSendFieldNumber = 2, - kProcessedMessagesFieldNumber = 3, - kNewNotifyTokenFieldNumber = 4, + kMessagesToSendFieldNumber = 1, + kProcessedMessagesFieldNumber = 2, + kNewNotifyTokenFieldNumber = 3, }; - // string sessionID = 1; - void clear_sessionid(); - const std::string& sessionid() const; - void set_sessionid(const std::string& value); - void set_sessionid(std::string&& value); - void set_sessionid(const char* value); - void set_sessionid(const char* value, size_t size); - std::string* mutable_sessionid(); - std::string* release_sessionid(); - void set_allocated_sessionid(std::string* sessionid); - private: - const std::string& _internal_sessionid() const; - void _internal_set_sessionid(const std::string& value); - std::string* _internal_mutable_sessionid(); - public: - - // .tunnelbroker.MessagesToSend messagesToSend = 2; + // .tunnelbroker.MessagesToSend messagesToSend = 1; bool has_messagestosend() const; private: bool _internal_has_messagestosend() const; @@ -2342,7 +2325,7 @@ ::tunnelbroker::MessagesToSend* messagestosend); ::tunnelbroker::MessagesToSend* unsafe_arena_release_messagestosend(); - // .tunnelbroker.ProcessedMessages processedMessages = 3; + // .tunnelbroker.ProcessedMessages processedMessages = 2; bool has_processedmessages() const; private: bool _internal_has_processedmessages() const; @@ -2360,7 +2343,7 @@ ::tunnelbroker::ProcessedMessages* processedmessages); ::tunnelbroker::ProcessedMessages* unsafe_arena_release_processedmessages(); - // string newNotifyToken = 4; + // string newNotifyToken = 3; bool has_newnotifytoken() const; private: bool _internal_has_newnotifytoken() const; @@ -2395,7 +2378,6 @@ template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sessionid_; union DataUnion { constexpr DataUnion() : _constinit_{} {} ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; @@ -5554,68 +5536,7 @@ // MessageToTunnelbroker -// string sessionID = 1; -inline void MessageToTunnelbroker::clear_sessionid() { - sessionid_.ClearToEmpty(); -} -inline const std::string& MessageToTunnelbroker::sessionid() const { - // @@protoc_insertion_point(field_get:tunnelbroker.MessageToTunnelbroker.sessionID) - return _internal_sessionid(); -} -inline void MessageToTunnelbroker::set_sessionid(const std::string& value) { - _internal_set_sessionid(value); - // @@protoc_insertion_point(field_set:tunnelbroker.MessageToTunnelbroker.sessionID) -} -inline std::string* MessageToTunnelbroker::mutable_sessionid() { - // @@protoc_insertion_point(field_mutable:tunnelbroker.MessageToTunnelbroker.sessionID) - return _internal_mutable_sessionid(); -} -inline const std::string& MessageToTunnelbroker::_internal_sessionid() const { - return sessionid_.Get(); -} -inline void MessageToTunnelbroker::_internal_set_sessionid(const std::string& value) { - - sessionid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena()); -} -inline void MessageToTunnelbroker::set_sessionid(std::string&& value) { - - sessionid_.Set( - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:tunnelbroker.MessageToTunnelbroker.sessionID) -} -inline void MessageToTunnelbroker::set_sessionid(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - sessionid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena()); - // @@protoc_insertion_point(field_set_char:tunnelbroker.MessageToTunnelbroker.sessionID) -} -inline void MessageToTunnelbroker::set_sessionid(const char* value, - size_t size) { - - sessionid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:tunnelbroker.MessageToTunnelbroker.sessionID) -} -inline std::string* MessageToTunnelbroker::_internal_mutable_sessionid() { - - return sessionid_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena()); -} -inline std::string* MessageToTunnelbroker::release_sessionid() { - // @@protoc_insertion_point(field_release:tunnelbroker.MessageToTunnelbroker.sessionID) - return sessionid_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void MessageToTunnelbroker::set_allocated_sessionid(std::string* sessionid) { - if (sessionid != nullptr) { - - } else { - - } - sessionid_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), sessionid, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:tunnelbroker.MessageToTunnelbroker.sessionID) -} - -// .tunnelbroker.MessagesToSend messagesToSend = 2; +// .tunnelbroker.MessagesToSend messagesToSend = 1; inline bool MessageToTunnelbroker::_internal_has_messagestosend() const { return data_case() == kMessagesToSend; } @@ -5688,7 +5609,7 @@ return _internal_mutable_messagestosend(); } -// .tunnelbroker.ProcessedMessages processedMessages = 3; +// .tunnelbroker.ProcessedMessages processedMessages = 2; inline bool MessageToTunnelbroker::_internal_has_processedmessages() const { return data_case() == kProcessedMessages; } @@ -5761,7 +5682,7 @@ return _internal_mutable_processedmessages(); } -// string newNotifyToken = 4; +// string newNotifyToken = 3; inline bool MessageToTunnelbroker::_internal_has_newnotifytoken() const { return data_case() == kNewNotifyToken; } diff --git a/shared/protos/_generated/tunnelbroker.pb.cc b/shared/protos/_generated/tunnelbroker.pb.cc --- a/shared/protos/_generated/tunnelbroker.pb.cc +++ b/shared/protos/_generated/tunnelbroker.pb.cc @@ -167,8 +167,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MessagesToSendDefaultTypeInternal _MessagesToSend_default_instance_; constexpr MessageToTunnelbroker::MessageToTunnelbroker( ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized) - : sessionid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string) - , _oneof_case_{}{} + : _oneof_case_{}{} struct MessageToTunnelbrokerDefaultTypeInternal { constexpr MessageToTunnelbrokerDefaultTypeInternal() : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {} @@ -385,7 +384,6 @@ ~0u, // no _extensions_ PROTOBUF_FIELD_OFFSET(::tunnelbroker::MessageToTunnelbroker, _oneof_case_[0]), ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::tunnelbroker::MessageToTunnelbroker, sessionid_), ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, ::PROTOBUF_NAMESPACE_ID::internal::kInvalidFieldOffsetTag, @@ -462,14 +460,14 @@ { 78, -1, sizeof(::tunnelbroker::MessageToTunnelbrokerStruct)}, { 87, -1, sizeof(::tunnelbroker::MessagesToSend)}, { 93, -1, sizeof(::tunnelbroker::MessageToTunnelbroker)}, - { 103, -1, sizeof(::tunnelbroker::MessageToClientStruct)}, - { 112, -1, sizeof(::tunnelbroker::MessagesToDeliver)}, - { 118, -1, sizeof(::tunnelbroker::MessageToClient)}, - { 128, -1, sizeof(::tunnelbroker::CheckRequest)}, - { 135, -1, sizeof(::tunnelbroker::CheckResponse)}, - { 141, -1, sizeof(::tunnelbroker::NewPrimaryRequest)}, - { 148, -1, sizeof(::tunnelbroker::NewPrimaryResponse)}, - { 154, -1, sizeof(::tunnelbroker::PongRequest)}, + { 102, -1, sizeof(::tunnelbroker::MessageToClientStruct)}, + { 111, -1, sizeof(::tunnelbroker::MessagesToDeliver)}, + { 117, -1, sizeof(::tunnelbroker::MessageToClient)}, + { 127, -1, sizeof(::tunnelbroker::CheckRequest)}, + { 134, -1, sizeof(::tunnelbroker::CheckResponse)}, + { 140, -1, sizeof(::tunnelbroker::NewPrimaryRequest)}, + { 147, -1, sizeof(::tunnelbroker::NewPrimaryResponse)}, + { 153, -1, sizeof(::tunnelbroker::PongRequest)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -524,56 +522,56 @@ "\022\n\ntoDeviceID\030\002 \001(\t\022\017\n\007payload\030\003 \001(\t\022\022\n\n" "blobHashes\030\004 \003(\t\"M\n\016MessagesToSend\022;\n\010me" "ssages\030\001 \003(\0132).tunnelbroker.MessageToTun" - "nelbrokerStruct\"\302\001\n\025MessageToTunnelbroke" - "r\022\021\n\tsessionID\030\001 \001(\t\0226\n\016messagesToSend\030\002" - " \001(\0132\034.tunnelbroker.MessagesToSendH\000\022<\n\021" - "processedMessages\030\003 \001(\0132\037.tunnelbroker.P" - "rocessedMessagesH\000\022\030\n\016newNotifyToken\030\004 \001" - "(\tH\000B\006\n\004data\"e\n\025MessageToClientStruct\022\021\n" - "\tmessageID\030\001 \001(\t\022\024\n\014fromDeviceID\030\002 \001(\t\022\017" - "\n\007payload\030\003 \001(\t\022\022\n\nblobHashes\030\004 \003(\t\"J\n\021M" - "essagesToDeliver\0225\n\010messages\030\001 \003(\0132#.tun" - "nelbroker.MessageToClientStruct\"\367\001\n\017Mess" - "ageToClient\022<\n\021messagesToDeliver\030\001 \001(\0132\037" - ".tunnelbroker.MessagesToDeliverH\000\022<\n\021pro" - "cessedMessages\030\002 \001(\0132\037.tunnelbroker.Proc" - "essedMessagesH\000\0228\n\026newNotifyTokenRequire" - "d\030\003 \001(\0132\026.google.protobuf.EmptyH\000\022&\n\004pin" - "g\030\004 \001(\0132\026.google.protobuf.EmptyH\000B\006\n\004dat" - "a\"3\n\014CheckRequest\022\016\n\006userId\030\001 \001(\t\022\023\n\013dev" - "iceToken\030\002 \001(\t\"K\n\rCheckResponse\022:\n\021check" - "ResponseType\030\001 \001(\0162\037.tunnelbroker.CheckR" - "esponseType\"8\n\021NewPrimaryRequest\022\016\n\006user" - "Id\030\001 \001(\t\022\023\n\013deviceToken\030\002 \001(\t\"%\n\022NewPrim" - "aryResponse\022\017\n\007success\030\001 \001(\010\"2\n\013PongRequ" - "est\022\016\n\006userId\030\001 \001(\t\022\023\n\013deviceToken\030\002 \001(\t" - "*n\n\021CheckResponseType\022\030\n\024PRIMARY_DOESNT_" - "EXIST\020\000\022\022\n\016PRIMARY_ONLINE\020\001\022\023\n\017PRIMARY_O" - "FFLINE\020\002\022\026\n\022CURRENT_IS_PRIMARY\020\0032\237\005\n\023Tun" - "nelbrokerService\022W\n\032CheckIfPrimaryDevice" - "Online\022\032.tunnelbroker.CheckRequest\032\033.tun" - "nelbroker.CheckResponse\"\000\022]\n\026BecomeNewPr" - "imaryDevice\022\037.tunnelbroker.NewPrimaryReq" - "uest\032 .tunnelbroker.NewPrimaryResponse\"\000" - "\022\?\n\010SendPong\022\031.tunnelbroker.PongRequest\032" - "\026.google.protobuf.Empty\"\000\022c\n\020SessionSign" - "ature\022%.tunnelbroker.SessionSignatureReq" - "uest\032&.tunnelbroker.SessionSignatureResp" - "onse\"\000\022Q\n\nNewSession\022\037.tunnelbroker.NewS" - "essionRequest\032 .tunnelbroker.NewSessionR" - "esponse\"\000\022;\n\004Send\022\031.tunnelbroker.SendReq" - "uest\032\026.google.protobuf.Empty\"\000\022>\n\003Get\022\030." - "tunnelbroker.GetRequest\032\031.tunnelbroker.G" - "etResponse\"\0000\001\022Z\n\016MessagesStream\022#.tunne" - "lbroker.MessageToTunnelbroker\032\035.tunnelbr" - "oker.MessageToClient\"\000(\0010\001b\006proto3" + "nelbrokerStruct\"\257\001\n\025MessageToTunnelbroke" + "r\0226\n\016messagesToSend\030\001 \001(\0132\034.tunnelbroker" + ".MessagesToSendH\000\022<\n\021processedMessages\030\002" + " \001(\0132\037.tunnelbroker.ProcessedMessagesH\000\022" + "\030\n\016newNotifyToken\030\003 \001(\tH\000B\006\n\004data\"e\n\025Mes" + "sageToClientStruct\022\021\n\tmessageID\030\001 \001(\t\022\024\n" + "\014fromDeviceID\030\002 \001(\t\022\017\n\007payload\030\003 \001(\t\022\022\n\n" + "blobHashes\030\004 \003(\t\"J\n\021MessagesToDeliver\0225\n" + "\010messages\030\001 \003(\0132#.tunnelbroker.MessageTo" + "ClientStruct\"\367\001\n\017MessageToClient\022<\n\021mess" + "agesToDeliver\030\001 \001(\0132\037.tunnelbroker.Messa" + "gesToDeliverH\000\022<\n\021processedMessages\030\002 \001(" + "\0132\037.tunnelbroker.ProcessedMessagesH\000\0228\n\026" + "newNotifyTokenRequired\030\003 \001(\0132\026.google.pr" + "otobuf.EmptyH\000\022&\n\004ping\030\004 \001(\0132\026.google.pr" + "otobuf.EmptyH\000B\006\n\004data\"3\n\014CheckRequest\022\016" + "\n\006userId\030\001 \001(\t\022\023\n\013deviceToken\030\002 \001(\t\"K\n\rC" + "heckResponse\022:\n\021checkResponseType\030\001 \001(\0162" + "\037.tunnelbroker.CheckResponseType\"8\n\021NewP" + "rimaryRequest\022\016\n\006userId\030\001 \001(\t\022\023\n\013deviceT" + "oken\030\002 \001(\t\"%\n\022NewPrimaryResponse\022\017\n\007succ" + "ess\030\001 \001(\010\"2\n\013PongRequest\022\016\n\006userId\030\001 \001(\t" + "\022\023\n\013deviceToken\030\002 \001(\t*n\n\021CheckResponseTy" + "pe\022\030\n\024PRIMARY_DOESNT_EXIST\020\000\022\022\n\016PRIMARY_" + "ONLINE\020\001\022\023\n\017PRIMARY_OFFLINE\020\002\022\026\n\022CURRENT" + "_IS_PRIMARY\020\0032\237\005\n\023TunnelbrokerService\022W\n" + "\032CheckIfPrimaryDeviceOnline\022\032.tunnelbrok" + "er.CheckRequest\032\033.tunnelbroker.CheckResp" + "onse\"\000\022]\n\026BecomeNewPrimaryDevice\022\037.tunne" + "lbroker.NewPrimaryRequest\032 .tunnelbroker" + ".NewPrimaryResponse\"\000\022\?\n\010SendPong\022\031.tunn" + "elbroker.PongRequest\032\026.google.protobuf.E" + "mpty\"\000\022c\n\020SessionSignature\022%.tunnelbroke" + "r.SessionSignatureRequest\032&.tunnelbroker" + ".SessionSignatureResponse\"\000\022Q\n\nNewSessio" + "n\022\037.tunnelbroker.NewSessionRequest\032 .tun" + "nelbroker.NewSessionResponse\"\000\022;\n\004Send\022\031" + ".tunnelbroker.SendRequest\032\026.google.proto" + "buf.Empty\"\000\022>\n\003Get\022\030.tunnelbroker.GetReq" + "uest\032\031.tunnelbroker.GetResponse\"\0000\001\022Z\n\016M" + "essagesStream\022#.tunnelbroker.MessageToTu" + "nnelbroker\032\035.tunnelbroker.MessageToClien" + "t\"\000(\0010\001b\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tunnelbroker_2eproto_deps[1] = { &::descriptor_table_google_2fprotobuf_2fempty_2eproto, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tunnelbroker_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tunnelbroker_2eproto = { - false, false, 2834, descriptor_table_protodef_tunnelbroker_2eproto, "tunnelbroker.proto", + false, false, 2815, descriptor_table_protodef_tunnelbroker_2eproto, "tunnelbroker.proto", &descriptor_table_tunnelbroker_2eproto_once, descriptor_table_tunnelbroker_2eproto_deps, 1, 20, schemas, file_default_instances, TableStruct_tunnelbroker_2eproto::offsets, file_level_metadata_tunnelbroker_2eproto, file_level_enum_descriptors_tunnelbroker_2eproto, file_level_service_descriptors_tunnelbroker_2eproto, @@ -3628,11 +3626,6 @@ MessageToTunnelbroker::MessageToTunnelbroker(const MessageToTunnelbroker& from) : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - sessionid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_sessionid().empty()) { - sessionid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_sessionid(), - GetArena()); - } clear_has_data(); switch (from.data_case()) { case kMessagesToSend: { @@ -3655,7 +3648,6 @@ } void MessageToTunnelbroker::SharedCtor() { -sessionid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); clear_has_data(); } @@ -3667,7 +3659,6 @@ void MessageToTunnelbroker::SharedDtor() { GOOGLE_DCHECK(GetArena() == nullptr); - sessionid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (has_data()) { clear_data(); } @@ -3716,7 +3707,6 @@ // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - sessionid_.ClearToEmpty(); clear_data(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -3728,32 +3718,23 @@ ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); CHK_(ptr); switch (tag >> 3) { - // string sessionID = 1; + // .tunnelbroker.MessagesToSend messagesToSend = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - auto str = _internal_mutable_sessionid(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "tunnelbroker.MessageToTunnelbroker.sessionID")); + ptr = ctx->ParseMessage(_internal_mutable_messagestosend(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .tunnelbroker.MessagesToSend messagesToSend = 2; + // .tunnelbroker.ProcessedMessages processedMessages = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_messagestosend(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_processedmessages(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .tunnelbroker.ProcessedMessages processedMessages = 3; + // string newNotifyToken = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_processedmessages(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string newNotifyToken = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { auto str = _internal_mutable_newnotifytoken(); ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "tunnelbroker.MessageToTunnelbroker.newNotifyToken")); @@ -3788,40 +3769,30 @@ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // string sessionID = 1; - if (this->sessionid().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_sessionid().data(), static_cast(this->_internal_sessionid().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "tunnelbroker.MessageToTunnelbroker.sessionID"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_sessionid(), target); - } - - // .tunnelbroker.MessagesToSend messagesToSend = 2; + // .tunnelbroker.MessagesToSend messagesToSend = 1; if (_internal_has_messagestosend()) { target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage( - 2, _Internal::messagestosend(this), target, stream); + 1, _Internal::messagestosend(this), target, stream); } - // .tunnelbroker.ProcessedMessages processedMessages = 3; + // .tunnelbroker.ProcessedMessages processedMessages = 2; if (_internal_has_processedmessages()) { target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage( - 3, _Internal::processedmessages(this), target, stream); + 2, _Internal::processedmessages(this), target, stream); } - // string newNotifyToken = 4; + // string newNotifyToken = 3; if (_internal_has_newnotifytoken()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_newnotifytoken().data(), static_cast(this->_internal_newnotifytoken().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "tunnelbroker.MessageToTunnelbroker.newNotifyToken"); target = stream->WriteStringMaybeAliased( - 4, this->_internal_newnotifytoken(), target); + 3, this->_internal_newnotifytoken(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -3840,29 +3811,22 @@ // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string sessionID = 1; - if (this->sessionid().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_sessionid()); - } - switch (data_case()) { - // .tunnelbroker.MessagesToSend messagesToSend = 2; + // .tunnelbroker.MessagesToSend messagesToSend = 1; case kMessagesToSend: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *data_.messagestosend_); break; } - // .tunnelbroker.ProcessedMessages processedMessages = 3; + // .tunnelbroker.ProcessedMessages processedMessages = 2; case kProcessedMessages: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *data_.processedmessages_); break; } - // string newNotifyToken = 4; + // string newNotifyToken = 3; case kNewNotifyToken: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( @@ -3904,9 +3868,6 @@ ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from.sessionid().size() > 0) { - _internal_set_sessionid(from._internal_sessionid()); - } switch (from.data_case()) { case kMessagesToSend: { _internal_mutable_messagestosend()->::tunnelbroker::MessagesToSend::MergeFrom(from._internal_messagestosend()); @@ -3947,7 +3908,6 @@ void MessageToTunnelbroker::InternalSwap(MessageToTunnelbroker* other) { using std::swap; _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - sessionid_.Swap(&other->sessionid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); swap(data_, other->data_); swap(_oneof_case_[0], other->_oneof_case_[0]); } diff --git a/shared/protos/identity.proto b/shared/protos/identity.proto --- a/shared/protos/identity.proto +++ b/shared/protos/identity.proto @@ -14,6 +14,10 @@ // Called by users and keyservers to get userID corresponding to a wallet // address or username rpc GetUserID(GetUserIDRequest) returns (GetUserIDResponse) {} + // Called by keyservers to get the public key corresponding to a given user ID + // and device ID + rpc GetUserPublicKey(GetUserPublicKeyRequest) returns + (GetUserPublicKeyResponse) {} } // Helper types @@ -138,3 +142,14 @@ message GetUserIDResponse { string userID = 1; } + +// GetUserPublicKey + +message GetUserPublicKeyRequest { + string userID = 1; + string deviceID = 2; +} + +message GetUserPublicKeyResponse { + string publicKey = 1; +}