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-vault #825

Merged
merged 9 commits into from
Jun 10, 2024
Merged

[PM-8301] Create bitwarden-vault #825

merged 9 commits into from
Jun 10, 2024

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Jun 10, 2024

๐ŸŽŸ๏ธ Tracking

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

๐Ÿ“” Objective

Continue extracting functionality from bitwarden to new crates.

  • Extracts VaultLocked to bitwarden-core.
  • Moved bitwarden/src/vault models to bitwarden-vault crate.
  • Refactored Authenticator logic to not impl vault owned models.

โฐ 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 08:47
Copy link
Contributor

github-actions bot commented Jun 10, 2024

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ ec3f8fca-4156-425f-ac62-fdfe533c721f

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Unpinned Actions Full Length Commit SHA /publish-rust-crates.yml: [178](https://github.com/bitwarden/sdk/blob/ps/bitwarden-vault//.github/workflows/publish-rust-crates.yml# L178) 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: [167](https://github.com/bitwarden/sdk/blob/ps/bitwarden-vault//.github/workflows/publish-rust-crates.yml# L167)

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 42.50765% with 188 lines in your changes missing coverage. Please review.

Project coverage is 59.25%. Comparing base (5ee45a1) to head (b4b8658).

Files Patch % Lines
crates/bitwarden/src/platform/fido2/mod.rs 0.00% 73 Missing โš ๏ธ
crates/bitwarden-vault/src/exporters.rs 66.09% 59 Missing โš ๏ธ
crates/bitwarden-vault/src/cipher/cipher.rs 36.84% 12 Missing โš ๏ธ
crates/bitwarden-vault/src/cipher/login.rs 0.00% 5 Missing โš ๏ธ
crates/bitwarden/src/mobile/tool/client_sends.rs 0.00% 5 Missing โš ๏ธ
...ates/bitwarden/src/platform/fido2/authenticator.rs 0.00% 5 Missing โš ๏ธ
crates/bitwarden-vault/src/cipher/attachment.rs 0.00% 3 Missing โš ๏ธ
crates/bitwarden-vault/src/domain.rs 0.00% 3 Missing โš ๏ธ
crates/bitwarden/src/vault/sync.rs 0.00% 2 Missing โš ๏ธ
crates/bitwarden-core/src/error.rs 0.00% 1 Missing โš ๏ธ
... and 20 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #825      +/-   ##
==========================================
- Coverage   59.34%   59.25%   -0.10%     
==========================================
  Files         183      186       +3     
  Lines       12423    12416       -7     
==========================================
- Hits         7373     7357      -16     
- Misses       5050     5059       +9     

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

Base automatically changed from ps/bitwarden-core to main June 10, 2024 12:17
# Conflicts:
#	crates/bitwarden-core/src/error.rs
#	crates/bitwarden-core/src/lib.rs
#	crates/bitwarden-core/src/uniffi_support.rs
#	crates/bitwarden-vault/src/cipher/cipher.rs
#	crates/bitwarden-vault/src/cipher/field.rs
#	crates/bitwarden-vault/src/cipher/login.rs
#	crates/bitwarden-vault/src/cipher/secure_note.rs
#	crates/bitwarden-vault/src/collection.rs
#	crates/bitwarden-vault/src/domain.rs
#	crates/bitwarden-vault/src/folder.rs
#	crates/bitwarden/src/error.rs
#	crates/bitwarden/src/tool/exporters/mod.rs
#	crates/bitwarden/src/vault/sync.rs
@Hinton Hinton requested a review from dani-garcia June 10, 2024 12:30
dani-garcia
dani-garcia previously approved these changes Jun 10, 2024
@@ -4,6 +4,10 @@ use thiserror::Error;
#[error("The response received was missing a required field: {0}")]
pub struct MissingFieldError(pub &'static str);

#[derive(Debug, Error)]
#[error("The client vault is locked and needs to be unlocked before use")]
pub struct VaultLocked();
Copy link
Member

Choose a reason for hiding this comment

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

Nit: You can define the struct without parentheses and that way you don't need to use them every time you refer to this error type:

Suggested change
pub struct VaultLocked();
pub struct VaultLocked;

@Hinton Hinton merged commit 9acd362 into main Jun 10, 2024
105 checks passed
@Hinton Hinton deleted the ps/bitwarden-vault branch June 10, 2024 14:44
Hinton added a commit that referenced this pull request Jun 10, 2024
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