?????????? ????????? - ??????????????? - /home/agenciai/.local/lib/python3.9/site-packages/mysql/connector/plugins/__pycache__/authentication_kerberos_client.cpython-39.pyc
???????
a ��JhxT � @ s@ d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z m Z mZmZ ddl mZ ddlmZmZ dd lmZ e r�dd lmZ zddlZW n* ey� dZejdkr�ed�d�Y n0 zddlZddlZW n ey� dZdZY n0 d dlmZ ejdk�rdndZG dd� de�ZG dd� de�ZG dd� de�ZdS )zKerberos Authentication Plugin.� N)�abstractmethod)�Path)� TYPE_CHECKING�Any�Optional�Tuple� )� ERR_STATUS)�InterfaceError�ProgrammingError)�logger)�MySQLSocket�ntzwModule gssapi is required for GSSAPI authentication mechanism but was not found. Unable to authenticate with the server� )�MySQLAuthPlugin�MySQLSSPIKerberosAuthPlugin�MySQLKerberosAuthPluginc @ sl e Zd ZdZeed�dd��Zeed�dd��Ze e e ee e ef d�dd ��Z d eeed�dd �ZdS )�MySQLBaseKerberosAuthPluginz8Base class for the MySQL Kerberos authentication plugin.��returnc C s dS )zPlugin official name.Zauthentication_kerberos_client� ��selfr r �k/home/agenciai/.local/lib/python3.9/site-packages/mysql/connector/plugins/authentication_kerberos_client.py�nameL s z MySQLBaseKerberosAuthPlugin.namec C s dS )z'Signals whether or not SSL is required.Fr r r r r �requires_sslQ s z(MySQLBaseKerberosAuthPlugin.requires_ssl��tgt_auth_challenger c C s dS )�! Continue with the Kerberos TGT service request. With the TGT authentication service given response generate a TGT service request. This method must be invoked sequentially (in a loop) until the security context is completed and an empty response needs to be send to acknowledge the server. Args: tgt_auth_challenge: the challenge for the negotiation. Returns: tuple (bytearray TGS service request, bool True if context is completed otherwise False). Nr )r r r r r � auth_continueV s z)MySQLBaseKerberosAuthPlugin.auth_continuer )�sock� auth_data�kwargsr c K s� t �d|� | j|fddi|��}|du r2td��t �d|t|�� |�|� |�� }t �d|� |tk�r�d}t �d � t �d |d|d � � t �dt|�� t �d � d}d}|�sJ|dk �rJt �dd|d d� t �d|� t �d|d|d � � | �||d� �\} }| �r"|�| � |�r,�qJ|�� }t �d| � |d7 }q�|�sdtd|� d|� ���t �d|t|�� |�� }t �d|� t |�S )aS Handles server's `auth switch request` response. Args: sock: Pointer to the socket connection. auth_data: Plugin provided data (extracted from a packet representing an `auth switch request` response). kwargs: Custom configuration to be passed to the auth plugin when invoked. The parameters defined here will override the ones defined in the auth plugin itself. Returns: packet: Last server's response after back-and-forth communication. z# auth_data: %s�ignore_auth_dataFNzGot a NULL auth responsez# request: %s size: %sz# server response packet: %s� z%# Continue with GSSAPI authenticationz# Response header: %sr z# Response size: %sz# Negotiate a service requestr z%s Attempt %s %sz--------------------z<< Server response: %sz# Response code: %sz>> Response to server: %sz'Unable to fulfill server request after z! attempts. Last server response: z(Last response from server: %s length: %dz<< Ok packet from server: %s) r �debug� auth_responser �len�send�recvr r �bytes) r r r! r"