From 50b335dc28468ac32ad2145bdec71662a20d4504 Mon Sep 17 00:00:00 2001 From: Daniel Buchner Date: Thu, 5 Oct 2023 15:25:05 -0500 Subject: [PATCH] Addresses 399, 429, 437, 446 --- spec/spec.md | 35 +++++++++++++++-------------------- spec/v2.0.0/spec.md | 40 +++++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 41 deletions(-) diff --git a/spec/spec.md b/spec/spec.md index 77b1707f..5757d9e0 100644 --- a/spec/spec.md +++ b/spec/spec.md @@ -396,8 +396,8 @@ be ignored, unless otherwise specified by a [[ref:Feature]]; value signature to the top-level `format` object, but can be used to specifically constrain submission of a single input to a subset of formats or algorithms. - The [[ref:Input Descriptor Object]] ****MUST**** contain a `constraints` -property. Its value ****MUST**** be an object composed of _at least one_ -of the following properties, unless otherwise specified by a [[ref:Feature]]: +property. Its value ****MUST**** be an object composed as follows, unless otherwise +specified by a [[ref:Feature]]: - The _constraints object_ ****MAY**** contain a `fields` property. Fields ****SHALL**** be processed forward from 0-index, so if a [[ref:Verifier]] desires to reduce processing by checking the most defining characteristics @@ -1287,28 +1287,23 @@ For each candidate input: 1. If the result returned no JSONPath match, skip to the next `path` array element. 2. Else, evaluate the first JSONPath match (_candidate_) as follows: - 1. If the _fields object_ has no `filter`, or if _candidate_ - validates against the + 1. If the _fields object_ has no `filter`, or if _candidate_ validates against the [JSON Schema](https://json-schema.org/specification.html) descriptor specified in `filter`, then: - ::: note - **Predicate Feature Only** - - If the _fields object_ has a `predicate`, set _Field Query Result_ to - the boolean value resulting from evaluating the _Field Query Result_ against - the [JSON Schema](https://json-schema.org/specification.html) descriptor value - of the `filter` property. - - Else - ::: - - set _Field Query Result_ to be _candidate_ + - If not using the **Predicate Feature**, set _Field Query Result_ to be _candidate_. + - If using the **Predicate Feature**: + - If the _fields object_ has a `predicate`, set _Field Query Result_ to the + boolean value resulting from evaluating the _Field Query Result_ against + the [JSON Schema](https://json-schema.org/specification.html) descriptor + value of the `filter` property. + - Else, set _Field Query Result_ to be _candidate_. 2. Else, skip to the next `path` array element. - 3. If no value is located for any of the specified `path` queries, and + 3. If no `path` entries are found that satisfy the _fields object_'s constraints, and the _fields object_ ****DOES NOT**** contain the `optional` property - or it is set to `false`, reject the field as invalid. If no value is - located for any of the specified `path` queries and the _fields object_ - ****DOES**** contain the `optional` property set to the value `true`, - treat the field as valid and proceed to the next _fields object_. + or it is set to `false`, reject the field as invalid. If no `path` entry + satisfies the _fields object_'s constraints for any of the specified `path` queries, + and the _fields object_ ****DOES**** contain the `optional` property set to the value + `true`, treat the field as valid and proceed to the next _fields object_. 2. If all of the previous validation steps are successful mark the candidate input as a match for use in a [[ref:Presentation Submission]]. ::: note diff --git a/spec/v2.0.0/spec.md b/spec/v2.0.0/spec.md index 7af1bccf..ceeaa3e8 100644 --- a/spec/v2.0.0/spec.md +++ b/spec/v2.0.0/spec.md @@ -3,6 +3,8 @@ Presentation Exchange 2.0.0 **Specification Status:** DIF Ratified Specification +**Ratification Date**: November 3rd, 2022 + **Latest Draft:** [identity.foundation/presentation-exchange](https://identity.foundation/presentation-exchange) @@ -357,8 +359,8 @@ be ignored, unless otherwise specified by a [[ref:Feature]]; value signature to the top-level `format` object, but can be used to specifically constrain submission of a single input to a subset of formats or algorithms. - The [[ref:Input Descriptor Object]] ****MUST**** contain a `constraints` -property. Its value ****MUST**** be an object composed of _at least one_ -of the following properties, unless otherwise specified by a [[ref:Feature]]: +property. Its value ****MUST**** be an object composed as follows, unless otherwise +specified by a [[ref:Feature]]: - The _constraints object_ ****MAY**** contain a `fields` property. Fields ****SHALL**** be processed forward from 0-index, so if a [[ref:Verifier]] desires to reduce processing by checking the most defining characteristics @@ -1247,29 +1249,25 @@ For each candidate input: elements are exhausted: 1. If the result returned no JSONPath match, skip to the next `path` array element. - 2. Else, evaluate the first JSONPath match (_candidate_) as follows: - 1. If the _fields object_ has no `filter`, or if _candidate_ - validates against the + 2. Else, evaluate each JSONPath match (_candidate_) as follows until one is found + that satisfies the _fields object_ constraints: + 1. If the _fields object_ has no `filter`, or if _candidate_ validates against the [JSON Schema](https://json-schema.org/specification.html) descriptor specified in `filter`, then: - ::: note - **Predicate Feature Only** - - If the _fields object_ has a `predicate`, set _Field Query Result_ to - the boolean value resulting from evaluating the _Field Query Result_ against - the [JSON Schema](https://json-schema.org/specification.html) descriptor value - of the `filter` property. - - Else - ::: - - set _Field Query Result_ to be _candidate_ + - If not using the **Predicate Feature**, set _Field Query Result_ to be _candidate_. + - If using the **Predicate Feature**: + - If the _fields object_ has a `predicate`, set _Field Query Result_ to the + boolean value resulting from evaluating the _Field Query Result_ against + the [JSON Schema](https://json-schema.org/specification.html) descriptor + value of the `filter` property. + - Else, set _Field Query Result_ to be _candidate_. 2. Else, skip to the next `path` array element. - 3. If no value is located for any of the specified `path` queries, and + 3. If no `path` entries are found that satisfy the _fields object_'s constraints, and the _fields object_ ****DOES NOT**** contain the `optional` property - or it is set to `false`, reject the field as invalid. If no value is - located for any of the specified `path` queries and the _fields object_ - ****DOES**** contain the `optional` property set to the value `true`, - treat the field as valid and proceed to the next _fields object_. + or it is set to `false`, reject the field as invalid. If no `path` entry + satisfies the _fields object_'s constraints for any of the specified `path` queries, + and the _fields object_ ****DOES**** contain the `optional` property set to the value + `true`, treat the field as valid and proceed to the next _fields object_. 2. If all of the previous validation steps are successful mark the candidate input as a match for use in a [[ref:Presentation Submission]]. ::: note