Skip to content

Commit 05f05c4

Browse files
committed
update jupyterhub user url
/api/user added in 0.8 in 2017 /authorizations/token deprecated since 2.0 in 2021
1 parent cb9ecac commit 05f05c4

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

dask-gateway-server/dask_gateway_server/auth.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import time
44
import uuid
5-
from urllib.parse import quote
65

76
import aiohttp
87
from aiohttp import web
@@ -376,13 +375,10 @@ async def authenticate(self, request):
376375
if token is None:
377376
raise unauthorized("jupyterhub")
378377

379-
url = "{}/authorizations/token/{}".format(
380-
self.jupyterhub_api_url,
381-
quote(token, safe=""),
382-
)
378+
url = f"{self.jupyterhub_api_url}/user"
383379

384380
kwargs = {
385-
"headers": {"Authorization": "token %s" % self.jupyterhub_api_token},
381+
"headers": {"Authorization": f"token {token}"},
386382
"ssl": self.ssl_context,
387383
}
388384

tests/test_auth.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def configure_dask_gateway(jhub_api_token, jhub_bind_url):
117117
"dask_gateway_server.auth.JupyterHubAuthenticator"
118118
)
119119
config.JupyterHubAuthenticator.jupyterhub_api_token = jhub_api_token
120-
config.JupyterHubAuthenticator.jupyterhub_api_url = jhub_bind_url + "api/"
120+
config.JupyterHubAuthenticator.jupyterhub_api_url = jhub_bind_url + "api"
121121
return config
122122

123123

0 commit comments

Comments
 (0)