mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-11 12:03:00 +00:00
Fixed merge request after cherrypick
This commit is contained in:
@@ -57,8 +57,6 @@ class RootAPIHandler(APIHandler):
|
||||
def get(self):
|
||||
"""GET /api/ returns info about the Hub and its API.
|
||||
|
||||
It is not an authenticated endpoint.
|
||||
|
||||
For now, it just returns the version of JupyterHub itself.
|
||||
"""
|
||||
data = {'version': __version__}
|
||||
@@ -66,12 +64,11 @@ class RootAPIHandler(APIHandler):
|
||||
|
||||
|
||||
class InfoAPIHandler(APIHandler):
|
||||
@needs_scope('read:hub')
|
||||
def get(self):
|
||||
"""GET /api/info returns detailed info about the Hub and its API.
|
||||
|
||||
It is not an authenticated endpoint.
|
||||
|
||||
For now, it just returns the version of JupyterHub itself.
|
||||
Currently, it returns information on the python version, spawner and authenticator
|
||||
"""
|
||||
|
||||
def _class_info(typ):
|
||||
|
@@ -1618,13 +1618,15 @@ async def test_root_api(app):
|
||||
if app.internal_ssl:
|
||||
kwargs['cert'] = (app.internal_ssl_cert, app.internal_ssl_key)
|
||||
kwargs["verify"] = app.internal_ssl_ca
|
||||
r = await async_requests.get(url, **kwargs)
|
||||
with mock_role(app):
|
||||
r = await api_request(app, bypass_proxy=True)
|
||||
r.raise_for_status()
|
||||
expected = {'version': jupyterhub.__version__}
|
||||
assert r.json() == expected
|
||||
|
||||
|
||||
async def test_info(app):
|
||||
with mock_role(app):
|
||||
r = await api_request(app, 'info')
|
||||
r.raise_for_status()
|
||||
data = r.json()
|
||||
|
@@ -97,7 +97,7 @@ class MockAPIHandler:
|
||||
def group_thing(self, group_name):
|
||||
return True
|
||||
|
||||
@needs_scope('services')
|
||||
@needs_scope('read:services')
|
||||
def service_thing(self, service_name):
|
||||
return True
|
||||
|
||||
@@ -133,7 +133,7 @@ class MockAPIHandler:
|
||||
('maybe', 'bluth2'),
|
||||
False,
|
||||
),
|
||||
(['services'], 'service_thing', ('service1',), True),
|
||||
(['read:services'], 'service_thing', ('service1',), True),
|
||||
(
|
||||
['users!user=george', 'read:groups!group=bluths'],
|
||||
'group_thing',
|
||||
|
@@ -223,6 +223,7 @@ def get_scopes(role='admin'):
|
||||
'services',
|
||||
'proxy',
|
||||
'shutdown',
|
||||
'read:hub',
|
||||
],
|
||||
'user': [
|
||||
'all',
|
||||
|
Reference in New Issue
Block a user