�
u��g7 � � � d dl mZ n# e$ r d dlmZ Y nw xY w d dlmZ n# e$ r d dlmZ Y nw xY wd dlZ ej e � � Z
d� Zd� Z G d� de
� � ZdS ) � )�urlparse)�cElementTree)�ElementTreeNc �Z � d� | dgt | � � dz
z z � � S )N�/z..� )�join�len)�
route_to_leafs �X/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/msal/mex.py�_xpath_of_rootr
) s- � ��8�8�M�T�F�c�-�.@�.@��.B�$C�C�D�D�D� c � � |j | fi |��}|� � � t |j � � � � � S # t
j $ r( t � d|j |j � � � w xY w)NzMalformed MEX document: %s, %s)
�get�raise_for_status�Mex�text�&get_wstrust_username_password_endpoint�ET�
ParseError�logger� exception�status_code)�mex_endpoint�http_client�kwargs�mex_resps r �send_requestr . s� � ��{��|�6�6�v�6�6�H���������8�=�!�!�H�H�J�J�J��
�=� � � ����,�h�.B�H�M� S� S� S�
����s �%A
�
7Bc �b � e Zd Zdddddddddd d
d
ddd
�ZdZdZd� Zd� Zd� Zd� Z d� Z
d� Zd� ZdS )r z http://schemas.xmlsoap.org/wsdl/z9http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702z4http://schemas.xmlsoap.org/ws/2005/07/securitypolicyzRhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsdz$http://www.w3.org/2005/08/addressingz3http://schemas.microsoft.com/ws/06/2004/policy/httpz'http://schemas.xmlsoap.org/wsdl/soap12/z,http://schemas.xmlsoap.org/ws/2004/09/policyz'http://www.w3.org/2003/05/soap-envelopez0http://docs.oasis-open.org/ws-sx/ws-trust/200512z%urn:oasis:names:tc:SAML:1.0:assertionz+http://schemas.xmlsoap.org/ws/2005/02/trust)�wsdl�sp�sp2005�wsu�wsa�wsa10�http�soap12�wsp�s�wst�trust�saml�wst2005z:http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issuez5http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issuec �8 � t j |� � | _ d S )N)r �
fromstring�dom)�self�mex_documents r �__init__zMex.__init__N s � ��=��.�.����r c � � ��� d� j d z �t ��� fd�� j � t |� � � j � � D � � � � S )Nz{%s}Idr# c � �� g | ]E}|� ��j � � �d� |� �� � � � ��FS )Nz#{})�find�NS�formatr )�.0�policy�
binding_xpath�id_attrr1 s ���r �
<listcomp>z'Mex._get_policy_ids.<locals>.<listcomp>S sV �� � @� @� @���{�{�=�$�'�2�2�>� �L�L����G�!4�!4�5�5� ?�>�>r )r7 �setr0 �findallr
)r1 �components_to_leafr; r<