]> git.proxmox.com Git - proxmox-backup.git/commitdiff
update to proxmox-acme 0.5
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 6 Dec 2023 11:45:35 +0000 (12:45 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 6 Dec 2023 11:45:35 +0000 (12:45 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cargo.toml
src/acme/client.rs
src/acme/plugin.rs
src/api2/config/acme.rs
src/api2/node/certificates.rs

index 96c17f16b85b3240374398275dee35931fd02aee..7e8b95078c362fd427d4294c865d2c91814ac699 100644 (file)
@@ -84,7 +84,7 @@ proxmox-uuid = "1"
 
 # other proxmox crates
 pathpatterns = "0.3"
-proxmox-acme-rs = "0.4"
+proxmox-acme = "0.5"
 pxar = "0.10.2"
 
 # PBS workspace
@@ -227,7 +227,7 @@ proxmox-uuid.workspace = true
 
 # in their respective repo
 pathpatterns.workspace = true
-proxmox-acme-rs.workspace = true
+proxmox-acme.workspace = true
 pxar.workspace = true
 
 # proxmox-backup workspace/internal crates
@@ -271,7 +271,7 @@ proxmox-rrd.workspace = true
 #proxmox-time = { path = "../proxmox/proxmox-time" }
 #proxmox-uuid = { path = "../proxmox/proxmox-uuid" }
 
-#proxmox-acme-rs = { path = "../proxmox-acme-rs" }
+#proxmox-acme = { path = "../proxmox-acme" }
 #pathpatterns = {path = "../pathpatterns" }
 #pxar = { path = "../pxar" }
 
index 46566210cea83cde679f6973cb4a2c58653e4a9e..352384ea8995acfb194c5285d0a1ec62c360f696 100644 (file)
@@ -10,11 +10,11 @@ use hyper::{Body, Request};
 use nix::sys::stat::Mode;
 use serde::{Deserialize, Serialize};
 
-use proxmox_acme_rs::account::AccountCreator;
-use proxmox_acme_rs::account::AccountData as AcmeAccountData;
-use proxmox_acme_rs::order::{Order, OrderData};
-use proxmox_acme_rs::Request as AcmeRequest;
-use proxmox_acme_rs::{Account, Authorization, Challenge, Directory, Error, ErrorResponse};
+use proxmox_acme::account::AccountCreator;
+use proxmox_acme::account::AccountData as AcmeAccountData;
+use proxmox_acme::order::{Order, OrderData};
+use proxmox_acme::Request as AcmeRequest;
+use proxmox_acme::{Account, Authorization, Challenge, Directory, Error, ErrorResponse};
 use proxmox_http::client::Client;
 use proxmox_sys::fs::{replace_file, CreateOptions};
 
@@ -507,7 +507,7 @@ impl AcmeClient {
             .await
             .map_err(|err| Error::Custom(format!("failed to retrieve response body: {}", err)))?;
 
-        let got_nonce = if let Some(new_nonce) = parts.headers.get(proxmox_acme_rs::REPLAY_NONCE) {
+        let got_nonce = if let Some(new_nonce) = parts.headers.get(proxmox_acme::REPLAY_NONCE) {
             let new_nonce = new_nonce.to_str().map_err(|err| {
                 Error::Client(format!(
                     "received invalid replay-nonce header from ACME server: {}",
@@ -555,7 +555,7 @@ impl AcmeClient {
             ))
         })?;
 
-        if error.ty == proxmox_acme_rs::error::BAD_NONCE {
+        if error.ty == proxmox_acme::error::BAD_NONCE {
             if !got_nonce {
                 return Err(Error::InvalidApi(
                     "badNonce without a new Replay-Nonce header".to_string(),
index 5fe8993dc7a668cfea3052c92d7bfc383a9e077c..200cf9cc3b59ff62e363643590500e5e437526df 100644 (file)
@@ -9,7 +9,7 @@ use hyper::{Body, Request, Response};
 use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncWriteExt, BufReader};
 use tokio::process::Command;
 
-use proxmox_acme_rs::{Authorization, Challenge};
+use proxmox_acme::{Authorization, Challenge};
 
 use crate::acme::AcmeClient;
 use crate::api2::types::AcmeDomain;
index 1954318b7a89cc7a31fe8335fdaaf6856a8f3897..6fc8364df23431d3f9a2358b1e632c641b670e21 100644 (file)
@@ -16,8 +16,8 @@ use proxmox_router::{
 use proxmox_schema::{api, param_bail};
 use proxmox_sys::{task_log, task_warn};
 
-use proxmox_acme_rs::account::AccountData as AcmeAccountData;
-use proxmox_acme_rs::Account;
+use proxmox_acme::account::AccountData as AcmeAccountData;
+use proxmox_acme::Account;
 
 use pbs_api_types::{Authid, PRIV_SYS_MODIFY};
 
index d514001a467b9642b0f748e5c7038999b9dd009b..1ba46c0a8e64216c5d025e931583045bdfe9d695 100644 (file)
@@ -281,8 +281,8 @@ async fn order_certificate(
     worker: Arc<WorkerTask>,
     node_config: &NodeConfig,
 ) -> Result<Option<OrderedCertificate>, Error> {
-    use proxmox_acme_rs::authorization::Status;
-    use proxmox_acme_rs::order::Identifier;
+    use proxmox_acme::authorization::Status;
+    use proxmox_acme::order::Identifier;
 
     let domains = node_config.acme_domains().try_fold(
         Vec::<AcmeDomain>::new(),
@@ -378,12 +378,12 @@ async fn order_certificate(
     task_log!(worker, "All domains validated");
     task_log!(worker, "Creating CSR");
 
-    let csr = proxmox_acme_rs::util::Csr::generate(&identifiers, &Default::default())?;
+    let csr = proxmox_acme::util::Csr::generate(&identifiers, &Default::default())?;
     let mut finalize_error_cnt = 0u8;
     let order_url = &order.location;
     let mut order;
     loop {
-        use proxmox_acme_rs::order::Status;
+        use proxmox_acme::order::Status;
 
         order = acme.get_order(order_url).await?;
 
@@ -453,7 +453,7 @@ async fn request_validation(
     tokio::time::sleep(Duration::from_secs(5)).await;
 
     loop {
-        use proxmox_acme_rs::authorization::Status;
+        use proxmox_acme::authorization::Status;
 
         let auth = acme.get_authorization(auth_url).await?;
         match auth.status {