Skip to content
Snippets Groups Projects
Commit d98e7dd8 authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

Fix failing unit tests because of unresolvable external jsonld context

parent 3e50e95f
Branches
No related tags found
No related merge requests found
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
# signer # signer
Signer service exposes HTTP API to creates proofs for verifiable credentials Signer service exposes HTTP API to create Verifiable Credentials, Verifiable
and verifiable presentations. It exposes additional endpoints for retrieving Presentations, or add proofs to given VC or VP. It exposes additional endpoints
public keys necessary for proofs verification. for retrieving public keys necessary for proofs verification.
It is developed using the [Goa v3](https://goa.design/) framework. It is developed using the [Goa v3](https://goa.design/) framework.
...@@ -27,8 +27,8 @@ flowchart LR ...@@ -27,8 +27,8 @@ flowchart LR
``` ```
### Signing Key ### Signing Key
The service uses Vault for making digital signatures on proofs. When a client The service uses Hashicorp Vault for making digital signatures on proofs. When a client
requests a proof, it can specify the name of the signing key to be used. If no requests a proof, it must specify the name of the signing key to be used. If no
key is specified by the client, the signer service will use a default preconfigured key is specified by the client, the signer service will use a default preconfigured
key name to make the proof. key name to make the proof.
...@@ -50,7 +50,8 @@ VAULT_SUPPORTED_KEYS="ed25519,ecdsa-p256" ...@@ -50,7 +50,8 @@ VAULT_SUPPORTED_KEYS="ed25519,ecdsa-p256"
> Check out Hashicorp Vault docs for all [supported key types](https://www.vaultproject.io/api-docs/secret/transit#type-1) > Check out Hashicorp Vault docs for all [supported key types](https://www.vaultproject.io/api-docs/secret/transit#type-1)
> by Vault Transit Engine. Keep in mind, that not all Vault key types may be supported > by Vault Transit Engine. Keep in mind, that not all Vault key types may be supported
> by the Aries framework signature suites and the signer service. > by the Aries framework signature suites and the signer service. Most keys we have
> tested with are ECDSA.
### Public Keys ### Public Keys
......
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"testing" "testing"
"time"
"github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable"
"github.com/piprate/json-gold/ld" "github.com/piprate/json-gold/ld"
...@@ -427,7 +428,7 @@ func TestService_CredentialProof(t *testing.T) { ...@@ -427,7 +428,7 @@ func TestService_CredentialProof(t *testing.T) {
}) })
if err != nil { if err != nil {
assert.Nil(t, res) assert.Nil(t, res)
assert.NotEmpty(t, test.errtext) require.NotEmpty(t, test.errtext, "error is not expected, but got: %v ")
assert.Contains(t, err.Error(), test.errtext) assert.Contains(t, err.Error(), test.errtext)
if e, ok := err.(*errors.Error); ok { if e, ok := err.(*errors.Error); ok {
assert.Equal(t, test.errkind, e.Kind) assert.Equal(t, test.errkind, e.Kind)
...@@ -449,6 +450,8 @@ func TestService_CredentialProof(t *testing.T) { ...@@ -449,6 +450,8 @@ func TestService_CredentialProof(t *testing.T) {
assert.NotEmpty(t, vc.Proofs[0]["jws"]) assert.NotEmpty(t, vc.Proofs[0]["jws"])
} }
}) })
time.Sleep(500 * time.Millisecond)
} }
} }
...@@ -627,9 +630,9 @@ func TestService_PresentationProof(t *testing.T) { ...@@ -627,9 +630,9 @@ func TestService_PresentationProof(t *testing.T) {
Key: test.keyname, Key: test.keyname,
Presentation: pres, Presentation: pres,
}) })
if test.errtext != "" { if err != nil {
require.Error(t, err)
assert.Nil(t, res) assert.Nil(t, res)
require.NotEmpty(t, test.errtext, "error is not expected, but got: %v")
assert.Contains(t, err.Error(), test.errtext) assert.Contains(t, err.Error(), test.errtext)
if e, ok := err.(*errors.Error); ok { if e, ok := err.(*errors.Error); ok {
assert.Equal(t, test.errkind, e.Kind) assert.Equal(t, test.errkind, e.Kind)
...@@ -637,7 +640,7 @@ func TestService_PresentationProof(t *testing.T) { ...@@ -637,7 +640,7 @@ func TestService_PresentationProof(t *testing.T) {
return return
} }
assert.NotNil(t, res) require.NotNil(t, res)
vp, ok := res.(*verifiable.Presentation) vp, ok := res.(*verifiable.Presentation)
assert.True(t, ok) assert.True(t, ok)
...@@ -648,6 +651,8 @@ func TestService_PresentationProof(t *testing.T) { ...@@ -648,6 +651,8 @@ func TestService_PresentationProof(t *testing.T) {
assert.Equal(t, test.proofVerificationMethod, vp.Proofs[0]["verificationMethod"]) assert.Equal(t, test.proofVerificationMethod, vp.Proofs[0]["verificationMethod"])
assert.NotEmpty(t, vp.Proofs[0]["jws"]) assert.NotEmpty(t, vp.Proofs[0]["jws"])
}) })
time.Sleep(500 * time.Millisecond)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment