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 error codes #19

Merged
merged 21 commits into from
Aug 8, 2022
Merged

Add did key error codes #19

merged 21 commits into from
Aug 8, 2022

Conversation

aljones15
Copy link
Contributor

@aljones15 aljones15 commented Aug 5, 2022

  • Adds a new file ./lib/validators.js
  • Adds a new validator `checkKeyBytes.
  • Separates TypeError from SyntaxError
  • DRYs up key bytes checks
  • Add error code for invalidPublicKeyLength to public key checks.

#18

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

codecov-commenter commented Aug 8, 2022

Codecov Report

Merging #19 (8537fcd) into main (56eb921) will decrease coverage by 0.36%.
The diff coverage is 78.18%.

@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
- Coverage   92.01%   91.65%   -0.37%     
==========================================
  Files           3        4       +1     
  Lines         614      659      +45     
==========================================
+ Hits          565      604      +39     
- Misses         49       55       +6     
Impacted Files Coverage Δ
lib/validators.js 62.50% <62.50%> (ø)
lib/Ed25519VerificationKey2020.js 92.09% <100.00%> (+0.12%) ⬆️
lib/ed25519.js 96.12% <100.00%> (+4.18%) ⬆️

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

@aljones15 aljones15 requested review from dlongley and msporny August 8, 2022 18:12
@aljones15 aljones15 marked this pull request as ready for review August 8, 2022 18:13
aljones15 and others added 6 commits August 8, 2022 14:25
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Copy link
Contributor

@dmitrizagidulin dmitrizagidulin left a comment

Choose a reason for hiding this comment

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

👍 this is great

aljones15 and others added 4 commits August 8, 2022 14:30
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
@aljones15 aljones15 requested a review from dlongley August 8, 2022 18:39
Copy link
Member

@msporny msporny left a comment

Choose a reason for hiding this comment

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

First pass seems fine to me... I expect @dlongley might have more specific thoughts on the structure of the call... for example, do we expect ALL key libraries to export an assertKeyBytes method? When would you use that vs. checkKeyBytes? It was not immediately evident what the answers to these questions were.

Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
@aljones15 aljones15 merged commit 0125923 into main Aug 8, 2022
@aljones15 aljones15 deleted the add-did-key-error-codes branch August 8, 2022 20:19
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.

5 participants