From fb2ab093944c3d17b9cf053557ad5bdf6c7f3a75 Mon Sep 17 00:00:00 2001 From: enisdenjo Date: Sat, 31 Oct 2020 21:42:43 +0100 Subject: [PATCH] docs(protocol): more auth options [skip ci] --- PROTOCOL.md | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/PROTOCOL.md b/PROTOCOL.md index 3b9f85c4..b5b910a3 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -39,17 +39,11 @@ interface ConnectionInitMessage { } ``` -The server will respond by either: - -- Dispatching a `ConnectionAck` message acknowledging that the connection has been successfully established. -- Closing the socket with a close event `4403: Forbidden` indicating that the connection request has been denied because of access control. -- Closing the socket with a close event `4400: ` indicating that the connection request has been denied because of an implementation specific error. - ### `ConnectionAck` Direction: **Server -> Client** -Potential response to the `ConnectionInit` message from the client acknowledging a successful connection with the server. +Expected response to the `ConnectionInit` message from the client acknowledging a successful connection with the server. ```typescript interface ConnectionAckMessage { @@ -148,24 +142,6 @@ For the sake of clarity, the following examples demonstrate the communication pr 1. _Server_ validates the connection initialisation request and dispatches a `ConnectionAck` message to the client on successful connection 1. _Client_ has received the acknowledgement message and is now ready to request operation executions -### Forbidden connection initialisation - -1. _Client_ sends a WebSocket handshake request with the sub-protocol: `graphql-transport-ws` -1. _Server_ accepts the handshake and establishes a WebSocket communication channel (which we call "socket") -1. _Client_ immediately dispatches a `ConnectionInit` message optionally providing a payload as agreed with the server -1. _Server_ validates the connection initialisation request and decides that the client is not allowed to establish a connection -1. _Server_ closes the socket by dispatching the event `4403: Forbidden` -1. _Client_ reports an error using the close event reason (which is `Forbidden`) - -### Erroneous connection initialisation - -1. _Client_ sends a WebSocket handshake request with the sub-protocol: `graphql-transport-ws` -1. _Server_ accepts the handshake and establishes a WebSocket communication channel (which we call "socket") -1. _Client_ immediately dispatches a `ConnectionInit` message optionally providing a payload as agreed with the server -1. _Server_ tries validating the connection initialisation request but an error `I'm a teapot` is thrown -1. _Server_ closes the socket by dispatching the event `4400: I'm a teapot` -1. _Client_ reports an error using the close event reason (which is `I'm a teapot`) - ### Connection initialisation timeout 1. _Client_ sends a WebSocket handshake request with the sub-protocol: `graphql-transport-ws` @@ -174,7 +150,6 @@ For the sake of clarity, the following examples demonstrate the communication pr 1. _Server_ waits for the `ConnectionInit` message for the duration specified in the `connectionInitWaitTimeout` parameter 1. _Server_ waiting time has passed 1. _Server_ closes the socket by dispatching the event `4408: Connection initialisation timeout` -1. _Client_ reports an error using the close event reason (which is `Connection initialisation timeout`) ### Single result operation