| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Happstack.Authenticate.Password.Core
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 => PasswordConfig -> AcidState AuthenticateState -> AcidState PasswordState -> m (Either PasswordError Text)
- issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m (Either PasswordError JSON)
- sendResetEmail :: MonadIO m => Email -> Email -> 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 #
Constructors
| PasswordConfig | |
Fields
| |
Instances
| Generic PasswordConfig Source # | |
Defined in Happstack.Authenticate.Password.Core Associated Types type Rep PasswordConfig :: * -> * # Methods 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.3.4.11-Bwj3cHLrT0KCBoc9b6QczY" 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 #
Constructors
| NotAuthenticated | |
| NotAuthorized | |
| InvalidUsername | |
| InvalidPassword | |
| InvalidUsernamePassword | |
| NoEmailAddress | |
| MissingResetToken | |
| InvalidResetToken | |
| PasswordMismatch | |
| UnacceptablePassword | |
Fields | |
| CoreError | |
Fields | |
Instances
newtype HashedPass Source #
Constructors
| HashedPass | |
Fields | |
Instances
Arguments
| :: (Functor m, MonadIO m) | |
| => Text | password in plain text |
| -> m HashedPass | salted and hashed |
hash a password string
Arguments
| :: Text | password in plain text |
| -> HashedPass | hashed version of password |
| -> Bool |
verify a password
data PasswordState Source #
Constructors
| PasswordState | |
Fields | |
Instances
Arguments
| :: UserId | UserId |
| -> HashedPass | the hashed password |
| -> Update PasswordState () |
set the password for UserId
Arguments
| :: UserId | UserId |
| -> Update PasswordState () |
delete the password for UserId
verifyPasswordForUserId Source #
Arguments
| :: UserId | UserId |
| -> Text | plain-text password |
| -> Query PasswordState Bool |
verify that the supplied password matches the stored hashed password for UserId
data SetPassword Source #
Constructors
| SetPassword UserId HashedPass |
Instances
| UpdateEvent SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
| Method SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core Methods methodTag :: SetPassword -> Tag | |
| SafeCopy SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core Methods version :: Version SetPassword kind :: Kind SetPassword getCopy :: Contained (Get SetPassword) putCopy :: SetPassword -> Contained Put internalConsistency :: Consistency SetPassword objectProfile :: Profile SetPassword errorTypeName :: Proxy SetPassword -> String | |
| type MethodResult SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core type MethodResult SetPassword = () | |
| type MethodState SetPassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
newtype DeletePassword Source #
Constructors
| DeletePassword UserId |
Instances
| UpdateEvent DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
| Method DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core Methods methodTag :: DeletePassword -> Tag | |
| SafeCopy DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core Methods version :: Version DeletePassword kind :: Kind DeletePassword getCopy :: Contained (Get DeletePassword) putCopy :: DeletePassword -> Contained Put internalConsistency :: Consistency DeletePassword objectProfile :: Profile DeletePassword errorTypeName :: Proxy DeletePassword -> String | |
| type MethodResult DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core type MethodResult DeletePassword = () | |
| type MethodState DeletePassword Source # | |
Defined in Happstack.Authenticate.Password.Core | |
data VerifyPasswordForUserId Source #
Constructors
| VerifyPasswordForUserId UserId Text |
Instances
| QueryEvent VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core | |
| Method VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core Associated Types type MethodResult VerifyPasswordForUserId :: * type MethodState VerifyPasswordForUserId :: * Methods methodTag :: VerifyPasswordForUserId -> Tag | |
| SafeCopy VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core Methods version :: Version VerifyPasswordForUserId kind :: Kind VerifyPasswordForUserId getCopy :: Contained (Get VerifyPasswordForUserId) putCopy :: VerifyPasswordForUserId -> Contained Put internalConsistency :: Consistency VerifyPasswordForUserId objectProfile :: Profile VerifyPasswordForUserId errorTypeName :: Proxy VerifyPasswordForUserId -> String | |
| type MethodResult VerifyPasswordForUserId Source # | |
Defined in Happstack.Authenticate.Password.Core | |
| type MethodState 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
| Eq UserPass Source # | |
| Data UserPass Source # | |
Defined in Happstack.Authenticate.Password.Core Methods 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 :: (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.3.4.11-Bwj3cHLrT0KCBoc9b6QczY" 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
Constructors
| NewAccountData | |
Fields
| |
Instances
data ChangePasswordData Source #
JSON record for change password data
Constructors
| ChangePasswordData | |
Fields | |
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
Constructors
| RequestResetPasswordData | |
Fields | |
Instances
passwordRequestReset :: Happstack m => PasswordConfig -> AcidState AuthenticateState -> AcidState PasswordState -> m (Either PasswordError Text) Source #
request reset password
issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m (Either PasswordError JSON) Source #
issueResetToken
data ResetPasswordData Source #
JSON record for new account data
Constructors
| ResetPasswordData | |
Fields
| |
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 #