summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaelXavier <>2018-01-12 22:48:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-01-12 22:48:00 (GMT)
commit261a60017f0d1ba4cf8ce4fcd901d211bfdb54be (patch)
treed9203be156cb054aececac911c7b92579dd4f937
parentbec9f6d3f5f9d0bf0db5d1ae3f48a595cad78cc7 (diff)
version 0.5.1HEAD0.5.1master
-rw-r--r--CHANGELOG.md3
-rw-r--r--snaplet-persistent.cabal31
-rw-r--r--src/Snap/Snaplet/Auth/Backends/Persistent.hs6
3 files changed, 26 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ea4be1..664cb19 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+# 0.5.1
+* Allow for newer dependencies.
+
# 0.5
* Upgrade to persistent 2
diff --git a/snaplet-persistent.cabal b/snaplet-persistent.cabal
index 66a05c8..a2fef8d 100644
--- a/snaplet-persistent.cabal
+++ b/snaplet-persistent.cabal
@@ -1,5 +1,5 @@
name: snaplet-persistent
-version: 0.5
+version: 0.5.1
synopsis: persistent snaplet for the Snap Framework
description: Snaplet support for using the Postgresql database
with a Snap Framework application via the persistent
@@ -25,6 +25,10 @@ source-repository head
type: git
location: https://github.com/soostone/snaplet-persistent.git
+flag lib-Werror
+ default: False
+ manual: True
+
Library
hs-source-dirs: src
@@ -41,25 +45,28 @@ Library
bytestring >= 0.9.1 && < 0.11,
clientsession >= 0.7.2 && < 0.10,
configurator >= 0.2 && < 0.4,
- heist >= 0.14 && < 0.15,
- lens >= 3.7.6 && < 4.7,
- errors >= 1.4 && < 1.5,
- MonadCatchIO-transformers >= 0.3 && < 0.4,
+ heist >= 0.14 && < 1.1,
+ lens >= 3.7.6 && < 5,
+ errors >= 1.4 && < 2.3,
monad-logger >= 0.2.4 && < 0.4,
mtl >= 2 && < 3,
- persistent >= 2.0 && < 2.2,
- persistent-postgresql >= 2.0 && < 2.2,
- persistent-template >= 2.0 && < 2.2,
+ persistent >= 2.0 && < 2.8,
+ persistent-postgresql >= 2.0 && < 2.7,
+ persistent-template >= 2.0 && < 2.6,
readable >= 0.1 && < 0.4,
resource-pool >= 0.2 && < 0.3,
resourcet >= 0.4 && < 1.2,
safe >= 0.3 && < 0.4,
- snap >= 0.13 && < 0.14,
+ snap >= 0.13 && < 1.1,
text >= 0.11 && < 1.3,
- time >= 1.1 && < 1.6,
- transformers >= 0.2 && < 0.5,
- unordered-containers >= 0.2 && < 0.3
+ time >= 1.1 && < 1.7,
+ transformers >= 0.2 && < 0.6,
+ unordered-containers >= 0.2 && < 0.3,
+ map-syntax
ghc-options: -Wall -fwarn-tabs -funbox-strict-fields
-fno-warn-orphans -fno-warn-unused-do-bind
+
+ if flag(lib-Werror)
+ ghc-options: -Werror \ No newline at end of file
diff --git a/src/Snap/Snaplet/Auth/Backends/Persistent.hs b/src/Snap/Snaplet/Auth/Backends/Persistent.hs
index a36976c..aace932 100644
--- a/src/Snap/Snaplet/Auth/Backends/Persistent.hs
+++ b/src/Snap/Snaplet/Auth/Backends/Persistent.hs
@@ -30,6 +30,7 @@ module Snap.Snaplet.Auth.Backends.Persistent
import Control.Monad
import Control.Monad.Trans
import qualified Data.HashMap.Strict as HM
+import qualified Data.Map.Syntax as MS
import Data.Maybe
import Data.Text (Text)
import qualified Data.Text as T
@@ -107,7 +108,7 @@ db2au (Entity k SnapAuthUser{..}) = AuthUser
-- 'AuthUser'.
dbUserSplices :: Monad n
=> Splices (RuntimeSplice n (Entity SnapAuthUser) -> Splice n)
-dbUserSplices = mapV (deferMap (return . db2au)) userCSplices
+dbUserSplices = MS.mapV (deferMap (return . db2au)) userCSplices
data PersistAuthManager = PAM {
@@ -156,6 +157,7 @@ initHelper aus l pool = liftIO $ do
, activeUser = Nothing
, minPasswdLen = asMinPasswdLen aus
, rememberCookieName = asRememberCookieName aus
+ , rememberCookieDomain = Nothing
, rememberPeriod = asRememberPeriod aus
, siteKey = key
, lockout = asLockout aus
@@ -171,7 +173,7 @@ readT = readNote "Can't read text" . T.unpack
-- | Get the db key from an 'AuthUser'
userDBKey :: AuthUser -> Maybe SnapAuthUserId
userDBKey au = case userId au of
- Nothing -> Nothing
+ Nothing -> Nothing
Just (UserId k) -> Just . mkKey $ (readT k :: Int)