opentok-0.0.1: An OpenTok SDK for Haskell

Safe HaskellNone
LanguageHaskell2010

OpenTok.Token

Synopsis

Documentation

data Role Source #

Information on user roles can be found at https://tokbox.com/developer/guides/create-token/

Instances
Show Role Source # 
Instance details

Defined in OpenTok.Token

Methods

showsPrec :: Int -> Role -> ShowS #

show :: Role -> String #

showList :: [Role] -> ShowS #

data TokenOptions Source #

Instances
Show TokenOptions Source # 
Instance details

Defined in OpenTok.Token

Generic TokenOptions Source # 
Instance details

Defined in OpenTok.Token

Associated Types

type Rep TokenOptions :: * -> * #

type Rep TokenOptions Source # 
Instance details

Defined in OpenTok.Token

type Rep TokenOptions = D1 (MetaData "TokenOptions" "OpenTok.Token" "opentok-0.0.1-C3l0wmoQLhV5aSIPMnVfOR" False) (C1 (MetaCons "TokenOptions" PrefixI True) ((S1 (MetaSel (Just "_role") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Role) :*: S1 (MetaSel (Just "_expireTime") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe UTCTime))) :*: (S1 (MetaSel (Just "_connectionData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)) :*: S1 (MetaSel (Just "_initialLayoutClassList") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [String])))))

tokenOpts :: TokenOptions Source #

Default token options

sanitize :: String -> String Source #

Replace invalid base64 chars

validSessionId :: SessionId -> APIKey -> Bool Source #

Extract an API key from a session Id and compare against provided key

validExpireTime :: TokenOptions -> IO Bool Source #

Validate token options

cleanTokenOptions :: [(a, Maybe b)] -> [(a, Maybe b)] Source #

Remove pairs with Nothing values before creating query string

formatToken :: String -> String Source #

Remove new-line characters from the final token

encodeToken :: APIKey -> APISecret -> SessionId -> TokenOptions -> IO Token Source #

Create a SHA1 encoded token

generate :: APIKey -> APISecret -> SessionId -> TokenOptions -> IO (Either OTError Token) Source #

Generate a new token for an OpenTok session using the provided token options