]> git.proxmox.com Git - proxmox-acme.git/commitdiff
Implement function to resolve all subplugins
authorWolfgang Link <w.link@proxmox.com>
Wed, 8 Apr 2020 09:06:10 +0000 (11:06 +0200)
committerWolfgang Link <w.link@proxmox.com>
Thu, 16 Apr 2020 06:44:20 +0000 (08:44 +0200)
This function helps to retrieve all subplugins
that are supported by the plugins.
This will later be used as an enumeration for entering parameters.

src/PVE/ACME.pm
src/PVE/ACME/DNSChallenge.pm
src/PVE/ACME/StandAlone.pm

index 46b8fb17d494bd2467ff1f14650bda812010b715..c2756b650234cfb501d5f5a24b76d62bccfb4a68 100644 (file)
@@ -495,6 +495,27 @@ sub request_challenge_validation {
     return $return;
 }
 
+# return all availible subplugins from the plugins
+sub get_subplugins {
+
+    my $tmp = [];
+    my $plugins = PVE::ACME::Challenge->lookup_types();
+
+    foreach my $plugin_name (@$plugins) {
+       my $plugin = PVE::ACME::Challenge->lookup($plugin_name);
+       push @$tmp, $plugin->get_subplugins();
+    }
+
+    my $subplugins = [];
+    foreach my $array (@$tmp) {
+       foreach my $subplugin ( @$array) {
+           push @$subplugins, $subplugin;
+       }
+    }
+
+    return $subplugins;
+}
+
 # actually 'do' a $method request on $url
 # $data: input for JWS, optional
 # $use_jwk: use JWK instead of KID in JWD (see sub jws)
index 7af442ec5d847295eb6aef9776d5720419ea315e..f62333b2410052e30954ac0f9e32b34b1bdbeee8 100644 (file)
@@ -153,6 +153,10 @@ sub extract_challenge {
 
     return PVE::ACME::Challenge->extract_challenge($challenge, 'dns-01');
 }
+    
+sub get_subplugins {
+    return $api_name_list;
+}
 
 # The order of the parameters passed to proxmox-acme is important
 # proxmox-acme setup $plugin [$domain|$alias] $txtvalue $plugin_conf_string
index 73caef698cdc1220191743a315b94e36dbc184fb..310e62710863e8e5f1e29f82919dc857173f186d 100644 (file)
@@ -33,6 +33,10 @@ sub extract_challenge {
     return PVE::ACME::Challenge->extract_challenge($challenge, 'http-01');
 }
 
+sub get_subplugins {
+    return [];
+}
+
 sub setup {
     my ($class, $data) = @_;