Skip to content

Request Credential Sets: More validation - #805

Open
nodh wants to merge 5 commits into
feature/request-credential-setsfrom
feature/request-credential-sets-validation
Open

nodh wants to merge 5 commits into
feature/request-credential-setsfrom
feature/request-credential-sets-validation

Conversation

@nodh

@nodh nodh commented Nov 19, 2026

Copy link
Copy Markdown
Member

More validation and detailed checks. But we'll need to implement ISO 18013-5 from 2026 to support optional claims over ISO Device Requests.

@nodh nodh added this to the 10.0 milestone Nov 19, 2026
@nodh
nodh requested a review from JesusMcCloud November 19, 2026 08:32
@nodh nodh self-assigned this Nov 19, 2026
@nodh
nodh added this pull request to stack #797 November 19, 2026 08:32

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T08:37:47.255258Z 34ddf5f PR opened
🔒 Security Review ✅ Completed 2026-11-19T08:40:36.339605Z 34ddf5f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34ddf5fc87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +216 to +217
if (queryIds != null && !queryIds.containsAll(ids))
throw InvalidRequest("credential_ids of verifier_info references an unknown DCQL query")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject verifier info IDs when the DCQL query is absent

When an incoming request has verifier_info.credential_ids but no dcql_query (for example, a scope-only or otherwise malformed VP request), queryIds is null and this condition skips reference validation entirely, so arbitrary non-empty identifiers are accepted even though they cannot reference a Credential Query. Treat the missing query as having no valid IDs, as OpenId4VpRequestOptions already does, or reject credential-scoped verifier info in this case.

Useful? React with 👍 / 👎.

nodh and others added 5 commits November 19, 2026 10:56
DcApiVerifier accepted an ISO/IEC 18013-7 Annex C response as soon as
there was one accepted document of each requested docType, even if it
withheld requested data elements, which the mdoc may do (ISO/IEC
18013-5:2021, 8.3.2.1.2.2). As VC-K requests only the data elements it
requires, every document request now has to be answered by its own
accepted document that returns each requested data element
issuer-signed. Documents are assigned to requests by backtracking,
regardless of their order, so two requests of one docType need two
documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DCQLQuery.toIso180137AnnexCDeviceRequest rejected claim_sets with more
than one option, as an ItemsRequest can not express that the wallet
presents one of them (OpenID4VP 1.0, 6.4.1). So an mdoc whose data
elements are requested if available, with the claim combinations
[required + if available] and [required], could not be offered over
ISO/IEC 18013-7 Annex C next to OpenID4VP.

If one option is contained in every other one, the verifier accepts it,
and requesting exactly its claims asks for nothing the verifier does not
accept, so that option is requested, as RequestedCredential.Mdoc
.toDocRequest does for claims requested if available. Neither ISO/IEC
18013-5:2021 nor ISO/IEC DIS 18013-5:2026 can mark a data element as
optional. Alternatives, of which no option is contained in all others,
are still rejected, as requesting their common claims would ask for less
than the verifier accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HolderDCQLQueryMatchingResult only offered toDefaultSubmission, which
presents the first satisfiable option of each required credential set
and no optional set. Wallets that let the End-User choose, as they
"typically" do (OpenID4VP 1.0, 6.4.3), had no view of the credential
sets and built the submission map themselves.

credentialSets(dcqlQuery) lists the credential sets with whether the
holder can satisfy each option, and toSubmission(dcqlQuery, selection)
builds the submission of the chosen option of each set, or of none for
an optional set, failing for an unsatisfied required set.
toDefaultSubmission is that selection of the first satisfiable option of
each required set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The matching quoted "Verifiers MUST NOT point to the same claim more
than once in a single query. Wallets SHOULD ignore such duplicate claim
queries." as OpenID4VP 1.0, 6.1, and ignored every claims query of a
combination after the first one of its claim. OpenID4VP 1.0 has no such
rule: draft 31 removed it ("Remove requirements for duplicate claim
entries"). So two claims queries of one claim with different values
silently checked only the first.

Every claims query of a combination is now matched. An mdoc presentation
returns a data element selected by several claims queries once, as an
mdoc does not return a data element twice in one name space (ISO/IEC
18013-5:2021, 8.3.2.1.2.2); SD-JWT disclosures are a set already.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Credential and claims query identifiers have to be non-empty strings of
"alphanumeric, underscore (_), or hyphen (-) characters" (OpenID4VP 1.0,
6.1, 6.3). They accepted every Unicode letter and digit, e.g. "ä", with
isLetterOrDigit; they now accept the ASCII letters and digits, ALPHA and
DIGIT of RFC 5234. DCQLCredentialQueryIdentifierTest tested the claims
query identifier instead of the credential query identifier.

The credential_ids of verifier_info, if present, are "A non-empty array
of strings each referencing a Credential requested by the Verifier"
(OpenID4VP 1.0, 5.1), but were not checked. OpenId4VpRequestOptions now
rejects empty ones and ones referencing no credential query, and the
wallet's AuthorizationRequestValidator rejects such requests with
invalid_request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nodh
nodh force-pushed the feature/request-credential-sets-validation branch from 34ddf5f to 0102288 Compare November 19, 2026 09:58

This branch has not been deployed

No deployments
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.

1 participant