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

fix: verify result should be false if error #17

Conversation

TimoGlastra
Copy link
Contributor

The isValid value of SdJwtVc.verify return object would be true, if though containsRequiredVcProperties or containsExpectedKeyBinding could be false.

I think isValid should only be true if all checks and validation have passed, so I made this PR to make it so that it is true. There is a test that tested the flow as it used to be (isValid: true, but other fields having false value), so if it was on purpose I think we should maybe reconsider it, as it was kinda confusing.

How I've handled it in the past is to create a nested validation object, to separate the overall check (isValid) from the individual checks:

{
  // will only be true if all validations are true
  isValid: true,
  validations: {
     containsRequiredVcProperties: true
  }
}

Signed-off-by: Timo Glastra <timo@animo.id>
@berendsliedrecht berendsliedrecht merged commit 2243577 into berendsliedrecht:main Jan 11, 2024
2 of 3 checks passed
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.

2 participants