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 did key spec 7 validators #63

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

Conversation

aljones15
Copy link

@aljones15 aljones15 commented Aug 5, 2022

Adds general did validators to the cached resolver.

To Do:

  • Expand tests for did and did url validators

@aljones15 aljones15 self-assigned this Aug 5, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2022

Codecov Report

Merging #63 (50ae168) into main (ef5d7cc) will increase coverage by 5.31%.
The diff coverage is 90.54%.

@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
+ Coverage   78.33%   83.65%   +5.31%     
==========================================
  Files           4        6       +2     
  Lines         337      465     +128     
==========================================
+ Hits          264      389     +125     
- Misses         73       76       +3     
Impacted Files Coverage Δ
lib/CachedResolver.js 64.00% <44.00%> (+0.66%) ⬆️
lib/DidResolverError.js 100.00% <100.00%> (ø)
lib/did-io.js 82.37% <100.00%> (+0.98%) ⬆️
lib/index.js 100.00% <100.00%> (ø)
lib/validators.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@aljones15 aljones15 marked this pull request as ready for review August 12, 2022 17:10
lib/did-io.js Outdated Show resolved Hide resolved
lib/did-io.js Outdated Show resolved Hide resolved
lib/did-io.js Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
* @param {object} driver - A did method driver.
* @param {string} [method] - An optional method.
*/
use(driver, method) {
Copy link
Member

Choose a reason for hiding this comment

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

Should this change to an arguments object like {driver: d, method: m}?

Copy link
Author

Choose a reason for hiding this comment

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

We've never used that pattern for registering plugins or middleware (I forget what the name of this pattern is) so I just stuck with what we already have. I might add that method parameter exists for one reason: test data this might be over thinking an optional parameter.

lib/validators.js Outdated Show resolved Hide resolved
lib/validators.js Outdated Show resolved Hide resolved
test/02-did-io-validators.spec.js Outdated Show resolved Hide resolved
lib/CachedResolver.js Outdated Show resolved Hide resolved
test/helpers.js Outdated Show resolved Hide resolved
aljones15 and others added 2 commits August 26, 2022 10:08
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
aljones15 and others added 16 commits August 26, 2022 10:08
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
aljones15 and others added 2 commits August 26, 2022 10:30
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
CHANGELOG.md Outdated Show resolved Hide resolved
lib/index.js Outdated Show resolved Hide resolved
aljones15 and others added 2 commits December 7, 2022 09:31
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
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.

3 participants