Skip to content

Fix SM init crypto #260

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 4 commits into from
May 5, 2025
Merged

Fix SM init crypto #260

merged 4 commits into from
May 5, 2025

Conversation

dani-garcia
Copy link
Member

@dani-garcia dani-garcia commented May 2, 2025

🎟️ Tracking

📔 Objective

Before the crypto refactor a user key was required to initialize crypto. Because secrets manager only has a single organization key, we used to set it as the user key and internally whenever an organization key was requested we'd return the user key if there was no private key.

With the crypto refactor, we removed this user key requirement and the code fallback when selecting a key, but we didn't change the initialization method to save the key as an organization key.

This PR changes the secrets manager initialization to do the correct thing here, and also brings a mocked test that was previously disabled in core to the bitwarden-sm crate. I've also fixed some compile time features that were incorrect and were causing compilation issues when running tests on bitwarden-sm.

⏰ 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 May 2, 2025

Logo
Checkmarx One – Scan Summary & Details6ace020b-7047-45f4-b577-8bd6f18d519d

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 97.45763% with 3 lines in your changes missing coverage. Please review.

Project coverage is 68.87%. Comparing base (82f69c3) to head (a2ef268).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ates/bitwarden-core/src/auth/login/access_token.rs 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
+ Coverage   66.84%   68.87%   +2.03%     
==========================================
  Files         213      212       -1     
  Lines       15926    16025      +99     
==========================================
+ Hits        10645    11038     +393     
+ Misses       5281     4987     -294     

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

Copy link

sonarqubecloud bot commented May 2, 2025

@dani-garcia dani-garcia marked this pull request as ready for review May 2, 2025 13:41
@dani-garcia dani-garcia requested a review from a team as a code owner May 2, 2025 13:41
@dani-garcia dani-garcia merged commit 6a9ca8c into main May 5, 2025
43 checks passed
@dani-garcia dani-garcia deleted the ps/fix-sm-init branch May 5, 2025 09:36
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