Commit 1e688cb
committed
fix: fix CI failures from the recovery-code round-trip test and dash normalization
1. testDisplayedRecoveryCodeRedeemsThroughVerifyRecoveryCode called
AbstractMFAChallengeStrategy::verifyRecoveryCode() directly, but it
takes a PESSIMISTIC_WRITE row lock that requires an open transaction
(Doctrine\ORM\TransactionRequiredException in CI). Route it through
IAuthService::verifyMFARecoveryCode(), like the real login flow,
which wraps the call in a transaction.
2. Several pre-existing test fixtures hashed a "plain" recovery code
with a literal "-" baked in (e.g. 'RECOVERY-REUSE-TX-' . uniqid())
and then submitted that same string for verification. The dash
normalization added earlier in this PR strips separators from the
submitted code before Hash::check(), so a hash made from a
dash-containing string can never match its own normalized
submission - a real generated code never contains a dash in its
raw/hashed form, only in its display formatting. Fixed the 7
affected fixtures across TwoFactorLoginFlowTest and
AbstractMFAChallengeStrategyTest to drop the literal dash.1 parent 89e058c commit 1e688cb
3 files changed
Lines changed: 21 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
144 | 148 | | |
145 | | - | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
486 | 489 | | |
487 | 490 | | |
488 | 491 | | |
| |||
603 | 606 | | |
604 | 607 | | |
605 | 608 | | |
606 | | - | |
| 609 | + | |
607 | 610 | | |
608 | 611 | | |
609 | 612 | | |
| |||
783 | 786 | | |
784 | 787 | | |
785 | 788 | | |
786 | | - | |
| 789 | + | |
787 | 790 | | |
788 | 791 | | |
789 | 792 | | |
| |||
836 | 839 | | |
837 | 840 | | |
838 | 841 | | |
839 | | - | |
| 842 | + | |
840 | 843 | | |
841 | 844 | | |
842 | 845 | | |
| |||
856 | 859 | | |
857 | 860 | | |
858 | 861 | | |
859 | | - | |
| 862 | + | |
860 | 863 | | |
861 | 864 | | |
862 | 865 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
123 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
0 commit comments