From 97116b1151a8942f640a264fa1c1c4a37512a482 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 11 Oct 2024 14:28:28 +0200 Subject: [PATCH 01/18] Pin WASM bindgen (#1129) Every time wasm-bindgen is updated we run into conflicts with the wasm-bindgen-cli version. Pin it to avoid this problem in the future. --- .github/workflows/build-wasm-internal.yml | 2 +- .github/workflows/build-wasm.yml | 2 +- Cargo.lock | 20 ++++++++++---------- crates/bitwarden-wasm-internal/Cargo.toml | 3 ++- crates/bitwarden-wasm/Cargo.toml | 3 ++- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 99fe06c4..0be6b29c 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -46,7 +46,7 @@ jobs: key: wasm-cargo-cache - name: Install wasm-bindgen-cli - run: cargo install wasm-bindgen-cli + run: cargo install wasm-bindgen-cli --version 0.2.95 - name: Build run: ./build.sh -r diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 35c0ca6b..117bbf2c 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -46,7 +46,7 @@ jobs: key: wasm-cargo-cache - name: Install wasm-bindgen-cli - run: cargo install wasm-bindgen-cli + run: cargo install wasm-bindgen-cli --version 0.2.95 - name: Build run: ./build.sh -r diff --git a/Cargo.lock b/Cargo.lock index 024abbe0..e6ca566f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4503,9 +4503,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef073ced962d62984fb38a36e5fdc1a2b23c9e0e1fa0689bb97afa4202ef6887" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4516,9 +4516,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4bfab14ef75323f4eb75fa52ee0a3fb59611977fd3240da19b2cf36ff85030e" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -4543,9 +4543,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7bec9830f60924d9ceb3ef99d55c155be8afa76954edffbb5936ff4509474e7" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4553,9 +4553,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c74f6e152a76a2ad448e223b0fc0b6b5747649c3d769cc6bf45737bf97d0ed6" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -4566,9 +4566,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.94" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42f6c679374623f295a8623adfe63d9284091245c3504bde47c17a3ce2777d9" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-bindgen-test" diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index 4f68c08d..b18e412c 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -21,7 +21,8 @@ console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" log = "0.4.20" serde_json = ">=1.0.96, <2.0" -wasm-bindgen = { version = "0.2.91", features = ["serde-serialize"] } +# When upgrading wasm-bindgen, make sure to update the version in the workflows! +wasm-bindgen = { version = "=0.2.95", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4.41" [lints] diff --git a/crates/bitwarden-wasm/Cargo.toml b/crates/bitwarden-wasm/Cargo.toml index fd3c278f..b57a0192 100644 --- a/crates/bitwarden-wasm/Cargo.toml +++ b/crates/bitwarden-wasm/Cargo.toml @@ -25,7 +25,8 @@ console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" log = "0.4.20" serde = { version = "1.0.196", features = ["derive"] } -wasm-bindgen = { version = "0.2.91", features = ["serde-serialize"] } +# When upgrading wasm-bindgen, make sure to update the version in the workflows! +wasm-bindgen = { version = "=0.2.95", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4.41" [dev-dependencies] From 43e5ae9165732ffb0b79a9fa6b9866b679d881f0 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 11 Oct 2024 15:32:44 +0200 Subject: [PATCH 02/18] Remove direct dependency to bitwarden in wasm-internal (#1131) In preparation for the bitwarden crate being removes we can stop depending on it in wasm-internal. --- Cargo.lock | 2 +- crates/bitwarden-wasm-internal/Cargo.toml | 2 +- crates/bitwarden-wasm-internal/src/client.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6ca566f..9f8552b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -681,7 +681,7 @@ dependencies = [ name = "bitwarden-wasm-internal" version = "0.1.0" dependencies = [ - "bitwarden", + "bitwarden-core", "console_error_panic_hook", "console_log", "js-sys", diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index b18e412c..e943daca 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -15,7 +15,7 @@ keywords.workspace = true crate-type = ["cdylib"] [dependencies] -bitwarden = { workspace = true, features = ["wasm"] } +bitwarden-core = { workspace = true, features = ["wasm", "internal"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 994af1fc..8f2fa80d 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -1,7 +1,7 @@ extern crate console_error_panic_hook; use std::rc::Rc; -use bitwarden::{Client, ClientSettings}; +use bitwarden_core::{Client, ClientSettings}; use log::{set_max_level, Level}; use wasm_bindgen::prelude::*; From 639667c81f4ffef96f6c4bf40aa25bbb4349a990 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:38:29 +0200 Subject: [PATCH 03/18] [deps]: Lock file maintenance (#1139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week of the year before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). đŸšĻ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. â™ģ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. đŸ‘ģ **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bitwarden/sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 52 +++++++++++++++++++++++------------------------ package-lock.json | 6 +++--- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f8552b6..678c86e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -784,9 +784,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -855,9 +855,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "shlex", ] @@ -2210,9 +2210,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.71" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cb94a0ffd3f3ee755c20f7d8752f45cac88605a4dcf808abcff72873296ec7b" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2383,9 +2383,9 @@ dependencies = [ [[package]] name = "napi" -version = "2.16.11" +version = "2.16.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53575dfa17f208dd1ce3a2da2da4659aae393b256a472f2738a8586a6c4107fd" +checksum = "3a84fdaf64da2b2d86b1be5db1b81963353bf00f7bef4b9e2668bbe6f72e8eb3" dependencies = [ "bitflags 2.6.0", "ctor", @@ -2917,9 +2917,9 @@ source = "git+https://github.com/bitwarden/passkey-rs?rev=ff757604cd7b4e8f321ed1 [[package]] name = "pyo3" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ee168e30649f7f234c3d49ef5a7a6cbf5134289bc46c29ff3155fa3221c225" +checksum = "00e89ce2565d6044ca31a3eb79a334c3a79a841120a98f64eea9f579564cb691" dependencies = [ "cfg-if", "indoc", @@ -2935,9 +2935,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61cef80755fe9e46bb8a0b8f20752ca7676dcc07a5277d8b7768c6172e529b3" +checksum = "d8afbaf3abd7325e08f35ffb8deb5892046fcb2608b703db6a583a5ba4cea01e" dependencies = [ "once_cell", "target-lexicon", @@ -2945,9 +2945,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce096073ec5405f5ee2b8b31f03a68e02aa10d5d4f565eca04acc41931fa1c" +checksum = "ec15a5ba277339d04763f4c23d85987a5b08cbb494860be141e6a10a8eb88022" dependencies = [ "libc", "pyo3-build-config", @@ -2966,9 +2966,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2440c6d12bc8f3ae39f1e775266fa5122fd0c8891ce7520fa6048e683ad3de28" +checksum = "15e0f01b5364bcfbb686a52fc4181d412b708a68ed20c330db9fc8d2c2bf5a43" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -2978,9 +2978,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be962f0e06da8f8465729ea2cb71a416d2257dff56cbe40a70d3e62a93ae5d1" +checksum = "a09b550200e1e5ed9176976d0060cbc2ea82dc8515da07885e7b8153a85caacb" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4531,9 +4531,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65471f79c1022ffa5291d33520cbbb53b7687b01c2f8e83b57d102eed7ed479d" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4572,9 +4572,9 @@ checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-bindgen-test" -version = "0.3.44" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93d2a9ae98f1af8953f6415397299d808cce0a24f6d7c613d27bd83edf98da8" +checksum = "d381749acb0943d357dcbd8f0b100640679883fcdeeef04def49daf8d33a5426" dependencies = [ "console_error_panic_hook", "js-sys", @@ -4587,9 +4587,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.44" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8b294691f640bad8f2bb35a11bb28272701b1d687bd5fd661a27684e894d4d" +checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" dependencies = [ "proc-macro2", "quote", @@ -4598,9 +4598,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.71" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44188d185b5bdcae1052d08bcbcf9091a5524038d4572cc4f4f2bb9d5554ddd9" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/package-lock.json b/package-lock.json index 894ec74e..e41dd2a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2292,9 +2292,9 @@ } }, "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", + "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", "dev": true, "license": "ISC", "bin": { From a0f45304563e6c02471012801f5a9bd7f70c1f2c Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 14 Oct 2024 14:44:31 +0200 Subject: [PATCH 04/18] [PM-11764] Implement account switching and sdk initialization (#1116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking ## 📔 Objective - Expose crypto client - Add error handling ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- Cargo.lock | 6 ++++ crates/bitwarden-core/src/mobile/crypto.rs | 6 ++++ crates/bitwarden-crypto/Cargo.toml | 3 ++ .../src/enc_string/asymmetric.rs | 7 +++- .../src/enc_string/symmetric.rs | 6 ++++ .../bitwarden-crypto/src/keys/master_key.rs | 3 ++ crates/bitwarden-vault/Cargo.toml | 3 ++ crates/bitwarden-vault/src/folder.rs | 4 +++ crates/bitwarden-wasm-internal/Cargo.toml | 2 ++ crates/bitwarden-wasm-internal/src/client.rs | 12 ++++++- crates/bitwarden-wasm-internal/src/crypto.rs | 33 +++++++++++++++++++ .../src/custom_types.rs | 22 +++++++++++++ crates/bitwarden-wasm-internal/src/error.js | 13 ++++++++ crates/bitwarden-wasm-internal/src/error.rs | 27 +++++++++++++++ crates/bitwarden-wasm-internal/src/lib.rs | 8 +++++ .../src/vault/folders.rs | 24 ++++++++++++++ .../bitwarden-wasm-internal/src/vault/mod.rs | 24 ++++++++++++++ languages/js/sdk-internal/.gitignore | 1 + 18 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 crates/bitwarden-wasm-internal/src/crypto.rs create mode 100644 crates/bitwarden-wasm-internal/src/custom_types.rs create mode 100644 crates/bitwarden-wasm-internal/src/error.js create mode 100644 crates/bitwarden-wasm-internal/src/error.rs create mode 100644 crates/bitwarden-wasm-internal/src/vault/folders.rs create mode 100644 crates/bitwarden-wasm-internal/src/vault/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 678c86e5..e9b7646b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -475,8 +475,10 @@ dependencies = [ "sha2", "subtle", "thiserror", + "tsify-next", "uniffi", "uuid", + "wasm-bindgen", "zeroize", ] @@ -656,8 +658,10 @@ dependencies = [ "sha2", "thiserror", "tokio", + "tsify-next", "uniffi", "uuid", + "wasm-bindgen", ] [[package]] @@ -682,6 +686,8 @@ name = "bitwarden-wasm-internal" version = "0.1.0" dependencies = [ "bitwarden-core", + "bitwarden-crypto", + "bitwarden-vault", "console_error_panic_hook", "console_log", "js-sys", diff --git a/crates/bitwarden-core/src/mobile/crypto.rs b/crates/bitwarden-core/src/mobile/crypto.rs index 2aae903c..1b027df4 100644 --- a/crates/bitwarden-core/src/mobile/crypto.rs +++ b/crates/bitwarden-core/src/mobile/crypto.rs @@ -6,6 +6,8 @@ use bitwarden_crypto::{ }; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +#[cfg(feature = "wasm")] +use {tsify_next::Tsify, wasm_bindgen::prelude::*}; use crate::{ client::{encryption_settings::EncryptionSettingsError, LoginMethod, UserLoginMethod}, @@ -16,6 +18,7 @@ use crate::{ #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct InitUserCryptoRequest { /// The user's KDF parameters, as received from the prelogin request pub kdf_params: Kdf, @@ -30,6 +33,7 @@ pub struct InitUserCryptoRequest { #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub enum InitUserCryptoMethod { Password { /// The user's master password @@ -73,6 +77,7 @@ pub enum InitUserCryptoMethod { #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub enum AuthRequestMethod { UserKey { /// User Key protected by the private key provided in `AuthRequestResponse`. @@ -185,6 +190,7 @@ pub async fn initialize_user_crypto( #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct InitOrgCryptoRequest { /// The encryption keys for all the organizations the user is a part of pub organization_keys: HashMap, diff --git a/crates/bitwarden-crypto/Cargo.toml b/crates/bitwarden-crypto/Cargo.toml index 3254640f..7671a776 100644 --- a/crates/bitwarden-crypto/Cargo.toml +++ b/crates/bitwarden-crypto/Cargo.toml @@ -15,6 +15,7 @@ keywords.workspace = true [features] default = [] +wasm = ["dep:tsify-next", "dep:wasm-bindgen"] # WASM support uniffi = ["dep:uniffi"] # Uniffi bindings no-memory-hardening = [] # Disable memory hardening features @@ -42,8 +43,10 @@ sha1 = ">=0.10.5, <0.11" sha2 = ">=0.10.6, <0.11" subtle = ">=2.5.0, <3.0" thiserror = { workspace = true } +tsify-next = { workspace = true, optional = true } uniffi = { workspace = true, optional = true } uuid = { workspace = true } +wasm-bindgen = { workspace = true, optional = true } zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] } [dev-dependencies] diff --git a/crates/bitwarden-crypto/src/enc_string/asymmetric.rs b/crates/bitwarden-crypto/src/enc_string/asymmetric.rs index f9bda838..9d4f0d63 100644 --- a/crates/bitwarden-crypto/src/enc_string/asymmetric.rs +++ b/crates/bitwarden-crypto/src/enc_string/asymmetric.rs @@ -11,11 +11,16 @@ use crate::{ rsa::encrypt_rsa2048_oaep_sha1, AsymmetricCryptoKey, AsymmetricEncryptable, KeyDecryptable, }; - // This module is a workaround to avoid deprecated warnings that come from the ZeroizeOnDrop // macro expansion #[allow(deprecated)] mod internal { + #[cfg(feature = "wasm")] + #[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] + const TS_CUSTOM_TYPES: &'static str = r#" + export type AsymmetricEncString = string; + "#; + /// # Encrypted string primitive /// /// [AsymmetricEncString] is a Bitwarden specific primitive that represents an asymmetrically diff --git a/crates/bitwarden-crypto/src/enc_string/symmetric.rs b/crates/bitwarden-crypto/src/enc_string/symmetric.rs index 1fc9b3a9..69711f74 100644 --- a/crates/bitwarden-crypto/src/enc_string/symmetric.rs +++ b/crates/bitwarden-crypto/src/enc_string/symmetric.rs @@ -11,6 +11,12 @@ use crate::{ KeyDecryptable, KeyEncryptable, LocateKey, SymmetricCryptoKey, }; +#[cfg(feature = "wasm")] +#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] +const TS_CUSTOM_TYPES: &'static str = r#" +export type EncString = string; +"#; + /// # Encrypted string primitive /// /// [EncString] is a Bitwarden specific primitive that represents a symmetrically encrypted string. diff --git a/crates/bitwarden-crypto/src/keys/master_key.rs b/crates/bitwarden-crypto/src/keys/master_key.rs index fc9762c3..7a1e4959 100644 --- a/crates/bitwarden-crypto/src/keys/master_key.rs +++ b/crates/bitwarden-crypto/src/keys/master_key.rs @@ -5,6 +5,8 @@ use generic_array::{typenum::U32, GenericArray}; use rand::Rng; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +#[cfg(feature = "wasm")] +use {tsify_next::Tsify, wasm_bindgen::prelude::*}; use super::utils::{derive_kdf_key, stretch_kdf_key}; use crate::{util, CryptoError, EncString, KeyDecryptable, Result, SymmetricCryptoKey, UserKey}; @@ -16,6 +18,7 @@ use crate::{util, CryptoError, EncString, KeyDecryptable, Result, SymmetricCrypt #[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub enum Kdf { PBKDF2 { iterations: NonZeroU32, diff --git a/crates/bitwarden-vault/Cargo.toml b/crates/bitwarden-vault/Cargo.toml index 4c41e139..3c7757e2 100644 --- a/crates/bitwarden-vault/Cargo.toml +++ b/crates/bitwarden-vault/Cargo.toml @@ -19,6 +19,7 @@ uniffi = [ "bitwarden-crypto/uniffi", "dep:uniffi", ] # Uniffi bindings +wasm = ["dep:tsify-next", "dep:wasm-bindgen"] # WASM support [dependencies] base64 = ">=0.22.1, <0.23" @@ -38,6 +39,8 @@ sha2 = ">=0.10.6, <0.11" thiserror = { workspace = true } uniffi = { version = "=0.28.1", optional = true } uuid = { workspace = true } +tsify-next = { workspace = true, optional = true } +wasm-bindgen = { workspace = true, optional = true } [dev-dependencies] tokio = { workspace = true, features = ["rt"] } diff --git a/crates/bitwarden-vault/src/folder.rs b/crates/bitwarden-vault/src/folder.rs index c5ab1401..f57b8ee1 100644 --- a/crates/bitwarden-vault/src/folder.rs +++ b/crates/bitwarden-vault/src/folder.rs @@ -7,12 +7,15 @@ use chrono::{DateTime, Utc}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use uuid::Uuid; +#[cfg(feature = "wasm")] +use {tsify_next::Tsify, wasm_bindgen::prelude::*}; use crate::VaultParseError; #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct Folder { id: Option, name: EncString, @@ -22,6 +25,7 @@ pub struct Folder { #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase")] #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))] pub struct FolderView { pub id: Option, pub name: String, diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index e943daca..33f8128e 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -16,6 +16,8 @@ crate-type = ["cdylib"] [dependencies] bitwarden-core = { workspace = true, features = ["wasm", "internal"] } +bitwarden-crypto = { workspace = true, features = ["wasm"] } +bitwarden-vault = { workspace = true, features = ["wasm"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68" diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 8f2fa80d..ac7779b2 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -5,6 +5,8 @@ use bitwarden_core::{Client, ClientSettings}; use log::{set_max_level, Level}; use wasm_bindgen::prelude::*; +use crate::{vault::ClientVault, ClientCrypto}; + #[wasm_bindgen] pub enum LogLevel { Trace, @@ -27,7 +29,7 @@ fn convert_level(level: LogLevel) -> Level { // Rc<...> is to avoid needing to take ownership of the Client during our async run_command // function https://github.com/rustwasm/wasm-bindgen/issues/2195#issuecomment-799588401 #[wasm_bindgen] -pub struct BitwardenClient(Rc); +pub struct BitwardenClient(pub(crate) Rc); #[wasm_bindgen] impl BitwardenClient { @@ -54,4 +56,12 @@ impl BitwardenClient { res.text().await.map_err(|e| e.to_string()) } + + pub fn crypto(&self) -> ClientCrypto { + ClientCrypto::new(self.0.clone()) + } + + pub fn vault(&self) -> ClientVault { + ClientVault::new(self.0.clone()) + } } diff --git a/crates/bitwarden-wasm-internal/src/crypto.rs b/crates/bitwarden-wasm-internal/src/crypto.rs new file mode 100644 index 00000000..f1b58196 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/crypto.rs @@ -0,0 +1,33 @@ +use std::rc::Rc; + +use bitwarden_core::{ + mobile::crypto::{InitOrgCryptoRequest, InitUserCryptoRequest}, + Client, +}; +use wasm_bindgen::prelude::*; + +use crate::error::Result; + +#[wasm_bindgen] +pub struct ClientCrypto(Rc); + +impl ClientCrypto { + pub fn new(client: Rc) -> Self { + Self(client) + } +} + +#[wasm_bindgen] +impl ClientCrypto { + /// Initialization method for the user crypto. Needs to be called before any other crypto + /// operations. + pub async fn initialize_user_crypto(&self, req: InitUserCryptoRequest) -> Result<()> { + Ok(self.0.crypto().initialize_user_crypto(req).await?) + } + + /// Initialization method for the organization crypto. Needs to be called after + /// `initialize_user_crypto` but before any other crypto operations. + pub async fn initialize_org_crypto(&self, req: InitOrgCryptoRequest) -> Result<()> { + Ok(self.0.crypto().initialize_org_crypto(req).await?) + } +} diff --git a/crates/bitwarden-wasm-internal/src/custom_types.rs b/crates/bitwarden-wasm-internal/src/custom_types.rs new file mode 100644 index 00000000..8d20bf85 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/custom_types.rs @@ -0,0 +1,22 @@ +/// This file contains custom TypeScript for types defined by external crates. +/// Everything in the string below is appended to the generated TypeScript definition file. +#[wasm_bindgen::prelude::wasm_bindgen(typescript_custom_section)] +const TS_CUSTOM_TYPES: &'static str = r#" +export type Uuid = string; + +/** + * RFC3339 compliant date-time string. + * @typeParam T - Not used in JavaScript. + */ +export type DateTime = string; + +/** + * UTC date-time string. Not used in JavaScript. + */ +export type Utc = unknown; + +/** + * An integer that is known not to equal zero. + */ +export type NonZeroU32 = number; +"#; diff --git a/crates/bitwarden-wasm-internal/src/error.js b/crates/bitwarden-wasm-internal/src/error.js new file mode 100644 index 00000000..cd3d3a34 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/error.js @@ -0,0 +1,13 @@ +/** + * Error thrown by the WASM module. + * @param {string} message - Error message. + * @extends Error + */ +class WasmError extends Error { + constructor(message) { + super(message); + this.name = "WasmError"; + } +} + +exports.WasmError = WasmError; diff --git a/crates/bitwarden-wasm-internal/src/error.rs b/crates/bitwarden-wasm-internal/src/error.rs new file mode 100644 index 00000000..2750d262 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/error.rs @@ -0,0 +1,27 @@ +use wasm_bindgen::prelude::*; + +// Importing an error class defined in JavaScript instead of defining it in Rust +// allows us to extend the `Error` class. It also provides much better console output. +#[wasm_bindgen(module = "/src/error.js")] +extern "C" { + type WasmError; + + #[wasm_bindgen(constructor)] + fn new(message: String) -> WasmError; +} + +pub type Result = std::result::Result; + +pub struct GenericError(pub String); + +impl From for GenericError { + fn from(error: T) -> Self { + GenericError(error.to_string()) + } +} + +impl From for JsValue { + fn from(error: GenericError) -> Self { + WasmError::new(error.0).into() + } +} diff --git a/crates/bitwarden-wasm-internal/src/lib.rs b/crates/bitwarden-wasm-internal/src/lib.rs index b79c47fc..6367ff31 100644 --- a/crates/bitwarden-wasm-internal/src/lib.rs +++ b/crates/bitwarden-wasm-internal/src/lib.rs @@ -1 +1,9 @@ mod client; +mod crypto; +mod custom_types; +mod error; +mod vault; + +pub use client::BitwardenClient; +pub use crypto::ClientCrypto; +pub use vault::{folders::ClientFolders, ClientVault}; diff --git a/crates/bitwarden-wasm-internal/src/vault/folders.rs b/crates/bitwarden-wasm-internal/src/vault/folders.rs new file mode 100644 index 00000000..65289269 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/vault/folders.rs @@ -0,0 +1,24 @@ +use std::rc::Rc; + +use bitwarden_core::Client; +use bitwarden_vault::{ClientVaultExt, Folder, FolderView}; +use wasm_bindgen::prelude::*; + +use crate::error::Result; + +#[wasm_bindgen] +pub struct ClientFolders(Rc); + +impl ClientFolders { + pub fn new(client: Rc) -> Self { + Self(client) + } +} + +#[wasm_bindgen] +impl ClientFolders { + /// Decrypt folder + pub fn decrypt(&self, folder: Folder) -> Result { + Ok(self.0.vault().folders().decrypt(folder)?) + } +} diff --git a/crates/bitwarden-wasm-internal/src/vault/mod.rs b/crates/bitwarden-wasm-internal/src/vault/mod.rs new file mode 100644 index 00000000..11db0e13 --- /dev/null +++ b/crates/bitwarden-wasm-internal/src/vault/mod.rs @@ -0,0 +1,24 @@ +pub mod folders; + +use std::rc::Rc; + +use bitwarden_core::Client; +use wasm_bindgen::prelude::*; + +use crate::ClientFolders; + +#[wasm_bindgen] +pub struct ClientVault(Rc); + +impl ClientVault { + pub fn new(client: Rc) -> Self { + Self(client) + } +} + +#[wasm_bindgen] +impl ClientVault { + pub fn folders(&self) -> ClientFolders { + ClientFolders::new(self.0.clone()) + } +} diff --git a/languages/js/sdk-internal/.gitignore b/languages/js/sdk-internal/.gitignore index ef69b9de..99cddcd2 100644 --- a/languages/js/sdk-internal/.gitignore +++ b/languages/js/sdk-internal/.gitignore @@ -1,3 +1,4 @@ +**/snippets/**/*.js bitwarden_wasm_internal_bg.js bitwarden_wasm_internal_bg.wasm bitwarden_wasm_internal_bg.wasm.d.ts From d094901a8badd3f84e1173440839c58639c3bbe6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:37:12 +0200 Subject: [PATCH 05/18] [deps]: Update @openapitools/openapi-generator-cli to v2.14.0 (#1007) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@openapitools/openapi-generator-cli](https://redirect.github.com/OpenAPITools/openapi-generator-cli) | [`2.13.4` -> `2.14.0`](https://renovatebot.com/diffs/npm/@openapitools%2fopenapi-generator-cli/2.13.4/2.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@openapitools%2fopenapi-generator-cli/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@openapitools%2fopenapi-generator-cli/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@openapitools%2fopenapi-generator-cli/2.13.4/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@openapitools%2fopenapi-generator-cli/2.13.4/2.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
OpenAPITools/openapi-generator-cli (@​openapitools/openapi-generator-cli) ### [`v2.14.0`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.14.0) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.13...v2.14.0) ##### Features - **config schema:** add openapi-normalizer generator property ([#​830](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/830)) ([c91d116](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/c91d116a1fe4b8ed9270c4546447173b0af1e6ab)) ### [`v2.13.13`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.13) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.12...v2.13.13) ##### Bug Fixes - update `glob` package ([#​828](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/828)) ([4d88fe2](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/4d88fe2c1c9c23097b197cbb1161fcf827a81770)) ### [`v2.13.12`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.12) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.11...v2.13.12) ##### Bug Fixes - **deps:** update dependency axios to v1.7.7 ([#​817](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/817)) ([f5b3ede](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/f5b3eded0a6b7b4a5761deb6dec6287fb670d014)) ### [`v2.13.11`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.11) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.10...v2.13.11) ##### Bug Fixes - **deps:** update dependency tslib to v2.7.0 ([#​810](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/810)) ([d800f75](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/d800f75d9b4c77f78e8f3e7cf082ed3f36add0bd)) ### [`v2.13.10`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.10) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.9...v2.13.10) ##### Bug Fixes - **deps:** update dependency https-proxy-agent to v7.0.5 ([#​800](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/800)) ([e8226d8](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/e8226d8e2f92da5649e5e679dcd155f69464205c)) ### [`v2.13.9`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.9) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.8...v2.13.9) ##### Bug Fixes - **[#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802):** better error handling ([#​812](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/812)) ([1879a1e](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/1879a1eda21a7757ce0eab748d381d985e52d792)), closes [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) ### [`v2.13.8`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.8) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.7...v2.13.8) ##### Bug Fixes - **[#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802):** add fallback to default versions if search returns errors ([#​811](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/811)) ([129c002](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/129c00259d9f842f42b1772cc6baf1eef73ac797)), closes [#​802](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/802) ### [`v2.13.7`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.7) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.6...v2.13.7) ##### Bug Fixes - **deps:** update nest dependencies to v10.4.2 ([#​801](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/801)) ([fff1d32](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/fff1d32a1f313781fe17eedf3d21d4052d8b09e9)) ### [`v2.13.6`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.6) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.5...v2.13.6) ##### Bug Fixes - **deps:** update dependency [@​nestjs/axios](https://redirect.github.com/nestjs/axios) to v3.0.3 ([#​799](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/799)) ([868d55e](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/868d55eb989111296a068d1c521e45f5a13889b0)) ### [`v2.13.5`](https://redirect.github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.5) [Compare Source](https://redirect.github.com/OpenAPITools/openapi-generator-cli/compare/v2.13.4...v2.13.5) ##### Bug Fixes - **deps:** update dependency axios to v1.7.4 \[security] ([#​789](https://redirect.github.com/OpenAPITools/openapi-generator-cli/issues/789)) ([18abce4](https://redirect.github.com/OpenAPITools/openapi-generator-cli/commit/18abce41f5fac12e574977e175adf32a42f8b5a6))
--- ### Configuration 📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week of the year before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). đŸšĻ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. â™ģ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bitwarden/sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 215 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 102 insertions(+), 115 deletions(-) diff --git a/package-lock.json b/package-lock.json index e41dd2a8..bdf9b485 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "license": "SEE LICENSE IN LICENSE", "devDependencies": { - "@openapitools/openapi-generator-cli": "2.13.4", + "@openapitools/openapi-generator-cli": "2.14.0", "prettier": "3.3.3", "quicktype-core": "23.0.170", "rimraf": "6.0.1", @@ -192,9 +192,9 @@ } }, "node_modules/@nestjs/axios": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", - "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.3.tgz", + "integrity": "sha512-h6TCn3yJwD6OKqqqfmtRS5Zo4E46Ip2n+gK1sqwzNBC+qxQ9xpCu+ODVRFur6V3alHSCSBxb3nNtt73VEdluyA==", "dev": true, "license": "MIT", "peerDependencies": { @@ -204,14 +204,14 @@ } }, "node_modules/@nestjs/common": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", - "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.3.tgz", + "integrity": "sha512-4hbLd3XIJubHSylYd/1WSi4VQvG68KM/ECYpMDqA3k3J1/T17SAg40sDoq3ZoO5OZgU0xuNyjuISdOTjs11qVg==", "dev": true, "license": "MIT", "dependencies": { "iterare": "1.2.1", - "tslib": "2.6.2", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -221,7 +221,7 @@ "peerDependencies": { "class-transformer": "*", "class-validator": "*", - "reflect-metadata": "^0.1.12", + "reflect-metadata": "^0.1.12 || ^0.2.0", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -234,9 +234,9 @@ } }, "node_modules/@nestjs/core": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz", - "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.3.tgz", + "integrity": "sha512-6OQz+5C8mT8yRtfvE5pPCq+p6w5jDot+oQku1KzQ24ABn+lay1KGuJwcKZhdVNuselx+8xhdMxknZTA8wrGLIg==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -244,8 +244,8 @@ "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", "iterare": "1.2.1", - "path-to-regexp": "3.2.0", - "tslib": "2.6.2", + "path-to-regexp": "3.3.0", + "tslib": "2.7.0", "uid": "2.0.2" }, "funding": { @@ -257,7 +257,7 @@ "@nestjs/microservices": "^10.0.0", "@nestjs/platform-express": "^10.0.0", "@nestjs/websockets": "^10.0.0", - "reflect-metadata": "^0.1.12", + "reflect-metadata": "^0.1.12 || ^0.2.0", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { @@ -292,37 +292,37 @@ } }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.13.4", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.4.tgz", - "integrity": "sha512-4JKyrk55ohQK2FcuZbPdNvxdyXD14jjOIvE8hYjJ+E1cHbRbfXQXbYnjTODFE52Gx8eAxz8C9icuhDYDLn7nww==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.14.0.tgz", + "integrity": "sha512-k+ioQLtXLXgNbhQbp1UOxtaUnnYTWwAPev88hP5qauFA+eq4NyeQGNojknFssXg2x0VT0TUGmU3PZ2DiQ70IVg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@nestjs/axios": "3.0.2", - "@nestjs/common": "10.3.0", - "@nestjs/core": "10.3.0", + "@nestjs/axios": "3.0.3", + "@nestjs/common": "10.4.3", + "@nestjs/core": "10.4.3", "@nuxtjs/opencollective": "0.3.2", - "axios": "1.6.8", + "axios": "1.7.7", "chalk": "4.1.2", "commander": "8.3.0", "compare-versions": "4.1.4", "concurrently": "6.5.1", "console.table": "0.10.0", "fs-extra": "10.1.0", - "glob": "7.2.3", - "https-proxy-agent": "7.0.4", + "glob": "9.3.5", + "https-proxy-agent": "7.0.5", "inquirer": "8.2.6", "lodash": "4.17.21", "reflect-metadata": "0.1.13", "rxjs": "7.8.1", - "tslib": "2.6.2" + "tslib": "2.7.0" }, "bin": { "openapi-generator-cli": "main.js" }, "engines": { - "node": ">=10.0.0" + "node": ">=16" }, "funding": { "type": "opencollective", @@ -477,9 +477,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dev": true, "license": "MIT", "dependencies": { @@ -529,14 +529,13 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/browser-or-node": { @@ -728,13 +727,6 @@ "dev": true, "license": "MIT" }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, "node_modules/concurrently": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz", @@ -1115,27 +1107,68 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/glob/node_modules/minipass": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", + "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/path-scurry/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -1154,9 +1187,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, "license": "MIT", "dependencies": { @@ -1201,18 +1234,6 @@ ], "license": "BSD-3-Clause" }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1415,16 +1436,19 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", + "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minipass": { @@ -1472,16 +1496,6 @@ } } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -1546,16 +1560,6 @@ "dev": true, "license": "(MIT AND Zlib)" }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -1584,9 +1588,9 @@ } }, "node_modules/path-to-regexp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", - "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", "dev": true, "license": "MIT" }, @@ -1771,16 +1775,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/rimraf/node_modules/glob": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", @@ -2075,9 +2069,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true, "license": "0BSD" }, @@ -2274,13 +2268,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index e7e41946..fada308d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { - "@openapitools/openapi-generator-cli": "2.13.4", + "@openapitools/openapi-generator-cli": "2.14.0", "prettier": "3.3.3", "quicktype-core": "23.0.170", "rimraf": "6.0.1", From c22c2165804307c4ca5ed9de0afd9e9c06e9e5f6 Mon Sep 17 00:00:00 2001 From: Bitwarden DevOps <106330231+bitwarden-devops-bot@users.noreply.github.com> Date: Mon, 14 Oct 2024 08:54:46 -0600 Subject: [PATCH 06/18] Bump java-sdk version to 1.0.1 (#1141) ## Type of change - [ ] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [X] Other ## Objective Automated java-sdk version bump to 1.0.1 --- languages/java/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/java/build.gradle b/languages/java/build.gradle index 52337a44..b9789d19 100644 --- a/languages/java/build.gradle +++ b/languages/java/build.gradle @@ -36,7 +36,7 @@ repositories { def branchName = "git branch --show-current".execute().text.trim() if (branchName == "main" || branchName == "rc" || branchName == "hotfix-rc") { - version = "1.0.0" + version = "1.0.1" } else { // branchName-SNAPSHOT version = "${branchName.replaceAll('/', '-')}-SNAPSHOT" From 8b44f55c82270d70ff2db5f7ccde905395a273c1 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 14 Oct 2024 17:53:31 +0200 Subject: [PATCH 07/18] Remove usage of snippet and just return a vanilla error (#1140) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we'll have to look into proper error handling anyways, so I'm just quickfixing this until then ## 🎟ī¸ Tracking ## 📔 Objective Snippets are not properly uploaded to npmjs. Bypassing the issue by not using snippets until we figure out error handling properly ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bitwarden-wasm-internal/src/client.rs | 4 ++++ crates/bitwarden-wasm-internal/src/error.js | 13 ------------- crates/bitwarden-wasm-internal/src/error.rs | 11 ++++++----- 3 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 crates/bitwarden-wasm-internal/src/error.js diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index ac7779b2..0a5ce27d 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -49,6 +49,10 @@ impl BitwardenClient { msg } + pub fn throw(&self, msg: String) -> Result<(), crate::error::GenericError> { + Err(crate::error::GenericError(msg)) + } + /// Test method, calls http endpoint pub async fn http_get(&self, url: String) -> Result { let client = self.0.internal.get_http_client(); diff --git a/crates/bitwarden-wasm-internal/src/error.js b/crates/bitwarden-wasm-internal/src/error.js deleted file mode 100644 index cd3d3a34..00000000 --- a/crates/bitwarden-wasm-internal/src/error.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Error thrown by the WASM module. - * @param {string} message - Error message. - * @extends Error - */ -class WasmError extends Error { - constructor(message) { - super(message); - this.name = "WasmError"; - } -} - -exports.WasmError = WasmError; diff --git a/crates/bitwarden-wasm-internal/src/error.rs b/crates/bitwarden-wasm-internal/src/error.rs index 2750d262..237ee494 100644 --- a/crates/bitwarden-wasm-internal/src/error.rs +++ b/crates/bitwarden-wasm-internal/src/error.rs @@ -2,12 +2,13 @@ use wasm_bindgen::prelude::*; // Importing an error class defined in JavaScript instead of defining it in Rust // allows us to extend the `Error` class. It also provides much better console output. -#[wasm_bindgen(module = "/src/error.js")] +#[wasm_bindgen] extern "C" { - type WasmError; + #[wasm_bindgen(js_name = Error)] + type JsError; - #[wasm_bindgen(constructor)] - fn new(message: String) -> WasmError; + #[wasm_bindgen(constructor, js_class = Error)] + fn new(message: String) -> JsError; } pub type Result = std::result::Result; @@ -22,6 +23,6 @@ impl From for GenericError { impl From for JsValue { fn from(error: GenericError) -> Self { - WasmError::new(error.0).into() + JsError::new(error.0).into() } } From 8aea2e9011936b1a2023f008d74f5cc4f4fe3733 Mon Sep 17 00:00:00 2001 From: Colton Hurst Date: Tue, 15 Oct 2024 11:41:39 -0400 Subject: [PATCH 08/18] Update the Changelogs for the 1.0 Releases (#1122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📔 Objective Update the changelogs for the 1.0 releases of `bitwarden` and `bws`. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bitwarden/CHANGELOG.md | 2 ++ crates/bws/CHANGELOG.md | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/crates/bitwarden/CHANGELOG.md b/crates/bitwarden/CHANGELOG.md index 5d3eefa9..f43c14ff 100644 --- a/crates/bitwarden/CHANGELOG.md +++ b/crates/bitwarden/CHANGELOG.md @@ -7,6 +7,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.0.0] - 2024-09-26 + ### Added - Support for secrets sync (#678) diff --git a/crates/bws/CHANGELOG.md b/crates/bws/CHANGELOG.md index 2690c14f..ba7818f9 100644 --- a/crates/bws/CHANGELOG.md +++ b/crates/bws/CHANGELOG.md @@ -7,13 +7,18 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.0.0] - 2024-09-26 + ### Added - The ability to edit unassigned secrets with direct permissions. (#906) +- The `run` command, to run commands with secrets (#621) ### Changed - Updated MSRV `1.75.0` (#980) +- Use state files by default. You can opt out of this behavior with the new `state_opt_out` key. + (#930) ### Removed From 37b22fef050fb7b6556c66846e318812c4c88fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ch=C4=99ci=C5=84ski?= Date: Thu, 17 Oct 2024 16:15:54 +0200 Subject: [PATCH 09/18] [BRE-101] Remove dept-devops from CODEOWNERS (#826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking https://bitwarden.atlassian.net/browse/BRE-101 ## 📔 Objective Remove dept-devops from CODEOWNERS and add `bitwarden/dept-bre` for all release workflows. ## 📸 Screenshots ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --------- Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com> Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com> --- .github/CODEOWNERS | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e4fbb97b..2698af85 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,9 +4,43 @@ # # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners +# BRE for publish workflow changes +.github/workflows/publish-*.yml @bitwarden/dept-bre + +# Shared workflows ownership + +## BRE & SM teams shared ownership +.github/workflows/build-cli-docker.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-cli.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-cpp.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-dotnet.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-go.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-java.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-napi.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-python-wheels.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/build-ruby.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-bws.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-cpp.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-dotnet.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-go.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-java.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-napi.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-python.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev +.github/workflows/release-ruby.yml @bitwarden/dept-bre @bitwarden/team-secrets-manager-dev + +## Multiple owners +.github/workflows/build-android.yml +.github/workflows/build-rust-crates.yml +.github/workflows/build-rust-cross-platform.yml +.github/workflows/build-swift.yml +.github/workflows/build-wasm-internal.yml +.github/workflows/build-wasm.yml +.github/workflows/release-rust-crates.yml +.github/workflows/release-swift.yml +.github/workflows/release-wasm.yml +.github/workflows/version-bump.yml + -# DevOps for Actions and other workflow changes. -.github/workflows @bitwarden/dept-devops # Secrets Manager team crates/bitwarden-sm @bitwarden/team-secrets-manager-dev @@ -16,3 +50,9 @@ crates/bws @bitwarden/team-secrets-manager-dev crates/bws/Cargo.toml crates/bws/scripts/install.ps1 crates/bws/scripts/install.sh + +## Docker files have shared ownership ## +**/Dockerfile +**/*.Dockerfile +**/.dockerignore +**/entrypoint.sh From 1a523e9a0f95a13d91972b77c47e3ad15907c1a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:45:06 -0400 Subject: [PATCH 10/18] [deps]: Update gh minor (#1136) --- .github/workflows/build-android.yml | 12 +++---- .github/workflows/build-cli-docker.yml | 6 ++-- .github/workflows/build-cli.yml | 36 +++++++++---------- .github/workflows/build-cpp.yml | 4 +-- .github/workflows/build-dotnet.yml | 6 ++-- .github/workflows/build-go.yaml | 4 +-- .github/workflows/build-java.yml | 8 ++--- .github/workflows/build-napi.yml | 6 ++-- .github/workflows/build-python-wheels.yml | 10 +++--- .github/workflows/build-ruby.yml | 6 ++-- .github/workflows/build-rust-crates.yml | 8 ++--- .../workflows/build-rust-cross-platform.yml | 8 ++--- .github/workflows/build-swift.yml | 10 +++--- .github/workflows/build-wasm-internal.yml | 6 ++-- .github/workflows/build-wasm.yml | 6 ++-- .github/workflows/cloc.yml | 2 +- .github/workflows/direct-minimal-versions.yml | 4 +-- .github/workflows/generate_schemas.yml | 20 +++++------ .github/workflows/lint.yml | 6 ++-- .github/workflows/memory-testing.yml | 4 +-- .github/workflows/minimum-rust-version.yml | 4 +-- .github/workflows/publish-bws.yml | 12 +++---- .github/workflows/publish-dotnet.yml | 2 +- .github/workflows/publish-internal.yml | 6 ++-- .github/workflows/publish-java.yml | 4 +-- .github/workflows/publish-napi.yml | 6 ++-- .github/workflows/publish-php.yml | 10 +++--- .github/workflows/publish-python.yml | 4 +-- .github/workflows/publish-ruby.yml | 4 +-- .github/workflows/publish-rust-crates.yml | 6 ++-- .github/workflows/publish-wasm.yml | 6 ++-- .github/workflows/release-bws.yml | 2 +- .github/workflows/release-cpp.yml | 2 +- .github/workflows/release-dotnet.yml | 4 +-- .github/workflows/release-go.yml | 6 ++-- .github/workflows/release-java.yml | 4 +-- .github/workflows/release-napi.yml | 4 +-- .github/workflows/release-python.yml | 4 +-- .github/workflows/release-ruby.yml | 4 +-- .github/workflows/release-rust-crates.yml | 2 +- .github/workflows/release-swift.yml | 6 ++-- .github/workflows/release-wasm.yml | 4 +-- .github/workflows/rust-test.yml | 14 ++++---- .github/workflows/rustdoc.yml | 2 +- .github/workflows/scan.yml | 10 +++--- .github/workflows/version-bump.yml | 6 ++-- 46 files changed, 155 insertions(+), 155 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 7607d530..e49fc0d6 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -25,7 +25,7 @@ jobs: - target: i686-linux-android steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -33,7 +33,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo @@ -46,7 +46,7 @@ jobs: run: cross build -p bitwarden-uniffi --release --target=${{ matrix.settings.target }} - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: android-${{ matrix.settings.target }} path: ./target/${{ matrix.settings.target }}/release/libbitwarden_uniffi.so @@ -57,14 +57,14 @@ jobs: needs: build steps: - name: Checkout repo (PR) - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 if: github.event_name == 'pull_request' with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} - name: Checkout repo (Push) - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 if: github.event_name == 'push' with: fetch-depth: 0 @@ -75,7 +75,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: cargo-combine-cache diff --git a/.github/workflows/build-cli-docker.yml b/.github/workflows/build-cli-docker.yml index 83daabf2..65e16480 100644 --- a/.github/workflows/build-cli-docker.yml +++ b/.github/workflows/build-cli-docker.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Check Branch to Publish id: publish-branch-check @@ -33,7 +33,7 @@ jobs: uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 ########## Login to Docker registries ########## - name: Login to Azure - Prod Subscription @@ -87,7 +87,7 @@ jobs: fi - name: Build and push Docker image - uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: crates/bws/Dockerfile diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 9ffb3bde..648291eb 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -21,7 +21,7 @@ jobs: sign: ${{ steps.sign.outputs.sign }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get Package Version id: retrieve-version @@ -56,7 +56,7 @@ jobs: target: aarch64-pc-windows-msvc steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -65,7 +65,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -121,7 +121,7 @@ jobs: run: 7z a ./bws-${{ matrix.settings.target }}-%_PACKAGE_VERSION%.zip ./target/${{ matrix.settings.target }}/release/bws.exe - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip @@ -145,7 +145,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -154,7 +154,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -230,7 +230,7 @@ jobs: xcrun notarytool submit ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip --keychain-profile "notarytool-profile" --wait - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip @@ -259,7 +259,7 @@ jobs: target: aarch64-unknown-linux-gnu steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -273,7 +273,7 @@ jobs: version: 0.12.0 - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -289,7 +289,7 @@ jobs: run: zip -j ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip ./target/${{ matrix.settings.target }}/release/bws - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip @@ -305,7 +305,7 @@ jobs: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download x86_64-apple-darwin artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -394,7 +394,7 @@ jobs: xcrun notarytool submit ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip --keychain-profile "notarytool-profile" --wait - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip path: ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip @@ -407,7 +407,7 @@ jobs: - setup steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -415,7 +415,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: cargo-cli-about @@ -429,7 +429,7 @@ jobs: sed -i.bak 's/\$NAME\$/Bitwarden Secrets Manager CLI/g' THIRDPARTY.html - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: THIRDPARTY.html path: ./crates/bws/THIRDPARTY.html @@ -441,7 +441,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -449,7 +449,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: cargo-cli-manpage @@ -460,7 +460,7 @@ jobs: mv $OUT_DIR/manpages . - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: manpages path: ./manpages/* diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 68636936..2cd9991a 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: install dependencies linux if: runner.os == 'Linux' @@ -152,7 +152,7 @@ jobs: fi - name: Upload C++ package for ${{ matrix.settings.target }} - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: libbitwarden_cpp-${{ matrix.settings.target }} path: languages/cpp/build/artifacts diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index bb5d56b6..974c7e58 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -23,7 +23,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install xmllint run: sudo apt-get install -y libxml2-utils @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download C# schemas artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -92,7 +92,7 @@ jobs: working-directory: languages/csharp/Bitwarden.Sdk - name: Upload NuGet package - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: Bitwarden.Sdk.${{ needs.version.outputs.version }}.nupkg path: | diff --git a/.github/workflows/build-go.yaml b/.github/workflows/build-go.yaml index ffb4d669..0a84e72a 100644 --- a/.github/workflows/build-go.yaml +++ b/.github/workflows/build-go.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Go environment uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 @@ -27,7 +27,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Cache dependencies - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/build-java.yml b/.github/workflows/build-java.yml index 6994a5a6..761ba5ce 100644 --- a/.github/workflows/build-java.yml +++ b/.github/workflows/build-java.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download Java schemas artifact uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -67,21 +67,21 @@ jobs: working-directory: languages/java - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: build path: ${{ github.workspace }}/languages/java/build if-no-files-found: error - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: resources path: ${{ github.workspace }}/languages/java/src/main/resources if-no-files-found: error - name: Upload Java SDK Build - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas path: languages/java/src/main/java/bit/sdk/schema diff --git a/.github/workflows/build-napi.yml b/.github/workflows/build-napi.yml index 41ed1d17..f9ebbc7a 100644 --- a/.github/workflows/build-napi.yml +++ b/.github/workflows/build-napi.yml @@ -51,7 +51,7 @@ jobs: strip *.node steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -67,7 +67,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -84,7 +84,7 @@ jobs: run: ${{ matrix.settings.build }} - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-bitwarden-napi-${{ matrix.settings.target }} path: ${{ github.workspace }}/crates/bitwarden-napi/sdk-napi.*.node diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml index b3919567..60c6e4b2 100644 --- a/.github/workflows/build-python-wheels.yml +++ b/.github/workflows/build-python-wheels.yml @@ -26,7 +26,7 @@ jobs: package_version: ${{ steps.retrieve-version.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get Package Version id: retrieve-version @@ -63,7 +63,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -77,7 +77,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} @@ -109,14 +109,14 @@ jobs: working-directory: ${{ github.workspace }}/languages/python - name: Upload wheels - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-${{ matrix.settings.target }} path: ${{ github.workspace }}/target/wheels/bitwarden_sdk*.whl - name: Upload sdists if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} # we only need one sdist - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-sdist path: ${{ github.workspace }}/target/wheels/bitwarden_sdk-*.tar.gz diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index 5a3f1a01..559c161c 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Ruby - uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # v1.191.0 + uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # v1.196.0 with: ruby-version: 3.2 @@ -89,7 +89,7 @@ jobs: working-directory: languages/ruby/bitwarden_sdk_secrets - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: path: bitwarden-sdk-secrets-*.gem name: bitwarden-sdk-secrets diff --git a/.github/workflows/build-rust-crates.yml b/.github/workflows/build-rust-crates.yml index 8400fcbf..115be589 100644 --- a/.github/workflows/build-rust-crates.yml +++ b/.github/workflows/build-rust-crates.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -42,7 +42,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Build run: cargo build -p ${{ matrix.package }} --release @@ -56,7 +56,7 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -64,7 +64,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-release diff --git a/.github/workflows/build-rust-cross-platform.yml b/.github/workflows/build-rust-cross-platform.yml index 1748661b..7014bf95 100644 --- a/.github/workflows/build-rust-cross-platform.yml +++ b/.github/workflows/build-rust-cross-platform.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -46,7 +46,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 if: ${{ contains(matrix.settings.target, 'musl') }} @@ -83,13 +83,13 @@ jobs: run: cargo build -p bitwarden-c --target ${{ matrix.settings.target }} --release - name: Upload Artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: libbitwarden_c_files-${{ matrix.settings.target }} path: target/${{ matrix.settings.target }}/release/*bitwarden_c* - name: Upload Artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: libbitwarden_c_files-${{ matrix.settings.target }} path: target/${{ matrix.settings.target }}/release-windows/*bitwarden_c* diff --git a/.github/workflows/build-swift.yml b/.github/workflows/build-swift.yml index 37224134..94b730e8 100644 --- a/.github/workflows/build-swift.yml +++ b/.github/workflows/build-swift.yml @@ -17,7 +17,7 @@ jobs: package_version: ${{ steps.retrieve-version.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get Package Version id: retrieve-version @@ -33,7 +33,7 @@ jobs: _VERSION: ${{ needs.version.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -41,7 +41,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: sdk-swift-cargo @@ -67,14 +67,14 @@ jobs: cp -rf languages/swift/BitwardenFFI.xcframework artifacts - name: Upload BitwardenFFI.xcframework artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: BitwardenFFI-${{ env._VERSION }}-${{ steps.build.outputs.short-sha }}.xcframework path: artifacts if-no-files-found: error - name: Upload BitwardenSdk sources - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: BitwardenSdk-${{ env._VERSION }}-${{ steps.build.outputs.short-sha }}-sources path: languages/swift/Sources/BitwardenSdk diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 0be6b29c..6e0e28b9 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -41,7 +41,7 @@ jobs: targets: wasm32-unknown-unknown - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: wasm-cargo-cache @@ -52,7 +52,7 @@ jobs: run: ./build.sh -r - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-internal path: ${{ github.workspace }}/languages/js/sdk-internal/* diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 117bbf2c..f3a57f06 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -41,7 +41,7 @@ jobs: targets: wasm32-unknown-unknown - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: wasm-cargo-cache @@ -52,7 +52,7 @@ jobs: run: ./build.sh -r - name: Upload artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-bitwarden-wasm path: ${{ github.workspace }}/languages/js/wasm/* diff --git a/.github/workflows/cloc.yml b/.github/workflows/cloc.yml index 644dc0bf..c78c2855 100644 --- a/.github/workflows/cloc.yml +++ b/.github/workflows/cloc.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up cloc run: | diff --git a/.github/workflows/direct-minimal-versions.yml b/.github/workflows/direct-minimal-versions.yml index 22feb04c..7b3820c7 100644 --- a/.github/workflows/direct-minimal-versions.yml +++ b/.github/workflows/direct-minimal-versions.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -45,7 +45,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: dmv-${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} diff --git a/.github/workflows/generate_schemas.yml b/.github/workflows/generate_schemas.yml index 434174c7..66e6f450 100644 --- a/.github/workflows/generate_schemas.yml +++ b/.github/workflows/generate_schemas.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -37,61 +37,61 @@ jobs: run: npm ci - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: NPM Schemas run: npm run schemas - name: Upload ts schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.ts path: ${{ github.workspace }}/languages/js/sdk-client/src/schemas.ts if-no-files-found: error - name: Upload c# schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.cs path: ${{ github.workspace }}/languages/csharp/Bitwarden.Sdk/schemas.cs if-no-files-found: error - name: Upload python schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.py path: ${{ github.workspace }}/languages/python/bitwarden_sdk/schemas.py if-no-files-found: error - name: Upload ruby schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.rb path: ${{ github.workspace }}/languages/ruby/bitwarden_sdk_secrets/lib/schemas.rb if-no-files-found: error - name: Upload json schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-schemas-json path: ${{ github.workspace }}/support/schemas/* if-no-files-found: error - name: Upload Go schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: schemas.go path: ${{ github.workspace }}/languages/go/schema.go - name: Upload java schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-schemas-java path: ${{ github.workspace }}/languages/java/src/main/java/com/bitwarden/sdk/schema/* if-no-files-found: error - name: Upload cpp schemas artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sdk-schemas-cpp path: ${{ github.workspace }}/languages/cpp/include/schemas.hpp diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a12e263c..a8d14a69 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -30,7 +30,7 @@ jobs: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Cargo fmt run: cargo +nightly fmt --check @@ -45,7 +45,7 @@ jobs: RUSTFLAGS: "-D warnings" - name: Upload Clippy results to GitHub - uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 with: sarif_file: clippy_result.sarif diff --git a/.github/workflows/memory-testing.yml b/.github/workflows/memory-testing.yml index 41b15853..527121ba 100644 --- a/.github/workflows/memory-testing.yml +++ b/.github/workflows/memory-testing.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Check out repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up gdb run: | @@ -35,7 +35,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: memtest-cargo diff --git a/.github/workflows/minimum-rust-version.yml b/.github/workflows/minimum-rust-version.yml index fa95eb0b..deaca3c1 100644 --- a/.github/workflows/minimum-rust-version.yml +++ b/.github/workflows/minimum-rust-version.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -38,7 +38,7 @@ jobs: targets: ${{ matrix.settings.target }} - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 with: key: msrv-${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} diff --git a/.github/workflows/publish-bws.yml b/.github/workflows/publish-bws.yml index dc939a5d..d4dc445c 100644 --- a/.github/workflows/publish-bws.yml +++ b/.github/workflows/publish-bws.yml @@ -32,7 +32,7 @@ jobs: deployment-id: ${{ steps.deployment.outputs.deployment_id }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -80,7 +80,7 @@ jobs: _TAG_NAME: ${{ needs.setup.outputs.release-tag }} steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Login to Azure uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 @@ -101,7 +101,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-release @@ -119,7 +119,7 @@ jobs: needs: setup steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env._TAG_NAME }} @@ -142,7 +142,7 @@ jobs: uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 ########## Login to Docker registries ########## - name: Login to Azure - Prod Subscription @@ -172,7 +172,7 @@ jobs: azure-keyvault-name: "bitwarden-ci" - name: Build and push Docker image - uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.0 + uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: context: . file: crates/bws/Dockerfile diff --git a/.github/workflows/publish-dotnet.yml b/.github/workflows/publish-dotnet.yml index 1e2fc06f..624cf944 100644 --- a/.github/workflows/publish-dotnet.yml +++ b/.github/workflows/publish-dotnet.yml @@ -28,7 +28,7 @@ jobs: version: ${{ steps.version-output.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 13f3a9d9..62ffc9e4 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -45,10 +45,10 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 20 diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index 002a61ee..c6266a1a 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -35,7 +35,7 @@ jobs: tag_name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -69,7 +69,7 @@ jobs: needs: validate steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.validate.outputs.tag_name }} diff --git a/.github/workflows/publish-napi.yml b/.github/workflows/publish-napi.yml index 6a284d4a..0caec400 100644 --- a/.github/workflows/publish-napi.yml +++ b/.github/workflows/publish-napi.yml @@ -31,7 +31,7 @@ jobs: tag-name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -68,7 +68,7 @@ jobs: _TAG_NAME: ${{ needs.setup.outputs.tag-name }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env._TAG_NAME }} @@ -84,7 +84,7 @@ jobs: task: release - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 18 cache: "npm" diff --git a/.github/workflows/publish-php.yml b/.github/workflows/publish-php.yml index 986923ab..fc82c6bc 100644 --- a/.github/workflows/publish-php.yml +++ b/.github/workflows/publish-php.yml @@ -25,7 +25,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Setup PHP with PECL extension uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # 2.31.1 @@ -76,7 +76,7 @@ jobs: _PKG_VERSION: ${{ needs.validate.outputs.version }} steps: - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: path: sdk @@ -93,7 +93,7 @@ jobs: secrets: "github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout SDK-PHP repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sm-sdk-php path: sm-sdk-php @@ -255,7 +255,7 @@ jobs: packagist-key" - name: Checkout SDK-PHP repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sm-sdk-php path: sm-sdk-php diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 7e339509..76b06a43 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -31,7 +31,7 @@ jobs: tag_name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -65,7 +65,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.setup.outputs.tag_name }} diff --git a/.github/workflows/publish-ruby.yml b/.github/workflows/publish-ruby.yml index 875def06..827377c2 100644 --- a/.github/workflows/publish-ruby.yml +++ b/.github/workflows/publish-ruby.yml @@ -30,7 +30,7 @@ jobs: tag-name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -67,7 +67,7 @@ jobs: _TAG_NAME: ${{ needs.setup.outputs.tag-name }} steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ env._TAG_NAME }} diff --git a/.github/workflows/publish-rust-crates.yml b/.github/workflows/publish-rust-crates.yml index bb79aad2..156aedb0 100644 --- a/.github/workflows/publish-rust-crates.yml +++ b/.github/workflows/publish-rust-crates.yml @@ -29,7 +29,7 @@ jobs: release-tag: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -63,7 +63,7 @@ jobs: needs: setup steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.setup.outputs.release-tag }} @@ -85,7 +85,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-release diff --git a/.github/workflows/publish-wasm.yml b/.github/workflows/publish-wasm.yml index 95a86a0c..b8bd637f 100644 --- a/.github/workflows/publish-wasm.yml +++ b/.github/workflows/publish-wasm.yml @@ -31,7 +31,7 @@ jobs: tag_name: ${{ steps.version-output.outputs.tag_name }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -67,12 +67,12 @@ jobs: _VERSION: ${{ needs.setup.outputs.release-version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ needs.setup.outputs.tag_name }} - name: Setup Node - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 18 cache: "npm" diff --git a/.github/workflows/release-bws.yml b/.github/workflows/release-bws.yml index 92a8544b..aec83741 100644 --- a/.github/workflows/release-bws.yml +++ b/.github/workflows/release-bws.yml @@ -22,7 +22,7 @@ jobs: release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml index 47199a99..77bc8940 100644 --- a/.github/workflows/release-cpp.yml +++ b/.github/workflows/release-cpp.yml @@ -24,7 +24,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-dotnet.yml b/.github/workflows/release-dotnet.yml index dc853927..f968ebac 100644 --- a/.github/workflows/release-dotnet.yml +++ b/.github/workflows/release-dotnet.yml @@ -21,7 +21,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -48,7 +48,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download NuGet package uses: bitwarden/gh-actions/download-artifacts@main diff --git a/.github/workflows/release-go.yml b/.github/workflows/release-go.yml index f88e52af..4138c722 100644 --- a/.github/workflows/release-go.yml +++ b/.github/workflows/release-go.yml @@ -26,7 +26,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -55,7 +55,7 @@ jobs: steps: - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: path: sdk @@ -72,7 +72,7 @@ jobs: secrets: "github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout SDK-Go repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sdk-go path: sdk-go diff --git a/.github/workflows/release-java.yml b/.github/workflows/release-java.yml index 6898932d..863a8986 100644 --- a/.github/workflows/release-java.yml +++ b/.github/workflows/release-java.yml @@ -21,7 +21,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -45,7 +45,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Create release if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml index 761515c7..b47f51f5 100644 --- a/.github/workflows/release-napi.yml +++ b/.github/workflows/release-napi.yml @@ -28,7 +28,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -55,7 +55,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download artifacts uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 5be1a12f..6d246270 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -22,7 +22,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -46,7 +46,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download artifacts uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 diff --git a/.github/workflows/release-ruby.yml b/.github/workflows/release-ruby.yml index 9c3e82b7..9fb3349c 100644 --- a/.github/workflows/release-ruby.yml +++ b/.github/workflows/release-ruby.yml @@ -21,7 +21,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -45,7 +45,7 @@ jobs: needs: setup steps: - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download ruby artifact uses: bitwarden/gh-actions/download-artifacts@main diff --git a/.github/workflows/release-rust-crates.yml b/.github/workflows/release-rust-crates.yml index 54845e14..abf48a50 100644 --- a/.github/workflows/release-rust-crates.yml +++ b/.github/workflows/release-rust-crates.yml @@ -21,7 +21,7 @@ jobs: release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} diff --git a/.github/workflows/release-swift.yml b/.github/workflows/release-swift.yml index 351581a7..38f247cc 100644 --- a/.github/workflows/release-swift.yml +++ b/.github/workflows/release-swift.yml @@ -42,7 +42,7 @@ jobs: swift_checksum: ${{ steps.calculate-swift-checksum.outputs.checksum }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get version id: version @@ -114,7 +114,7 @@ jobs: _BUILD_RUN_ID: ${{ needs.validate.outputs.run_id }} steps: - name: Checkout SDK repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: path: sdk @@ -142,7 +142,7 @@ jobs: github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout SDK-Swift repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: bitwarden/sdk-swift path: sdk-swift diff --git a/.github/workflows/release-wasm.yml b/.github/workflows/release-wasm.yml index 97b2c34d..c53d3081 100644 --- a/.github/workflows/release-wasm.yml +++ b/.github/workflows/release-wasm.yml @@ -26,7 +26,7 @@ jobs: release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Branch check if: ${{ inputs.release_type != 'Dry Run' }} @@ -53,7 +53,7 @@ jobs: needs: setup steps: - name: Checkout repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Download artifacts uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 5e7703e8..a313970b 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -42,7 +42,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Test # Termporarily exclude NAPI due to a test error on windows @@ -54,7 +54,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -63,7 +63,7 @@ jobs: components: llvm-tools - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-llvm-cov run: cargo install cargo-llvm-cov --version 0.5.38 @@ -72,7 +72,7 @@ jobs: run: cargo llvm-cov --all-features --lcov --output-path lcov.info --ignore-filename-regex "crates/bitwarden-api-" - name: Upload to codecov.io - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -83,7 +83,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable @@ -92,7 +92,7 @@ jobs: targets: wasm32-unknown-unknown - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Check run: cargo check -p bitwarden-wasm --target wasm32-unknown-unknown diff --git a/.github/workflows/rustdoc.yml b/.github/workflows/rustdoc.yml index 45ab6d07..afa12fd5 100644 --- a/.github/workflows/rustdoc.yml +++ b/.github/workflows/rustdoc.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml index 193c9fcf..f337e17a 100644 --- a/.github/workflows/scan.yml +++ b/.github/workflows/scan.yml @@ -26,12 +26,12 @@ jobs: steps: - name: Check out repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: ${{ github.event.pull_request.head.sha }} - name: Scan with Checkmarx - uses: checkmarx/ast-github-action@9fda5a4a2c297608117a5a56af424502a9192e57 # 2.0.34 + uses: checkmarx/ast-github-action@f0869bd1a37fddc06499a096101e6c900e815d81 # 2.0.36 env: INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}" with: @@ -46,7 +46,7 @@ jobs: --output-path . ${{ env.INCREMENTAL }} - name: Upload Checkmarx results to GitHub - uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 with: sarif_file: cx_result.sarif @@ -60,13 +60,13 @@ jobs: steps: - name: Check out repo - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - name: Scan with SonarCloud - uses: sonarsource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0.0 + uses: sonarsource/sonarcloud-github-action@383f7e52eae3ab0510c3cb0e7d9d150bbaeab838 # v3.1.0 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 7053181e..9cd716eb 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -39,7 +39,7 @@ jobs: toolchain: stable - name: Cache cargo registry - uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 - name: Install cargo-release run: cargo install cargo-edit --locked @@ -59,7 +59,7 @@ jobs: github-pat-bitwarden-devops-bot-repo-scope" - name: Checkout Branch - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: main repository: bitwarden/sdk @@ -236,7 +236,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Branch - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: main From 6babf9e21a1ef7e3f61331f59af1a063295bbe3a Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:50:08 -0400 Subject: [PATCH 11/18] BRE-367 - Update regex in Publish Java workflow (#1143) --- .github/workflows/publish-java.yml | 4 ++-- languages/java/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index c6266a1a..7f461c19 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -51,8 +51,8 @@ jobs: id: version-output run: | if [[ "${{ inputs.version }}" == "latest" || "${{ inputs.version }}" == "" ]]; then - TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -c '.[] | select(.tag_name | contains("java")) | .tag_name' | head -1) - VERSION=$(echo $TAG_NAME | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+') + TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/sdk/releases" | jq -rc '.[] | select(.tag_name | contains("java")) | .tag_name' | head -1) + VERSION=$(echo $TAG_NAME | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') echo "Latest Released Version: $VERSION" echo "version=$VERSION" >> $GITHUB_OUTPUT diff --git a/languages/java/build.gradle b/languages/java/build.gradle index b9789d19..a28a7445 100644 --- a/languages/java/build.gradle +++ b/languages/java/build.gradle @@ -35,7 +35,7 @@ repositories { def branchName = "git branch --show-current".execute().text.trim() - if (branchName == "main" || branchName == "rc" || branchName == "hotfix-rc") { + if (branchName == "main") { version = "1.0.1" } else { // branchName-SNAPSHOT From f9757b1454e4674d4f119ce2b3c79fc584d8f048 Mon Sep 17 00:00:00 2001 From: Colton Hurst Date: Thu, 17 Oct 2024 12:04:52 -0400 Subject: [PATCH 12/18] Add opt out docs link to the bws changelog (#1142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📔 Objective As discussed in PR https://github.com/bitwarden/sdk/pull/1122, add a link to our docs about the opt out change. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bws/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bws/CHANGELOG.md b/crates/bws/CHANGELOG.md index ba7818f9..19b1010f 100644 --- a/crates/bws/CHANGELOG.md +++ b/crates/bws/CHANGELOG.md @@ -19,6 +19,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Updated MSRV `1.75.0` (#980) - Use state files by default. You can opt out of this behavior with the new `state_opt_out` key. (#930) + - Opt out documentation can be found + [here](https://bitwarden.com/help/secrets-manager-cli/#config-state) ### Removed From 6460db27b098bf58983632430380c0a2886d3796 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:41:57 -0400 Subject: [PATCH 13/18] BRE-367 - Update logic to use version only (#1146) --- languages/java/build.gradle | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/languages/java/build.gradle b/languages/java/build.gradle index a28a7445..7e98de1d 100644 --- a/languages/java/build.gradle +++ b/languages/java/build.gradle @@ -34,13 +34,7 @@ repositories { // Main: Grab it from `crates/bitwarden/Cargo.toml` def branchName = "git branch --show-current".execute().text.trim() - - if (branchName == "main") { - version = "1.0.1" - } else { - // branchName-SNAPSHOT - version = "${branchName.replaceAll('/', '-')}-SNAPSHOT" - } + version = "1.0.1" afterEvaluate { from components.java From e2aa10212270ff21a8c99937d4a55b0d65080bb6 Mon Sep 17 00:00:00 2001 From: Opeyemi Date: Mon, 21 Oct 2024 13:11:03 +0100 Subject: [PATCH 14/18] [BRE-372] - Clean up document start (#1147) --- .github/workflows/build-android.yml | 1 - .github/workflows/build-cli-docker.yml | 1 - .github/workflows/build-cli.yml | 1 - .github/workflows/build-java.yml | 1 - .github/workflows/build-napi.yml | 1 - .github/workflows/build-python-wheels.yml | 1 - .github/workflows/build-ruby.yml | 1 - .github/workflows/build-rust-crates.yml | 1 - .github/workflows/build-swift.yml | 1 - .github/workflows/build-wasm-internal.yml | 1 - .github/workflows/build-wasm.yml | 1 - .github/workflows/delete-old-packages.yml | 1 - .github/workflows/direct-minimal-versions.yml | 1 - .github/workflows/enforce-labels.yml | 1 - .github/workflows/memory-testing.yml | 1 - .github/workflows/minimum-rust-version.yml | 1 - .github/workflows/publish-bws.yml | 1 - .github/workflows/publish-internal.yml | 1 - .github/workflows/publish-java.yml | 1 - .github/workflows/publish-napi.yml | 1 - .github/workflows/publish-php.yml | 1 - .github/workflows/publish-python.yml | 1 - .github/workflows/publish-rust-crates.yml | 1 - .github/workflows/publish-wasm.yml | 1 - .github/workflows/release-bws.yml | 1 - .github/workflows/release-napi.yml | 1 - .github/workflows/release-python.yml | 1 - .github/workflows/release-swift.yml | 1 - .github/workflows/release-wasm.yml | 1 - .github/workflows/version-bump.yml | 1 - .github/workflows/workflow-linter.yml | 12 ------- languages/java/example/bin/main/.classpath | 12 +++++++ languages/java/example/bin/main/.project | 34 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../main/.settings/org.eclipse.jdt.core.prefs | 4 +++ languages/java/example/bin/main/build.gradle | 23 +++++++++++++ 36 files changed, 75 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/workflow-linter.yml create mode 100644 languages/java/example/bin/main/.classpath create mode 100644 languages/java/example/bin/main/.project create mode 100644 languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs create mode 100644 languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs create mode 100644 languages/java/example/bin/main/build.gradle diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index e49fc0d6..49ee2084 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -1,4 +1,3 @@ ---- name: Build Android on: diff --git a/.github/workflows/build-cli-docker.yml b/.github/workflows/build-cli-docker.yml index 65e16480..abf1c3a8 100644 --- a/.github/workflows/build-cli-docker.yml +++ b/.github/workflows/build-cli-docker.yml @@ -1,4 +1,3 @@ ---- name: Build bws Docker image on: diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index 648291eb..05f4cd23 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -1,4 +1,3 @@ ---- name: Build CLI on: diff --git a/.github/workflows/build-java.yml b/.github/workflows/build-java.yml index 761ba5ce..abeabe9d 100644 --- a/.github/workflows/build-java.yml +++ b/.github/workflows/build-java.yml @@ -1,4 +1,3 @@ ---- name: Build Java SDK on: diff --git a/.github/workflows/build-napi.yml b/.github/workflows/build-napi.yml index f9ebbc7a..cae88a1b 100644 --- a/.github/workflows/build-napi.yml +++ b/.github/workflows/build-napi.yml @@ -1,4 +1,3 @@ ---- name: Build @bitwarden/sdk-napi on: diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml index 60c6e4b2..da3305e7 100644 --- a/.github/workflows/build-python-wheels.yml +++ b/.github/workflows/build-python-wheels.yml @@ -1,4 +1,3 @@ ---- name: Build Python Wheels on: diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index 559c161c..3ac79de7 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -1,4 +1,3 @@ ---- name: Build Ruby on: diff --git a/.github/workflows/build-rust-crates.yml b/.github/workflows/build-rust-crates.yml index 115be589..bc00dd97 100644 --- a/.github/workflows/build-rust-crates.yml +++ b/.github/workflows/build-rust-crates.yml @@ -1,4 +1,3 @@ ---- name: Build Rust crates on: diff --git a/.github/workflows/build-swift.yml b/.github/workflows/build-swift.yml index 94b730e8..93cb314c 100644 --- a/.github/workflows/build-swift.yml +++ b/.github/workflows/build-swift.yml @@ -1,4 +1,3 @@ ---- name: Build Swift Package on: diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 6e0e28b9..e45bcc26 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -1,4 +1,3 @@ ---- name: Build @bitwarden/sdk-internal on: diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index f3a57f06..7e01e10e 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -1,4 +1,3 @@ ---- name: Build @bitwarden/sdk-wasm on: diff --git a/.github/workflows/delete-old-packages.yml b/.github/workflows/delete-old-packages.yml index b3be807a..f690e801 100644 --- a/.github/workflows/delete-old-packages.yml +++ b/.github/workflows/delete-old-packages.yml @@ -1,4 +1,3 @@ ---- name: Delete old packages on: diff --git a/.github/workflows/direct-minimal-versions.yml b/.github/workflows/direct-minimal-versions.yml index 7b3820c7..66623ed6 100644 --- a/.github/workflows/direct-minimal-versions.yml +++ b/.github/workflows/direct-minimal-versions.yml @@ -1,4 +1,3 @@ ---- name: Direct Minimum Version on: diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml index a98c4ae1..40ddfe77 100644 --- a/.github/workflows/enforce-labels.yml +++ b/.github/workflows/enforce-labels.yml @@ -1,4 +1,3 @@ ---- name: Enforce PR labels on: diff --git a/.github/workflows/memory-testing.yml b/.github/workflows/memory-testing.yml index 527121ba..619fbb46 100644 --- a/.github/workflows/memory-testing.yml +++ b/.github/workflows/memory-testing.yml @@ -1,4 +1,3 @@ ---- name: Test for memory leaks on: diff --git a/.github/workflows/minimum-rust-version.yml b/.github/workflows/minimum-rust-version.yml index deaca3c1..812822c6 100644 --- a/.github/workflows/minimum-rust-version.yml +++ b/.github/workflows/minimum-rust-version.yml @@ -1,4 +1,3 @@ ---- name: Minimum Rust Version on: diff --git a/.github/workflows/publish-bws.yml b/.github/workflows/publish-bws.yml index d4dc445c..3f4245b9 100644 --- a/.github/workflows/publish-bws.yml +++ b/.github/workflows/publish-bws.yml @@ -1,4 +1,3 @@ ---- name: Publish bws CLI run-name: Publish bws CLI ${{ inputs.release_type }} diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml index 62ffc9e4..eef5b4d0 100644 --- a/.github/workflows/publish-internal.yml +++ b/.github/workflows/publish-internal.yml @@ -1,4 +1,3 @@ ---- name: Publish @bitwarden/sdk-internal run-name: Publish @bitwarden/sdk-internal ${{ inputs.release_type }} diff --git a/.github/workflows/publish-java.yml b/.github/workflows/publish-java.yml index 7f461c19..84ce0a95 100644 --- a/.github/workflows/publish-java.yml +++ b/.github/workflows/publish-java.yml @@ -1,4 +1,3 @@ ---- name: Publish Java SDK run-name: Publish Java SDK ${{ inputs.release_type }} diff --git a/.github/workflows/publish-napi.yml b/.github/workflows/publish-napi.yml index 0caec400..5c7aca19 100644 --- a/.github/workflows/publish-napi.yml +++ b/.github/workflows/publish-napi.yml @@ -1,4 +1,3 @@ ---- name: Publish @bitwarden/sdk-napi run-name: Publish @bitwarden/sdk-napi ${{ inputs.release_type }} diff --git a/.github/workflows/publish-php.yml b/.github/workflows/publish-php.yml index fc82c6bc..d3965f70 100644 --- a/.github/workflows/publish-php.yml +++ b/.github/workflows/publish-php.yml @@ -1,4 +1,3 @@ ---- name: Publish PHP SDK run-name: Publish PHP SDK ${{ inputs.release_type }} diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 76b06a43..bfc6b7a0 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -1,4 +1,3 @@ ---- name: Publish Python SDK run-name: Publish Python SDK ${{ inputs.release_type }} diff --git a/.github/workflows/publish-rust-crates.yml b/.github/workflows/publish-rust-crates.yml index 156aedb0..30921f6b 100644 --- a/.github/workflows/publish-rust-crates.yml +++ b/.github/workflows/publish-rust-crates.yml @@ -1,4 +1,3 @@ ---- name: Publish Rust crates run-name: Publish Rust crates ${{ inputs.release_type }} diff --git a/.github/workflows/publish-wasm.yml b/.github/workflows/publish-wasm.yml index b8bd637f..95779b78 100644 --- a/.github/workflows/publish-wasm.yml +++ b/.github/workflows/publish-wasm.yml @@ -1,4 +1,3 @@ ---- name: Publish @bitwarden/sdk-wasm run-name: Publish @bitwarden/sdk-wasm ${{ inputs.release_type }} diff --git a/.github/workflows/release-bws.yml b/.github/workflows/release-bws.yml index aec83741..9063ca6a 100644 --- a/.github/workflows/release-bws.yml +++ b/.github/workflows/release-bws.yml @@ -1,4 +1,3 @@ ---- name: Release bws CLI run-name: Release bws CLI ${{ inputs.release_type }} diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml index b47f51f5..65534e8e 100644 --- a/.github/workflows/release-napi.yml +++ b/.github/workflows/release-napi.yml @@ -1,4 +1,3 @@ ---- name: Release @bitwarden/sdk-napi run-name: Release @bitwarden/sdk-napi ${{ inputs.release_type }} diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 6d246270..a634a2d1 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -1,4 +1,3 @@ ---- name: Release Python SDK run-name: Release Python SDK ${{ inputs.release_type }} diff --git a/.github/workflows/release-swift.yml b/.github/workflows/release-swift.yml index 38f247cc..c5c25d65 100644 --- a/.github/workflows/release-swift.yml +++ b/.github/workflows/release-swift.yml @@ -1,4 +1,3 @@ ---- name: Release Swift Package on: diff --git a/.github/workflows/release-wasm.yml b/.github/workflows/release-wasm.yml index c53d3081..982a31ec 100644 --- a/.github/workflows/release-wasm.yml +++ b/.github/workflows/release-wasm.yml @@ -1,4 +1,3 @@ ---- name: Release @bitwarden/sdk-wasm run-name: Release @bitwarden/sdk-wasm ${{ inputs.release_type }} diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 9cd716eb..47642e19 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -1,4 +1,3 @@ ---- name: Version Bump run-name: Version Bump - ${{ inputs.project }} - v${{ inputs.version_number }} diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml deleted file mode 100644 index 24f10f1e..00000000 --- a/.github/workflows/workflow-linter.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Workflow linter - -on: - pull_request: - paths: - - .github/workflows/** - -jobs: - call-workflow: - name: Lint - uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@main diff --git a/languages/java/example/bin/main/.classpath b/languages/java/example/bin/main/.classpath new file mode 100644 index 00000000..18f7d238 --- /dev/null +++ b/languages/java/example/bin/main/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/languages/java/example/bin/main/.project b/languages/java/example/bin/main/.project new file mode 100644 index 00000000..050f3113 --- /dev/null +++ b/languages/java/example/bin/main/.project @@ -0,0 +1,34 @@ + + + example + Project example created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1729179122477 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..b1886adb --- /dev/null +++ b/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..55e9d5ff --- /dev/null +++ b/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=19 +org.eclipse.jdt.core.compiler.compliance=19 +org.eclipse.jdt.core.compiler.source=19 diff --git a/languages/java/example/bin/main/build.gradle b/languages/java/example/bin/main/build.gradle new file mode 100644 index 00000000..73025e50 --- /dev/null +++ b/languages/java/example/bin/main/build.gradle @@ -0,0 +1,23 @@ +plugins { + id 'application' +} + +repositories { + mavenLocal() + mavenCentral() +} + +dependencies { + implementation rootProject +} + +application { + mainClass = 'Example' +} + +sourceSets { + main { + java.srcDirs += '.' + } +} + From c5a74193dbe8fa6d2b7c45412c678d7dcdb2a239 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 21 Oct 2024 14:53:38 +0200 Subject: [PATCH 15/18] fix: downgrade rust to 1.81.0 in WASM builds (#1149) This is a temporary fix for WASM no longer building due to wasm2js breaking when using 1.82.0 --- .github/workflows/build-wasm-internal.yml | 2 +- .github/workflows/build-wasm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index e45bcc26..2262babc 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -36,7 +36,7 @@ jobs: - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable with: - toolchain: stable + toolchain: 1.81.0 targets: wasm32-unknown-unknown - name: Cache cargo registry diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 7e01e10e..e1924ca2 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -36,7 +36,7 @@ jobs: - name: Install rust uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable with: - toolchain: stable + toolchain: 1.81.0 targets: wasm32-unknown-unknown - name: Cache cargo registry From 39358acc891590b5c90fa0734cd50a04cf80bb1c Mon Sep 17 00:00:00 2001 From: Opeyemi Date: Mon, 21 Oct 2024 15:07:22 +0100 Subject: [PATCH 16/18] [BRE-372] - Clean up Eclipse added files (#1150) --- languages/java/example/bin/main/.classpath | 12 ------- languages/java/example/bin/main/.project | 34 ------------------- .../org.eclipse.buildship.core.prefs | 2 -- .../main/.settings/org.eclipse.jdt.core.prefs | 4 --- languages/java/example/bin/main/build.gradle | 23 ------------- 5 files changed, 75 deletions(-) delete mode 100644 languages/java/example/bin/main/.classpath delete mode 100644 languages/java/example/bin/main/.project delete mode 100644 languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs delete mode 100644 languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs delete mode 100644 languages/java/example/bin/main/build.gradle diff --git a/languages/java/example/bin/main/.classpath b/languages/java/example/bin/main/.classpath deleted file mode 100644 index 18f7d238..00000000 --- a/languages/java/example/bin/main/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/languages/java/example/bin/main/.project b/languages/java/example/bin/main/.project deleted file mode 100644 index 050f3113..00000000 --- a/languages/java/example/bin/main/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - example - Project example created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - - - 1729179122477 - - 30 - - org.eclipse.core.resources.regexFilterMatcher - node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ - - - - diff --git a/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index b1886adb..00000000 --- a/languages/java/example/bin/main/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir=.. -eclipse.preferences.version=1 diff --git a/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs b/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 55e9d5ff..00000000 --- a/languages/java/example/bin/main/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=19 -org.eclipse.jdt.core.compiler.compliance=19 -org.eclipse.jdt.core.compiler.source=19 diff --git a/languages/java/example/bin/main/build.gradle b/languages/java/example/bin/main/build.gradle deleted file mode 100644 index 73025e50..00000000 --- a/languages/java/example/bin/main/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id 'application' -} - -repositories { - mavenLocal() - mavenCentral() -} - -dependencies { - implementation rootProject -} - -application { - mainClass = 'Example' -} - -sourceSets { - main { - java.srcDirs += '.' - } -} - From be75311e92309109147c4b6d742e23a192b253c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 21 Oct 2024 17:37:04 +0200 Subject: [PATCH 17/18] [PM-13420] Support case-insensitive TOTP generation (#1144) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking https://bitwarden.atlassian.net/browse/PM-13420 ## 📔 Objective Update TOTP parsing to be case insensitive by lowercasing the input initially. `decode_b32` is already converting the input to uppercase so secret decoding will still work the same. I've also removed the `to_uppercase` from algorithm now that we know the string is lowercase. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bitwarden-vault/src/totp.rs | 44 ++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/crates/bitwarden-vault/src/totp.rs b/crates/bitwarden-vault/src/totp.rs index 8aee3e69..d6167a1a 100644 --- a/crates/bitwarden-vault/src/totp.rs +++ b/crates/bitwarden-vault/src/totp.rs @@ -157,17 +157,19 @@ impl FromStr for Totp { /// - OTP Auth URI /// - Steam URI fn from_str(key: &str) -> Result { + let key = key.to_lowercase(); + let params = if key.starts_with("otpauth://") { - let url = Url::parse(key).map_err(|_| TotpError::InvalidOtpauth)?; + let url = Url::parse(&key).map_err(|_| TotpError::InvalidOtpauth)?; let parts: HashMap<_, _> = url.query_pairs().collect(); Totp { algorithm: parts .get("algorithm") - .and_then(|v| match v.to_uppercase().as_ref() { - "SHA1" => Some(Algorithm::Sha1), - "SHA256" => Some(Algorithm::Sha256), - "SHA512" => Some(Algorithm::Sha512), + .and_then(|v| match v.as_ref() { + "sha1" => Some(Algorithm::Sha1), + "sha256" => Some(Algorithm::Sha256), + "sha512" => Some(Algorithm::Sha512), _ => None, }) .unwrap_or(DEFAULT_ALGORITHM), @@ -200,7 +202,7 @@ impl FromStr for Totp { algorithm: DEFAULT_ALGORITHM, digits: DEFAULT_DIGITS, period: DEFAULT_PERIOD, - secret: decode_b32(key), + secret: decode_b32(&key), } }; @@ -285,6 +287,7 @@ mod tests { ("PIUD1IS!EQYA=", "829846"), // sanitized // Steam ("steam://HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", "7W6CJ"), + ("StEam://HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", "7W6CJ"), ("steam://ABCD123", "N26DF"), // Various weird lengths ("ddfdf", "932653"), @@ -321,6 +324,20 @@ mod tests { assert_eq!(response.period, 30); } + #[test] + fn test_generate_otpauth_uppercase() { + let key = "OTPauth://totp/test-account?secret=WQIQ25BRKZYCJVYP".to_string(); + let time = Some( + DateTime::parse_from_rfc3339("2023-01-01T00:00:00.000Z") + .unwrap() + .with_timezone(&Utc), + ); + let response = generate_totp(key, time).unwrap(); + + assert_eq!(response.code, "194506".to_string()); + assert_eq!(response.period, 30); + } + #[test] fn test_generate_otpauth_period() { let key = "otpauth://totp/test-account?secret=WQIQ25BRKZYCJVYP&period=60".to_string(); @@ -335,6 +352,21 @@ mod tests { assert_eq!(response.period, 60); } + #[test] + fn test_generate_otpauth_algorithm_sha256() { + let key = + "otpauth://totp/test-account?secret=WQIQ25BRKZYCJVYP&algorithm=SHA256".to_string(); + let time = Some( + DateTime::parse_from_rfc3339("2023-01-01T00:00:00.000Z") + .unwrap() + .with_timezone(&Utc), + ); + let response = generate_totp(key, time).unwrap(); + + assert_eq!(response.code, "842615".to_string()); + assert_eq!(response.period, 30); + } + #[test] fn test_generate_totp_cipher_view() { let view = CipherListView { From 38ecf133f86940f9c8f6a9627012938e7569b44d Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 21 Oct 2024 18:05:18 +0200 Subject: [PATCH 18/18] [PM-11924] Add ssh-key item type (#1037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking https://bitwarden.atlassian.net/browse/PM-11924 Server PR: https://bitwarden.atlassian.net/browse/PM-10394 ## 📔 Objective Add a new item type for ssh-keys. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --------- Co-authored-by: Oscar Hinton --- .../resources/json_export.json | 20 ++++ crates/bitwarden-exporters/src/json.rs | 113 +++++++++++++++++- crates/bitwarden-exporters/src/lib.rs | 11 ++ crates/bitwarden-exporters/src/models.rs | 9 ++ .../bitwarden-vault/src/cipher/attachment.rs | 3 + crates/bitwarden-vault/src/cipher/cipher.rs | 71 ++++++++++- crates/bitwarden-vault/src/cipher/mod.rs | 1 + crates/bitwarden-vault/src/cipher/ssh_key.rs | 49 ++++++++ .../src/mobile/client_ciphers.rs | 2 + 9 files changed, 272 insertions(+), 7 deletions(-) create mode 100644 crates/bitwarden-vault/src/cipher/ssh_key.rs diff --git a/crates/bitwarden-exporters/resources/json_export.json b/crates/bitwarden-exporters/resources/json_export.json index ad538055..27a0921d 100644 --- a/crates/bitwarden-exporters/resources/json_export.json +++ b/crates/bitwarden-exporters/resources/json_export.json @@ -141,6 +141,26 @@ "revisionDate": "2024-01-30T17:54:50.706Z", "creationDate": "2024-01-30T17:54:50.706Z", "deletedDate": null + }, + { + "id": "646594a9-a9cb-4082-9d57-0024c3fbcaa9", + "folderId": null, + "organizationId": null, + "collectionIds": null, + "name": "My ssh key", + "notes": null, + "type": 5, + "sshKey": { + "privateKey": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\nQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiwAAAKAy48fwMuPH\n8AAAAAtzc2gtZWQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiw\nAAAEAYUCIdfLI14K3XIy9V0FDZLQoZ9gcjOnvFjb4uA335HmKc0TlyEy0IeHcFXQfX4Kk+\nURAHBHlwP5dv2LwxocaLAAAAHHF1ZXh0ZW5ATWFjQm9vay1Qcm8tMTYubG9jYWwB\n-----END OPENSSH PRIVATE KEY-----", + "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGKc0TlyEy0IeHcFXQfX4Kk+URAHBHlwP5dv2LwxocaL", + "fingerprint": "SHA256:1JjFjvPRkj1Gbf2qRP1dgHiIzEuNAEvp+92x99jw3K0" + }, + "favorite": false, + "reprompt": 0, + "passwordHistory": null, + "revisionDate": "2024-01-30T11:25:25.466Z", + "creationDate": "2024-01-30T11:25:25.466Z", + "deletedDate": null } ] } \ No newline at end of file diff --git a/crates/bitwarden-exporters/src/json.rs b/crates/bitwarden-exporters/src/json.rs index 3f6c72c1..7ed85d45 100644 --- a/crates/bitwarden-exporters/src/json.rs +++ b/crates/bitwarden-exporters/src/json.rs @@ -2,7 +2,9 @@ use chrono::{DateTime, Utc}; use thiserror::Error; use uuid::Uuid; -use crate::{Card, Cipher, CipherType, Field, Folder, Identity, Login, LoginUri, SecureNote}; +use crate::{ + Card, Cipher, CipherType, Field, Folder, Identity, Login, LoginUri, SecureNote, SshKey, +}; #[derive(Error, Debug)] pub enum JsonError { @@ -69,6 +71,8 @@ struct JsonCipher { card: Option, #[serde(skip_serializing_if = "Option::is_none")] secure_note: Option, + #[serde(skip_serializing_if = "Option::is_none")] + ssh_key: Option, favorite: bool, reprompt: u8, @@ -206,6 +210,24 @@ impl From for JsonIdentity { } } +#[derive(serde::Serialize)] +#[serde(rename_all = "camelCase")] +struct JsonSshKey { + private_key: Option, + public_key: Option, + fingerprint: Option, +} + +impl From for JsonSshKey { + fn from(ssh_key: SshKey) -> Self { + JsonSshKey { + private_key: ssh_key.private_key, + public_key: ssh_key.public_key, + fingerprint: ssh_key.fingerprint, + } + } +} + #[derive(serde::Serialize)] #[serde(rename_all = "camelCase")] struct JsonField { @@ -233,13 +255,15 @@ impl From for JsonCipher { CipherType::SecureNote(_) => 2, CipherType::Card(_) => 3, CipherType::Identity(_) => 4, + CipherType::SshKey(_) => 5, }; - let (login, secure_note, card, identity) = match cipher.r#type { - CipherType::Login(l) => (Some((*l).into()), None, None, None), - CipherType::SecureNote(s) => (None, Some((*s).into()), None, None), - CipherType::Card(c) => (None, None, Some((*c).into()), None), - CipherType::Identity(i) => (None, None, None, Some((*i).into())), + let (login, secure_note, card, identity, ssh_key) = match cipher.r#type { + CipherType::Login(l) => (Some((*l).into()), None, None, None, None), + CipherType::SecureNote(s) => (None, Some((*s).into()), None, None, None), + CipherType::Card(c) => (None, None, Some((*c).into()), None, None), + CipherType::Identity(i) => (None, None, None, Some((*i).into()), None), + CipherType::SshKey(ssh) => (None, None, None, None, Some((*ssh).into())), }; JsonCipher { @@ -254,6 +278,7 @@ impl From for JsonCipher { identity, card, secure_note, + ssh_key, favorite: cipher.favorite, reprompt: cipher.reprompt, fields: cipher.fields.into_iter().map(|f| f.into()).collect(), @@ -594,6 +619,60 @@ mod tests { ) } + #[test] + fn test_convert_ssh_key() { + let cipher = Cipher { + id: "23f0f877-42b1-4820-a850-b10700bc41eb".parse().unwrap(), + folder_id: None, + + name: "My ssh key".to_string(), + notes: None, + + r#type: CipherType::SshKey(Box::new(SshKey { + private_key: Some("private".to_string()), + public_key: Some("public".to_string()), + fingerprint: Some("fingerprint".to_string()), + })), + + favorite: false, + reprompt: 0, + + fields: vec![], + + revision_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + creation_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + deleted_date: None, + }; + + let json = serde_json::to_string(&JsonCipher::from(cipher)).unwrap(); + + let expected = r#"{ + "passwordHistory": null, + "revisionDate": "2024-01-30T11:25:25.466Z", + "creationDate": "2024-01-30T11:25:25.466Z", + "deletedDate": null, + "id": "23f0f877-42b1-4820-a850-b10700bc41eb", + "organizationId": null, + "folderId": null, + "type": 5, + "reprompt": 0, + "name": "My ssh key", + "notes": null, + "sshKey": { + "privateKey": "private", + "publicKey": "public", + "fingerprint": "fingerprint" + }, + "favorite": false, + "collectionIds": null + }"#; + + assert_eq!( + json.parse::().unwrap(), + expected.parse::().unwrap() + ) + } + #[test] pub fn test_export() { let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -750,6 +829,28 @@ mod tests { creation_date: "2024-01-30T17:54:50.706Z".parse().unwrap(), deleted_date: None, }, + Cipher { + id: "646594a9-a9cb-4082-9d57-0024c3fbcaa9".parse().unwrap(), + folder_id: None, + + name: "My ssh key".to_string(), + notes: None, + + r#type: CipherType::SshKey(Box::new(SshKey { + private_key: Some("-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\nQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiwAAAKAy48fwMuPH\n8AAAAAtzc2gtZWQyNTUxOQAAACBinNE5chMtCHh3BV0H1+CpPlEQBwR5cD+Xb9i8MaHGiw\nAAAEAYUCIdfLI14K3XIy9V0FDZLQoZ9gcjOnvFjb4uA335HmKc0TlyEy0IeHcFXQfX4Kk+\nURAHBHlwP5dv2LwxocaLAAAAHHF1ZXh0ZW5ATWFjQm9vay1Qcm8tMTYubG9jYWwB\n-----END OPENSSH PRIVATE KEY-----".to_string()), + public_key: Some("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGKc0TlyEy0IeHcFXQfX4Kk+URAHBHlwP5dv2LwxocaL".to_string()), + fingerprint: Some("SHA256:1JjFjvPRkj1Gbf2qRP1dgHiIzEuNAEvp+92x99jw3K0".to_string()), + })), + + favorite: false, + reprompt: 0, + + fields: vec![], + + revision_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + creation_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + deleted_date: None, + } ], ) .unwrap(); diff --git a/crates/bitwarden-exporters/src/lib.rs b/crates/bitwarden-exporters/src/lib.rs index 75b0503e..f6bb8dbf 100644 --- a/crates/bitwarden-exporters/src/lib.rs +++ b/crates/bitwarden-exporters/src/lib.rs @@ -70,6 +70,7 @@ pub enum CipherType { SecureNote(Box), Card(Box), Identity(Box), + SshKey(Box), } impl fmt::Display for CipherType { @@ -79,6 +80,7 @@ impl fmt::Display for CipherType { CipherType::SecureNote(_) => write!(f, "note"), CipherType::Card(_) => write!(f, "card"), CipherType::Identity(_) => write!(f, "identity"), + CipherType::SshKey(_) => write!(f, "ssh_key"), } } } @@ -132,3 +134,12 @@ pub struct Identity { pub passport_number: Option, pub license_number: Option, } + +pub struct SshKey { + /// [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key), in PEM encoding. + pub private_key: Option, + /// Ssh public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6) + pub public_key: Option, + /// SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT` + pub fingerprint: Option, +} diff --git a/crates/bitwarden-exporters/src/models.rs b/crates/bitwarden-exporters/src/models.rs index 1d56e723..1d2e80d9 100644 --- a/crates/bitwarden-exporters/src/models.rs +++ b/crates/bitwarden-exporters/src/models.rs @@ -74,6 +74,14 @@ impl TryFrom for crate::Cipher { license_number: i.license_number, })) } + CipherType::SshKey => { + let s = require!(value.ssh_key); + crate::CipherType::SshKey(Box::new(crate::SshKey { + private_key: s.private_key, + public_key: s.public_key, + fingerprint: s.fingerprint, + })) + } }; Ok(Self { @@ -172,6 +180,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true, diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index d1a058c0..bf589879 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -208,6 +208,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, @@ -258,6 +259,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, @@ -312,6 +314,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index 8ac4bfe7..846d332c 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -14,7 +14,7 @@ use uuid::Uuid; use super::{ attachment, card, field, identity, local_data::{LocalData, LocalDataView}, - secure_note, + secure_note, ssh_key, }; use crate::{ password_history, Fido2CredentialFullView, Fido2CredentialView, Login, LoginView, @@ -41,6 +41,7 @@ pub enum CipherType { SecureNote = 2, Card = 3, Identity = 4, + SshKey = 5, } #[derive(Clone, Copy, Serialize_repr, Deserialize_repr, Debug, JsonSchema, PartialEq)] @@ -72,6 +73,7 @@ pub struct Cipher { pub identity: Option, pub card: Option, pub secure_note: Option, + pub ssh_key: Option, pub favorite: bool, pub reprompt: CipherRepromptType, @@ -109,6 +111,7 @@ pub struct CipherView { pub identity: Option, pub card: Option, pub secure_note: Option, + pub ssh_key: Option, pub favorite: bool, pub reprompt: CipherRepromptType, @@ -137,6 +140,7 @@ pub enum CipherListViewType { SecureNote, Card, Identity, + SshKey, } #[derive(Serialize, Deserialize, Debug, JsonSchema, PartialEq)] @@ -211,6 +215,7 @@ impl KeyEncryptable for CipherView { identity: self.identity.encrypt_with_key(key)?, card: self.card.encrypt_with_key(key)?, secure_note: self.secure_note.encrypt_with_key(key)?, + ssh_key: self.ssh_key.encrypt_with_key(key)?, favorite: self.favorite, reprompt: self.reprompt, organization_use_totp: self.organization_use_totp, @@ -245,6 +250,7 @@ impl KeyDecryptable for Cipher { identity: self.identity.decrypt_with_key(key).ok().flatten(), card: self.card.decrypt_with_key(key).ok().flatten(), secure_note: self.secure_note.decrypt_with_key(key).ok().flatten(), + ssh_key: self.ssh_key.decrypt_with_key(key).ok().flatten(), favorite: self.favorite, reprompt: self.reprompt, organization_use_totp: self.organization_use_totp, @@ -329,6 +335,18 @@ impl Cipher { .transpose()?, ) } + CipherType::SshKey => { + let Some(ssh_key) = &self.ssh_key else { + return Ok(String::new()); + }; + + ssh_key + .fingerprint + .as_ref() + .map(|c| c.decrypt_with_key(key)) + .transpose()? + .unwrap_or_default() + } }) } } @@ -553,6 +571,7 @@ impl KeyDecryptable for Cipher { CipherType::SecureNote => CipherListViewType::SecureNote, CipherType::Card => CipherListViewType::Card, CipherType::Identity => CipherListViewType::Identity, + CipherType::SshKey => CipherListViewType::SshKey, }, favorite: self.favorite, reprompt: self.reprompt, @@ -614,6 +633,8 @@ impl TryFrom for Cipher { identity: cipher.identity.map(|i| (*i).try_into()).transpose()?, card: cipher.card.map(|c| (*c).try_into()).transpose()?, secure_note: cipher.secure_note.map(|s| (*s).try_into()).transpose()?, + // TODO: add ssh_key when api bindings have been updated + ssh_key: None, favorite: cipher.favorite.unwrap_or(false), reprompt: cipher .reprompt @@ -650,6 +671,7 @@ impl From for CipherType { bitwarden_api_api::models::CipherType::SecureNote => CipherType::SecureNote, bitwarden_api_api::models::CipherType::Card => CipherType::Card, bitwarden_api_api::models::CipherType::Identity => CipherType::Identity, + // TODO: add ssh_key when api bindings have been updated } } } @@ -669,6 +691,7 @@ mod tests { use std::collections::HashMap; use attachment::AttachmentView; + use ssh_key::SshKey; use super::*; use crate::Fido2Credential; @@ -695,6 +718,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true, @@ -753,6 +777,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: false, @@ -1159,4 +1184,48 @@ mod tests { let subtitle = build_subtitle_identity(first_name, last_name); assert_eq!(subtitle, ""); } + + #[test] + fn test_subtitle_ssh_key() { + let key = "hvBMMb1t79YssFZkpetYsM3deyVuQv4r88Uj9gvYe0+G8EwxvW3v1iywVmSl61iwzd17JW5C/ivzxSP2C9h7Tw==".to_string(); + let key = SymmetricCryptoKey::try_from(key).unwrap(); + let original_subtitle = "SHA256:1JjFjvPRkj1Gbf2qRP1dgHiIzEuNAEvp+92x99jw3K0".to_string(); + let fingerprint_encrypted = original_subtitle.to_owned().encrypt_with_key(&key).unwrap(); + let ssh_key_cipher = Cipher { + id: Some("090c19ea-a61a-4df6-8963-262b97bc6266".parse().unwrap()), + organization_id: None, + folder_id: None, + collection_ids: vec![], + r#type: CipherType::SshKey, + key: None, + name: "My test ssh key" + .to_string() + .encrypt_with_key(&key) + .unwrap(), + notes: None, + login: None, + identity: None, + card: None, + secure_note: None, + ssh_key: Some(SshKey { + private_key: None, + public_key: None, + fingerprint: Some(fingerprint_encrypted), + }), + favorite: false, + reprompt: CipherRepromptType::None, + organization_use_totp: false, + edit: true, + view_password: true, + local_data: None, + attachments: None, + fields: None, + password_history: None, + creation_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), + deleted_date: None, + revision_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), + }; + let subtitle = ssh_key_cipher.get_decrypted_subtitle(&key).unwrap(); + assert_eq!(subtitle, original_subtitle); + } } diff --git a/crates/bitwarden-vault/src/cipher/mod.rs b/crates/bitwarden-vault/src/cipher/mod.rs index 67513d52..a4a6088d 100644 --- a/crates/bitwarden-vault/src/cipher/mod.rs +++ b/crates/bitwarden-vault/src/cipher/mod.rs @@ -8,6 +8,7 @@ pub(crate) mod linked_id; pub(crate) mod local_data; pub(crate) mod login; pub(crate) mod secure_note; +pub(crate) mod ssh_key; pub use attachment::{ Attachment, AttachmentEncryptResult, AttachmentFile, AttachmentFileView, AttachmentView, diff --git a/crates/bitwarden-vault/src/cipher/ssh_key.rs b/crates/bitwarden-vault/src/cipher/ssh_key.rs new file mode 100644 index 00000000..6d4977c8 --- /dev/null +++ b/crates/bitwarden-vault/src/cipher/ssh_key.rs @@ -0,0 +1,49 @@ +use bitwarden_crypto::{ + CryptoError, EncString, KeyDecryptable, KeyEncryptable, SymmetricCryptoKey, +}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +pub struct SshKey { + /// SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key) + pub private_key: Option, + /// SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6) + pub public_key: Option, + /// SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT` + pub fingerprint: Option, +} + +#[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[cfg_attr(feature = "uniffi", derive(uniffi::Record))] +pub struct SshKeyView { + /// SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key) + pub private_key: Option, + /// SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6) + pub public_key: Option, + /// SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT` + pub fingerprint: Option, +} + +impl KeyEncryptable for SshKeyView { + fn encrypt_with_key(self, key: &SymmetricCryptoKey) -> Result { + Ok(SshKey { + private_key: self.private_key.encrypt_with_key(key)?, + public_key: self.public_key.encrypt_with_key(key)?, + fingerprint: self.fingerprint.encrypt_with_key(key)?, + }) + } +} + +impl KeyDecryptable for SshKey { + fn decrypt_with_key(&self, key: &SymmetricCryptoKey) -> Result { + Ok(SshKeyView { + private_key: self.private_key.decrypt_with_key(key).ok().flatten(), + public_key: self.public_key.decrypt_with_key(key).ok().flatten(), + fingerprint: self.fingerprint.decrypt_with_key(key).ok().flatten(), + }) + } +} diff --git a/crates/bitwarden-vault/src/mobile/client_ciphers.rs b/crates/bitwarden-vault/src/mobile/client_ciphers.rs index 345f04df..063fb4bc 100644 --- a/crates/bitwarden-vault/src/mobile/client_ciphers.rs +++ b/crates/bitwarden-vault/src/mobile/client_ciphers.rs @@ -118,6 +118,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true, @@ -159,6 +160,7 @@ mod tests { identity: None, card: None, secure_note: None, + ssh_key: None, favorite: false, reprompt: CipherRepromptType::None, organization_use_totp: true,