Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides the JWT claims validation. Since websockets and listening connections in the database tend to be resource intensive (not to mention stateful) we need claims authorizing a specific channel and mode of operation.
Synopsis
- type ConnectionInfo = ([Text], Text, Claims)
- validateClaims :: Maybe Text -> ByteString -> LByteString -> UTCTime -> IO (Either Text ConnectionInfo)
Documentation
type ConnectionInfo = ([Text], Text, Claims) Source #
validateClaims :: Maybe Text -> ByteString -> LByteString -> UTCTime -> IO (Either Text ConnectionInfo) Source #
Given a secret, a token and a timestamp it validates the claims and returns either an error message or a triple containing channel, mode and claims KeyMap.