packages feed

Spock 0.6.1.3 → 0.6.2.0

raw patch · 4 files changed

+16/−2 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Web.Spock: clearAllSessions :: SpockAction conn sess st ()

Files

Spock.cabal view
@@ -1,5 +1,5 @@ name:                Spock-version:             0.6.1.3+version:             0.6.2.0 synopsis:            Another Haskell web framework for rapid development description:         This toolbox provides everything you need to get a quick start into web hacking with haskell: routing, middleware, json, blaze, sessions, cookies, database helper, csrf-protection, global state Homepage:            https://github.com/agrafix/Spock
src/Web/Spock.hs view
@@ -25,7 +25,7 @@     , HasSpock (runQuery, getState)       -- * Sessions     , SessionCfg (..)-    , readSession, writeSession, modifySession+    , readSession, writeSession, modifySession, clearAllSessions       -- * Safe actions     , SafeAction (..)     , safeActionPath@@ -98,3 +98,10 @@ readSession =     do mgr <- getSessMgr        sm_readSession mgr++-- | Globally delete all existing sessions. This is useful for example if you want+-- to require all users to relogin+clearAllSessions :: SpockAction conn sess st ()+clearAllSessions =+    do mgr <- getSessMgr+       sm_clearAllSessions mgr
src/Web/Spock/SessionManager.hs view
@@ -37,6 +37,7 @@                   { sm_readSession = readSessionImpl vaultKey cacheHM                   , sm_writeSession = writeSessionImpl vaultKey cacheHM                   , sm_modifySession = modifySessionImpl vaultKey cacheHM+                  , sm_clearAllSessions = clearAllSessionsImpl cacheHM                   , sm_middleware = sessionMiddleware cfg vaultKey cacheHM                   , sm_addSafeAction = addSafeActionImpl vaultKey cacheHM                   , sm_lookupSafeAction = lookupSafeActionImpl vaultKey cacheHM@@ -217,6 +218,11 @@ deleteSessionImpl sessionRef sid =     do atomically $ modifyTVar' sessionRef (\hm -> HM.delete sid hm)        return ()++clearAllSessionsImpl :: UserSessions conn sess st+                     -> SpockAction conn sess st ()+clearAllSessionsImpl sessionRef =+    liftIO $ atomically $ modifyTVar' sessionRef (const HM.empty)  housekeepSessions :: UserSessions conn sess st -> IO () housekeepSessions sessionRef =
src/Web/Spock/Types.hs view
@@ -140,6 +140,7 @@    { sm_readSession :: SpockAction conn sess st sess    , sm_writeSession :: sess -> SpockAction conn sess st ()    , sm_modifySession :: (sess -> sess) -> SpockAction conn sess st ()+   , sm_clearAllSessions :: SpockAction conn sess st ()    , sm_middleware :: Middleware    , sm_addSafeAction :: PackedSafeAction conn sess st -> SpockAction conn sess st SafeActionHash    , sm_lookupSafeAction :: SafeActionHash -> SpockAction conn sess st (Maybe (PackedSafeAction conn sess st))