* [pve-devel] [PATCH] fix #6932: api: acme: add digest and plugin to return schema
@ 2025-10-15 10:05 Nicolas Frey
2025-10-15 11:22 ` Nicolas Frey
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Frey @ 2025-10-15 10:05 UTC (permalink / raw)
To: pve-devel
fixes regression from `427e2627 api: add ACME plugin return schema`
by adding digest and plugin parameters and deleting id parameter, as
it is replaced by plugin on return schemas. This mismatch would
result in `400 Result verification failed` on index and
get_plugin_config.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6932
Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
---
PVE/API2/ACMEPlugin.pm | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/PVE/API2/ACMEPlugin.pm b/PVE/API2/ACMEPlugin.pm
index c12b75c5..1754d9f0 100644
--- a/PVE/API2/ACMEPlugin.pm
+++ b/PVE/API2/ACMEPlugin.pm
@@ -50,7 +50,17 @@ my $modify_cfg_for_api = sub {
return $plugin_cfg;
};
-my $acme_challenge_api_create_and_return_schema = PVE::ACME::Challenge->createSchema();
+my $acme_challenge_create_schema = PVE::ACME::Challenge->createSchema();
+my $acme_challenge_api_create_and_return_schema = {
+ type => "object",
+ properties => {
+ PVE::ACME::Challenge->createSchema()->{properties}->%*,
+ digest => get_standard_option('pve-config-digest'),
+ plugin => get_standard_option('pve-acme-pluginid'),
+ },
+};
+# replaced by plugin property
+delete $acme_challenge_api_create_and_return_schema->{properties}->{id};
__PACKAGE__->register_method({
name => 'index',
@@ -126,7 +136,7 @@ __PACKAGE__->register_method({
check => ['perm', '/', ['Sys.Modify']],
},
protected => 1,
- parameters => $acme_challenge_api_create_and_return_schema,
+ parameters => $acme_challenge_create_schema,
returns => {
type => "null",
},
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [PATCH] fix #6932: api: acme: add digest and plugin to return schema
2025-10-15 10:05 [pve-devel] [PATCH] fix #6932: api: acme: add digest and plugin to return schema Nicolas Frey
@ 2025-10-15 11:22 ` Nicolas Frey
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Frey @ 2025-10-15 11:22 UTC (permalink / raw)
To: pve-devel
Renamed $acme_challenge_api_create_and_return_schema in v2
Superseded-by: https://lore.proxmox.com/pve-devel/20251015111740.122773-1-n.frey@proxmox.com/T/#u
On 10/15/25 12:04 PM, Nicolas Frey wrote:
> fixes regression from `427e2627 api: add ACME plugin return schema`
> by adding digest and plugin parameters and deleting id parameter, as
> it is replaced by plugin on return schemas. This mismatch would
> result in `400 Result verification failed` on index and
> get_plugin_config.
>
> Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6932
> Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
> ---
> PVE/API2/ACMEPlugin.pm | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/PVE/API2/ACMEPlugin.pm b/PVE/API2/ACMEPlugin.pm
> index c12b75c5..1754d9f0 100644
> --- a/PVE/API2/ACMEPlugin.pm
> +++ b/PVE/API2/ACMEPlugin.pm
> @@ -50,7 +50,17 @@ my $modify_cfg_for_api = sub {
> return $plugin_cfg;
> };
>
> -my $acme_challenge_api_create_and_return_schema = PVE::ACME::Challenge->createSchema();
> +my $acme_challenge_create_schema = PVE::ACME::Challenge->createSchema();
> +my $acme_challenge_api_create_and_return_schema = {
> + type => "object",
> + properties => {
> + PVE::ACME::Challenge->createSchema()->{properties}->%*,
> + digest => get_standard_option('pve-config-digest'),
> + plugin => get_standard_option('pve-acme-pluginid'),
> + },
> +};
> +# replaced by plugin property
> +delete $acme_challenge_api_create_and_return_schema->{properties}->{id};
>
> __PACKAGE__->register_method({
> name => 'index',
> @@ -126,7 +136,7 @@ __PACKAGE__->register_method({
> check => ['perm', '/', ['Sys.Modify']],
> },
> protected => 1,
> - parameters => $acme_challenge_api_create_and_return_schema,
> + parameters => $acme_challenge_create_schema,
> returns => {
> type => "null",
> },
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-15 11:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-15 10:05 [pve-devel] [PATCH] fix #6932: api: acme: add digest and plugin to return schema Nicolas Frey
2025-10-15 11:22 ` Nicolas Frey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox