From 0282619e0a84afe215a77dcde89dae5cc7219d38 Mon Sep 17 00:00:00 2001 From: Nathan Lie Date: Tue, 12 Nov 2024 11:21:53 -0800 Subject: [PATCH] feat: add gnap error schema to idp spec --- .../auth/src/openapi/specs/id-provider.yaml | 62 ++++++++++++++++++- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/packages/auth/src/openapi/specs/id-provider.yaml b/packages/auth/src/openapi/specs/id-provider.yaml index b710b12eef..67fd4ca3ce 100644 --- a/packages/auth/src/openapi/specs/id-provider.yaml +++ b/packages/auth/src/openapi/specs/id-provider.yaml @@ -39,8 +39,16 @@ paths: description: Interaction id '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' '500': description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' operationId: get-interact parameters: - schema: @@ -91,9 +99,17 @@ paths: description: Client finish endpoint '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' '404': description: Not Found - description: "This endpoint is called by the identity provider to end the user interaction and redirect the user to the client's finish URL." + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' + description: "To finish the user interaction for grant approval, this endpoint redirects the user to the client's finish url." parameters: - schema: type: string @@ -138,8 +154,16 @@ paths: type: string '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' '404': description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' operationId: get-grant description: | This endpoint is called by the identity provider to get the grant details associated with the `interactId` on the front-channel. The identity provider will display the details to the user to either accept or deny. @@ -167,11 +191,23 @@ paths: description: Accepted '400': description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' '404': description: Not Found - description: This endpoint is called by the identity provider to communicate the user's choice (acceptance or rejection) to the authorization server. + content: + application/json: + schema: + $ref: '#/components/schemas/gnap-error' + description: The Identity Provider uses this endpoint to submit the user's choice regarding accepting or rejecting a grant to Authorization Server. parameters: - schema: type: string @@ -197,7 +233,27 @@ paths: tags: - back-channel components: - schemas: {} + schemas: + gnap-error: + type: object + properties: + error: + type: object + properties: + description: + type: string + code: + type: string + enum: + - invalid_request + - invalid_client + - invalid_interaction + - invalid_rotation + - invalid_continuation + - user_denied + - request_denied + - unknown_interaction + - too_fast securitySchemes: GNAP: name: Authorization