-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Continuation on #402. This PR extracts the generators to their own crate to establish clear boundaries between the code. There is still some logic in the client to expose generators that we may want to revisit. Also extracts explicit errors for the different generators for better error handling downstream when/if desired.
- Loading branch information
Showing
33 changed files
with
843 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Bitwarden Crypto | ||
|
||
This is an internal crate for the Bitwarden SDK do not depend on this directly and use the | ||
[`bitwarden`](https://crates.io/crates/bitwarden) crate instead. | ||
|
||
This crate does not follow semantic versioning and the public interface may change at any time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[package] | ||
name = "bitwarden-generators" | ||
version = "0.1.0" | ||
authors = ["Bitwarden Inc"] | ||
license-file = "LICENSE" | ||
repository = "https://github.com/bitwarden/sdk" | ||
homepage = "https://bitwarden.com" | ||
description = """ | ||
Internal crate for the bitwarden crate. Do not use. | ||
""" | ||
keywords = ["bitwarden"] | ||
edition = "2021" | ||
rust-version = "1.57" | ||
|
||
[features] | ||
mobile = ["uniffi"] # Mobile-specific features | ||
|
||
[dependencies] | ||
bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0" } | ||
rand = ">=0.8.5, <0.9" | ||
reqwest = { version = ">=0.11, <0.12", features = [ | ||
"json", | ||
], default-features = false } | ||
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] } | ||
serde = { version = ">=1.0, <2.0", features = ["derive"] } | ||
serde_json = ">=1.0.96, <2.0" | ||
thiserror = ">=1.0.40, <2.0" | ||
uniffi = { version = "=0.25.2", optional = true } | ||
|
||
[dev-dependencies] | ||
rand_chacha = "0.3.1" | ||
tokio = { version = "1.35.1", features = ["rt", "macros"] } | ||
wiremock = "0.5.22" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Bitwarden Generators | ||
|
||
This is an internal crate for the Bitwarden SDK do not depend on this directly and use the | ||
[`bitwarden`](https://crates.io/crates/bitwarden) crate instead. | ||
|
||
This crate does not follow semantic versioning and the public interface may change at any time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
mod passphrase; | ||
pub use passphrase::{passphrase, PassphraseError, PassphraseGeneratorRequest}; | ||
mod password; | ||
mod util; | ||
pub use password::{password, PasswordError, PasswordGeneratorRequest}; | ||
mod username; | ||
pub use username::{username, ForwarderServiceType, UsernameError, UsernameGeneratorRequest}; | ||
mod username_forwarders; | ||
|
||
#[cfg(feature = "mobile")] | ||
uniffi::setup_scaffolding!(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.