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

feat: adapt to did core spec #156

Merged
merged 10 commits into from
Mar 24, 2021
Merged

feat: adapt to did core spec #156

merged 10 commits into from
Mar 24, 2021

Conversation

mirceanis
Copy link
Member

@mirceanis mirceanis commented Mar 23, 2021

closes #155

added support for blockchainAccountId

This PR introduces verification capabilities for DID documents that use blockchainAccountId (with eip155)
Support for ethereumAddress is maintained for backward compatibility.

added support for proofPurpose

Verification can now be done using a proofPurpose, which filters the verificationMethod based on the entries in the respective section of the DIDDocument.

Examples:

verifyJWT( token, { proofPurpose: 'authentication', ... })
verifyJWT( token, { proofPurpose: 'assertionMethod', ... })
verifyJWT( token, { proofPurpose: 'capabilityDelegation', ... })
// ...

// legacy API for 'authentication' purpose, maintained for backward compatibility.
verifyJWT( token, { auth: true, ... })`

For backward compatibility the verifier supports legacy DID resolvers that do not return DIDResolutionResult and also DID Documents that do not list assertionMethod at all.
This support will be removed once the ecosystem is more uniform with compliance.

testing

This PR also includes some hardening of existing tests. Using expect.assertions(...) to make sure that async tests are not falsely passing and replaced some test assertions with stricter versions and some toMatchSnapshot with toEqual

@mirceanis mirceanis marked this pull request as draft March 23, 2021 18:53
package.json Outdated Show resolved Hide resolved
@mirceanis mirceanis changed the base branch from master to manage-dependencies March 23, 2021 19:56
@mirceanis mirceanis changed the base branch from manage-dependencies to master March 23, 2021 19:57
Verifiers now have the ability to filter the types of `verificationMethod` used from the DID document based on purpose.
Please replace the `auth: true` option with `proofPurpose: 'authentication'`
@mirceanis mirceanis marked this pull request as ready for review March 24, 2021 14:22
@mirceanis
Copy link
Member Author

@oed now I think it's ready. please take another look

Copy link
Member

@awoie awoie left a comment

Choose a reason for hiding this comment

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

LGTM from a spec perspective although I think verificationRelationship is more appropriate than proofPurpose.

@mirceanis
Copy link
Member Author

mirceanis commented Mar 24, 2021

LGTM from a spec perspective although I think verificationRelationship is more appropriate than proofPurpose.

that's true, but it is so very verbose 😅 .. I guess purpose makes even more sense to me :)

@mirceanis mirceanis merged commit 4283ab3 into master Mar 24, 2021
@mirceanis mirceanis deleted the feat/adapt-to-did-core-spec branch March 24, 2021 16:33
uport-automation-bot pushed a commit that referenced this pull request Mar 24, 2021
# [5.1.0](5.0.2...5.1.0) (2021-03-24)

### Features

* adapt to did core spec ([#156](#156)) ([4283ab3](4283ab3)), closes [#155](#155)
@uport-automation-bot
Copy link
Collaborator

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Adapt to latest did-core-spec
4 participants