line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
31
|
use utf8; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
36
|
|
2
|
|
|
|
|
|
|
package Etcd3::Auth::Role; |
3
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
172
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
95
|
|
5
|
5
|
|
|
5
|
|
22
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
128
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
23
|
use Moo; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
32
|
|
8
|
5
|
|
|
5
|
|
1579
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
27
|
|
9
|
5
|
|
|
5
|
|
4431
|
use MIME::Base64; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
309
|
|
10
|
5
|
|
|
5
|
|
26
|
use Carp; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
253
|
|
11
|
5
|
|
|
5
|
|
27
|
use JSON; |
|
5
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
35
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Etcd3::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
2561
|
use namespace::clean; |
|
5
|
|
|
|
|
45845
|
|
|
5
|
|
|
|
|
31
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Etcd3::Auth::Role |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.007'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Role |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 endpoint |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has endpoint => ( |
34
|
|
|
|
|
|
|
is => 'rwp', |
35
|
|
|
|
|
|
|
isa => Str, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 name |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
name of role |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has name => ( |
45
|
|
|
|
|
|
|
is => 'ro', |
46
|
|
|
|
|
|
|
isa => Str, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 role |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
name of role |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has role => ( |
56
|
|
|
|
|
|
|
is => 'ro', |
57
|
|
|
|
|
|
|
isa => Str, |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 add |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Add role |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub add { |
67
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
68
|
|
|
|
|
|
|
confess 'name required for ' . __PACKAGE__ . '->add' |
69
|
0
|
0
|
|
|
|
|
unless $self->{name}; |
70
|
0
|
|
|
|
|
|
$self->{endpoint} = '/auth/role/add'; |
71
|
0
|
|
|
|
|
|
$self->request; |
72
|
0
|
|
|
|
|
|
return $self; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 delete |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Delete role |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub delete { |
82
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
83
|
|
|
|
|
|
|
confess 'name required for ' . __PACKAGE__ . '->delete' |
84
|
0
|
0
|
|
|
|
|
unless $self->{role}; |
85
|
0
|
|
|
|
|
|
$self->{endpoint} = '/auth/role/delete'; |
86
|
0
|
|
|
|
|
|
$self->request; |
87
|
0
|
|
|
|
|
|
return $self; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 get |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Get role |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub get { |
97
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
98
|
|
|
|
|
|
|
confess 'name required for ' . __PACKAGE__ . '->get' |
99
|
0
|
0
|
|
|
|
|
unless $self->{role}; |
100
|
0
|
|
|
|
|
|
$self->{endpoint} = '/auth/role/get'; |
101
|
0
|
|
|
|
|
|
$self->request; |
102
|
0
|
|
|
|
|
|
return $self; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 list |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
List roles |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub list { |
112
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
113
|
0
|
|
|
|
|
|
$self->{endpoint} = '/auth/role/list'; |
114
|
0
|
|
|
|
|
|
$self->{json_args} = '{}'; |
115
|
0
|
|
|
|
|
|
$self->request; |
116
|
0
|
|
|
|
|
|
return $self; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
1; |