Skip to content

Expose credential exchange in wasm #222

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

Merged
merged 5 commits into from
Apr 25, 2025
Merged

Expose credential exchange in wasm #222

merged 5 commits into from
Apr 25, 2025

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Apr 23, 2025

🎟️ Tracking

📔 Objective

We would like to do a PoC where we implement credential exchange in our browser extension. Which requires us to expose the CXF flow in wasm.

⏰ 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

Copy link
Contributor

github-actions bot commented Apr 23, 2025

Logo
Checkmarx One – Scan Summary & Detailsefb505b5-c968-41aa-9f7d-8b271e7fe922

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Apr 23, 2025

Codecov Report

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

Project coverage is 67.03%. Comparing base (fe76be2) to head (6aa1187).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-wasm-internal/src/client.rs 0.00% 3 Missing ⚠️
crates/bitwarden-exporters/src/error.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
- Coverage   67.05%   67.03%   -0.02%     
==========================================
  Files         212      213       +1     
  Lines       15989    15993       +4     
==========================================
  Hits        10721    10721              
- Misses       5268     5272       +4     

☔ 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.

@Hinton Hinton marked this pull request as ready for review April 23, 2025 12:06
@Hinton Hinton requested a review from a team as a code owner April 23, 2025 12:06
@Hinton Hinton requested a review from dani-garcia April 23, 2025 12:06

impl ExporterClient {
/// Constructs a new SDK client for exporting and importing vault items.
pub fn new(client: Client) -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem used anywhere. We need to create an exporter function on crates/bitwarden-wasm-internal/src/client.rs to return the exporter client so that it can be created in WASM

Copy link
Member

Choose a reason for hiding this comment

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

Alternatively, you may be able to add this to the WASM client file:

    pub fn exporters(&self) -> bitwarden_exporters::ExporterClient {
        bitwarden_exporters::ExporterClient::new(self.0.clone())
    }

and remove this file entirely if the API in bitwarden-exporters is the same?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah true. I changed to exposing the ExporterClient directly.

@Hinton Hinton requested a review from dani-garcia April 23, 2025 12:43
@Hinton Hinton merged commit 0b97bdd into main Apr 25, 2025
42 checks passed
@Hinton Hinton deleted the cxf-wasm branch April 25, 2025 11:57
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