Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7ee42d5
Add Send functionality to rust CLI
adudek-bw Jun 8, 2026
dcc75e1
PR fixes
adudek-bw Jun 8, 2026
176c1c9
Merge branch 'main' into tools/pm-34719/add-send-commands-to-rust-cli-2
adudek-bw Jun 8, 2026
b6871b3
PR fixes
adudek-bw Jun 8, 2026
6a674f2
Merge branch 'tools/pm-34719/add-send-commands-to-rust-cli-2' of gith…
adudek-bw Jun 8, 2026
b5f47fd
Merge branch 'main' into tools/pm-34719/add-send-commands-to-rust-cli-2
adudek-bw Jun 9, 2026
8092c14
PR fix
adudek-bw Jun 9, 2026
5038c1a
PR fix
adudek-bw Jun 10, 2026
358c840
Merge branch 'main' into tools/pm-34719/add-send-commands-to-rust-cli-2
adudek-bw Jun 10, 2026
47b4865
PR fix
adudek-bw Jun 10, 2026
2aac235
Merge branch 'tools/pm-34719/add-send-commands-to-rust-cli-2' of gith…
adudek-bw Jun 10, 2026
2718bef
Merge branch 'main' into tools/pm-34719/add-send-commands-to-rust-cli-2
adudek-bw Jun 12, 2026
4e7f043
PR fixes
adudek-bw Jun 17, 2026
1113cf1
Update crates/bw/tests/send.rs
adudek-bw Jun 18, 2026
a7456e8
Update crates/bw/tests/send.rs
adudek-bw Jun 18, 2026
d8762f6
PR fixes: address review feedback
adudek-bw Jun 18, 2026
e98b2fe
Clarify type-immutability comment on bw send edit
adudek-bw Jun 18, 2026
ceace58
Merge branch 'main' into tools/pm-34719/add-send-commands-to-rust-cli-2
adudek-bw Jun 18, 2026
f496e22
merge main
adudek-bw Jun 22, 2026
af1d1cf
Merge branch 'main' into tools/pm-34719/add-send-commands-to-rust-cli-2
adudek-bw Jun 23, 2026
b7d6a6d
Lift send command structs into send.rs + use PossibleValuesParser
adudek-bw Jun 23, 2026
30e952e
Drop redundant Clone bound from delete_in_days_parser
adudek-bw Jun 25, 2026
8a751a6
[PM-39239] Surface shareable access URLs in bw send output
adudek-bw Jul 8, 2026
34e7de4
PR fixes
adudek-bw Jul 15, 2026
1d22c59
[PM-39238] Complete file send lifecycle in bw send
adudek-bw Jul 20, 2026
e249a25
[PM-39238] Send correct file length on file-send create
adudek-bw Jul 23, 2026
1cca1f4
Merge remote-tracking branch 'origin/main' into tools/pm-39238/comple…
adudek-bw Jul 24, 2026
638c6f4
Merge branch 'main' into tools/pm-39238/complete-file-send-lifecycle
adudek-bw Jul 28, 2026
959af75
Merge branch 'main' into tools/pm-39238/complete-file-send-lifecycle
adudek-bw Jul 28, 2026
943e126
chore(bw): trim redundant review comments in send.rs and jwt_token.rs
adudek-bw Jul 28, 2026
5fc85b7
Merge branch 'tools/pm-39238/complete-file-send-lifecycle' of github.…
adudek-bw Jul 29, 2026
e4edf56
PR fixes
adudek-bw Jul 30, 2026
a4495a6
Merge branch 'main' into tools/pm-39238/complete-file-send-lifecycle
adudek-bw Jul 30, 2026
2a9bd02
[PM-34718] Implement bw receive / bw send receive
adudek-bw Jul 30, 2026
e88d175
Merge branch 'main' into tools/pm-39238/complete-file-send-lifecycle
adudek-bw Jul 31, 2026
a2e4d4c
Merge branch 'tools/pm-39238/complete-file-send-lifecycle' of github.…
adudek-bw Jul 31, 2026
516466a
Merge branch 'main' into tools/pm-39238/complete-file-send-lifecycle
adudek-bw Jul 31, 2026
bd00b41
fix(bw): correct send.file template's type discriminant
adudek-bw Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ crates/bitwarden-ipc/src/crypto_provider/noise/ @bitwarden/team-key-management-d
crates/bw/src/admin_console/** @bitwarden/team-platform-dev
crates/bw/src/auth/** @bitwarden/team-auth-dev
crates/bw/src/key_management/** @bitwarden/team-key-management-dev
crates/bw/src/tools/** @bitwarden/team-platform-dev
crates/bw/src/tools/** @bitwarden/team-tools-dev @bitwarden/team-platform-dev
crates/bw/src/vault/** @bitwarden/team-vault-dev

# BRE for publish workflow changes
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions crates/bitwarden-core/src/auth/jwt_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ pub struct JwtToken {
pub email: Option<String>,
/// Used by Service Accounts to denote the organization.
pub organization: Option<String>,
/// Whether the user has an active premium membership. Present on user access-token JWTs;
/// absent on Service Account tokens (hence `Option`).
pub premium: Option<bool>,
/// The scopes the token has access to.
pub scope: Vec<String>,
}
Expand Down Expand Up @@ -82,7 +85,42 @@ mod tests {
assert_eq!(token.sub, "e25d37f3-b603-40de-84ba-af96012f5a42");
assert_eq!(token.email.as_deref(), Some("test@bitwarden.com"));
assert_eq!(token.organization.as_deref(), None);
// This fixture carries `"premium":false` in its payload.
Comment thread
dani-garcia marked this conversation as resolved.
Outdated
assert_eq!(token.premium, Some(false));
assert_eq!(token.scope[0], "api");
assert_eq!(token.scope[1], "offline_access");
}

/// A user access-token JWT with `"premium":true` must parse the claim as `Some(true)`. The
/// payload below decodes to
/// `{"sub":"...","email":"premium@bitwarden.com","premium":true,"scope":["api"],"exp":
/// 1675107177}`.
#[test]
fn can_decode_premium_claim() {
// header.payload.signature β€” only the payload segment is parsed (the signature is not
// verified), so a placeholder header/signature is sufficient for this test.
let payload = bitwarden_encoding::B64Url::from(
br#"{"sub":"e25d37f3-b603-40de-84ba-af96012f5a42","email":"premium@bitwarden.com","premium":true,"scope":["api"],"exp":1675107177}"#
.as_slice(),
);
let jwt = format!("aaaa.{payload}.bbbb");

let token: JwtToken = jwt.parse().unwrap();
assert_eq!(token.premium, Some(true));
assert_eq!(token.email.as_deref(), Some("premium@bitwarden.com"));
}

/// A Service Account token has no `premium` claim; the field must decode to `None` rather than
/// failing the parse.
#[test]
fn premium_absent_decodes_to_none() {
let payload = bitwarden_encoding::B64Url::from(
br#"{"sub":"e25d37f3-b603-40de-84ba-af96012f5a42","scope":["api"],"exp":1675107177}"#
.as_slice(),
);
let jwt = format!("aaaa.{payload}.bbbb");

let token: JwtToken = jwt.parse().unwrap();
assert_eq!(token.premium, None);
}
}
Loading