HEX
Server: Apache
System: Linux pdx1-shared-a1-29 6.18.39-grsec-noble+ #4 SMP Thu Jul 23 07:53:29 UTC 2026 x86_64
User: dh_bj99yp (22285841)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/boto/mturk/__pycache__/notification.cpython-312.pyc
�

ckF[b��x�dZddlZ	ddlmZddlZddlZGd�de�Z	Gd�de�Z
y#e$rddlZY�*wxYw)z�
Provides NotificationMessage and Event classes, with utility methods, for
implementations of the Mechanical Turk Notification API.
�N)�sha1c�P�eZdZdZdZdZdZdZeje�Z
d�Zd�Zy)	�NotificationMessagezlhttp://mechanicalturk.amazonaws.com/AWSMechanicalTurk/2006-05-05/AWSMechanicalTurkRequesterNotification.wsdlz
2006-05-05�&AWSMechanicalTurkRequesterNotification�Notifyz!Event\.(?P<n>\d+)\.(?P<param>\w+)c��|d|_|d|_|d|_|dtjk(sJdtjz��g|_i}d|vr|d}nx|D]s}||}|j
d�s�tjj|�j�}t|d�}t|d	�}||vri||<||||<�u|D])}|j
jt||���+y
)z
        Constructor; expects parameter d to be a dict of string parameters from a REST transport notification message
        �	Signature�	Timestamp�Version�methodzMethod should be '%s'�EventzEvent.�n�paramN)�	signature�	timestamp�versionr�OPERATION_NAME�events�
startswith�EVENT_RE�search�	groupdict�int�str�appendr
)�self�d�events_dict�k�v�edrrs        �9/usr/lib/python3/dist-packages/boto/mturk/notification.py�__init__zNotificationMessage.__init__.s���;�����;������|�����{�1�@�@�@�~�BY�\o�\~�\~�B~�~�@�������a�<��G�*�K��
.���a�D���<�<��)�,�5�5�<�<�Q�?�I�I�K�B��B�s�G��A���7��,�E���+�)+��A��,-�K��N�5�)�
.��	6�A��K�K���u�[��^�4�5�	6�c�"�tj}|tjz
}||jz
}t	j
|t��}|j|�tj|j��}|j|k(S)a
        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.
        )�key�	digestmod)r�SERVICE_NAMErr�hmac�new�sha�update�base64�	b64encode�digestr)r�
secret_key�verification_input�h�signature_calcs     r"�verifyzNotificationMessage.verifyJss��1�=�=���1�@�@�@���d�n�n�,���H�H��s�3��	���#�$��)�)�!�(�(�*�5���~�~��/�/r$N)
�__name__�
__module__�__qualname__�NOTIFICATION_WSDL�NOTIFICATION_VERSIONr(r�
EVENT_PATTERN�re�compilerr#r4�r$r"rr#s:��G��'��;�L��N�8�M��r�z�z�-�(�H�6�80r$rc��eZdZd�Zd�Zy)r
c�r�|d|_|d|_|d|_|d|_d|vr|d|_yy)N�	EventType�	EventTime�	HITTypeId�HITId�AssignmentId)�
event_type�event_time_str�hit_type�hit_id�
assignment_id)rrs  r"r#zEvent.__init__\sI���K�.�����n����+���
���j����Q��!"�>�!2�D��r$c�<�d|j�d|j�d�S)Nz <boto.mturk.notification.Event: z for HIT # �>)rErH)rs r"�__repr__zEvent.__repr__fs��EI�_�_�VZ�Va�Va�b�br$N)r5r6r7r#rLr=r$r"r
r
[s
��3�cr$r
)�__doc__r)�hashlibrr+�ImportErrorr-r;�objectrr
r=r$r"�<module>rQsO��,�
��#��	�60�&�60�pc�F�c��{����s�-�	9�9