Skip to content

fix: do not enumerate all VCTM claims in fallback DCQL query#481

Open
leifj wants to merge 1 commit into
SUNET:mainfrom
sirosfoundation:fix/dcql-fallback-omit-claims
Open

fix: do not enumerate all VCTM claims in fallback DCQL query#481
leifj wants to merge 1 commit into
SUNET:mainfrom
sirosfoundation:fix/dcql-fallback-omit-claims

Conversation

@leifj

@leifj leifj commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #480

When no presentation request templates are configured (presentation_requests_dir not set), the verifier falls back to buildDCQLQueryFromConfig() which iterated all claims from the VCTM and added them to the DCQL query. This caused the verifier to request every possible claim from the wallet, regardless of what the operator intended.

Changes

  • internal/verifier/apiv1/client.go: Remove VCTM claim enumeration from buildDCQLQueryFromConfig(). The fallback DCQL query now omits the Claims field entirely, letting the wallet decide what to disclose. To request specific claims, operators should configure presentation request templates with explicit DCQL claim paths.
  • internal/verifier/apiv1/client_test.go: Add assertion that fallback DCQL credentials do not enumerate individual claims.

Testing

  • All existing tests pass (including the buildDCQLQueryFromConfig and createDCQLQuery test suites)
  • The scope with VCTM containing claims test case now explicitly verifies that claims are not populated in fallback mode

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the verifier’s fallback DCQL query construction so that, when presentation request templates aren’t available, it no longer enumerates all claims from the VCTM into the DCQL query (preventing “request everything” behavior and aligning disclosure decisions with the wallet unless operators explicitly configure claim paths via templates).

Changes:

  • Remove VCTM claim enumeration from buildDCQLQueryFromConfig() so fallback DCQL omits claims.
  • Add/extend tests to assert that fallback DCQL credentials do not populate Claims.
  • Add clarifying inline documentation for the fallback behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/verifier/apiv1/client.go Stops fallback DCQL generation from enumerating VCTM claims; adds explanatory comment.
internal/verifier/apiv1/client_test.go Adds assertion that fallback DCQL does not populate Claims.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/verifier/apiv1/client.go Outdated
Comment on lines +309 to +312
// This is the fallback path used when no presentation request templates are configured.
// It does NOT enumerate individual claims from the VCTM — instead it omits the Claims
// field, letting the wallet decide what to disclose. To request specific claims,
// configure presentation request templates with explicit DCQL claim paths.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point — updated the doc comment to mention template loading failures as well.

When no presentation request templates are configured, the verifier
falls back to buildDCQLQueryFromConfig() which iterated all claims
from the VCTM and added them to the DCQL query. This caused the
verifier to request every possible claim from the wallet, ignoring
any claim filtering configured in presentation request templates.

Remove the VCTM claim enumeration from the fallback path. When no
templates are configured, the DCQL query now omits the Claims field
entirely, letting the wallet decide what to disclose.

To request specific claims, configure presentation request templates
with explicit DCQL claim paths.

Fixes SUNET#480
@leifj leifj force-pushed the fix/dcql-fallback-omit-claims branch from 9f7ad4d to dae860a Compare June 12, 2026 08:54
@sonarqubecloud

Copy link
Copy Markdown

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.

Verifier queries all credential claims in "OIDC OP" mode

2 participants