Skip to content
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

Allow purpose.match to supply a reason it did not match #157

Open
aljones15 opened this issue Oct 6, 2021 · 1 comment
Open

Allow purpose.match to supply a reason it did not match #157

aljones15 opened this issue Oct 6, 2021 · 1 comment

Comments

@aljones15
Copy link
Contributor

aljones15 commented Oct 6, 2021

// first check if the proof matches the purpose; if it doesn't continue
if(!await purpose.match(proof, {document, documentLoader, expansionMap})) {
continue;
}

if a purpose does not match no Error or Reason is given. Then if no purposes match at all then this generic error is thrown:

if(results.length === 0) {
const error = new Error(
'Did not verify any proofs; insufficient proofs matched the ' +
'acceptable suite(s) and required purpose(s).');
error.name = 'NotFoundError';
throw error;
}

jsigs should allow purpose.match to supply a reason for not matching which is reported back to the user.

@dmitrizagidulin
Copy link
Contributor

+1, this would be a great feature.

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

No branches or pull requests

2 participants