From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 86CC2B81F0 for ; Thu, 7 Mar 2024 10:46:06 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 61E6233F3E for ; Thu, 7 Mar 2024 10:45:36 +0100 (CET) Received: from druiddev.proxmox.com (unknown [94.136.29.99]) by firstgate.proxmox.com (Proxmox) with ESMTP for ; Thu, 7 Mar 2024 10:45:35 +0100 (CET) Received: by druiddev.proxmox.com (Postfix, from userid 1000) id C6DFB8BD61; Thu, 7 Mar 2024 10:45:35 +0100 (CET) From: Dietmar Maurer To: pve-devel@lists.proxmox.com Date: Thu, 7 Mar 2024 10:45:33 +0100 Message-Id: <20240307094533.63638-1-dietmar@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.547 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [eab.rs, account.rs] Subject: [pve-devel] [PATCH proxmox] proxmox-acme: add api-types feature X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2024 09:46:06 -0000 Because AccountData is exposed via our API (currently as type Object). Signed-off-by: Dietmar Maurer --- 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