o
    i                     @   sF   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 dZdS )   )TokenVerifier    )WebhookEvent)ParseNc                   @   s0   e Zd ZdefddZdededefddZd	S )
WebhookReceivertoken_verifierc                 C   s
   || _ d S )N)	_verifier)selfr    r
   U/var/www/html/livekit_bhavya/venv/lib/python3.10/site-packages/livekit/api/webhook.py__init__	   s   
zWebhookReceiver.__init__body
auth_tokenreturnc                 C   s\   | j |}|jd u rtdt|  }t|j}||kr&tdt	|t
 d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_hashr
   r
   r   receive   s   
zWebhookReceiver.receiveN)__name__
__module____qualname__r   r   strr   r   r
   r
   r
   r   r      s    r   )	access_tokenr   livekit.protocol.webhookr   google.protobuf.json_formatr   r   r   r   r
   r
   r
   r   <module>   s    