tls-session-manager
Safe HaskellNone
LanguageHaskell2010

Network.TLS.SessionManager.Internal

Description

The implementation of Network.TLS.SessionManager, exposed for testing. This module may change without notice.

Synopsis

Documentation

data Config Source #

Configuration for session managers.

Constructors

Config 

Fields

  • ticketLifetime :: Int

    Ticket lifetime in seconds. It should match serverTicketLifetime on a server. A TLS 1.3 session is kept no longer than the lifetime of its ticket.

  • pruningDelay :: Int

    Pruning delay in seconds. This is set to reaperDelay.

  • dbMaxSize :: Int

    The limit size of session data entries.

defaultConfig :: Config Source #

ticketLifetime: 2 hours (7200 seconds), pruningDelay: 10 minutes (600 seconds), dbMaxSize: 1000 entries.

toKey :: ByteString -> SessionIDCopy Source #

toValue :: SessionData -> SessionDataCopy Source #

fromValue :: SessionDataCopy -> SessionData Source #

type SessionIDCopy = ShortByteString Source #

newtype SessionDataCopy Source #

Constructors

SessionDataCopy SessionData 

Instances

Instances details
Show SessionDataCopy Source # 
Instance details

Defined in Network.TLS.SessionManager.Internal

Methods

showsPrec :: Int -> SessionDataCopy -> ShowS

show :: SessionDataCopy -> String

showList :: [SessionDataCopy] -> ShowS

Eq SessionDataCopy Source # 
Instance details

Defined in Network.TLS.SessionManager.Internal

type Sec = Int64 Source #

data DB Source #

The sessions, and the keys deleted since the reaper last took them away to prune. While it prunes, the workload left in their place is empty, so a deletion there is kept to be applied to the pruned sessions too.

Constructors

DB Sessions [SessionIDCopy] 

data Use Source #

Constructors

SingleUse 
MultipleUse 

data Availability Source #

Constructors

Fresh 
Used 

newSessionManager :: Config -> IO SessionManager Source #

Creating an in-memory session manager.

cons :: Int -> Item -> DB -> DB Source #

clean :: Int -> DB -> IO (DB -> DB) Source #

establish :: Reaper DB Item -> Sec -> SessionID -> SessionData -> IO () Source #

resume :: Reaper DB Item -> Use -> SessionID -> IO (Maybe SessionData) Source #

invalidate :: Reaper DB Item -> SessionID -> IO () Source #