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