Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- data PasswordConfig = PasswordConfig {
- _resetLink :: Text
- _domain :: Text
- _passwordAcceptable :: Text -> Maybe Text
- resetLink :: Lens' PasswordConfig Text
- passwordAcceptable :: Lens' PasswordConfig (Text -> Maybe Text)
- domain :: Lens' PasswordConfig Text
- data PasswordError
- newtype HashedPass = HashedPass {}
- unHashedPass :: Iso' HashedPass ByteString
- mkHashedPass :: (Functor m, MonadIO m) => Text -> m HashedPass
- verifyHashedPass :: Text -> HashedPass -> Bool
- data PasswordState = PasswordState {}
- passwords :: Iso' PasswordState (Map UserId HashedPass)
- initialPasswordState :: PasswordState
- setPassword :: UserId -> HashedPass -> Update PasswordState ()
- deletePassword :: UserId -> Update PasswordState ()
- verifyPasswordForUserId :: UserId -> Text -> Query PasswordState Bool
- data SetPassword = SetPassword UserId HashedPass
- newtype DeletePassword = DeletePassword UserId
- data VerifyPasswordForUserId = VerifyPasswordForUserId UserId Text
- verifyPassword :: MonadIO m => AcidState AuthenticateState -> AcidState PasswordState -> Username -> Text -> m Bool
- data UserPass = UserPass {}
- user :: Lens' UserPass Username
- password :: Lens' UserPass Text
- token :: Happstack m => AcidState AuthenticateState -> AuthenticateConfig -> AcidState PasswordState -> m Response
- data NewAccountData = NewAccountData {
- _naUser :: User
- _naPassword :: Text
- _naPasswordConfirm :: Text
- naUser :: Lens' NewAccountData User
- naPasswordConfirm :: Lens' NewAccountData Text
- naPassword :: Lens' NewAccountData Text
- data ChangePasswordData = ChangePasswordData {}
- cpOldPassword :: Lens' ChangePasswordData Text
- cpNewPasswordConfirm :: Lens' ChangePasswordData Text
- cpNewPassword :: Lens' ChangePasswordData Text
- account :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> AuthenticateConfig -> PasswordConfig -> Maybe (UserId, AccountURL) -> m (Either PasswordError UserId)
- data RequestResetPasswordData = RequestResetPasswordData {}
- rrpUsername :: Iso' RequestResetPasswordData Username
- passwordRequestReset :: Happstack m => AuthenticateConfig -> PasswordConfig -> AcidState AuthenticateState -> AcidState PasswordState -> m (Either PasswordError Text)
- issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m (Either PasswordError Text)
- sendResetEmail :: MonadIO m => Maybe FilePath -> Email -> SimpleAddress -> Maybe SimpleAddress -> Text -> m ()
- data ResetPasswordData = ResetPasswordData {}
- rpResetToken :: Lens' ResetPasswordData Text
- rpPasswordConfirm :: Lens' ResetPasswordData Text
- rpPassword :: Lens' ResetPasswordData Text
- passwordReset :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> PasswordConfig -> m (Either PasswordError Text)
- decodeAndVerifyResetToken :: MonadIO m => AcidState AuthenticateState -> Text -> m (Maybe (User, JWT VerifiedJWT))
Documentation
data PasswordConfig Source #
PasswordConfig | |
|
Instances
Generic PasswordConfig Source # | |
Defined in Happstack.Authenticate.Password.Core type Rep PasswordConfig :: Type -> Type # from :: PasswordConfig -> Rep PasswordConfig x # to :: Rep PasswordConfig x -> PasswordConfig # | |
type Rep PasswordConfig Source # | |
Defined in Happstack.Authenticate.Password.Core type Rep PasswordConfig = D1 (MetaData "PasswordConfig" "Happstack.Authenticate.Password.Core" "happstack-authenticate-2.4.0.3-EWiQK3JTFpjLhW6KbXCBsH" False) (C1 (MetaCons "PasswordConfig" PrefixI True) (S1 (MetaSel (Just "_resetLink") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: (S1 (MetaSel (Just "_domain") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "_passwordAcceptable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Text -> Maybe Text))))) |
passwordAcceptable :: Lens' PasswordConfig (Text -> Maybe Text) Source #
data PasswordError Source #
NotAuthenticated | |
NotAuthorized | |
InvalidUsername | |
InvalidPassword | |
InvalidUsernamePassword | |
NoEmailAddress | |
MissingResetToken | |
InvalidResetToken | |
PasswordMismatch | |
UnacceptablePassword | |
CoreError | |
Instances
newtype HashedPass Source #
Instances
:: (Functor m, MonadIO m) | |
=> Text | password in plain text |
-> m HashedPass | salted and hashed |
hash a password string
:: Text | password in plain text |
-> HashedPass | hashed version of password |
-> Bool |
verify a password
data PasswordState Source #
Instances
:: UserId | UserId |
-> HashedPass | the hashed password |
-> Update PasswordState () |
set the password for UserId
verifyPasswordForUserId Source #
:: UserId | UserId |
-> Text | plain-text password |
-> Query PasswordState Bool |
verify that the supplied password matches the stored hashed password for UserId
data SetPassword Source #
Instances
SafeCopy SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
UpdateEvent SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
Method SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core type MethodResult SetPassword :: Type # type MethodState SetPassword :: Type # methodTag :: SetPassword -> Tag # | |
type MethodState SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
type MethodResult SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core |
newtype DeletePassword Source #
Instances
SafeCopy DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
UpdateEvent DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
Method DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core type MethodResult DeletePassword :: Type # type MethodState DeletePassword :: Type # methodTag :: DeletePassword -> Tag # | |
type MethodState DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
type MethodResult DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core |
data VerifyPasswordForUserId Source #
Instances
SafeCopy VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core | |
QueryEvent VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core | |
Method VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core type MethodResult VerifyPasswordForUserId :: Type # type MethodState VerifyPasswordForUserId :: Type # methodTag :: VerifyPasswordForUserId -> Tag # | |
type MethodState VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core | |
type MethodResult VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core |
verifyPassword :: MonadIO m => AcidState AuthenticateState -> AcidState PasswordState -> Username -> Text -> m Bool Source #
verify that the supplied username/password is valid
Instances
token :: Happstack m => AcidState AuthenticateState -> AuthenticateConfig -> AcidState PasswordState -> m Response Source #
data NewAccountData Source #
JSON record for new account data
Instances
data ChangePasswordData Source #
JSON record for change password data
Instances
account :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> AuthenticateConfig -> PasswordConfig -> Maybe (UserId, AccountURL) -> m (Either PasswordError UserId) Source #
account handler
data RequestResetPasswordData Source #
JSON record for new account data
Instances
passwordRequestReset :: Happstack m => AuthenticateConfig -> PasswordConfig -> AcidState AuthenticateState -> AcidState PasswordState -> m (Either PasswordError Text) Source #
request reset password
issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m (Either PasswordError Text) Source #
issueResetToken
sendResetEmail :: MonadIO m => Maybe FilePath -> Email -> SimpleAddress -> Maybe SimpleAddress -> Text -> m () Source #
data ResetPasswordData Source #
JSON record for new account data
Instances
passwordReset :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> PasswordConfig -> m (Either PasswordError Text) Source #
decodeAndVerifyResetToken :: MonadIO m => AcidState AuthenticateState -> Text -> m (Maybe (User, JWT VerifiedJWT)) Source #