matebeamter/src/Types/Reader.hs
2019-09-17 21:29:56 +02:00

35 lines
673 B
Haskell

module Types.Reader where
import Network.HTTP.Client (Manager)
import Servant (Handler)
import Servant.Client (ClientEnv)
import Control.Monad.Reader (ReaderT)
import Data.Text.I18n
import Crypto.KDF.PBKDF2
import Crypto.Hash.Algorithms
data ReadState = ReadState
-- { rsManager :: Manager
{ rsL10n :: L10n
, rsBackend :: ClientEnv
, rsHashParams :: HashParams
}
type UserHandler = ReaderT ReadState Handler
data HashParams = HashParams
{ hashIterations :: Int
, hashSaltLength :: Int
, hashOutputLength :: Int
}
recommendedHashParams = HashParams
{ hashIterations = 8000
, hashSaltLength = 23
, hashOutputLength = 512
}