Add support for archiving items#6916
Conversation
| #[put("/ciphers/archive", data = "<data>")] | ||
| async fn archive_cipher_selected( | ||
| data: Json<CipherIdsData>, | ||
| headers: Headers, | ||
| conn: DbConn, | ||
| nt: Notify<'_>, | ||
| ) -> JsonResult { | ||
| _set_archived_multiple_ciphers(data, &headers, true, &conn, &nt).await | ||
| } | ||
|
|
||
| #[put("/ciphers/<cipher_id>/unarchive")] | ||
| async fn unarchive_cipher_put(cipher_id: CipherId, headers: Headers, conn: DbConn, nt: Notify<'_>) -> JsonResult { | ||
| _set_archived_cipher_by_uuid(&cipher_id, &headers, false, false, &conn, &nt).await | ||
| } | ||
|
|
||
| #[put("/ciphers/unarchive", data = "<data>")] | ||
| async fn unarchive_cipher_selected( | ||
| data: Json<CipherIdsData>, | ||
| headers: Headers, | ||
| conn: DbConn, | ||
| nt: Notify<'_>, | ||
| ) -> JsonResult { | ||
| _set_archived_multiple_ciphers(data, &headers, false, &conn, &nt).await | ||
| } | ||
|
|
There was a problem hiding this comment.
Looks ok, but i would like to not use an _ as function prefix. I know we currently have this on several locations, but it's not really idomatic Rust since functions or variables starting with _ are normally used for functions or variables not really used, or need to be ignored during clippy lints.
src/config.rs
Outdated
| "anon-addy-self-host-alias", | ||
| "simple-login-self-host-alias", | ||
| "mutual-tls", | ||
| "pm-19148-innovation-archive", |
There was a problem hiding this comment.
@BlackDex I have not tested it (and I am not sure how stable this feature is yet) but could we not just enable this feature directly instead of adding a new feature flag that you have to opt in?
Also the feature flags we set have already been removed for a few releases, so they can be safely replaced in my opinion.
vaultwarden/src/api/core/mod.rs
Lines 208 to 212 in ba55191
There was a problem hiding this comment.
With it being included in the 2026.2.1 release announcement, I think it'd be stable enough to enable directly
There was a problem hiding this comment.
I have enabled the flag directly and removed some of the older flags (keeping email-verification and mobile-error-reporting).
@BlackDex Let me know if this needs further adjustments
|
I’m just wondering why we don’t simply add a field to the https://github.com/bitwarden/server/blob/main/src/Sql/dbo/Vault/Tables/Cipher.sql#L16 |
They originally did that, but later added the |
f5497c3 to
4bfc0b2
Compare
|
Refactored to properly support importing items that were archived |
Adds support for archiving items: #6372
I'm new to the codebase, so let me know if I have missed anything. Happy to apply any feedback you may have. Thank you!