servant-auth-token-acid 0.4.1.0 → 0.4.1.1
raw patch · 3 files changed
+20/−2 lines, 3 filesdep ~servant-server
Dependency ranges changed: servant-server
Files
CHANGELOG.md view
@@ -1,3 +1,8 @@+0.4.1.1+=======++* Relax `servant` and `servant-server` versions.+ 0.4.1.0 =======
servant-auth-token-acid.cabal view
@@ -1,5 +1,5 @@ name: servant-auth-token-acid-version: 0.4.1.0+version: 0.4.1.1 synopsis: Acid-state backend for servant-auth-token server description: Please see README.md homepage: https://github.com/ncrashed/servant-auth-token#readme@@ -33,7 +33,7 @@ , safecopy >= 0.9 && < 0.10 , servant-auth-token >= 0.4 && < 0.5 , servant-auth-token-api >= 0.4 && < 0.5- , servant-server >= 0.9 && < 0.10+ , servant-server >= 0.9 && < 0.12 , template-haskell >= 2.11 && < 2.12 , text >= 1.2 && < 1.3 , time >= 1.5 && < 1.7@@ -56,10 +56,12 @@ QuasiQuotes RecordWildCards ScopedTypeVariables+ StandaloneDeriving TemplateHaskell TupleSections TypeFamilies TypeOperators+ UndecidableInstances source-repository head type: git
src/Servant/Server/Auth/Token/Acid.hs view
@@ -4,8 +4,10 @@ , deriveAcidHasStorage ) where +import Control.Monad.Base import Control.Monad.Except import Control.Monad.Reader+import Control.Monad.Trans.Control import Data.Acid import Data.Acid.Core import Language.Haskell.TH@@ -17,8 +19,17 @@ newtype AcidBackendT st m a = AcidBackendT { unAcidBackendT :: ReaderT (AuthConfig, AcidState st) (ExceptT ServantErr m) a } deriving (Functor, Applicative, Monad, MonadIO, MonadError ServantErr, MonadReader (AuthConfig, AcidState st)) +deriving instance MonadBase IO m => MonadBase IO (AcidBackendT st m)+ instance Monad m => HasAuthConfig (AcidBackendT st m) where getAuthConfig = fmap fst $ AcidBackendT ask++newtype StMAcidBackendT st m a = StMAcidBackendT { unStMAcidBackendT :: StM (ReaderT (AuthConfig, AcidState st) (ExceptT ServantErr m)) a }++instance MonadBaseControl IO m => MonadBaseControl IO (AcidBackendT st m) where+ type StM (AcidBackendT st m) a = StMAcidBackendT st m a+ liftBaseWith f = AcidBackendT $ liftBaseWith $ \q -> f (fmap StMAcidBackendT . q . unAcidBackendT)+ restoreM = AcidBackendT . restoreM . unStMAcidBackendT -- | Execute backend action with given connection pool. runAcidBackendT :: AuthConfig -> AcidState st -> AcidBackendT st m a -> m (Either ServantErr a)