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

W3 DID context omiting 'www.' is rejected #345

Closed
oeed opened this issue Nov 7, 2021 · 3 comments · Fixed by #349
Closed

W3 DID context omiting 'www.' is rejected #345

oeed opened this issue Nov 7, 2021 · 3 comments · Fixed by #349

Comments

@oeed
Copy link

oeed commented Nov 7, 2021

A context of https://w3.org/ns/did/v1 is rejected because current it only expects the context be prefixed with 'www.'.

https://w3.org/ns/did/v1 redirects to https://www.w3.org/ns/did/v1, so it'd be good to have both accepted.

@oeed
Copy link
Author

oeed commented Nov 8, 2021

For context, the NZ Covid Pass specification omits this. If this is believed to be a violation of the DID spec let me know and I'll reach out to them.

Otherwise, I'm quite happy to make a PR to fix - should be fairly straight forward (trying to release asap).

@clehner
Copy link
Contributor

clehner commented Nov 9, 2021

Hi @oeed,

Nice work on the nzcp-rust implementation.

The requirement for the DID document @context property is in the JSON-LD representation production rules: https://www.w3.org/TR/did-core/#production-0
("The serialized value of @context MUST be the JSON String https://www.w3.org/ns/did/v1, or a JSON Array where the first item is the JSON String https://www.w3.org/ns/did/v1" ...) (tested in DID Test Suite).

ssi applies a check on @context for all DID document representations; this is probably not needed for e.g. the JSON representation, where the production/consumption rules do not make mention of @context.

I don't see that the did:web method specification specifies whether a resolved did:web DID document is in JSON or JSON-LD representation (or whether that may be based on the returned HTTP header). But it does refer to the DID document file as a JSON-LD file in 2.5.1 Create (Register). ssi's did:web implementation assumes the resolved DID document is always JSON-LD.

Anyway, ssi also allows some alternative URIs for the DID document base context, for compatibility purposes. So we could just add another for that here [#349].

@oeed
Copy link
Author

oeed commented Nov 17, 2021

Thanks for the fix @clehner!

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 a pull request may close this issue.

2 participants