diff --git a/test/steelthread.go b/test/steelthread.go index a4fb11a8e..f89d0c78c 100644 --- a/test/steelthread.go +++ b/test/steelthread.go @@ -35,7 +35,7 @@ func RunTest() error { // Create a did for the issuer fmt.Println("\n\nCreate a did for the issuer:") - output, err = put(endpoint+version+"dids/key", getJSONFromFile("did.json")) + output, err = put(endpoint+version+"dids/key", getJSONFromFile("did-input.json")) if err != nil { return errors.Wrapf(err, "problem with dids/key endpoint with output: %s", output) } @@ -48,7 +48,7 @@ func RunTest() error { // Create a schema to be used in CM fmt.Println("\n\nCreate a schema to be used in CM:") - output, err = put(endpoint+version+"schemas", getJSONFromFile("schema.json")) + output, err = put(endpoint+version+"schemas", getJSONFromFile("schema-input.json")) if err != nil { return errors.Wrapf(err, "problem with schema endpoint with output: %s", output) } @@ -61,7 +61,7 @@ func RunTest() error { // Create a credential fmt.Println("\n\nCreate a credential to be used in CA:") - credentialJSON := getJSONFromFile("credential.json") + credentialJSON := getJSONFromFile("credential-input.json") credentialJSON = strings.Replace(credentialJSON, "", issuerDID, -1) credentialJSON = strings.Replace(credentialJSON, "", issuerDID, -1) credentialJSON = strings.Replace(credentialJSON, "", schemaID, -1) @@ -78,7 +78,7 @@ func RunTest() error { // Create our Credential Manifest fmt.Println("\n\nCreate our Credential Manifest:") - manifestJSON := getJSONFromFile("manifest.json") + manifestJSON := getJSONFromFile("manifest-input.json") manifestJSON = strings.Replace(manifestJSON, "", schemaID, -1) manifestJSON = strings.Replace(manifestJSON, "", issuerDID, -1) output, err = put(endpoint+version+"manifests", manifestJSON) @@ -94,7 +94,7 @@ func RunTest() error { // Submit an application fmt.Println("\n\nSubmit an Application:") - applicationJSON := getJSONFromFile("application.json") + applicationJSON := getJSONFromFile("application-input.json") applicationJSON = strings.Replace(applicationJSON, "", presentationDefinitionID, -1) applicationJSON = strings.Replace(applicationJSON, "", credentialJWT, -1) output, err = put(endpoint+version+"manifests/applications", applicationJSON) diff --git a/test/testdata/application.json b/test/testdata/application-input.json similarity index 100% rename from test/testdata/application.json rename to test/testdata/application-input.json diff --git a/test/testdata/application-output.json b/test/testdata/application-output.json new file mode 100644 index 000000000..4b4721896 --- /dev/null +++ b/test/testdata/application-output.json @@ -0,0 +1,20 @@ +{ + "credential_response":{ + "id":"cb0cb76e-4a83-4212-aacb-2dd34603927d", + "spec_version":"https://identity.foundation/credential-manifest/spec/v1.0.0/", + "manifest_id":"WA-DL-CLASS-A", + "application_id":"id123", + "fulfillment":{ + "descriptor_map":[ + { + "id":"6a2726f9-37c3-4a5a-886b-4c8e9eb1b264", + "format":"jwt_vc", + "path":"$.verifiableCredential[0]" + } + ] + } + }, + "verifiableCredential":[ + "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa2dNRkJrN3VFdHJZaU1aRmZQRmZ4Z2E5UzhhaHR0anNGd2JGek5MRzJGM3JnIiwidHlwIjoiSldUIn0.eyJpc3MiOiJkaWQ6a2V5Ono2TWtnTUZCazd1RXRyWWlNWkZmUEZmeGdhOVM4YWh0dGpzRndiRnpOTEcyRjNyZyIsImp0aSI6IjZhMjcyNmY5LTM3YzMtNGE1YS04ODZiLTRjOGU5ZWIxYjI2NCIsIm5iZiI6MTY2NjE5NTY1NSwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwiaWQiOiI2YTI3MjZmOS0zN2MzLTRhNWEtODg2Yi00YzhlOWViMWIyNjQiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIl0sImlzc3VlciI6ImRpZDprZXk6ejZNa2dNRkJrN3VFdHJZaU1aRmZQRmZ4Z2E5UzhhaHR0anNGd2JGek5MRzJGM3JnIiwiaXNzdWFuY2VEYXRlIjoiMjAyMi0xMC0xOVQxNjowNzozNVoiLCJjcmVkZW50aWFsU3ViamVjdCI6e30sImNyZWRlbnRpYWxTY2hlbWEiOnsiaWQiOiJiYzc3OTU0Yi01N2ZjLTRkNWMtYmZmZi1hNmFjYjJhMTdiNjAiLCJ0eXBlIjoiSnNvblNjaGVtYVZhbGlkYXRvcjIwMTgifX19.3EkBtSh_yBbArNVOaLRyhjmebM1BNFHpVAC1Wj-obnkuSNDqvGpQkRVEMUGZD-phZIgSJjVHQORXpuc2SWLwBQ" + ] +} \ No newline at end of file diff --git a/test/testdata/credential.json b/test/testdata/credential-input.json similarity index 100% rename from test/testdata/credential.json rename to test/testdata/credential-input.json diff --git a/test/testdata/credential-output.json b/test/testdata/credential-output.json new file mode 100644 index 000000000..76779eb36 --- /dev/null +++ b/test/testdata/credential-output.json @@ -0,0 +1,27 @@ +{ + "credential":{ + "@context":[ + "https://www.w3.org/2018/credentials/v1" + ], + "id":"346c77c2-177b-4902-86f3-115a9fcb028e", + "type":[ + "VerifiableCredential" + ], + "issuer":"did:key:z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg", + "issuanceDate":"2022-10-19T16:07:33Z", + "expirationDate":"2051-10-05T14:48:00.000Z", + "credentialSubject":{ + "additionalName":"hank hill", + "birthDate":"2009-01-03", + "familyName":"simpson", + "givenName":"ricky bobby", + "postalAddress":"p sherman 42 wallaby way, sydney", + "taxID":"123" + }, + "credentialSchema":{ + "id":"bc77954b-57fc-4d5c-bfff-a6acb2a17b60", + "type":"JsonSchemaValidator2018" + } + }, + "credentialJwt":"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa2dNRkJrN3VFdHJZaU1aRmZQRmZ4Z2E5UzhhaHR0anNGd2JGek5MRzJGM3JnIiwidHlwIjoiSldUIn0.eyJleHAiOjI1ODAxMzAwODAsImlzcyI6ImRpZDprZXk6ejZNa2dNRkJrN3VFdHJZaU1aRmZQRmZ4Z2E5UzhhaHR0anNGd2JGek5MRzJGM3JnIiwianRpIjoiMzQ2Yzc3YzItMTc3Yi00OTAyLTg2ZjMtMTE1YTlmY2IwMjhlIiwibmJmIjoxNjY2MTk1NjUzLCJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6IjM0NmM3N2MyLTE3N2ItNDkwMi04NmYzLTExNWE5ZmNiMDI4ZSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmtleTp6Nk1rZ01GQms3dUV0cllpTVpGZlBGZnhnYTlTOGFodHRqc0Z3YkZ6TkxHMkYzcmciLCJpc3N1YW5jZURhdGUiOiIyMDIyLTEwLTE5VDE2OjA3OjMzWiIsImV4cGlyYXRpb25EYXRlIjoiMjA1MS0xMC0wNVQxNDo0ODowMC4wMDBaIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiYWRkaXRpb25hbE5hbWUiOiJoYW5rIGhpbGwiLCJiaXJ0aERhdGUiOiIyMDA5LTAxLTAzIiwiZmFtaWx5TmFtZSI6InNpbXBzb24iLCJnaXZlbk5hbWUiOiJyaWNreSBib2JieSIsInBvc3RhbEFkZHJlc3MiOiJwIHNoZXJtYW4gNDIgd2FsbGFieSB3YXksIHN5ZG5leSIsInRheElEIjoiMTIzIn0sImNyZWRlbnRpYWxTY2hlbWEiOnsiaWQiOiJiYzc3OTU0Yi01N2ZjLTRkNWMtYmZmZi1hNmFjYjJhMTdiNjAiLCJ0eXBlIjoiSnNvblNjaGVtYVZhbGlkYXRvcjIwMTgifX19.47ywDhtVCfLrpCS1MNt0615crXckfTh_w4cfkbvxqqcvOpTpn3ShOWTiCVA8f_SQT8TK_cAZUCQ6GOocbnnhAA" +} \ No newline at end of file diff --git a/test/testdata/did.json b/test/testdata/did-input.json similarity index 100% rename from test/testdata/did.json rename to test/testdata/did-input.json diff --git a/test/testdata/did-output.json b/test/testdata/did-output.json new file mode 100644 index 000000000..eb5707694 --- /dev/null +++ b/test/testdata/did-output.json @@ -0,0 +1,35 @@ +{ + "did":{ + "@context":"https://www.w3.org/ns/did/v1", + "id":"did:key:z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg", + "verificationMethod":[ + { + "id":"#z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg", + "type":"Ed25519VerificationKey2018", + "controller":"did:key:z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg", + "publicKeyBase58":"2tz99seoZK4FF4Qxhgi7qUbSK1S3UrcuFaM4Y4J1Kq5J" + } + ], + "authentication":[ + [ + "#z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg" + ] + ], + "assertionMethod":[ + [ + "#z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg" + ] + ], + "keyAgreement":[ + [ + "#z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg" + ] + ], + "capabilityDelegation":[ + [ + "#z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg" + ] + ] + }, + "privateKeyBase58":"6QLVkTcrAj2gRKwN6tXW3bUFRUBYB5FbQhgtnwP9LdpBUZ3cWrTqZRJurfnsrXJKtMDrobUXxvJhG9vap6QN2sb2VbRYjtFMyMfzVXi5QvMtQvpbT1hdBJbNRdK" +} \ No newline at end of file diff --git a/test/testdata/manifest.json b/test/testdata/manifest-input.json similarity index 100% rename from test/testdata/manifest.json rename to test/testdata/manifest-input.json diff --git a/test/testdata/manifest-output.json b/test/testdata/manifest-output.json new file mode 100644 index 000000000..218ffc931 --- /dev/null +++ b/test/testdata/manifest-output.json @@ -0,0 +1,97 @@ +{ + "credential_manifest":{ + "id":"WA-DL-CLASS-A", + "spec_version":"https://identity.foundation/credential-manifest/spec/v1.0.0/", + "issuer":{ + "id":"did:key:z6MkgMFBk7uEtrYiMZFfPFfxga9S8ahttjsFwbFzNLG2F3rg" + }, + "output_descriptors":[ + { + "id":"kyc_credential", + "schema":"bc77954b-57fc-4d5c-bfff-a6acb2a17b60" + } + ], + "presentation_definition":{ + "id":"32f54163-7166-48f1-93d8-ff217bdb0653", + "input_descriptors":[ + { + "id":"kyc1", + "name":"Personal Info", + "constraints":{ + "fields":[ + { + "path":[ + "$.vc.credentialSubject.givenName" + ], + "id":"givenName", + "filter":{ + "type":"string", + "pattern":"[a-zA-Z \\-\\.].+" + } + }, + { + "path":[ + "$.vc.credentialSubject.additionalName" + ], + "id":"additionalName", + "filter":{ + "type":"string", + "pattern":"[a-zA-Z \\-\\.].+" + } + }, + { + "path":[ + "$.vc.credentialSubject.familyName" + ], + "id":"familyName", + "filter":{ + "type":"string", + "pattern":"[a-zA-Z \\-\\.].+" + } + }, + { + "path":[ + "$.vc.credentialSubject.birthDate" + ], + "id":"birthDate", + "filter":{ + "type":"string", + "format":"date" + } + }, + { + "path":[ + "$.vc.credentialSubject.postalAddress" + ], + "id":"postalAddress", + "filter":{ + "type":"string" + } + }, + { + "path":[ + "$.vc.credentialSubject.taxID" + ], + "id":"taxID", + "filter":{ + "type":"string" + } + } + ], + "subject_is_issuer":"required" + } + } + ], + "name":"KYC Requirements", + "purpose":"TBD", + "format":{ + "jwt":{ + "alg":[ + "EdDSA" + ] + } + } + } + }, + "manifestJwt":"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa2dNRkJrN3VFdHJZaU1aRmZQRmZ4Z2E5UzhhaHR0anNGd2JGek5MRzJGM3JnIiwidHlwIjoiSldUIn0.eyJpZCI6IldBLURMLUNMQVNTLUEiLCJpc3N1ZXIiOnsiaWQiOiJkaWQ6a2V5Ono2TWtnTUZCazd1RXRyWWlNWkZmUEZmeGdhOVM4YWh0dGpzRndiRnpOTEcyRjNyZyJ9LCJvdXRwdXRfZGVzY3JpcHRvcnMiOlt7ImlkIjoia3ljX2NyZWRlbnRpYWwiLCJzY2hlbWEiOiJiYzc3OTU0Yi01N2ZjLTRkNWMtYmZmZi1hNmFjYjJhMTdiNjAifV0sInByZXNlbnRhdGlvbl9kZWZpbml0aW9uIjp7ImZvc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F1aXJlZCJ9LCJpZCI6Imt5YzEiLCJuYW1lIjoiUGVyc29uYWwgSW5mbyJ9XSwibmFtZSI6IktZQyBSZXF1aXJlbWVudHMiLCJwdXJwb3NlIjoiVEJEIn0sInNwZWNfdmVyc2lvbiI6Imh0dHBzOi8vaWRlbnRpdHkuZm91bmRhdGlvbi9jcmVkZW50aWFsLW1hbmlmZXN0L3NwZWMvdjEuMC4wLyJ9.IOXET2euVcsFdfrQnarSCFyPEYb4Ptbd1WRUZJG6MXcBdv_XicjxRolfpY283gtLauByN98JnU-8GoDDRhlHDw" +} \ No newline at end of file diff --git a/test/testdata/schema.json b/test/testdata/schema-input.json similarity index 100% rename from test/testdata/schema.json rename to test/testdata/schema-input.json diff --git a/test/testdata/schema-output.json b/test/testdata/schema-output.json new file mode 100644 index 000000000..69097a845 --- /dev/null +++ b/test/testdata/schema-output.json @@ -0,0 +1,44 @@ +{ + "id":"bc77954b-57fc-4d5c-bfff-a6acb2a17b60", + "schema":{ + "type":"https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json", + "version":"1.0", + "id":"bc77954b-57fc-4d5c-bfff-a6acb2a17b60", + "name":"KYC", + "author":"did:example:123", + "authored":"2022-10-19T16:07:33Z", + "schema":{ + "$id":"kyc-schema-1.0", + "$schema":"https://json-schema.org/draft/2020-12/schema", + "additionalProperties":false, + "description":"KYC Schema", + "properties":{ + "additionalName":{ + "type":"string" + }, + "birthDate":{ + "type":"string" + }, + "familyName":{ + "type":"string" + }, + "givenName":{ + "type":"string" + }, + "id":{ + "type":"string" + }, + "postalAddress":{ + "type":"string" + }, + "taxID":{ + "type":"string" + } + }, + "required":[ + + ], + "type":"object" + } + } +} \ No newline at end of file