Skip to content

Unify WASM crypto client with mobile #226

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dani-garcia
Copy link
Member

@dani-garcia dani-garcia commented Apr 25, 2025

🎟️ Tracking

📔 Objective

With the removal of the lifetimes of the clients, we can remove the wasm-specific crypto client and instead use the one in bitwarden-core.

⏰ 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

}
}

impl CryptoClient {
Copy link
Member Author

@dani-garcia dani-garcia Apr 25, 2025

Choose a reason for hiding this comment

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

I've split the impl CryptoClient into two blocks, one with wasm_bindgen for the functions we're currently exporting to wasm, and one without it for the ones that we're not using.

We could also export all of them if we wanted, but to keep the PR simple I only include the ones actually in use.

@@ -49,6 +50,7 @@ tsify-next = { workspace = true, optional = true }
uniffi = { workspace = true, optional = true, features = ["tokio"] }
uuid = { workspace = true }
wasm-bindgen = { workspace = true, optional = true }
wasm-bindgen-futures = { workspace = true, optional = true }
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 dep is used internally for the wasm-bindgen macro as cryptoclient has some async functions.

Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details5b82e37a-5136-4c2f-aee3-63128c74e838

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 66.92%. Comparing base (8014451) to head (8872fb9).

Files with missing lines Patch % Lines
crates/bitwarden-core/src/mobile/crypto_client.rs 0.00% 9 Missing ⚠️
crates/bitwarden-core/src/mobile/crypto.rs 0.00% 3 Missing ⚠️
crates/bitwarden-wasm-internal/src/client.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   66.81%   66.92%   +0.10%     
==========================================
  Files         213      212       -1     
  Lines       15922    15901      -21     
==========================================
+ Hits        10638    10641       +3     
+ Misses       5284     5260      -24     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dani-garcia dani-garcia marked this pull request as ready for review April 25, 2025 16:44
@dani-garcia dani-garcia requested a review from a team as a code owner April 25, 2025 16:44
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.

1 participant