polysemy-account-0.2.0.0: Account management with Servant and Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Account.Effect.Password

Description

 
Synopsis

Documentation

data Password :: Effect where Source #

This effect provides password hashing, validation, and generation.

Constructors

Hash :: RawPassword -> Password m HashedPassword

Hash a clear text password.

Check :: RawPassword -> HashedPassword -> Password m Bool

Validate a password against a hash.

Generate :: Word -> Password m GeneratedPassword

Generate a new clear text password of the specified length.

generate :: forall r. Member Password r => Word -> Sem r GeneratedPassword Source #

Generate a new clear text password of the specified length.

check :: forall r. Member Password r => RawPassword -> HashedPassword -> Sem r Bool Source #

Validate a password against a hash.

hash :: forall r. Member Password r => RawPassword -> Sem r HashedPassword Source #

Hash a clear text password.