packages feed

servant-auth-server 0.4.1.0 → 0.4.2.0

raw patch · 4 files changed

+16/−7 lines, 4 filesdep ~QuickCheckdep ~basedep ~http-api-dataPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: QuickCheck, base, http-api-data, jose, servant, servant-server

API changes (from Hackage documentation)

- Servant.Auth.Server.Internal: instance (n ~ 'Servant.Auth.Server.Internal.AddSetCookie.S ('Servant.Auth.Server.Internal.AddSetCookie.S 'Servant.Auth.Server.Internal.AddSetCookie.Z), Servant.Server.Internal.HasServer (Servant.Auth.Server.Internal.AddSetCookie.AddSetCookiesApi n api) ctxs, Servant.Auth.Server.Internal.Class.AreAuths auths ctxs v, Servant.Server.Internal.HasServer api ctxs, Servant.Auth.Server.Internal.AddSetCookie.AddSetCookies n (Servant.Server.Internal.ServerT api Servant.Server.Internal.Handler.Handler) (Servant.Server.Internal.ServerT (Servant.Auth.Server.Internal.AddSetCookie.AddSetCookiesApi n api) Servant.Server.Internal.Handler.Handler), Servant.Auth.Server.Internal.JWT.ToJWT v, Servant.Server.Internal.Context.HasContextEntry ctxs Servant.Auth.Server.Internal.ConfigTypes.CookieSettings, Servant.Server.Internal.Context.HasContextEntry ctxs Servant.Auth.Server.Internal.ConfigTypes.JWTSettings) => Servant.Server.Internal.HasServer (Servant.Auth.Auth auths v Servant.API.Sub.:> api) ctxs
- Servant.Auth.Server.Internal.Class: instance (Servant.Auth.Server.Internal.Types.AuthCheck v ~ Servant.Auth.Server.Internal.Class.App (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Class.Unapp (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Types.AuthCheck v)), Servant.Auth.Server.Internal.Class.IsAuth a v, Servant.Auth.Server.Internal.Class.AreAuths as ctxs v, Servant.Auth.Server.Internal.Class.AppCtx ctxs (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Class.Unapp (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Types.AuthCheck v))) => Servant.Auth.Server.Internal.Class.AreAuths (a : as) ctxs v
+ Servant.Auth.Server: type family BasicAuthCfg
+ Servant.Auth.Server.Internal: instance (n Data.Type.Equality.~ 'Servant.Auth.Server.Internal.AddSetCookie.S ('Servant.Auth.Server.Internal.AddSetCookie.S 'Servant.Auth.Server.Internal.AddSetCookie.Z), Servant.Server.Internal.HasServer (Servant.Auth.Server.Internal.AddSetCookie.AddSetCookiesApi n api) ctxs, Servant.Auth.Server.Internal.Class.AreAuths auths ctxs v, Servant.Server.Internal.HasServer api ctxs, Servant.Auth.Server.Internal.AddSetCookie.AddSetCookies n (Servant.Server.Internal.ServerT api Servant.Server.Internal.Handler.Handler) (Servant.Server.Internal.ServerT (Servant.Auth.Server.Internal.AddSetCookie.AddSetCookiesApi n api) Servant.Server.Internal.Handler.Handler), Servant.Auth.Server.Internal.JWT.ToJWT v, Servant.Server.Internal.Context.HasContextEntry ctxs Servant.Auth.Server.Internal.ConfigTypes.CookieSettings, Servant.Server.Internal.Context.HasContextEntry ctxs Servant.Auth.Server.Internal.ConfigTypes.JWTSettings) => Servant.Server.Internal.HasServer (Servant.Auth.Auth auths v Servant.API.Sub.:> api) ctxs
+ Servant.Auth.Server.Internal.AddSetCookie: type family AddSetCookieApi a :: *
+ Servant.Auth.Server.Internal.BasicAuth: type family BasicAuthCfg
+ Servant.Auth.Server.Internal.Class: instance (Servant.Auth.Server.Internal.Types.AuthCheck v Data.Type.Equality.~ Servant.Auth.Server.Internal.Class.App (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Class.Unapp (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Types.AuthCheck v)), Servant.Auth.Server.Internal.Class.IsAuth a v, Servant.Auth.Server.Internal.Class.AreAuths as ctxs v, Servant.Auth.Server.Internal.Class.AppCtx ctxs (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Class.Unapp (Servant.Auth.Server.Internal.Class.AuthArgs a) (Servant.Auth.Server.Internal.Types.AuthCheck v))) => Servant.Auth.Server.Internal.Class.AreAuths (a : as) ctxs v
- Servant.Auth.Server: AuthCheck :: Request -> IO (AuthResult val) -> AuthCheck val
+ Servant.Auth.Server: AuthCheck :: (Request -> IO (AuthResult val)) -> AuthCheck val
- Servant.Auth.Server: CookieSettings :: !IsSecure -> !(Maybe DiffTime) -> !(Maybe UTCTime) -> !(Maybe ByteString) -> !(Maybe ByteString) -> !SameSite -> !ByteString -> !(Maybe XsrfCookieSettings) -> CookieSettings
+ Servant.Auth.Server: CookieSettings :: !IsSecure -> !Maybe DiffTime -> !Maybe UTCTime -> !Maybe ByteString -> !Maybe ByteString -> !SameSite -> !ByteString -> !Maybe XsrfCookieSettings -> CookieSettings
- Servant.Auth.Server: JWTSettings :: JWK -> Maybe Alg -> JWKSet -> StringOrURI -> IsMatch -> JWTSettings
+ Servant.Auth.Server: JWTSettings :: JWK -> Maybe Alg -> JWKSet -> (StringOrURI -> IsMatch) -> JWTSettings
- Servant.Auth.Server: XsrfCookieSettings :: !ByteString -> !(Maybe ByteString) -> !ByteString -> !Bool -> XsrfCookieSettings
+ Servant.Auth.Server: XsrfCookieSettings :: !ByteString -> !Maybe ByteString -> !ByteString -> !Bool -> XsrfCookieSettings
- Servant.Auth.Server: [cookieDomain] :: CookieSettings -> !(Maybe ByteString)
+ Servant.Auth.Server: [cookieDomain] :: CookieSettings -> !Maybe ByteString
- Servant.Auth.Server: [cookieExpires] :: CookieSettings -> !(Maybe UTCTime)
+ Servant.Auth.Server: [cookieExpires] :: CookieSettings -> !Maybe UTCTime
- Servant.Auth.Server: [cookieMaxAge] :: CookieSettings -> !(Maybe DiffTime)
+ Servant.Auth.Server: [cookieMaxAge] :: CookieSettings -> !Maybe DiffTime
- Servant.Auth.Server: [cookiePath] :: CookieSettings -> !(Maybe ByteString)
+ Servant.Auth.Server: [cookiePath] :: CookieSettings -> !Maybe ByteString
- Servant.Auth.Server: [cookieXsrfSetting] :: CookieSettings -> !(Maybe XsrfCookieSettings)
+ Servant.Auth.Server: [cookieXsrfSetting] :: CookieSettings -> !Maybe XsrfCookieSettings
- Servant.Auth.Server: [xsrfCookiePath] :: XsrfCookieSettings -> !(Maybe ByteString)
+ Servant.Auth.Server: [xsrfCookiePath] :: XsrfCookieSettings -> !Maybe ByteString
- Servant.Auth.Server: data Auth (auths :: [*]) val
+ Servant.Auth.Server: data Auth (auths :: [Type]) val
- Servant.Auth.Server.Internal.Class: type family AuthArgs a :: [*];
+ Servant.Auth.Server.Internal.Class: type family App ls res
- Servant.Auth.Server.Internal.ConfigTypes: CookieSettings :: !IsSecure -> !(Maybe DiffTime) -> !(Maybe UTCTime) -> !(Maybe ByteString) -> !(Maybe ByteString) -> !SameSite -> !ByteString -> !(Maybe XsrfCookieSettings) -> CookieSettings
+ Servant.Auth.Server.Internal.ConfigTypes: CookieSettings :: !IsSecure -> !Maybe DiffTime -> !Maybe UTCTime -> !Maybe ByteString -> !Maybe ByteString -> !SameSite -> !ByteString -> !Maybe XsrfCookieSettings -> CookieSettings
- Servant.Auth.Server.Internal.ConfigTypes: JWTSettings :: JWK -> Maybe Alg -> JWKSet -> StringOrURI -> IsMatch -> JWTSettings
+ Servant.Auth.Server.Internal.ConfigTypes: JWTSettings :: JWK -> Maybe Alg -> JWKSet -> (StringOrURI -> IsMatch) -> JWTSettings
- Servant.Auth.Server.Internal.ConfigTypes: XsrfCookieSettings :: !ByteString -> !(Maybe ByteString) -> !ByteString -> !Bool -> XsrfCookieSettings
+ Servant.Auth.Server.Internal.ConfigTypes: XsrfCookieSettings :: !ByteString -> !Maybe ByteString -> !ByteString -> !Bool -> XsrfCookieSettings
- Servant.Auth.Server.Internal.ConfigTypes: [cookieDomain] :: CookieSettings -> !(Maybe ByteString)
+ Servant.Auth.Server.Internal.ConfigTypes: [cookieDomain] :: CookieSettings -> !Maybe ByteString
- Servant.Auth.Server.Internal.ConfigTypes: [cookieExpires] :: CookieSettings -> !(Maybe UTCTime)
+ Servant.Auth.Server.Internal.ConfigTypes: [cookieExpires] :: CookieSettings -> !Maybe UTCTime
- Servant.Auth.Server.Internal.ConfigTypes: [cookieMaxAge] :: CookieSettings -> !(Maybe DiffTime)
+ Servant.Auth.Server.Internal.ConfigTypes: [cookieMaxAge] :: CookieSettings -> !Maybe DiffTime
- Servant.Auth.Server.Internal.ConfigTypes: [cookiePath] :: CookieSettings -> !(Maybe ByteString)
+ Servant.Auth.Server.Internal.ConfigTypes: [cookiePath] :: CookieSettings -> !Maybe ByteString
- Servant.Auth.Server.Internal.ConfigTypes: [cookieXsrfSetting] :: CookieSettings -> !(Maybe XsrfCookieSettings)
+ Servant.Auth.Server.Internal.ConfigTypes: [cookieXsrfSetting] :: CookieSettings -> !Maybe XsrfCookieSettings
- Servant.Auth.Server.Internal.ConfigTypes: [xsrfCookiePath] :: XsrfCookieSettings -> !(Maybe ByteString)
+ Servant.Auth.Server.Internal.ConfigTypes: [xsrfCookiePath] :: XsrfCookieSettings -> !Maybe ByteString
- Servant.Auth.Server.Internal.Types: AuthCheck :: Request -> IO (AuthResult val) -> AuthCheck val
+ Servant.Auth.Server.Internal.Types: AuthCheck :: (Request -> IO (AuthResult val)) -> AuthCheck val

Files

CHANGELOG.md view
@@ -3,9 +3,15 @@ All notable changes to this project will be documented in this file.  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)-and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).+and this project adheres to [PVP Versioning](https://pvp.haskell.org/).  ## [Unreleased]++## [0.4.2.0] - 2018-11-05++### Added+- `Headers hs a` instance for AddSetCookieApi [@domenkozar]+- GHC 8.6.x support [@domenkozar]  ## [0.4.1.0] - 2018-10-05 
servant-auth-server.cabal view
@@ -1,5 +1,5 @@ name:           servant-auth-server-version:        0.4.1.0+version:        0.4.2.0 synopsis:       servant-server/servant-auth compatibility description:    This package provides the required instances for using the @Auth@ combinator                 in your 'servant' server.@@ -15,7 +15,7 @@ copyright:      (c) Julian K. Arni license:        BSD3 license-file:   LICENSE-tested-with:    GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3+tested-with:    GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1 build-type:     Simple cabal-version:  >= 1.10 extra-source-files:@@ -31,7 +31,7 @@   default-extensions: AutoDeriveTypeable ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators   ghc-options: -Wall   build-depends:-      base                    >= 4.8  && < 4.12+      base                    >= 4.8  && < 4.13     , aeson                   >= 0.11 && < 2     , base64-bytestring       >= 1    && < 2     , blaze-builder           >= 0.4  && < 0.5@@ -122,7 +122,7 @@   build-depends:       servant-auth-server     , hspec > 2 && < 3-    , QuickCheck >= 2.8 && < 2.12+    , QuickCheck >= 2.8 && < 2.13     , http-client >= 0.4 && < 0.6     , lens-aeson     , warp
src/Servant/Auth/Server/Internal/AddSetCookie.hs view
@@ -36,6 +36,7 @@ type instance AddSetCookieApi (Verb method stat ctyps a)   = Verb method stat ctyps (AddSetCookieApiVerb a) type instance AddSetCookieApi Raw = Raw+type instance AddSetCookieApi (Headers hs a) = AddSetCookieApiVerb (Headers hs a)  data SetCookieList (n :: Nat) :: * where   SetCookieNil :: SetCookieList 'Z
test/Servant/Auth/ServerSpec.hs view
@@ -475,8 +475,10 @@     getLogin :: User -> Handler (Headers '[ Header "Set-Cookie" SetCookie                                           , Header "Set-Cookie" SetCookie ] NoContent)     getLogin user = do-        Just applyCookies <- liftIO $ acceptLogin ccfg jwtCfg user-        return $ applyCookies NoContent+        maybeApplyCookies <- liftIO $ acceptLogin ccfg jwtCfg user+        case maybeApplyCookies of+          Just applyCookies -> return $ applyCookies NoContent+          Nothing -> error "cookies failed to apply"      getLogout :: Handler (Headers '[ Header "Set-Cookie" SetCookie                                    , Header "Set-Cookie" SetCookie ] NoContent)