postgrest-ws-0.4.2.0: PostgREST extension to map LISTEN/NOTIFY messages to Websockets

Safe HaskellNone
LanguageHaskell2010

PostgRESTWS.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

validateClaims :: Maybe ByteString -> ByteString -> LByteString -> 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 hashmap.