postgrest- REST API for any Postgres database

Safe HaskellNone



This module provides functions to deal with the JWT authorization ( It also can be used to define other authorization functions, in the future Oauth, LDAP and similar integrations can be coded here.

Authentication should always be implemented in an external service. In the test suite there is an example of simple login function that can be used for a very simple authentication system inside the PostgreSQL database.



containsRole :: JWTAttempt -> Bool Source #

Whether a response from jwtClaims contains a role claim

jwtClaims :: Maybe JWK -> Maybe StringOrURI -> LByteString -> UTCTime -> Maybe JSPath -> IO JWTAttempt Source #

Receives the JWT secret and audience (from config) and a JWT and returns a map of JWT claims.

data JWTAttempt Source #

Possible situations encountered with client JWTs