
    =OOf                     B    d Z ddlmZ ddlmZ ddlmZ  G d de      Zy)
   )RESULT_SUCCESS)LDAPExtensionError)decoderc                   4    e Zd ZddZd Zd ZddZd Zd Zy)	ExtendedOperationNc                     || _         d | _        d | _        d | _        d | _        d | _        d | _        d | _        d | _        || _	        | j                          y N)
connectiondecoded_responseresult	asn1_specrequest_nameresponse_namerequest_valueresponse_valueresponse_attributecontrolsconfig)selfr   r   s      W/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/ldap3/extend/operation.py__init__zExtendedOperation.__init__    sW    $ $ !!""&     c                 V   | j                   j                  r| j                   j                  j                  x| j                   j                  j                  j                  N| j                   j                  j                  j                  D ]  }|d   | j
                  k(  s n t        d      | j                   j                  | j
                  | j                  | j                        }| j                   j                  j                  s| j                   j                  |      \  }}n>| j                   j                  j                  r|\  }}}}n| j                   j                  }|| _        | j                  |       | j!                          | j#                          | j$                  S )N    z1extension not in DSA list of supported extensions)r   check_namesserverinfosupported_extensionsr   r   extendedr   r   strategysyncget_responsethread_safer   decode_responsepopulate_resultset_responser   )r   r   resp_r   s        r   sendzExtendedOperation.send-   sS   ??&&4??+A+A+F+F+RW[WfWfWmWmWrWr  XH  XH  XT $ 6 6 ; ; P P ^?d&7&77^ ))\]]''(9(94;M;Mt}}]'',,44T:IAv''33"&61a//V$"""r   c                      y r
    r   s    r   r&   z!ExtendedOperation.populate_resultC       r   c                    |s| j                   }|sy |d   t        fvr1| j                  j                  rt	        d|d   z   dz   |d   z         y | j
                  r|d   | j
                  k(  rY|d   rS| j                  <t        j                  |d   | j                        \  }}|rt	        d	      || _	        y |d   | _	        y y t	        d
      )Nr   zextended operation error: descriptionz - messageresponseNameresponseValue)asn1Specz&error decoding extended response valuezinvalid response name received)
r   r   r   raise_exceptionsr   r   r   r   decoder   )r   responsedecodedunprocesseds       r   r%   z!ExtendedOperation.decode_responseF   s    {{HHn%55//()EQ^H_)_bg)gjrs|j})}~~!!Xn%=ASAS%S(>>-+2>>(?:S^b^l^l+m(G["01YZZ,3D),4_,ED) ) %%EFFr   c                    | j                   r1| j                  | j                   v r| j                   | j                     nd | _        | j                  j                  j
                  s| j                  | j                  _        y y r
   )r   r   r   r   r!   r$   r7   r-   s    r   r'   zExtendedOperation.set_response\   se    FJkkVZVmVmquq|q|V|dkk$*A*AB  CG''33'+':':DOO$ 4r   c                      y r
   r,   r-   s    r   r   zExtendedOperation.configa   r.   r   r
   )	__name__
__module____qualname__r   r*   r&   r%   r'   r   r,   r   r   r   r      s!    #,G,;
r   r   N)	__doc__core.resultsr   core.exceptionsr   
utils.asn1r   objectr   r,   r   r   <module>rD      s#   2 * 0  C Cr   