Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Session
- data SessionConfig = SessionConfig {
- sessionKeySource :: KeySource
- sessionMaxAge :: DiffTime
- sessionPath :: Maybe ByteString
- sessionDomain :: Maybe ByteString
- sessionHttpOnly :: Bool
- sessionSecure :: Bool
- sessionTimeoutAction :: forall exts prms m. MonadIO m => ActionT exts prms m ()
- angularXsrfCookieName :: Maybe ByteString
- csrfTokenCookieName :: ByteString
- csrfTokenCheckingName :: Either HeaderName ByteString
- csrfTokenLength :: Int
- data KeySource
- embedKeyConfig :: FilePath -> ExpQ
- embedDefaultKeyConfig :: ExpQ
- initSession :: MonadIO m => SessionConfig -> Initializer' m Session
- getSessionConfig :: (Has Session exts, Monad m) => ActionT exts prms m SessionConfig
- setSession :: (Has Session exts, MonadIO m) => ByteString -> ByteString -> ActionT exts prms m ()
- csrfToken :: (Has Session exts, MonadIO m) => ActionT exts prms m ByteString
- setSessionWith :: (Has Session exts, MonadIO m) => SessionConfig -> ByteString -> ByteString -> ActionT exts prms m ()
- session :: (MonadIO actM, Strategy w, Has Session exts, KnownSymbol k, NotMember k prms, Query a) => proxy k -> w a -> ApiaryT exts (SNext w k a prms) actM m () -> ApiaryT exts prms actM m ()
- checkToken :: (MonadIO actM, Has Session exts) => ApiaryT exts prms actM m () -> ApiaryT exts prms actM m ()
- module Web.Apiary.Cookie
Documentation
config
data SessionConfig Source
SessionConfig | |
|
embedKeyConfig :: FilePath -> ExpQ Source
generate and embed key at compile time. since 0.13.2.
This function embed as SessionsessionConfig with default sessionConfig. so you can sessionConfigure it. but DON'T sessionConfigure sessionKey.
this function is convenient when create heroku project.
embedsessionConfig = $embedDefaultKeysessionConfig { csrfTokenCookieName = "foo" }
initializer
initSession :: MonadIO m => SessionConfig -> Initializer' m Session Source
getter
getSessionConfig :: (Has Session exts, Monad m) => ActionT exts prms m SessionConfig Source
setter
setSession :: (Has Session exts, MonadIO m) => ByteString -> ByteString -> ActionT exts prms m () Source
csrfToken :: (Has Session exts, MonadIO m) => ActionT exts prms m ByteString Source
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.
with sessionConfig
setSessionWith :: (Has Session exts, MonadIO m) => SessionConfig -> ByteString -> ByteString -> ActionT exts prms m () Source
filter
session :: (MonadIO actM, Strategy w, Has Session exts, KnownSymbol k, NotMember k prms, Query a) => proxy k -> w a -> ApiaryT exts (SNext w k a prms) actM m () -> ApiaryT exts prms actM m () Source
checkToken :: (MonadIO actM, Has Session exts) => ApiaryT exts prms actM m () -> ApiaryT exts prms actM m () Source
Reexport
deleteCookie
module Web.Apiary.Cookie