Repository navigation
[PM-40601] test: Add baseline tests for Identity grant stores before v8 update - #8803
Conversation
…ppening in version 8 major update
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR changes only tests. It adds baseline unit tests for |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8803 +/- ##
==========================================
+ Coverage 68.39% 68.44% +0.05%
==========================================
Files 2750 2752 +2
Lines 118161 118265 +104
Branches 10740 10755 +15
==========================================
+ Hits 80811 80943 +132
+ Misses 34806 34780 -26
+ Partials 2544 2542 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JaredSnider-Bitwarden
left a comment
There was a problem hiding this comment.
Nice work! Literally found one tiny thing to improve and we are good to go. Ty for taking this careful approach for the upgrade.
There was a problem hiding this comment.
Great enhancement to consolidate the SSO auth code logic into this helper! Ty!
JaredSnider-Bitwarden
left a comment
There was a problem hiding this comment.
🎨 : with the new helper, we can also replace client ids and redirect uris with refs to those consts!
JaredSnider-Bitwarden
left a comment
There was a problem hiding this comment.
LGTM! Thank you!
🎟️ Tracking
PM-40601
Deps PR for Identity Version 8 #8025
📔 Objective
Add baseline tests for the Identity grant stores before the Duende IdentityServer v8 major update. The v8 update changes method signatures on these stores. These tests record the current behavior so that the upgrade PR can show that the behavior does not change.
New unit tests
AuthorizationCodeStoreTests— covers store, get, and remove of authorization codes. It also records thatRemoveAuthorizationCodeAsyncintentionally keeps the grant until it expires.PersistedGrantStoreTests— coversGetAsync,GetAllAsync,RemoveAsync,RemoveAllAsync, andStoreAsync, including the grant converter.New shared helper
SsoAuthorizationCodeTestHelpers(inIntegrationTestCommon) stores SSO authorization codes through the realIAuthorizationCodeStore. The token endpoint then redeems each code through the same store, serializer, and grant repository as a real SSO login.Updated integration tests
IdentityServerSsoTests,IdentityServerTwoFactorTests, andTwoFactorControllerEmailTestsnow use the shared helper. Previously, these tests substituted the authorization code store with a hard-codedtest_code.IdentityServerSsoTestsadds two tests:SsoLogin_AuthorizationCodeFromGrantStore_ReturnsTokensSsoLogin_SameAuthorizationCodeRedeemedTwice_BothSucceedThis PR changes only tests. It does not change production code.