Integration test: jwt-bearer two-VP token request payload (4078-4)#4229
Draft
stevenvegt wants to merge 4 commits intofeature/4078-jwt-bearer-two-vpfrom
Draft
Integration test: jwt-bearer two-VP token request payload (4078-4)#4229stevenvegt wants to merge 4 commits intofeature/4078-jwt-bearer-two-vpfrom
stevenvegt wants to merge 4 commits intofeature/4078-jwt-bearer-two-vpfrom
Conversation
|
Coverage Impact ⬇️ Merging this pull request will decrease total coverage on 🛟 Help
|
This was referenced May 1, 2026
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.

Parent PRD
#4078
Implementation Spec
Integration safety net. Asserts the full client-side flow produces a PSA 10.10.6-conformant token request and that both VPs verify cleanly through the existing VCR
verifyVPAPI.What to build
In-process Go integration test (under
auth/api/iam/— extend or add alongside the existingintegration_test.go). No docker-compose; that's reserved for cross-node workflows.Test setup
organizationPD (e.g.HealthcareProviderCredential).ServiceProviderDelegationCredentialwhoseissueris one of the HCP subject's DIDs.medication-overviewprofile that has bothorganizationandclientPDs, sharing adelegating_hcpfield id on$.issuer.httptest.Servermock AS that:oauth-authorization-servermetadata advertisingurn:ietf:params:oauth:grant-type:jwt-beareringrant_types_supported.Positive path assertions
POST /internal/auth/v2/{HCP-subjectID}/request-service-access-tokenwith body containingclient_id,authorization_server(mock AS URL), and a mixedscope.grant_typeequalsurn:ietf:params:oauth:grant-type:jwt-bearer.client_assertion_typeequalsurn:ietf:params:oauth:client-assertion-type:jwt-bearer.scopematches what was requested.assertionandclient_assertionare both present and non-empty.presentation_submissionform parameter is present.assertionJWT-VP to the same node'sPOST /internal/vcr/v2/verifier/vpand assertvalidity: true. Inspect the verified credentials — VP1 must contain the expected HCP credentials and be signed by the HCP DID.client_assertionJWT-VP the same way. VP2 must contain the delegation credential, be signed by the SP DID, and the delegation'sissuermust equal the HCP DID that signed VP1 (cross-VP binding verified end-to-end).Negative path assertions
jwt-bearerfromgrant_types_supported→ API call returns 400 with a clear error.clientPD configured for the requested profile → API call returns 400.client_idpresent → API call returns 400 (feature disabled).Modules touched
auth/api/iam/integration_test.go(or a new sibling test file for the jwt-bearer flow).test/or alongside.Why no docker e2e
PSA 10.10.6 server-side support is out of scope for #4078 (separate PRD). There is no second Nuts node that can receive and validate the request. A mock AS via
httptestis the appropriate level — the test verifies wire format and round-trips both VPs through the same node'sverifyVPfor proof validation.Acceptance Criteria
verifyVP; cross-VP binding holds end-to-end.clientPD, feature flag disabled.