remote.cfg: rename userid to 'auth-id'
and fixup config file on upgrades accordingly Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
b57619ea29
commit
10052ea644
@ -78,7 +78,7 @@ pub fn list_remotes(
|
||||
optional: true,
|
||||
default: 8007,
|
||||
},
|
||||
userid: {
|
||||
"auth-id": {
|
||||
type: Authid,
|
||||
},
|
||||
password: {
|
||||
@ -178,7 +178,7 @@ pub enum DeletableProperty {
|
||||
type: u16,
|
||||
optional: true,
|
||||
},
|
||||
userid: {
|
||||
"auth-id": {
|
||||
optional: true,
|
||||
type: Authid,
|
||||
},
|
||||
@ -214,7 +214,7 @@ pub fn update_remote(
|
||||
comment: Option<String>,
|
||||
host: Option<String>,
|
||||
port: Option<u16>,
|
||||
userid: Option<Authid>,
|
||||
auth_id: Option<Authid>,
|
||||
password: Option<String>,
|
||||
fingerprint: Option<String>,
|
||||
delete: Option<Vec<DeletableProperty>>,
|
||||
@ -252,7 +252,7 @@ pub fn update_remote(
|
||||
}
|
||||
if let Some(host) = host { data.host = host; }
|
||||
if port.is_some() { data.port = port; }
|
||||
if let Some(userid) = userid { data.userid = userid; }
|
||||
if let Some(auth_id) = auth_id { data.auth_id = auth_id; }
|
||||
if let Some(password) = password { data.password = password; }
|
||||
|
||||
if let Some(fingerprint) = fingerprint { data.fingerprint = Some(fingerprint); }
|
||||
@ -323,7 +323,7 @@ pub async fn remote_client(remote: remote::Remote) -> Result<HttpClient, Error>
|
||||
let client = HttpClient::new(
|
||||
&remote.host,
|
||||
remote.port.unwrap_or(8007),
|
||||
&remote.userid,
|
||||
&remote.auth_id,
|
||||
options)?;
|
||||
let _auth_info = client.login() // make sure we can auth
|
||||
.await
|
||||
|
@ -50,7 +50,7 @@ pub async fn get_pull_parameters(
|
||||
let (remote_config, _digest) = remote::config()?;
|
||||
let remote: remote::Remote = remote_config.lookup("remote", remote)?;
|
||||
|
||||
let src_repo = BackupRepository::new(Some(remote.userid.clone()), Some(remote.host.clone()), remote.port, remote_store.to_string());
|
||||
let src_repo = BackupRepository::new(Some(remote.auth_id.clone()), Some(remote.host.clone()), remote.port, remote_store.to_string());
|
||||
|
||||
let client = crate::api2::config::remote::remote_client(remote).await?;
|
||||
|
||||
|
@ -44,7 +44,7 @@ pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth t
|
||||
description: "The (optional) port",
|
||||
type: u16,
|
||||
},
|
||||
userid: {
|
||||
"auth-id": {
|
||||
type: Authid,
|
||||
},
|
||||
password: {
|
||||
@ -57,6 +57,7 @@ pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth t
|
||||
}
|
||||
)]
|
||||
#[derive(Serialize,Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
/// Remote properties.
|
||||
pub struct Remote {
|
||||
pub name: String,
|
||||
@ -65,7 +66,7 @@ pub struct Remote {
|
||||
pub host: String,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
pub port: Option<u16>,
|
||||
pub userid: Authid,
|
||||
pub auth_id: Authid,
|
||||
#[serde(skip_serializing_if="String::is_empty")]
|
||||
#[serde(with = "proxmox::tools::serde::string_as_base64")]
|
||||
pub password: String,
|
||||
|
Reference in New Issue
Block a user