mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-10-27 08:30:13 +00:00
Send API cleanup: remove legacy endpoints and align access with upstream (#7806)
This commit is contained in:
1 parent
1c89e1772b
commit
f4f1a8e105
5 files changed
+32
-209
No files matched your search
@@ -32,7 +32,7 @@ use crate::{
|
||||
|
||||
use super::{
|
||||
ciphers::{CipherData, update_cipher_from_data},
|
||||
sends::{SendData, update_send_from_data},
|
||||
sends::SendData,
|
||||
};
|
||||
|
||||
pub fn routes() -> Vec<rocket::Route> {
|
||||
@@ -982,11 +982,13 @@ async fn post_rotatekey(data: Json<KeyData>, headers: Headers, conn: DbConn, nt:
|
||||
|
||||
// Update send data
|
||||
for send_data in data.account_data.sends {
|
||||
let Some(send) = existing_sends.iter_mut().find(|s| &s.uuid == send_data.id.as_ref().unwrap()) else {
|
||||
let Some(send) = send_data.id.as_ref().and_then(|id| existing_sends.iter_mut().find(|s| &s.uuid == id)) else {
|
||||
err!("Send doesn't exist")
|
||||
};
|
||||
|
||||
update_send_from_data(send, send_data, &headers, &conn, &nt, UpdateType::None).await?;
|
||||
// Like upstream, only the key changes on rotation
|
||||
send.akey = send_data.key;
|
||||
send.save(&conn).await?;
|
||||
}
|
||||
|
||||
// Update cipher data
|
||||
|
||||
Reference in new issue
Block a user