From fee5752db286cdfd534b71578904f54c17716a1b Mon Sep 17 00:00:00 2001 From: michev <georgi.michev@vereign.com> Date: Sat, 3 Dec 2022 22:19:21 +0200 Subject: [PATCH] Update integration tests The update was needed due to changes in services (Signer tag: v1.3.1). Signed-off-by: michev <georgi.michev@vereign.com> --- integration/credentials_testdata.go | 32 +++++---- integration/internal/client/signer.go | 7 +- integration/presentations_testdata.go | 96 +++++++++++++++++++-------- 3 files changed, 91 insertions(+), 44 deletions(-) diff --git a/integration/credentials_testdata.go b/integration/credentials_testdata.go index 79d9042..1048bc3 100644 --- a/integration/credentials_testdata.go +++ b/integration/credentials_testdata.go @@ -2,20 +2,24 @@ package integration var credentialWithSubjectID = ` { - "@context": - [ - "https://www.w3.org/2018/credentials/v1", - "https://w3id.org/security/suites/jws-2020/v1", - "https://schema.org" - ], - "type": "VerifiableCredential", - "issuer": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": - { - "id":"did:web:example.com", - "allow":true + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "id": "http://example.edu/credentials/3732", + "type": ["VerifiableCredential", "UniversityDegreeCredential"], + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "issuanceDate": "2010-01-01T00:00:00Z", + "credentialSubject": { + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "allow": true, + "num": 123, + "array": { + "txt1": "1", + "txt2": "2" } + } }` var credentialWithoutSubjectID = ` @@ -27,7 +31,7 @@ var credentialWithoutSubjectID = ` "https://schema.org" ], "type": "VerifiableCredential", - "issuer": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "issuanceDate": "2010-01-01T19:23:24Z", "credentialSubject": { diff --git a/integration/internal/client/signer.go b/integration/internal/client/signer.go index 9e7fa36..398b429 100644 --- a/integration/internal/client/signer.go +++ b/integration/internal/client/signer.go @@ -23,8 +23,9 @@ func (s *Signer) CreateCredentialProof(vc []byte) ([]byte, error) { } payload := map[string]interface{}{ + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "namespace": "transit", - "key": "key2", + "key": "key1", "credential": cred, } @@ -90,9 +91,9 @@ func (s *Signer) CreatePresentationProof(vp []byte) ([]byte, error) { } payload := map[string]interface{}{ - "issuer": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "namespace": "transit", - "key": "key2", + "key": "key1", "presentation": pres, } diff --git a/integration/presentations_testdata.go b/integration/presentations_testdata.go index bc3dbef..607fa2e 100644 --- a/integration/presentations_testdata.go +++ b/integration/presentations_testdata.go @@ -1,34 +1,76 @@ package integration +// var presentationWithSubjectID = ` +// { +// "@context": +// [ +// "https://www.w3.org/2018/credentials/v1", +// "https://w3id.org/security/suites/jws-2020/v1", +// "https://schema.org" +// ], +// "id": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", +// "type": "VerifiablePresentation", +// "verifiableCredential": +// [ +// { +// "@context": +// [ +// "https://www.w3.org/2018/credentials/v1", +// "https://schema.org" +// ], +// "id": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", +// "type": "VerifiableCredential", +// "issuer": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", +// "issuanceDate": "2010-01-01T19:23:24Z", +// "credentialSubject": +// { +// "id":"did:web:example.com", +// "allow": true +// } +// } +// ] +// }` + var presentationWithSubjectID = ` { - "@context": - [ - "https://www.w3.org/2018/credentials/v1", - "https://w3id.org/security/suites/jws-2020/v1", - "https://schema.org" - ], - "id": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", - "type": "VerifiablePresentation", - "verifiableCredential": - [ - { - "@context": - [ - "https://www.w3.org/2018/credentials/v1", - "https://schema.org" - ], - "id": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", - "type": "VerifiableCredential", - "issuer": "did:web:4db4-85-196-181-2.eu.ngrok.io:policy:policy:example:returnDID:1.0:evaluation", - "issuanceDate": "2010-01-01T19:23:24Z", - "credentialSubject": - { - "id":"did:web:example.com", - "allow": true - } - } - ] + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1" + ], + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiablePresentation", + "verifiableCredential": [ + { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1", + "https://schema.org" + ], + "credentialSubject": { + "allow": true, + "citizenship": "France", + "age_over": 18, + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" + }, + "issuanceDate": "2022-07-21T10:24:36.203848291Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" + }, + { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1", + "https://schema.org" + ], + "credentialSubject": { + "allow": true, + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" + }, + "issuanceDate": "2022-07-21T10:24:36.203861194Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" + } + ] }` var presentationWithoutSubjectID = ` -- GitLab