{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Servant.Auth where
import Data.Proxy (Proxy(..))
import Servant.API ((:>))
import Servant.Links (HasLink (..))
data Auth (auths :: [*]) val
instance HasLink sub => HasLink (Auth (tag :: [*]) value :> sub) where
#if MIN_VERSION_servant(0,14,0)
type MkLink (Auth (tag :: [*]) value :> sub) a = MkLink sub a
toLink :: (Link -> a)
-> Proxy (Auth tag value :> sub)
-> Link
-> MkLink (Auth tag value :> sub) a
toLink Link -> a
toA Proxy (Auth tag value :> sub)
_ = (Link -> a) -> Proxy sub -> Link -> MkLink sub a
forall k (endpoint :: k) a.
HasLink endpoint =>
(Link -> a) -> Proxy endpoint -> Link -> MkLink endpoint a
toLink Link -> a
toA (Proxy sub
forall k (t :: k). Proxy t
Proxy :: Proxy sub)
#else
type MkLink (Auth (tag :: [*]) value :> sub) = MkLink sub
toLink _ = toLink (Proxy :: Proxy sub)
#endif
data JWT
data Cookie
data BasicAuth
data FormLogin form