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: add gnap error response schema to spec #519

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-cooks-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@interledger/open-payments': minor
---

Added GNAP error models to auth server responses.
148 changes: 144 additions & 4 deletions openapi/auth-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,24 @@ paths:
uri: 'https://auth.rafiki.money/continue/4CF492MLVMSW9MKMXKHQ'
'400':
description: Bad Request
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/error-invalid-request'
- $ref: '#/components/schemas/error-invalid-client'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error-invalid-client'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/error-request-denied'
requestBody:
content:
application/json:
Expand Down Expand Up @@ -198,10 +212,29 @@ paths:
wait: 30
'400':
description: Bad Request
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/error-too-fast'
- $ref: '#/components/schemas/error-invalid-client'
'401':
description: Unauthorized
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/error-invalid-client'
- $ref: '#/components/schemas/error-invalid-continuation'
- $ref: '#/components/schemas/error-request-denied'
'404':
description: Not Found
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/error-invalid-continuation'
- $ref: '#/components/schemas/error-invalid-request'
requestBody:
content:
application/json:
Expand All @@ -226,12 +259,21 @@ paths:
responses:
'204':
description: No Content
'400':
description: Bad Request
'401':
description: Unauthorized
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/error-invalid-client'
- $ref: '#/components/schemas/error-invalid-continuation'
- $ref: '#/components/schemas/error-invalid-request'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error-invalid-request'
description: Cancel a grant request or delete a grant client side.
tags:
- grant
Expand Down Expand Up @@ -279,10 +321,28 @@ paths:
assetScale: 2
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/error-invalid-rotation'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error-invalid-client'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error-invalid-rotation'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/error-request-denied'
description: Management endpoint to rotate access token.
tags:
- token
Expand All @@ -293,10 +353,18 @@ paths:
responses:
'204':
description: No Content
'400':
description: Bad Request
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error-invalid-client'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/error-request-denied'
tags:
- token
components:
Expand Down Expand Up @@ -532,6 +600,78 @@ components:
- debitAmount
- required:
- receiveAmount
error-invalid-client:
type: object
properties:
error:
type: object
properties:
description:
type: string
code:
type: string
enum:
- invalid_client
error-invalid-request:
type: object
properties:
error:
type: object
properties:
description:
type: string
code:
type: string
enum:
- invalid_request
error-request-denied:
type: object
properties:
error:
type: object
properties:
description:
type: string
code:
type: string
enum:
- request_denied
error-too-fast:
type: object
properties:
error:
type: object
properties:
description:
type: string
code:
type: string
enum:
- too_fast
error-invalid-continuation:
type: object
properties:
error:
type: object
properties:
description:
type: string
code:
type: string
enum:
- invalid_continuation
error-invalid-rotation:
type: object
properties:
error:
type: object
properties:
description:
type: string
code:
type: string
enum:
- invalid_rotation
securitySchemes:
GNAP:
name: Authorization
Expand Down
Loading
Loading