diff --git a/README.md b/README.md index 471e9ac1784dbb1147e5f059759e8771841b35b2..bd917fb456dab00e370590aa6ffa60fe42deebe0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/internal/service/signer/service_test.go b/internal/service/signer/service_test.go index be27a0c3c965765fb73649d96f92e1abd9349bdd..6bcbd42f2da3108ae9a2178049c43430ecdb16a6 100644 --- a/internal/service/signer/service_test.go +++ b/internal/service/signer/service_test.go @@ -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) } }