Safe Haskell | None |
---|---|
Language | Haskell2010 |
- serveAversCoreAPI :: Handle -> Authorizations -> Server AversCoreAPI
- serveAversSessionAPI :: Handle -> Server AversSessionAPI
- credentialsObjId :: Handle -> Credentials -> ExceptT ServantErr IO ObjId
- data Authorizations = Authorizations {
- createObjectAuthz :: Credentials -> Text -> Authz
- lookupObjectAuthz :: Credentials -> ObjId -> Authz
- type Authz = [Avers AuthzR]
- data AuthzR
- defaultAuthorizations :: Authorizations
- runAuthorization :: Handle -> Authz -> ExceptT ServantErr IO ()
- trace :: Avers () -> Avers AuthzR
- sufficient :: Avers Bool -> Avers AuthzR
- requisite :: Avers Bool -> Avers AuthzR
Documentation
credentialsObjId :: Handle -> Credentials -> ExceptT ServantErr IO 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 -> ExceptT ServantErr IO () 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.