-
Notifications
You must be signed in to change notification settings - Fork 6
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 static test vectors #33
Conversation
e6a55b2
to
d6d3f9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small, human-facing
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just need clarity around some things.
@@ -23,3 +23,4 @@ reports/** | |||
credentials/*.json | |||
.vscode | |||
.localImplementationsConfig.cjs | |||
tests/input/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's in this directory? Is it populated by someone/something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is where the static test vectors from vc-di-ecdsa
are being stored. This follows the existing convention of storing test vectors in /tests/input
such as in the VC 2.0 Data Model tests. We're not using anything in that DIR yet, but we do plan on using those vectors in the future.
README.md
Outdated
the issuer name using an environment variable or setting `issuerName` in `./config/runner.json`. | ||
|
||
For the `ecdsa-rdfc-2019` suite use `RDFC_ISSUER_NAME`. | ||
For the `ecdsa-sd-2023` suite use `SD_ISSUER_NAME`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So...set RDFC_ISSUER_NAME
to some string value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be improved here: c97f3e4
README.md
Outdated
To generate test data used in the test suite, testers are required to specify | ||
the issuer name using the environment variable `ISSUER_NAME`. | ||
the issuer name using an environment variable or setting `issuerName` in `./config/runner.json`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is issuerName
in config/runner.json
, but the other variables are environment variables?
Also, this says you can do that either way, but it removes what environment variable name to use. Should that be SD_ISSUER_NAME
? And if so, why the name change? And is issuerName
in config/runner.json
the same thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully improved the explanation here: c97f3e4
README.md
Outdated
If `$HOLDER_NAME` is not specified, `Digital Bazaar` will be used. | ||
In addition, the environment variable `SD_HOLDER_NAME` or the setting `holderName` in `./config/runner.json` | ||
can be used to specify the VC holder name for generating disclosed test credentials for ECDSA-SD tests. | ||
If `$SD_HOLDER_NAME` or `holderName` is not specified, `Digital Bazaar` will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just for reporting purposes? Or is this a lookup of some kind? If it's a lookup (from the implementations list?), we should spell that out here. If it's just a string for reporting purposes, we should set it to something generic to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it needs to match an implementation name. The implementation used it not noted in the report unless it fails to create the test data in some suites. Anyways, addressed here: c97f3e4
README.md
Outdated
### Changing the Test Tag | ||
These test suites use tags to identify which implementation's endpoints are used in tests. | ||
### Configuring the Tests | ||
The suites call on a common config file stored at `./config/runner.json`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular sentence should likely be moved up to the top of "Usage"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to the top and expanded here: a356456
README.md
Outdated
"suites": { | ||
"ecdsa-rdfc-2019": { | ||
"tags": ["ecdsa-rdfc-2019"], | ||
"issuerName": "Digital Bazaar", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file increasingly feels confused in purpose. If it's a committed file in git history, we don't want local test running folks to ever edit it--which essentially causes a fork.
So, any "runtime" config should be kept elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there are now vector.json
and runner.json
files here: a6ebbef
tests/50-sd-verify.js
Outdated
// select less than full subarrays | ||
const pointers2 = credentialHasArrays.selectivePointers.slice( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not real keen on the incrementing variable name. Can we use something clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed this test data is has been historically a little weird, anyways improved the pointer names here: 67418b3 in the vc-generator PR these test vectors should be created programmatically outside of the before statement.
signedCredential: signedAchievementCredential, | ||
vcHolder | ||
}); | ||
disclosedCredentialsWithLessThanFullSubArray.push( | ||
revealedAchievementCredential2); | ||
|
||
// select w/o first array element | ||
// select w/o first 7 array element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the first 7 elements? No need to explain it in a reply here, but explaining it in a comment in the code would help folks who work with you on this or who use it as reference when testing their implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is hopefully addressed somewhat here: 67418b3
as the original 2 pieces of test data appear to have been identical, this change at the least seems to improve the diversity of test data.
tests/helpers.js
Outdated
export const createMultipleVcs = async ({}) => { | ||
|
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should come out until it's in use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent catch, was going to move test data generation outside of the before statements and into helpers to clean up the suites, but to much going on in this PR. Removed createMultipleVc
here: da1f798
@@ -1,5 +1,73 @@ | |||
/*! | |||
* Copyright 2023 Digital Bazaar, Inc. All Rights Reserved | |||
* Copyright 2023-2024 Digital Bazaar, Inc. All Rights Reserved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also drop the "All Rights Reserved" text, fwiw. It's ancient...and means things are under copyright. Something I missed removing earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appended this as an additional task to this issue: #27
Co-authored-by: BigBlueHat <byoung@digitalbazaar.com>
Co-authored-by: BigBlueHat <byoung@digitalbazaar.com>
Co-authored-by: BigBlueHat <byoung@digitalbazaar.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small thing that can wait, so please plow ahead.
Copyright 2023 Digital Bazaar, Inc. | ||
|
||
SPDX-License-Identifier: BSD-3-Clause | ||
--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Co-authored-by: BigBlueHat <byoung@digitalbazaar.com>
Adds configurable static test vectors to project. This does not use the vectors from the ecdsa spec yet, but can be configured to use them in the future.
Partially Addresses this issue: #29
Features:
credentials
section inrunner.json
that allows configuring static test vectors.vc-di-ecdsa
repo andTestVectors
into the project.mocks
that contains static test vectors and respective pointers.issuerName
for configuring the issuer used to create test data.holderName
for configuring the holder used to create sd test data.