NAME

Password::Policy::Exception::Pwned - Die if a password has been pwned

SYNOPSIS

use Password::Policy;
use Try::Tiny;

my $pass = 'password1';

my $pp = Password::Policy->new (config => 'policy.yaml');
try {
    $pp->process({ password => $pass });
} catch {
    warn "This password '$pass' is pwned - don't use it";
    # Other actions
}

DESCRIPTION

This exception is thrown when Password::Policy::Rule::Pwned determines that a password has been pwned.

METHODS

error

$exception->error ();

This method is not expected to be called directly but rather via Password::Policy->process. It returns the text of an appropriate error which in this case is "The specified password has been pwned".

SEE ALSO

For how to determine if passwords are pwned, see Password::Policy::Rule::Pwned.

To understand how to use this as part of a wider password policy enforcement program, see Password::Policy.

REPOSITORY

https://gitlab.com/openstrike/password-pwned

MAINTAINER

This module is written and maintained by Pete Houston of Openstrike <cpan@openstrike.co.uk>

COPYRIGHT INFORMATION

Copyright 2018 by Pete Houston. All Rights Reserved.

Permission to use, copy, and distribute is hereby granted, providing that the above copyright notice and this permission appear in all copies and in supporting documentation.

LICENCE

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