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-6262] Add basic feature flags support to enable cipher key encryption #638

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

dani-garcia
Copy link
Member

Type of change

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

Objective

Implement support for some basic feature flagging for the mobile clients, the only flag supported is enableCipherKeyEncryption

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

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

Project coverage is 60.53%. Comparing base (c3d809b) to head (541887a).
Report is 2 commits behind head on main.

Files Patch % Lines
...rates/bitwarden/src/mobile/vault/client_ciphers.rs 0.00% 7 Missing ⚠️
crates/bitwarden/src/client/client.rs 25.00% 6 Missing ⚠️
crates/bitwarden-uniffi/src/platform/mod.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #638      +/-   ##
==========================================
+ Coverage   59.50%   60.53%   +1.03%     
==========================================
  Files         171      172       +1     
  Lines       10416    10527     +111     
==========================================
+ Hits         6198     6373     +175     
+ Misses       4218     4154      -64     

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

@bitwarden-bot
Copy link

bitwarden-bot commented Feb 28, 2024

Logo
Checkmarx One – Scan Summary & Detailsf83fd05f-2347-4b28-bf96-88325c78e991

Fixed Issues

Severity Issue Source File / Package
MEDIUM Denial_Of_Service_Resource_Exhaustion /languages/go/example/example.go: 16
MEDIUM Denial_Of_Service_Resource_Exhaustion /languages/go/example/example.go: 21
MEDIUM Denial_Of_Service_Resource_Exhaustion /languages/go/example/example.go: 15
MEDIUM Privacy_Violation /languages/go/example/example.go: 103
MEDIUM Privacy_Violation /languages/go/example/example.go: 103

@dani-garcia dani-garcia marked this pull request as ready for review February 28, 2024 17:39
Comment on lines +9 to +13
let map = map
.into_iter()
.map(|(k, v)| (k, serde_json::Value::Bool(v)))
.collect();
serde_json::from_value(serde_json::Value::Object(map)).expect("Valid map")
Copy link
Member

Choose a reason for hiding this comment

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

Serde 😢, we could write a proc macro for this but unsure if it's worth the hassle.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could even do a small declarative macro that just does:

this_flag = map.get("this_flag").unwrap_or(false);
that_flag = map.get("that_flag").unwrap_or(false);
another_flag = map.get("another_flag").unwrap_or(false);

That said I think we can deal with that when we have more flags to handle.

@dani-garcia dani-garcia merged commit 29089c5 into main Mar 1, 2024
60 checks passed
@dani-garcia dani-garcia deleted the ps/PM-6262-feature-flag-encrypt branch March 1, 2024 12:18
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.

3 participants