remote: try to use Struct for api
with a catch: password is in the struct but we do not want it to return via the api, so we only 'serialize' it when the string is not empty (this can only happen when the format is not checked by us, iow. when its returned from the api) and setting it manually to "" when we return remotes from the api this way we can still use the type but do not return the password Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
bfa0146c00
commit
83fd4b3b1b
@ -59,6 +59,7 @@ pub struct Remote {
|
||||
pub comment: Option<String>,
|
||||
pub host: String,
|
||||
pub userid: String,
|
||||
#[serde(skip_serializing_if="String::is_empty")]
|
||||
pub password: String,
|
||||
#[serde(skip_serializing_if="Option::is_none")]
|
||||
pub fingerprint: Option<String>,
|
||||
|
Reference in New Issue
Block a user