Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section on Context Validation. #1535

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

msporny
Copy link
Member

@msporny msporny commented Jul 21, 2024

This PR attempts to address issue #1529 by adding normative text requiring verifiers to implement context validation.


Preview | Diff

@msporny msporny added normative The PR is a normative change to the CR specification CR1 This item was processed during CR1 labels Jul 21, 2024
@msporny msporny requested a review from selfissued as a code owner July 21, 2024 18:59
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
Comment on lines +4897 to +4914
One such approach would be for a [=verifier=] to configure a JSON-LD Context
loader, sometimes referred to as a document loader, to use only local copies of
approved context files which would guarantee that 1) context files will never
change, and 2) the cryptographic hashes will never change, effectively
resulting in the same result as the algorithm above.
</p>

<p>
Another approach a [=verifier=] could use would be to use a list of well known
context URLs and their associated approved cryptographic hashes, without storing
every context file locally, which would allow contexts to be safely loaded and
cached from the network without compromising the security expectations of the
[=verifier=]. This approach would also be effectively equivalent to the
algorithm provided in this section.
</p>

<p>
Yet another valid approach would be for the [=holder=] to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listing multiple ways to perform validation is good, but it then seems that the above MUST on the specific algorithm provided there should be a MAY instead -- or some other text should make it clear that either the algorithm can be run or one of these other equivalent approaches can be taken.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8dbad0b.

Comment on lines +4827 to +4829
This section contains an algorithm that [=verifiers=] MUST run after running the
algorithm in Section [[[#verification]]], when validating a [=verifiable
credential=] or a [=verifiable presentation=]. This algorithm takes a document
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in w3c/vc-data-integrity#291 (comment). Any reason why this algorithm shouldn't be run before even touching verification?

Copy link
Contributor

@dlongley dlongley Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that it should be up to an implementer whether it is run before or after verification. This an application-level check, and the best time to run it can be application / use-case dependent.

Copy link
Member

@iherman iherman Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the text should say so! It currently has a numbered list, which suggests mandatory ordering...

(Also for w3c/vc-data-integrity#291)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8dbad0b.

@TallTed
Copy link
Member

TallTed commented Jul 23, 2024

There's a lot of repeated text, here and in w3c/vc-data-integrity#291, which needs similar if not identical changes (which suggestions from myself and others do not currently reflect), possibly being adjusted to be said in one place, and referenced in the other.

@msporny
Copy link
Member Author

msporny commented Jul 24, 2024

@TallTed wrote:

There's a lot of repeated text, here and in w3c/vc-data-integrity#291, which needs similar if not identical changes (which suggestions from myself and others do not currently reflect), possibly being adjusted to be said in one place, and referenced in the other.

Yep, I had considered these issues:

  1. We duplicate this text in DI and VC JOSE COSE (because the VC JOSE COSE folks have historically not wanted to refer to DI and also because it would be weird for DI or VC JOSE COSE, which don't reference each other for anything, to cross-reference either way on this particular point... and then VCDM needs to pick one of those places to point to?
  2. We have DI and VC JOSE COSE point to the language in this VCDM PR, which would be a bit of a strange layering violation since they're both at a lower architectural level than VCDM (it would be weird to ref "up" to VCDM from DI).
  3. DI stands on it's own... you don't have to use it with VCDM, but this guidance is generally applicable to any JSON-LD document secured using DI, so it should probably exist over there even if it didn't exist in VCDM.

So, the solution seems to be to put it in both places, even though most of the text is duplicated, OR, if we can get past the "VC JOSE COSE needs to be at the same level as DI", we could just ref DI from VCDM (at least). I don't think we will get to consensus on that approach, so duplicating the text in VCDM and DI is the best I think we can achieve.

That said, happy to not duplicate the text, though the only reasonable path I see for that is to put this in DI (or maybe the JSON-LD spec, which you've raised as a concern @TallTed... but that doesn't happen before we get the VCWG specs to REC, IMHO).

Anyone else see a better way through this?

@longpd
Copy link
Contributor

longpd commented Jul 24, 2024

There's a lot of repeated text, here and in w3c/vc-data-integrity#291, which needs similar if not identical changes (which suggestions from myself and others do not currently reflect), possibly being adjusted to be said in one place, and referenced in the other.

So where @TallTed should the core changes be made, e.g., in (w3c/vc-data-integrity#291) or (#1535) with the pointer from the other?

@longpd
Copy link
Contributor

longpd commented Jul 24, 2024

So, the solution seems to be to put it in both places, even though most of the text is duplicated, OR, if we can get past the "VC JOSE COSE needs to be at the same level as DI", we could just ref DI from VCDM (at least). I don't think we will get to consensus on that approach, so duplicating the text in VCDM and DI is the best I think we can achieve.

That looks like the most pragmatic thing to do, that is, see if we can get consensus on referencing DI from VCDM, and if that's not possible then duplicating the text in VCDM and DI makes sense. We'll just have to insure (as best we can) that any changes to text VCDM are propagated to DI (and vice-versa) to they stay in sync.

@msporny
Copy link
Member Author

msporny commented Jul 24, 2024

@longpd wrote:

We'll just have to insure (as best we can) that any changes to text VCDM are propagated to DI (and vice-versa) to they stay in sync.

Update... the text across both PRs are now wildly out of sync (which only underscores @TallTed's concern)! Let's try to focus getting the language right on the DI PR and I'll update the VCDM PR (this one) once the DI text settles. It's largely the algorithm that changed (and is improved in the DI PR).

@iherman iherman self-requested a review July 25, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR1 This item was processed during CR1 normative The PR is a normative change to the CR specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants