return [
{ name => 'account' },
{ name => 'tos' },
+ { name => 'meta' },
{ name => 'directories' },
{ name => 'plugins' },
{ name => 'challenge-schema' },
return $update_account->($param, 'deactivate', $force_deactivate, status => 'deactivated');
}});
+# TODO: deprecated, remove with pmg 9
__PACKAGE__->register_method ({
name => 'get_tos',
path => 'tos',
method => 'GET',
- description => "Retrieve ACME TermsOfService URL from CA.",
+ description => "Retrieve ACME TermsOfService URL from CA. Deprecated, please use /config/acme/meta.",
permissions => { user => 'all' },
parameters => {
additionalProperties => 0,
return $meta ? $meta->{termsOfService} : undef;
}});
+__PACKAGE__->register_method ({
+ name => 'get_meta',
+ path => 'meta',
+ method => 'GET',
+ description => "Retrieve ACME Directory Meta Information",
+ permissions => { user => 'all' },
+ parameters => {
+ additionalProperties => 0,
+ properties => {
+ directory => get_standard_option('pmg-acme-directory-url', {
+ default => $acme_default_directory_url,
+ optional => 1,
+ }),
+ },
+ },
+ returns => {
+ type => 'object',
+ additionalProperties => 1,
+ properties => {
+ termsOfService => {
+ description => 'ACME TermsOfService URL.',
+ type => 'string',
+ optional => 1,
+ },
+ externalAccountRequired => {
+ description => 'EAB Required',
+ type => 'boolean',
+ optional => 1,
+ },
+ website => {
+ description => 'URL to more information about the ACME server.',
+ type => 'string',
+ optional => 1,
+ },
+ caaIdentities => {
+ description => 'Hostnames referring to the ACME servers.',
+ type => 'array',
+ items => {
+ type => 'string',
+ },
+ optional => 1,
+ },
+ },
+ },
+ code => sub {
+ my ($param) = @_;
+
+ my $directory = extract_param($param, 'directory') // $acme_default_directory_url;
+
+ my $acme = PVE::ACME->new(undef, $directory);
+ my $meta = $acme->get_meta();
+
+ return $meta;
+ }});
+
__PACKAGE__->register_method ({
name => 'get_directories',
path => 'directories',