Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
class (Monad m, AuthTypes tag, UserTypes tag) => UserDB tag m where Source #
getUsers :: AuthInfo tag -> Maybe Filter -> ScimHandler m (ListResponse (StoredUser tag)) Source #
Get all users, optionally filtered by a Filter
.
getUser :: AuthInfo tag -> UserId tag -> ScimHandler m (StoredUser tag) Source #
Get a single user by ID.
Should throw notFound
if the user doesn't exist.
postUser :: AuthInfo tag -> User tag -> ScimHandler m (StoredUser tag) Source #
Create a new user.
Should throw conflict
if uniqueness constraints are violated.
putUser :: AuthInfo tag -> UserId tag -> User tag -> ScimHandler m (StoredUser tag) Source #
Overwrite an existing user.
Should throw notFound
if the user doesn't exist, and conflict
if
uniqueness constraints are violated.
:: AuthInfo tag | |
-> UserId tag | |
-> PatchOp tag | PATCH payload |
-> ScimHandler m (StoredUser tag) |
Modify an existing user.
Should throw notFound
if the user doesn't exist, and conflict
if
uniqueness constraints are violated.
https://tools.ietf.org/html/rfc7644#section-3.5.2
If the target location already contains the value specified, no changes SHOULD be made to the resource, and a success response SHOULD be returned. Unless other operations change the resource, this operation SHALL NOT change the modify timestamp of the resource.
Given that PUT has the same constraints, we can implement PATCH in terms of some magic in this library, GET and PUT.
SCIM's Patch semantics are hard to get right. So we advice using the library built-in implementation. we implement PATCH in terms of a GET followed by a PUT. GET will retrieve the entire record; we then modify this record by a series of PATCH operations, and then PUT the entire record.
default patchUser :: (Patchable (UserExtra tag), FromJSON (UserExtra tag)) => AuthInfo tag -> UserId tag -> PatchOp tag -> ScimHandler m (StoredUser tag) Source #
deleteUser :: AuthInfo tag -> UserId tag -> ScimHandler m () Source #
Delete a user.
Should throw notFound
if the user doesn't exist.
Instances
UserDB Mock TestServer Source # | |
Defined in Web.Scim.Server.Mock getUsers :: AuthInfo Mock -> Maybe Filter -> ScimHandler TestServer (ListResponse (StoredUser Mock)) Source # getUser :: AuthInfo Mock -> UserId Mock -> ScimHandler TestServer (StoredUser Mock) Source # postUser :: AuthInfo Mock -> User Mock -> ScimHandler TestServer (StoredUser Mock) Source # putUser :: AuthInfo Mock -> UserId Mock -> User Mock -> ScimHandler TestServer (StoredUser Mock) Source # patchUser :: AuthInfo Mock -> UserId Mock -> PatchOp Mock -> ScimHandler TestServer (StoredUser Mock) Source # deleteUser :: AuthInfo Mock -> UserId Mock -> ScimHandler TestServer () Source # |
data UserSite tag route Source #
UserSite | |
|
Instances
userServer :: forall tag m. (AuthDB tag m, UserDB tag m) => Maybe (AuthData tag) -> UserSite tag (AsServerT (ScimHandler m)) Source #