diff --git a/native/cpp/CommonCpp/grpc/protos/identity.proto b/native/cpp/CommonCpp/grpc/protos/identity.proto --- a/native/cpp/CommonCpp/grpc/protos/identity.proto +++ b/native/cpp/CommonCpp/grpc/protos/identity.proto @@ -11,6 +11,9 @@ // Called by other services to verify a user's token rpc VerifyUserToken(VerifyUserTokenRequest) returns (VerifyUserTokenResponse) {} + // Called by users and keyservers to get userID corresponding to a wallet + // address or username + rpc GetUserID(GetUserIDRequest) returns (GetUserIDResponse) {} } // Helper types @@ -119,3 +122,18 @@ message VerifyUserTokenResponse { bool tokenValid = 1; } + +// GetUserID + +message GetUserIDRequest { + enum AuthType { + PASSWORD = 0; + WALLET = 1; + } + AuthType authType = 1; + string userInfo = 2; +} + +message GetUserIDResponse { + string userID = 1; +} 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 @@ -38,8 +38,9 @@ registration_request::Data::PakeRegistrationRequestAndUserId, registration_request::Data::PakeRegistrationUploadAndCredentialRequest, registration_response::Data::PakeLoginResponse as PakeRegistrationLoginResponse, - registration_response::Data::PakeRegistrationResponse, LoginRequest, - LoginResponse, PakeLoginRequest as PakeLoginRequestStruct, + registration_response::Data::PakeRegistrationResponse, GetUserIdRequest, + GetUserIdResponse, LoginRequest, LoginResponse, + PakeLoginRequest as PakeLoginRequestStruct, PakeLoginResponse as PakeLoginResponseStruct, RegistrationRequest, RegistrationResponse, VerifyUserTokenRequest, VerifyUserTokenResponse, WalletLoginRequest as WalletLoginRequestStruct, @@ -342,6 +343,14 @@ info!("Sending VerifyUserToken response: {:?}", response); Ok(response) } + + #[instrument(skip(self))] + async fn get_user_id( + &self, + request: Request, + ) -> Result, Status> { + unimplemented!(); + } } async fn put_token_helper(