postgres-websockets-0.11.2.2: Middleware to map LISTEN/NOTIFY messages to Websockets
Safe HaskellSafe-Inferred
LanguageHaskell2010

PostgresWebsockets.Claims

Description

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

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.