Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"presentation_definition": {
"name": "expirationDate less than 2020",
"input_descriptors": [
{
"id": "drivers_license_information",
"name": "Verify Valid License",
"purpose": "We need you to show that your driver's license will be valid through December of this year.",
"constraints": {
"fields": [
{
"path": ["$.expirationDate"],
"filter": {
"type": "string",
"format": "date-time",
"formatMaximum": "2020-12-31T23:59:59.000Z"
}
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"presentation_definition": {
"name": "Credit Score Check",
"id": "31e2f0f1-6b70-411d-b239-56aed5321884",
"purpose": "Proof that your Credit Score is good: above 800",
"input_descriptors": [
{
"id": "Credential 1",
"name": "CIBC: Credit Score Check",
"purpose": "Proof that your Credit Score is good: above 800",
"constraints": {
"fields": [
{
"path": [
"$.credentialSchema.id"
],
"filter": {
"const": "https://schema.truvera.io/CreditScore-V1-1732907844039.json"
}
},
{
"path": [
"$.credentialSubject.creditScore"
],
"filter": {
"const": 800
},
"predicate": "required"
},
{
"path": [
"$.credentialSubject.bankruptcies"
],
"filter": {
"const": 0
},
"optional": false,
"predicate": "required"
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"presentation_definition": {
"id": "31e2f0f1-6b70-411d-b239-56aed5321884",
"purpose": "We need to know that your license has not been revoked.",
"input_descriptors": [
{
"id": "drivers_license_information",
"name": "Verify Valid License",
"purpose": "We need to know that your license has not been revoked.",
"schema": [
{
"uri": "https://yourwatchful.gov/drivers-license-schema.json"
}
],
"constraints": {
"fields": [
{
"path": ["$.credentialStatus"]
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"presentation_definition": {
"name": "get type ProofOfEmployment",
"input_descriptors": [
{
"id": "Credential 1",
"name": "get type ProofOfEmployment",
"purpose": "test",
"constraints": {
"fields": [
{
"path": [
"$.type[*]"
],
"filter": {
"const": "ProofOfEmployment"
}
}
]
}
}
]
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"presentation_definition": {
"name": "get type UniversityDegree",
"input_descriptors": [
{
"id": "Credential 1",
"name": "get type UniversityDegree",
"purpose": "test",
"constraints": {
"fields": [
{
"path": [
"$.type[*]"
],
"filter": {
"const": "UniversityDegree"
}
}
]
}
}
]
}
}

27 changes: 27 additions & 0 deletions packages/credential-sdk/tests/data/pex/integerrange-pexv2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"presentation_definition": {
"name": "number range",
"input_descriptors": [
{
"id": "Credential 1",
"name": "number range",
"purpose": "test",
"constraints": {
"fields": [
{
"path": [
"$.credentialSubject.number"
],
"filter": {
"type": "integer",
"exclusiveMaximum": 123123,
"exclusiveMinimum": 0
},
"predicate": "required"
}
]
}
}
]
}
}
25 changes: 25 additions & 0 deletions packages/credential-sdk/tests/data/pex/invalid-path-pexv2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"presentation_definition": {
"name": "number range (invalid path)",
"input_descriptors": [
{
"id": "Credential 1",
"name": "number range",
"purpose": "test",
"constraints": {
"fields": [
{
"path": "$.",
"filter": {
"type": "number",
"exclusiveMaximum": 123123,
"exclusiveMinimum": 0
},
"predicate": "required"
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"presentation_definition": {
"name": "issue date greater than 1990",
"input_descriptors": [
{
"id": "Credential 1",
"name": "issue date greater than 1990",
"purpose": "test",
"constraints": {
"fields": [
{
"path": ["$.issuanceDate"],
"filter": {
"type": "string",
"format": "date-time",
"formatMinimum": "1990-10-05T14:38:34.852Z"
},
"predicate": "required"
}
]
}
}
]
}
}
24 changes: 24 additions & 0 deletions packages/credential-sdk/tests/data/pex/no-path-pexv2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"presentation_definition": {
"name": "number range (no path)",
"input_descriptors": [
{
"id": "Credential 1",
"name": "number range",
"purpose": "test",
"constraints": {
"fields": [
{
"filter": {
"type": "number",
"exclusiveMaximum": 123123,
"exclusiveMinimum": 0
},
"predicate": "required"
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"presentation_definition": {
"name": "number greater than 0",
"input_descriptors": [
{
"id": "Credential 1",
"name": "number greater than 0",
"purpose": "test",
"constraints": {
"fields": [
{
"path": [
"$.credentialSubject.number"
],
"filter": {
"type": "number",
"exclusiveMinimum": 0
},
"predicate": "required"
}
]
}
}
]
}
}
26 changes: 26 additions & 0 deletions packages/credential-sdk/tests/data/pex/numberlessthan-pexv2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"presentation_definition": {
"name": "number less than 0",
"input_descriptors": [
{
"id": "Credential 1",
"name": "number less than 0",
"purpose": "test",
"constraints": {
"fields": [
{
"path": [
"$.credentialSubject.number"
],
"filter": {
"type": "number",
"exclusiveMaximum": 123123
},
"predicate": "required"
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"presentation_definition": {
"name": "number range multi path",
"input_descriptors": [
{
"id": "Credential 1",
"name": "number range multi path",
"purpose": "test",
"constraints": {
"fields": [
{
"path": [
"$.credentialSubject.number",
"$.credentialSubject.numberTwo"
],
"filter": {
"type": "number",
"exclusiveMaximum": 123123,
"exclusiveMinimum": 0
},
"predicate": "required"
}
]
}
}
]
}
}
27 changes: 27 additions & 0 deletions packages/credential-sdk/tests/data/pex/numberrange-pexv2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"presentation_definition": {
"name": "number range",
"input_descriptors": [
{
"id": "Credential 1",
"name": "number range",
"purpose": "test",
"constraints": {
"fields": [
{
"path": [
"$.credentialSubject.number"
],
"filter": {
"type": "number",
"exclusiveMaximum": 123123,
"exclusiveMinimum": 0
},
"predicate": "required"
}
]
}
}
]
}
}
Loading