line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Passphrase; |
2
|
|
|
|
|
|
|
$Mojolicious::Plugin::Passphrase::VERSION = '0.001'; |
3
|
1
|
|
|
1
|
|
835
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
790
|
use Crypt::Passphrase; |
|
1
|
|
|
|
|
1304
|
|
|
1
|
|
|
|
|
223
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub register { |
11
|
1
|
|
|
1
|
1
|
47
|
my (undef, $app, $config) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
3
|
my $passphrase = Crypt::Passphrase->new(%{$config}); |
|
1
|
|
|
|
|
5
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$app->helper(hash_password => sub { |
16
|
5
|
|
|
5
|
|
215429
|
my ($c, @args) = @_; |
17
|
5
|
|
|
|
|
40
|
return $passphrase->hash_password(@args); |
18
|
1
|
|
|
|
|
5799
|
}); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$app->helper(verify_password => sub { |
21
|
2
|
|
|
2
|
|
793
|
my ($c, @args) = @_; |
22
|
2
|
|
|
|
|
12
|
return $passphrase->verify_password(@args); |
23
|
1
|
|
|
|
|
163
|
}); |
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
|
|
|
|
|
92
|
}); |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
107
|
return; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#ABSTRACT: Securely hash and validate your passwords. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |