| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
Polysemy.Account.Api.Interpreter.Jwt
Contents
Description
Interpreters for Jwt
Synopsis
- interpretGenJwk :: Member (Embed IO) r => InterpreterFor GenJwk r
 - interpretJwtState :: Members [GenJwk, AtomicState (Maybe JWK), Error Text, Embed IO] r => ToJWT a => InterpreterFor (Jwt a) r
 - interpretJwt :: forall a r. Members [Error Text, Embed IO] r => ToJWT a => InterpreterFor (Jwt a) r
 - interpretJwtPersistent :: forall a e r. Members [AtomicState JWK !! e, Error Text, Embed IO] r => ToJWT a => InterpreterFor (Jwt a !! e) r
 - interpretJwtDb :: forall a r. Members [Database !! DbError, Error InitDbError, Error Text, Log, Mask, Resource, Race, Embed IO] r => ToJWT a => InterpreterFor (Jwt a !! DbError) r
 
Documentation
interpretGenJwk :: Member (Embed IO) r => InterpreterFor GenJwk r Source #
interpretJwtState :: Members [GenJwk, AtomicState (Maybe JWK), Error Text, Embed IO] r => ToJWT a => InterpreterFor (Jwt a) r Source #
Interpret Jwt by storing the key in AtomicState, generating it on the fly if absent.
Generates Ed25519 keys.
Errors originating from the token generator are critical.
interpretJwt :: forall a r. Members [Error Text, Embed IO] r => ToJWT a => InterpreterFor (Jwt a) r Source #
Interpret Jwt by storing the key in AtomicState in memory.
interpretJwtPersistent :: forall a e r. Members [AtomicState JWK !! e, Error Text, Embed IO] r => ToJWT a => InterpreterFor (Jwt a !! e) r Source #
Interpret Jwt by storing the key in AtomicState, requiring the key to be present from the start.
 This is intended to be used with a database backing the AtomicState, the key being generated when starting the app.
Generates Ed25519 keys.
Errors originating from the token generator are critical.
interpretJwtDb :: forall a r. Members [Database !! DbError, Error InitDbError, Error Text, Log, Mask, Resource, Race, Embed IO] r => ToJWT a => InterpreterFor (Jwt a !! DbError) r Source #
Interpret Jwt using interpretJwtPersistent and interpret AtomicState as a PostgreSQL table using
 polysemy-hasql, generating the JWK when it is not found in the database.