ソースを参照

fix(docs): don't lead users to wrong assumptions about token validity

Peter Thomassen 4 年 前
コミット
45b46419a6
3 ファイル変更11 行追加8 行削除
  1. 4 5
      docs/dyndns/lets-encrypt.rst
  2. 3 3
      docs/index.rst
  3. 4 0
      docs/quickstart.rst

+ 4 - 5
docs/dyndns/lets-encrypt.rst

@@ -27,11 +27,10 @@ steps.
      wget https://raw.githubusercontent.com/desec-io/certbot-hook/master/hook.sh
      wget https://raw.githubusercontent.com/desec-io/certbot-hook/master/.dedynauth
 
-#. **Get a token.** you need to obtain a token for using the API. To get the token use the email address you used when setting up your desec.io account. To get a token run the following curl command::
-
-     curl -X POST https://desec.io/api/v1/auth/login/ --header "Content-Type: application/json" \
-         --data @- <<< '{"email": "your-email-address@example.com", "password": "your-desec.io-account-password-here"}'
-
+#. **Get a token.** You need to configure an API token so that certbot can use
+   it to authenticate its requests towards the deSEC API. The easiest way to
+   get such a token is to log into the web interface at https://desec.io/,
+   navigate to "Token Management", and create a token there.
 
 #. **Configuration.** You need to provide your dedyn.io credentials to the hook
    script, so that it can write the Let's Encrypt challenge to the DNS on your

+ 3 - 3
docs/index.rst

@@ -14,11 +14,11 @@ application/json`` header field.
 API functionality is demonstrated using the command line tool ``curl``.  To
 pretty-print JSON output, process the data through ``jq``:  ``curl ... | jq .``.
 
-**Windows users:** We are told that the `curl` commands in this documentation
+**Windows users:** We are told that the ``curl`` commands in this documentation
 sometimes do not work. In this case, try moving the request payload in front
-of the `curl` call, like this::
+of the ``curl`` call, like this::
 
-    echo {"email": "mail@example.com", "password": "foobar"} | curl -X POST https://desec.io/api/v1/auth/login/ --header "Content-Type: application/json" --data @-
+    echo {"name": "example.com"} | curl -X POST https://desec.io/api/v1/domains/ --header "Authorization: Token {token}" --header "Content-Type: application/json" --data @-
 
 
 .. toctree::

+ 4 - 0
docs/quickstart.rst

@@ -44,6 +44,10 @@ Here's a quick intro how to get started:
    authenticate requests to the DNS management endpoints as demonstrated in
    the next step.
 
+   Note that tokens created by the login endpoint have limited validity (see
+   the ``max_age`` and ``max_unused_period`` fields in the response). To
+   create a long-lived API token, please refer to :ref:`manage-tokens`.
+
 #. Create a DNS zone::
 
     curl -X POST https://desec.io/api/v1/domains/ \