Merge pull request #720 from mschristiansen/master
Add HasLink instance for AuthProtect.
This commit is contained in:
commit
f05b394261
1 changed files with 6 additions and 0 deletions
|
@ -112,6 +112,7 @@ import Servant.API.Verbs ( Verb )
|
||||||
import Servant.API.Sub ( type (:>) )
|
import Servant.API.Sub ( type (:>) )
|
||||||
import Servant.API.Raw ( Raw )
|
import Servant.API.Raw ( Raw )
|
||||||
import Servant.API.TypeLevel
|
import Servant.API.TypeLevel
|
||||||
|
import Servant.API.Experimental.Auth ( AuthProtect )
|
||||||
|
|
||||||
-- | A safe link datatype.
|
-- | A safe link datatype.
|
||||||
-- The only way of constructing a 'Link' is using 'safeLink', which means any
|
-- The only way of constructing a 'Link' is using 'safeLink', which means any
|
||||||
|
@ -259,3 +260,8 @@ instance HasLink (Verb m s ct a) where
|
||||||
instance HasLink Raw where
|
instance HasLink Raw where
|
||||||
type MkLink Raw = Link
|
type MkLink Raw = Link
|
||||||
toLink _ = id
|
toLink _ = id
|
||||||
|
|
||||||
|
-- AuthProtext instances
|
||||||
|
instance HasLink sub => HasLink (AuthProtect tag :> sub) where
|
||||||
|
type MkLink (AuthProtect tag :> sub) = MkLink sub
|
||||||
|
toLink _ = toLink (Proxy :: Proxy sub)
|
||||||
|
|
Loading…
Reference in a new issue