line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ACME2::Authorization; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::ACME2::Authorization |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
The ACME Authorization object. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
7
|
use parent qw( Net::ACME2::AccessorBase ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
42
|
use Call::Context (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
341
|
use Net::ACME2::Challenge (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
16
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#Pre-load challenge classes. |
25
|
1
|
|
|
1
|
|
401
|
use Net::ACME2::Challenge::http_01 (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
16
|
|
26
|
1
|
|
|
1
|
|
369
|
use Net::ACME2::Challenge::dns_01 (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
246
|
use constant _ACCESSORS => ( |
29
|
|
|
|
|
|
|
'id', |
30
|
|
|
|
|
|
|
'expires', |
31
|
|
|
|
|
|
|
'status', |
32
|
1
|
|
|
1
|
|
5
|
); |
|
1
|
|
|
|
|
3
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 ACCESSORS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
These provide text strings as defined in the ACME specification. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=over |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item * B |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item * B |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item * B |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=back |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 OTHER METHODS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 I->wildcard() |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Returns a Perl boolean that indicates whether the authorization is |
53
|
|
|
|
|
|
|
for a wildcard DNS name. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub wildcard { |
58
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return !!$self->{'_wildcard'}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 I->identifier() |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
The order’s identifier, as a hash reference. |
66
|
|
|
|
|
|
|
The content matches the ACME specification. (NB: Wildcard |
67
|
|
|
|
|
|
|
authorizations do B contain the leading C<*.> in the |
68
|
|
|
|
|
|
|
C.) |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub identifier { |
73
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
return { %{ $self->{'_identifier'} } }; |
|
0
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 I->challenges() |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
The order’s challenges, as a list of L |
81
|
|
|
|
|
|
|
instances. (C challenges will be instances of |
82
|
|
|
|
|
|
|
L.) |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub challenges { |
87
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
Call::Context::must_be_list(); |
90
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
my @challenges; |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
for my $c ( @{ $self->{'_challenges'} } ) { |
|
0
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
my $class = 'Net::ACME2::Challenge'; |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
my $module_leaf = $c->{'type'}; |
97
|
0
|
|
|
|
|
|
$module_leaf =~ tr<-><_>; |
98
|
0
|
|
|
|
|
|
$class .= "::$module_leaf"; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
#Ignore unrecognized challenges. |
101
|
0
|
0
|
|
|
|
|
next if !$class->can('new'); |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
push @challenges, $class->new( %$c ); |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
return @challenges; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub update { |
110
|
0
|
|
|
0
|
0
|
|
my ($self, $new_hr) = @_; |
111
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
for my $name ( 'status', 'challenges' ) { |
113
|
0
|
|
|
|
|
|
$self->{"_$name"} = $new_hr->{$name}; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
return $self; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
1; |