Safe Haskell | None |
---|---|
Language | Haskell2010 |
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)
- resetTokenForUserId :: Text -> AcidState AuthenticateState -> AcidState PasswordState -> UserId -> IO (Either PasswordError Text)
- resetTokenLink :: Text -> Text -> Text
- issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m 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.5.1-BzWELMPZnYYGo9CPtJoxJ3" '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 MethodState SetPassword # 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 MethodState DeletePassword # 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
verifyPassword :: MonadIO m => AcidState AuthenticateState -> AcidState PasswordState -> Username -> Text -> m Bool Source #
verify that the supplied username/password is valid
Instances
Eq UserPass Source # | |
Data UserPass Source # | |
Defined in Happstack.Authenticate.Password.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UserPass -> c UserPass # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UserPass # toConstr :: UserPass -> Constr # dataTypeOf :: UserPass -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UserPass) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UserPass) # gmapT :: (forall b. Data b => b -> b) -> UserPass -> UserPass # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UserPass -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UserPass -> r # gmapQ :: (forall d. Data d => d -> u) -> UserPass -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UserPass -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UserPass -> m UserPass # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UserPass -> m UserPass # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UserPass -> m UserPass # | |
Ord UserPass Source # | |
Defined in Happstack.Authenticate.Password.Core | |
Read UserPass Source # | |
Show UserPass Source # | |
Generic UserPass Source # | |
ToJSON UserPass Source # | |
Defined in Happstack.Authenticate.Password.Core | |
FromJSON UserPass Source # | |
ToJExpr UserPass Source # | |
Defined in Happstack.Authenticate.Password.Core | |
type Rep UserPass Source # | |
Defined in Happstack.Authenticate.Password.Core type Rep UserPass = D1 ('MetaData "UserPass" "Happstack.Authenticate.Password.Core" "happstack-authenticate-2.5.1-BzWELMPZnYYGo9CPtJoxJ3" 'False) (C1 ('MetaCons "UserPass" 'PrefixI 'True) (S1 ('MetaSel ('Just "_user") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Username) :*: S1 ('MetaSel ('Just "_password") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
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
resetTokenForUserId :: Text -> AcidState AuthenticateState -> AcidState PasswordState -> UserId -> IO (Either PasswordError Text) Source #
generate a reset token for a UserId
issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m 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 #