add entrypoint for proxy implementations

This commit is contained in:
Min RK
2018-10-11 16:54:25 +02:00
parent 95ee2cb709
commit abd3bc13d2
2 changed files with 16 additions and 3 deletions

View File

@@ -421,9 +421,18 @@ class JupyterHub(Application):
help="Supply extra arguments that will be passed to Jinja environment." help="Supply extra arguments that will be passed to Jinja environment."
).tag(config=True) ).tag(config=True)
proxy_class = Type(ConfigurableHTTPProxy, Proxy, proxy_class = EntryPointType(
help="""Select the Proxy API implementation.""" default_value=ConfigurableHTTPProxy,
).tag(config=True) klass=Proxy,
help="""The class to use for configuring the JupyterHub proxy.
Should be a subclass of :class:`jupyterhub.proxy.Proxy`.
.. versionchanged:: 1.0
proxies may be registered via entry points,
e.g. `c.JupyterHub.proxy_class = 'traefik'`
"""
).tag(config=True)
proxy_cmd = Command([], config=True, proxy_cmd = Command([], config=True,
help="DEPRECATED since version 0.8. Use ConfigurableHTTPProxy.command", help="DEPRECATED since version 0.8. Use ConfigurableHTTPProxy.command",

View File

@@ -112,6 +112,10 @@ setup_args = dict(
'pam = jupyterhub.auth:PAMAuthenticator', 'pam = jupyterhub.auth:PAMAuthenticator',
'dummy = jupyterhub.auth:DummyAuthenticator', 'dummy = jupyterhub.auth:DummyAuthenticator',
], ],
'jupyterhub.proxies': [
'default = jupyterhub.proxy:ConfigurableHTTPProxy',
'configurable-http-proxy = jupyterhub.proxy:ConfigurableHTTPProxy',
],
'jupyterhub.spawners': [ 'jupyterhub.spawners': [
'default = jupyterhub.spawner:LocalProcessSpawner', 'default = jupyterhub.spawner:LocalProcessSpawner',
'localprocess = jupyterhub.spawner:LocalProcessSpawner', 'localprocess = jupyterhub.spawner:LocalProcessSpawner',