Skip to content

[PM-40673] Two Factor Remember Token Updates (Part 3) - #8429

Open
rr-bw wants to merge 28 commits into
auth/pm-40673/part-2from
auth/pm-40673/part-3
Open

rr-bw wants to merge 28 commits into
auth/pm-40673/part-2from
auth/pm-40673/part-3

Conversation

@rr-bw

@rr-bw rr-bw commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-40673

PR Stack

  • auth/pm-40673/part-1 - Entity, Repository, and Command/Query updates
  • auth/pm-40673/part-2 - Add token issuance to login flow (and migrates from old-to-new tokens)
  • auth/pm-40673/part-3 - Updates call sites where we want to revoke 2FA remember tokens (admin 2FA reset, recovery code usage, removal of last 2FA method)

📔 Objective

Updates call sites where we want to revoke 2FA remember tokens (admin 2FA reset, recovery code usage, removal of last 2FA method)

📸 Screenshots

Screen recordings on Jira ticket

@rr-bw
rr-bw changed the base branch from main to auth/pm-40673/part-2 September 23, 2026 02:34
@rr-bw
rr-bw added this pull request to stack #8466 September 28, 2026 15:59
@rr-bw
rr-bw force-pushed the auth/pm-40673/part-3 branch from a891d95 to 936aa81 Compare September 28, 2026 16:20
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.85%. Comparing base (89faab1) to head (37b4443).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           auth/pm-40673/part-2    #8429      +/-   ##
========================================================
+ Coverage                 68.47%   74.85%   +6.37%     
========================================================
  Files                      2745     2751       +6     
  Lines                    117558   117653      +95     
  Branches                  10776    10787      +11     
========================================================
+ Hits                      80503    88067    +7564     
+ Misses                    34514    26933    -7581     
- Partials                   2541     2653     +112     

☔ View full report in Codecov by Harness.
📢 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.

@rr-bw
rr-bw force-pushed the auth/pm-40673/part-3 branch from 936aa81 to a4e377d Compare October 2, 2026 18:45
@rr-bw
rr-bw force-pushed the auth/pm-40673/part-3 branch from a4e377d to c437a6f Compare October 7, 2026 13:32
@rr-bw
rr-bw force-pushed the auth/pm-40673/part-3 branch from c437a6f to c729adc Compare October 12, 2026 14:17
@rr-bw
rr-bw force-pushed the auth/pm-40673/part-3 branch 4 times, most recently from 3fd63ca to 5f8c12f Compare October 17, 2026 12:40
@rr-bw rr-bw added the t:feature Change Type - Feature Development label Oct 17, 2026
@rr-bw
rr-bw force-pushed the auth/pm-40673/part-3 branch 2 times, most recently from 02b88f1 to e7ccf0a Compare October 19, 2026 14:12
@rr-bw
rr-bw marked this pull request as ready for review October 19, 2026 14:58
@rr-bw
rr-bw requested review from a team as code owners October 19, 2026 14:58
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This review covers the full Part 3 diff at head 37b44437: the revoke calls in ResetUserTwoFactorCommand, UserService.DisableTwoFactorProviderAsync / RecoverTwoFactorAsync, and both emergency access takeover paths, plus the RecoveryCode exclusion in BaseRequestValidator and the renaming from "remembered device" to "2FA remember token". Each revoke runs after the request is validated and before the user is saved, so if the revoke fails, the user's 2FA is still in place and the operation can be retried. IRevokeTwoFactorRememberTokensCommand is registered with DI, and none of the changed services is constructed by hand anywhere. The newest commit only changes tests: ValidateTwoFactorRememberTokenQueryTests now uses a frozen FakeTimeProvider through the internal ExpiringTokenable.TimeProvider, and the boundary tests for token and row expiry agree with IsExpired.

Code Review Details

No findings. The open question in the readme.md thread (org Duo removal, plan downgrade, member removal) is with product in Jira and is not raised again here.

JaredScar
JaredScar previously approved these changes Oct 21, 2026
rr-bw added 26 commits November 6, 2026 01:06
…kens before saving when the last 2FA provider is removed
… via Authenticator, YubiKey, Duo, and WebAuthn endpoints
…on the legacy emergency access takeover path
@rr-bw
rr-bw force-pushed the auth/pm-40673/part-3 branch from b13fc83 to 5b3c6e1 Compare November 6, 2026 07:06
@rr-bw

rr-bw commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

@JaredSnider-Bitwarden Two more commits since rebasing the stack:

  • b13474f - [PM-40673 Part 3] assert that a rejected emergency access takeover does not revoke 2FA remember tokens
  • 5b3c6e1 - [PM-40673 Part 3] add integration test for 2FA remember token revoke on the legacy emergency access takeover path
  • 37b4443 - [PM-40673 Part 3] use the fake clock for token expiry in ValidateTwoFactorRememberTokenQueryTests

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants