diff --git a/keyserver/addons/rust-node-addon/src/identity_client/login.rs b/keyserver/addons/rust-node-addon/src/identity_client/login.rs --- a/keyserver/addons/rust-node-addon/src/identity_client/login.rs +++ b/keyserver/addons/rust-node-addon/src/identity_client/login.rs @@ -55,7 +55,7 @@ debug!("Starting login to identity service"); let response = identity_client - .login_password_user_start(login_start_request) + .log_in_password_user_start(login_start_request) .await .map_err(handle_grpc_error)?; debug!("Received login response from identity service"); @@ -88,7 +88,7 @@ debug!("Attempting to finalize opaque login exchange with identity service"); let login_finish_response = identity_client - .login_password_user_finish(login_finish_request) + .log_in_password_user_finish(login_finish_request) .await .map_err(handle_grpc_error)? .into_inner(); diff --git a/native/native_rust_library/src/lib.rs b/native/native_rust_library/src/lib.rs --- a/native/native_rust_library/src/lib.rs +++ b/native/native_rust_library/src/lib.rs @@ -528,7 +528,7 @@ .await?; let response = identity_client - .login_password_user_start(login_start_request) + .log_in_password_user_start(login_start_request) .await?; // We need to get the load balancer cookie from from the response and send it @@ -560,7 +560,7 @@ } let login_finish_response = identity_client - .login_password_user_finish(finish_request) + .log_in_password_user_finish(finish_request) .await? .into_inner(); let user_id_and_access_token = UserIDAndDeviceAccessToken { @@ -652,7 +652,7 @@ .await?; let login_response = identity_client - .login_wallet_user(login_request) + .log_in_wallet_user(login_request) .await? .into_inner(); diff --git a/services/commtest/tests/identity_access_tokens_tests.rs b/services/commtest/tests/identity_access_tokens_tests.rs --- a/services/commtest/tests/identity_access_tokens_tests.rs +++ b/services/commtest/tests/identity_access_tokens_tests.rs @@ -21,7 +21,7 @@ let verify_request = VerifyUserAccessTokenRequest { user_id: device_info.user_id, - signing_public_key: device_info.device_id, + device_id: device_info.device_id, access_token: device_info.access_token, }; 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 @@ -243,7 +243,7 @@ } } - async fn login_password_user_start( + async fn log_in_password_user_start( &self, request: tonic::Request, ) -> Result, tonic::Status> { @@ -305,7 +305,7 @@ Ok(response) } - async fn login_password_user_finish( + async fn log_in_password_user_finish( &self, request: tonic::Request, ) -> Result, tonic::Status> { @@ -356,7 +356,7 @@ } } - async fn login_wallet_user( + async fn log_in_wallet_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { @@ -465,7 +465,7 @@ Ok(Response::new(response)) } - async fn login_reserved_wallet_user( + async fn log_in_reserved_wallet_user( &self, request: tonic::Request, ) -> Result, tonic::Status> { @@ -574,13 +574,13 @@ request: tonic::Request, ) -> Result, tonic::Status> { let message = request.into_inner(); - debug!("Verifying device: {}", &message.signing_public_key); + debug!("Verifying device: {}", &message.device_id); let token_valid = self .client .verify_access_token( message.user_id, - message.signing_public_key.clone(), + message.device_id.clone(), message.access_token, ) .await @@ -589,7 +589,7 @@ let response = Response::new(VerifyUserAccessTokenResponse { token_valid }); debug!( "device {} was verified: {}", - &message.signing_public_key, token_valid + &message.device_id, token_valid ); Ok(response) } diff --git a/services/tunnelbroker/src/identity/mod.rs b/services/tunnelbroker/src/identity/mod.rs --- a/services/tunnelbroker/src/identity/mod.rs +++ b/services/tunnelbroker/src/identity/mod.rs @@ -27,7 +27,7 @@ .await?; let message = VerifyUserAccessTokenRequest { user_id: user_id.to_string(), - signing_public_key: device_id.to_string(), + device_id: device_id.to_string(), access_token: access_token.to_string(), }; diff --git a/shared/grpc_clients/src/identity/unauthenticated/client.rs b/shared/grpc_clients/src/identity/unauthenticated/client.rs --- a/shared/grpc_clients/src/identity/unauthenticated/client.rs +++ b/shared/grpc_clients/src/identity/unauthenticated/client.rs @@ -22,7 +22,7 @@ let message = VerifyUserAccessTokenRequest { user_id: user_id.to_string(), - signing_public_key: device_id.to_string(), + device_id: device_id.to_string(), access_token: access_token.to_string(), }; diff --git a/shared/protos/identity_authenticated.proto b/shared/protos/identity_authenticated.proto --- a/shared/protos/identity_authenticated.proto +++ b/shared/protos/identity_authenticated.proto @@ -60,29 +60,29 @@ // As OPKs get exhausted, they need to be refreshed message UploadOneTimeKeysRequest { - repeated string contentOneTimePreKeys = 1; - repeated string notifOneTimePreKeys = 2; + repeated string content_one_time_pre_keys = 1; + repeated string notif_one_time_pre_keys = 2; } // RefreshUserPreKeys message RefreshUserPreKeysRequest { - identity.client.PreKey newContentPreKeys = 1; - identity.client.PreKey newNotifPreKeys = 2; + identity.client.PreKey new_content_pre_keys = 1; + identity.client.PreKey new_notif_pre_keys = 2; } // Information needed when establishing communication to someone else's device message OutboundKeyInfo { - identity.client.IdentityKeyInfo identityInfo = 1; - identity.client.PreKey contentPrekey = 2; - identity.client.PreKey notifPrekey = 3; - optional string oneTimeContentPrekey = 4; - optional string oneTimeNotifPrekey = 5; + identity.client.IdentityKeyInfo identity_info = 1; + identity.client.PreKey content_prekey = 2; + identity.client.PreKey notif_prekey = 3; + optional string one_time_content_prekey = 4; + optional string one_time_notif_prekey = 5; } message KeyserverKeysResponse { - optional OutboundKeyInfo keyserverInfo = 1; + optional OutboundKeyInfo keyserver_info = 1; } // GetOutboundKeysForUser @@ -96,15 +96,15 @@ // to a request. // The device receiving a request only needs the content key and prekey. message OutboundKeysForUserRequest { - string userID = 1; + string user_id = 1; } // GetInboundKeysForUser message InboundKeyInfo { - identity.client.IdentityKeyInfo identityInfo = 1; - identity.client.PreKey contentPrekey = 2; - identity.client.PreKey notifPrekey = 3; + identity.client.IdentityKeyInfo identity_info = 1; + identity.client.PreKey content_prekey = 2; + identity.client.PreKey notif_prekey = 3; } message InboundKeysForUserResponse { @@ -113,7 +113,7 @@ } message InboundKeysForUserRequest { - string userID = 1; + string user_id = 1; } // FindUserID @@ -121,13 +121,13 @@ message FindUserIDRequest { oneof identifier { string username = 1; - string walletAddress = 2; + string wallet_address = 2; } } message FindUserIDResponse { // userID if the user is registered with Identity Service, null otherwise - optional string userID = 1; + optional string user_id = 1; // true if the identifier (username or wallet address) exists in the // reserved usernames list, false otherwise. It doesn't take into account // whether the user is registered with Identity Service (userID != null). @@ -140,20 +140,20 @@ // access token to validate user before updating password message UpdateUserPasswordStartRequest { // Message sent to initiate PAKE registration (step 1) - bytes opaqueRegistrationRequest = 1; + bytes opaque_registration_request = 1; } // Do a user registration, but overwrite the existing credentials // after validation of user message UpdateUserPasswordFinishRequest { // Identifier used to correlate start and finish request - string sessionID = 1; + string session_id = 1; // Opaque client registration upload (step 3) - bytes opaqueRegistrationUpload = 2; + bytes opaque_registration_upload = 2; } message UpdateUserPasswordStartResponse { // Identifier used to correlate start request with finish request - string sessionID = 1; - bytes opaqueRegistrationResponse = 2; + string session_id = 1; + bytes opaque_registration_response = 2; } 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 @@ -18,12 +18,12 @@ rpc RegisterPasswordUserFinish(RegistrationFinishRequest) returns ( RegistrationFinishResponse) {} // Called by user to register device and get an access token - rpc LoginPasswordUserStart(OpaqueLoginStartRequest) returns + rpc LogInPasswordUserStart(OpaqueLoginStartRequest) returns (OpaqueLoginStartResponse) {} - rpc LoginPasswordUserFinish(OpaqueLoginFinishRequest) returns + rpc LogInPasswordUserFinish(OpaqueLoginFinishRequest) returns (OpaqueLoginFinishResponse) {} - rpc LoginWalletUser(WalletLoginRequest) returns (WalletLoginResponse) {} - rpc LoginReservedWalletUser(ReservedWalletLoginRequest) returns + rpc LogInWalletUser(WalletLoginRequest) returns (WalletLoginResponse) {} + rpc LogInReservedWalletUser(ReservedWalletLoginRequest) returns (WalletLoginResponse) {} // Sign-In with Ethereum actions @@ -57,8 +57,8 @@ message Empty {} message PreKey { - string preKey = 1; - string preKeySignature = 2; + string pre_key = 1; + string pre_key_signature = 2; } // Key information needed for starting a X3DH session @@ -68,10 +68,10 @@ // For keyservers, this will only contain ContentKeys string payload = 1; // Payload signed with the signing ed25519 key - string payloadSignature = 2; + string payload_signature = 2; // Signed message used for SIWE // This correlates a given wallet with a device's content key - optional string socialProof = 3; + optional string social_proof = 3; } // RegisterUser @@ -84,69 +84,69 @@ // be provide to avoid exhausting them. enum DeviceType { - Keyserver = 0; - Web = 1; + KEYSERVER = 0; + WEB = 1; // iOS doesn't leave a good option for title to camel case renaming - Ios = 2; - Android = 3; - Windows = 4; - MacOS = 5; + IOS = 2; + ANDROID = 3; + WINDOWS = 4; + MAC_OS = 5; } // Bundle of information needed for creating an initial message using X3DH message DeviceKeyUpload { - IdentityKeyInfo deviceKeyInfo = 1; - PreKey contentUpload = 2; - PreKey notifUpload = 3; - repeated string oneTimeContentPrekeys = 4; - repeated string oneTimeNotifPrekeys = 5; - DeviceType deviceType = 6; + IdentityKeyInfo device_key_info = 1; + PreKey content_upload = 2; + PreKey notif_upload = 3; + repeated string one_time_content_prekeys = 4; + repeated string one_time_notif_prekeys = 5; + DeviceType device_type = 6; } // Request for registering a new user message RegistrationStartRequest { // Message sent to initiate PAKE registration (step 1) - bytes opaqueRegistrationRequest = 1; + bytes opaque_registration_request = 1; string username = 2; // Information needed to open a new channel to current user's device - DeviceKeyUpload deviceKeyUpload = 3; + DeviceKeyUpload device_key_upload = 3; } message ReservedRegistrationStartRequest { // Message sent to initiate PAKE registration (step 1) - bytes opaqueRegistrationRequest = 1; + bytes opaque_registration_request = 1; string username = 2; // Information needed to open a new channel to current user's device - DeviceKeyUpload deviceKeyUpload = 3; + DeviceKeyUpload device_key_upload = 3; // Message from Ashoat's keyserver attesting that a given user has ownership // of a given username - string keyserverMessage = 4; + string keyserver_message = 4; // Above message signed with Ashoat's keyserver's signing ed25519 key - string keyserverSignature = 5; + string keyserver_signature = 5; } // Messages sent from a client to Identity Service message RegistrationFinishRequest { // Identifier to correlate RegisterStart session - string sessionID = 1; + string session_id = 1; // Final message in PAKE registration - bytes opaqueRegistrationUpload = 2; + bytes opaque_registration_upload = 2; } // Messages sent from Identity Service to client message RegistrationStartResponse { // Identifier used to correlate start request with finish request - string sessionID = 1; + string session_id = 1; // sent to the user upon reception of the PAKE registration attempt // (step 2) - bytes opaqueRegistrationResponse = 2; + bytes opaque_registration_response = 2; } message RegistrationFinishResponse { // Unique identifier for newly registered user - string userID = 1; + string user_id = 1; // After successful unpacking of user credentials, return token - string accessToken = 2; + string access_token = 2; } // LoginUser @@ -162,50 +162,50 @@ message OpaqueLoginFinishRequest { // Identifier used to correlate start request with finish request - string sessionID = 1; + string session_id = 1; // Message containing client's reponse to server challenge. // Used to verify that client holds password secret (Step 3) - bytes opaqueLoginUpload = 2; + bytes opaque_login_upload = 2; } message OpaqueLoginStartResponse { // Identifier used to correlate start request with finish request - string sessionID = 1; + string session_id = 1; // Opaque challenge sent from server to client attempting to login (Step 2) - bytes opaqueLoginResponse = 2; + bytes opaque_login_response = 2; } message OpaqueLoginFinishResponse { - string userID = 1; + string user_id = 1; // Mint and return a new access token upon successful login - string accessToken = 2; + string access_token = 2; } message WalletLoginRequest { - string siweMessage = 1; - string siweSignature = 2; + string siwe_message = 1; + string siwe_signature = 2; // Information specific to a user's device needed to open a new channel of // communication with this user - DeviceKeyUpload deviceKeyUpload = 3; + DeviceKeyUpload device_key_upload = 3; } message ReservedWalletLoginRequest { - string siweMessage = 1; - string siweSignature = 2; + string siwe_message = 1; + string siwe_signature = 2; // Information specific to a user's device needed to open a new channel of // communication with this user - DeviceKeyUpload deviceKeyUpload = 3; + DeviceKeyUpload device_key_upload = 3; // Message from Ashoat's keyserver attesting that a given user has ownership // of a given wallet address - string keyserverMessage = 4; + string keyserver_message = 4; // Above message signed with Ashoat's keyserver's signing ed25519 key - string keyserverSignature = 5; + string keyserver_signature = 5; } message WalletLoginResponse { - string userID = 1; - string accessToken = 2; + string user_id = 1; + string access_token = 2; } // GenerateNonce @@ -217,14 +217,14 @@ // VerifyUserAccessToken message VerifyUserAccessTokenRequest { - string userID = 1; + string user_id = 1; // signing ed25519 key for the given user's device - string signingPublicKey = 2; - string accessToken = 3; + string device_id = 2; + string access_token = 3; } message VerifyUserAccessTokenResponse { - bool tokenValid = 1; + bool token_valid = 1; } // AddReservedUsernames diff --git a/shared/protos/tunnelbroker.proto b/shared/protos/tunnelbroker.proto --- a/shared/protos/tunnelbroker.proto +++ b/shared/protos/tunnelbroker.proto @@ -19,7 +19,7 @@ message MessageToDevice { // The primary identity key of a device - string deviceID = 1; + string device_id = 1; // JSON encoded message. See shared/tunnelbroker_messages for valid payloads string payload = 2; }