-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PM-8301] Create bitwarden-send #829
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8bed9e7
Extract bitwarden-send to separate crate
Hinton f6972df
Update workflow
Hinton 9dbc0c6
Merge branch 'main' of github.com:bitwarden/sdk into ps/bitwarden-send
Hinton 7e2925c
Fix android
Hinton 53e7f7f
Revert lockfile
Hinton 9c76c10
Fix workflow
Hinton 9316f60
Merge branch 'main' into ps/bitwarden-send
Hinton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,38 @@ | ||
[package] | ||
name = "bitwarden-send" | ||
description = """ | ||
Internal crate for the bitwarden crate. Do not use. | ||
""" | ||
|
||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
homepage.workspace = true | ||
repository.workspace = true | ||
license-file.workspace = true | ||
keywords.workspace = true | ||
|
||
[features] | ||
uniffi = [ | ||
"bitwarden-core/uniffi", | ||
"bitwarden-crypto/uniffi", | ||
"dep:uniffi", | ||
] # Uniffi bindings | ||
|
||
[dependencies] | ||
base64 = ">=0.21.2, <0.23" | ||
bitwarden-api-api = { workspace = true } | ||
bitwarden-core = { workspace = true } | ||
bitwarden-crypto = { workspace = true } | ||
chrono = { version = ">=0.4.26, <0.5", default-features = false } | ||
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] } | ||
serde = { version = ">=1.0, <2.0", features = ["derive"] } | ||
serde_repr = ">=0.1.12, <0.2" | ||
thiserror = ">=1.0.40, <2.0" | ||
uniffi = { version = "=0.27.2", optional = true } | ||
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] } | ||
zeroize = { version = ">=1.7.0, <2.0" } | ||
|
||
[lints] | ||
workspace = true |
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 @@ | ||
use thiserror::Error; | ||
|
||
#[derive(Debug, Error)] | ||
pub enum SendParseError { | ||
#[error(transparent)] | ||
Chrono(#[from] chrono::ParseError), | ||
#[error(transparent)] | ||
Crypto(#[from] bitwarden_crypto::CryptoError), | ||
#[error(transparent)] | ||
MissingFieldError(#[from] bitwarden_core::MissingFieldError), | ||
} |
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,9 @@ | ||
#[cfg(feature = "uniffi")] | ||
uniffi::setup_scaffolding!(); | ||
#[cfg(feature = "uniffi")] | ||
mod uniffi_support; | ||
|
||
mod error; | ||
pub use error::SendParseError; | ||
mod send; | ||
pub use send::{Send, SendListView, SendView}; |
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,8 @@ | ||
use bitwarden_crypto::EncString; | ||
use uuid::Uuid; | ||
|
||
uniffi::ffi_converter_forward!(EncString, bitwarden_crypto::UniFfiTag, crate::UniFfiTag); | ||
|
||
type DateTime = chrono::DateTime<chrono::Utc>; | ||
uniffi::ffi_converter_forward!(DateTime, bitwarden_core::UniFfiTag, crate::UniFfiTag); | ||
uniffi::ffi_converter_forward!(Uuid, bitwarden_core::UniFfiTag, crate::UniFfiTag); |
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,9 @@ | ||
[bindings.kotlin] | ||
package_name = "com.bitwarden.send" | ||
generate_immutable_records = true | ||
android = true | ||
|
||
[bindings.swift] | ||
ffi_module_name = "BitwardenSendFFI" | ||
module_name = "BitwardenSend" | ||
generate_immutable_records = true |
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
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
mod exporters; | ||
pub use exporters::{ClientExporters, ExportFormat}; | ||
mod client_generator; | ||
pub use bitwarden_send::*; | ||
pub use client_generator::ClientGenerator; | ||
|
||
mod send; | ||
pub use send::{Send, SendListView, SendView}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think long term we should consider extracting this into a test crate or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think a separate test crate, or maybe even just a dedicated test module in
bitwarden-core
would be helpful in the future