Skip to content

fix: VPResponse.VPToken as map[string][]string per OID4VP DCQL spec#5

Merged
s-jairl merged 1 commit into
release/sirosid/v0.5.0from
fix/vptoken-dcql-array-v050
May 8, 2026
Merged

fix: VPResponse.VPToken as map[string][]string per OID4VP DCQL spec#5
s-jairl merged 1 commit into
release/sirosid/v0.5.0from
fix/vptoken-dcql-array-v050

Conversation

@leifj
Copy link
Copy Markdown
Collaborator

@leifj leifj commented May 8, 2026

Summary

Per OID4VP §6.3 with DCQL, vp_token values are arrays of Verifiable Presentations keyed by credential query ID. The previous map[string]string type caused json.Unmarshal to fail when a spec-compliant wallet sends array values, resulting in errors like failed to unmarshal decrypted JWE.

Changes

  • Change VPToken from map[string]string to map[string][]string in VPResponse
  • Update API gateway handler to unwrap first token from array
  • Update verifier handler with same unwrap logic
  • Update tests to use new type

Notes

Rebased version of SUNET#386 targeting release/sirosid/v0.5.0.

Fixes SUNET#365

OID4VP 1.0 §8.1 requires vp_token values to be arrays of presentations.
The previous map[string]string type caused json.Unmarshal to silently
drop array values from spec-compliant wallets, resulting in 'VP Token
not found' errors.

- Change VPToken from map[string]string to map[string][]string
- Update API gateway handler to unwrap first token from array
- Update verifier handler with same unwrap logic
- Update tests to use new type

Fixes SUNET#365
@s-jairl s-jairl merged commit 2e0e7bd into release/sirosid/v0.5.0 May 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants