Skip to content

[PM-19883] Add untrust devices endpoint #5619

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
Apr 9, 2025
Merged

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Apr 7, 2025

🎟️ Tracking

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

📔 Objective

Adds an endpoint to untrust a list of the users devices, removing their encryption keys. The untrusting operation has a separate command with provided unit tests.

📸 Screenshots

⏰ 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

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 78.37838% with 8 lines in your changes missing coverage. Please review.

Project coverage is 45.74%. Comparing base (0f0c3a4) to head (40cc9d6).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
src/Api/Controllers/DevicesController.cs 22.22% 7 Missing ⚠️
src/Api/Auth/Models/Request/UntrustDevicesModel.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5619      +/-   ##
==========================================
- Coverage   48.08%   45.74%   -2.34%     
==========================================
  Files        1563     1602      +39     
  Lines       71602    72650    +1048     
  Branches     6415     6508      +93     
==========================================
- Hits        34430    33235    -1195     
- Misses      35747    37998    +2251     
+ Partials     1425     1417       -8     

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

@quexten quexten marked this pull request as ready for review April 7, 2025 14:10
@quexten quexten requested a review from a team as a code owner April 7, 2025 14:10
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Logo
Checkmarx One – Scan Summary & Detailsf1214913-b541-4f7c-9ec1-9dbef530df01

New Issues (5)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 164
detailsMethod Put at line 164 of /src/Api/AdminConsole/Controllers/GroupsController.cs gets a parameter from a user request from model. This parameter val...
Attack Vector
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 86
detailsMethod Put at line 86 of /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs gets a parameter from a user request from model. This param...
Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/GroupsController.cs: 133
detailsMethod Put at line 133 of /src/Api/AdminConsole/Public/Controllers/GroupsController.cs gets a parameter from a user request from model. This parame...
Attack Vector
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 96
detailsMethod Patch at line 96 of /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs gets a parameter from a user request from model. This par...
Attack Vector
MEDIUM SSL_Verification_Bypass /src/Core/Services/Implementations/MailKitSmtpMailDeliveryService.cs: 73
details/src/Core/Services/Implementations/MailKitSmtpMailDeliveryService.cs relies HTTPS requests, in SendEmailAsync. The ServerCertificateValidationCallb...
Attack Vector
Fixed Issues (1)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM SSL_Verification_Bypass /src/Core/Services/Implementations/MailKitSmtpMailDeliveryService.cs: 76

Copy link
Contributor

@ike-kottlowski ike-kottlowski left a comment

Choose a reason for hiding this comment

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

🎨 : Non-blocking, but adding integration tests for the Device controller would be a nice addition here, but I understand that's a large ask.

I have tracked this request internally and we don't need to address it here.

Copy link
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden left a comment

Choose a reason for hiding this comment

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

Tiny bit of optimization and I'm good to approve! Tyvm for tackling this for us!

Copy link

sonarqubecloud bot commented Apr 7, 2025

Copy link
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden left a comment

Choose a reason for hiding this comment

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

Appreciate this work!

@quexten
Copy link
Contributor Author

quexten commented Apr 9, 2025

Merging since the code using this is featureflagged behind userkey-rotation-v2.

@quexten quexten merged commit 0a4f97b into main Apr 9, 2025
54 checks passed
@quexten quexten deleted the km/untrust-devices-endpoint branch April 9, 2025 12:26
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