Skip to content

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

@aljones15

Description

@aljones15

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions