public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-rs 1/1] fix #3688: handle optional meta property of the directory
Date: Thu, 21 Oct 2021 11:10:44 +0200	[thread overview]
Message-ID: <20211021091044.2135964-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20211021091044.2135964-1-d.csapak@proxmox.com>

meta is optional so handle that, fixes the issue where one could not
create an account on custom ACME endpoints without a meta property since
it could not be parsed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
needs proxmox-acme-rs to be bumped and the depency adapted in Cargo.toml

 src/acme.rs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/acme.rs b/src/acme.rs
index 9a57624..a1b5278 100644
--- a/src/acme.rs
+++ b/src/acme.rs
@@ -265,10 +265,11 @@ pub mod export {
 
     /// Get the directory's meta information.
     #[export]
-    pub fn get_meta(#[try_from_ref] this: &Acme) -> Result<Meta, Error> {
-        Ok(Meta::clone(
-            this.inner.lock().unwrap().client.directory()?.meta(),
-        ))
+    pub fn get_meta(#[try_from_ref] this: &Acme) -> Result<Option<Meta>, Error> {
+        match this.inner.lock().unwrap().client.directory()?.meta() {
+            Some(meta) => Ok(Some(meta.clone())),
+            None => Ok(None),
+        }
     }
 
     /// Get the account's directory URL.
-- 
2.30.2





  parent reply	other threads:[~2021-10-21  9:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  9:10 [pmg-devel] [PATCH proxmox-acme-rs/pmg-rs] fix #3688: allow missing 'meta' property for acme directories Dominik Csapak
2021-10-21  9:10 ` [pmg-devel] [PATCH proxmox-acme-rs 1/1] directory: make meta object optional Dominik Csapak
2021-10-21  9:10 ` Dominik Csapak [this message]
2021-10-21 11:24 ` [pmg-devel] applied: [PATCH proxmox-acme-rs/pmg-rs] fix #3688: allow missing 'meta' property for acme directories Wolfgang Bumiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211021091044.2135964-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal