
    %is                    ^    d dl mZ d dlZd dlmZ ddlmZ ddlmZm	Z	m
Z
 dZ G d d	e      Zy)
    )annotationsN)ABC   )TwirpClient)AccessTokenVideoGrants	SIPGrantsauthorizationc                  *    e Zd ZddZ	 d	 	 	 	 	 ddZy)Servicec                D    t        ||d      | _        || _        || _        y )Nlivekit)r   _clientapi_key
api_secret)selfsessionhostr   r   s        N/var/www/html/engine/venv/lib/python3.12/site-packages/livekit/api/_service.py__init__zService.__init__   s     "7D)<$    Nc                    t        | j                  | j                        }|r|j                  |       ||j	                  |       |j                         }i }dj                  |      |t        <   |S )Nz	Bearer {})r   r   r   with_grantswith_sip_grantsto_jwtformatAUTHORIZATION)r   grantssiptoktokenheaderss         r   _auth_headerzService._auth_header   sd     $,,8OOF#?$

!,!3!3E!:r   )r   zaiohttp.ClientSessionr   strr   r$   r   r$   )N)r   zVideoGrants | Noner   zSIPGrants | Nonereturnzdict[str, str])__name__
__module____qualname__r   r#    r   r   r   r      s+    % CG(/?	r   r   )
__future__r   aiohttpabcr   twirp_clientr   access_tokenr   r   r	   r   r   r)   r   r   <module>r/      s(    "   % = =c r   