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

Remove the last references to Encryptable and Decryptable #738

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Apr 26, 2024

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Wrap up the migration to KeyEncryptable / KeyDecryptable.

Before you submit

  • Please add unit tests where it makes sense to do so

@Hinton Hinton requested a review from dani-garcia April 26, 2024 09:13
Copy link
Contributor

github-actions bot commented Apr 26, 2024

Logo
Checkmarx One – Scan Summary & Details20df71be-f149-4baa-b51d-87a7cca78c3b

No New Or Fixed Issues Found

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 40 lines in your changes are missing coverage. Please review.

Project coverage is 61.80%. Comparing base (94b811f) to head (8cc40a0).

Files Patch % Lines
...rates/bitwarden-crypto/src/keys/key_encryptable.rs 0.00% 7 Missing ⚠️
...rates/bitwarden/src/mobile/vault/client_ciphers.rs 0.00% 6 Missing ⚠️
...rates/bitwarden/src/mobile/vault/client_folders.rs 0.00% 6 Missing ⚠️
crates/bitwarden/src/mobile/vault/client_sends.rs 0.00% 6 Missing ⚠️
...es/bitwarden/src/mobile/vault/client_collection.rs 0.00% 4 Missing ⚠️
...warden/src/mobile/vault/client_password_history.rs 0.00% 4 Missing ⚠️
...n/src/secrets_manager/projects/project_response.rs 0.00% 4 Missing ⚠️
crates/bitwarden/src/tool/exporters/mod.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #738      +/-   ##
==========================================
- Coverage   61.82%   61.80%   -0.03%     
==========================================
  Files         173      172       -1     
  Lines       10947    10932      -15     
==========================================
- Hits         6768     6756      -12     
+ Misses       4179     4176       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dani-garcia
dani-garcia previously approved these changes Apr 26, 2024
Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

LGTM, there are some merge conflicts to resolve though

…table

# Conflicts:
#	crates/bitwarden/src/tool/exporters/mod.rs
@Hinton Hinton merged commit 4adf439 into main Apr 29, 2024
77 checks passed
@Hinton Hinton deleted the ps/remove-encryptable branch April 29, 2024 09:04
Hinton added a commit that referenced this pull request May 31, 2024
In #738 we migrated away from `decrypt` and used `decrypt_with_key`
instead. However ciphers can be encrypted using either organization keys
or user key. The changes introduced meant we always used the users key
instead of conditionally based on the value of `organization_jd` in
`Cipher`.

The fix was to call `locate_key` on `Cipher` and `Collection`.

To properly write tests I needed to mock a user account and
organization. I took this moment to refactor our tests account and we
now have nice helpers for initializing the test@bitwarden.com account,
which also includes an organization.
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.

2 participants