Skip to content

Request Credential Sets: Data types - #802

Open
nodh wants to merge 4 commits into
feature/claim-pathsfrom
feature/request-credential-sets-data-types
Open

nodh wants to merge 4 commits into
feature/claim-pathsfrom
feature/request-credential-sets-data-types

Conversation

@nodh

@nodh nodh commented Nov 16, 2026

Copy link
Copy Markdown
Member

Adds data classes to represent the possibilities of building DCQL queries, credential sets and claim sets.

@nodh nodh added this to the 10.0 milestone Nov 16, 2026
@nodh
nodh requested review from JesusMcCloud and tlenz November 16, 2026 13:22
@nodh nodh self-assigned this Nov 16, 2026
@nodh
nodh added this pull request to stack #797 November 16, 2026 13:22

@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 16, 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-18T09:00:09.554968Z 3ef3513 Manual request
🔒 Security Review ✅ Completed 2026-11-16T13:26:40.418690Z 9f28f4d 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.

@nodh

nodh commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 9f28f4d6cd

ℹ️ 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".

val required = effectiveRequestedAttributePaths()
return ClaimSelection.All(
required = required.mapTo(linkedSetOf(), toClaim),
ifAvailable = (effectiveRequestedOptionalAttributePaths() - required).mapTo(linkedSetOf(), toClaim),

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 Deduplicate paths after VC-JWT qualification

When a VC-JWT claim is required using its relative form (for example, ["given_name"]) and also optional using its already-qualified form (["credentialSubject", "given_name"]), the subtraction here treats them as different paths, but toClaim then normalizes both to the same JsonClaimReference. ClaimSelection.All consequently throws for overlapping required and optional claims instead of treating the claim as required as documented. Map both sets through toClaim before removing the required claims from the optional set.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we have tests for this?

@JesusMcCloud JesusMcCloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like it very much, but it would be nice to test the claim made by codex (and act accordingly)

* to be used in [OpenId4VpRequestOptions]: a DCQL query (OpenID4VP 1.0, 6) with [toDCQLRequest],
* or an ISO `DeviceRequest` (ISO/IEC 18013-5:2021, 8.3.2.1.2.1) with [toIsoDeviceRetrievalRequest].
*/
data class CredentialPresentationRequestBuilder(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not related to this PR but why is this eve a data class?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Converted to a plain class

val required = effectiveRequestedAttributePaths()
return ClaimSelection.All(
required = required.mapTo(linkedSetOf(), toClaim),
ifAvailable = (effectiveRequestedOptionalAttributePaths() - required).mapTo(linkedSetOf(), toClaim),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we have tests for this?

@nodh
nodh force-pushed the feature/request-credential-sets-data-types branch from 9f28f4d to 3ef3513 Compare November 18, 2026 08:56
@nodh
nodh requested a review from JesusMcCloud November 18, 2026 08:57
@nodh

nodh commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

@codex review again

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 3ef3513b6b

ℹ️ 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".

@nodh
nodh force-pushed the feature/request-credential-sets-data-types branch 2 times, most recently from d23e316 to e9df462 Compare November 18, 2026 10:04
@nodh
nodh force-pushed the feature/request-credential-sets-data-types branch from e9df462 to 0064fae Compare November 18, 2026 10:10
nodh and others added 4 commits November 19, 2026 10:56
Add RequestedCredential.SdJwt, VcJwt and Mdoc, each with its type
identifier, a claim selection and the ID of its DCQL credential query,
constructed from a raw identifier or a typed credential scheme, with
vararg constructors requesting every given claim. ClaimSelection.All
holds the required claims and the claims requested if the holder's
credential contains them, as one bundle. Mdoc.toDocRequest builds the
ISO DocRequest of the required data elements, with intentToRetain per
data element, as a DocRequest marks none as optional.

Claims reuse JsonClaimReference and MdocClaimReference: JsonClaimReference
becomes a data class, so it can be a vararg parameter and its
constructors can be called from Java; its JSON form is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ClaimSelection.Alternatives requests the common claims and exactly one
of its options, alternative claim combinations in the order of the
verifier's preference (OpenID4VP 1.0, 6.4.1). Mdoc.toDocRequest rejects
alternatives, which an ISO ItemsRequest can not express.

Claims are sets, as their order within a claim combination means
nothing: a claim passed twice is requested once. The options of
alternatives stay a list, as their order is the preference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RequestedPresentation requests credentials as sets of alternative
credential combinations (OpenID4VP 1.0, 6.2, 6.4.2): RequestedCredentialSet
.oneOf for a required set, .optional for an optional one, and
RequestedPresentation.allOf for requiring every credential. Its
credentials are the Credential Queries, each once; different
credentials sharing an ID are rejected (OpenID4VP 1.0, 6.1).

Also word the failure of Mdoc.toDocRequest without data elements as
what is wrong.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CredentialPresentationRequestBuilder holds a RequestedPresentation and
builds its DCQL query with claims, claim_sets and credential_sets
(OpenID4VP 1.0, 6.1 to 6.4): claims requested if available are one
bundle, [required + ifAvailable] or [required]; alternatives are one
claim combination per option. The ISO DeviceRequest accepts only
mdocs that are all required, with required data elements, and requests
only those.

RequestOptionsCredential.toRequestedCredential bridges the old request
options: optional attribute paths are requested if available instead
of being required, and a scheme without the type identifier of the
representation fails instead of being dropped. A collection of request
options is passed with fromRequestOptions, as its constructor would
clash with the one taking requested credentials.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nodh
nodh force-pushed the feature/request-credential-sets-data-types branch from 0064fae to 557e7b1 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.

2 participants