Small fixes to services docs

This commit is contained in:
Erik Sundell
2023-09-06 09:41:51 +02:00
parent f416306913
commit 1eda00b721

View File

@@ -156,8 +156,8 @@ to perform its API requests. Each Externally-Managed Service will need a
unique API token, because the Hub authenticates each API request and the API unique API token, because the Hub authenticates each API request and the API
token is used to identify the originating Service or user. token is used to identify the originating Service or user.
A configuration example of an Externally-Managed Service with admin access and A configuration example of an Externally-Managed Service running its own web
running its own web server is: server is:
```python ```python
c.JupyterHub.services = [ c.JupyterHub.services = [
@@ -278,7 +278,7 @@ There are two levels of authentication with the Hub:
This should be used for any service that serves pages that should be visited with a browser. This should be used for any service that serves pages that should be visited with a browser.
To use HubAuth, you must set the `.api_token` instance variable. This can be To use HubAuth, you must set the `.api_token` instance variable. This can be
done either programmatically when constructing the class, or via the done via the HubAuth constructor, direct assignment to a HubAuth object, or via the
`JUPYTERHUB_API_TOKEN` environment variable. A number of the examples in the `JUPYTERHUB_API_TOKEN` environment variable. A number of the examples in the
root of the jupyterhub git repository set the `JUPYTERHUB_API_TOKEN` variable root of the jupyterhub git repository set the `JUPYTERHUB_API_TOKEN` variable
so consider having a look at those for futher reading so consider having a look at those for futher reading
@@ -287,8 +287,6 @@ so consider having a look at those for futher reading
[service-notebook](https://github.com/jupyterhub/jupyterhub/tree/master/examples/service-notebook) [service-notebook](https://github.com/jupyterhub/jupyterhub/tree/master/examples/service-notebook)
and [service-whoiami](https://github.com/jupyterhub/jupyterhub/tree/master/examples/service-whoami)) and [service-whoiami](https://github.com/jupyterhub/jupyterhub/tree/master/examples/service-whoami))
(TODO: Where is this API TOKen set?)
Most of the logic for authentication implementation is found in the Most of the logic for authentication implementation is found in the
{meth}`.HubAuth.user_for_token` methods, {meth}`.HubAuth.user_for_token` methods,
which makes a request of the Hub, and returns: which makes a request of the Hub, and returns:
@@ -340,7 +338,7 @@ for more details.
### Authenticating tornado services with JupyterHub ### Authenticating tornado services with JupyterHub
Since most Jupyter services are written with tornado, Since most Jupyter services are written with tornado,
we include a mixin class, [`HubOAuthenticated`][huboauthenticated], we include a mixin class, {class}`~.HubOAuthenticated`,
for quickly authenticating your own tornado services with JupyterHub. for quickly authenticating your own tornado services with JupyterHub.
Tornado's {py:func}`~.tornado.web.authenticated` decorator calls a Handler's {py:meth}`~.tornado.web.RequestHandler.get_current_user` Tornado's {py:func}`~.tornado.web.authenticated` decorator calls a Handler's {py:meth}`~.tornado.web.RequestHandler.get_current_user`