Skip to content
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 7 commits into from
Jun 14, 2024
Merged

[PM-8301] Create bitwarden-send #829

merged 7 commits into from
Jun 14, 2024

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Jun 10, 2024

๐ŸŽŸ๏ธ Tracking

https://bitwarden.atlassian.net/browse/PM-8301

๐Ÿ“” Objective

Extract send to separate crate.

โฐ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

๐Ÿฆฎ Reviewer guidelines

  • ๐Ÿ‘ (:+1:) or similar for great changes
  • ๐Ÿ“ (:memo:) or โ„น๏ธ (:information_source:) for notes or general info
  • โ“ (:question:) for questions
  • ๐Ÿค” (:thinking:) or ๐Ÿ’ญ (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • ๐ŸŽจ (:art:) for suggestions / improvements
  • โŒ (:x:) or โš ๏ธ (:warning:) for more significant problems or concerns needing attention
  • ๐ŸŒฑ (:seedling:) or โ™ป๏ธ (:recycle:) for future improvements or indications of technical debt
  • โ› (:pick:) for minor or nitpick changes

@Hinton Hinton requested a review from a team as a code owner June 10, 2024 14:06
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parse error is similar to CipherParseError, perhaps we should expose a generic ParseError in bitwarden-core?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean VaultParseError? And yeah if it's going to be used in multiple places, I think sharing it would make sense.

Copy link
Contributor

github-actions bot commented Jun 10, 2024

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 7d6d845b-18b3-46fa-b104-905dfd670fd5

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Unpinned Actions Full Length Commit SHA /publish-rust-crates.yml: [189](https://github.com/bitwarden/sdk/blob/ps/bitwarden-send//.github/workflows/publish-rust-crates.yml# L189) Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...

Fixed Issues

Severity Issue Source File / Package
MEDIUM Unpinned Actions Full Length Commit SHA /publish-rust-crates.yml: [178](https://github.com/bitwarden/sdk/blob/ps/bitwarden-send//.github/workflows/publish-rust-crates.yml# L178)

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 68.75000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 59.22%. Comparing base (e5a8dba) to head (9316f60).

Files Patch % Lines
crates/bitwarden-send/src/send.rs 78.57% 3 Missing โš ๏ธ
crates/bitwarden-send/src/error.rs 0.00% 1 Missing โš ๏ธ
crates/bitwarden-send/src/lib.rs 0.00% 1 Missing โš ๏ธ
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #829   +/-   ##
=======================================
  Coverage   59.22%   59.22%           
=======================================
  Files         186      188    +2     
  Lines       12396    12403    +7     
=======================================
+ Hits         7341     7346    +5     
- Misses       5055     5057    +2     

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

# Conflicts:
#	.github/workflows/publish-rust-crates.yml
#	Cargo.lock
#	Cargo.toml
#	crates/bitwarden/Cargo.toml
#	crates/bitwarden/src/error.rs
Comment on lines +370 to +381
struct MockKeyContainer(HashMap<Option<Uuid>, SymmetricCryptoKey>);
impl MockKeyContainer {
fn new(master_key: MasterKey, user_key: EncString) -> Result<Self, CryptoError> {
let user_key = master_key.decrypt_user_key(user_key)?;
Ok(Self(HashMap::from([(None, user_key)])))
}
}
impl KeyContainer for MockKeyContainer {
fn get_key<'a>(&'a self, org_id: &Option<Uuid>) -> Option<&'a SymmetricCryptoKey> {
self.0.get(org_id)
}
}
Copy link
Member Author

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.

Copy link
Member

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

@Hinton Hinton requested a review from dani-garcia June 10, 2024 16:30
@Hinton Hinton merged commit 2b53a7c into main Jun 14, 2024
105 checks passed
@Hinton Hinton deleted the ps/bitwarden-send branch June 14, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants