Remove unneeded tag from BasicAuth

This commit is contained in:
aaron levin 2016-01-16 18:09:10 +01:00
parent 2e7778d1d6
commit 9decfee68b
3 changed files with 5 additions and 5 deletions

View file

@ -471,9 +471,9 @@ instance HasServer api => HasServer (HttpVersion :> api) where
-- | Basic Authentication
instance (KnownSymbol realm, HasServer api)
=> HasServer (BasicAuth tag realm usr :> api) where
type ServerT (BasicAuth tag realm usr :> api) m = usr -> ServerT api m
type HasConfig (BasicAuth tag realm usr :> api) c
=> HasServer (BasicAuth realm usr :> api) where
type ServerT (BasicAuth realm usr :> api) m = usr -> ServerT api m
type HasConfig (BasicAuth realm usr :> api) c
= (HasConfigEntry c (BasicAuthCheck usr), HasConfig api c)
route Proxy config subserver = WithRequest $ \ request ->

View file

@ -528,7 +528,7 @@ miscCombinatorSpec = with (return $ serve miscApi EmptyConfig miscServ) $
------------------------------------------------------------------------------
-- * authspec {{{
------------------------------------------------------------------------------
type AuthAPI = BasicAuth "basic" "foo" () :> "basic" :> Get '[JSON] Animal
type AuthAPI = BasicAuth "foo" () :> "basic" :> Get '[JSON] Animal
:<|> AuthProtect "auth" :> "auth" :> Get '[JSON] Animal
authApi :: Proxy AuthAPI
authApi = Proxy

View file

@ -17,7 +17,7 @@ import GHC.TypeLits (Symbol)
-- In Basic Auth, username and password are base64-encoded and transmitted via
-- the @Authorization@ header. Handshakes are not required, making it
-- relatively efficient.
data BasicAuth (tag :: k) (realm :: Symbol) (usr :: *)
data BasicAuth (realm :: Symbol) (usr :: *)
deriving (Typeable)
-- | A generalized Authentication combinator.