o
    j3                     @   sX   d dl mZ d dlmZ d dlmZmZmZ d dlm	Z	 d dlm
Z
 G dd deZdS )	    )List)UniCredential)asyauthSecretasyauthProtocolasyauthSubProtocol)SubProtocol)SubProtocolNativec                   @   s2   e Zd Zg e fdee defddZdd ZdS )SPNEGOEXCredentialcredentialssubprotocolc                 C   s   t j| tj|d || _d S )N)protocolr   )r   __init__r   SPNEGOEXr
   )selfr
   r    r   /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/asyauth/common/credentials/spnegoex.pyr      s   
zSPNEGOEXCredential.__init__c                 O   s   | j jtjkr=ddlm} || }| jD ]&}| }|jt	j
kr'|d| q|jt	jkr4|d| qtd|j |S td| j  )Nr   )SPNEGOClientNativezMS KRB5 - Microsoft Kerberos 5z2NTLMSSP - Microsoft NTLM Security Support Providerz8Authentication protocol "%s" is not supported for SPNEGOzUnsupported subprotocol "%s")r   typer   NATIVE&asyauth.protocols.spnego.client.nativer   r
   build_contextr   r   KERBEROSadd_auth_contextNTLM	Exception)r   argskwargsr   sspi_ctx
credentialcontextr   r   r   r      s   
z SPNEGOEXCredential.build_contextN)	__name__
__module____qualname__r   r   r   r   r   r   r   r   r   r   r	      s    r	   N)typingr   asyauth.common.credentialsr   asyauth.common.constantsr   r   r   asyauth.common.subprotocolsr   r   r	   r   r   r   r   <module>   s    