mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #3685] Group External ID cleared after editing #1644
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#1644
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MatthewA1 on GitHub (Jul 11, 2023).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/3685
Subject of the issue
When a group created by the Bitwarden Directory Connector is edited through the web vault (for example, by editing the groups Collections access), the External ID field is cleared. This results in duplicates of the group being created when the groups are next synchronized by the BWDC.
Deployment environment
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden:
Clients used: web vault, desktop, Bitwarden Directory Connector
Reverse proxy and version: None
Other relevant details: Using Bitwarden Directory Connector in an Active Directory Environment; Organization Groups Enabled
Steps to reproduce
Expected behaviour
Changes to the group should be saved without affecting fields not edited (or read-only fields)
Actual behaviour
The changes to the group are saved, but the External ID field is cleared as well. This results in duplicates of the group being created the next time synchronization is preformed using the Bitwarden Directory Connector.
Troubleshooting data
I think the cause of this is the API request made by the web vault always sends null for the External ID, even if it is set, as the External ID is a read-only field (at least in the web vault). When a group is edited, the current External ID should be preserved instead of being either overwritten by this value or reset to the default null value.
@tessus commented on GitHub (Jul 11, 2023):
If this is really the case, bitwarden will have to fix this, because the vw devs do not maintain the clients.
Update: However, it might have something to do with the
pub fn set_external_idfunction. It seems to me that the vw server removes the data when an empty string is sent.@BlackDex commented on GitHub (Jul 11, 2023):
Well i was looking at this already, and the whole logic is a bit off i think looking at it right now.
I can remember that in older versions of the web-vault you was able to configure the
external-idvalues (And you still can for collections, but that might be a bug), but currently you can't.It states it is only used by the Directory Connector and thus it should only be handled by endpoints using that part.
That means, that an update via the web-vault, should not update/set/remove the value, as it also is set as read-only.
I know that with the 2022.12.0 release you could still manually add/update those values. But since 2023.2.0 they made those fields read-only.
So in the end, I think we need to make some changes on the Vaultwarden side.
@BlackDex commented on GitHub (Jul 12, 2023):
I have fixed it in the above PR, including some refactoring and other
externalIdfixes.