]> git.proxmox.com Git - pmg-api.git/commitdiff
api: acme: add eab parameters
authorFolke Gleumes <f.gleumes@proxmox.com>
Tue, 14 Nov 2023 14:14:06 +0000 (15:14 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 4 Dec 2023 12:14:28 +0000 (13:14 +0100)
Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
src/PMG/API2/ACME.pm

index 42c9f4efe68bce8f8f1f488a99d2d4a4ec2e705c..9e3eb8d5e14057344acba7bf2705380628d85559 100644 (file)
@@ -132,6 +132,18 @@ __PACKAGE__->register_method ({
                default => $acme_default_directory_url,
                optional => 1,
            }),
+           'eab-kid' => {
+               type => 'string',
+               description => 'Key Identifier for External Account Binding.',
+               requires => 'eab-hmac-key',
+               optional => 1,
+           },
+           'eab-hmac-key' => {
+               type => 'string',
+               description => 'HMAC key for External Account Binding.',
+               requires => 'eab-kid',
+               optional => 1,
+           },
        },
     },
     returns => {
@@ -151,6 +163,8 @@ __PACKAGE__->register_method ({
 
        my $directory = extract_param($param, 'directory') // $acme_default_directory_url;
        my $contact = $account_contact_from_param->($param);
+       my $eab_kid = extract_param($param, 'eab-kid');
+       my $eab_hmac_key = extract_param($param, 'eab-hmac-key');
 
        my $realcmd = sub {
            PMG::CertHelpers::lock_acme($account_name, 10, sub {
@@ -160,7 +174,7 @@ __PACKAGE__->register_method ({
                print "Registering new ACME account..\n";
                my $acme = PMG::RS::Acme->new($directory);
                eval {
-                   $acme->new_account($account_file, defined($param->{tos_url}), $contact, undef);
+                   $acme->new_account($account_file, defined($param->{tos_url}), $contact, undef, $eab_kid, $eab_hmac_key);
                };
                if (my $err = $@) {
                    unlink $account_file;