1
0
mirror of https://github.com/hasura/graphql-engine.git synced 2024-12-22 23:11:41 +03:00
graphql-engine/server/src-lib/Hasura/CredentialCache.hs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
596 B
Haskell
Raw Normal View History

{-# LANGUAGE NumericUnderscores #-}
-- | Interface for a service for maintaining short-lived credentials, such as
-- access tokens or JWTs.
module Hasura.CredentialCache
( CredentialCache (..),
)
where
import Control.Concurrent.STM
import Hasura.Prelude
newtype CredentialCache cred = CredentialCache
{ -- | Get the stored credential. Also returns an STM action for
-- requesting a refresh of the credential, which, in turn, returns an STM
-- action for waiting on the arrival of the fresh credential.
getCredential :: STM (cred, STM (STM ()))
}
deriving stock (Functor)