Wt
4.11.1
|
Validator for password strength. More...
#include <AbstractPasswordService.h>
Public Member Functions | |
AbstractStrengthValidator () | |
Constructor. | |
virtual StrengthValidatorResult | evaluateStrength (const WString &password, const WString &loginName, const std::string &email) const =0 |
Evaluates the strength of a password. More... | |
virtual Result | validate (const WString &password, const WString &loginName, const std::string &email) const |
Validates a password. More... | |
virtual Result | validate (const WString &password) const override |
Validates a password. More... | |
Public Member Functions inherited from Wt::WValidator | |
WValidator (bool mandatory=false) | |
Creates a new validator. More... | |
virtual | ~WValidator () |
Destructor. More... | |
void | setMandatory (bool how) |
Sets if input is mandatory. More... | |
bool | isMandatory () const |
Returns if input is mandatory. | |
void | setInvalidBlankText (const WString &text) |
Sets the message to display when a mandatory field is left blank. More... | |
WString | invalidBlankText () const |
Returns the message displayed when a mandatory field is left blank. More... | |
virtual WString | format () const |
Returns the validator format. More... | |
virtual std::string | javaScriptValidate () const |
Creates a Javascript object that validates the input. More... | |
virtual std::string | inputFilter () const |
Returns a regular expression that filters input. More... | |
Additional Inherited Members | |
Public Types inherited from Wt::WValidator | |
typedef ValidationState | State |
Typedef for enum Wt::ValidationState. | |
Validator for password strength.
This class defines a specialized validator interface for evaluating password strength. The implementation allows to evaluate strength in addition to the normal validator functionality of validating a password.
The evaluateStrength() computes the strength and returns an instance of StrenghtValidatorResult which contains information on the validity and the strength of the password together with possible messages.
|
pure virtual |
Evaluates the strength of a password.
The result is an instance of StrengthValidatorResult which contains information on the validity and the strength of the password together with possible messages.
The validator may take into account the user's login name and email address, to exclude passwords that are too similar to these.
Implemented in Wt::Auth::PasswordStrengthValidator.
|
overridevirtual |
Validates a password.
Calls validate(password, WString::Empty, "");
Reimplemented from Wt::WValidator.
|
virtual |
Validates a password.
This uses evaluateStrength(), isValid() and message() to return the result of password validation.