nuts-foundation / nuts-foundation/nuts-node

DeziUserCredential credentialSubject emits wrong @type

Open Beginner friendly
#4,223 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

On branch project-gf, CreateDeziUserCredential (in vcr/credential/dezi.go) produces a credentialSubject whose @type is DeziIDTokenSubject. Per the DeziUserCredential specification (NL Generic Functions IG, credential-DeziUserCredential.md), the credentialSubject.@type must be HealthcareProvider — the type describes the role of the subject, not the carrier.

The relevant code:

func (d DeziIDTokenSubject) MarshalJSON() ([]byte, error) {
    type Alias DeziIDTokenSubject
    aux := struct {
        Alias
        Type string `json:"@type"`
    }{
        Alias: Alias(d),
        Type:  "DeziIDTokenSubject",
    }
    return json.Marshal(aux)
}

The @type literal should be "HealthcareProvider". The inner Employee (HealthcareWorker) @type is already correct.

Expected

credentialSubject.@type == "HealthcareProvider"

Actual

credentialSubject.@type == "DeziIDTokenSubject"

Notes
  • Found while aligning the IG spec with the implementation.
  • Tests in dezi_test.go should be updated to assert @type once fixed.

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 in vcr/credential/dezi.go at DeziIDTokenSubject.MarshalJSON and review dezi_test.go. Change the emitted credentialSubject @type to match the DeziUserCredential specification, then update or run the tests to verify it is HealthcareProvider while the inner Employee type remains HealthcareWorker.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.