Browse Source

feat(api): add GET endpoint for single token

Peter Thomassen 5 years ago
parent
commit
b5c6031710
3 changed files with 7 additions and 1 deletions
  1. 1 0
      api/desecapi/views.py
  2. 3 0
      docs/authentication.rst
  3. 3 1
      docs/endpoint-reference.rst

+ 1 - 0
api/desecapi/views.py

@@ -50,6 +50,7 @@ class DomainView:
 
 class TokenViewSet(IdempotentDestroy,
                    mixins.CreateModelMixin,
+                   mixins.RetrieveModelMixin,
                    mixins.DestroyModelMixin,
                    mixins.ListModelMixin,
                    GenericViewSet):

+ 3 - 0
docs/authentication.rst

@@ -405,6 +405,9 @@ automatically populate the ``name`` field with values such as "login" or
         }
     ]
 
+You can also retrieve an individual token by appending ``:id/`` to the URL,
+for example in order to look up a token's name or creation timestamp.
+
 
 Create Additional Tokens
 ````````````````````````

+ 3 - 1
docs/endpoint-reference.rst

@@ -25,7 +25,9 @@ for `User Registration and Management`_.
 |                                                +------------+---------------------------------------------+
 |                                                | ``POST``   | Create new token                            |
 +------------------------------------------------+------------+---------------------------------------------+
-| ...\ ``/auth/tokens/:id/``                     | ``DELETE`` | Delete token                                |
+| ...\ ``/auth/tokens/:id/``                     | ``GET``    | Retrieve token                              |
+|                                                +------------+---------------------------------------------+
+|                          `                     | ``DELETE`` | Delete token                                |
 +------------------------------------------------+------------+---------------------------------------------+
 | ...\ ``/captcha/``                             | ``POST``   | Obtain captcha                              |
 +------------------------------------------------+------------+---------------------------------------------+