Ross Hayes
and 1 contributors


Dancer::Plugin::PasswordRequirements - Configurable password complexity testing


This module provides a wrapper around Data::Password::Simple, and impliments its functionality.

When this plugin is in use D::P::Simple object is retained within Dancer for improved performance, please be aware of the memory footprint implications when using the dictionary check function with large dictionaries.

The development of this module is maintained at


Version 0.01


    use Dancer::Plugin::PasswordRequirements;

The module is now ready to use, although not good for much. Data::Password::Simple will use its default configuration for password complexity (no dictionary checking, 6c minimum password length).

    get '/acceptable_password' => sub {
        return password_check(params->{word}) ? "yes" : "no";

If we want to we can construct a new D::P::Simple object using a new set of parameters. This will replace the existing object.

        length     => 6,
        dictionary => '/usr/share/dict/words',

Or we can access the existing D::P::Simple object directly, and make use of existing mutators and accessors.

    my $dps = password_dps_ref;



Replaces the current internal Data::Password::Simple object with one constructed with the given key => value list of parameters.

See the documentation for Data::Password::Simple::new for more information.


A wrapper for D::P::Simple::check.

In scalar context returns true if the password passes the check, false otherwise.

In list context returns a boolean result, and a hash containing details of password check results.

See the documentation for Data::Password::Simple::check for more information.


Returns the D::P::Simple object ref stored internally.

Note that D::P::Simple is not thread-safe. So modifications while being accessed by other Dancer workers may have odd effects.


Please report any bugs or feature requests to bug-dancer-plugin-passwordrequirements at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Dancer::Plugin::PasswordRequirements

You can also look for information at:


    Ross Hayes
    CPAN ID: Abablabab


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.


Data::Password::Simple Dancer Dancer::Plugin