diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f9f374c..2664540 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,3 +20,5 @@ updates: day: "monday" time: "06:00" timezone: "Europe/Berlin" + ignore: + - dependency-name: "dtolnay/rust-toolchain" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5244971..4b64ad4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v7 - name: Setup Rust toolchain - uses: dtolnay/rust-toolchain@1.120.0 + uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.platform.target }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6ac8662..dbb7314 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v7 - name: Setup Rust toolchain - uses: dtolnay/rust-toolchain@1.120.0 + uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy diff --git a/Cargo.lock b/Cargo.lock index 0a8ee6e..c7bb727 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1058,11 +1058,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5" dependencies = [ - "once_cell", + "cfg-if", + "futures-util", "wasm-bindgen", ] @@ -1204,9 +1205,9 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" +checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1" [[package]] name = "openssl-src" @@ -1541,9 +1542,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", @@ -1684,20 +1685,20 @@ dependencies = [ [[package]] name = "self-replace" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ec815b5eab420ab893f63393878d89c90fdd94c0bcc44c07abb8ad95552fb7" +checksum = "609c5606d9d357b26e4ee1a7a01beac396628d0fa01ebbade2a09cefb88e65af" dependencies = [ "fastrand", "tempfile", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "self_update" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9253f1675d280b3e348d63a03ad6af3fa32d515b0959406758342561655c4aa0" +checksum = "db894dc81dc2d26b41c4966e3e67ab2e0c21289912edd262012a07da9e4e0201" dependencies = [ "flate2", "http", @@ -1947,22 +1948,22 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -2259,7 +2260,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vault" -version = "1.0.29" +version = "1.0.30" dependencies = [ "anyhow", "assert_cmd", @@ -2327,9 +2328,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409" dependencies = [ "cfg-if", "once_cell", @@ -2340,23 +2341,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.64" +version = "0.4.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e" dependencies = [ - "cfg-if", - "futures-util", "js-sys", - "once_cell", + "tokio", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2364,31 +2362,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.91" +version = "0.3.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 9df68b5..c8a8403 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "vault" -version = "1.0.29" -authors = ["timglabisch "] +version = "1.0.30" +authors = ["Plattform Team "] edition = "2024" [dependencies] diff --git a/src/commands/get_multi.rs b/src/commands/get_multi.rs index 796e632..1bfa6c4 100644 --- a/src/commands/get_multi.rs +++ b/src/commands/get_multi.rs @@ -65,14 +65,14 @@ pub fn get_multi(input: &str, key_map: &KeyMap) -> Result<()> { Err(error) => { errors.push(format!( "could decode key {}. maybe it's not valid utf8?, error: {}", - &secret_key.secret, error + secret_key.secret, error )); } }; } Err(error) => errors.push(format!( "could not decrypt key {}, error: {}", - &secret_key.secret, error + secret_key.secret, error )), }; } @@ -94,7 +94,7 @@ pub fn get_multi(input: &str, key_map: &KeyMap) -> Result<()> { Err(error) => { errors.push(format!( "could decode template {}. error: {}", - &template.template, error + template.template, error )); } }; diff --git a/src/crypto.rs b/src/crypto.rs index e1a619d..5d0d3a3 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -101,7 +101,7 @@ impl Crypto { pub fn key_encrypt(public_key: &PublicKey, key: &[u8; KEY_SIZE]) -> Result> { let rsa = openssl::rsa::Rsa::public_key_from_pem(public_key.data()) - .with_context(|| format!("invalid public key {}", &public_key.name()))?; + .with_context(|| format!("invalid public key {}", public_key.name()))?; // Since this is a low level function, we can only encrypt data that is less than the // size of a signature minus the identifier marker of the padding (11 for PKCS1). @@ -122,7 +122,7 @@ impl Crypto { pub fn key_decrypt(private_key: &PrivateKey, encrypted_key: &[u8]) -> Result> { let rsa = Rsa::private_key_from_pem(private_key.data()) - .with_context(|| format!("invalid private key {}", &private_key.name()))?; + .with_context(|| format!("invalid private key {}", private_key.name()))?; // The maximal encrypted data can only be the size of the signature minus the identifier // marker of the padding (11 for PKCS1). The OpenSSL Rust crate currently doesn't properly diff --git a/src/key/key_map.rs b/src/key/key_map.rs index 356fca8..6a43541 100644 --- a/src/key/key_map.rs +++ b/src/key/key_map.rs @@ -160,7 +160,7 @@ impl KeyMap { { let secret_path = format!( "./.vault/secrets/{subscription}/{username}.crypt", - subscription = &raw_subscription, + subscription = raw_subscription, username = username ); @@ -193,7 +193,7 @@ impl KeyMap { lookup_paths.push(fs::read_dir(&config.path_private_key).with_context(|| { format!( "private key directory {path} is not readable", - path = &config.path_private_key + path = config.path_private_key ) })?); @@ -315,7 +315,7 @@ impl KeyMap { let decoded_config_file: ConfigToml = toml::from_str(&raw_config).map_err(|_| { anyhow!( "could not parse toml file {file}", - file = &config_file_path.display() + file = config_file_path.display() ) })?; diff --git a/src/rotate_key.rs b/src/rotate_key.rs index afcdea7..ddf106e 100644 --- a/src/rotate_key.rs +++ b/src/rotate_key.rs @@ -103,16 +103,16 @@ fn rename_user(username_from: &str, username_to: &str) -> Result<()> { if fs::metadata(&rename.to).is_ok() { return Err(anyhow!( "could not copy from {from} to {to}, file/dir already exists", - from = &rename.from, - to = &rename.to + from = rename.from, + to = rename.to )); } fs::rename(&rename.from, &rename.to).map_err(|error| { anyhow!( "could not copy from {from} to {to}, error: {error}", - from = &rename.from, - to = &rename.to, + from = rename.from, + to = rename.to, ) })?; }