Skip to content

Commit 66cf179

Browse files
authored
Updates and general fixes (#5762)
Updated all the crates to the latest version. We can unpin mimalloc, since the musl issues have been fixed Also fix a RUSTSEC https://osv.dev/vulnerability/RUSTSEC-2025-0023 for tokio Fixed some clippy lints reported by nightly. Ensure lints and are also run on the macro crate. This resulted in some lints being triggered, which I fixed. Updated some GHA uses. Signed-off-by: BlackDex <[email protected]>
1 parent 025bb90 commit 66cf179

File tree

8 files changed

+59
-73
lines changed

8 files changed

+59
-73
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/.github @dani-garcia @BlackDex
2+
/.github/** @dani-garcia @BlackDex
23
/.github/CODEOWNERS @dani-garcia @BlackDex
34
/.github/workflows/** @dani-garcia @BlackDex
5+
/SECURITY.md @dani-garcia @BlackDex

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -290,25 +290,25 @@ jobs:
290290
291291
# Upload artifacts to Github Actions and Attest the binaries
292292
- name: "Upload amd64 artifact ${{ matrix.base_image }}"
293-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
293+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
294294
with:
295295
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-amd64-${{ matrix.base_image }}
296296
path: vaultwarden-amd64-${{ matrix.base_image }}
297297

298298
- name: "Upload arm64 artifact ${{ matrix.base_image }}"
299-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
299+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
300300
with:
301301
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-arm64-${{ matrix.base_image }}
302302
path: vaultwarden-arm64-${{ matrix.base_image }}
303303

304304
- name: "Upload armv7 artifact ${{ matrix.base_image }}"
305-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
305+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
306306
with:
307307
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-armv7-${{ matrix.base_image }}
308308
path: vaultwarden-armv7-${{ matrix.base_image }}
309309

310310
- name: "Upload armv6 artifact ${{ matrix.base_image }}"
311-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4.6.1
311+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
312312
with:
313313
name: vaultwarden-${{ env.SOURCE_VERSION }}-linux-armv6-${{ matrix.base_image }}
314314
path: vaultwarden-armv6-${{ matrix.base_image }}

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
language: system
3232
args: ["--features", "sqlite,mysql,postgresql,enable_mimalloc", "--"]
3333
types_or: [rust, file]
34-
files: (Cargo.toml|Cargo.lock|rust-toolchain|.*\.rs$)
34+
files: (Cargo.toml|Cargo.lock|rust-toolchain.toml|rustfmt.toml|.*\.rs$)
3535
pass_filenames: false
3636
- id: cargo-clippy
3737
name: cargo clippy
@@ -40,11 +40,11 @@ repos:
4040
language: system
4141
args: ["--features", "sqlite,mysql,postgresql,enable_mimalloc", "--", "-D", "warnings"]
4242
types_or: [rust, file]
43-
files: (Cargo.toml|Cargo.lock|rust-toolchain|clippy.toml|.*\.rs$)
43+
files: (Cargo.toml|Cargo.lock|rust-toolchain.toml|rustfmt.toml|.*\.rs$)
4444
pass_filenames: false
4545
- id: check-docker-templates
4646
name: check docker templates
47-
desciption: Check if the Docker templates are updated
47+
description: Check if the Docker templates are updated
4848
language: system
4949
entry: sh
5050
args:

Cargo.lock

+28-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
workspace = { members = ["macros"] }
1+
[workspace]
2+
members = ["macros"]
23

34
[package]
45
name = "vaultwarden"
@@ -71,7 +72,7 @@ dashmap = "6.1.0"
7172

7273
# Async futures
7374
futures = "0.3.31"
74-
tokio = { version = "1.44.1", features = ["rt-multi-thread", "fs", "io-util", "parking_lot", "time", "signal", "net"] }
75+
tokio = { version = "1.44.2", features = ["rt-multi-thread", "fs", "io-util", "parking_lot", "time", "signal", "net"] }
7576

7677
# A generic serialization/deserialization framework
7778
serde = { version = "1.0.219", features = ["derive"] }
@@ -162,11 +163,9 @@ semver = "1.0.26"
162163

163164
# Allow overriding the default memory allocator
164165
# Mainly used for the musl builds, since the default musl malloc is very slow
165-
# Currently pinned to v0.1.44/v0.1.40 because of compile issues with musl - https://github.com/microsoft/mimalloc/issues/1056
166-
mimalloc = { version = "=0.1.44", features = ["secure"], default-features = false, optional = true }
167-
libmimalloc-sys = { version = "=0.1.40", optional = true }
166+
mimalloc = { version = "0.1.46", features = ["secure"], default-features = false, optional = true }
168167

169-
which = "7.0.2"
168+
which = "7.0.3"
170169

171170
# Argon2 library with support for the PHC format
172171
argon2 = "0.5.3"
@@ -217,7 +216,7 @@ codegen-units = 16
217216

218217
# Linting config
219218
# https://doc.rust-lang.org/rustc/lints/groups.html
220-
[lints.rust]
219+
[workspace.lints.rust]
221220
# Forbid
222221
unsafe_code = "forbid"
223222
non_ascii_idents = "forbid"
@@ -247,7 +246,7 @@ if_let_rescope = "allow"
247246
tail_expr_drop_order = "allow"
248247

249248
# https://rust-lang.github.io/rust-clippy/stable/index.html
250-
[lints.clippy]
249+
[workspace.lints.clippy]
251250
# Warn
252251
dbg_macro = "warn"
253252
todo = "warn"
@@ -285,3 +284,6 @@ unused_async = "deny"
285284
unused_self = "deny"
286285
verbose_file_reads = "deny"
287286
zero_sized_map_values = "deny"
287+
288+
[lints]
289+
workspace = true

macros/Cargo.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ path = "src/lib.rs"
99
proc-macro = true
1010

1111
[dependencies]
12-
quote = "1.0.38"
13-
syn = "2.0.98"
12+
quote = "1.0.40"
13+
syn = "2.0.100"
14+
15+
[lints]
16+
workspace = true

macros/src/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate proc_macro;
2-
31
use proc_macro::TokenStream;
42
use quote::quote;
53

@@ -12,7 +10,7 @@ pub fn derive_uuid_from_param(input: TokenStream) -> TokenStream {
1210

1311
fn impl_derive_uuid_macro(ast: &syn::DeriveInput) -> TokenStream {
1412
let name = &ast.ident;
15-
let gen = quote! {
13+
let gen_derive = quote! {
1614
#[automatically_derived]
1715
impl<'r> rocket::request::FromParam<'r> for #name {
1816
type Error = ();
@@ -27,7 +25,7 @@ fn impl_derive_uuid_macro(ast: &syn::DeriveInput) -> TokenStream {
2725
}
2826
}
2927
};
30-
gen.into()
28+
gen_derive.into()
3129
}
3230

3331
#[proc_macro_derive(IdFromParam)]
@@ -39,7 +37,7 @@ pub fn derive_id_from_param(input: TokenStream) -> TokenStream {
3937

4038
fn impl_derive_safestring_macro(ast: &syn::DeriveInput) -> TokenStream {
4139
let name = &ast.ident;
42-
let gen = quote! {
40+
let gen_derive = quote! {
4341
#[automatically_derived]
4442
impl<'r> rocket::request::FromParam<'r> for #name {
4543
type Error = ();
@@ -54,5 +52,5 @@ fn impl_derive_safestring_macro(ast: &syn::DeriveInput) -> TokenStream {
5452
}
5553
}
5654
};
57-
gen.into()
55+
gen_derive.into()
5856
}

src/api/notifications.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ impl WebSocketUsers {
495495
pub async fn send_auth_request(
496496
&self,
497497
user_id: &UserId,
498-
auth_request_uuid: &String,
498+
auth_request_uuid: &str,
499499
acting_device_id: &DeviceId,
500500
conn: &mut DbConn,
501501
) {
@@ -504,7 +504,7 @@ impl WebSocketUsers {
504504
return;
505505
}
506506
let data = create_update(
507-
vec![("Id".into(), auth_request_uuid.clone().into()), ("UserId".into(), user_id.to_string().into())],
507+
vec![("Id".into(), auth_request_uuid.to_owned().into()), ("UserId".into(), user_id.to_string().into())],
508508
UpdateType::AuthRequest,
509509
Some(acting_device_id.clone()),
510510
);
@@ -513,7 +513,7 @@ impl WebSocketUsers {
513513
}
514514

515515
if CONFIG.push_enabled() {
516-
push_auth_request(user_id.clone(), auth_request_uuid.to_string(), conn).await;
516+
push_auth_request(user_id.clone(), auth_request_uuid.to_owned(), conn).await;
517517
}
518518
}
519519

0 commit comments

Comments
 (0)