Skip to content

Commit

Permalink
Merge pull request #266 from openid/danielfett/vp-query-language-3
Browse files Browse the repository at this point in the history
Introduce new query language (Approach 3)
  • Loading branch information
jogu authored Oct 23, 2024
2 parents a1ceb50 + ff62fcf commit 2eaa550
Show file tree
Hide file tree
Showing 8 changed files with 722 additions and 23 deletions.
22 changes: 22 additions & 0 deletions examples/query_lang/claims_alternatives.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"credentials": [
{
"id": "pid",
"format": "vc+sd-jwt",
"meta": {
"vct_values": [ "https://credentials.example.com/identity_credential" ]
},
"claims": [
{"id": "a", "path": ["last_name"]},
{"id": "b", "path": ["postal_code"]},
{"id": "c", "path": ["locality"]},
{"id": "d", "path": ["region"]},
{"id": "e", "path": ["date_of_birth"]}
],
"claim_sets": [
["a", "c", "d", "e"],
["a", "b", "e"]
]
}
]
}
107 changes: 107 additions & 0 deletions examples/query_lang/complex_mdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"credentials": [
{
"id": "mdl-id",
"format": "mso_mdoc",
"meta": {
"doctype_value": "org.iso.18013.5.1.mDL"
},
"claims": [
{
"id": "given_name",
"namespace": "org.iso.18013.5.1",
"claim_name": "given_name"
},
{
"id": "family_name",
"namespace": "org.iso.18013.5.1",
"claim_name": "family_name"
},
{
"id": "portrait",
"namespace": "org.iso.18013.5.1",
"claim_name": "portrait"
}
]
},
{
"id": "mdl-address",
"format": "mso_mdoc",
"meta": {
"doctype_value": "org.iso.18013.5.1.mDL"
},
"claims": [
{
"id": "resident_address",
"namespace": "org.iso.18013.5.1",
"claim_name": "resident_address"
},
{
"id": "resident_country",
"namespace": "org.iso.18013.5.1",
"claim_name": "resident_country"
}
]
},
{
"id": "photo_card-id",
"format": "mso_mdoc",
"meta": {
"doctype_value": "org.iso.23220.photoid.1"
},
"claims": [
{
"id": "given_name",
"namespace": "org.iso.23220.1",
"claim_name": "given_name"
},
{
"id": "family_name",
"namespace": "org.iso.23220.1",
"claim_name": "family_name"
},
{
"id": "portrait",
"namespace": "org.iso.23220.1",
"claim_name": "portrait"
}
]
},
{
"id": "photo_card-address",
"format": "mso_mdoc",
"meta": {
"doctype_value": "org.iso.23220.photoid.1"
},
"claims": [
{
"id": "resident_address",
"namespace": "org.iso.23220.1",
"claim_name": "resident_address"
},
{
"id": "resident_country",
"namespace": "org.iso.23220.1",
"claim_name": "resident_country"
}
]
}
],
"credential_sets": [
{
"purpose": "Identification",
"options": [
[ "mdl-id" ],
[ "photo_card-id" ]
]
},
{
"purpose": "Proof of address",
"required": false,
"options": [
[ "mdl-address" ],
[ "photo_card-address" ]
]
}
]
}
78 changes: 78 additions & 0 deletions examples/query_lang/credentials_alternatives.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"credentials": [
{
"id": "pid",
"format": "vc+sd-jwt",
"meta": {
"vct_values": ["https://credentials.example.com/identity_credential"]
},
"claims": [
{"path": ["given_name"]},
{"path": ["family_name"]},
{"path": ["address", "street_address"]}
]
},
{
"id": "other_pid",
"format": "vc+sd-jwt",
"meta": {
"vct_values": ["https://othercredentials.example/pid"]
},
"claims": [
{"path": ["given_name"]},
{"path": ["family_name"]},
{"path": ["address", "street_address"]}
]
},
{
"id": "pid_reduced_cred_1",
"format": "vc+sd-jwt",
"meta": {
"vct_values": ["https://credentials.example.com/reduced_identity_credential"]
},
"claims": [
{"path": ["family_name"]},
{"path": ["given_name"]}
]
},
{
"id": "pid_reduced_cred_2",
"format": "vc+sd-jwt",
"meta": {
"vct_values": ["https://cred.example/residence_credential"]
},
"claims": [
{"path": ["postal_code"]},
{"path": ["locality"]},
{"path": ["region"]}
]
},
{
"id": "nice_to_have",
"format": "vc+sd-jwt",
"meta": {
"vct_values": ["https://company.example/company_rewards"]
},
"claims": [
{"path": ["rewards_number"]}
]
}
],
"credential_sets": [
{
"purpose": "Identification",
"options": [
[ "pid" ],
[ "other_pid" ],
[ "pid_reduced_cred_1", "pid_reduced_cred_2" ]
]
},
{
"purpose": "Show your rewards card",
"required": false,
"options": [
[ "nice_to_have" ]
]
}
]
}
33 changes: 33 additions & 0 deletions examples/query_lang/multi_credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"credentials": [
{
"id": "pid",
"format": "vc+sd-jwt",
"meta": {
"vct_values": ["https://credentials.example.com/identity_credential"]
},
"claims": [
{"path": ["given_name"]},
{"path": ["family_name"]},
{"path": ["address", "street_address"]}
]
},
{
"id": "mdl",
"format": "mso_mdoc",
"meta": {
"doctype_value": "org.iso.7367.1.mVRC"
},
"claims": [
{
"namespace": "org.iso.7367.1",
"claim_name": "vehicle_holder"
},
{
"namespace": "org.iso.18013.5.1",
"claim_name": "first_name"
}
]
}
]
}
16 changes: 16 additions & 0 deletions examples/query_lang/simple.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"credentials": [
{
"id": "my_credential",
"format": "vc+sd-jwt",
"meta": {
"vct_values": [ "https://credentials.example.com/identity_credential" ]
},
"claims": [
{"path": ["last_name"]},
{"path": ["first_name"]},
{"path": ["address", "street_address"]}
]
}
]
}
21 changes: 21 additions & 0 deletions examples/query_lang/simple_mdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"credentials": [
{
"id": "my_credential",
"format": "mso_mdoc",
"meta": {
"doctype_value": "org.iso.7367.1.mVRC"
},
"claims": [
{
"namespace": "org.iso.7367.1",
"claim_name": "vehicle_holder"
},
{
"namespace": "org.iso.18013.5.1",
"claim_name": "first_name"
}
]
}
]
}
23 changes: 23 additions & 0 deletions examples/query_lang/value_matching_simple.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"credentials": [
{
"id": "my_credential",
"format": "vc+sd-jwt",
"meta": {
"vct_values": [ "https://credentials.example.com/identity_credential" ]
},
"claims": [
{
"path": ["last_name"],
"values": ["Doe"]
},
{"path": ["first_name"]},
{"path": ["address", "street_address"]},
{
"path": ["postal_code"],
"values": ["90210", "90211"]
}
]
}
]
}
Loading

0 comments on commit 2eaa550

Please sign in to comment.