diff --git a/packages/types/src/api/web/global/scim/users.ts b/packages/types/src/api/web/global/scim/users.ts index 72b7078bb4..143419829c 100644 --- a/packages/types/src/api/web/global/scim/users.ts +++ b/packages/types/src/api/web/global/scim/users.ts @@ -1,6 +1,6 @@ import { ScimResource, ScimMeta, ScimPatchOperation } from "scim-patch" -type BooleanString = boolean | "True" | "False" +type BooleanString = boolean | "True" | "true" | "False" | "false" export interface ScimUserResponse extends ScimResource { schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"] diff --git a/packages/worker/src/api/routes/global/tests/scim/users.spec.ts b/packages/worker/src/api/routes/global/tests/scim/users.spec.ts index 5921ae0aeb..12910e63fe 100644 --- a/packages/worker/src/api/routes/global/tests/scim/users.spec.ts +++ b/packages/worker/src/api/routes/global/tests/scim/users.spec.ts @@ -396,23 +396,26 @@ describe("/api/global/scim/v2/users", () => { expect(persistedUser).toEqual(expectedScimUser) }) - it("can deactive an active user", async () => { - const body: ScimUpdateRequest = { - schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], - Operations: [{ op: "Replace", path: "active", value: "False" }], + it.each([false, "false", "False"])( + "can deactive an active user (sending %s)", + async activeValue => { + const body: ScimUpdateRequest = { + schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], + Operations: [{ op: "Replace", path: "active", value: activeValue }], + } + + const response = await patchScimUser({ id: user.id, body }) + + const expectedScimUser: ScimUserResponse = { + ...user, + active: false, + } + expect(response).toEqual(expectedScimUser) + + const persistedUser = await config.api.scimUsersAPI.find(user.id) + expect(persistedUser).toEqual(expectedScimUser) } - - const response = await patchScimUser({ id: user.id, body }) - - const expectedScimUser: ScimUserResponse = { - ...user, - active: false, - } - expect(response).toEqual(expectedScimUser) - - const persistedUser = await config.api.scimUsersAPI.find(user.id) - expect(persistedUser).toEqual(expectedScimUser) - }) + ) it("supports updating unmapped fields", async () => { const body: ScimUpdateRequest = {