line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Authen::Simple::PlugAuth; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1388
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
5
|
2
|
|
|
2
|
|
8
|
use base 'Authen::Simple::Adapter'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1628
|
|
6
|
2
|
|
|
2
|
|
78785
|
use PlugAuth::Client::Tiny; |
|
2
|
|
|
|
|
45399
|
|
|
2
|
|
|
|
|
313
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Simple PlugAuth authentication |
9
|
|
|
|
|
|
|
our $VERSION = '0.02'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
__PACKAGE__->options({ |
13
|
|
|
|
|
|
|
url => { |
14
|
|
|
|
|
|
|
type => Params::Validate::SCALAR, |
15
|
|
|
|
|
|
|
optional => 0, |
16
|
|
|
|
|
|
|
}, |
17
|
|
|
|
|
|
|
}); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init |
22
|
|
|
|
|
|
|
{ |
23
|
1
|
|
|
1
|
1
|
90
|
my($self, $param) = @_; |
24
|
1
|
|
|
|
|
6
|
$self->SUPER::init($param); |
25
|
1
|
|
|
|
|
33
|
$self->{client} = PlugAuth::Client::Tiny->new( url => $self->url ); |
26
|
1
|
|
|
|
|
21
|
$self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub check |
30
|
|
|
|
|
|
|
{ |
31
|
2
|
|
|
2
|
1
|
2795
|
my($self, $username, $password) = @_; |
32
|
2
|
100
|
|
|
|
8
|
$self->{client}->auth($username, $password) ? 1 : 0; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |