Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Oct 6, 2023
1 parent fef53b5 commit 84a8ea9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vcr/issuer/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ type issuer struct {
// If publish is true, it publishes the credential to the network using the configured Publisher
// Use the public flag to pass the visibility settings to the Publisher.
func (i issuer) Issue(ctx context.Context, template vc.VerifiableCredential, options CredentialOptions) (*vc.VerifiableCredential, error) {
// Until further notice we don't support publishing JWT VCs, since they're not officially supported by Nuts yet.
if options.Publish && options.Format == JWTCredentialFormat {
return nil, errors.New("publishing VC JWTs is not supported")
}

createdVC, err := i.buildVC(ctx, template, options)
if err != nil {
return nil, err
Expand Down
12 changes: 12 additions & 0 deletions vcr/issuer/issuer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ func Test_issuer_Issue(t *testing.T) {
assert.True(t, trustConfig.IsTrusted(credentialType, result.Issuer))
})

t.Run("publishing JWT VCs is disallowed", func(t *testing.T) {
sut := issuer{}

result, err := sut.Issue(ctx, template, CredentialOptions{
Publish: true,
Public: true,
Format: JWTCredentialFormat,
})
require.EqualError(t, err, "publishing VC JWTs is not supported")
assert.Nil(t, result)
})

t.Run("OpenID4VCI", func(t *testing.T) {
const walletIdentifier = "http://example.com/wallet"
t.Run("ok - publish over OpenID4VCI fails - fallback to network", func(t *testing.T) {
Expand Down

0 comments on commit 84a8ea9

Please sign in to comment.