
    %i                     L    d dl mZ ddlmZ ddlmZ ddlZddlZ G d d      Zy)   )TokenVerifier    )WebhookEvent)ParseNc                   ,    e Zd ZdefdZdededefdZy)WebhookReceivertoken_verifierc                     || _         y )N)	_verifier)selfr	   s     M/var/www/html/engine/venv/lib/python3.12/site-packages/livekit/api/webhook.py__init__zWebhookReceiver.__init__	   s	    '    body
auth_tokenreturnc                 R   | j                   j                  |      }|j                  t        d      t	        j                  |j                               j                         }t        j                  |j                        }||k7  rt        d      t        |t               d      S )Nz!sha256 was not found in the tokenzhash mismatchT)ignore_unknown_fields)r   verifysha256	Exceptionhashlibencodedigestbase64	b64decoder   r   )r   r   r   claims	body_hashclaims_hashs         r   receivezWebhookReceiver.receive   s    &&z2== ?@@NN4;;=188:	&&v}}5#O,,T<>FFr   N)__name__
__module____qualname__r   r   strr   r     r   r   r   r      s,    (} (GC GS G\ Gr   r   )	access_tokenr   livekit.protocol.webhookr   google.protobuf.json_formatr   r   r   r   r%   r   r   <module>r)      s     ' 1 -  G Gr   