Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3275638
D4614.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D4614.diff
View Options
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<GetUserIdRequest>,
+ ) -> Result<Response<GetUserIdResponse>, Status> {
+ unimplemented!();
+ }
}
async fn put_token_helper(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 7:09 AM (19 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2517491
Default Alt Text
D4614.diff (2 KB)
Attached To
Mode
D4614: [services] add GetUserID RPC
Attached
Detach File
Event Timeline
Log In to Comment