integration-0.1.0
Safe HaskellNone
LanguageGHC2021

Test.Spar.SCIM

Description

SCIM is the only writer of the user attributes it owns: since we never push SCIM data back to the IdP/provisioning side, any change by somebody else would silently put wire and the SCIM client out of sync. So for a user with managed_by == scim, every field of Wire.API.User.User that SCIM can write (ie., that is derived from Wire.API.User.Scim.ValidScimUser) must be rejected for all other actors.

The remaining User fields (userTextStatus, userPict, userAssets, userAccentId, userSupportedProtocols, userSearchable, ...) are not SCIM-managed and stay writable; testNonScimManagedFieldsStayWritable pins that down so the guards above don't accidentally grow into a blanket lock. SCIM-provisioned user groups are not write-protected either; see testScimGroupIsWritableByTeamAdmin.

Synopsis

Documentation

setupScimTeam :: HasCallStack => App (Value, Value, Value) Source #

Team with a SCIM token, one SCIM-provisioned (and registered, hence password-owning) member, and one ordinary wire-managed member. Returns (owner, scim user, wire user).

testScimUserIsNotAllowedToChangeName :: HasCallStack => App () Source #

userHandle and userDisplayName are SCIM-managed, so the user may not change them herself.

testScimManagedLocaleIsLockedForUser :: HasCallStack => App () Source #

userLocale is SCIM-managed, so the user may not change it herself. (The same is checked for e2eid teams in testAllowUpdatesBySCIMWhenE2EIdEnabled; here the team has no e2eid, so the lock can only come from managed_by == scim.)

testScimManagedEmailIsLockedForUser :: HasCallStack => App () Source #

userIdentity (the email part) is SCIM-managed, so the user may not change it herself.

testScimManagedEmailCannotBeRemoved :: HasCallStack => App () Source #

Removing a SCIM-managed email must be rejected without changing the identity.

testScimManagedEmailIsLockedForTeamAdmin :: HasCallStack => App () Source #

... and neither may a team admin, who can change the email address of any other wire-managed member of her team (PUT /users/:uid/email).

testScimManagedRoleIsLockedForTeamAdmin :: HasCallStack => App () Source #

A team owner must not overwrite a SCIM-provisioned role.

testScimUserAlwaysHasRole :: HasCallStack => App () Source #

Missing or empty roles on creation default to member; empty roles on update preserve the existing role rather than leaving the user without one.

testScimInvitationRoleCanBeUpdated :: HasCallStack => App () Source #

Role changes must also apply before the SCIM invitation is accepted.

testScimGroupIsWritableByTeamAdmin :: HasCallStack => App () Source #

Unlike the user attributes above, a SCIM-provisioned group is not write-protected: a team admin may rename it, change its membership and delete it through the public API.

testNonScimManagedFieldsStayWritable :: HasCallStack => App () Source #

Non-provisioned profile fields must not acquire a blanket SCIM lock.