From: Dietmar Maurer <dietmar@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox] proxmox-acme: add api-types feature
Date: Thu, 7 Mar 2024 10:45:33 +0100 [thread overview]
Message-ID: <20240307094533.63638-1-dietmar@proxmox.com> (raw)
Because AccountData is exposed via our API (currently as type Object).
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
proxmox-acme/Cargo.toml | 3 +++
proxmox-acme/src/account.rs | 7 +++++++
proxmox-acme/src/eab.rs | 5 +++++
3 files changed, 15 insertions(+)
diff --git a/proxmox-acme/Cargo.toml b/proxmox-acme/Cargo.toml
index 8f8f6e1..857c61d 100644
--- a/proxmox-acme/Cargo.toml
+++ b/proxmox-acme/Cargo.toml
@@ -19,6 +19,8 @@ openssl.workspace = true
# For the client
native-tls = { workspace = true, optional = true }
+proxmox-schema = { workspace = true, optional = true, features = [ "api-macro", "api-types" ] }
+
[dependencies.ureq]
optional = true
version = "2.4"
@@ -27,6 +29,7 @@ features = [ "native-tls", "gzip" ]
[features]
default = []
+api-types = [ "dep:proxmox-schema" ]
client = ["ureq", "native-tls"]
[dev-dependencies]
diff --git a/proxmox-acme/src/account.rs b/proxmox-acme/src/account.rs
index 9f3af26..e244c09 100644
--- a/proxmox-acme/src/account.rs
+++ b/proxmox-acme/src/account.rs
@@ -279,6 +279,7 @@ impl CertificateRevocation<'_> {
}
/// Status of an ACME account.
+#[cfg_attr(feature="api-types", proxmox_schema::api())]
#[derive(Clone, Copy, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum AccountStatus {
@@ -309,6 +310,12 @@ impl AccountStatus {
}
}
+#[cfg_attr(feature="api-types", proxmox_schema::api(
+ properties: {
+ extra: { type: Object, properties: {}, additional_properties: true },
+ contact: { type: Array, items: { type: String, description: "Contact Info." }}
+ }
+))]
/// ACME Account data. This is the part of the account returned from and possibly sent to the ACME
/// provider. Some fields may be uptdated by the user via a request to the account location, others
/// may not be changed.
diff --git a/proxmox-acme/src/eab.rs b/proxmox-acme/src/eab.rs
index a4c0642..f006a3f 100644
--- a/proxmox-acme/src/eab.rs
+++ b/proxmox-acme/src/eab.rs
@@ -14,11 +14,16 @@ struct Protected {
kid: String,
}
+#[cfg_attr(feature="api-types", proxmox_schema::api())]
+/// External Account Bindings
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ExternalAccountBinding {
+ /// JOSE Header (see RFC 7515)
protected: String,
+ /// Payload
payload: String,
+ /// HMAC signature
signature: String,
}
--
2.39.2
next reply other threads:[~2024-03-07 9:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 9:45 Dietmar Maurer [this message]
2024-03-07 12:25 ` [pve-devel] applied: " 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=20240307094533.63638-1-dietmar@proxmox.com \
--to=dietmar@proxmox.com \
--cc=pve-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