Skip to content

feat: [SIW-2159] Handle presentation errors #223

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

gispada
Copy link
Collaborator

@gispada gispada commented Apr 18, 2025

List of Changes

  • Added sendAuthorizationErrorResponse function to notify the RP
  • Created RelyingPartyResponseError class with RP-specific error codes
  • Explicitly handled 400 and 403 HTTP status code when sending the Authorization Response
  • Thrown InvalidRequestObjectError in verifyRequestObject for validation-related errors
  • Thrown DcqlError in evaluateDcqlQuery to unify DCQL-related errors
  • Refactored some error related utils and types
  • Updated the example app
  • Added more tests

Motivation and Context

This PR improves the error handling in the presentation flow, by providing a specific RelyingPartyResponseError and a function to notify the Relying Party of any errors occurred when processing the Authorization Request.

How Has This Been Tested?

Tested against the test Relying Party instance, using the example app and a proxy to simulate 400, 403 and 500 HTTP status codes, with the following body:

{
    "error": "invalid_request",
    "error_description": "An error occurred"
}

Screenshots (if appropriate):

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant