From 6392340162560d6ea8935ce7b5c877b67a065bf2 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 13:45:25 +0200 Subject: [PATCH 01/11] feat: add commercial vault crate --- Cargo.lock | 15 ++++++++ .../bitwarden-commercial-vault/Cargo.toml | 37 +++++++++++++++++++ .../bitwarden-commercial-vault/README.md | 1 + .../bitwarden-commercial-vault/src/lib.rs | 9 +++++ .../src/uniffi_support.rs | 3 ++ .../src/vault_client.rs | 31 ++++++++++++++++ .../bitwarden-commercial-vault/uniffi.toml | 9 +++++ 7 files changed, 105 insertions(+) create mode 100644 bitwarden_license/bitwarden-commercial-vault/Cargo.toml create mode 100644 bitwarden_license/bitwarden-commercial-vault/README.md create mode 100644 bitwarden_license/bitwarden-commercial-vault/src/lib.rs create mode 100644 bitwarden_license/bitwarden-commercial-vault/src/uniffi_support.rs create mode 100644 bitwarden_license/bitwarden-commercial-vault/src/vault_client.rs create mode 100644 bitwarden_license/bitwarden-commercial-vault/uniffi.toml diff --git a/Cargo.lock b/Cargo.lock index d2eb06438..049ea195d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,6 +491,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "bitwarden-commercial-vault" +version = "1.0.0" +dependencies = [ + "bitwarden-core", + "serde", + "serde_json", + "serde_repr", + "tsify", + "uniffi", + "uuid", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "bitwarden-core" version = "1.0.0" diff --git a/bitwarden_license/bitwarden-commercial-vault/Cargo.toml b/bitwarden_license/bitwarden-commercial-vault/Cargo.toml new file mode 100644 index 000000000..d35927e23 --- /dev/null +++ b/bitwarden_license/bitwarden-commercial-vault/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "bitwarden-commercial-vault" +description = """ +Internal commercial crate for the bitwarden crate. Do not use. +""" + +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +readme.workspace = true +homepage.workspace = true +repository.workspace = true +license-file = "../../LICENSE_BITWARDEN.txt" +keywords.workspace = true + +[features] +uniffi = ["dep:uniffi"] # Uniffi bindings +wasm = [ + "dep:tsify", + "dep:wasm-bindgen", + "dep:wasm-bindgen-futures" +] # WASM support + +[dependencies] +bitwarden-core = { workspace = true, features = ["internal"] } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +tsify = { workspace = true, optional = true } +uniffi = { workspace = true, optional = true } +uuid = { workspace = true } +wasm-bindgen = { workspace = true, optional = true } +wasm-bindgen-futures = { workspace = true, optional = true } + +[lints] +workspace = true diff --git a/bitwarden_license/bitwarden-commercial-vault/README.md b/bitwarden_license/bitwarden-commercial-vault/README.md new file mode 100644 index 000000000..d20832c85 --- /dev/null +++ b/bitwarden_license/bitwarden-commercial-vault/README.md @@ -0,0 +1 @@ +# Bitwarden Commercial Vault diff --git a/bitwarden_license/bitwarden-commercial-vault/src/lib.rs b/bitwarden_license/bitwarden-commercial-vault/src/lib.rs new file mode 100644 index 000000000..32c29e51b --- /dev/null +++ b/bitwarden_license/bitwarden-commercial-vault/src/lib.rs @@ -0,0 +1,9 @@ +#![doc = include_str!("../README.md")] + +#[cfg(feature = "uniffi")] +uniffi::setup_scaffolding!(); +#[cfg(feature = "uniffi")] +mod uniffi_support; + +mod vault_client; +pub use vault_client::{CommercialVaultClient, CommercialVaultClientExt}; diff --git a/bitwarden_license/bitwarden-commercial-vault/src/uniffi_support.rs b/bitwarden_license/bitwarden-commercial-vault/src/uniffi_support.rs new file mode 100644 index 000000000..3c6aff9f1 --- /dev/null +++ b/bitwarden_license/bitwarden-commercial-vault/src/uniffi_support.rs @@ -0,0 +1,3 @@ +use uuid::Uuid; + +uniffi::use_remote_type!(bitwarden_core::Uuid); diff --git a/bitwarden_license/bitwarden-commercial-vault/src/vault_client.rs b/bitwarden_license/bitwarden-commercial-vault/src/vault_client.rs new file mode 100644 index 000000000..701eb9fa5 --- /dev/null +++ b/bitwarden_license/bitwarden-commercial-vault/src/vault_client.rs @@ -0,0 +1,31 @@ +use bitwarden_core::Client; +#[cfg(feature = "wasm")] +use wasm_bindgen::prelude::*; + +#[allow(missing_docs)] +#[derive(Clone)] +#[cfg_attr(feature = "wasm", wasm_bindgen)] +pub struct CommercialVaultClient { + #[allow(unused)] + pub(crate) client: Client, +} + +impl CommercialVaultClient { + fn new(client: Client) -> Self { + Self { client } + } +} + +#[cfg_attr(feature = "wasm", wasm_bindgen)] +impl CommercialVaultClient {} + +#[allow(missing_docs)] +pub trait CommercialVaultClientExt { + fn vault(&self) -> CommercialVaultClient; +} + +impl CommercialVaultClientExt for Client { + fn vault(&self) -> CommercialVaultClient { + CommercialVaultClient::new(self.clone()) + } +} diff --git a/bitwarden_license/bitwarden-commercial-vault/uniffi.toml b/bitwarden_license/bitwarden-commercial-vault/uniffi.toml new file mode 100644 index 000000000..87d2c5516 --- /dev/null +++ b/bitwarden_license/bitwarden-commercial-vault/uniffi.toml @@ -0,0 +1,9 @@ +[bindings.kotlin] +package_name = "com.bitwarden.commercial.vault" +generate_immutable_records = true +android = true + +[bindings.swift] +ffi_module_name = "BitwardenCommercialVaultFFI" +module_name = "BitwardenCommercialVault" +generate_immutable_records = true From 048de0a4b14c1e522113dcdf0a5e2874b926acbe Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 14:16:26 +0200 Subject: [PATCH 02/11] feat: expose commercial vault crate in pm --- Cargo.lock | 1 + Cargo.toml | 1 + crates/bitwarden-pm/Cargo.toml | 2 ++ crates/bitwarden-pm/src/commercial.rs | 14 ++++++++++++++ crates/bitwarden-pm/src/lib.rs | 9 +++++++++ 5 files changed, 27 insertions(+) create mode 100644 crates/bitwarden-pm/src/commercial.rs diff --git a/Cargo.lock b/Cargo.lock index 049ea195d..56f7c311a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,6 +728,7 @@ name = "bitwarden-pm" version = "1.0.0" dependencies = [ "bitwarden-auth", + "bitwarden-commercial-vault", "bitwarden-core", "bitwarden-exporters", "bitwarden-fido", diff --git a/Cargo.toml b/Cargo.toml index 00d90641d..d7e9d3eb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ bitwarden-api-identity = { path = "crates/bitwarden-api-identity", version = "=1 bitwarden-auth = { path = "crates/bitwarden-auth", version = "=1.0.0" } bitwarden-cli = { path = "crates/bitwarden-cli", version = "=1.0.0" } bitwarden-collections = { path = "crates/bitwarden-collections", version = "=1.0.0" } +bitwarden-commercial-vault = { path = "bitwarden_license/bitwarden-commercial-vault", version = "=1.0.0" } bitwarden-core = { path = "crates/bitwarden-core", version = "=1.0.0" } bitwarden-crypto = { path = "crates/bitwarden-crypto", version = "=1.0.0" } bitwarden-encoding = { path = "crates/bitwarden-encoding", version = "=1.0.0" } diff --git a/crates/bitwarden-pm/Cargo.toml b/crates/bitwarden-pm/Cargo.toml index 6ce547bdf..759af24c1 100644 --- a/crates/bitwarden-pm/Cargo.toml +++ b/crates/bitwarden-pm/Cargo.toml @@ -37,9 +37,11 @@ wasm = [ "dep:wasm-bindgen-futures", "dep:tsify" ] # WASM support +bitwarden-license = ["dep:bitwarden-commercial-vault"] [dependencies] bitwarden-auth = { workspace = true } +bitwarden-commercial-vault = { workspace = true, optional = true } bitwarden-core = { workspace = true, features = ["internal"] } bitwarden-exporters = { workspace = true } bitwarden-fido = { workspace = true } diff --git a/crates/bitwarden-pm/src/commercial.rs b/crates/bitwarden-pm/src/commercial.rs new file mode 100644 index 000000000..30b26daaf --- /dev/null +++ b/crates/bitwarden-pm/src/commercial.rs @@ -0,0 +1,14 @@ +use bitwarden_commercial_vault::CommercialVaultClientExt as _; + +pub struct CommercialPasswordManagerClient(bitwarden_core::Client); + +impl CommercialPasswordManagerClient { + pub(crate) fn new(client: bitwarden_core::Client) -> Self { + Self(client) + } + + /// Vault item operations + pub fn vault(&self) -> bitwarden_commercial_vault::CommercialVaultClient { + self.0.vault() + } +} diff --git a/crates/bitwarden-pm/src/lib.rs b/crates/bitwarden-pm/src/lib.rs index acdad2d3f..b4feb9b7d 100644 --- a/crates/bitwarden-pm/src/lib.rs +++ b/crates/bitwarden-pm/src/lib.rs @@ -1,5 +1,8 @@ #![doc = include_str!("../README.md")] +#[cfg(feature = "bitwarden-license")] +mod commercial; + use std::sync::Arc; use bitwarden_auth::AuthClientExt as _; @@ -46,6 +49,12 @@ impl PasswordManagerClient { self.0.auth_new() } + /// Bitwarden licensed operations + #[cfg(feature = "bitwarden-license")] + pub fn commercial(&self) -> commercial::CommercialPasswordManagerClient { + commercial::CommercialPasswordManagerClient::new(self.0.clone()) + } + /// Crypto operations pub fn crypto(&self) -> bitwarden_core::key_management::CryptoClient { self.0.crypto() From e8b2d85f4a0e58b6a4c2e2eef561227ce969cfc2 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 14:47:36 +0200 Subject: [PATCH 03/11] feat: allow commercial features to be included in wasm --- Cargo.lock | 1 + crates/bitwarden-pm/Cargo.toml | 1 + crates/bitwarden-pm/src/commercial.rs | 7 ++++ crates/bitwarden-pm/src/lib.rs | 6 ++-- crates/bitwarden-wasm-internal/Cargo.toml | 6 ++++ crates/bitwarden-wasm-internal/build.sh | 35 +++++++++++++++----- crates/bitwarden-wasm-internal/src/client.rs | 8 ++++- 7 files changed, 53 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56f7c311a..727ea70ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -952,6 +952,7 @@ name = "bitwarden-wasm-internal" version = "0.1.0" dependencies = [ "async-trait", + "bitwarden-commercial-vault", "bitwarden-core", "bitwarden-crypto", "bitwarden-error", diff --git a/crates/bitwarden-pm/Cargo.toml b/crates/bitwarden-pm/Cargo.toml index 759af24c1..7a90980a5 100644 --- a/crates/bitwarden-pm/Cargo.toml +++ b/crates/bitwarden-pm/Cargo.toml @@ -29,6 +29,7 @@ uniffi = [ ] # Uniffi bindings wasm = [ "bitwarden-auth/wasm", + "bitwarden-commercial-vault/wasm", "bitwarden-core/wasm", "bitwarden-exporters/wasm", "bitwarden-generators/wasm", diff --git a/crates/bitwarden-pm/src/commercial.rs b/crates/bitwarden-pm/src/commercial.rs index 30b26daaf..fff2a2d23 100644 --- a/crates/bitwarden-pm/src/commercial.rs +++ b/crates/bitwarden-pm/src/commercial.rs @@ -1,12 +1,19 @@ use bitwarden_commercial_vault::CommercialVaultClientExt as _; +#[cfg(feature = "wasm")] +use wasm_bindgen::prelude::*; +#[cfg_attr(feature = "wasm", wasm_bindgen)] +/// Client for bitwarden licensed operations pub struct CommercialPasswordManagerClient(bitwarden_core::Client); impl CommercialPasswordManagerClient { pub(crate) fn new(client: bitwarden_core::Client) -> Self { Self(client) } +} +#[cfg_attr(feature = "wasm", wasm_bindgen)] +impl CommercialPasswordManagerClient { /// Vault item operations pub fn vault(&self) -> bitwarden_commercial_vault::CommercialVaultClient { self.0.vault() diff --git a/crates/bitwarden-pm/src/lib.rs b/crates/bitwarden-pm/src/lib.rs index b4feb9b7d..aeb23a24d 100644 --- a/crates/bitwarden-pm/src/lib.rs +++ b/crates/bitwarden-pm/src/lib.rs @@ -24,6 +24,8 @@ pub mod clients { pub use bitwarden_send::SendClient; pub use bitwarden_vault::VaultClient; } +#[cfg(feature = "bitwarden-license")] +pub use commercial::CommercialPasswordManagerClient; /// The main entry point for the Bitwarden Password Manager SDK pub struct PasswordManagerClient(pub bitwarden_core::Client); @@ -51,8 +53,8 @@ impl PasswordManagerClient { /// Bitwarden licensed operations #[cfg(feature = "bitwarden-license")] - pub fn commercial(&self) -> commercial::CommercialPasswordManagerClient { - commercial::CommercialPasswordManagerClient::new(self.0.clone()) + pub fn commercial(&self) -> CommercialPasswordManagerClient { + CommercialPasswordManagerClient::new(self.0.clone()) } /// Crypto operations diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index d582d688a..e5b25ccdd 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -12,11 +12,17 @@ repository.workspace = true license-file.workspace = true keywords.workspace = true +[features] +bitwarden-license = ["bitwarden-pm/bitwarden-license", "dep:bitwarden-commercial-vault"] + [lib] crate-type = ["cdylib"] [dependencies] async-trait = { workspace = true } +bitwarden-commercial-vault = { workspace = true, optional = true, features = [ + "wasm", +] } bitwarden-core = { workspace = true, features = ["wasm", "internal"] } bitwarden-crypto = { workspace = true, features = ["wasm"] } bitwarden-error = { workspace = true } diff --git a/crates/bitwarden-wasm-internal/build.sh b/crates/bitwarden-wasm-internal/build.sh index 69470bddc..321e25b67 100755 --- a/crates/bitwarden-wasm-internal/build.sh +++ b/crates/bitwarden-wasm-internal/build.sh @@ -9,14 +9,33 @@ cd ../../ # Write VERSION file git rev-parse HEAD > ./crates/bitwarden-wasm-internal/npm/VERSION -if [ "$1" != "-r" ]; then - echo "Building in debug mode" - RELEASE_FLAG="" - BUILD_FOLDER="debug" -else + +# Parse flags +ENABLE_LICENSE_FEATURE="" +RELEASE_FLAG="" +BUILD_FOLDER="debug" + +while [[ $# -gt 0 ]]; do + case "$1" in + -b) + ENABLE_LICENSE_FEATURE="--features bitwarden-license" + ;; + -r) + RELEASE_FLAG="--release" + BUILD_FOLDER="release" + ;; + esac + shift +done + +if [ -n "$RELEASE_FLAG" ]; then echo "Building in release mode" - RELEASE_FLAG="--release" - BUILD_FOLDER="release" +else + echo "Building in debug mode" +fi + +if [ -n "$ENABLE_LICENSE_FEATURE" ]; then + echo "Build will include BITWARDEN LICENSED FEATURES" fi # Build with MVP CPU target, two reasons: @@ -25,7 +44,7 @@ fi # Note that this requirest build-std which is an unstable feature, # this normally requires a nightly build, but we can also use the # RUSTC_BOOTSTRAP hack to use the same stable version as the normal build -RUSTFLAGS=-Ctarget-cpu=mvp RUSTC_BOOTSTRAP=1 cargo build -p bitwarden-wasm-internal -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown ${RELEASE_FLAG} +RUSTFLAGS=-Ctarget-cpu=mvp RUSTC_BOOTSTRAP=1 cargo build -p bitwarden-wasm-internal -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown ${RELEASE_FLAG} ${ENABLE_LICENSE_FEATURE} wasm-bindgen --target bundler --out-dir crates/bitwarden-wasm-internal/npm ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm wasm-bindgen --target nodejs --out-dir crates/bitwarden-wasm-internal/npm/node ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index e7f3299a2..2c1eafa4f 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -3,7 +3,7 @@ use std::{fmt::Display, sync::Arc}; use bitwarden_core::ClientSettings; use bitwarden_error::bitwarden_error; -use bitwarden_pm::{PasswordManagerClient, clients::*}; +use bitwarden_pm::{CommercialPasswordManagerClient, PasswordManagerClient, clients::*}; use wasm_bindgen::prelude::*; use crate::platform::{ @@ -54,6 +54,12 @@ impl BitwardenClient { self.0.auth() } + /// Bitwarden licensed operations. + #[cfg(feature = "bitwarden-license")] + pub fn commercial(&self) -> CommercialPasswordManagerClient { + self.0.commercial() + } + /// Crypto related operations. pub fn crypto(&self) -> CryptoClient { self.0.0.crypto() From 713e5743e5d89b0344716ee63397f952c3a38df9 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 14:50:57 +0200 Subject: [PATCH 04/11] feat: change version name in commercial --- crates/bitwarden-wasm-internal/src/client.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 2c1eafa4f..2cec0a24c 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -33,7 +33,10 @@ impl BitwardenClient { /// Returns the current SDK version pub fn version(&self) -> String { - env!("SDK_VERSION").to_owned() + #[cfg(feature = "bitwarden-license")] + return format!("COMMERCIAL-{}", env!("SDK_VERSION")); + #[cfg(not(feature = "bitwarden-license"))] + return env!("SDK_VERSION").to_owned(); } /// Test method, always throws an error From 1ca3bc2cecddd84170bbd1b90a57ab4d95406c43 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 14:53:52 +0200 Subject: [PATCH 05/11] feat: add commercial npm package --- .../bitwarden_license/npm/.gitignore | 9 + .../bitwarden_license/npm/LICENSE | 182 ++++++++++++++++++ .../bitwarden_license/npm/README.md | 3 + .../bitwarden_license/npm/index.js | 8 + .../bitwarden_license/npm/package-lock.json | 45 +++++ .../bitwarden_license/npm/package.json | 36 ++++ 6 files changed, 283 insertions(+) create mode 100644 crates/bitwarden-wasm-internal/bitwarden_license/npm/.gitignore create mode 100644 crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE create mode 100644 crates/bitwarden-wasm-internal/bitwarden_license/npm/README.md create mode 100644 crates/bitwarden-wasm-internal/bitwarden_license/npm/index.js create mode 100644 crates/bitwarden-wasm-internal/bitwarden_license/npm/package-lock.json create mode 100644 crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/.gitignore b/crates/bitwarden-wasm-internal/bitwarden_license/npm/.gitignore new file mode 100644 index 000000000..6262ecc8b --- /dev/null +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/.gitignore @@ -0,0 +1,9 @@ +**/snippets/**/*.js +bitwarden_wasm_internal_bg.js +bitwarden_wasm_internal_bg.wasm +bitwarden_wasm_internal_bg.wasm.d.ts +bitwarden_wasm_internal_bg.wasm.js +bitwarden_wasm_internal_bg.mvp.wasm +bitwarden_wasm_internal.d.ts +bitwarden_wasm_internal.js +VERSION diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE b/crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE new file mode 100644 index 000000000..699d89f25 --- /dev/null +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE @@ -0,0 +1,182 @@ +BITWARDEN LICENSE AGREEMENT +Version 1, 4 September 2020 + +PLEASE CAREFULLY READ THIS BITWARDEN LICENSE AGREEMENT ("AGREEMENT"). THIS +AGREEMENT CONSTITUTES A LEGALLY BINDING AGREEMENT BETWEEN YOU AND BITWARDEN, +INC. ("BITWARDEN") AND GOVERNS YOUR USE OF THE COMMERCIAL MODULES (DEFINED +BELOW). BY COPYING OR USING THE COMMERCIAL MODULES, YOU AGREE TO THIS AGREEMENT. +IF YOU DO NOT AGREE WITH THIS AGREEMENT, YOU MAY NOT COPY OR USE THE COMMERCIAL +MODULES. IF YOU ARE COPYING OR USING THE COMMERCIAL MODULES ON BEHALF OF A LEGAL +ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE AUTHORITY TO AGREE TO THIS +AGREEMENT ON BEHALF OF SUCH ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, DO NOT +COPY OR USE THE COMMERCIAL MODULES IN ANY MANNER. + +This Agreement is entered into by and between Bitwarden and you, or the legal +entity on behalf of whom you are acting (as applicable, "You" or "Your"). + +1. DEFINITIONS + +"Bitwarden Software" means the Bitwarden client software, libraries, and +Commercial Modules. + +"Commercial Modules" means the modules designed to work with and enhance the +Bitwarden Software to which this Agreement is linked, referenced, or appended. + +2. LICENSES, RESTRICTIONS AND THIRD PARTY CODE + +2.1 Commercial Module License. Subject to Your compliance with this Agreement, +Bitwarden hereby grants to You a limited, non-exclusive, non-transferable, +royalty-free license to use the Commercial Modules for the sole purposes of +internal development and internal testing, and only in a non-production +environment. + +2.2 Reservation of Rights. As between Bitwarden and You, Bitwarden owns all +right, title and interest in and to the Bitwarden Software, and except as +expressly set forth in Sections 2.1, no other license to the Bitwarden Software +is granted to You under this Agreement, by implication, estoppel, or otherwise. + +2.3 Restrictions. You agree not to: (i) except as expressly permitted in +Section 2.1, sell, rent, lease, distribute, sublicense, loan or otherwise +transfer the Commercial Modules to any third party; (ii) alter or remove any +trademarks, service mark, and logo included with the Commercial Modules, or +(iii) use the Commercial Modules to create a competing product or service. +Bitwarden is not obligated to provide maintenance and support services for the +Bitwarden Software licensed under this Agreement. + +2.4 Third Party Software. The Commercial Modules may contain or be provided +with third party open source libraries, components, utilities and other open +source software (collectively, "Open Source Software"). Notwithstanding anything +to the contrary herein, use of the Open Source Software will be subject to the +license terms and conditions applicable to such Open Source Software. To the +extent any condition of this Agreement conflicts with any license to the Open +Source Software, the Open Source Software license will govern with respect to +such Open Source Software only. + +2.5 This Agreement does not grant any rights in the trademarks, service marks, or +logos of any Contributor (except as may be necessary to comply with the notice +requirements in Section 2.3), and use of any Bitwarden trademarks must comply with +Bitwarden Trademark Guidelines +. + +3. TERMINATION + +3.1 Termination. This Agreement will automatically terminate upon notice from +Bitwarden, which notice may be by email or posting in the location where the +Commercial Modules are made available. + +3.2 Effect of Termination. Upon any termination of this Agreement, for any +reason, You will promptly cease use of the Commercial Modules and destroy any +copies thereof. For the avoidance of doubt, termination of this Agreement will +not affect Your right to Bitwarden Software, other than the Commercial Modules, +made available pursuant to an Open Source Software license. + +3.3 Survival. Sections 1, 2.2 -2.4, 3.2, 3.3, 4, and 5 will survive any +termination of this Agreement. + +4. DISCLAIMER AND LIMITATION OF LIABILITY + +4.1 Disclaimer of Warranties. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE +LAW, THE BITWARDEN SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED REGARDING OR RELATING TO THE BITWARDEN SOFTWARE, INCLUDING +ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, +TITLE, AND NON-INFRINGEMENT. FURTHER, BITWARDEN DOES NOT WARRANT RESULTS OF USE +OR THAT THE BITWARDEN SOFTWARE WILL BE ERROR FREE OR THAT THE USE OF THE +BITWARDEN SOFTWARE WILL BE UNINTERRUPTED. + +4.2 Limitation of Liability. IN NO EVENT WILL BITWARDEN OR ITS LICENSORS BE +LIABLE TO YOU OR ANY THIRD PARTY UNDER THIS AGREEMENT FOR (I) ANY AMOUNTS IN +EXCESS OF US $25 OR (II) FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF +ANY KIND, INCLUDING FOR ANY LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION, +LOSS OF DATA, COST OF SUBSTITUTE GOODS OR SERVICES, WHETHER ALLEGED AS A BREACH +OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, EVEN IF BITWARDEN HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +5. MISCELLANEOUS + +5.1 Assignment. You may not assign or otherwise transfer this Agreement or any +rights or obligations hereunder, in whole or in part, whether by operation of +law or otherwise, to any third party without Bitwarden's prior written consent. +Any purported transfer, assignment or delegation without such prior written +consent will be null and void and of no force or effect. Bitwarden may assign +this Agreement to any successor to its business or assets to which this +Agreement relates, whether by merger, sale of assets, sale of stock, +reorganization or otherwise. Subject to this Section 5.1, this Agreement will be +binding upon and inure to the benefit of the parties hereto, and their +respective successors and permitted assigns. + +5.2 Entire Agreement; Modification; Waiver. This Agreement represents the +entire agreement between the parties, and supersedes all prior agreements and +understandings, written or oral, with respect to the matters covered by this +Agreement, and is not intended to confer upon any third party any rights or +remedies hereunder. You acknowledge that You have not entered in this Agreement +based on any representations other than those contained herein. No modification +of or amendment to this Agreement, nor any waiver of any rights under this +Agreement, will be effective unless in writing and signed by both parties. The +waiver of one breach or default or any delay in exercising any rights will not +constitute a waiver of any subsequent breach or default. + +5.3 Governing Law. This Agreement will in all respects be governed by the laws +of the State of California without reference to its principles of conflicts of +laws. The parties hereby agree that all disputes arising out of this Agreement +will be subject to the exclusive jurisdiction of and venue in the federal and +state courts within Los Angeles County, California. You hereby consent to the +personal and exclusive jurisdiction and venue of these courts. The parties +hereby disclaim and exclude the application hereto of the United Nations +Convention on Contracts for the International Sale of Goods. + +5.4 Severability. If any provision of this Agreement is held invalid or +unenforceable under applicable law by a court of competent jurisdiction, it will +be replaced with the valid provision that most closely reflects the intent of +the parties and the remaining provisions of the Agreement will remain in full +force and effect. + +5.5 Relationship of the Parties. Nothing in this Agreement is to be construed +as creating an agency, partnership, or joint venture relationship between the +parties hereto. Neither party will have any right or authority to assume or +create any obligations or to make any representations or warranties on behalf of +any other party, whether express or implied, or to bind the other party in any +respect whatsoever. + +5.6 Notices. All notices permitted or required under this Agreement will be in +writing and will be deemed to have been given when delivered in person +(including by overnight courier), or three (3) business days after being mailed +by first class, registered or certified mail, postage prepaid, to the address of +the party specified in this Agreement or such other address as either party may +specify in writing. + +5.7 U.S. Government Restricted Rights. If Commercial Modules is being licensed +by the U.S. Government, the Commercial Modules is deemed to be "commercial +computer software" and "commercial computer documentation" developed exclusively +at private expense, and (a) if acquired by or on behalf of a civilian agency, +will be subject solely to the terms of this computer software license as +specified in 48 C.F.R. 12.212 of the Federal Acquisition Regulations and its +successors; and (b) if acquired by or on behalf of units of the Department of +Defense ("DOD") will be subject to the terms of this commercial computer +software license as specified in 48 C.F.R. 227.7202-2, DOD FAR Supplement and +its successors. + +5.8 Injunctive Relief. A breach or threatened breach by You of Section 2 may +cause irreparable harm for which damages at law may not provide adequate relief, +and therefore Bitwarden will be entitled to seek injunctive relief in any +applicable jurisdiction without being required to post a bond. + +5.9 Export Law Assurances. You understand that the Commercial Modules is +subject to export control laws and regulations. You may not download or +otherwise export or re-export the Commercial Modules or any underlying +information or technology except in full compliance with all applicable laws and +regulations, in particular, but without limitation, United States export control +laws. None of the Commercial Modules or any underlying information or technology +may be downloaded or otherwise exported or re- exported: (a) into (or to a +national or resident of) any country to which the United States has embargoed +goods; or (b) to anyone on the U.S. Treasury Department's list of specially +designated nationals or the U.S. Commerce Department's list of prohibited +countries or debarred or denied persons or entities. You hereby agree to the +foregoing and represents and warrants that You are not located in, under control +of, or a national or resident of any such country or on any such list. + +5.10 Construction. The titles and section headings used in this Agreement are +for ease of reference only and will not be used in the interpretation or +construction of this Agreement. No rule of construction resolving any ambiguity +in favor of the non-drafting party will be applied hereto. The word "including", +when used herein, is illustrative rather than exclusive and means "including, +without limitation." diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/README.md b/crates/bitwarden-wasm-internal/bitwarden_license/npm/README.md new file mode 100644 index 000000000..65225a96c --- /dev/null +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/README.md @@ -0,0 +1,3 @@ +# @bitwarden/commercial-sdk-internal + +**Note:** This is only for internal use. Bitwarden will not provide any support for this package. diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/index.js b/crates/bitwarden-wasm-internal/bitwarden_license/npm/index.js new file mode 100644 index 000000000..0525f7aa4 --- /dev/null +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/index.js @@ -0,0 +1,8 @@ +import { __wbg_set_wasm } from "./bitwarden_wasm_internal_bg.js"; + +// In order to support a fallback strategy for web we need to conditionally load the wasm file +export function init(wasm) { + __wbg_set_wasm(wasm); +} + +export * from "./bitwarden_wasm_internal_bg.js"; diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/package-lock.json b/crates/bitwarden-wasm-internal/bitwarden_license/npm/package-lock.json new file mode 100644 index 000000000..f7d99b0bb --- /dev/null +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/package-lock.json @@ -0,0 +1,45 @@ +{ + "name": "@bitwarden/commercial-sdk-internal", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@bitwarden/commercial-sdk-internal", + "version": "0.1.0", + "license": "GPL-3.0", + "dependencies": { + "type-fest": "^4.41.0" + }, + "devDependencies": { + "typescript": "5.9.2" + } + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json b/crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json new file mode 100644 index 000000000..8d5f641f7 --- /dev/null +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json @@ -0,0 +1,36 @@ +{ + "name": "@bitwarden/commercial-sdk-internal", + "version": "0.1.0", + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "git+https://github.com/bitwarden/sdk-internal.git" + }, + "files": [ + "bitwarden_wasm_internal_bg.js", + "bitwarden_wasm_internal_bg.wasm.d.ts", + "bitwarden_wasm_internal_bg.wasm.js", + "bitwarden_wasm_internal_bg.wasm", + "bitwarden_wasm_internal.d.ts", + "bitwarden_wasm_internal.js", + "index.js", + "node/bitwarden_wasm_internal_bg.wasm.d.ts", + "node/bitwarden_wasm_internal_bg.wasm", + "node/bitwarden_wasm_internal.d.ts", + "node/bitwarden_wasm_internal.js", + "VERSION" + ], + "main": "node/bitwarden_wasm_internal.js", + "module": "index.js", + "types": "bitwarden_wasm_internal.d.ts", + "scripts": {}, + "sideEffects": [ + "./bitwarden_wasm_internal.js" + ], + "dependencies": { + "type-fest": "^4.41.0" + }, + "devDependencies": { + "typescript": "5.9.2" + } +} From 046d7259b0326e04d6ca5c572047a85c8aed1596 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 14:58:34 +0200 Subject: [PATCH 06/11] feat: build commercial npm package --- crates/bitwarden-wasm-internal/build.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/bitwarden-wasm-internal/build.sh b/crates/bitwarden-wasm-internal/build.sh index 321e25b67..5024bf783 100755 --- a/crates/bitwarden-wasm-internal/build.sh +++ b/crates/bitwarden-wasm-internal/build.sh @@ -12,6 +12,7 @@ git rev-parse HEAD > ./crates/bitwarden-wasm-internal/npm/VERSION # Parse flags ENABLE_LICENSE_FEATURE="" +NPM_FOLDER="npm" RELEASE_FLAG="" BUILD_FOLDER="debug" @@ -19,6 +20,7 @@ while [[ $# -gt 0 ]]; do case "$1" in -b) ENABLE_LICENSE_FEATURE="--features bitwarden-license" + NPM_FOLDER="bitwarden_license/npm" ;; -r) RELEASE_FLAG="--release" @@ -45,20 +47,20 @@ fi # this normally requires a nightly build, but we can also use the # RUSTC_BOOTSTRAP hack to use the same stable version as the normal build RUSTFLAGS=-Ctarget-cpu=mvp RUSTC_BOOTSTRAP=1 cargo build -p bitwarden-wasm-internal -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown ${RELEASE_FLAG} ${ENABLE_LICENSE_FEATURE} -wasm-bindgen --target bundler --out-dir crates/bitwarden-wasm-internal/npm ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm -wasm-bindgen --target nodejs --out-dir crates/bitwarden-wasm-internal/npm/node ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm +wasm-bindgen --target bundler --out-dir crates/bitwarden-wasm-internal/${NPM_FOLDER} ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm +wasm-bindgen --target nodejs --out-dir crates/bitwarden-wasm-internal/${NPM_FOLDER}/node ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm # Format -npx prettier --write ./crates/bitwarden-wasm-internal/npm +npx prettier --write ./crates/bitwarden-wasm-internal/${NPM_FOLDER} # Optimize size -wasm-opt -Os ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm -wasm-opt -Os ./crates/bitwarden-wasm-internal/npm/node/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/npm/node/bitwarden_wasm_internal_bg.wasm +wasm-opt -Os ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/bitwarden_wasm_internal_bg.wasm +wasm-opt -Os ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/node/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/node/bitwarden_wasm_internal_bg.wasm # Transpile to JS -wasm2js -Os ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js -npx terser ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js -o ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js +wasm2js -Os ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/bitwarden_wasm_internal_bg.wasm.js +npx terser ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/bitwarden_wasm_internal_bg.wasm.js -o ./crates/bitwarden-wasm-internal/${NPM_FOLDER}/bitwarden_wasm_internal_bg.wasm.js # Typecheck the generated TypeScript definitions -cd crates/bitwarden-wasm-internal/npm +cd crates/bitwarden-wasm-internal/${NPM_FOLDER} npx tsc --noEmit --lib es2020,dom bitwarden_wasm_internal.d.ts From c8d7306c94414418296979c997f93434a4e0e33e Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 15:14:46 +0200 Subject: [PATCH 07/11] feat: add commercial CI build --- .github/workflows/build-wasm-internal.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 8e224259c..4b46b1bd9 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -16,10 +16,21 @@ defaults: jobs: build: - name: Building @bitwarden/sdk-wasm-internal + name: Building @bitwarden/sdk-wasm-internal - ${{matrix.license_type.readable}} runs-on: ubuntu-24.04 permissions: contents: read + strategy: + matrix: + license_type: + - artifact_name: "wasm-internal" + build_flags: "" + npm_folder: "npm" + readable: "open source license" + - artifact_name: "commercial-wasm-internal" + build_flags: "-b" + npm_folder: "bitwarden_license/npm" + readable: "commercial license" steps: - name: Checkout repo @@ -64,7 +75,7 @@ jobs: - name: NPM setup run: npm ci - working-directory: crates/bitwarden-wasm-internal/npm + working-directory: crates/bitwarden-wasm-internal/${{ matrix.license_type.npm_folder }} - name: Install rust uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # stable @@ -82,13 +93,13 @@ jobs: run: cargo install wasm-bindgen-cli --version 0.2.100 - name: Build - run: ./build.sh -r + run: ./build.sh -r ${{ matrix.license_type.build_flags }} - name: Upload artifact uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: - name: sdk-internal - path: ${{ github.workspace }}/crates/bitwarden-wasm-internal/npm/* + name: ${{ matrix.license_type.artifact_name }} + path: ${{ github.workspace }}/crates/bitwarden-wasm-internal/${{ matrix.license_type.npm_folder }}/* if-no-files-found: error trigger-wasm-publish: From ca6c4c54e00bc537d2827696a9710a45c5b3f2d8 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 30 Sep 2025 15:23:11 +0200 Subject: [PATCH 08/11] fix: commercial code being imported when not enabled --- crates/bitwarden-wasm-internal/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index 2cec0a24c..f9f57ae4c 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -59,7 +59,7 @@ impl BitwardenClient { /// Bitwarden licensed operations. #[cfg(feature = "bitwarden-license")] - pub fn commercial(&self) -> CommercialPasswordManagerClient { + pub fn commercial(&self) -> bitwarden_pm::CommercialPasswordManagerClient { self.0.commercial() } From b0d28c20c2ed668f47ff9d0b03c28ffb7f49029a Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Wed, 1 Oct 2025 13:58:04 +0200 Subject: [PATCH 09/11] feat: add some docs for building commercial --- crates/bitwarden-wasm-internal/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bitwarden-wasm-internal/README.md b/crates/bitwarden-wasm-internal/README.md index e4727ed38..95a3e6a87 100644 --- a/crates/bitwarden-wasm-internal/README.md +++ b/crates/bitwarden-wasm-internal/README.md @@ -26,6 +26,12 @@ brew install binaryen # dev ./build.sh +# dev with commercial license +./build.sh -b + # release ./build.sh -r + +# release with commercial license +./build.sh -r -b ``` From 3cb687849e40c3b7826e4f631bc9efa01c8ea5fe Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 7 Oct 2025 15:59:34 +0200 Subject: [PATCH 10/11] chore: clean up unused import --- crates/bitwarden-wasm-internal/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bitwarden-wasm-internal/src/client.rs b/crates/bitwarden-wasm-internal/src/client.rs index f9f57ae4c..fd5be70b4 100644 --- a/crates/bitwarden-wasm-internal/src/client.rs +++ b/crates/bitwarden-wasm-internal/src/client.rs @@ -3,7 +3,7 @@ use std::{fmt::Display, sync::Arc}; use bitwarden_core::ClientSettings; use bitwarden_error::bitwarden_error; -use bitwarden_pm::{CommercialPasswordManagerClient, PasswordManagerClient, clients::*}; +use bitwarden_pm::{PasswordManagerClient, clients::*}; use wasm_bindgen::prelude::*; use crate::platform::{ From 46b59e60df7d924e0fc5060c4aa61d2a056343f8 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 7 Oct 2025 16:39:46 +0200 Subject: [PATCH 11/11] fix: update npm license --- .../bitwarden_license/npm/LICENSE | 477 +++++++++++------- .../bitwarden_license/npm/package.json | 2 +- 2 files changed, 296 insertions(+), 183 deletions(-) diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE b/crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE index 699d89f25..0742be808 100644 --- a/crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/LICENSE @@ -1,182 +1,295 @@ -BITWARDEN LICENSE AGREEMENT -Version 1, 4 September 2020 - -PLEASE CAREFULLY READ THIS BITWARDEN LICENSE AGREEMENT ("AGREEMENT"). THIS -AGREEMENT CONSTITUTES A LEGALLY BINDING AGREEMENT BETWEEN YOU AND BITWARDEN, -INC. ("BITWARDEN") AND GOVERNS YOUR USE OF THE COMMERCIAL MODULES (DEFINED -BELOW). BY COPYING OR USING THE COMMERCIAL MODULES, YOU AGREE TO THIS AGREEMENT. -IF YOU DO NOT AGREE WITH THIS AGREEMENT, YOU MAY NOT COPY OR USE THE COMMERCIAL -MODULES. IF YOU ARE COPYING OR USING THE COMMERCIAL MODULES ON BEHALF OF A LEGAL -ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE AUTHORITY TO AGREE TO THIS -AGREEMENT ON BEHALF OF SUCH ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, DO NOT -COPY OR USE THE COMMERCIAL MODULES IN ANY MANNER. - -This Agreement is entered into by and between Bitwarden and you, or the legal -entity on behalf of whom you are acting (as applicable, "You" or "Your"). - -1. DEFINITIONS - -"Bitwarden Software" means the Bitwarden client software, libraries, and -Commercial Modules. - -"Commercial Modules" means the modules designed to work with and enhance the -Bitwarden Software to which this Agreement is linked, referenced, or appended. - -2. LICENSES, RESTRICTIONS AND THIRD PARTY CODE - -2.1 Commercial Module License. Subject to Your compliance with this Agreement, -Bitwarden hereby grants to You a limited, non-exclusive, non-transferable, -royalty-free license to use the Commercial Modules for the sole purposes of -internal development and internal testing, and only in a non-production -environment. - -2.2 Reservation of Rights. As between Bitwarden and You, Bitwarden owns all -right, title and interest in and to the Bitwarden Software, and except as -expressly set forth in Sections 2.1, no other license to the Bitwarden Software -is granted to You under this Agreement, by implication, estoppel, or otherwise. - -2.3 Restrictions. You agree not to: (i) except as expressly permitted in -Section 2.1, sell, rent, lease, distribute, sublicense, loan or otherwise -transfer the Commercial Modules to any third party; (ii) alter or remove any -trademarks, service mark, and logo included with the Commercial Modules, or -(iii) use the Commercial Modules to create a competing product or service. -Bitwarden is not obligated to provide maintenance and support services for the -Bitwarden Software licensed under this Agreement. - -2.4 Third Party Software. The Commercial Modules may contain or be provided -with third party open source libraries, components, utilities and other open -source software (collectively, "Open Source Software"). Notwithstanding anything -to the contrary herein, use of the Open Source Software will be subject to the -license terms and conditions applicable to such Open Source Software. To the -extent any condition of this Agreement conflicts with any license to the Open -Source Software, the Open Source Software license will govern with respect to -such Open Source Software only. - -2.5 This Agreement does not grant any rights in the trademarks, service marks, or -logos of any Contributor (except as may be necessary to comply with the notice -requirements in Section 2.3), and use of any Bitwarden trademarks must comply with -Bitwarden Trademark Guidelines -. - -3. TERMINATION - -3.1 Termination. This Agreement will automatically terminate upon notice from -Bitwarden, which notice may be by email or posting in the location where the -Commercial Modules are made available. - -3.2 Effect of Termination. Upon any termination of this Agreement, for any -reason, You will promptly cease use of the Commercial Modules and destroy any -copies thereof. For the avoidance of doubt, termination of this Agreement will -not affect Your right to Bitwarden Software, other than the Commercial Modules, -made available pursuant to an Open Source Software license. - -3.3 Survival. Sections 1, 2.2 -2.4, 3.2, 3.3, 4, and 5 will survive any -termination of this Agreement. - -4. DISCLAIMER AND LIMITATION OF LIABILITY - -4.1 Disclaimer of Warranties. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE -LAW, THE BITWARDEN SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED REGARDING OR RELATING TO THE BITWARDEN SOFTWARE, INCLUDING -ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, -TITLE, AND NON-INFRINGEMENT. FURTHER, BITWARDEN DOES NOT WARRANT RESULTS OF USE -OR THAT THE BITWARDEN SOFTWARE WILL BE ERROR FREE OR THAT THE USE OF THE -BITWARDEN SOFTWARE WILL BE UNINTERRUPTED. - -4.2 Limitation of Liability. IN NO EVENT WILL BITWARDEN OR ITS LICENSORS BE -LIABLE TO YOU OR ANY THIRD PARTY UNDER THIS AGREEMENT FOR (I) ANY AMOUNTS IN -EXCESS OF US $25 OR (II) FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF -ANY KIND, INCLUDING FOR ANY LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION, -LOSS OF DATA, COST OF SUBSTITUTE GOODS OR SERVICES, WHETHER ALLEGED AS A BREACH -OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, EVEN IF BITWARDEN HAS -BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -5. MISCELLANEOUS - -5.1 Assignment. You may not assign or otherwise transfer this Agreement or any -rights or obligations hereunder, in whole or in part, whether by operation of -law or otherwise, to any third party without Bitwarden's prior written consent. -Any purported transfer, assignment or delegation without such prior written -consent will be null and void and of no force or effect. Bitwarden may assign -this Agreement to any successor to its business or assets to which this -Agreement relates, whether by merger, sale of assets, sale of stock, -reorganization or otherwise. Subject to this Section 5.1, this Agreement will be -binding upon and inure to the benefit of the parties hereto, and their -respective successors and permitted assigns. - -5.2 Entire Agreement; Modification; Waiver. This Agreement represents the -entire agreement between the parties, and supersedes all prior agreements and -understandings, written or oral, with respect to the matters covered by this -Agreement, and is not intended to confer upon any third party any rights or -remedies hereunder. You acknowledge that You have not entered in this Agreement -based on any representations other than those contained herein. No modification -of or amendment to this Agreement, nor any waiver of any rights under this -Agreement, will be effective unless in writing and signed by both parties. The -waiver of one breach or default or any delay in exercising any rights will not -constitute a waiver of any subsequent breach or default. - -5.3 Governing Law. This Agreement will in all respects be governed by the laws -of the State of California without reference to its principles of conflicts of -laws. The parties hereby agree that all disputes arising out of this Agreement -will be subject to the exclusive jurisdiction of and venue in the federal and -state courts within Los Angeles County, California. You hereby consent to the -personal and exclusive jurisdiction and venue of these courts. The parties -hereby disclaim and exclude the application hereto of the United Nations -Convention on Contracts for the International Sale of Goods. - -5.4 Severability. If any provision of this Agreement is held invalid or -unenforceable under applicable law by a court of competent jurisdiction, it will -be replaced with the valid provision that most closely reflects the intent of -the parties and the remaining provisions of the Agreement will remain in full -force and effect. - -5.5 Relationship of the Parties. Nothing in this Agreement is to be construed -as creating an agency, partnership, or joint venture relationship between the -parties hereto. Neither party will have any right or authority to assume or -create any obligations or to make any representations or warranties on behalf of -any other party, whether express or implied, or to bind the other party in any -respect whatsoever. - -5.6 Notices. All notices permitted or required under this Agreement will be in -writing and will be deemed to have been given when delivered in person -(including by overnight courier), or three (3) business days after being mailed -by first class, registered or certified mail, postage prepaid, to the address of -the party specified in this Agreement or such other address as either party may -specify in writing. - -5.7 U.S. Government Restricted Rights. If Commercial Modules is being licensed -by the U.S. Government, the Commercial Modules is deemed to be "commercial -computer software" and "commercial computer documentation" developed exclusively -at private expense, and (a) if acquired by or on behalf of a civilian agency, -will be subject solely to the terms of this computer software license as -specified in 48 C.F.R. 12.212 of the Federal Acquisition Regulations and its -successors; and (b) if acquired by or on behalf of units of the Department of -Defense ("DOD") will be subject to the terms of this commercial computer -software license as specified in 48 C.F.R. 227.7202-2, DOD FAR Supplement and -its successors. - -5.8 Injunctive Relief. A breach or threatened breach by You of Section 2 may -cause irreparable harm for which damages at law may not provide adequate relief, -and therefore Bitwarden will be entitled to seek injunctive relief in any -applicable jurisdiction without being required to post a bond. - -5.9 Export Law Assurances. You understand that the Commercial Modules is -subject to export control laws and regulations. You may not download or -otherwise export or re-export the Commercial Modules or any underlying -information or technology except in full compliance with all applicable laws and -regulations, in particular, but without limitation, United States export control -laws. None of the Commercial Modules or any underlying information or technology -may be downloaded or otherwise exported or re- exported: (a) into (or to a -national or resident of) any country to which the United States has embargoed -goods; or (b) to anyone on the U.S. Treasury Department's list of specially -designated nationals or the U.S. Commerce Department's list of prohibited -countries or debarred or denied persons or entities. You hereby agree to the -foregoing and represents and warrants that You are not located in, under control -of, or a national or resident of any such country or on any such list. - -5.10 Construction. The titles and section headings used in this Agreement are -for ease of reference only and will not be used in the interpretation or -construction of this Agreement. No rule of construction resolving any ambiguity -in favor of the non-drafting party will be applied hereto. The word "including", -when used herein, is illustrative rather than exclusive and means "including, -without limitation." +BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT +Version 2, 7 October 2025 + +1. Introduction + +1.1 The Bitwarden Software Development Kit (referred to in the License Agreement +as the "SDK" and available for download at the following URL +https://github.com/bitwarden/sdk-internal) is licensed to you subject to the terms of +this License Agreement. The License Agreement forms a legally binding contract +between you and the Company in relation to your use of the SDK. + +1.2 "Bitwarden" means the Bitwarden software made available by the Company, +available for download at the following URL, as updated from time to time. + +1.3 A "Compatible Application" means any software program or service that (i) +connects to and interoperates with a current version of the Bitwarden server +products distributed by the Company; and (ii) complies with the Company’s +acceptable use policy available at the following URL: +https://bitwarden.com/terms/#acceptable_use. + +1.4 "Company" means Bitwarden Inc., organized under the laws of the State of +Delaware. + +2. Accepting this License Agreement + +2.1 In order to access or use the SDK, you must first agree to the License +Agreement. You may not access or use the SDK if you do not accept the License +Agreement. + +2.2 By clicking to accept and/or accessing or using the SDK, you hereby agree to +the terms of the License Agreement. + +2.3 You may not access or use the SDK and may not accept the License Agreement +if you are a person barred from receiving the SDK under the laws of the United +States or other countries, including the country in which you are resident or +from which you access or use the SDK. + +2.4 If you are agreeing to be bound by the License Agreement on behalf of your +employer or any other entity, you represent and warrant that you have full legal +authority to bind your employer or such other entity to the License Agreement. +If you do not have the requisite authority, you may not accept the License +Agreement or you may not access or use the SDK on behalf of your employer or +other entity. + +3. SDK License from Bitwarden + +3.1 Subject to the terms of this License Agreement, Bitwarden grants you a +limited, worldwide, royalty-free, non-assignable, non-exclusive, and +non-sublicensable license to use the SDK solely (a) to develop, test, and +demonstrate a Compatible Application; (b) to develop, test, and run a Compatible +Application for personal use by your family; or (c) to to develop, test, and run +a Compatible Application for the internal business operations of your +organization in connection with a paid license for a Bitwarden server product, +provided that in no case above may the Compatible Application be offered, +licensed, or sold to a third party. + +3.2 You agree that Bitwarden or third parties own all legal right, title and +interest in and to the SDK, including any Intellectual Property Rights that +subsist in the SDK. "Intellectual Property Rights" means any and all rights +under patent law, copyright law, trade secret law, trademark law, and any and +all other proprietary rights. Bitwarden reserves all rights not expressly +granted to you. + +3.3 You may not use this SDK to develop applications for use with software other +than Bitwarden (including non-compatible implementations of Bitwarden) or to +develop another SDK. + +3.4 You may not use the SDK for any purpose not expressly permitted by the +License Agreement. Except for contributions to Bitwarden pursuant to the +Contribution License Agreement available at this URL: +https://cla-assistant.io/bitwarden/clients, or to the extent required by +applicable third party licenses, you may not copy modify, adapt, redistribute, +decompile, reverse engineer, disassemble, or create derivative works of the SDK +or any part of the SDK. + +3.5 Use, reproduction, and distribution of a component of the SDK licensed under +an open source software license are governed solely by the terms of that open +source software license and not the License Agreement. + +3.6 You agree that the form and nature of the SDK that the Company provides may +change without prior notice to you and that future versions of the SDK may be +incompatible with applications developed on previous versions of the SDK. You +agree that the Company may stop (permanently or temporarily) providing the SDK +or any features within the SDK to you or to users generally at the Company’s +sole discretion, without prior notice to you. + +3.7 Nothing in the License Agreement gives you a right to use any of the +Company’s trade names, trademarks, service marks, logos, domain names, or other +distinctive brand features. + +3.8 You agree that you will not remove, obscure, or alter any proprietary rights +notices (including copyright and trademark notices) that may be affixed to or +contained within the SDK. + +4. Use of the SDK by You + +4.1 The Company agrees that it obtains no right, title, or interest from you (or +your licensors) under the License Agreement in or to any software applications +that you develop using the SDK, including any Intellectual Property Rights that +subsist in those applications. + +4.2 You agree to use the SDK and write applications only for purposes that are +permitted by (a) the License Agreement and (b) any applicable law, regulation or +generally accepted practices or guidelines in the relevant jurisdictions +(including any laws regarding the export of data or software to and from the +United States or other relevant countries). + +4.3 You agree that if you use the SDK to develop applications for other users, +you will protect the privacy and legal rights of those users. If the users +provide you with user names, passwords, or other login information or personal +information, you must make the users aware that the information will be +available to your application, and you must provide legally adequate privacy +notice and protection for those users. If your application stores personal or +sensitive information provided by users, it must do so securely. If the user +provides your application with Bitwarden Account information, your application +may only use that information to access the user's Bitwarden Account when, and +for the limited purposes for which, the user has given you permission to do so. + +4.4 You agree that you will not engage in any activity with the SDK, including +the development or distribution of an application, that interferes with, +disrupts, damages, or accesses in an unauthorized manner the servers, networks, +or other properties or services of any third party including, but not limited +to, the Company, or any mobile communications carrier or public cloud service. + +4.5 If you use the SDK to retrieve a user's data from Bitwarden, you acknowledge +and agree that you shall retrieve data only with the user's explicit consent and +only when, and for the limited purposes for which, the user has given you +permission to do so. + +4.6 You agree that you are solely responsible for, and that the Company has no +responsibility to you or to any third party for, any data, content, or resources +that you create, transmit or display through Bitwarden and/or applications for +Bitwarden, and for the consequences of your actions (including any loss or +damage which Bitwarden may suffer) by doing so. + +4.7 You agree that you are solely responsible for, and that the Company has no +responsibility to you or to any third party for, any breach of your obligations +under the License Agreement, any applicable third party contract or Terms of +Service, or any applicable law or regulation, and for the consequences +(including any loss or damage which the Company or any third party may suffer) +of any such breach. + +5. Third Party Applications + +5.1 If you use the SDK to integrate or run applications developed by a third +party or that access data, content or resources provided by a third party, you +agree that the Company is not responsible for those applications, data, content, +or resources. You understand that all data, content or resources which you may +access through such third party applications are the sole responsibility of the +person from which they originated and that the Company is not liable for any +loss or damage that you may experience as a result of the use or access of any +of those third party applications, data, content, or resources. + +5.2 You should be aware that the data, content, and resources presented to you +through such a third party application may be protected by intellectual property +rights which are owned by the providers (or by other persons or companies on +their behalf). You acknowledge that your use of such third party applications, +data, content, or resources may be subject to separate terms between you and the +relevant third party. In that case, the License Agreement does not affect your +legal relationship with these third parties. + +6. Use of Bitwarden Server + +You acknowledge and agree that the Bitwarden server products to which any +Compatible Application must connect is protected by intellectual property rights +which are owned by the Company and your use of the Bitwarden server products is +subject to additional terms not set forth in this License Agreement. + +7. Terminating this License Agreement + +7.1 The License Agreement will continue to apply until terminated by either you +or the Company as set out below. + +7.2 If you want to terminate the License Agreement, you may do so by ceasing +your use of the SDK and any relevant developer credentials. + +7.3 The Company may at any time, terminate the License Agreement with you if: + +(a) you have breached any provision of the License Agreement; or + +(b) the Company is required to do so by law; or + +(c) a third party with whom the Company offered certain parts of the SDK to you +has terminated its relationship with the Company or ceased to offer certain +parts of the SDK to either the Company or to you; or + +(d) the Company decides to no longer provide the SDK or certain parts of the SDK +to users in the country in which you are resident or from which you use the +service, or the provision of the SDK or certain SDK services to you by the +Company is, in the Company’'s sole discretion, no longer commercially viable or +technically practicable. + +7.4 When the License Agreement comes to an end, all of the legal rights, +obligations and liabilities that you and the Company have benefited from, been +subject to (or which have accrued over time whilst the License Agreement has +been in force) or which are expressed to continue indefinitely, shall be +unaffected by this cessation, and the provisions of paragraph 12.8 shall +continue to apply to such rights, obligations and liabilities indefinitely. + +8. NO SUPPORT + +The Company is not obligated under this License Agreement to provide you any +support services for the SDK. Any support provided is at the Company’s sole +discretion and provided on an "as is" basis and without warranty of any kind. + +9. DISCLAIMER OF WARRANTIES + +9.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE +RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF +ANY KIND FROM Bitwarden. + +9.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED +THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY +RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF +DATA THAT RESULTS FROM SUCH USE. + +9.3 THE COMPANY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY +KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED +WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE +AND NON-INFRINGEMENT. + +10. LIMITATION OF LIABILITY + +YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE COMPANY, ITS SUBSIDIARIES AND +AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF +LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, +STATUTORY, OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS +OF DATA, WHETHER OR NOT THE COMPANY OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF +OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. + +11. Indemnification + +To the maximum extent permitted by law, you agree to defend, indemnify and hold +harmless the Company, its affiliates and their respective directors, officers, +employees and agents from and against any and all claims, actions, suits or +proceedings, as well as any and all losses, liabilities, damages, costs and +expenses (including reasonable attorneys fees) arising out of or accruing from +(a) your use of the SDK, (b) any application you develop on the SDK that +infringes any copyright, trademark, trade secret, trade dress, patent or other +intellectual property right of any person or defames any person or violates +their rights of publicity or privacy, and (c) any non-compliance by you with the +License Agreement. + +12. General Legal Terms + +12.1 The Company may make changes to the License Agreement as it distributes new +versions of the SDK. When these changes are made, the Company will make a new +version of the License Agreement available on the website where the SDK is made +available. + +12.2 The License Agreement constitutes the whole legal agreement between you and +the Company and governs your use of the SDK (excluding any services or software +which the Company may provide to you under a separate written agreement), and +completely replaces any prior agreements between you and the Company in relation +to the SDK. + +12.3 You agree that if the Company does not exercise or enforce any legal right +or remedy which is contained in the License Agreement (or which the Company has +the benefit of under any applicable law), this will not be taken to be a formal +waiver of the Company's rights and that those rights or remedies will still be +available to the Company. + +12.4 If any court of law, having the jurisdiction to decide on this matter, +rules that any provision of the License Agreement is invalid, then that +provision will be removed from the License Agreement without affecting the rest +of the License Agreement. The remaining provisions of the License Agreement will +continue to be valid and enforceable. + +12.5 You acknowledge and agree that each member of the group of companies of +which the Company is the parent shall be third party beneficiaries to the +License Agreement and that such other companies shall be entitled to directly +enforce, and rely upon, any provision of the License Agreement that confers a +benefit on them or rights in favor of them. Other than this, no other person or +company shall be third party beneficiaries to the License Agreement. + +12.6 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND +REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND +REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON +DESTINATIONS, END USERS, AND END USE. + +12.7 The rights granted in the License Agreement may not be assigned or +transferred by either you or the Company without the prior written approval of +the other party, provided that the Company may assign this License Agreement +upon notice to you in connection with an acquisition, merger, sale of assets, or +similar corporate change in control for the Company or the Intellectual Property +Rights in the SDK. + +12.8 The License Agreement, and any dispute relating to or arising out of this +License Agreement, shall be governed by the laws of the State of California +without regard to its conflict of laws provisions. You and the Company agree to +submit to the exclusive jurisdiction of the courts located within the county of +Los Angeles, California to resolve any dispute or legal matter arising from the +License Agreement. Notwithstanding this, you agree that the Company shall be +allowed to apply for injunctive remedies, or any equivalent type of urgent legal +relief, in any forum or jurisdiction. diff --git a/crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json b/crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json index 8d5f641f7..84c10ea5a 100644 --- a/crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json +++ b/crates/bitwarden-wasm-internal/bitwarden_license/npm/package.json @@ -1,7 +1,7 @@ { "name": "@bitwarden/commercial-sdk-internal", "version": "0.1.0", - "license": "GPL-3.0", + "license": "BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT", "repository": { "type": "git", "url": "git+https://github.com/bitwarden/sdk-internal.git"