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

VC is throwing exception instead of returning result when credential is expired #27

Open
fabrii opened this issue Nov 27, 2024 · 1 comment
Labels

Comments

@fabrii
Copy link

fabrii commented Nov 27, 2024

When credential is revoked, vc returns the following object:

{"log": [{"id": "valid_signature", "valid": true},
{"id": "issuer_did_resolves", "valid": true},
{"id": "expiration", "valid": true},
{"id": "revocation_status", "valid": false}],
"results": [{"error": undefined, "log": [Array], "proof": [Object], "purposeResult": [Object], "verificationMethod": [Object], "verified": true}], "statusResult": {"results": [[Object]], "verified": false},
"verified": false}

When credential is expired, vc returns

{"error": [Error: Credential has expired.], "results": [{"credential": [Object], "error": [Error: Credential has expired.], "verified": false}], "verified": false}

VC should return a similar object as the first case with {"id": "expiration", "valid": false}
This has impact in learner credential: https://github.com/openwallet-foundation-labs/learner-credential-wallet/blob/8f9184309c770c015a63579bdb47d9d3ce5d4b93/app/lib/validate.ts#L83

When credential is expired, a generic Error is thrown, and the reason is lost.

@fabrii
Copy link
Author

fabrii commented Dec 14, 2024

This was working correctly with vc 7.0.0, but stopped working with vc 8.0.0.

I tracked down the issue to this commit b97ca64

In particular, it changed this line

image

Meanwhile, in learner credential, at https://github.com/openwallet-foundation-labs/learner-credential-wallet/blob/8f9184309c770c015a63579bdb47d9d3ce5d4b93/app/lib/validate.ts#L82 it is checked that the log entry should exist. If it doesn´t, it throws a generic error.

@dmitrizagidulin
@kezike

@alexfigtree alexfigtree moved this to To Do (Current sprint) in DCC Engineering Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To Do (Current sprint)
Development

No branches or pull requests

2 participants