Ë
    £…j�  ã                   ób   — d dl mZmZ d dlmZmZmZ ddlmZ ddl	m
Z
 ddlmZ  G d„ d	e«      Zy
)é    )ÚOptionalÚAny)ÚAccessTokenÚAccessTokenInfoÚTokenRequestOptionsé   )ÚAsyncContextManager)Úlog_get_token_asyncé   )ÚVisualStudioCodeCredentialc                   óŠ   — e Zd ZdZdeddfd„Zdd„Zdd„Zedddœd	e	d
e
e	   de
e	   dedef
d„«       Zddœd	e	de
e   defd„Zy)r   a³  Authenticates as the Azure user signed in to Visual Studio Code via the 'Azure Resources' extension.

    This currently only works in Windows/WSL environments and requires the 'azure-identity-broker'
    package to be installed.

    :keyword str tenant_id: A Microsoft Entra tenant ID. Defaults to the tenant specified in the authentication
        record file used by the Azure Resources extension.
    :keyword List[str] additionally_allowed_tenants: Specifies tenants in addition to the specified "tenant_id"
        for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to
        acquire tokens for any tenant the application can access.
    ÚkwargsÚreturnNc                 ó$   — t        di |¤Ž| _        y )N© )ÚSyncVSCodeCredentialÚ_sync_credential)Úselfr   s     úg/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/azure/identity/aio/_credentials/vscode.pyÚ__init__z#VisualStudioCodeCredential.__init__   s   € Ü 4Ñ >°vÑ >ˆÕó    c              ƒ   óB   K  — | j                   j                  «        | S ­w)N)r   Ú	__enter__©r   s    r   Ú
__aenter__z%VisualStudioCodeCredential.__aenter__   s   è ø€ Ø×Ñ×'Ñ'Ô)Øˆùó   ‚c              ƒ   ó@   K  — | j                   j                  «        y­w)z)Close the credential's transport session.N)r   Úcloser   s    r   r   z VisualStudioCodeCredential.close!   s   è ø€ à×Ñ×#Ñ#Õ%ùs   ‚©ÚclaimsÚ	tenant_idÚscopesr    r!   c             �   óH   K  —  | j                   j                  |||dœ|¤ŽS ­w)a”  Request an access token for `scopes` as the user currently signed in to Visual Studio Code.

        This method is called automatically by Azure SDK clients.

        :param str scopes: desired scopes for the access token. This method requires at least one scope.
            For more information about scopes, see
            https://learn.microsoft.com/entra/identity-platform/scopes-oidc.
        :keyword str claims: additional claims required in the token, such as those returned in a resource provider's
            claims challenge following an authorization failure.
        :keyword str tenant_id: optional tenant to include in the token request.

        :return: An access token with the desired scopes.
        :rtype: ~azure.core.credentials.AccessToken
        :raises ~azure.identity.CredentialUnavailableError: the credential cannot retrieve user details from Visual
            Studio Code
        r   )r   Ú	get_token)r   r    r!   r"   r   s        r   r$   z$VisualStudioCodeCredential.get_token%   s,   è ø€ ð( /ˆt×$Ñ$×.Ñ.°¸vÐQZÑeÐ^dÑeÐeùs   ‚ ")Úoptionsr%   c             ‡   óB   K  —  | j                   j                  |d|iŽS ­w)aÕ  Request an access token for `scopes` as the user currently signed in to Visual Studio Code.

        This is an alternative to `get_token` to enable certain scenarios that require additional properties
        on the token. This method is called automatically by Azure SDK clients.

        :param str scopes: desired scopes for the access token. This method requires at least one scope.
            For more information about scopes, see https://learn.microsoft.com/entra/identity-platform/scopes-oidc.
        :keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
        :paramtype options: ~azure.core.credentials.TokenRequestOptions

        :rtype: ~azure.core.credentials.AccessTokenInfo
        :return: An AccessTokenInfo instance containing information about the token.
        :raises ~azure.identity.CredentialUnavailableError: the credential cannot retrieve user details from Visual
          Studio Code.
        r%   )r   Úget_token_info)r   r%   r"   s      r   r'   z)VisualStudioCodeCredential.get_token_info;   s&   è ø€ ð  4ˆt×$Ñ$×3Ñ3°VÐMÀWÑMÐMùr   )r   r   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r
   Ústrr   r   r$   r   r   r'   r   r   r   r   r      s¡   „ ñ
ð? ð ?¨ó ?óó&ð à48ÐUYòfØðfØ$,¨S¡MðfØEMÈcÁ]ðfØehðfà	òfó ðfð* [_ò N¨Cð N¸(ÐCVÑ:Wð NÐcrô Nr   r   N)Útypingr   r   Úazure.core.credentialsr   r   r   Ú	_internalr	   Ú_internal.decoratorsr
   Ú_credentials.vscoder   r   r   r   r   ú<module>r2      s(   ð÷
 !ç TÑ TÝ +Ý 6Ý Uô>NÐ!4õ >Nr   