Skip to content

Commit

Permalink
addingn readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nitro-neal committed Nov 30, 2023
1 parent 392de55 commit 0fbcb47
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 42 deletions.
22 changes: 22 additions & 0 deletions web5-test-vectors/presentation-exchange/README.md
Original file line number Diff line number Diff line change
@@ -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`

Check failure on line 9 in web5-test-vectors/presentation-exchange/README.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces

web5-test-vectors/presentation-exchange/README.md:9:104 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md009.md

Check failure on line 9 in web5-test-vectors/presentation-exchange/README.md

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces

web5-test-vectors/presentation-exchange/README.md:9:104 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md009.md

| 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`. |
83 changes: 41 additions & 42 deletions web5-test-vectors/presentation-exchange/wa-license.json
Original file line number Diff line number Diff line change
@@ -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.eyJpc3MiOiJkaWQ6a2V5Ono2TWtuakpFV2dMc2gzUngzN2V6VEIySmhNUWNZMWMzeHZ0WEt3MWhBemZlZUp6SiIsInN1YiI6ImRpZDprZXk6ejZNa25qSkVXZ0xzaDNSeDM3ZXpUQjJKaE1RY1kxYzN4dnRYS3cxaEF6ZmVlSnpKIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIldhRHJpdmVMaWNlbnNlIl0sImlkIjoidXJuO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jktOTEyYS00MWNjLWFjYjUtZjMzOGQ2MmQ1OGNlIiwiaXNzdWVyIjoiZGlkOmtleTp6Nk1rbmpKRVdnTHNoM1J4MzdlelRCMkpoTVFjWTFjM3h2dFhLdzFoQXpmZWVKekoiLCJpc3N1YW5jZURhdGUiOiIyMDIzLTExLTI5VDIxOjQ5OjIxWiIsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmtleTp6Nk1rbmpKRVdnTHNoM1J4MzdlelRCMkpoTVFjWTFjM3h2dFhLdzFoQXpmZWVKekoiLCJkYXRlT2ZCaXJ0aCI6IjExLTExLTIwMTEiLCJsaWNlbnNlTnVtYmVyIjoiMTIzNCIsImxpY2Vuc2VTdGF0ZSI6IldBIn19fQ.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]"
}
]
}
}
}
}
}
]
}

}

0 comments on commit 0fbcb47

Please sign in to comment.