Skip to content

Support latest OID4VP requirements: DCQL with updated path syntax #66

@pstamatop

Description

@pstamatop

Current Limitations

DCQL Support

There is currently support for presentation requests based on the older OID4VP drafts that used Presentation Exchange (presentation_definition with input_descriptors) but from later drafts onward (Draft 26), the spec removes PEX and introduces DCQL queries which are not currently supported.

Updated Path Syntax

Additionally, only PEX-style JSONPath path values are supported today.
Example: (Draft 20 syntax)

"path": ["$['org.iso.18013.5.1']['family_name']"]

Internally, prepareDigest() enforces this format using regex:

const [[_1, nameSpace], [_2, elementIdentifier]] = [...path.matchAll(/\['(.*?)'\]/g)];

However, newer OID4VP drafts have moved away from JSONPath and now define path as a direct ordered list of keys:
Example: Latest OpenID4VP v1.0 syntax

"path": ["org.iso.18013.5.1", "first_name"]

This path syntax fails with current parsing during digest preparation


Proposed Solution

  • Add DCQL query support alongside existing Presentation Definition support:

    • New usingDcqlQuery()
    • Extend sign() to process dcql_query.credentials as well
  • Extend namespace preparation to work for both:

    • constraints.fields (Presentation Definition)
    • claims (DCQL)
  • Update path resolution (prepareDigest) to support two formats:

    • Legacy JSONPath string ("$['org.iso.18013.5.1']['family_name']")
    • New array form (["org.iso.18013.5.1", "family_name"])
  • Add DCQL tests using sample queries


I’m happy to submit a PR addressing this, if you think the proposed approach makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions