33from jupyterhub import __version__ as __jh_version__
44from jupyterhub .services .auth import HubOAuthenticated
55from jupyterhub .utils import make_ssl_context
6- from tornado import httpclient
6+ from tornado import httpclient , web
77from tornado .log import app_log as log
88
9- from ..handlers import ProxyHandler
109from .proxy import StandaloneProxyHandler
1110
1211
13- class StandaloneHubProxyHandler (StandaloneProxyHandler , HubOAuthenticated ):
12+ class StandaloneHubProxyHandler (HubOAuthenticated , StandaloneProxyHandler ):
1413 """
1514 Standalone Proxy used when spawned by a JupyterHub.
1615 Will restrict access to the application by authentication with the JupyterHub API.
@@ -28,9 +27,9 @@ def hub_groups(self):
2827 return {self .settings ["hub_group" ]}
2928 return set ()
3029
31- def prepare ( self , * args , ** kwargs ):
32- # Enable Authentication Check
33- return ProxyHandler . prepare ( self , * args , ** kwargs )
30+ @ web . authenticated
31+ async def proxy ( self , port , path ):
32+ return await super (). proxy ( port , path )
3433
3534 def set_default_headers (self ):
3635 self .set_header ("X-JupyterHub-Version" , __jh_version__ )
0 commit comments