drop pbs_tools::auth

`pbs_client::connect_to_localhost` now requires the key as
optional parameter

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2021-09-29 11:05:26 +02:00
parent 8cf445ecc4
commit 01a080215d
15 changed files with 57 additions and 58 deletions

View File

@ -1,26 +0,0 @@
//! Helpers for authentication used by both client and server.
use anyhow::Error;
use lazy_static::lazy_static;
use openssl::pkey::{PKey, Private};
use openssl::rsa::Rsa;
use proxmox::tools::fs::file_get_contents;
use pbs_buildcfg::configdir;
fn load_private_auth_key() -> Result<PKey<Private>, Error> {
let pem = file_get_contents(configdir!("/authkey.key"))?;
let rsa = Rsa::private_key_from_pem(&pem)?;
let key = PKey::from_rsa(rsa)?;
Ok(key)
}
pub fn private_auth_key() -> &'static PKey<Private> {
lazy_static! {
static ref KEY: PKey<Private> = load_private_auth_key().unwrap();
}
&KEY
}

View File

@ -1,5 +1,4 @@
pub mod acl;
pub mod auth;
pub mod blocking;
pub mod borrow;
pub mod broadcast_future;