line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Passphrase; |
2
|
|
|
|
|
|
|
$Mojolicious::Plugin::Passphrase::VERSION = '0.003'; |
3
|
1
|
|
|
1
|
|
772
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
730
|
use Crypt::Passphrase; |
|
1
|
|
|
|
|
1221
|
|
|
1
|
|
|
|
|
233
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub register { |
11
|
1
|
|
|
1
|
1
|
49
|
my (undef, $app, $config) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
2
|
my $passphrase = Crypt::Passphrase->new(%{$config}); |
|
1
|
|
|
|
|
6
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$app->helper(hash_password => sub { |
16
|
5
|
|
|
5
|
|
48324
|
my ($c, @args) = @_; |
17
|
5
|
|
|
|
|
29
|
return $passphrase->hash_password(@args); |
18
|
1
|
|
|
|
|
5592
|
}); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$app->helper(verify_password => sub { |
21
|
6
|
|
|
6
|
|
38710
|
my ($c, @args) = @_; |
22
|
6
|
|
|
|
|
31
|
return $passphrase->verify_password(@args); |
23
|
1
|
|
|
|
|
171
|
}); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$app->helper(password_needs_rehash => sub { |
26
|
0
|
|
|
0
|
|
0
|
my ($c, @args) = @_; |
27
|
0
|
|
|
|
|
0
|
return $passphrase->needs_rehash(@args); |
28
|
1
|
|
|
|
|
87
|
}); |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
83
|
return; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#ABSTRACT: Securely hash and validate your passwords. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |