api: acme: rustfmt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b41f9e9fec
commit
875d53ef6c
@ -14,11 +14,11 @@ use proxmox_acme_rs::account::AccountData as AcmeAccountData;
|
|||||||
use proxmox_acme_rs::Account;
|
use proxmox_acme_rs::Account;
|
||||||
|
|
||||||
use crate::acme::AcmeClient;
|
use crate::acme::AcmeClient;
|
||||||
|
use crate::api2::types::{AcmeAccountName, Authid, KnownAcmeDirectory};
|
||||||
use crate::config::acl::PRIV_SYS_MODIFY;
|
use crate::config::acl::PRIV_SYS_MODIFY;
|
||||||
use crate::config::acme::plugin::{
|
use crate::config::acme::plugin::{
|
||||||
DnsPlugin, DnsPluginCore, DnsPluginCoreUpdater, PLUGIN_ID_SCHEMA,
|
DnsPlugin, DnsPluginCore, DnsPluginCoreUpdater, PLUGIN_ID_SCHEMA,
|
||||||
};
|
};
|
||||||
use crate::api2::types::{Authid, KnownAcmeDirectory, AcmeAccountName};
|
|
||||||
use crate::server::WorkerTask;
|
use crate::server::WorkerTask;
|
||||||
use crate::tools::ControlFlow;
|
use crate::tools::ControlFlow;
|
||||||
|
|
||||||
@ -194,8 +194,9 @@ fn register_account(
|
|||||||
) -> Result<String, Error> {
|
) -> Result<String, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
|
|
||||||
let name = name
|
let name = name.unwrap_or_else(|| unsafe {
|
||||||
.unwrap_or_else(|| unsafe { AcmeAccountName::from_string_unchecked("default".to_string()) });
|
AcmeAccountName::from_string_unchecked("default".to_string())
|
||||||
|
});
|
||||||
|
|
||||||
if Path::new(&crate::config::acme::account_path(&name)).exists() {
|
if Path::new(&crate::config::acme::account_path(&name)).exists() {
|
||||||
http_bail!(BAD_REQUEST, "account {} already exists", name);
|
http_bail!(BAD_REQUEST, "account {} already exists", name);
|
||||||
|
Loading…
Reference in New Issue
Block a user