| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  |  | 
| 2 |  |  |  |  |  |  | use Moo; | 
| 3 | 2 |  |  | 2 |  | 42455 |  | 
|  | 2 |  |  |  |  | 6432 |  | 
|  | 2 |  |  |  |  | 11 |  | 
| 4 |  |  |  |  |  |  | with 'Dancer2::Plugin::FormValidator::Role::Extension'; | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | our $VERSION = '0.82'; | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | return { | 
| 9 |  |  |  |  |  |  | password_simple => 'Dancer2::Plugin::FormValidator::Extension::Password::Simple', | 
| 10 |  |  |  |  |  |  | password_robust => 'Dancer2::Plugin::FormValidator::Extension::Password::Robust', | 
| 11 | 4 |  |  | 4 | 0 | 6130 | password_hard   => 'Dancer2::Plugin::FormValidator::Extension::Password::Hard', | 
| 12 |  |  |  |  |  |  | }; | 
| 13 |  |  |  |  |  |  | } | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | 1; | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | # ABSTRACT: Dancer2 FormValidator extension for validating passwords. | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | =pod | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | =encoding UTF-8 | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | =head1 NAME | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | Dancer2::Plugin::FormValidator::Extension::Password - Dancer2 FormValidator extension for validating passwords. | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | =head1 VERSION | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | version 0.82 | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | package Validator { | 
| 36 |  |  |  |  |  |  | use Moo; | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  | with 'Dancer2::Plugin::FormValidator::Role::Profile'; | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | sub profile { | 
| 41 |  |  |  |  |  |  | return { | 
| 42 |  |  |  |  |  |  | email    => [qw(required email)], | 
| 43 |  |  |  |  |  |  | password => [qw(required password_robust)], | 
| 44 |  |  |  |  |  |  | }; | 
| 45 |  |  |  |  |  |  | }; | 
| 46 |  |  |  |  |  |  | } | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | =head1 DISCLAIMER | 
| 50 |  |  |  |  |  |  |  | 
| 51 |  |  |  |  |  |  | This is beta version, not stable. | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | This extension provides validators for password verification for Dancer2::Plugin::FormValidator. | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | L<Dancer2::Plugin::FormValidator|https://metacpan.org/pod/Dancer2::Plugin::FormValidator>. | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | =head1 CONFIGURATION | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | set plugins => { | 
| 62 |  |  |  |  |  |  | FormValidator => { | 
| 63 |  |  |  |  |  |  | session    => { | 
| 64 |  |  |  |  |  |  | namespace => '_form_validator' | 
| 65 |  |  |  |  |  |  | }, | 
| 66 |  |  |  |  |  |  | forms      => { | 
| 67 |  |  |  |  |  |  | login => 'Validator', | 
| 68 |  |  |  |  |  |  | }, | 
| 69 |  |  |  |  |  |  | extensions => { | 
| 70 |  |  |  |  |  |  | password => { | 
| 71 |  |  |  |  |  |  | provider => 'Dancer2::Plugin::FormValidator::Extension::Password', | 
| 72 |  |  |  |  |  |  | } | 
| 73 |  |  |  |  |  |  | } | 
| 74 |  |  |  |  |  |  | }, | 
| 75 |  |  |  |  |  |  | }; | 
| 76 |  |  |  |  |  |  |  | 
| 77 |  |  |  |  |  |  | config.yml: | 
| 78 |  |  |  |  |  |  |  | 
| 79 |  |  |  |  |  |  | ... | 
| 80 |  |  |  |  |  |  | plugins: | 
| 81 |  |  |  |  |  |  | FormValidator: | 
| 82 |  |  |  |  |  |  | session: | 
| 83 |  |  |  |  |  |  | namespace: '_form_validator' | 
| 84 |  |  |  |  |  |  | extensions: | 
| 85 |  |  |  |  |  |  | password: | 
| 86 |  |  |  |  |  |  | provider: 'Dancer2::Plugin::FormValidator::Extension::Password' | 
| 87 |  |  |  |  |  |  | ... | 
| 88 |  |  |  |  |  |  | ... | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  | =head1 Validators | 
| 91 |  |  |  |  |  |  |  | 
| 92 |  |  |  |  |  |  | =head3 password_simple | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | Field must be minimum 8 characters long and contain at least one letter and one number. | 
| 95 |  |  |  |  |  |  |  | 
| 96 |  |  |  |  |  |  | =head3 password_robust | 
| 97 |  |  |  |  |  |  |  | 
| 98 |  |  |  |  |  |  | Field must be minimum 8 characters long and contain at least one letter, a number, and a special character. | 
| 99 |  |  |  |  |  |  |  | 
| 100 |  |  |  |  |  |  | =head3 password_hard | 
| 101 |  |  |  |  |  |  |  | 
| 102 |  |  |  |  |  |  | must be minimum 8 characters long and contain at least one uppercase letter, one lowercase letter, one number and a special character. | 
| 103 |  |  |  |  |  |  |  | 
| 104 |  |  |  |  |  |  | =head1 SOURCE CODE REPOSITORY | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  | L<https://github.com/AlexP007/dancer2-plugin-formvalidator-extension-password|https://github.com/AlexP007/dancer2-plugin-formvalidator-extension-password>. | 
| 107 |  |  |  |  |  |  |  | 
| 108 |  |  |  |  |  |  | =head1 AUTHOR | 
| 109 |  |  |  |  |  |  |  | 
| 110 |  |  |  |  |  |  | Alexander Panteleev <alexpan at cpan dot org>. | 
| 111 |  |  |  |  |  |  |  | 
| 112 |  |  |  |  |  |  | =head1 LICENSE AND COPYRIGHT | 
| 113 |  |  |  |  |  |  |  | 
| 114 |  |  |  |  |  |  | This software is copyright (c) 2022 by Alexander Panteleev. | 
| 115 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 116 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 117 |  |  |  |  |  |  |  | 
| 118 |  |  |  |  |  |  | =cut |