From 8285e21ebb96285c83b8b87460593f14f65f62e2 Mon Sep 17 00:00:00 2001 From: Simon Broeng Jensen Date: Wed, 5 Feb 2025 10:03:08 +0100 Subject: [PATCH] domain: rename AttributeValue to Attribute Preparation for storing the actual types for each value, which will repurpose the AttributeValue name. --- crates/domain/src/requests.rs | 12 ++-- crates/domain/src/types.rs | 8 +-- server/src/domain/ldap/utils.rs | 6 +- server/src/domain/model/group_attributes.rs | 4 +- server/src/domain/model/user_attributes.rs | 4 +- server/src/domain/sql_backend_handler.rs | 6 +- .../src/domain/sql_group_backend_handler.rs | 14 ++--- .../src/domain/sql_schema_backend_handler.rs | 4 +- server/src/domain/sql_user_backend_handler.rs | 58 +++++++++---------- server/src/infra/graphql/mutation.rs | 8 +-- server/src/infra/graphql/query.rs | 22 +++---- server/src/infra/ldap_handler.rs | 30 +++++----- 12 files changed, 86 insertions(+), 90 deletions(-) diff --git a/crates/domain/src/requests.rs b/crates/domain/src/requests.rs index 28a658e..2198f42 100644 --- a/crates/domain/src/requests.rs +++ b/crates/domain/src/requests.rs @@ -1,8 +1,6 @@ use serde::{Deserialize, Serialize}; -use crate::types::{ - AttributeName, AttributeType, AttributeValue, Email, GroupId, GroupName, UserId, -}; +use crate::types::{Attribute, AttributeName, AttributeType, Email, GroupId, GroupName, UserId}; #[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone, Default)] pub struct CreateUserRequest { @@ -10,7 +8,7 @@ pub struct CreateUserRequest { pub user_id: UserId, pub email: Email, pub display_name: Option, - pub attributes: Vec, + pub attributes: Vec, } #[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone, Default)] @@ -20,13 +18,13 @@ pub struct UpdateUserRequest { pub email: Option, pub display_name: Option, pub delete_attributes: Vec, - pub insert_attributes: Vec, + pub insert_attributes: Vec, } #[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone, Default)] pub struct CreateGroupRequest { pub display_name: GroupName, - pub attributes: Vec, + pub attributes: Vec, } #[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)] @@ -34,7 +32,7 @@ pub struct UpdateGroupRequest { pub group_id: GroupId, pub display_name: Option, pub delete_attributes: Vec, - pub insert_attributes: Vec, + pub insert_attributes: Vec, } #[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)] diff --git a/crates/domain/src/types.rs b/crates/domain/src/types.rs index 52d08e4..d6f306c 100644 --- a/crates/domain/src/types.rs +++ b/crates/domain/src/types.rs @@ -408,7 +408,7 @@ impl IntoActiveValue for JpegPhoto { } #[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize, Hash)] -pub struct AttributeValue { +pub struct Attribute { pub name: AttributeName, pub value: Serialized, } @@ -420,7 +420,7 @@ pub struct User { pub display_name: Option, pub creation_date: NaiveDateTime, pub uuid: Uuid, - pub attributes: Vec, + pub attributes: Vec, } #[cfg(feature = "test")] @@ -528,7 +528,7 @@ pub struct Group { pub creation_date: NaiveDateTime, pub uuid: Uuid, pub users: Vec, - pub attributes: Vec, + pub attributes: Vec, } #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -537,7 +537,7 @@ pub struct GroupDetails { pub display_name: GroupName, pub creation_date: NaiveDateTime, pub uuid: Uuid, - pub attributes: Vec, + pub attributes: Vec, } #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/server/src/domain/ldap/utils.rs b/server/src/domain/ldap/utils.rs index 5e0b4fa..d923e65 100644 --- a/server/src/domain/ldap/utils.rs +++ b/server/src/domain/ldap/utils.rs @@ -10,9 +10,7 @@ use crate::domain::{ model::UserColumn, schema::{PublicSchema, SchemaAttributeExtractor}, }; -use lldap_domain::types::{ - AttributeName, AttributeType, AttributeValue, GroupName, JpegPhoto, UserId, -}; +use lldap_domain::types::{Attribute, AttributeName, AttributeType, GroupName, JpegPhoto, UserId}; impl From for SubStringFilter { fn from( @@ -287,7 +285,7 @@ pub struct LdapInfo { } pub fn get_custom_attribute( - attributes: &[AttributeValue], + attributes: &[Attribute], attribute_name: &AttributeName, schema: &PublicSchema, ) -> Option>> { diff --git a/server/src/domain/model/group_attributes.rs b/server/src/domain/model/group_attributes.rs index 933c8e4..c9cebc8 100644 --- a/server/src/domain/model/group_attributes.rs +++ b/server/src/domain/model/group_attributes.rs @@ -1,7 +1,7 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; -use lldap_domain::types::{AttributeName, AttributeValue, GroupId, Serialized}; +use lldap_domain::types::{Attribute, AttributeName, GroupId, Serialized}; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] #[sea_orm(table_name = "group_attributes")] @@ -56,7 +56,7 @@ impl Related for Entity { impl ActiveModelBehavior for ActiveModel {} -impl From for AttributeValue { +impl From for Attribute { fn from( Model { group_id: _, diff --git a/server/src/domain/model/user_attributes.rs b/server/src/domain/model/user_attributes.rs index 7b2ccc2..f5ba33d 100644 --- a/server/src/domain/model/user_attributes.rs +++ b/server/src/domain/model/user_attributes.rs @@ -1,7 +1,7 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; -use lldap_domain::types::{AttributeName, AttributeValue, Serialized, UserId}; +use lldap_domain::types::{Attribute, AttributeName, Serialized, UserId}; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] #[sea_orm(table_name = "user_attributes")] @@ -56,7 +56,7 @@ impl Related for Entity { impl ActiveModelBehavior for ActiveModel {} -impl From for AttributeValue { +impl From for Attribute { fn from( Model { user_id: _, diff --git a/server/src/domain/sql_backend_handler.rs b/server/src/domain/sql_backend_handler.rs index 750c817..5288d7a 100644 --- a/server/src/domain/sql_backend_handler.rs +++ b/server/src/domain/sql_backend_handler.rs @@ -33,7 +33,7 @@ pub mod tests { use lldap_auth::{opaque, registration}; use lldap_domain::{ requests::{CreateGroupRequest, CreateUserRequest}, - types::{AttributeValue as DomainAttributeValue, GroupId, Serialized, UserId}, + types::{Attribute as DomainAttribute, GroupId, Serialized, UserId}, }; use pretty_assertions::assert_eq; use sea_orm::Database; @@ -93,11 +93,11 @@ pub mod tests { email: format!("{}@bob.bob", name).into(), display_name: Some("display ".to_string() + name), attributes: vec![ - DomainAttributeValue { + DomainAttribute { name: "first_name".into(), value: Serialized::from(("first ".to_string() + name).as_str()), }, - DomainAttributeValue { + DomainAttribute { name: "last_name".into(), value: Serialized::from(("last ".to_string() + name).as_str()), }, diff --git a/server/src/domain/sql_group_backend_handler.rs b/server/src/domain/sql_group_backend_handler.rs index 911e43b..7e19895 100644 --- a/server/src/domain/sql_group_backend_handler.rs +++ b/server/src/domain/sql_group_backend_handler.rs @@ -7,7 +7,7 @@ use crate::domain::{ use async_trait::async_trait; use lldap_domain::{ requests::{CreateGroupRequest, UpdateGroupRequest}, - types::{AttributeName, AttributeValue, Group, GroupDetails, GroupId, Serialized, Uuid}, + types::{Attribute, AttributeName, Group, GroupDetails, GroupId, Serialized, Uuid}, }; use sea_orm::{ sea_query::{Alias, Cond, Expr, Func, IntoCondition, OnConflict, SimpleExpr}, @@ -133,7 +133,7 @@ impl GroupListerBackendHandler for SqlBackendHandler { for group in groups.iter_mut() { group.attributes = attributes_iter .take_while_ref(|u| u.group_id == group.id) - .map(AttributeValue::from) + .map(Attribute::from) .collect(); } groups.sort_by(|g1, g2| g1.display_name.cmp(&g2.display_name)); @@ -155,7 +155,7 @@ impl GroupBackendHandler for SqlBackendHandler { .order_by_asc(model::GroupAttributesColumn::AttributeName) .all(&self.sql_pool) .await?; - group_details.attributes = attributes.into_iter().map(AttributeValue::from).collect(); + group_details.attributes = attributes.into_iter().map(Attribute::from).collect(); Ok(group_details) } @@ -447,7 +447,7 @@ mod tests { group_id: fixture.groups[0], display_name: None, delete_attributes: Vec::new(), - insert_attributes: vec![AttributeValue { + insert_attributes: vec![Attribute { name: "gid".into(), value: Serialized::from(&512), }], @@ -548,7 +548,7 @@ mod tests { .handler .create_group(CreateGroupRequest { display_name: "New Group".into(), - attributes: vec![AttributeValue { + attributes: vec![Attribute { name: "new_attribute".into(), value: Serialized::from("value"), }], @@ -563,7 +563,7 @@ mod tests { assert_eq!(group_details.display_name, "New Group".into()); assert_eq!( group_details.attributes, - vec![AttributeValue { + vec![Attribute { name: "new_attribute".into(), value: Serialized::from("value"), }] @@ -585,7 +585,7 @@ mod tests { .await .unwrap(); let group_id = fixture.groups[0]; - let attributes = vec![AttributeValue { + let attributes = vec![Attribute { name: "new_attribute".into(), value: Serialized::from(&42i64), }]; diff --git a/server/src/domain/sql_schema_backend_handler.rs b/server/src/domain/sql_schema_backend_handler.rs index 0aafeeb..3b9e175 100644 --- a/server/src/domain/sql_schema_backend_handler.rs +++ b/server/src/domain/sql_schema_backend_handler.rs @@ -181,7 +181,7 @@ mod tests { }; use lldap_domain::requests::UpdateUserRequest; use lldap_domain::schema::AttributeList; - use lldap_domain::types::{AttributeType, AttributeValue, Serialized}; + use lldap_domain::types::{Attribute, AttributeType, Serialized}; use pretty_assertions::assert_eq; #[tokio::test] @@ -296,7 +296,7 @@ mod tests { .handler .update_user(UpdateUserRequest { user_id: "bob".into(), - insert_attributes: vec![AttributeValue { + insert_attributes: vec![Attribute { name: "new_attribute".into(), value: Serialized::from(&3), }], diff --git a/server/src/domain/sql_user_backend_handler.rs b/server/src/domain/sql_user_backend_handler.rs index 606e09e..231c263 100644 --- a/server/src/domain/sql_user_backend_handler.rs +++ b/server/src/domain/sql_user_backend_handler.rs @@ -8,8 +8,8 @@ use async_trait::async_trait; use lldap_domain::{ requests::{CreateUserRequest, UpdateUserRequest}, types::{ - AttributeName, AttributeValue, GroupDetails, GroupId, Serialized, User, UserAndGroups, - UserId, Uuid, + Attribute, AttributeName, GroupDetails, GroupId, Serialized, User, UserAndGroups, UserId, + Uuid, }, }; use sea_orm::{ @@ -165,7 +165,7 @@ impl UserListerBackendHandler for SqlBackendHandler { for user in users.iter_mut() { user.user.attributes = attributes_iter .take_while_ref(|u| u.user_id == user.user.user_id) - .map(AttributeValue::from) + .map(Attribute::from) .collect(); } Ok(users) @@ -270,7 +270,7 @@ impl UserBackendHandler for SqlBackendHandler { .order_by_asc(model::UserAttributesColumn::AttributeName) .all(&self.sql_pool) .await?; - user.attributes = attributes.into_iter().map(AttributeValue::from).collect(); + user.attributes = attributes.into_iter().map(Attribute::from).collect(); Ok(user) } @@ -812,15 +812,15 @@ mod tests { display_name: Some("display_name".to_string()), delete_attributes: Vec::new(), insert_attributes: vec![ - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("first_name"), }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("last_name"), }, - AttributeValue { + Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()), }, @@ -839,15 +839,15 @@ mod tests { assert_eq!( user.attributes, vec![ - AttributeValue { + Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()) }, - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("first_name") }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("last_name") } @@ -864,7 +864,7 @@ mod tests { .update_user(UpdateUserRequest { user_id: UserId::new("bob"), delete_attributes: vec!["last_name".into()], - insert_attributes: vec![AttributeValue { + insert_attributes: vec![Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()), }], @@ -882,11 +882,11 @@ mod tests { assert_eq!( user.attributes, vec![ - AttributeValue { + Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()) }, - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("first bob") } @@ -902,7 +902,7 @@ mod tests { .handler .update_user(UpdateUserRequest { user_id: UserId::new("bob"), - insert_attributes: vec![AttributeValue { + insert_attributes: vec![Attribute { name: "first_name".into(), value: Serialized::from("new first"), }], @@ -919,11 +919,11 @@ mod tests { assert_eq!( user.attributes, vec![ - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("new first") }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("last bob") } @@ -952,7 +952,7 @@ mod tests { .unwrap(); assert_eq!( user.attributes, - vec![AttributeValue { + vec![Attribute { name: "last_name".into(), value: Serialized::from("last bob") }] @@ -968,7 +968,7 @@ mod tests { .update_user(UpdateUserRequest { user_id: UserId::new("bob"), delete_attributes: vec!["first_name".into()], - insert_attributes: vec![AttributeValue { + insert_attributes: vec![Attribute { name: "first_name".into(), value: Serialized::from("new first"), }], @@ -985,11 +985,11 @@ mod tests { assert_eq!( user.attributes, vec![ - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("new first") }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("last bob") }, @@ -1005,7 +1005,7 @@ mod tests { .handler .update_user(UpdateUserRequest { user_id: UserId::new("bob"), - insert_attributes: vec![AttributeValue { + insert_attributes: vec![Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()), }], @@ -1019,7 +1019,7 @@ mod tests { .get_user_details(&UserId::new("bob")) .await .unwrap(); - let avatar = AttributeValue { + let avatar = Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()), }; @@ -1028,7 +1028,7 @@ mod tests { .handler .update_user(UpdateUserRequest { user_id: UserId::new("bob"), - insert_attributes: vec![AttributeValue { + insert_attributes: vec![Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::null()), }], @@ -1056,15 +1056,15 @@ mod tests { email: "email".into(), display_name: Some("display_name".to_string()), attributes: vec![ - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("First Name"), }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("last_name"), }, - AttributeValue { + Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()), }, @@ -1083,15 +1083,15 @@ mod tests { assert_eq!( user.attributes, vec![ - AttributeValue { + Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()) }, - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("First Name") }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("last_name") } diff --git a/server/src/infra/graphql/mutation.rs b/server/src/infra/graphql/mutation.rs index 47abca3..ac387cb 100644 --- a/server/src/infra/graphql/mutation.rs +++ b/server/src/infra/graphql/mutation.rs @@ -21,7 +21,7 @@ use lldap_domain::{ }, schema::AttributeList, types::{ - AttributeName, AttributeType, AttributeValue as DomainAttributeValue, Email, GroupId, + Attribute as DomainAttribute, AttributeName, AttributeType, Email, GroupId, LdapObjectClass, UserId, }, }; @@ -137,7 +137,7 @@ impl Success { struct UnpackedAttributes { email: Option, display_name: Option, - attributes: Vec, + attributes: Vec, } fn unpack_attributes( @@ -749,7 +749,7 @@ fn deserialize_attribute( attribute_schema: &AttributeList, attribute: AttributeValue, is_admin: bool, -) -> FieldResult { +) -> FieldResult { let attribute_name = AttributeName::from(attribute.name.as_str()); let attribute_schema = attribute_schema .get_attribute_schema(&attribute_name) @@ -774,7 +774,7 @@ fn deserialize_attribute( attribute_schema.is_list, ) .context(format!("While deserializing attribute {}", attribute.name))?; - Ok(DomainAttributeValue { + Ok(DomainAttribute { name: attribute_name, value: deserialized_values, }) diff --git a/server/src/infra/graphql/query.rs b/server/src/infra/graphql/query.rs index c9e481b..e37b4ab 100644 --- a/server/src/infra/graphql/query.rs +++ b/server/src/infra/graphql/query.rs @@ -28,7 +28,7 @@ type DomainGroup = lldap_domain::types::Group; type DomainUserAndGroups = lldap_domain::types::UserAndGroups; type DomainAttributeList = lldap_domain::schema::AttributeList; type DomainAttributeSchema = lldap_domain::schema::AttributeSchema; -type DomainAttributeValue = lldap_domain::types::AttributeValue; +type DomainAttribute = lldap_domain::types::Attribute; #[derive(PartialEq, Eq, Debug, GraphQLInputObject)] /// A filter for requests, specifying a boolean expression based on field constraints. Only one of @@ -578,7 +578,7 @@ impl From for Schema { #[derive(PartialEq, Eq, Debug, Serialize, Deserialize)] pub struct AttributeValue { - attribute: DomainAttributeValue, + attribute: DomainAttribute, schema: AttributeSchema, _phantom: std::marker::PhantomData>, } @@ -599,7 +599,7 @@ impl AttributeValue { } impl AttributeValue { - fn from_domain(value: DomainAttributeValue, schema: DomainAttributeSchema) -> Self { + fn from_domain(value: DomainAttribute, schema: DomainAttributeSchema) -> Self { Self { attribute: value, schema: AttributeSchema:: { @@ -622,7 +622,7 @@ impl Clone for AttributeValue { } pub fn serialize_attribute( - attribute: &DomainAttributeValue, + attribute: &DomainAttribute, attribute_schema: &DomainAttributeSchema, ) -> Vec { let convert_date = |date| chrono::Utc.from_utc_datetime(&date).to_rfc3339(); @@ -665,7 +665,7 @@ pub fn serialize_attribute( } impl AttributeValue { - fn from_schema(a: DomainAttributeValue, schema: &DomainAttributeList) -> Option { + fn from_schema(a: DomainAttribute, schema: &DomainAttributeList) -> Option { schema .get_attribute_schema(&a.name) .map(|s| AttributeValue::::from_domain(a, s.clone())) @@ -696,7 +696,7 @@ impl AttributeValue { }) .map(|(attribute, value)| { AttributeValue::::from_domain( - DomainAttributeValue { + DomainAttribute { name: attribute.name.clone(), value, }, @@ -738,7 +738,7 @@ impl AttributeValue { }) .map(|(attribute, value)| { AttributeValue::::from_domain( - DomainAttributeValue { + DomainAttribute { name: attribute.name.clone(), value, }, @@ -780,7 +780,7 @@ impl AttributeValue { }) .map(|(attribute, value)| { AttributeValue::::from_domain( - DomainAttributeValue { + DomainAttribute { name: attribute.name.clone(), value, }, @@ -908,11 +908,11 @@ mod tests { creation_date: chrono::Utc.timestamp_millis_opt(42).unwrap().naive_utc(), uuid: lldap_domain::uuid!("b1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8"), attributes: vec![ - DomainAttributeValue { + DomainAttribute { name: "first_name".into(), value: Serialized::from("Bob"), }, - DomainAttributeValue { + DomainAttribute { name: "last_name".into(), value: Serialized::from("Bobberson"), }, @@ -926,7 +926,7 @@ mod tests { display_name: "Bobbersons".into(), creation_date: chrono::Utc.timestamp_nanos(42).naive_utc(), uuid: lldap_domain::uuid!("a1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8"), - attributes: vec![DomainAttributeValue { + attributes: vec![DomainAttribute { name: "club_name".into(), value: Serialized::from("Gang of Four"), }], diff --git a/server/src/infra/ldap_handler.rs b/server/src/infra/ldap_handler.rs index 264485a..92d1802 100644 --- a/server/src/infra/ldap_handler.rs +++ b/server/src/infra/ldap_handler.rs @@ -28,7 +28,7 @@ use ldap3_proto::proto::{ }; use lldap_domain::{ requests::CreateUserRequest, - types::{AttributeName, AttributeType, AttributeValue, Email, Group, UserAndGroups, UserId}, + types::{Attribute, AttributeName, AttributeType, Email, Group, UserAndGroups, UserId}, }; use std::collections::HashMap; use tracing::{debug, instrument, warn}; @@ -771,7 +771,7 @@ impl LdapHandler LdapHandler = Vec::new(); + let mut new_user_attributes: Vec = Vec::new(); if let Some(first_name) = get_attribute("givenname").transpose()? { new_user_attributes.push(make_encoded_attribute( "first_name", @@ -1298,11 +1298,11 @@ mod tests { display_name: Some("Bôb Böbberson".to_string()), uuid: uuid!("698e1d5f-7a40-3151-8745-b9b8a37839da"), attributes: vec![ - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("Bôb"), }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("Böbberson"), }, @@ -1317,15 +1317,15 @@ mod tests { email: "jim@cricket.jim".into(), display_name: Some("Jimminy Cricket".to_string()), attributes: vec![ - AttributeValue { + Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()), }, - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("Jim"), }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("Cricket"), }, @@ -1735,7 +1735,7 @@ mod tests { creation_date: chrono::Utc.timestamp_opt(42, 42).unwrap().naive_utc(), users: vec![], uuid: uuid!("04ac75e0-2900-3e21-926c-2f732c26b3fc"), - attributes: vec![AttributeValue { + attributes: vec![Attribute { name: "Attr".into(), value: Serialized::from("TEST"), }], @@ -2171,11 +2171,11 @@ mod tests { email: "bob@bobmail.bob".into(), display_name: Some("Bôb Böbberson".to_string()), attributes: vec![ - AttributeValue { + Attribute { name: "first_name".into(), value: Serialized::from("Bôb"), }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("Böbberson"), }, @@ -2255,11 +2255,11 @@ mod tests { email: "bob@bobmail.bob".into(), display_name: Some("Bôb Böbberson".to_string()), attributes: vec![ - AttributeValue { + Attribute { name: "avatar".into(), value: Serialized::from(&JpegPhoto::for_tests()), }, - AttributeValue { + Attribute { name: "last_name".into(), value: Serialized::from("Böbberson"), }, @@ -3076,7 +3076,7 @@ mod tests { Ok(vec![UserAndGroups { user: User { user_id: UserId::new("test"), - attributes: vec![AttributeValue { + attributes: vec![Attribute { name: "nickname".into(), value: Serialized::from("Bob the Builder"), }], @@ -3092,7 +3092,7 @@ mod tests { creation_date: chrono::Utc.timestamp_opt(42, 42).unwrap().naive_utc(), users: vec![UserId::new("bob")], uuid: uuid!("04ac75e0-2900-3e21-926c-2f732c26b3fc"), - attributes: vec![AttributeValue { + attributes: vec![Attribute { name: "club_name".into(), value: Serialized::from("Breakfast Club"), }],