Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- serveAversAPI :: Handle -> Authorizations -> Server AversAPI
- credentialsObjId :: Handle -> Credentials -> Handler ObjId
- data Authorizations = Authorizations {
- createObjectAuthz :: Credentials -> Text -> Authz
- lookupObjectAuthz :: Credentials -> ObjId -> Authz
- patchObjectAuthz :: Credentials -> ObjId -> [Operation] -> Authz
- deleteObjectAuthz :: Credentials -> ObjId -> Authz
- uploadBlobAuthz :: Credentials -> Text -> Authz
- lookupBlobAuthz :: Credentials -> BlobId -> Authz
- lookupBlobContentAuthz :: Credentials -> BlobId -> Authz
- type Authz = [Avers AuthzR]
- data AuthzR
- defaultAuthorizations :: Authorizations
- runAuthorization :: Handle -> Authz -> Handler ()
- trace :: Avers () -> Avers AuthzR
- sufficient :: Avers Bool -> Avers AuthzR
- requisite :: Avers Bool -> Avers AuthzR
- sessionCreatedObject :: Session -> ObjId -> Avers Bool
- sessionIsObject :: Session -> ObjId -> Avers Bool
Documentation
serveAversAPI :: Handle -> Authorizations -> Server AversAPI Source #
credentialsObjId :: Handle -> Credentials -> Handler ObjId Source #
Convert the Credentials
into an ObjId
to which the ceredentials refer.
That's the object the client is authenticated as.
data Authorizations Source #
Defines all the authorization points which are used in the server. For each you can supply your own logic. The default is to allow everything.
Authorizations | |
|
runAuthorization :: Handle -> Authz -> Handler () Source #
Run the authorization logic inside of the Servant monad.
trace :: Avers () -> Avers AuthzR Source #
This doesn't change the result, but allows you to run arbitrary Avers
actions. This is useful for debugging.