Open
Description
Problem
Current jupyter-server code doesn't have a base handler or utility for creating authenticated web socket APIs. An example of an authenticated web socket is present in AuthenticatedZMQStreamHandler
.
jupyter_server/jupyter_server/base/zmqhandlers.py
Lines 303 to 348 in 77be2f5
When working with authenticated web socket APIs, this code will be duplicated for each handler.
Proposed Solution
- Create a new
WebSocketAPIHandler
that new APIs can inherit from. This will contain functions that all jupyter web sockets should inherit, for example, set_default_handlers, initialize, get_compression_options etc. - Create a
AuthWebSocketAPIHandler
that additionally adds authentication for web sockets. This will contain functions, that add authentication for web sockets, for examplepre_get
andget
.