From 92fcc4c3cd6d826369253960684192656b6a7d69 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 6 Dec 2023 12:45:35 +0100 Subject: [PATCH] update to proxmox-acme 0.5 Signed-off-by: Wolfgang Bumiller --- Cargo.toml | 6 +++--- src/acme/client.rs | 14 +++++++------- src/acme/plugin.rs | 2 +- src/api2/config/acme.rs | 4 ++-- src/api2/node/certificates.rs | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 96c17f16b..7e8b95078 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/src/acme/client.rs b/src/acme/client.rs index 46566210c..352384ea8 100644 --- a/src/acme/client.rs +++ b/src/acme/client.rs @@ -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(), diff --git a/src/acme/plugin.rs b/src/acme/plugin.rs index 5fe8993dc..200cf9cc3 100644 --- a/src/acme/plugin.rs +++ b/src/acme/plugin.rs @@ -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; diff --git a/src/api2/config/acme.rs b/src/api2/config/acme.rs index 1954318b7..6fc8364df 100644 --- a/src/api2/config/acme.rs +++ b/src/api2/config/acme.rs @@ -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}; diff --git a/src/api2/node/certificates.rs b/src/api2/node/certificates.rs index d514001a4..1ba46c0a8 100644 --- a/src/api2/node/certificates.rs +++ b/src/api2/node/certificates.rs @@ -281,8 +281,8 @@ async fn order_certificate( worker: Arc, node_config: &NodeConfig, ) -> Result, 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::::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 {