1
0
mirror of https://github.com/bitwarden/server synced 2025-12-20 02:03:46 +00:00

[EC-338] Update SCIM code naming conventions (revoked/restore) (#2140)

* Keep old endpoints but mark as deprecated
* Do not change existing sproc naming
This commit is contained in:
Thomas Rittson
2022-07-25 10:47:44 +10:00
committed by GitHub
parent cf16be16c6
commit f6a18db582
10 changed files with 93 additions and 61 deletions

View File

@@ -191,13 +191,13 @@ namespace Bit.Scim.Controllers.v2
});
}
if (model.Active && orgUser.Status == OrganizationUserStatusType.Deactivated)
if (model.Active && orgUser.Status == OrganizationUserStatusType.Revoked)
{
await _organizationService.ActivateUserAsync(orgUser, null);
await _organizationService.RestoreUserAsync(orgUser, null);
}
else if (!model.Active && orgUser.Status != OrganizationUserStatusType.Deactivated)
else if (!model.Active && orgUser.Status != OrganizationUserStatusType.Revoked)
{
await _organizationService.DeactivateUserAsync(orgUser, null);
await _organizationService.RevokeUserAsync(orgUser, null);
}
// Have to get full details object for response model
@@ -227,14 +227,14 @@ namespace Bit.Scim.Controllers.v2
if (replaceOp.Value.TryGetProperty("active", out var activeProperty))
{
var active = activeProperty.GetBoolean();
if (active && orgUser.Status == OrganizationUserStatusType.Deactivated)
if (active && orgUser.Status == OrganizationUserStatusType.Revoked)
{
await _organizationService.ActivateUserAsync(orgUser, null);
await _organizationService.RestoreUserAsync(orgUser, null);
operationHandled = true;
}
else if (!active && orgUser.Status != OrganizationUserStatusType.Deactivated)
else if (!active && orgUser.Status != OrganizationUserStatusType.Revoked)
{
await _organizationService.DeactivateUserAsync(orgUser, null);
await _organizationService.RevokeUserAsync(orgUser, null);
operationHandled = true;
}
}