Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

adding outputs for reference #137

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/steelthread.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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, "<CREDISSUERID>", issuerDID, -1)
credentialJSON = strings.Replace(credentialJSON, "<CREDSUBJECTID>", issuerDID, -1)
credentialJSON = strings.Replace(credentialJSON, "<SCHEMAID>", schemaID, -1)
Expand All @@ -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>", schemaID, -1)
manifestJSON = strings.Replace(manifestJSON, "<ISSUERID>", issuerDID, -1)
output, err = put(endpoint+version+"manifests", manifestJSON)
Expand All @@ -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, "<DEFINITIONID>", presentationDefinitionID, -1)
applicationJSON = strings.Replace(applicationJSON, "<VCJWT>", credentialJWT, -1)
output, err = put(endpoint+version+"manifests/applications", applicationJSON)
Expand Down
20 changes: 20 additions & 0 deletions test/testdata/application-output.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
27 changes: 27 additions & 0 deletions test/testdata/credential-output.json
Original file line number Diff line number Diff line change
@@ -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"
}
File renamed without changes.
35 changes: 35 additions & 0 deletions test/testdata/did-output.json
Original file line number Diff line number Diff line change
@@ -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"
}
97 changes: 97 additions & 0 deletions test/testdata/manifest-output.json
Original file line number Diff line number Diff line change
@@ -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.eyJpZCI6IldBLURMLUNMQVNTLUEiLCJpc3N1ZXIiOnsiaWQiOiJkaWQ6a2V5Ono2TWtnTUZCazd1RXRyWWlNWkZmUEZmeGdhOVM4YWh0dGpzRndiRnpOTEcyRjNyZyJ9LCJvdXRwdXRfZGVzY3JpcHRvcnMiOlt7ImlkIjoia3ljX2NyZWRlbnRpYWwiLCJzY2hlbWEiOiJiYzc3OTU0Yi01N2ZjLTRkNWMtYmZmZi1hNmFjYjJhMTdiNjAifV0sInByZXNlbnRhdGlvbl9kZWZpbml0aW9uIjp7ImZvcm1hdCI6eyJqd3QiOnsiYWxnIjpbIkVkRFNBIl19fSwiaWQiOiIzMmY1NDE2My03MTY2LTQ4ZjEtOTNkOC1mZjIxN2JkYjA2NTMiLCJpbnB1dF9kZXNjcmlwdG9ycyI6W3siY29uc3RyYWludHMiOnsiZmllbGRzIjpbeyJmaWx0ZXIiOnsicGF0dGVybiI6IlthLXpBLVogXFwtXFwuXS4rIiw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MC4wLyJ9.IOXET2euVcsFdfrQnarSCFyPEYb4Ptbd1WRUZJG6MXcBdv_XicjxRolfpY283gtLauByN98JnU-8GoDDRhlHDw"
}
44 changes: 44 additions & 0 deletions test/testdata/schema-output.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}