move basic ACME types into src/api2/types/acme.rs

And rename AccountName into AcmeAccountName.
This commit is contained in:
Dietmar Maurer
2021-05-04 11:29:27 +02:00
parent 603aa09d54
commit 39c5db7f0f
10 changed files with 168 additions and 149 deletions

View File

@ -17,7 +17,8 @@ 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 crate::config::acme::{account_path, AccountName};
use crate::api2::types::AcmeAccountName;
use crate::config::acme::account_path;
use crate::tools::http::SimpleHttp;
/// Our on-disk format inherited from PVE's proxmox-acme code.
@ -76,7 +77,7 @@ impl AcmeClient {
}
/// Load an existing ACME account by name.
pub async fn load(account_name: &AccountName) -> Result<Self, anyhow::Error> {
pub async fn load(account_name: &AcmeAccountName) -> Result<Self, anyhow::Error> {
Self::load_path(account_path(account_name.as_ref())).await
}
@ -98,7 +99,7 @@ impl AcmeClient {
pub async fn new_account<'a>(
&'a mut self,
account_name: &AccountName,
account_name: &AcmeAccountName,
tos_agreed: bool,
contact: Vec<String>,
rsa_bits: Option<u32>,

View File

@ -11,7 +11,7 @@ use tokio::process::Command;
use proxmox_acme_rs::{Authorization, Challenge};
use crate::acme::AcmeClient;
use crate::config::acme::AcmeDomain;
use crate::api2::types::AcmeDomain;
use crate::server::WorkerTask;
use crate::config::acme::plugin::{DnsPlugin, PluginData};