Skip to content

Commit

Permalink
feat: individual error objects for gnap errors
Browse files Browse the repository at this point in the history
  • Loading branch information
njlie committed Nov 15, 2024
1 parent 01d8f9b commit 08b1293
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 64 deletions.
126 changes: 95 additions & 31 deletions openapi/auth-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,21 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
oneOf:
- $ref: '#/components/schemas/error-invalid-request'
- $ref: '#/components/schemas/error-invalid-client'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
$ref: '#/components/schemas/error-invalid-client'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
$ref: '#/components/schemas/error-request-denied'
requestBody:
content:
application/json:
Expand Down Expand Up @@ -213,19 +215,26 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
oneOf:
- $ref: '#/components/schemas/error-too-fast'
- $ref: '#/components/schemas/error-invalid-client'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
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:
$ref: '#/components/schemas/gnap-error'
oneOf:
- $ref: '#/components/schemas/error-invalid-continuation'
- $ref: '#/components/schemas/error-invalid-request'
requestBody:
content:
application/json:
Expand All @@ -250,24 +259,21 @@ paths:
responses:
'204':
description: No Content
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
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/gnap-error'
$ref: '#/components/schemas/error-invalid-request'
description: Cancel a grant request or delete a grant client side.
tags:
- grant
Expand Down Expand Up @@ -318,19 +324,25 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
$ref: '#/components/schemas/error-invalid-rotation'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
$ref: '#/components/schemas/error-invalid-client'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
$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 @@ -341,18 +353,18 @@ paths:
responses:
'204':
description: No Content
'400':
description: Bad Request
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
'401':
description: Unauthorized
$ref: '#/components/schemas/error-invalid-client'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/gnap-error'
$ref: '#/components/schemas/error-request-denied'
tags:
- token
components:
Expand Down Expand Up @@ -588,7 +600,7 @@ components:
- debitAmount
- required:
- receiveAmount
gnap-error:
error-invalid-client:
type: object
properties:
error:
Expand All @@ -599,15 +611,67 @@ components:
code:
type: string
enum:
- invalid_request
- invalid_client
- invalid_interaction
- invalid_rotation
- invalid_continuation
- user_denied
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
- unknown_interaction
- too_fast
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

0 comments on commit 08b1293

Please sign in to comment.