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 @@ -338,7 +338,6 @@ .add_user_device( state.user_id.clone(), state.flattened_device_key_upload.clone(), - None, code_version, login_time, ) @@ -421,7 +420,6 @@ .add_user_device( id.clone(), flattened_device_key_upload.clone(), - Some(social_proof), code_version, chrono::Utc::now(), ) diff --git a/services/identity/src/constants.rs b/services/identity/src/constants.rs --- a/services/identity/src/constants.rs +++ b/services/identity/src/constants.rs @@ -97,7 +97,6 @@ // IdentityKeyInfo constants pub const ATTR_KEY_PAYLOAD: &str = "keyPayload"; pub const ATTR_KEY_PAYLOAD_SIGNATURE: &str = "keyPayloadSignature"; - pub const ATTR_SOCIAL_PROOF: &str = "socialProof"; // PreKey constants pub const ATTR_PREKEY: &str = "preKey"; diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs --- a/services/identity/src/database.rs +++ b/services/identity/src/database.rs @@ -177,7 +177,6 @@ .add_device( &user_id, device_key_upload, - None, code_version, access_token_creation_time, ) @@ -197,7 +196,7 @@ ) -> Result { let wallet_identity = EthereumIdentity { wallet_address, - social_proof: social_proof.clone(), + social_proof, }; let user_id = self .add_user_to_users_table( @@ -212,7 +211,6 @@ .add_device( &user_id, flattened_device_key_upload, - Some(social_proof), code_version, access_token_creation_time, ) @@ -283,7 +281,6 @@ &self, user_id: String, flattened_device_key_upload: FlattenedDeviceKeyUpload, - social_proof: Option, code_version: u64, access_token_creation_time: DateTime, ) -> Result<(), Error> { @@ -314,7 +311,6 @@ .add_device( user_id, flattened_device_key_upload, - social_proof, code_version, access_token_creation_time, ) @@ -347,6 +343,8 @@ .ok_or(Error::MissingItem)?; let user_id: String = user_info.take_attr(USERS_TABLE_PARTITION_KEY)?; + let social_proof: Option = + user_info.take_attr(USERS_TABLE_SOCIAL_PROOF_ATTRIBUTE_NAME)?; let user_devices = self.get_current_devices(user_id).await?; let maybe_keyserver_device = user_devices .into_iter() @@ -381,7 +379,7 @@ let outbound_payload = OutboundKeys { key_payload: keyserver.device_key_info.key_payload, key_payload_signature: keyserver.device_key_info.key_payload_signature, - social_proof: keyserver.device_key_info.social_proof, + social_proof, content_prekey: keyserver.content_prekey, notif_prekey: keyserver.notif_prekey, content_one_time_key, diff --git a/services/identity/src/database/device_list.rs b/services/identity/src/database/device_list.rs --- a/services/identity/src/database/device_list.rs +++ b/services/identity/src/database/device_list.rs @@ -56,7 +56,6 @@ pub struct IdentityKeyInfo { pub key_payload: String, pub key_payload_signature: String, - pub social_proof: Option, } #[derive(Clone, Debug)] @@ -69,7 +68,6 @@ pub fn from_device_key_upload( user_id: impl Into, upload: FlattenedDeviceKeyUpload, - social_proof: Option, code_version: u64, login_time: DateTime, ) -> Self { @@ -81,7 +79,6 @@ device_key_info: IdentityKeyInfo { key_payload: upload.key_payload, key_payload_signature: upload.key_payload_signature, - social_proof, }, content_prekey: PreKey { pre_key: upload.content_prekey, @@ -259,14 +256,16 @@ Self { payload: value.key_payload, payload_signature: value.key_payload_signature, - social_proof: value.social_proof, + // social proof isn't stored in the devices table + // it cannot be retrieved here + social_proof: None, } } } impl From for AttributeValue { fn from(value: IdentityKeyInfo) -> Self { - let mut attrs = HashMap::from([ + let attrs = HashMap::from([ ( ATTR_KEY_PAYLOAD.to_string(), AttributeValue::S(value.key_payload), @@ -276,12 +275,6 @@ AttributeValue::S(value.key_payload_signature), ), ]); - if let Some(social_proof) = value.social_proof { - attrs.insert( - ATTR_SOCIAL_PROOF.to_string(), - AttributeValue::S(social_proof), - ); - } AttributeValue::M(attrs) } } @@ -291,13 +284,10 @@ fn try_from(mut attrs: AttributeMap) -> Result { let key_payload = attrs.take_attr(ATTR_KEY_PAYLOAD)?; let key_payload_signature = attrs.take_attr(ATTR_KEY_PAYLOAD_SIGNATURE)?; - // social proof is optional - let social_proof: Option = attrs.take_attr(ATTR_SOCIAL_PROOF)?; Ok(Self { key_payload, key_payload_signature, - social_proof, }) } } @@ -630,7 +620,6 @@ &self, user_id: impl Into, device_key_upload: FlattenedDeviceKeyUpload, - social_proof: Option, code_version: u64, login_time: DateTime, ) -> Result<(), Error> { @@ -640,7 +629,6 @@ let new_device = DeviceRow::from_device_key_upload( &user_id, device_key_upload, - social_proof, code_version, login_time, ); @@ -1239,7 +1227,6 @@ device_key_info: IdentityKeyInfo { key_payload: "".into(), key_payload_signature: "".into(), - social_proof: None, }, content_prekey: PreKey { pre_key: "".into(),