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

feat(auth): use gnap error middleware on idp api #3094

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

njlie
Copy link
Contributor

@njlie njlie commented Nov 8, 2024

Changes proposed in this pull request

  • Adds the gnapServerErrorMiddleware to the routes on the Identity Provider API on the auth server.

Context

Closes #3029.

This ended up being a one-line change, as the IDP responses were added already in the spec from #850 and #3024. The code already throws these errors and had tests added as of #2400. There was one potential response missing from the spec, however.

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

@github-actions github-actions bot added type: source Changes business logic pkg: auth Changes in the GNAP auth package. labels Nov 8, 2024
Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 0282619
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/6734e29442ce3e0008fd802c

oana-lolea
oana-lolea previously approved these changes Nov 11, 2024
Comment on lines +42 to +47
'500':
description: Internal Server Error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be good to provide the actual GNAP response error objects in the IDP spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add them since it's a pretty bare PR as it is right now

mkurapov
mkurapov previously approved these changes Nov 12, 2024
Copy link
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make my comment into a separate issue, if you'd like

@njlie njlie dismissed stale reviews from mkurapov and oana-lolea via 1735c6e November 12, 2024 19:21
@njlie njlie requested review from oana-lolea and mkurapov November 12, 2024 20:45
oana-lolea
oana-lolea previously approved these changes Nov 13, 2024
@njlie njlie force-pushed the nl/3029/auth-interaction-errors branch from 1735c6e to 0282619 Compare November 13, 2024 17:32
@njlie njlie requested a review from oana-lolea November 13, 2024 17:32
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it might make sense to include this in the auth server spec as well for Open Payments, so I captured it in an issue here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! if you want, we could probably merge the open payments issue first, bump the client, and import the yaml files in here so we can reference them as ./auth-server.yaml#/components/schemas/..., what do you think? Unless we want to decouple the IDP spec from the auth server spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bump the OP client for this 👍

@mkurapov mkurapov added the do not merge Do not merge PRs with these label label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Do not merge PRs with these label pkg: auth Changes in the GNAP auth package. type: source Changes business logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly return errors in Auth Interaction server
3 participants