Skip to content

VC 2.0 Add validUntil & validFrom / make credentialStatus.id checks optional - #168

Merged
dlongley merged 52 commits into
update-vc-2.0from
vc-2.0-time-props
Apr 29, 2024
Merged

dlongley merged 52 commits into
update-vc-2.0from
vc-2.0-time-props

Conversation

@aljones15

@aljones15 aljones15 commented Dec 8, 2023 •

Copy link
Copy Markdown
Contributor

Features:

  1. changes the DateRegexp to an XML schema DateTime and expands tests on it
  2. move expirationDate into the VC 1.0 validators and only checks date when mode is verify
  3. adds validUntil and associated tests
  4. adds validFrom and associated tests
  5. make some minor corrections with test data for better consistency
  6. This pr now contains credentialStatus check changes from here
  7. Makes credentialStatus.id optional
  8. Checks to ensure if credentialStatus.id is present it must be a URL.

@aljones15 aljones15 changed the title Move expirationDate test to v1 tests & use mockCredential in all tests. VC 2.0 add validUntil and validBefore Dec 8, 2023
@aljones15
aljones15 marked this pull request as ready for review December 8, 2023 19:25

@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.

LGTM, just some minor comments. TY!

Edit: In the PR title and the description it says validBefore, but maybe you intended to refer to validAfter instead?

Comment thread lib/index.js Resolved
Comment thread test/10-verify.spec.js Resolved
Comment thread test/helpers.js Resolved
@aljones15 aljones15 mentioned this pull request Dec 8, 2023
10 of 12 tasks
@codecov-commenter

codecov-commenter commented Jan 2, 2024 •

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (update-vc-2.0@9ff44fe). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff                @@
##             update-vc-2.0     #168   +/-   ##
================================================
  Coverage                 ?   90.54%           
================================================
  Files                    ?        5           
  Lines                    ?     1058           
  Branches                 ?        0           
================================================
  Hits                     ?      958           
  Misses                   ?      100           
  Partials                 ?        0           

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 9ff44fe...0bb92ad. Read the comment docs.

Comment thread test/10-verify.spec.js Outdated
error = e;
}
should.exist(error,
'Should throw error when "evidence" is not a URI');

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.

What's "evidence" here? Looks like a copy/paste error.

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.

I actually was assuming as evidence is moving out the spec that credentialStatus was now a piece of evidence? @davidlehn is this a mistake or should the credentialStatus.id not being a URI be taken as an evidence error?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like typo. Fixed. Do these id changes need a changelog entry? Not sure what's going in this for this PR.

@BigBlueHat

Copy link
Copy Markdown
Contributor

@aljones15 it looks like this PR has moved (or is moving) well beyond validUntil and validBefore. Is that correct? If so, we should relabel the PR at least.

I'm also a bit concerned about us ending up with one massive PR to review. Can we do more, smaller PRs against a non-main branch (as this one is against update-vc-2.0)? That would make reviews much faster, safer, and more sane. 😃

@aljones15

aljones15 commented Jan 11, 2024 •

Copy link
Copy Markdown
Contributor Author

I will refrain from merging any further PRs into this PR, but as this PR and the other PR: #170 had both been approved it seemed safe to merge the two.

As for this PR moving beyond validUntil & validBefore that was not intentional, but the feature making credentialStatus.id optional branched from the validUntil branch so it couldn't be aimed at the core VC 2.0 branch/PR.

Comment thread test/10-verify.spec.js
});

it('should reject credentialStatus that is not a URI', () => {
it('should reject credentialStatus id that is not a URI', () => {

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.

the spec says URL actually. Also, only one id is allowed.

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.

Can you match the spec text where possible? Makes it much easier to match tests to the spec. Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know what needs changing here. Please do whatever is needed. If only one status is allowed, the check code should check that, and tests should be written to fail on multiple statuses.

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.

@BigBlueHat the tests inside of the libraries usually don't match the spec text so what you're asking might be better as a separate issue. If you want it done here I could get a start on it in this pr.

@BigBlueHat

Copy link
Copy Markdown
Contributor

I will refrain from merging any further PRs into this PR, but as this PR and the other PR: #170 had both been approved it seemed safe to merge the two.

As for this PR moving beyond validUntil & validBefore that was not intentional, but the feature making credentialStatus.id optional branched from the validUntil branch so it couldn't be aimed at the core VC 2.0 branch/PR.

Mostly, my aim is to keep topics clear...and now it's pretty muddied what's going on.

Also, as @JSAssassin mentioned earlier, the fields are validFrom and validUntil--and we should change this PR to match.

Thanks!

Comment thread CHANGELOG.md Resolved
Comment thread test/10-verify.spec.js Resolved
@aljones15 aljones15 changed the title VC 2.0 add validUntil and validBefore VC 2.0 Add validUntil & validBefore / make credentialStatus.id checks optional Jan 13, 2024
@aljones15 aljones15 changed the title VC 2.0 Add validUntil & validBefore / make credentialStatus.id checks optional VC 2.0 Add validUntil & validFrom / make credentialStatus.id checks optional Jan 15, 2024
aljones15 and others added 20 commits April 29, 2024 15:51
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>
@aljones15

Copy link
Copy Markdown
Contributor Author

@BigBlueHat @davidlehn please double check this as this is your last chance before merge into update-vc-2.0.

@aljones15
aljones15 removed the request for review from JSAssassin April 29, 2024 15:58
@dlongley
dlongley merged commit d3abfab into update-vc-2.0 Apr 29, 2024
@dlongley
dlongley deleted the vc-2.0-time-props branch July 25, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants