Skip to content

Add verifyAll and change the verify(verificationLevel, options)#104

Open
jpsantosbh wants to merge 2 commits intomasterfrom
verifyAll
Open

Add verifyAll and change the verify(verificationLevel, options)#104
jpsantosbh wants to merge 2 commits intomasterfrom
verifyAll

Conversation

@jpsantosbh
Copy link
Contributor

Since verifyAttestation() ins an ASYNC method it can't be part of the verify method. Changing the verify method to async will impact a lot of implementation that doesn't need to verify the anchor. This PR has a proposal to add a new ASYNC verification method verifyAll and remove the anchor verification for the verify method

@jpsantosbh jpsantosbh requested review from dankelleher and rado0x54 May 9, 2019 12:15
return verifiedlevel;
};

this.verifyAll = async (options) => {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet... Only proposing it :-)


// Test next level
if (verifiedlevel === VERIFY_LEVELS.PROOFS
&& hVerifyLevel >= VERIFY_LEVELS.ANCHOR
Copy link
Member

Choose a reason for hiding this comment

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

Is it correct that verify(leve) can now verify everything up to Anchor but not including Anchor? If so this should be probably documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you are correct needs better documentation

});

it('should check all verifications and fail - tampered grant', async (done) => {
const credentialContents = fs.readFileSync('__test__/creds/fixtures/VCPermanentAnchor.json', 'utf8');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that a require in test/creds/fixtures/VCPermanentAnchor.json is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The anchor on this test is not checked. it fails before that.

});

it('should check all verifications and fail - tampered claims', async (done) => {
const credentialContents = fs.readFileSync('__test__/creds/fixtures/VCPermanentAnchor.json', 'utf8');
Copy link
Contributor

Choose a reason for hiding this comment

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

see above

});

it('should check all verifications and fail - anchor fails', async (done) => {
const credentialContents = fs.readFileSync('__test__/creds/fixtures/VCPermanentAnchor.json', 'utf8');
Copy link
Contributor

Choose a reason for hiding this comment

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

here as well

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.

3 participants