nuts-foundation / nuts-foundation/nuts-node

Presentation Definition: be lenient about single-entry arrays v.s. singular values

Open
#4,126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
28
Forks
23
Avg merge
1d 10h
Merged PRs (30d)
76

Description

credentialSubject can be an array or a single object. The Presentation Definition specify to handle both, unless it's 100% certain it's one of them.

However, this is quite error prone. Maybe we should treat single-entry arrays and singular values the same when matching Presentation Definitions, regardless whether we're indexing an array (entry 0) or not?

Meaning, these Presentation Definition constraint paths are equivalent when the credentialSubject is an array or an object:

  • credentialSubject[0].some.other.property
  • credentialSubject.some.other.property

If credentialSubject is an array with multiple entries, or the credentialSubject[x] is indexed with x != 0, this semantic doesn't apply.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Go entry point that matches Presentation Definition constraint paths and review how credentialSubject values are resolved. Verify the requested equivalence for a singular value and a single-entry array, while preserving distinct behavior for multiple entries and indexes other than 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.