From 6bf4f3b2aae73c0f2f45ec39b5b01d83e3bbb0ba Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 26 May 2020 13:40:21 +0200 Subject: [PATCH] document upgrading from api_tokens to services config --- docs/source/reference/rest.md | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/source/reference/rest.md b/docs/source/reference/rest.md index 95e9ea8b..0432f677 100644 --- a/docs/source/reference/rest.md +++ b/docs/source/reference/rest.md @@ -57,6 +57,9 @@ generating an API token is available from the JupyterHub user interface: ## Add API tokens to the config file +**This is deprecated. We are in no rush to remove this feature, +but please consider if service tokens are right for you.** + You may also add a dictionary of API tokens and usernames to the hub's configuration file, `jupyterhub_config.py` (note that the **key** is the 'secret-token' while the **value** is the 'username'): @@ -67,6 +70,41 @@ c.JupyterHub.api_tokens = { } ``` +### Updating to admin services + +The `api_tokens` configuration has been softly deprecated since the introduction of services. +We have no plans to remove it, +but users are encouraged to use service configuration instead. + +If you have been using `api_tokens` to create an admin user +and a token for that user to perform some automations, +the services mechanism may be a better fit. +If you have the following configuration: + +```python +c.JupyterHub.admin_users = {"service-admin",} +c.JupyterHub.api_tokens = { + "secret-token": "service-admin", +} +``` + +This can be updated to create an admin service, with the following configuration: + +```python +c.JupyterHub.services = [ + { + "name": "service-token", + "admin": True, + "api_token": "secret-token", + }, +] +``` + +The token will have the same admin permissions, +but there will no longer be a user account created to house it. +The main noticeable difference is that there will be no notebook server associated with the account +and the service will not show up in the various user list pages and APIs. + ## Make an API request To authenticate your requests, pass the API token in the request's