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

Surface error to client on OID4 issuance failure. #125

Open
wes-smith opened this issue Dec 6, 2024 · 3 comments
Open

Surface error to client on OID4 issuance failure. #125

wes-smith opened this issue Dec 6, 2024 · 3 comments

Comments

@wes-smith
Copy link

Right now an OID4 issuance failure results in an inscrutable 500 server error https://github.com/digitalbazaar/bedrock-vc-delivery/blob/main/lib/oid4/http.js#L211.

Probably either the issuance code that returns an empty object should instead throw, or there should be a check in this code to indicate that issuance failed.

@dlongley
Copy link
Member

The symptom that triggers the exception here is that result doesn't have what's required to perform this destructuring:

https://github.com/digitalbazaar/bedrock-vc-delivery/blob/main/lib/oid4/http.js#L221

@dlongley
Copy link
Member

This code:

https://github.com/digitalbazaar/bedrock-vc-delivery/blob/main/lib/issue.js#L23

Returns an empty result with nothing to destructure when there are no VCs to be issued (no VC templates, etc.). This will cause an exception and needs to be remedied.

@dlongley
Copy link
Member

I believe the right fix here is two fold:

  1. Ensure that this exception won't be thrown (some other exception can be thrown that indicates that there are no VCs issued and OID4VCI should fail with a more useful message).
  2. A check that a workflow that supports OID4VCI must include at least one VC template/reference to a VC template, i.e., it must issue at least one VC. This might already be enforced for non-templated steps and, if so, we only need to do the first thing in this list, since templated steps can't be checked, I don't expect, until runtime anyway.

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

No branches or pull requests

2 participants