test(uk-open-banking): assert real 403 for the 3 checkUKConsent-gated v4.0.1 endpoints#2872
Closed
hongwei1 wants to merge 2 commits into
Closed
Conversation
… v4.0.1 endpoints develop's Hydra removal (PR OpenBankProject#2866) rewrote ConsentUtil.checkUKConsent to read the consent_id claim directly off the Bearer access token instead of calling an external Hydra introspection endpoint. That was the only blocker keeping getAccounts/getAccountsAccountIdBalances/getAccountsAccountIdTransactions on a weak "authenticated -> not 401" assertion (mirroring the same limitation in UKOpenBankingV310AisTests for the equivalent v3.1 endpoints). The OAuth1-signed test requests carry no Bearer JWT, so the consent_id claim lookup now fails deterministically with 403 ConsentIdClaimMissing — asserted directly (status code + error message) instead of the previous placeholder.
…ent-403-assertions # Conflicts: # obp-api/src/test/scala/code/api/UKOpenBanking/v4_0_1/UKOpenBankingV401AccountInfoTests.scala
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
ConsentUtil.checkUKConsentto read theconsent_idclaim directly off the Bearer access token instead of calling an external Hydra introspection endpoint.getAccounts/getAccountsAccountIdBalances/getAccountsAccountIdTransactions(inUKOpenBankingV401AccountInfoTests) on a weak "authenticated -> not 401" assertion, mirroring the same limitation inUKOpenBankingV310AisTestsfor the equivalent v3.1 endpoints.consent_idclaim lookup now fails deterministically with 403ConsentIdClaimMissing— asserted directly (status code + error message) instead of the previous placeholder.Test plan
UKOpenBankingV401AccountInfoTests— 63/63 passedUKOpenBankingV310AisTests— 56/56 passed (no regression)