diff roundup/rest.py @ 5727:8b5171f353eb

issue2551033: actually use the key in hmac generation. Finally add testing for etag generation to verify that etag is stable and that the key is actually being used.
author John Rouillard <rouilj@ieee.org>
date Thu, 23 May 2019 20:55:03 -0400
parents e199d0ae4a25
children 9ea2ce9d10cf
line wrap: on
line diff
--- a/roundup/rest.py	Thu May 23 18:56:57 2019 -0400
+++ b/roundup/rest.py	Thu May 23 20:55:03 2019 -0400
@@ -142,7 +142,7 @@
     '''
 
     items = node.items(protected=True) # include every item
-    etag = hmac.new(bs2b(repr(sorted(items)))).hexdigest()
+    etag = hmac.new(bs2b(key),bs2b(repr(sorted(items)))).hexdigest()
     logger.debug("object=%s%s; tag=%s; repr=%s", classname, id,
                  etag, repr(node.items(protected=True)))
     # Quotes are part of ETag spec, normal headers don't have quotes

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