sse: add auth check

This commit is contained in:
Alexandre Aubin 2023-05-20 02:02:26 +02:00
parent af2316233a
commit 47a6006980

View file

@ -351,10 +351,15 @@ class _ActionsMapPlugin:
return m18n.g("logged_out")
def sse(self):
import time
import zmq.green as zmq
# FIXME : check auth...
profile = request.params.get("profile", self.actionsmap.default_authentication)
authenticator = self.actionsmap.get_authenticator(profile)
try:
authenticator.get_session_cookie()
except KeyError:
raise HTTPResponse(m18n.g("not_logged_in"), 401)
ctx = zmq.Context()
sub = ctx.socket(zmq.SUB)