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

Clarify id prop language to allow equivalent DID values #376

Merged
merged 6 commits into from
Aug 30, 2020

Conversation

csuwildcat
Copy link
Contributor

@csuwildcat csuwildcat commented Aug 20, 2020

Copy link
Contributor

@OR13 OR13 left a comment

Choose a reason for hiding this comment

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

based on conversation we had this seems pretty critical :)

I think most readers would assume as you did, that the current language is MUST, not a SHOULD.... I think this correction is helpful.

index.html Outdated
@@ -1330,8 +1330,10 @@ <h2>DID Subject</h2>
such as when a <a>DID resolver</a> is performing <a>DID resolution</a>.
However, the fully resolved <a>DID document</a> always contains a valid
<code><a>id</a></code> property. The value of <code><a>id</a></code> in the
resolved <a>DID document</a> is expected to match the <a>DID</a> that was
resolved.
resolved <a>DID document</a> SHOULD match the <a>DID</a> that was
Copy link
Member

Choose a reason for hiding this comment

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

Wait this isn't a MUST? Seems odd to me that I'd map did:example:123 => { "id": "did:example:456", ... }

Can we provide some further detail on why this is best left as a should?

@csuwildcat
Copy link
Contributor Author

There was no normative, explicit directive at all before this, so I put in SHOULD simply because there was no feedback yet. Personally, I couldn't think of anything else it would/should ever be either, so I'm happy to go with MUST.

@csuwildcat
Copy link
Contributor Author

csuwildcat commented Aug 21, 2020

@kdenhartog to be clear: if it was a MUST, it would be that it MUST be either the same as the resolved DID or the equivalent canonical DID the DID Method determines as part of its resolution logic.

@csuwildcat csuwildcat closed this Aug 21, 2020
@csuwildcat csuwildcat reopened this Aug 21, 2020
@csuwildcat
Copy link
Contributor Author

Sorry, GitHub's UI freaked out and bizarrely closed the issue, so pay no attention to the Closed entry 😜

@csuwildcat
Copy link
Contributor Author

@kdenhartog @OR13 changed the directive from SHOULD to MUST, as I agree with you that this proposed language is a sensible one-way requirement.

index.html Outdated
resolved <a>DID document</a> is expected to match the <a>DID</a> that was
resolved.
resolved <a>DID document</a> MUST match the <a>DID</a> that was
resolved, or be populated by the <a>DID method</a> with another <a>DID</a> it
Copy link
Member

Choose a reason for hiding this comment

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

I'm good with this. The "or..." statement seems like it could cause some tricky issues with how de-referencing would work on identifying the did document, such as sub-objects (verificationMethod block, service block, etc) being identified with a different base did than the top level id. However, since the point of this statement is to point out that the method authors must state how it's canonically mapped, I think it should work out fine as long as the method is written properly.

Co-authored-by: Dave Longley <[email protected]>
@csuwildcat
Copy link
Contributor Author

@msporny I added in @dlongley's change, so I think we're good, right?

index.html Outdated
Comment on lines 1333 to 1336
resolved <a>DID document</a> MUST match the <a>DID</a> that was
resolved, or be populated according to the <a>DID method</a> with another
<a>DID</a> it specifies is the equivalent canonical <a>DID</a> for the <a>DID</a>
that was resolved.
Copy link
Member

@brentzundel brentzundel Aug 24, 2020

Choose a reason for hiding this comment

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

Suggested change
resolved <a>DID document</a> MUST match the <a>DID</a> that was
resolved, or be populated according to the <a>DID method</a> with another
<a>DID</a> it specifies is the equivalent canonical <a>DID</a> for the <a>DID</a>
that was resolved.
resolved <a>DID document</a> MUST match the <a>DID</a> that was
resolved, or be populated with the equivalent, canonical <a>DID</>
as specified by the relevant <a>DID method</a>.

Copy link
Member

Choose a reason for hiding this comment

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

I understood what you were saying and like the change, but the wording felt kind of clumsy, so this is my attempt to wordsmith.
Just a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two things here I want to note:

  1. Where it says THE equivalent canonical DID, was intentional to make sure that it was a singular relationship, where as a change to an equivalent canonical DID seems to suggest that it is selecting from many. I think it would be best to leave this the.
  2. While I am fine with the general change of the wording to as specified by the related DID method, do you think we should use a different word that related here? I ask because this is about relationships between things, and maybe we should be more explicit that its not just the related method, its the Method of the DID being resolved.

Copy link
Member

Choose a reason for hiding this comment

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

good points, suggestion has been updated.

@@ -0,0 +1,3 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

looks like you might have inadvertently added some personal IDE settings to the PR.

Copy link
Contributor

@OR13 OR13 Aug 25, 2020

Choose a reason for hiding this comment

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

I wish we all used vs code and agreed to committed settings... like auto format or not.... every w3c repo i work in, i have a bunch of settings disabling my default behavior, like format on save... but yea, probably a mistake to commit this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't realize I had, I can delete.

@peacekeeper
Copy link
Contributor

I cannot say exactly why, but I feel slightly uncomfortable with allowing the id property to contain anything other than the DID that was resolved.

Another solution to this use case (besides the idea of a canonical link relation discussed in #368) could be to return a null DID document, plus resolution metadata which contains the canonical DID that should be resolved instead. This would be comparable to HTTP's redirect status codes.

E.g. if you resolve did:example:123, the result of the resolve() function would be:

  1. did-resolution-metadata = «["redirect" → "did:example:456"]»
  2. did-document = null
  3. did-document-metadata = null

A resolver could be configured to automatically follow such redirects, to make this transparent for the client.

@csuwildcat
Copy link
Contributor Author

I really think making some sort of canonical redirect from one DID to another based on having to generically follow data/directives in the resolution metadata to another DID/DID Document, then making the same inference in the end you would have this way, is going to require a ton more spec text across multiple specs (some outside of the DID Core spec) and will be prone to devs footgunning themselves with the complexity and ergonomic issues. The unidirectional nature of the canonical value language is the most objective/empirical of all the equivalence expressions we have discussed, so I really hope we can at least get this in. If not, I would hope the fallback is a specific property like canonical being added, because going through redirect hoops seems like a lot of complexity for very little benefit.

@msporny msporny merged commit 24d042d into w3c:master Aug 30, 2020
@msporny
Copy link
Member

msporny commented Aug 30, 2020

I'll note that the last SHOULD in this statement is not testable and may be changed to "is expected to be used during future resolution requests."

Normative, multiple reviews, changes requested and made, no objections, merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants