diff --git a/services/identity/src/client_service.rs b/services/identity/src/client_service.rs --- a/services/identity/src/client_service.rs +++ b/services/identity/src/client_service.rs @@ -4,8 +4,9 @@ use crate::{ client_service::client_proto::{ - DeleteUserRequest, Empty, GenerateNonceResponse, KeyserverKeysRequest, - KeyserverKeysResponse, OpaqueLoginFinishRequest, OpaqueLoginFinishResponse, + CompareUsersRequest, CompareUsersResponse, DeleteUserRequest, Empty, + GenerateNonceResponse, KeyserverKeysRequest, KeyserverKeysResponse, + OpaqueLoginFinishRequest, OpaqueLoginFinishResponse, OpaqueLoginStartRequest, OpaqueLoginStartResponse, ReceiverKeysForUserRequest, ReceiverKeysForUserResponse, RefreshUserPreKeysRequest, RegistrationFinishRequest, @@ -150,4 +151,11 @@ ) -> Result, tonic::Status> { unimplemented!(); } + + async fn compare_users( + &self, + _request: tonic::Request, + ) -> Result, tonic::Status> { + unimplemented!(); + } } diff --git a/shared/protos/identity_client.proto b/shared/protos/identity_client.proto --- a/shared/protos/identity_client.proto +++ b/shared/protos/identity_client.proto @@ -63,6 +63,11 @@ // Called by other services to verify a user's access token rpc VerifyUserAccessToken(VerifyUserAccessTokenRequest) returns (VerifyUserAccessTokenResponse) {} + + // Called by Ashoat's keyserver with a list of usernames in MySQL and returns: + // 1. a list of usernames that are in DynamoDB but not in the supplied list + // 2. a list of usernames that are in the supplied list but not in DynamoDB + rpc CompareUsers(CompareUsersRequest) returns (CompareUsersResponse) {} } // Helper types @@ -318,3 +323,14 @@ message VerifyUserAccessTokenResponse { bool tokenValid = 1; } + +// CompareUsers + +message CompareUsersRequest { + repeated string users = 1; +} + +message CompareUsersResponse { + repeated string usersMissingFromKeyserver = 1; + repeated string usersMissingFromIdentity = 2; +}