Skip to content

VC 2.0 Release Canidate - #148

Merged
davidlehn merged 112 commits into
mainfrom
update-vc-2.0
Aug 1, 2024
Merged

davidlehn merged 112 commits into
mainfrom
update-vc-2.0

Conversation

@aljones15

@aljones15 aljones15 commented Jul 24, 2023 •

Copy link
Copy Markdown
Contributor

Features:

  1. Issues and Verifies VCs using the 1.0 and 2.0 VC Data Models
  2. Has integration tests for VCs using both models
  3. Has validators for validUntil and validFrom
  4. Updates the timestamp validator to use the XML standard from the spec
  5. includes an expanded suite with timestamp tests

NOTE:
new features in the VC 2.0 release should branch from this PR unless they build on another feature in a sister PR.

TODO:

  • add or borrow logic for validUntil (PR approved for this)
  • add or borrow logic for validFrom (PR approved for this)
  • Merge validUntil and validFrom feature into this branch.
  • Solve mixed context issues in Verifiable Presentations Mixing VC Contexts in VPs causes VPs to throw #169
  • check against spec revision history
  • use release of VC 2.0 context
  • Do we check credentialSchemas?
    • no
  • Do we check evidence?
    • no
  • Do we need to support node 14?
    • drop support for node 14 and 16 (separate PR for this)
  • Add MAJOR Changelog entry as vc2.0 is the new default context / data model.
  • @OR13 When this get's merged we will want to update the various plugins that build examples.

Addresses:
#149 (comment)

@JSAssassin

Copy link
Copy Markdown
Contributor

@aljones15 IMO we should drop support for Node 14 and 16 and that can be addressed in a separate PR.

@aljones15

Copy link
Copy Markdown
Contributor Author

@aljones15 IMO we should drop support for Node 14 and 16 and that can be addressed in a separate PR.

awesome thanks for letting me, node 14 tests are failing probably because of the branches.

@OR13

OR13 commented Sep 17, 2023

Copy link
Copy Markdown
Contributor

When this get's merged we will want to update the various plugins that build examples.

@aljones15

Copy link
Copy Markdown
Contributor Author

When this get's merged we will want to update the various plugins that build examples.

@OR13 this branch was used for the test suite for VC 2.0, but as that spec is still in progress, we might not release this build of this library. This PR also still lacks a few VC 2.0 features such as validUntil and validFrom. So this PR is not currently prioritized to my knowledge for merge or release.

@aljones15
aljones15 force-pushed the update-vc-2.0 branch 2 times, most recently from d9d7ba4 to dcecf7b Compare November 28, 2023 14:54
Comment thread lib/helpers.js Resolved
Comment thread lib/index.js Resolved
Comment thread lib/index.js Resolved
Comment thread lib/helpers.js Resolved
Comment thread lib/helpers.js Resolved
Comment thread test/10-verify.spec.js Resolved
Comment thread test/10-verify.spec.js Resolved
Comment thread test/10-verify.spec.js
Comment on lines +472 to +830
if(result.error) {
const firstError = [].concat(result.error)[0];
throw firstError;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this needed here and in other places?

@aljones15 aljones15 Dec 6, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually not my code or part of this PR, but I do know that the VC library doesn't throw in all cases, verification can return an error or an array of errors. it looks like this code takes that error which could be an array, ensures it is an array and then throws the first error. We probably should be asserting on that error. Maybe an issue can be made about this to assert on these errors rather than throw? EDIT: in most cases it looks like we don't want to assert on the error, and that this code ensures that positive tests throw if an error occurs in verification as this library often doesn't throw when verifying.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dmitrizagidulin got any insight here? it looks like you just wanted to throw if there is an error so you could check it and figure out what was going wrong with this lib?

Comment thread test/10-verify.spec.js Resolved
Comment thread test/10-verify.spec.js Resolved
@aljones15
aljones15 force-pushed the update-vc-2.0 branch 2 times, most recently from ec59695 to 8d114c3 Compare December 6, 2023 14:39
@codecov-commenter

codecov-commenter commented Dec 6, 2023 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 90.85366% with 30 lines in your changes missing coverage. Please review.

Project coverage is 90.46%. Comparing base (be05032) to head (203d698).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #148      +/-   ##
==========================================
+ Coverage   88.66%   90.46%   +1.79%     
==========================================
  Files           4        5       +1     
  Lines         812     1059     +247     
==========================================
+ Hits          720      958     +238     
- Misses         92      101       +9     
Files Coverage Δ
lib/contexts/index.js 100.00% <100.00%> (ø)
lib/helpers.js 92.39% <92.39%> (ø)
lib/index.js 90.70% <89.68%> (+1.64%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be05032...203d698. Read the comment docs.

@JSAssassin JSAssassin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! LGTM.

@aljones15 aljones15 changed the title Update vc 2.0 VC 2.0 Release Canidate Dec 8, 2023
@aljones15
aljones15 requested a review from BigBlueHat January 11, 2024 15:49
aljones15 and others added 15 commits May 17, 2024 22:56
Co-authored-by: Tashi D. Gyeltshen <38434620+JSAssassin@users.noreply.github.com>
Co-authored-by: Tashi D. Gyeltshen <38434620+JSAssassin@users.noreply.github.com>
…stamp.

Co-authored-by: Tashi D. Gyeltshen <38434620+JSAssassin@users.noreply.github.com>
- Make "id" optional.
- If "id" present, check it's a URL.
- Add tests.
Co-authored-by: BigBlueHat <byoung@bigbluehat.com>
Co-authored-by: BigBlueHat <byoung@bigbluehat.com>
Comment thread test/constants.js
export default {
CREDENTIALS_CONTEXT_URL: 'https://www.w3.org/2018/credentials/v1',
CREDENTIALS_CONTEXT_URL: 'https://www.w3.org/ns/credentials/v2',
CREDENTIALS_CONTEXT_V1_URL: 'https://www.w3.org/2018/credentials/v1',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@aljones15 maybe we need a CREDENTIALS_CONTEXT_V2_URL here?

aljones15 and others added 9 commits July 6, 2024 13:24
- Switch from `credentials-context` to
  `@digitalbazaar/credentials-context`.
- Use all contexts from `@digitalbazaar/credentials-context`.
- Simplify context packages usage by using exported `contexts` directly.
- Improve credentials context mapping to and from versions.
  - Use explicit maps.
  - Expose a helper function.
@davidlehn
davidlehn marked this pull request as ready for review August 1, 2024 19:02
@davidlehn
davidlehn merged commit 857a7b8 into main Aug 1, 2024
@aljones15

Copy link
Copy Markdown
Contributor Author

@davidlehn obviously leave the branch update-vc-2.0 so other builds still work with it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants