Skip to content

Expand complex types in verifier.#469

Merged
masv3971 merged 22 commits into
mainfrom
masv/verifier/selective-discloser-view
Jun 11, 2026
Merged

Expand complex types in verifier.#469
masv3971 merged 22 commits into
mainfrom
masv/verifier/selective-discloser-view

Conversation

@masv3971

@masv3971 masv3971 commented Jun 9, 2026

Copy link
Copy Markdown
Member

No description provided.

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 expands verifier support for “complex” selective disclosures and DCQL claim paths, enabling nested objects and per-array-element disclosures (e.g., nationalities), and improving how credentials/claims are parsed and rendered in the verifier UI.

Changes:

  • Add recursive SD-JWT disclosure resolution for nested _sd arrays and array-element markers ({"...": "<hash>"}) during parsing/verification and improve related tests.
  • Extend DCQL claim path handling to support null path elements (array element access) via []*string paths + custom (un)marshaling, and update templates/config accordingly.
  • Update verifier UI rendering to display nested claims as a tree and handle vp_token responses sent either as DCQL object or as a plain string.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
presentation_requests/eudi_pid.yaml Adds ["nationalities", null] path to request per-element nationality disclosures.
presentation_requests/eduid.yaml Adds ["nationalities", null] path to request per-element nationality disclosures.
pkg/sdjwtvc/verification.go Reconstructs nested disclosed claims (including arrays) during SD-JWT verification.
pkg/sdjwtvc/verification_test.go Adds tests for nested reconstruction and attacker/decoy scenarios.
pkg/sdjwtvc/utils.go Parses tokens by recursively resolving disclosures (nested _sd and array markers).
pkg/sdjwtvc/utils_test.go Adds extensive tests for recursive disclosure resolution and security properties.
pkg/openid4vp/response_parameters.go Adds flexible VPResponse JSON unmarshaling for multiple vp_token shapes.
pkg/openid4vp/presentation_builder.go Updates DCQL copy logic for []*string claim paths.
pkg/openid4vp/dcql.go Changes DCQL ClaimQuery.Path to []*string with custom JSON/YAML (un)marshaling helpers.
pkg/openid4vp/dcql_vc20_test.go Updates tests to use StringPath(...).
pkg/openid4vp/dcql_test.go Updates tests to use StringPath(...).
pkg/openid4vp/dcql_functions_test.go Updates tests to use StringPath(...).
internal/verifier/staticembed/credential_display.html Renders picture claim as an <img> instead of raw text.
internal/verifier/staticembed/callback.html Replaces JSON viewer with server-rendered claims tree + <pre> JSON.
internal/verifier/httpserver/service.go Adds template helpers to render claim trees and clean unresolved array markers for display.
internal/verifier/apiv1/helpers_test.go Updates tests to use openid4vp.StringPath(...).
internal/verifier/apiv1/handlers_verification.go Uses parsed (resolved) credential map for display and supports _default vp_token fallback.
internal/verifier/apiv1/handlers_ui.go Augments DCQL based on VCTM to expand nested/object + array-null paths.
internal/verifier/apiv1/handler_session_preference.go Flattens nested verified claims into dot-notation for display API responses.
internal/verifier/apiv1/handler_session_preference_test.go Adds tests for flattening nested claims.
internal/verifier/apiv1/client.go Includes full VCTM claim paths in built DCQL (not only top-level leaf claims).
internal/apigw/apiv1/handlers_verifier.go Updates claim-path construction to use openid4vp.StringPath(...).
.devcontainer/devcontainer.json Adds Go VS Code extension to devcontainer defaults.

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

Comment thread pkg/sdjwtvc/verification.go
Comment thread pkg/openid4vp/dcql.go

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

Copilot reviewed 34 out of 34 changed files in this pull request and generated 7 comments.

Comment thread pkg/sdjwtvc/utils.go
Comment thread pkg/openid4vp/dcql.go
Comment thread pkg/openid4vp/dcql.go
Comment thread internal/verifier/httpserver/service.go Outdated
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread pkg/sdjwtvc/utils.go
Comment thread pkg/sdjwtvc/verification.go

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

Copilot reviewed 34 out of 34 changed files in this pull request and generated 11 comments.

Comment thread pkg/openid4vp/dcql.go
Comment thread pkg/sdjwtvc/verification.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/httpserver/service.go Outdated

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

Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.

Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread pkg/sdjwtvc/utils_test.go
Comment thread internal/verifier/apiv1/client.go
Comment thread pkg/sdjwtvc/utils.go

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

Copilot reviewed 34 out of 34 changed files in this pull request and generated 8 comments.

Comment thread pkg/sdjwtvc/vctm_test.go Outdated
Comment thread pkg/sdjwtvc/vctm_test.go Outdated
Comment thread pkg/sdjwtvc/vctm_test.go Outdated
Comment thread pkg/sdjwtvc/utils.go Outdated
Comment thread pkg/sdjwtvc/verification.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go Outdated
Comment thread internal/verifier/apiv1/handlers_ui_test.go

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Comment thread pkg/openid4vp/presentation_builder.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go

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

Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.

Comment thread pkg/sdjwtvc/verification.go Outdated
Comment thread pkg/openid4vp/dcql_resolve.go Outdated
Comment thread pkg/openid4vp/dcql.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread pkg/sdjwtvc/vctm_test.go
Comment thread pkg/sdjwtvc/example_test.go

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Comment thread pkg/sdjwtvc/verification.go
Comment thread internal/verifier/apiv1/handlers_ui_test.go

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.

Comment thread internal/verifier/apiv1/handlers_ui_test.go
Comment thread pkg/openid4vp/dcql.go
Comment thread pkg/openid4vp/response_parameters.go
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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

Copilot reviewed 35 out of 35 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

internal/verifier/apiv1/handlers_ui_test.go:15

  • The test file calls new("...") to build *string path segments, but there is no new identifier defined in package apiv1 tests. As-is, this won’t compile because Go’s built-in new requires a type (e.g. new(string)), not a string value.

Add a small helper (or switch call sites to an existing pointer helper) so these tests compile.

import (
	"encoding/json"
	"fmt"
	"testing"
	"time"

	"github.com/SUNET/vc/pkg/model"
	"github.com/SUNET/vc/pkg/openid4vp"
	"github.com/SUNET/vc/pkg/sdjwtvc"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

@masv3971 masv3971 merged commit d9f28e7 into main Jun 11, 2026
6 of 7 checks passed
@masv3971 masv3971 deleted the masv/verifier/selective-discloser-view branch June 11, 2026 15:08
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