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
|
1
|
|
|
1
|
|
51903
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
30
|
1
|
|
|
1
|
|
2
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
3
|
use parent qw( Net::ACME::AccessorBase ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
35
|
use constant _ACCESSORS => qw( error status ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
1
|
|
325
|
use Net::ACME::Utils (); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
use Net::ACME::X (); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $ERROR_CLASS; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
BEGIN { |
42
|
|
|
|
|
|
|
$ERROR_CLASS = 'Net::ACME::Error'; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub new { |
46
|
|
|
|
|
|
|
my ( $class, %opts ) = @_; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
if ( $opts{'error'} && !Net::ACME::Utils::thing_isa($opts{'error'}, $ERROR_CLASS) ) { |
49
|
|
|
|
|
|
|
die Net::ACME::X::create( 'InvalidParameter', "“error” must be an instance of “$ERROR_CLASS”, not “$opts{'error'}”!" ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
return $class->SUPER::new( %opts ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub status { |
56
|
|
|
|
|
|
|
my ($self) = @_; |
57
|
|
|
|
|
|
|
return $self->SUPER::status() || 'pending'; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |