Skip to content

Commit

Permalink
fix: vc-model-v2 test suite (#1811)
Browse files Browse the repository at this point in the history
* fix: vc-model-v2 test suite

* fix: lint
  • Loading branch information
skynet2 authored Dec 2, 2024
1 parent 97c1ce5 commit 28c80a9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/restapi/v1/issuer/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,12 @@ func (c *Controller) issueCredential(
return nil, err
}

issuer := credentialParsed.Contents().Issuer
if issuer != nil && !strings.HasPrefix(issuer.ID, "did:") {
return nil, resterr.NewValidationError(resterr.InvalidValue, "credential.issuer",
errors.New("issuer must be a DID"))
}
// not sure why we need this, but this breaks vc-data-model-2.0-test-suite
// issuer := credentialParsed.Contents().Issuer
// if issuer != nil && !strings.HasPrefix(issuer.ID, "did:") {
// return nil, resterr.NewValidationError(resterr.InvalidValue, "credential.issuer",
// errors.New("issuer must be a DID"))
//}

// maybe implement some better handling https://www.w3.org/TR/vc-data-model-2.0/#dfn-url
if strings.Contains(credentialParsed.Contents().ID, " ") {
Expand Down

0 comments on commit 28c80a9

Please sign in to comment.