]> git.proxmox.com Git - proxmox.git/commitdiff
proxmox-acme: add api-types feature
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 7 Mar 2024 09:45:33 +0000 (10:45 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 7 Mar 2024 12:21:52 +0000 (13:21 +0100)
Because AccountData is exposed via our API (currently as type Object).

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
proxmox-acme/Cargo.toml
proxmox-acme/src/account.rs
proxmox-acme/src/eab.rs

index 8f8f6e1cb194b4c92ae89d46c2406651fae4e2b0..857c61d9c762c436c5ae15858e4f3062482d5832 100644 (file)
@@ -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]
index 9f3af264bcb780aef80fc2592056c8b96ee4a2d3..e244c092cffb1d195bfa70a92f4d77bc957eff2a 100644 (file)
@@ -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.
index a4c064248b535b2ed67097f06b13a08b4ef276e6..f006a3f25df27c9e21f7c50aeb0cccd4b6c06bf1 100644 (file)
@@ -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,
 }