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 }),
35 my ($class, $filename, $raw) = @_;
37 my $cfg = $class->SUPER::parse_config
($filename, $raw);
38 my $ids = $cfg->{ids
};
40 # make sure we have a standalone plugin definition as fallback!
41 if (!$ids->{standalone
} || $ids->{standalone
}->{type
} ne 'standalone') {
42 $ids->{standalone
} = {
50 sub supported_challenge_types
{
54 sub extract_challenge
{
55 my ($self, $challenges) = @_;
57 die "no challenges defined\n" if !$challenges;
59 my $supported_types = $self->supported_challenge_types();
61 # preference returned by plugin!
62 foreach my $supported_type (@$supported_types) {
63 foreach my $challenge (@$challenges) {
64 next if $challenge->{type
} ne $supported_type;
70 die "plugin does not support any of the requested challenge types\n";
77 # acme => PVE::ACME instance
78 # auth => authorization object returned by ACME server
80 # plugin => plugin config data
81 # alias => optional domain alias
83 # needs to set $data->{url} to URL of the challenge which has been set up
84 # can set other $data keys needed by teardown sub
86 my ($self, $acme, $auth, $data) = @_;
93 my ($self, $acme, $auth, $data) = @_;