From 0fbcb474a12cb6bfd6cbe1dc154e04aa6d7a574c Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 30 Nov 2023 10:43:49 -0600 Subject: [PATCH] addingn readme --- .../presentation-exchange/README.md | 22 +++++ .../presentation-exchange/wa-license.json | 83 +++++++++---------- 2 files changed, 63 insertions(+), 42 deletions(-) create mode 100644 web5-test-vectors/presentation-exchange/README.md diff --git a/web5-test-vectors/presentation-exchange/README.md b/web5-test-vectors/presentation-exchange/README.md new file mode 100644 index 0000000..7d5a60c --- /dev/null +++ b/web5-test-vectors/presentation-exchange/README.md @@ -0,0 +1,22 @@ +# Presentation Exchange Test Vectors + +## CreatePresentationFromCredentials + +Input and output for a full presentation exchange test vectors are available [here](./wa-license.json) + +### Input + +the value of `input` is a an object with `presentationDefinition` and the corresponding `credentialJwt` + +| Property | Description | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `presentationDefinition` | the input [presentationDefinition](https://identity.foundation/presentation-exchange/#presentation-definition) showing the requirements used for this getting an example WA license | +| `credentialJwt` | the input [credentialJwt](https://www.w3.org/TR/did-core/#dfn-diddocumentmetadata) that corresponds to the presentationDefinition to fulfill it and do a full presentation exchange + +### Output + +the value of `output` is an object that contains the following properties + +| Property | Description | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `presentationSubmission` | the expected [presentationSubmission](https://www.w3.org/TR/did-core/#dfn-diddocument) when the `inputs` are processed by `createPresentationFromCredentials`. | diff --git a/web5-test-vectors/presentation-exchange/wa-license.json b/web5-test-vectors/presentation-exchange/wa-license.json index 28f4b0e..269ca08 100644 --- a/web5-test-vectors/presentation-exchange/wa-license.json +++ b/web5-test-vectors/presentation-exchange/wa-license.json @@ -1,46 +1,45 @@ { - "description": "Simple Presentation Exchange", - "vectors": [ - { - "description": "presentation exchange for wa drivers license", - "input": { - "presentationDefinition": { - "id": "32f54163-7166-48f1-93d8-ff217bdb0653", - "input_descriptors": [ - { - "id": "wa_driver_license", - "name": "Washington State Business License", - "purpose": "We can only allow licensed Washington State business representatives into the WA Business Conference", - "constraints": { - "fields": [ - { - "path": [ - "$.credentialSubject.dateOfBirth", - "$.credentialSubject.licenseNumber", - "$.credentialSubject.licenseState" - ] - } - ] - } - } - ] + "description":"Simple Presentation Exchange", + "vectors":[ + { + "description":"presentation exchange for wa drivers license", + "input":{ + "presentationDefinition":{ + "id":"32f54163-7166-48f1-93d8-ff217bdb0653", + "input_descriptors":[ + { + "id":"wa_driver_license", + "name":"Washington State Business License", + "purpose":"We can only allow licensed Washington State business representatives into the WA Business Conference", + "constraints":{ + "fields":[ + { + "path":[ + "$.credentialSubject.dateOfBirth", + "$.credentialSubject.licenseNumber", + "$.credentialSubject.licenseState" + ] + } + ] + } + } + ] + }, + "credentialJwt":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDprZXk6ejZNa25qSkVXZ0xzaDNSeDM3ZXpUQjJKaE1RY1kxYzN4dnRYS3cxaEF6ZmVlSnpKI3o2TWtuakpFV2dMc2gzUngzN2V6VEIySmhNUWNZMWMzeHZ0WEt3MWhBemZlZUp6SiJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtuakpFV2dMc2gzUngzN2V6VEIySmhNUWNZMWMzeHZ0WEt3MWhBemZlZUp6SiIsInN1YiI6ImRpZDprZXk6ejZNa25qSkVXZ0xzaDNSeDM3ZXpUQjJKaE1RY1kxYzN4dnRYS3cxaEF6ZmVlSnpKIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIldhRHJpdmVMaWNlbnNlIl0sImlkIjoidXJuOnV1aWQ6OGYzYmU5NjktOTEyYS00MWNjLWFjYjUtZjMzOGQ2MmQ1OGNlIiwiaXNzdWVyIjoiZGlkOmtleTp6Nk1rbmpKRVdnTHNoM1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WTFjM3h2dFhLdzFoQXpmZWVKekoiLCJpc3N1YW5jZURhdGUiOiIyMDIzLTExLTI5VDIxOjQ5OjIxWiIsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmtleTp6Nk1rbmpKRVdnTHNoM1J4MzdlelRCMkpoTVFjWTFjM3h2dFhLdzFoQXpmZWVKekoiLCJkYXRlT2ZCaXJ0aCI6IjExLTExLTIwMTEiLCJsaWNlbnNlTnVtYmVyIjoiMTIzNCIsImxpY2Vuc2VTdGF0ZSI6IldBIn19fQ.oGaIuZI9vRcauGI2Zi469mx8KZR1zpNV_HbmFtvWoap6CaPtn-uaG4oxswAfB4ITUs5fePKIgUvdGbBKyWx1CQ" - }, - "output": { - "presentationSubmission": { - "id": "VPaHaqzslzOqisx02jMS0", - "definition_id": "32f54163-7166-48f1-93d8-ff217bdb0653", - "descriptor_map": [ - { - "id": "wa_driver_license", - "format": "jwt_vc", - "path": "$.verifiableCredential[0]" - } - ] + "output":{ + "presentationSubmission":{ + "id":"VPaHaqzslzOqisx02jMS0", + "definition_id":"32f54163-7166-48f1-93d8-ff217bdb0653", + "descriptor_map":[ + { + "id":"wa_driver_license", + "format":"jwt_vc", + "path":"$.verifiableCredential[0]" + } + ] + } } - } - } + } ] - } - \ No newline at end of file + } \ No newline at end of file