Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1679)

Unified Diff: boto/mturk/notification.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « boto/mturk/connection.py ('k') | boto/mturk/question.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: boto/mturk/notification.py
diff --git a/boto/mturk/notification.py b/boto/mturk/notification.py
index 2aa99ca47b9d0a83345f99479ff772c6246a98dd..02c93aab14d4ebb519d73e536fd3f365929f794a 100644
--- a/boto/mturk/notification.py
+++ b/boto/mturk/notification.py
@@ -74,9 +74,18 @@ class NotificationMessage:
def verify(self, secret_key):
"""
Verifies the authenticity of a notification message.
+
+ TODO: This is doing a form of authentication and
+ this functionality should really be merged
+ with the pluggable authentication mechanism
+ at some point.
"""
- verification_input = NotificationMessage.SERVICE_NAME + NotificationMessage.OPERATION_NAME + self.timestamp
- signature_calc = self._auth_handler.sign_string(verification_input)
+ verification_input = NotificationMessage.SERVICE_NAME
+ verification_input += NotificationMessage.OPERATION_NAME
+ verification_input += self.timestamp
+ h = hmac.new(key=secret_key, digestmod=sha)
+ h.update(verification_input)
+ signature_calc = base64.b64encode(h.digest())
return self.signature == signature_calc
class Event:
« no previous file with comments | « boto/mturk/connection.py ('k') | boto/mturk/question.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698