Skip to content

Commit d7cacf4

Browse files
committed
Remove question mark notation; add purpose; add/fix example descriptions
1 parent f71a2e2 commit d7cacf4

5 files changed

+72
-62
lines changed

examples/query_lang/claims_alternatives.json

+6-13
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,16 @@
66
"meta": {
77
"vct_values": [ "https://credentials.example.com/identity_credential" ]
88
},
9-
// Comments in JSON to be removed before merging PR, they are just here to make Brian less sad
10-
"claims": [ // define claims, may add other properties like a purpose to each claims
11-
{
12-
"id": "a", // required for use in claim_sets below; if that is omitted, the id is optional
13-
"path": ["last_name"]
14-
},
9+
"claims": [
10+
{"id": "a","path": ["last_name"]},
1511
{"id": "b", "path": ["postal_code"]},
1612
{"id": "c", "path": ["locality"]},
1713
{"id": "d", "path": ["region"]},
18-
{"id": "e", "path": ["date_of_birth"]},
19-
{"id": "f", "path": ["email"]}
14+
{"id": "e", "path": ["date_of_birth"]}
2015
],
21-
"claim_sets": [ // defines the rules
22-
// postal code or (locality and region), last_name, and date_of_birth are mandatory; email is required if present on the matched credential
23-
["a", "b", "e", "f?!"],
24-
["a", "c", "d", "e", "f?!"]
25-
// Note: the ?! to mark a claim as `required if present` is syntactical sugar; the rules could be rewritten without it, but that would require a lot of repetition
16+
"claim_sets": [
17+
["a", "c", "d", "e"],
18+
["a", "b", "e"]
2619
]
2720
}
2821
]

examples/query_lang/complex_mdoc.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@
8888
}
8989
],
9090
"credential_sets": [
91-
{ // Purpose of this request is to prove your ID, response to this request is required
92-
"query_options": [ // These options mean you could use either your mDL or Photo Card to respond to the request
91+
{
92+
"query_options": [
9393
[ "mdl-id" ],
9494
[ "photo_card-id" ]
9595
]
9696
},
97-
{ // Purpose of this request is to prove your address, response to this request is not required
97+
{
9898
"required": false,
99-
"query_options": [ // These options mean you could use either your mDL or Photo Card to respond to the request
99+
"query_options": [
100100
[ "mdl-address" ],
101101
[ "photo_card-address" ]
102102
]

examples/query_lang/credentials_alternatives.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,10 @@
5454
"vct_values": ["https://company.example/company_rewards"]
5555
},
5656
"claims": [
57-
{"id": "current", "path": ["rewards_number"]}
58-
],
59-
"claim_sets": [
60-
["current"]
57+
{"path": ["rewards_number"]}
6158
]
6259
}
6360
],
64-
// deliver the pid, or the other_pid, or both pid_reduced_cred1 + 2; nice_to_have is optional in all cases
6561
"credential_sets": [
6662
{
6763
"query_options": [

examples/query_lang/value_matching_simple.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"claims": [
1010
{
1111
"path": ["last_name"],
12-
"value": "Doe"
12+
"values": ["Doe"]
1313
},
1414
{"path": ["first_name"]},
1515
{"path": ["address", "street_address"]},

openid-4-verifiable-presentations-1_0.md

+60-39
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ the Wallet when processing the query.
627627

628628
## Credential Query {#credential_query}
629629

630-
A Credential Query is an object representing a request for one specific
630+
A Credential Query is an object representing a request for a presentation of one
631631
Credential.
632632

633633
Each entry in `credentials` MUST be an object with the following properties:
@@ -656,32 +656,40 @@ Credential.
656656
claims in the requested Credentials.
657657

658658
`claim_sets`:
659-
: OPTIONAL. A non-empty array containing arrays of identifiers for elements in
660-
`claims`. The identifier MAY be postfixed by `?!` indicating that
661-
delivery of the respective claim is required if present on the credential, see (#selecting_claims) for more details.
659+
: OPTIONAL. A non-empty array containing arrays of identifiers for
660+
elements in `claims`. The rules for selecting claims to send are defined in (#selecting_claims).
661+
662+
Note that multiple Credential Queries in a request MAY request a presentation of the same Credential.
662663

663664
## Credential Set Query {#credential_set_query}
664665

665666
A Credential Set Query is an object representing a request for one or more credentials to satisfy
666-
a particular usecase with the Verifier.
667+
a particular use case with the Verifier.
667668

668669
Each entry in `credential_sets` MUST be an object with the following properties:
669670

670-
`query_options`
671+
`options`
671672
: REQUIRED: A non-empty array, where each value in the array represents a distinct query that satisfies
672-
the Usecase. The value of each element in the `query_options` array, is an array of identifiers which reference
673+
the use case. The value of each element in the `options` array is an array of identifiers which reference
673674
elements in `credentials`.
674675

675676
`required`
676677
: OPTIONAL. A boolean flag which indicates whether the wallet is required to respond to the query.
677678
If omitted, the effective value MUST be processed as `true`.
678679

680+
`purpose`
681+
: OPTIONAL. A string, number or object specifying the purpose of the
682+
query. This specification does not define a specific structure or specific values
683+
for this property. The purpose is intended to be used by the Verifier to
684+
communicate the reason for the query to the Wallet. The Wallet MAY use this
685+
information to show the user the reason for the request.
686+
679687
## Claims Query {#claims_query}
680688

681689
Each entry in `claims` MUST be an object with the following properties:
682690

683691
`id`:
684-
: REQUIRED if `claim_sets` is present; OPTIONAL otherwise. A string
692+
: REQUIRED if `claim_sets` is present in the Credential Query; OPTIONAL otherwise. A string
685693
identifying the particular claim. The value MUST be a non-empty string
686694
consisting of alphanumeric, underscore (`_`) or hyphen (`-`) characters.
687695
Within the particular `claims` array, the same `id` MUST NOT
@@ -704,8 +712,8 @@ in the mdoc, e.g., `first_name`.
704712

705713
`values`:
706714
: OPTIONAL. An array of strings, integers or boolean values that specifies the expected values of the claim.
707-
If the `values` property is present, the Wallet MUST return the claim only if the
708-
type and value of the claim both match for at least one of the elements in the array.
715+
If the `values` property is present, the Wallet SHOULD return the claim only if the
716+
type and value of the claim both match for at least one of the elements in the array. Details of the processing rules are defined in (#selecting_claims).
709717

710718
### Selecting Claims and Credentials {#vp_query_lang_processing_rules}
711719

@@ -726,22 +734,31 @@ The following rules apply for selecting claims via `claims` and `claim_sets`:
726734
- If `claims` is provided, but `claim_sets` is not provided,
727735
the Verifier requests all claims listed in `claims`.
728736
- Otherwise, the Verifier requests one combination of the claims listed in
729-
`claim_sets`. Claims listed without a postfix are requested unconditionally.
730-
Claims postfixed by `?!` have to be provided by the Wallet if they exist on
731-
the matched Credential. The order of the options conveyed in the `claim_sets`
732-
array expresses the Verifiers preference for what is returned. A wallet MUST
733-
prioritise returning the most preferred option.
737+
`claim_sets`. The order of the options conveyed in the `claim_sets`
738+
array expresses the Verifiers' preference for what is returned; the Wallet MUST return
739+
the first option that it can satisfy. If the Wallet cannot satisfy any of the
740+
options, it MUST NOT return any claims.
741+
742+
When a Claims Query contains a restriction on the values of a claim, the Wallet
743+
SHOULD NOT return the claim if its value does not match at least one of the
744+
elements in `values` i.e., the claim should be treated the same as if it did not
745+
exist in the Credential. Implementing this restriction may not be possible in
746+
all cases, for example, if the Wallet does not have access to the claim value
747+
before presentation or user consent or if another component routing
748+
the request to the Wallet does not have access to the claim value. Therefore, Verifiers
749+
must treat restrictions expressed using `values` as a best-effort way to improve
750+
user privacy, but MUST NOT rely on it for security checks.
734751

735752
The purpose of the `claim_sets` syntax is to provide a way for a
736753
verifier to describe alternative ways a given credential can satisfy the request.
737-
The array ordering expresses the Verifier's preference for how the request should
738-
be fulfilled where the first element in the array is the most preferred and the last
739-
element in the array is the least preferred. Verifiers should use the principle of
754+
The array ordering expresses the Verifier's preference for how the request must
755+
be fulfilled. The first element in the array is the most preferred and the last
756+
element in the array is the least preferred. Verifiers SHOULD use the principle of
740757
least information disclosure to influence how they order these options. For example, a
741758
proof of age request should prioritize requesting an attribute like `age_over_18` over
742759
an attribute like `birth_date`.
743760

744-
If the Wallet cannot deliver all unconditional claims requested by the Verifier
761+
If the Wallet cannot deliver all claims requested by the Verifier
745762
according to these rules, it MUST NOT return the respective Credential.
746763

747764
#### Selecting Credentials
@@ -753,15 +770,18 @@ The following rules apply for selecting Credentials via `credentials` and `crede
753770
- Otherwise, the Verifier requests all of the credential set queries in the `credential_sets` array
754771
with `required` evaluated as true to be returned at a minimum and optionally any of the credential set queries
755772
with `required` evaluated as false.
756-
- For each credential set query inside the `credential_sets` array, in order to satisfy the query, the Wallet MUST return
757-
a credential or credentials that match to one of the `query_options` inside the object.
773+
- For each credential set query inside the `credential_sets` array, in order to
774+
satisfy the query, the Wallet MUST return a credential or credentials that
775+
match to one of the `options` inside the object. It is typically
776+
expected that the Wallet presents the End-User with a choice of which
777+
credential to present if multiple credentials match the query.
758778

759779
Credentials not matching the respective constraints expressed within
760780
`credentials` MUST NOT be returned, i.e., they are treated as if
761781
they would not exist in the Wallet.
762782

763-
If the Wallet cannot deliver all non-optional Credentials requested by the Verifier according to these rules, it MUST NOT
764-
return any credential(s).
783+
If the Wallet cannot deliver all non-optional Credentials requested by the
784+
Verifier according to these rules, it MUST NOT return any credential(s).
765785

766786
## Format-specific Properties {#format_specific_properties}
767787

@@ -783,10 +803,6 @@ the inheritance logic defined in [@!I-D.ietf-oauth-sd-jwt-vc].
783803
doctype of the requested Verifiable Credential. All elements in the array MUST
784804
be valid doctype identifiers as defined in ISO 18013-5.
785805

786-
### Format `jwt_vp*`
787-
788-
TBD
789-
790806

791807
## Claims Path Pointer {#claims_path_pointer}
792808

@@ -2384,26 +2400,31 @@ Credential in the format `mso_mdoc` with the claims `vehicle_holder` and
23842400

23852401
<{{examples/query_lang/simple_mdoc.json}}
23862402

2387-
The following is a non-normative example of a VP Query that requests
2388-
2389-
- the mandatory claims `last_name` and `date_of_birth`, and
2390-
- either the claim `postal_code`, or both of the the claims `locality` and `region`, and
2391-
- optionally the claim `email`.
2392-
2393-
<{{examples/query_lang/claims_alternatives.json}}
2394-
23952403
The following is a non-normative example of a VP Query that requests multiple
23962404
Verifiable Credentials; all of them must be returned:
23972405

23982406
<{{examples/query_lang/multi_credentials.json}}
23992407

2400-
The following shows a complex query where the Wallet is requested to deliver the `pid` credential, or the `other_pid` credential, or both `pid_reduced_cred_1` and `pid_reduced_cred_2`. Additionally, the `nice_to_have` credential may optionally be
2401-
delivered. From the latter, the claim `legacy_system_rewards_number` may optionally
2402-
be delivered.
2408+
The following shows a complex query where the Wallet is requested to deliver the
2409+
`pid` credential, or the `other_pid` credential, or both `pid_reduced_cred_1`
2410+
and `pid_reduced_cred_2`. Additionally, the `nice_to_have` credential may
2411+
optionally be delivered.
24032412

24042413
<{{examples/query_lang/credentials_alternatives.json}}
24052414

2406-
The following example shows a query that uses the `value` and `values` constraints
2415+
The following shows a query where an ID and an address are requested; either can
2416+
come from an mDL or a photoid Credential.
2417+
2418+
<{{examples/query_lang/complex_mdoc.json}}
2419+
2420+
The following is a non-normative example of a VP Query that requests
2421+
2422+
- the mandatory claims `last_name` and `date_of_birth`, and
2423+
- either the claim `postal_code`, or, if that is not available, both of the claims `locality` and `region`.
2424+
2425+
<{{examples/query_lang/claims_alternatives.json}}
2426+
2427+
The following example shows a query that uses the `values` constraints
24072428
to request a credential with specific values for the `last_name` and `postal_code` claims:
24082429

24092430
<{{examples/query_lang/value_matching_simple.json}}

0 commit comments

Comments
 (0)