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

Returns 500 on issuance of credentials with undefined Terms or Types #169

Open
aljones15 opened this issue Aug 1, 2024 · 2 comments
Open

Comments

@aljones15
Copy link
Contributor

If a credential is posted to an issuer instance, this library returns 500 if that credential has an undefined term or type.

Example:

{
  '@context': ['...credentials v2 context'],
  'type': ['VerifiableCredential', 'UndefinedType'],
  'credentialSubject': {
    'undefinedTerm': 'notDefinedInContext'
  }
@davidlehn
Copy link
Member

  • I started adding a test to check this better.
  • That data causes the issue endpoint to throw a JsonLdError for a safe mode violation, log it, and rethrow the error, which turns into a ISE/500.
  • What should this do? Is there similar code elsewhere on how to nicely capture and expose these sorts of errors? There are other errors that could happen too. I'm not sure what should be exposed and how.

@aljones15
Copy link
Contributor Author

  • I started adding a test to check this better.
  • That data causes the issue endpoint to throw a JsonLdError for a safe mode violation, log it, and rethrow the error, which turns into a ISE/500.
  • What should this do? Is there similar code elsewhere on how to nicely capture and expose these sorts of errors? There are other errors that could happen too. I'm not sure what should be exposed and how.

I actually don't know, we could look for a jsonld error and then determine the status code from the jsonld error. There was places where we look for bedrock database errors for instance and turn NotFound into a 404.

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