mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 10:04:07 +00:00
12 lines
303 B
Python
12 lines
303 B
Python
import os
|
|
|
|
import httpx
|
|
|
|
|
|
# a minimal alternative to using HubOAuth class
|
|
def get_client():
|
|
base_url = os.environ["JUPYTERHUB_API_URL"]
|
|
token = os.environ["JUPYTERHUB_API_TOKEN"]
|
|
headers = {"Authorization": f"Bearer {token}"}
|
|
return httpx.AsyncClient(base_url=base_url, headers=headers)
|