Skip to content

Commit

Permalink
sse: add auth check
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin committed Nov 6, 2024
1 parent f625b30 commit 51e25da
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions moulinette/interfaces/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,15 @@ def logout(self):
return m18n.g("logged_in")

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)
Expand Down

0 comments on commit 51e25da

Please sign in to comment.