line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ACME::Challenge; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Net::ACME::Challenge - a resolved/handled challenge |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Net::ACME::Challenge (); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#This is minimal for now. |
14
|
|
|
|
|
|
|
my $challenge = Net::ACME::Challenge->new( |
15
|
|
|
|
|
|
|
status => 'invalid', #or 'valid' |
16
|
|
|
|
|
|
|
error => $error_object, #likely undef if status == “valid” |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This module abstracts details of a handled/resolved challenge, whether |
22
|
|
|
|
|
|
|
that challenge was met successfully or not. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
To work with unhandled/unresolved challenges, see |
25
|
|
|
|
|
|
|
(subclasses of) C. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
4
|
|
55292
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
108
|
|
30
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
100
|
|
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
4
|
|
14
|
use parent qw( Net::ACME::AccessorBase ); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
17
|
|
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
4
|
|
160
|
use constant _ACCESSORS => qw( error status ); |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
206
|
|
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
4
|
|
303
|
use Net::ACME::Utils (); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
72
|
|
37
|
4
|
|
|
4
|
|
14
|
use Net::ACME::X (); |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
73
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $ERROR_CLASS; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
BEGIN { |
42
|
4
|
|
|
4
|
|
425
|
$ERROR_CLASS = 'Net::ACME::Error'; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub new { |
46
|
5
|
|
|
5
|
0
|
782
|
my ( $class, %opts ) = @_; |
47
|
|
|
|
|
|
|
|
48
|
5
|
100
|
100
|
|
|
23
|
if ( $opts{'error'} && !Net::ACME::Utils::thing_isa($opts{'error'}, $ERROR_CLASS) ) { |
49
|
1
|
|
|
|
|
9
|
die Net::ACME::X::create( 'InvalidParameter', "“error” must be an instance of “$ERROR_CLASS”, not “$opts{'error'}”!" ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
4
|
|
|
|
|
23
|
return $class->SUPER::new( %opts ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub status { |
56
|
4
|
|
|
4
|
0
|
1348
|
my ($self) = @_; |
57
|
4
|
|
100
|
|
|
40
|
return $self->SUPER::status() || 'pending'; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |