diff doc/rest.txt @ 6638:e1588ae185dc issue2550923_computed_property

merge from default branch. Fix travis.ci so CI builds don't error out
author John Rouillard <rouilj@ieee.org>
date Thu, 21 Apr 2022 16:54:17 -0400
parents 0351caa802f7
children ff8845ca305e
line wrap: on
line diff
--- a/doc/rest.txt	Fri Oct 08 00:37:16 2021 -0400
+++ b/doc/rest.txt	Thu Apr 21 16:54:17 2022 -0400
@@ -1,3 +1,9 @@
+.. meta::
+    :description language=en:
+        Documentation on the RESTful interface to the Roundup Issue
+	Tracker.
+
+
 .. index:: pair: api; Representational state transfer
    pair: api; rest
 
@@ -227,7 +233,12 @@
 ETag header or an @etag property. This needs to be submitted with
 ``DELETE``, ``PUT`` and ``PATCH`` operations on the item using an
 ``If-Match`` header or an ``"@etag`` property in the data payload if
-the method supports a payload.
+the method supports a payload. The ETag header value will include a
+suffix (starting with '-') indicating the Content-Encoding used to
+respond to the request. If the response was uncompressed, there will
+be no suffix. The ``@etag`` property never includes the suffix. Any
+ETag value suffixed or not can be sent in an ``If-Match`` header as
+the suffix is ignored during comparison.
 
 The exact details of returned data is determined by the value of the
 ``@verbose`` query parameter.  The various supported values and their
@@ -708,8 +719,7 @@
 /, you get a web page that includes metadata about the message. With
 the slash you get a text/plain (in most cases) data stream.
 
-Also you can use the url:
-
+Also you can use the url: ``https://.../demo/rest/data/msg/11?@verbose=3``
 and the content property (if the data is utf-8 compatible) now looks
 like::
 
@@ -1857,6 +1867,8 @@
         @Routing.route("/jwt/issue", 'POST')
         @_data_decorator
         def generate_jwt(self, input):
+        """Create a JSON Web Token (jwt)
+        """
             import jwt
             import datetime
             from roundup.anypy.strings import b2s
@@ -1879,6 +1891,11 @@
             else:
                 raise Unauthorised(denialmsg)
 
+            # verify we have input data.
+            if not input:
+                raise UsageError("Missing data payload. "
+                             "Verify Content-Type is sent")
+
             # If we reach this point we have validated that the user has
             # logged in with a password using basic auth.
             all_roles = list(self.db.security.role.items())
@@ -1910,7 +1927,7 @@
 
             newroles = []
             if 'roles' in input:
-                for role in input['roles'].value:
+                for role in [ r.lower() for r in input['roles'].value ]:
                     if role not in rolenames:
                         raise UsageError("Role %s is not valid."%role)
                     if role in user_roles:

Roundup Issue Tracker: http://roundup-tracker.org/