diff --git a/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs b/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs --- a/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs +++ b/keyserver/addons/rust-node-addon/src/identity_client/prekey.rs @@ -22,11 +22,11 @@ get_authenticated_identity_client(user_id, device_id, access_token).await?; let message = RefreshUserPrekeysRequest { - new_content_prekeys: Some(Prekey { + new_content_prekey: Some(Prekey { prekey: content_prekey, prekey_signature: content_prekey_signature, }), - new_notif_prekeys: Some(Prekey { + new_notif_prekey: Some(Prekey { prekey: notif_prekey, prekey_signature: notif_prekey_signature, }), diff --git a/native/native_rust_library/src/identity/x3dh.rs b/native/native_rust_library/src/identity/x3dh.rs --- a/native/native_rust_library/src/identity/x3dh.rs +++ b/native/native_rust_library/src/identity/x3dh.rs @@ -101,11 +101,11 @@ ) { RUNTIME.spawn(async move { let refresh_request = RefreshUserPrekeysRequest { - new_content_prekeys: Some(Prekey { + new_content_prekey: Some(Prekey { prekey: content_prekey, prekey_signature: content_prekey_signature, }), - new_notif_prekeys: Some(Prekey { + new_notif_prekey: Some(Prekey { prekey: notif_prekey, prekey_signature: notif_prekey_signature, }), diff --git a/services/commtest/tests/identity_prekey_tests.rs b/services/commtest/tests/identity_prekey_tests.rs --- a/services/commtest/tests/identity_prekey_tests.rs +++ b/services/commtest/tests/identity_prekey_tests.rs @@ -23,11 +23,11 @@ .expect("Couldn't connect to identity service"); let upload_request = RefreshUserPrekeysRequest { - new_content_prekeys: Some(Prekey { + new_content_prekey: Some(Prekey { prekey: "content_prekey".to_string(), prekey_signature: "content_prekey_signature".to_string(), }), - new_notif_prekeys: Some(Prekey { + new_notif_prekey: Some(Prekey { prekey: "content_prekey".to_string(), prekey_signature: "content_prekey_signature".to_string(), }), diff --git a/services/identity/src/grpc_services/authenticated.rs b/services/identity/src/grpc_services/authenticated.rs --- a/services/identity/src/grpc_services/authenticated.rs +++ b/services/identity/src/grpc_services/authenticated.rs @@ -105,10 +105,10 @@ debug!("Refreshing prekeys for user: {}", user_id); - let content_keys = message.new_content_prekeys.ok_or_else(|| { + let content_key = message.new_content_prekey.ok_or_else(|| { Status::invalid_argument(tonic_status_messages::MISSING_CONTENT_KEYS) })?; - let notif_keys = message.new_notif_prekeys.ok_or_else(|| { + let notif_key = message.new_notif_prekey.ok_or_else(|| { Status::invalid_argument(tonic_status_messages::MISSING_NOTIF_KEYS) })?; @@ -117,8 +117,8 @@ .update_device_prekeys( user_id, device_id, - content_keys.into(), - notif_keys.into(), + content_key.into(), + notif_key.into(), ) .await .map_err(handle_db_error)?; diff --git a/shared/protos/identity_auth.proto b/shared/protos/identity_auth.proto --- a/shared/protos/identity_auth.proto +++ b/shared/protos/identity_auth.proto @@ -83,11 +83,13 @@ /* Miscellaneous actions */ - rpc FindUserIdentities(UserIdentitiesRequest) returns (UserIdentitiesResponse) {} + rpc FindUserIdentities(UserIdentitiesRequest) returns + (UserIdentitiesResponse) {} // Updates current device PlatformDetails stored on Identity Service. // It doesn't require any input - all values are passed via request metadata. - rpc SyncPlatformDetails(identity.unauth.Empty) returns (identity.unauth.Empty) {} + rpc SyncPlatformDetails(identity.unauth.Empty) returns + (identity.unauth.Empty) {} } // Helper types @@ -117,8 +119,8 @@ // RefreshUserPreKeys message RefreshUserPrekeysRequest { - identity.unauth.Prekey new_content_prekeys = 1; - identity.unauth.Prekey new_notif_prekeys = 2; + identity.unauth.Prekey new_content_prekey = 1; + identity.unauth.Prekey new_notif_prekey = 2; } // Information needed when establishing communication to someone else's device diff --git a/shared/protos/identity_unauth.proto b/shared/protos/identity_unauth.proto --- a/shared/protos/identity_unauth.proto +++ b/shared/protos/identity_unauth.proto @@ -67,7 +67,8 @@ // Helper types -message Empty {} +message Empty { +} message Prekey { string prekey = 1; diff --git a/web/grpc/identity-service-client-wrapper.js b/web/grpc/identity-service-client-wrapper.js --- a/web/grpc/identity-service-client-wrapper.js +++ b/web/grpc/identity-service-client-wrapper.js @@ -504,8 +504,8 @@ notifPrekeyUpload.setPrekeySignature(prekeys.notifPrekeySignature); const request = new IdentityAuthStructs.RefreshUserPrekeysRequest(); - request.setNewContentPrekeys(contentPrekeyUpload); - request.setNewNotifPrekeys(notifPrekeyUpload); + request.setNewContentPrekey(contentPrekeyUpload); + request.setNewNotifPrekey(notifPrekeyUpload); await client.refreshUserPrekeys(request); }; diff --git a/web/protobufs/identity-auth-structs.cjs b/web/protobufs/identity-auth-structs.cjs --- a/web/protobufs/identity-auth-structs.cjs +++ b/web/protobufs/identity-auth-structs.cjs @@ -1274,8 +1274,8 @@ */ proto.identity.auth.RefreshUserPrekeysRequest.toObject = function(includeInstance, msg) { var f, obj = { - newContentPrekeys: (f = msg.getNewContentPrekeys()) && identity_unauth_pb.Prekey.toObject(includeInstance, f), - newNotifPrekeys: (f = msg.getNewNotifPrekeys()) && identity_unauth_pb.Prekey.toObject(includeInstance, f) + newContentPrekey: (f = msg.getNewContentPrekey()) && identity_unauth_pb.Prekey.toObject(includeInstance, f), + newNotifPrekey: (f = msg.getNewNotifPrekey()) && identity_unauth_pb.Prekey.toObject(includeInstance, f) }; if (includeInstance) { @@ -1315,12 +1315,12 @@ case 1: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); - msg.setNewContentPrekeys(value); + msg.setNewContentPrekey(value); break; case 2: var value = new identity_unauth_pb.Prekey; reader.readMessage(value,identity_unauth_pb.Prekey.deserializeBinaryFromReader); - msg.setNewNotifPrekeys(value); + msg.setNewNotifPrekey(value); break; default: reader.skipField(); @@ -1351,7 +1351,7 @@ */ proto.identity.auth.RefreshUserPrekeysRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getNewContentPrekeys(); + f = message.getNewContentPrekey(); if (f != null) { writer.writeMessage( 1, @@ -1359,7 +1359,7 @@ identity_unauth_pb.Prekey.serializeBinaryToWriter ); } - f = message.getNewNotifPrekeys(); + f = message.getNewNotifPrekey(); if (f != null) { writer.writeMessage( 2, @@ -1371,10 +1371,10 @@ /** - * optional identity.unauth.Prekey new_content_prekeys = 1; + * optional identity.unauth.Prekey new_content_prekey = 1; * @return {?proto.identity.unauth.Prekey} */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.getNewContentPrekeys = function() { +proto.identity.auth.RefreshUserPrekeysRequest.prototype.getNewContentPrekey = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 1)); }; @@ -1384,7 +1384,7 @@ * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.setNewContentPrekeys = function(value) { +proto.identity.auth.RefreshUserPrekeysRequest.prototype.setNewContentPrekey = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; @@ -1393,8 +1393,8 @@ * Clears the message field making it undefined. * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.clearNewContentPrekeys = function() { - return this.setNewContentPrekeys(undefined); +proto.identity.auth.RefreshUserPrekeysRequest.prototype.clearNewContentPrekey = function() { + return this.setNewContentPrekey(undefined); }; @@ -1402,16 +1402,16 @@ * Returns whether this field is set. * @return {boolean} */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.hasNewContentPrekeys = function() { +proto.identity.auth.RefreshUserPrekeysRequest.prototype.hasNewContentPrekey = function() { return jspb.Message.getField(this, 1) != null; }; /** - * optional identity.unauth.Prekey new_notif_prekeys = 2; + * optional identity.unauth.Prekey new_notif_prekey = 2; * @return {?proto.identity.unauth.Prekey} */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.getNewNotifPrekeys = function() { +proto.identity.auth.RefreshUserPrekeysRequest.prototype.getNewNotifPrekey = function() { return /** @type{?proto.identity.unauth.Prekey} */ ( jspb.Message.getWrapperField(this, identity_unauth_pb.Prekey, 2)); }; @@ -1421,7 +1421,7 @@ * @param {?proto.identity.unauth.Prekey|undefined} value * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.setNewNotifPrekeys = function(value) { +proto.identity.auth.RefreshUserPrekeysRequest.prototype.setNewNotifPrekey = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; @@ -1430,8 +1430,8 @@ * Clears the message field making it undefined. * @return {!proto.identity.auth.RefreshUserPrekeysRequest} returns this */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.clearNewNotifPrekeys = function() { - return this.setNewNotifPrekeys(undefined); +proto.identity.auth.RefreshUserPrekeysRequest.prototype.clearNewNotifPrekey = function() { + return this.setNewNotifPrekey(undefined); }; @@ -1439,7 +1439,7 @@ * Returns whether this field is set. * @return {boolean} */ -proto.identity.auth.RefreshUserPrekeysRequest.prototype.hasNewNotifPrekeys = function() { +proto.identity.auth.RefreshUserPrekeysRequest.prototype.hasNewNotifPrekey = function() { return jspb.Message.getField(this, 2) != null; }; diff --git a/web/protobufs/identity-auth-structs.cjs.flow b/web/protobufs/identity-auth-structs.cjs.flow --- a/web/protobufs/identity-auth-structs.cjs.flow +++ b/web/protobufs/identity-auth-structs.cjs.flow @@ -86,15 +86,15 @@ }; declare export class RefreshUserPrekeysRequest extends Message { - getNewContentPrekeys(): identityStructs.Prekey | void; - setNewContentPrekeys(value?: identityStructs.Prekey): RefreshUserPrekeysRequest; - hasNewContentPrekeys(): boolean; - clearNewContentPrekeys(): RefreshUserPrekeysRequest; + getNewContentPrekey(): identityStructs.Prekey | void; + setNewContentPrekey(value?: identityStructs.Prekey): RefreshUserPrekeysRequest; + hasNewContentPrekey(): boolean; + clearNewContentPrekey(): RefreshUserPrekeysRequest; - getNewNotifPrekeys(): identityStructs.Prekey | void; - setNewNotifPrekeys(value?: identityStructs.Prekey): RefreshUserPrekeysRequest; - hasNewNotifPrekeys(): boolean; - clearNewNotifPrekeys(): RefreshUserPrekeysRequest; + getNewNotifPrekey(): identityStructs.Prekey | void; + setNewNotifPrekey(value?: identityStructs.Prekey): RefreshUserPrekeysRequest; + hasNewNotifPrekey(): boolean; + clearNewNotifPrekey(): RefreshUserPrekeysRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RefreshUserPrekeysRequestObject; @@ -105,8 +105,8 @@ } export type RefreshUserPrekeysRequestObject = { - newContentPrekeys?: identityStructs.PrekeyObject, - newNotifPrekeys?: identityStructs.PrekeyObject, + newContentPrekey?: identityStructs.PrekeyObject, + newNotifPrekey?: identityStructs.PrekeyObject, } declare export class OutboundKeyInfo extends Message {