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 ctx.throw, add 40X responses to idp spec #850

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

njlie
Copy link
Contributor

@njlie njlie commented Dec 14, 2022

Changes proposed in this pull request

  • Adds 40X responses to the endpoints the AS extends for interactions
  • Uses ctx.throw for all known errors.

Context

In order to surface certain errors properly, the needed to be reflected in the spec so that they wouldn't be swallowed by the validator.

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Documentation added
  • Make sure that all checks pass

@github-actions github-actions bot added pkg: auth Changes in the GNAP auth package. type: source Changes business logic type: tests Testing related labels Dec 14, 2022
Comment on lines 316 to 319
await expect(grantRoutes.create(ctx)).rejects.toHaveProperty(
'status',
400
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
await expect(grantRoutes.create(ctx)).rejects.toHaveProperty(
'status',
400
)
await expect(grantRoutes.create(ctx)).rejects.toMatchObject({
status: 400,
error: 'interaction_required'
})

@njlie njlie requested a review from wilsonianb December 15, 2022 20:58
@njlie njlie merged commit af6558f into main Dec 15, 2022
@njlie njlie deleted the nl-add-openapi-responses branch December 15, 2022 21:54
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. type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants