Skip to content

DeziUserCredential credentialSubject emits wrong @type #4223

@reinkrul

Description

@reinkrul

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions