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

Merge branch 'fix-unit-tests' into 'main'

Fix failing unit tests because of unresolvable external jsonld context

See merge request eclipse/xfsc/tsa/signer!13
parents 3e50e95f d98e7dd8
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,9 @@
# signer
Signer service exposes HTTP API to creates proofs for verifiable credentials
and verifiable presentations. It exposes additional endpoints for retrieving
public keys necessary for proofs verification.
Signer service exposes HTTP API to create Verifiable Credentials, Verifiable
Presentations, or add proofs to given VC or VP. It exposes additional endpoints
for retrieving public keys necessary for proofs verification.
It is developed using the [Goa v3](https://goa.design/) framework.
......@@ -27,8 +27,8 @@ flowchart LR
```
### Signing Key
The service uses 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
The service uses Hashicorp Vault for making digital signatures on proofs. When a client
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 name to make the proof.
......@@ -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)
> 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
......
......@@ -9,6 +9,7 @@ import (
"fmt"
"net/http"
"testing"
"time"
"github.com/hyperledger/aries-framework-go/pkg/doc/verifiable"
"github.com/piprate/json-gold/ld"
......@@ -427,7 +428,7 @@ func TestService_CredentialProof(t *testing.T) {
})
if err != nil {
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)
if e, ok := err.(*errors.Error); ok {
assert.Equal(t, test.errkind, e.Kind)
......@@ -449,6 +450,8 @@ func TestService_CredentialProof(t *testing.T) {
assert.NotEmpty(t, vc.Proofs[0]["jws"])
}
})
time.Sleep(500 * time.Millisecond)
}
}
......@@ -627,9 +630,9 @@ func TestService_PresentationProof(t *testing.T) {
Key: test.keyname,
Presentation: pres,
})
if test.errtext != "" {
require.Error(t, err)
if err != nil {
assert.Nil(t, res)
require.NotEmpty(t, test.errtext, "error is not expected, but got: %v")
assert.Contains(t, err.Error(), test.errtext)
if e, ok := err.(*errors.Error); ok {
assert.Equal(t, test.errkind, e.Kind)
......@@ -637,7 +640,7 @@ func TestService_PresentationProof(t *testing.T) {
return
}
assert.NotNil(t, res)
require.NotNil(t, res)
vp, ok := res.(*verifiable.Presentation)
assert.True(t, ok)
......@@ -648,6 +651,8 @@ func TestService_PresentationProof(t *testing.T) {
assert.Equal(t, test.proofVerificationMethod, vp.Proofs[0]["verificationMethod"])
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