summaryrefslogtreecommitdiff
path: root/overlays/spm/server/Spm/Server/Ctx.hs
blob: 7b84e3d58a3e5e1c729d3454cc4a83847acae50a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{-# LANGUAGE TemplateHaskell #-}

module Spm.Server.Ctx
  ( ServerCtx(..)
  , sctxSqlPool, sctxInstanceId, sctxJwkSet
  ) where

import Data.UUID (UUID)
import Crypto.JOSE.JWK (JWKSet)
import Database.Persist.Postgresql
import Data.Pool
import Control.Lens.TH

import Type.Reflection (Typeable)
import GHC.Generics (Generic)


data ServerCtx = ServerCtx
  { _sctxSqlPool :: Pool SqlBackend
  , _sctxInstanceId :: UUID
  , _sctxJwkSet :: JWKSet
  } deriving (Generic, Typeable)
makeLenses ''ServerCtx