Fix some external_id issues

- Do not update `externalId` on group updates
   Groups are only updated via the web-vault currently, and those do not
   send the `externalId` value, and thus we need to prevent updating it.
 - Refactored some other ExternalId functions
 - Prevent empty `externalId` on `Collections`
 - Return `externalId` for users

Fixes #3685
This commit is contained in:
BlackDex
2023-07-12 21:58:45 +02:00
parent 61f9081827
commit 631d022e17
3 changed files with 28 additions and 38 deletions

View File

@@ -434,6 +434,7 @@ impl UserOrganization {
"UserId": self.user_uuid,
"Name": user.name,
"Email": user.email,
"ExternalId": user.external_id,
"Groups": groups,
"Collections": collections,
@@ -441,7 +442,7 @@ impl UserOrganization {
"Type": self.atype,
"AccessAll": self.access_all,
"TwoFactorEnabled": twofactor_enabled,
"ResetPasswordEnrolled":self.reset_password_key.is_some(),
"ResetPasswordEnrolled": self.reset_password_key.is_some(),
"Object": "organizationUserUserDetails",
})