line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
53
|
use utf8; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
42
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::User::Role; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
322
|
use strict; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
175
|
|
5
|
9
|
|
|
9
|
|
39
|
use warnings; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
263
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
60
|
use Moo; |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
49
|
|
8
|
9
|
|
|
9
|
|
2727
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
64
|
|
|
9
|
|
|
|
|
88
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
11
|
|
|
|
|
|
|
|
12
|
9
|
|
|
9
|
|
7996
|
use namespace::clean; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
51
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Net::Etcd::User::Role |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.020'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Use role |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 ACCESSORS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 endpoint |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has endpoint => ( |
35
|
|
|
|
|
|
|
is => 'ro', |
36
|
|
|
|
|
|
|
isa => Str, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 user |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
name of user |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has user => ( |
46
|
|
|
|
|
|
|
is => 'ro', |
47
|
|
|
|
|
|
|
isa => Str, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 name |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
name of user |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
has name => ( |
57
|
|
|
|
|
|
|
is => 'ro', |
58
|
|
|
|
|
|
|
isa => Str, |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 role |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
name of role |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
has role => ( |
68
|
|
|
|
|
|
|
is => 'ro', |
69
|
|
|
|
|
|
|
isa => Str, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 PUBLIC METHODS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 grant |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub grant { |
79
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
80
|
0
|
|
|
|
|
|
$self->{endpoint} = '/auth/user/grant'; |
81
|
0
|
|
|
|
|
|
$self->request; |
82
|
0
|
|
|
|
|
|
return $self; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 revoke |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub revoke { |
90
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
91
|
0
|
|
|
|
|
|
$self->{endpoint} = '/auth/user/revoke'; |
92
|
0
|
|
|
|
|
|
$self->request; |
93
|
0
|
|
|
|
|
|
return $self; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |