Safe Haskell | None |
---|
- type HasSession = Given Session
- data SessionConfig = SessionConfig {
- sessionKeyFile :: FilePath
- sessionMaxAge :: DiffTime
- sessionPath :: Maybe ByteString
- sessionDomain :: Maybe ByteString
- sessionHttpOnly :: Bool
- sessionSecure :: Bool
- angularXsrfCookieName :: Maybe ByteString
- csrfTokenCookieName :: ByteString
- csrfTokenCheckingName :: Either HeaderName ByteString
- csrfTokenLength :: Int
- withSession :: MonadIO m => SessionConfig -> (HasSession => m b) -> m b
- setSession :: (MonadIO m, HasSession) => ByteString -> ByteString -> ActionT m ()
- csrfToken :: (MonadIO m, HasSession) => ActionT m ByteString
- session :: (Functor n, MonadIO n, Strategy w, Query a, HasSession) => ByteString -> Proxy (w a) -> ApiaryT (SNext w as a) n m b -> ApiaryT as n m b
- checkToken :: (Functor n, MonadIO n, HasSession) => ApiaryT c n m a -> ApiaryT c n m a
- module Data.Default.Class
- module Web.Apiary.Cookie
Documentation
type HasSession = Given SessionSource
data SessionConfig Source
withSession :: MonadIO m => SessionConfig -> (HasSession => m b) -> m bSource
setter
setSession :: (MonadIO m, HasSession) => ByteString -> ByteString -> ActionT m ()Source
csrfToken :: (MonadIO m, HasSession) => ActionT m ByteStringSource
create crypto random (generate random by AES CTR(cprng-aes package) and encode by base64),
set it client session cookie, set XSRF-TOKEN header(when Just angularXsrfCookieName),
and return value. since 0.9.0.0.
filter
session :: (Functor n, MonadIO n, Strategy w, Query a, HasSession) => ByteString -> Proxy (w a) -> ApiaryT (SNext w as a) n m b -> ApiaryT as n m bSource
checkToken :: (Functor n, MonadIO n, HasSession) => ApiaryT c n m a -> ApiaryT c n m aSource
check csrf token. since 0.9.0.0.
Reexport
module Data.Default.Class
deleteCookie
module Web.Apiary.Cookie