| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Test.Spar
Synopsis
- testTeamInvitationWhenScimInvitationExpired :: HasCallStack => App ()
- testTeamInvitationWhenScimInvitationPending :: HasCallStack => App ()
- testTeamInvitationWhenScimAccountExists :: HasCallStack => App ()
- testTeamInvitationUsedAfterScimUserDeleted :: HasCallStack => App ()
- testSparUserCreationInvitationTimeout :: HasCallStack => App ()
- testSparExternalIdDifferentFromEmailWithIdp :: HasCallStack => App ()
- testSparPatchEmailValuePath :: HasCallStack => App ()
- testSparPatchEmailValuePathInPlace :: HasCallStack => App ()
- testSparScimEmailMetaRoundTrip :: HasCallStack => App ()
- testSparScimEmailTypeNonWorkEcho :: HasCallStack => App ()
- testSparPatchEmailSubAttrRemoveNull :: HasCallStack => App ()
- testSparRejectsMultiplePrimaryEmails :: HasCallStack => App ()
- testSparExternalIdDifferentFromEmail :: HasCallStack => App ()
- testSparExternalIdUpdateToANonEmail :: HasCallStack => App ()
- scimPatchOp :: String -> String -> Maybe Value -> Value
- scimAddPatchOp :: String -> String -> Value
- testSparMigrateFromExternalIdOnlyToEmail :: HasCallStack => Tagged "mailUnchanged" Bool -> App ()
- checkSparGetUserAndFindByExtId :: (HasCallStack, MakesValue domain) => domain -> String -> String -> String -> (Value -> App ()) -> App ()
- scimStoredEmail :: String -> Value
- testSparScimTokenLimit :: HasCallStack => App ()
- testSparCreateScimTokenNoName :: HasCallStack => App ()
- testSparCreateScimTokenAssocImplicitly :: HasCallStack => App ()
- testSparCreateScimTokenWithName :: HasCallStack => App ()
- testSparScimCreateGetSearchUserGroup :: HasCallStack => App ()
- testSparScimUpdateUserGroup :: HasCallStack => App ()
- normalizeValue :: MakesValue a => a -> App Value
- testSparScimUpdateUserGroupRejectsInvalidMembers :: HasCallStack => App ()
- testSparScimDeleteUserGroup :: HasCallStack => App ()
- testSparScimGroupSearchOnlyReturnsScimGroups :: HasCallStack => App ()
- testSparEmulateSPInitiatedLogin :: HasCallStack => App ()
- testSparExpiredIdpCertStillWorks :: HasCallStack => App ()
- testSparSPInitiatedLoginWithUtf8 :: HasCallStack => App ()
- testSparCreateTwoScimTokensForOneIdp :: HasCallStack => App ()
- testCheckAdminGetTeamId :: HasCallStack => App ()
- testCheckAdminGetTeamIdV7 :: App ()
- testSsoLoginAndEmailVerification :: HasCallStack => App ()
- testSsoLoginNoSamlEmailValidation :: HasCallStack => TaggedBool "requireExternalEmailVerification" -> App ()
- testScimUpdateEmailAddress :: HasCallStack => TaggedBool "extIdIsEmail" -> TaggedBool "requireExternalEmailVerification" -> App ()
- testScimUpdateEmailAddressAndExternalId :: HasCallStack => App ()
- testScimLoginNoSamlEmailValidation :: HasCallStack => TaggedBool "requireExternalEmailVerification" -> App ()
- testIdpUpdate :: HasCallStack => App ()
- testAllowUpdatesBySCIMWhenE2EIdEnabled :: HasCallStack => TaggedBool "sso-enabled" -> App ()
- testNoPasswordResetForSAMLUser :: HasCallStack => App ()
- testScimUserIsNotAllowedToChangeName :: HasCallStack => App ()
- testScimUserIsNotAllowedToChangeNameOnRegistering :: HasCallStack => App ()
- testScimUserChangeNameOnRegisteringIgnoredV16 :: HasCallStack => App ()
- testSparScimInvalidatesPendingEmail :: HasCallStack => App ()
Documentation
testTeamInvitationUsedAfterScimUserDeleted :: HasCallStack => App () Source #
Ensure that unused team invitations are invalidated when the SCIM user gets deleted.
testSparPatchEmailValuePath :: HasCallStack => App () Source #
testSparScimEmailMetaRoundTrip :: HasCallStack => App () Source #
SCIM email metadata (type, primary) round-trips verbatim: spar
persists what the IdP sends and echoes exactly that; users provisioned
without metadata get back an email object with only value (strict echo).
testSparScimEmailTypeNonWorkEcho :: HasCallStack => App () Source #
Non-"work" email types are accepted and echoed verbatim (no normalization to "work").
testSparPatchEmailSubAttrRemoveNull :: HasCallStack => App () Source #
RFC 7644 §3.5.2.2: removing a sub-attribute unassigns it and keeps the
record; RFC 7643 §2.5 (and RFC 7644 §3.5.2): assigning null is equivalent
to unassignment. Removing or nulling emails[type eq "work"].type must
not erase the email value or the primary flag.
scimPatchOp :: String -> String -> Maybe Value -> Value Source #
A SCIM PatchOp with the given op, path, and optional value.
testSparMigrateFromExternalIdOnlyToEmail :: HasCallStack => Tagged "mailUnchanged" Bool -> App () Source #
checkSparGetUserAndFindByExtId :: (HasCallStack, MakesValue domain) => domain -> String -> String -> String -> (Value -> App ()) -> App () Source #
scimStoredEmail :: String -> Value Source #
Expected SCIM email object. spar echoes the type/primary metadata of the
stored email entry exactly as provisioned (see
synthesizeScimUser); fixtures in this module send no
metadata, so the expected email object has only value.
testSparScimTokenLimit :: HasCallStack => App () Source #
testSparCreateScimTokenNoName :: HasCallStack => App () Source #
testSparCreateScimTokenAssocImplicitly :: HasCallStack => App () Source #
in V6, create idp then scim without idp id and idp id is unique
testSparCreateScimTokenWithName :: HasCallStack => App () Source #
in V6, name should be ignored
testSparScimUpdateUserGroup :: HasCallStack => App () Source #
normalizeValue :: MakesValue a => a -> App Value Source #
Normalize on Value level
Recursively sorts all JSON arrays. This produces a canonical form, where the initial order of elements doesn't matter. Only use this function when that's desired (i.e. there is no value in the order of elements).
testSparScimDeleteUserGroup :: HasCallStack => App () Source #
testSparEmulateSPInitiatedLogin :: HasCallStack => App () Source #
In this test, the IdP attempts an IdP-initiated login, and the client gets redirected back to IdP from SP with a valid authentication request. This is to make some hypothetical attacks harder while still supporting login dashboards in IdP UIs.
testSparExpiredIdpCertStillWorks :: HasCallStack => App () Source #
The backend accepts an IdP descriptor whose signing cert is already expired, both at config-import time (POST /identity-providers) and at AuthnResponse verification time (POST ssofinalize-login).
This was probably built this way to not force team admins to reconfigure IdPs over and over again (and if they forget, having angry users who cannot login).
testSparSPInitiatedLoginWithUtf8 :: HasCallStack => App () Source #
UTF-8 chars (non-Latin-1) caused issues in XML parsing.
testSparCreateTwoScimTokensForOneIdp :: HasCallStack => App () Source #
in V6, create two idps then one scim should fail
testCheckAdminGetTeamId :: HasCallStack => App () Source #
testCheckAdminGetTeamIdV7 :: App () Source #
testSsoLoginNoSamlEmailValidation :: HasCallStack => TaggedBool "requireExternalEmailVerification" -> App () Source #
This test may be covered by testScimUpdateEmailAddress and maybe can be removed.
testScimUpdateEmailAddress :: HasCallStack => TaggedBool "extIdIsEmail" -> TaggedBool "requireExternalEmailVerification" -> App () Source #
create user with non-email externalId. then use put to add an email address.
testScimUpdateEmailAddressAndExternalId :: HasCallStack => App () Source #
changing externalId and emails subsequently:
- create user with extid email;
- add email to emails field;
- change extId to uuid;
- change extId back to *other* email.
(may overlap with testSsoLoginNoSamlEmailValidation.)
testScimLoginNoSamlEmailValidation :: HasCallStack => TaggedBool "requireExternalEmailVerification" -> App () Source #
testIdpUpdate :: HasCallStack => App () Source #
testAllowUpdatesBySCIMWhenE2EIdEnabled :: HasCallStack => TaggedBool "sso-enabled" -> App () Source #
testNoPasswordResetForSAMLUser :: HasCallStack => App () Source #
testSparScimInvalidatesPendingEmail :: HasCallStack => App () Source #
A pending email update (emailUnvalidated + activation code) must be
invalidated when the user transitions to SCIM control. Getting a Wire-managed
user via the SCIM API triggers getUserById -> synthesizeStoredUser ->
ManagedByScim -> deletePendingEmailUpdate in spar, which calls the brig
internal endpoint that deletes both the activation code and the pending
email entry. See WPB-21744 / PR #5333.