happstack-helpers-0.51: Convenience functions for Happstack.Source codeContentsIndex
Happstack.Data.User.Password
Description
Synopsis
newtype Salt = Salt String
newtype PasswordHash = PasswordHash [Word8]
data Password = Password Salt PasswordHash
dataType[ahdu] :: DataType
constr[ahdv] :: Constr
dataType[ahdk] :: DataType
constr[ahdl] :: Constr
dataType[ahd9] :: DataType
constr[ahda] :: Constr
checkPassword :: Password -> String -> Bool
doHash :: Salt -> String -> PasswordHash
changepass :: Monad m => String -> String -> Password -> m Password
genSalt :: MonadIO m => m Salt
newPassword :: MonadIO m => String -> m Password
Documentation
newtype Salt Source
Constructors
Salt String
show/hide Instances
newtype PasswordHash Source
Constructors
PasswordHash [Word8]
show/hide Instances
data Password Source
Constructors
Password Salt PasswordHash
show/hide Instances
dataType[ahdu] :: DataTypeSource
constr[ahdv] :: ConstrSource
dataType[ahdk] :: DataTypeSource
constr[ahdl] :: ConstrSource
dataType[ahd9] :: DataTypeSource
constr[ahda] :: ConstrSource
checkPasswordSource
:: Passwordstored salt and password hash
-> Stringpassword to test (unhashed)
-> Booldid it match
check if the submitted password matches the stored password
doHash :: Salt -> String -> PasswordHashSource
hash a password using the supplied salt Originally implemented using SHA1. By switching to pbkdf2, we don't rely on implementation of randomIO being cryptographically secure.
changepass :: Monad m => String -> String -> Password -> m PasswordSource
genSalt :: MonadIO m => m SaltSource
generate some random salt returns 4 Char of salt.
newPassword :: MonadIO m => String -> m PasswordSource
generate a new salted/hashed Password from the given input string
Produced by Haddock version 2.6.1