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 @@ -400,6 +400,24 @@ } } +fn parse_user_id_attribute( + attribute: Option, +) -> Result { + match attribute { + Some(AttributeValue::S(user_id)) => Ok(user_id), + Some(_) => Err(DBItemError::new( + USERS_TABLE_PARTITION_KEY, + attribute, + DBItemAttributeError::IncorrectType, + )), + None => Err(DBItemError::new( + USERS_TABLE_PARTITION_KEY, + attribute, + DBItemAttributeError::Missing, + )), + } +} + #[cfg(test)] mod tests { use super::*;