line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
9
|
|
|
9
|
|
59
|
use utf8; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
61
|
|
2
|
|
|
|
|
|
|
package Net::Etcd::Auth::Role; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
382
|
use strict; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
183
|
|
5
|
9
|
|
|
9
|
|
40
|
use warnings; |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
217
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
39
|
use Moo; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
54
|
|
8
|
9
|
|
|
9
|
|
3084
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
45
|
|
9
|
9
|
|
|
9
|
|
7182
|
use MIME::Base64; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
445
|
|
10
|
9
|
|
|
9
|
|
43
|
use Carp; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
397
|
|
11
|
9
|
|
|
9
|
|
42
|
use JSON; |
|
9
|
|
|
|
|
84
|
|
|
9
|
|
|
|
|
63
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Net::Etcd::Role::Actions'; |
14
|
|
|
|
|
|
|
|
15
|
9
|
|
|
9
|
|
4886
|
use namespace::clean; |
|
9
|
|
|
|
|
102176
|
|
|
9
|
|
|
|
|
55
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Etcd::Auth::Role |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.020'; |
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 'role 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; |