Skip to content

Commit

Permalink
Require auth on WSHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored and bryevdv committed Jul 27, 2020
1 parent 634a1ca commit 86cecf7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bokeh/server/views/ws.py
Expand Up @@ -25,7 +25,7 @@
from urllib.parse import urlparse

# External imports
from tornado import locks
from tornado import locks, web
from tornado.websocket import WebSocketClosedError, WebSocketHandler

# Bokeh imports
Expand All @@ -38,6 +38,7 @@
from ...protocol.message import Message
from ...protocol.receiver import Receiver
from ..protocol_handler import ProtocolHandler
from .auth_mixin import AuthMixin

#-----------------------------------------------------------------------------
# Globals and constants
Expand All @@ -55,7 +56,7 @@
# Dev API
#-----------------------------------------------------------------------------

class WSHandler(WebSocketHandler):
class WSHandler(AuthMixin, WebSocketHandler):
''' Implements a custom Tornado WebSocketHandler for the Bokeh Server.
'''
Expand Down Expand Up @@ -108,6 +109,7 @@ def check_origin(self, origin):
origin, origin_host, origin_host, allowed_hosts)
return False

@web.authenticated
def open(self):
''' Initialize a connection to a client.
Expand Down

0 comments on commit 86cecf7

Please sign in to comment.