1 package PVE
::ACME
::Challenge
;
6 use PVE
::JSONSchema
qw(get_standard_option);
8 use base
qw(PVE::SectionConfig);
11 additionalProperties
=> 0,
14 description
=> "ACME Plugin ID name",
18 description
=> "ACME challenge type.",
22 description
=> "Flag to disable the config.",
26 nodes
=> get_standard_option
('pve-node-list', { optional
=> 1 }),
34 sub supported_challenge_types
{
38 sub extract_challenge
{
39 my ($self, $challenges, $c_type) = @_;
41 die "no challenges defined\n" if !$challenges;
42 die "no challenge type is defined \n" if !$c_type;
44 my $tmp_challenges = [ grep {$_->{type
} eq $c_type} @$challenges ];
45 die "no $c_type challenge defined in authorization\n"
46 if ! scalar $tmp_challenges;
48 my $challenge = $tmp_challenges->[0];
58 my ($class, $acme, $authorization) = @_;