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

Update decryptUserKeyWithMasterKey to requireUserId #11560

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

trmartin4
Copy link
Member

@trmartin4 trmartin4 commented Oct 15, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13686

📔 Objective

We should require a userId on decryptUserKeyWithMasterKey in order to ensure that we are retrieving the masterKey and userKey for the correct user from state.

Previously, we were relying on the ActiveUserState, which we are actively trying to remove.

We have had reports of intermittent vault decryption issues, and so we are attempting to eliminate any potential method by which the incorrect userKey is being retrieved.

⏰ 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

@trmartin4 trmartin4 requested a review from a team as a code owner October 15, 2024 16:29
Copy link
Contributor

github-actions bot commented Oct 15, 2024

Logo
Checkmarx One – Scan Summary & Details69fde415-2c74-4613-868c-2f989da4ccac

No New Or Fixed Issues Found

@@ -28,6 +28,7 @@ export const authGuard: CanActivateFn = async (
const masterPasswordService = inject(MasterPasswordServiceAbstraction);

const authStatus = await authService.getAuthStatus();
x;
Copy link
Member

Choose a reason for hiding this comment

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

Leftover x

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you! I missed that. I've removed it.

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 33.15%. Comparing base (15e5a6d) to head (c8b7ae4).
Report is 7 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ervices/master-password/master-password.service.ts 0.00% 2 Missing ⚠️
apps/cli/src/auth/commands/unlock.command.ts 0.00% 1 Missing ⚠️
...src/app/auth/settings/change-password.component.ts 0.00% 1 Missing ⚠️
...es/master-password/fake-master-password.service.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11560      +/-   ##
==========================================
- Coverage   33.15%   33.15%   -0.01%     
==========================================
  Files        2779     2779              
  Lines       86297    86311      +14     
  Branches    16441    16444       +3     
==========================================
+ Hits        28610    28614       +4     
- Misses      55417    55423       +6     
- Partials     2270     2274       +4     

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

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