Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Role
- data TokenOptions = TokenOptions {}
- tokenOpts :: TokenOptions
- sanitize :: String -> String
- validSessionId :: SessionId -> APIKey -> Bool
- validExpireTime :: TokenOptions -> IO Bool
- cleanTokenOptions :: [(a, Maybe b)] -> [(a, Maybe b)]
- formatToken :: String -> String
- encodeToken :: APIKey -> APISecret -> SessionId -> TokenOptions -> IO Token
- generate :: APIKey -> APISecret -> SessionId -> TokenOptions -> IO (Either OTError Token)
Documentation
Information on user roles can be found at https://tokbox.com/developer/guides/create-token/
data TokenOptions Source #
TokenOptions | |
|
Instances
tokenOpts :: TokenOptions Source #
Default token options
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