mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-10 04:53:54 +00:00
* Password History Support (#155) * down.sql logic not required as per review comments
This commit is contained in:
parent
b82710eecf
commit
781056152a
5 changed files with 16 additions and 0 deletions
|
@ -32,6 +32,7 @@ pub struct Cipher {
|
|||
pub data: String,
|
||||
|
||||
pub favorite: bool,
|
||||
pub password_history: Option<String>,
|
||||
}
|
||||
|
||||
/// Local methods
|
||||
|
@ -55,6 +56,7 @@ impl Cipher {
|
|||
fields: None,
|
||||
|
||||
data: String::new(),
|
||||
password_history: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +79,10 @@ impl Cipher {
|
|||
let fields_json: JsonValue = if let Some(ref fields) = self.fields {
|
||||
serde_json::from_str(fields).unwrap()
|
||||
} else { JsonValue::Null };
|
||||
|
||||
let password_history_json: JsonValue = if let Some(ref password_history) = self.password_history {
|
||||
serde_json::from_str(password_history).unwrap()
|
||||
} else { JsonValue::Null };
|
||||
|
||||
let mut data_json: JsonValue = serde_json::from_str(&self.data).unwrap();
|
||||
|
||||
|
@ -108,6 +114,8 @@ impl Cipher {
|
|||
|
||||
"Object": "cipher",
|
||||
"Edit": true,
|
||||
|
||||
"PasswordHistory": password_history_json,
|
||||
});
|
||||
|
||||
let key = match self.type_ {
|
||||
|
|
|
@ -21,6 +21,7 @@ table! {
|
|||
fields -> Nullable<Text>,
|
||||
data -> Text,
|
||||
favorite -> Bool,
|
||||
password_history -> Nullable<Text>,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue