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

Properly return errors in Auth Interaction server #3029

Open
2 tasks
mkurapov opened this issue Oct 11, 2024 · 0 comments
Open
2 tasks

Properly return errors in Auth Interaction server #3029

mkurapov opened this issue Oct 11, 2024 · 0 comments
Labels
pkg: auth Changes in the GNAP auth package.

Comments

@mkurapov
Copy link
Contributor

mkurapov commented Oct 11, 2024

Context

Currently, in the auth server routes (Open Payments & some of the front channel routes), we are throwing GNAPServerRouteErrors, and properly catching them in gnapServerErrorMiddleware in order to return a well formatted GNAP error object that is defined in the GNAP spec. However, we are not doing the same for /grant/:id/:nonce/:choice /grant/:id/:nonce, the two routes exposed in the "Interaction Server".

Relevant OpenAPI docs

Todos

  • Add gnapServerErrorMiddleware handler in the "Interaction Server" routes, add tests accordingly
  • Update the IDP spec to display the different possible error objects for each route. A good idea might be to define all the possible GNAP errors we throw as components/schemas, and use them in each of the routes (see OpenAPI docs above)
@mkurapov mkurapov added the pkg: auth Changes in the GNAP auth package. label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: auth Changes in the GNAP auth package.
Projects
Status: Todo
Development

No branches or pull requests

1 participant