Skip to content

Commit f8044bd

Browse files
committed
Merge branch 'km/cose-signatures' of github.com:bitwarden/sdk-internal into km/cose-signatures
2 parents 712dfea + c551e7f commit f8044bd

File tree

127 files changed

+2221
-923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+2221
-923
lines changed

Cargo.lock

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

Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ bitwarden-crypto = { path = "crates/bitwarden-crypto", version = "=1.0.0" }
2727
bitwarden-exporters = { path = "crates/bitwarden-exporters", version = "=1.0.0" }
2828
bitwarden-fido = { path = "crates/bitwarden-fido", version = "=1.0.0" }
2929
bitwarden-generators = { path = "crates/bitwarden-generators", version = "=1.0.0" }
30+
bitwarden-ipc = { path = "crates/bitwarden-ipc", version = "=1.0.0" }
3031
bitwarden-send = { path = "crates/bitwarden-send", version = "=1.0.0" }
3132
bitwarden-sm = { path = "bitwarden_license/bitwarden-sm", version = "=1.0.0" }
3233
bitwarden-ssh = { path = "crates/bitwarden-ssh", version = "=1.0.0" }
@@ -63,6 +64,12 @@ wasm-bindgen = { version = ">=0.2.91, <0.3", features = ["serde-serialize"] }
6364
js-sys = { version = ">=0.3.72, <0.4" }
6465
wasm-bindgen-futures = "0.4.41"
6566

67+
# There is an incompatibility when using pkcs5 and chacha20 on wasm builds. This can be removed once a new
68+
# rustcrypto-formats crate version is released since the fix has been upstreamed.
69+
# https://github.com/RustCrypto/formats/pull/1625
70+
[patch.crates-io]
71+
pkcs5 = { git = "https://github.com/bitwarden/rustcrypto-formats.git", rev = "2b27c63034217dd126bbf5ed874da51b84f8c705" }
72+
6673
[workspace.lints.clippy]
6774
unused_async = "deny"
6875
unwrap_used = "deny"

bitwarden_license/bitwarden-sm/src/client_projects.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,57 @@ use crate::{
99
},
1010
};
1111

12-
pub struct ClientProjects<'a> {
13-
pub client: &'a Client,
12+
pub struct ClientProjects {
13+
pub client: Client,
1414
}
1515

16-
impl<'a> ClientProjects<'a> {
17-
pub fn new(client: &'a Client) -> Self {
16+
impl ClientProjects {
17+
pub fn new(client: Client) -> Self {
1818
Self { client }
1919
}
2020

2121
pub async fn get(
2222
&self,
2323
input: &ProjectGetRequest,
2424
) -> Result<ProjectResponse, SecretsManagerError> {
25-
get_project(self.client, input).await
25+
get_project(&self.client, input).await
2626
}
2727

2828
pub async fn create(
2929
&self,
3030
input: &ProjectCreateRequest,
3131
) -> Result<ProjectResponse, SecretsManagerError> {
32-
create_project(self.client, input).await
32+
create_project(&self.client, input).await
3333
}
3434

3535
pub async fn list(
3636
&self,
3737
input: &ProjectsListRequest,
3838
) -> Result<ProjectsResponse, SecretsManagerError> {
39-
list_projects(self.client, input).await
39+
list_projects(&self.client, input).await
4040
}
4141

4242
pub async fn update(
4343
&self,
4444
input: &ProjectPutRequest,
4545
) -> Result<ProjectResponse, SecretsManagerError> {
46-
update_project(self.client, input).await
46+
update_project(&self.client, input).await
4747
}
4848

4949
pub async fn delete(
5050
&self,
5151
input: ProjectsDeleteRequest,
5252
) -> Result<ProjectsDeleteResponse, SecretsManagerError> {
53-
delete_projects(self.client, input).await
53+
delete_projects(&self.client, input).await
5454
}
5555
}
5656

57-
pub trait ClientProjectsExt<'a> {
58-
fn projects(&'a self) -> ClientProjects<'a>;
57+
pub trait ClientProjectsExt {
58+
fn projects(&self) -> ClientProjects;
5959
}
6060

61-
impl<'a> ClientProjectsExt<'a> for Client {
62-
fn projects(&'a self) -> ClientProjects<'a> {
63-
ClientProjects::new(self)
61+
impl ClientProjectsExt for Client {
62+
fn projects(&self) -> ClientProjects {
63+
ClientProjects::new(self.clone())
6464
}
6565
}

bitwarden_license/bitwarden-sm/src/client_secrets.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -12,78 +12,78 @@ use crate::{
1212
},
1313
};
1414

15-
pub struct ClientSecrets<'a> {
16-
client: &'a Client,
15+
pub struct ClientSecrets {
16+
client: Client,
1717
}
1818

19-
impl<'a> ClientSecrets<'a> {
20-
pub fn new(client: &'a Client) -> Self {
19+
impl ClientSecrets {
20+
pub fn new(client: Client) -> Self {
2121
Self { client }
2222
}
2323

2424
pub async fn get(
2525
&self,
2626
input: &SecretGetRequest,
2727
) -> Result<SecretResponse, SecretsManagerError> {
28-
get_secret(self.client, input).await
28+
get_secret(&self.client, input).await
2929
}
3030

3131
pub async fn get_by_ids(
3232
&self,
3333
input: SecretsGetRequest,
3434
) -> Result<SecretsResponse, SecretsManagerError> {
35-
get_secrets_by_ids(self.client, input).await
35+
get_secrets_by_ids(&self.client, input).await
3636
}
3737

3838
pub async fn create(
3939
&self,
4040
input: &SecretCreateRequest,
4141
) -> Result<SecretResponse, SecretsManagerError> {
42-
create_secret(self.client, input).await
42+
create_secret(&self.client, input).await
4343
}
4444

4545
pub async fn list(
4646
&self,
4747
input: &SecretIdentifiersRequest,
4848
) -> Result<SecretIdentifiersResponse, SecretsManagerError> {
49-
list_secrets(self.client, input).await
49+
list_secrets(&self.client, input).await
5050
}
5151

5252
pub async fn list_by_project(
5353
&self,
5454
input: &SecretIdentifiersByProjectRequest,
5555
) -> Result<SecretIdentifiersResponse, SecretsManagerError> {
56-
list_secrets_by_project(self.client, input).await
56+
list_secrets_by_project(&self.client, input).await
5757
}
5858

5959
pub async fn update(
6060
&self,
6161
input: &SecretPutRequest,
6262
) -> Result<SecretResponse, SecretsManagerError> {
63-
update_secret(self.client, input).await
63+
update_secret(&self.client, input).await
6464
}
6565

6666
pub async fn delete(
6767
&self,
6868
input: SecretsDeleteRequest,
6969
) -> Result<SecretsDeleteResponse, SecretsManagerError> {
70-
delete_secrets(self.client, input).await
70+
delete_secrets(&self.client, input).await
7171
}
7272

7373
pub async fn sync(
7474
&self,
7575
input: &SecretsSyncRequest,
7676
) -> Result<SecretsSyncResponse, SecretsManagerError> {
77-
sync_secrets(self.client, input).await
77+
sync_secrets(&self.client, input).await
7878
}
7979
}
8080

81-
pub trait ClientSecretsExt<'a> {
82-
fn secrets(&'a self) -> ClientSecrets<'a>;
81+
pub trait ClientSecretsExt {
82+
fn secrets(&self) -> ClientSecrets;
8383
}
8484

85-
impl<'a> ClientSecretsExt<'a> for Client {
86-
fn secrets(&'a self) -> ClientSecrets<'a> {
87-
ClientSecrets::new(self)
85+
impl ClientSecretsExt for Client {
86+
fn secrets(&self) -> ClientSecrets {
87+
ClientSecrets::new(self.clone())
8888
}
8989
}

crates/bitwarden-cli/src/color.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
use clap::ValueEnum;
22

3+
/// Color configuration for the CLI
34
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)]
45
pub enum Color {
6+
/// Force colors off
57
No,
8+
/// Force colors on
69
Yes,
10+
/// Automatically detect if colors are supported in the terminal.
711
Auto,
812
}
913

crates/bitwarden-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ internal = ["dep:zxcvbn"]
1919
no-memory-hardening = [
2020
"bitwarden-crypto/no-memory-hardening"
2121
] # Disable memory hardening features
22-
uniffi = ["bitwarden-crypto/uniffi", "dep:uniffi"] # Uniffi bindings
2322
secrets = [] # Secrets manager API
23+
uniffi = ["bitwarden-crypto/uniffi", "dep:uniffi"] # Uniffi bindings
2424
wasm = [
2525
"bitwarden-error/wasm",
2626
"dep:wasm-bindgen",

crates/bitwarden-core/README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
# Bitwarden Core
22

3-
Contains core functionality used by the feature crates.
3+
Contains core functionality used by the feature crates. For an introduction to the Bitwarden SDK and
4+
the `bitwarden-core` create please refer to the
5+
[SDK Architecture](https://contributing.bitwarden.com/architecture/sdk/) documentation.
46

57
<div class="warning">
68
Generally you should <b>not</b> find yourself needing to edit this crate! When possible, please use the feature crates instead.
79
</div>
10+
11+
## Features
12+
13+
- `internal` - Internal unstable APIs that should only be consumed by internal Bitwarden clients.
14+
- `no-memory-hardening` - Disables `bitwarden-crypto` memory hardening.
15+
- `secrets` - Secrets Manager specific functionality.
16+
- `uniffi` - Mobile bindings.
17+
- `wasm` - WebAssembly bindings.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//! Admin console module for Bitwarden Core.
2+
//!
3+
//! Contains policies.
4+
15
mod policy;
26

37
pub use policy::Policy;

0 commit comments

Comments
 (0)