�
u��g: � �� � d dl Z d dlZd dlZd dlZd dlZ ej e� � Zd� Zd� Z G d� de
� � Z G d� de
� � Z G d� d e� � Z
eZe
Ze
j e_ dS )
� Nc �B � | � d�� � S # | cY S xY w)Nzutf-8)�encoding)�encode)�raws �h/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/msal/oauth2cli/assertion.py�
_str2bytesr s- � ���z�z�7�z�+�+�+����
�
�
���s � �c �r � t j t j | � � � � � � � S �N)�base64�urlsafe_b64encode�binascii�a2b_hex�decode)�
thumbprints r �_encode_thumbprintr s* � ��#�H�$4�Z�$@�$@�A�A�H�H�J�J�J� c �$ � e Zd Z dd�Z dd�ZdS )�AssertionCreatorN�X c � � t d� � �)a+ Create an assertion in bytes, based on the provided claims.
All parameter names are defined in https://tools.ietf.org/html/rfc7521#section-5
except the expires_in is defined here as lifetime-in-seconds,
which will be automatically translated into expires_at in UTC.
z Will be implemented by sub-class)�NotImplementedError) �self�audience�issuer�subject�
expires_at�
expires_in� issued_at�assertion_id�kwargss r �create_normal_assertionz(AssertionCreator.create_normal_assertion s � � "�"D�E�E�Er c �Z � � t |||||f� fd� t |dz
d� � �� � S )z�Create an assertion as a callable,
which will then compute the assertion later when necessary.
This is a useful optimization to reuse the client assertion.
c �( �� �j | ||fd|i|��S )Nr )r! )�a�i�s�er r s �r �<lambda>z@AssertionCreator.create_regenerative_assertion.<locals>.<lambda>) s) �� �,��,�Q��1�M�M��M�f�M�M� r �<