o
    >h$                     @   sr   d dl Z d dlmZmZ d dlmZmZmZmZm	Z	 e 
eZG dd dZG dd deeZG dd	 d	eZdS )
    N)ABCabstractmethod)AnyCallableOptionalTupleUnionc                   @   sT   e Zd ZdZdeee eeef f fddZdeee eeef f fddZdS )CredentialProviderz
    Credentials Provider.
    returnc                 C   s   t d)Nz#get_credentials must be implemented)NotImplementedErrorself r   q/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/redis/credentials.pyget_credentials   s   z"CredentialProvider.get_credentialsc                    s   t d |  S )Nz[This method is added for backward compatability. Please override it in your implementation.)loggerwarningr   r   r   r   r   get_credentials_async   s
   z(CredentialProvider.get_credentials_asyncN)	__name__
__module____qualname____doc__r   r   strr   r   r   r   r   r   r	      s    "&r	   c                   @   sZ   e Zd ZdZedeegdf fddZedeegdf fddZ	ede
fd	d
ZdS )StreamingCredentialProviderzI
    Credential provider that streams credentials in the background.
    callbackNc                 C   s   dS )z
        Specifies the callback that should be invoked
        when the next credentials will be retrieved.

        :param callback: Callback with
        :return:
        Nr   r   r   r   r   r   on_next   s   	z#StreamingCredentialProvider.on_nextc                 C      d S Nr   r   r   r   r   on_error(      z$StreamingCredentialProvider.on_errorr
   c                 C   r   r   r   r   r   r   r   is_streaming,   r    z(StreamingCredentialProvider.is_streaming)r   r   r   r   r   r   r   r   	Exceptionr   boolr!   r   r   r   r   r      s    
r   c                   @   sV   e Zd ZdZddee dee fddZdd Zd	ee	e e	eef f fd
dZ
dS )"UsernamePasswordCredentialProviderzg
    Simple implementation of CredentialProvider that just wraps static
    username and password.
    Nusernamepasswordc                 C   s   |pd| _ |pd| _d S )N r%   r&   )r   r%   r&   r   r   r   __init__7   s   
z+UsernamePasswordCredentialProvider.__init__c                 C   s   | j r	| j | jfS | jfS r   r(   r   r   r   r   r   ;   s   z2UsernamePasswordCredentialProvider.get_credentialsr
   c                    s
   |   S r   )r   r   r   r   r   r   @   s   z8UsernamePasswordCredentialProvider.get_credentials_async)NN)r   r   r   r   r   r   r)   r   r   r   r   r   r   r   r   r$   1   s
    &r$   )loggingabcr   r   typingr   r   r   r   r   	getLoggerr   r   r	   r   r$   r   r   r   r   <module>   s    
