
    	h                        d Z ddlZddlZddlmZmZ dZdeeef         defdZ	deeef         d	eeef         d
eeef         defdZ
deeef         d	eeef         defdZdeeef         d	eeef         deeef         fdZdS )z!
Authentication related methods.
    N)TupleUnion)auth_crammd5_verifyauth_plain_encodeauth_login_encodevaluereturnc                 Z    t          | t                    r| S |                     d          S )Nzutf-8)
isinstancebytesencode)r   s    \/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/aiosmtplib/auth.py_ensure_bytesr      s+    % <<       usernamepassword	challengec                   t          |           }t          |          }t          j        |          }t          j        ||d          }|dz   |                                                    d          z   }t          j        |          }|S )z
    CRAM-MD5 auth uses the password as a shared secret to MD5 the server's
    response, and sends the username combined with that (base64 encoded).
    md5)msg	digestmod    ascii)r   base64	b64decodehmacnew	hexdigestr   	b64encode)	r   r   r   username_bytespassword_bytesdecoded_challenge
md5_digestverificationencoded_verifications	            r   r   r      s     #8,,N"8,,N(33..?5QQQJ!D(:+?+?+A+A+H+H+Q+QQL!+L99r   c                    t          |           }t          |          }d|z   dz   |z   }t          j        |          }|S )zG
    PLAIN auth base64 encodes the username and password together.
        r   r   r   )r   r   r    r!   username_and_passwordencodeds         r   r   r   (   sI     #8,,N"8,,N!N2U:^K455GNr   c                    t          |           }t          |          }t          j        |          }t          j        |          }||fS )z]
    LOGIN auth base64 encodes the username and password and sends them
    in sequence.
    r(   )r   r   r    r!   encoded_usernameencoded_passwords         r   r   r   9   sL     #8,,N"8,,N'77'77---r   )__doc__r   r   typingr   r   __all__strr   r   r   r   r    r   r   <module>r3      sT              L!sEz* !u ! ! ! ! CJ CJ  S%Z  
        *CJCJ 	   ".CJ.CJ. 5%<	. . . . . .r   