servant-server-0.20.3.0: A family of combinators for defining webservices APIs and serving them

Safe Haskell | None
Language | Haskell2010

Servant.Server.Experimental.Auth

Contents

- General Auth
- Orphan instances

Synopsis

- type family AuthServerData a
- newtype AuthHandler r usr = AuthHandler {
  - unAuthHandler :: r -> Handler usr
  }
- mkAuthHandler :: (r -> Handler usr) -> AuthHandler r usr

# General Auth

type family AuthServerData a Source #

Specify the type of data returned after we've authenticated a request. quite often this is some `User` datatype.

NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE

newtype AuthHandler r usr Source #

Handlers for AuthProtected resources

NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE

Constructors

AuthHandler |

Fields

- unAuthHandler :: r -> Handler usr

#### Instances

Instances details

Functor (AuthHandler r) Source # |
Instance details Defined in Servant.Server.Experimental.Auth Methods fmap :: (a -> b) -> AuthHandler r a -> AuthHandler r b Source # (<$) :: a -> AuthHandler r b -> AuthHandler r a Source #
Generic (AuthHandler r usr) Source # |

Instance details

Defined in Servant.Server.Experimental.Auth

Associated Types

type Rep (AuthHandler r usr) |
Instance details Defined in Servant.Server.Experimental.Auth type Rep (AuthHandler r usr) = D1 ('MetaData "AuthHandler" "Servant.Server.Experimental.Auth" "servant-server-0.20.3.0-K3OEf3La2TA6Zg4wWiPZKx" 'True) (C1 ('MetaCons "AuthHandler" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAuthHandler") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (r -> Handler usr))))

Methods

from :: AuthHandler r usr -> Rep (AuthHandler r usr) x Source #

to :: Rep (AuthHandler r usr) x -> AuthHandler r usr Source #

type Rep (AuthHandler r usr) Source # |
Instance details Defined in Servant.Server.Experimental.Auth type Rep (AuthHandler r usr) = D1 ('MetaData "AuthHandler" "Servant.Server.Experimental.Auth" "servant-server-0.20.3.0-K3OEf3La2TA6Zg4wWiPZKx" 'True) (C1 ('MetaCons "AuthHandler" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAuthHandler") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (r -> Handler usr))))

mkAuthHandler :: (r -> Handler usr) -> AuthHandler r usr Source #

NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE

# Orphan instances

(HasServer api context, HasContextEntry context (AuthHandler Request (AuthServerData (AuthProtect tag)))) => HasServer (AuthProtect tag :> api :: Type) context Source # | Known orphan instance.
Instance details Methods route :: Proxy (AuthProtect tag :> api) -> Context context -> Delayed env (Server (AuthProtect tag :> api)) -> Router env Source # hoistServerWithContext :: Proxy (AuthProtect tag :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (AuthProtect tag :> api) m -> ServerT (AuthProtect tag :> api) n Source #