-
Notifications
You must be signed in to change notification settings - Fork 15
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
Enveloped proofs helper functions #114
Conversation
Signed-off-by: Patrick <[email protected]>
'./input/credential-ok.json')); | ||
} catch(e) { | ||
console.error( | ||
`Issuer: ${name} failed to issue "credential-ok.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.
we should probably store this error and ensure it shows up in the report so they know that the issuance failed.
'for that property', | ||
async function() { | ||
this.test.link = `https://www.w3.org/TR/vc-data-model-2.0/#conformance:~:text=MUST%20include%20all%20required%20properties%20in%20the%20conforming%20documents%20it%20produces`; | ||
this.test.cell.skipMessage = 'Tested by other tests in this suite.'; |
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 can be handled by awaiting a previous call, you can do something like this
async function testSomething(){
return endpoints.post('goo');
}
// store a promise here
const somethingTest = testSomething();
// await the promise
it('assertion 1', async function() {
await somethingTest;
})
// await the promise again
it('assertion 2', async function() {
await somethingTest;
})
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.
I wouldn't go that far. In fact, I realized when going back through the MUSTs just now that all of Section 1 Introduction (of which 1.3 Conformance is a part) is non-normative...so we can remove the 1-3-conformance.js
file altogether (and should for maintainability).
Let's merge this PR first, though.
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.
Actually, since you've brought them all in the way you have, we could do what @aljones15 is suggesting. It'll make the code read a little strangely (all the test's will get called outside of any it()
and then their results awaited in each it()
), but if y'all feel this will comfort developers and spec reviewers who will see those MUSTs and wonder why they're not tested, I'm more than happy for these to stay.
Just still on the fence as to whether the await approach is worth the effort. Maybe let's discuss it soon.
.include('data:application/vc+jwt', | ||
`Expecting id field to be a data: URL [RFC2397].`); | ||
const extractedCredential = extractIfEnveloped(issuedVc); | ||
shouldBeCredential(extractedCredential); | ||
this.skip(); |
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 do we assert here and then skip?
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.
@PatStLouis guessing the above this.skip()
just got overlooked?
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.
The problem here is because this test will also be executed on a non enveloped credential. I put the skip there until we have some way to tag implementations, I should of left a comment!
this.test.cell.skipMessage = 'TBD'; | ||
issuedVc.should.have.property('type').that.does | ||
.include('EnvelopedVerifiableCredential', | ||
`Expecting type field to be EnvelopedVerifiableCredential`); | ||
this.skip(); |
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 odd we assert and then skip that seems off.
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.
same as above, currently skipped until we have a way to tag EnvelopedProof
implementations as otherwise this test will always fail on other 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.
Overall really good, but those assertions above those skips seem weird to me.
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.
Overall this looks great. I do think we need to chat about the 1-3-conformance.js
tests, though, and how we want to see the tagging and configuration done per implementation.
'for that property', | ||
async function() { | ||
this.test.link = `https://www.w3.org/TR/vc-data-model-2.0/#conformance:~:text=MUST%20include%20all%20required%20properties%20in%20the%20conforming%20documents%20it%20produces`; | ||
this.test.cell.skipMessage = 'Tested by other tests in this suite.'; |
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.
Actually, since you've brought them all in the way you have, we could do what @aljones15 is suggesting. It'll make the code read a little strangely (all the test's will get called outside of any it()
and then their results awaited in each it()
), but if y'all feel this will comfort developers and spec reviewers who will see those MUSTs and wonder why they're not tested, I'm more than happy for these to stay.
Just still on the fence as to whether the await approach is worth the effort. Maybe let's discuss it soon.
@PatStLouis what are your thoughts about handling the 1.3 Conformance stuff. How you have it now is fine by me (and I'll update my review), but we actually don't need to even provide that 1.3 section...as it's non-normative. |
Discussed this more with Manu and think proceeding with what you have here would be best. |
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.
unblocking the improvements here
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.
Actually...code's got bugs...
@PatStLouis let's also remove the first (currently skipped) entry: That's rather the point of the whole test suite. 😁 |
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.
Signed-off-by: Patrick <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
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.
Looks good!
Signed-off-by: Patrick <[email protected]>
Signed-off-by: Patrick <[email protected]>
Signed-off-by: Patrick <[email protected]>
once @TallTed approves the changes I will merge this, the location of the file changed (outdated) but I've implemented your suggestions! |
Moved securing mechanism tests and added enveloped related helper functions.
I think we need a tagging option for
EnvelopedProof
vsEmbededProof
.