�
u��g�v � �f � d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z d dl
mZmZ ddl
mZ ddlmZ ddlmZmZ dd lmZ ej e� � Z G d
� de� � Z G d� d
e � � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de � � Z!d� Z"d� Z# e � � Z$ e � � Z% e � � Z& e � � Z' e � � Z( e � � Z)d� Z*d� Z+d%d�Z,d� Z-d� Z.d� Z/d� Z0dej1 �2 d � � d!�Z3 G d"� d#e� � Z4d$� Z5dS )&� N)�urlparse)�UserDict)�Optional�Union� )�
TokenCache)�_IndividualCache)�ThrottledHttpClientBase�RetryAfterParser)�_is_running_in_cloud_shellc � � e Zd ZdS )�ManagedIdentityErrorN��__name__�
__module__�__qualname__� � �e/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/msal/managed_identity.pyr r � � � � � � ��Dr r c � � � e Zd ZdZdZdZdZdZdZdZ eded ed
iZ
ed� � � Zed� � � Z
ed
� � � Zd� fd� Z� xZS )�ManagedIdentityz�Feed an instance of this class to :class:`msal.ManagedIdentityClient`
to acquire token for the specified managed identity.
�ManagedIdentityIdType�Id�ClientId�
ResourceId�ObjectId�SystemAssigned� client_id�
msi_res_id� object_idc � � t |t � � p)| � |� � p| � |� � S �N)�
isinstancer �is_system_assigned�is_user_assigned��cls�unknowns r �is_managed_identityz#ManagedIdentity.is_managed_identity/ s@ � ��7�O�4�4� -��%�%�g�.�.�-��#�#�G�,�,� .r c � � t |t � � p7t |t � � o"|� | j � � | j k S r# )r$ �SystemAssignedManagedIdentity�dict�get�ID_TYPE�SYSTEM_ASSIGNEDr'