o
    jA                     @   s  d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 ddl4Z4G dd de5Z6G dd	 d	e6Z7G d
d de7Z8G dd de7Z9G dd de7Z:G dd de7Z;G dd de7Z<G dd de7Z=G dd de7Z>G dd de7Z?G dd de7Z@G dd de7ZAG dd de7ZBG d d! d!e7ZCG d"d# d#e7ZDG d$d% d%e7ZEG d&d' d'e7ZFG d(d) d)e7ZGG d*d+ d+e7ZHG d,d- d-e7ZIG d.d/ d/e7ZJG d0d1 d1e7ZKG d2d3 d3e7ZLG d4d5 d5e7ZMG d6d7 d7e7ZNG d8d9 d9e7ZOG d:d; d;e7ZPG d<d= d=e7ZQG d>d? d?e7ZRG d@dA dAe7ZSG dBdC dCe7ZTG dDdE dEe7ZUG dFdG dGe7ZVG dHdI dIe7ZWG dJdK dKe7ZXG dLdM dMe7ZYG dNdO dOe7ZZG dPdQ dQe7Z[G dRdS dSe7Z\G dTdU dUe7Z]G dVdW dWe7Z^G dXdY dYe7Z_G dZd[ d[e7Z`G d\d] d]e7ZaG d^d_ d_e7ZbG d`da dae7ZcG dbdc dce7ZdG ddde dee7ZeG dfdg dge7ZfG dhdi die7Zgi ee8ee9ee:ee;ee<ee=e	e>e
e?ee@eeAeeBeeCeeDeeEeeFeeGeeHi eeIeeJeeKeeLe3eMeeNe#eOe(ePe*eQe,eReeSe"eTe$eUe+eVe2eWeeXe!eYe)eZe-e[e1e\ee]e e^e'e_e.e`eeaeebe%ece&ede/eee0efeegiZhG djdk dke6ZiG dldm dmeiZjG dndo doejZkG dpdq dqejZlG drds dsejZmG dtdu duejZnG dvdw dwejeoZpG dxdy dyejZqG dzd{ d{eieresZtG d|d} d}eieuZvG d~d deieuewZxG dd deiZyG dd deyesZzG dd deiZ{G dd deieoZ|G dd deiZ}G dd deieuZ~G dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deieuZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deieuZG dd deieuZG dd deieuZG dd deieuZG dd deieuZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG dd deiZG ddÄ deiZG ddń deiZG ddǄ deiZG ddɄ deiZG dd˄ deZG dd̈́ deZG ddτ dee4jZG ddф dee4jZG ddӄ deZG ddՄ deZG ddׄ deZG ddل deZG ddۄ deiZG dd݄ deiZG dd߄ deiZdd Zdd ZdS )
    )sep   )0RESULT_OPERATIONS_ERRORRESULT_PROTOCOL_ERRORRESULT_TIME_LIMIT_EXCEEDEDRESULT_SIZE_LIMIT_EXCEEDEDRESULT_STRONGER_AUTH_REQUIREDRESULT_REFERRALRESULT_ADMIN_LIMIT_EXCEEDED%RESULT_UNAVAILABLE_CRITICAL_EXTENSION RESULT_AUTH_METHOD_NOT_SUPPORTEDRESULT_UNDEFINED_ATTRIBUTE_TYPERESULT_NO_SUCH_ATTRIBUTERESULT_SASL_BIND_IN_PROGRESSRESULT_CONFIDENTIALITY_REQUIREDRESULT_INAPPROPRIATE_MATCHINGRESULT_CONSTRAINT_VIOLATION RESULT_ATTRIBUTE_OR_VALUE_EXISTSRESULT_INVALID_ATTRIBUTE_SYNTAXRESULT_NO_SUCH_OBJECTRESULT_ALIAS_PROBLEMRESULT_INVALID_DN_SYNTAX"RESULT_ALIAS_DEREFERENCING_PROBLEMRESULT_INVALID_CREDENTIALSRESULT_LOOP_DETECTEDRESULT_ENTRY_ALREADY_EXISTSRESULT_LCUP_SECURITY_VIOLATIONRESULT_CANCELEDRESULT_E_SYNC_REFRESH_REQUIREDRESULT_NO_SUCH_OPERATIONRESULT_LCUP_INVALID_DATA#RESULT_OBJECT_CLASS_MODS_PROHIBITEDRESULT_NAMING_VIOLATION!RESULT_INSUFFICIENT_ACCESS_RIGHTSRESULT_OBJECT_CLASS_VIOLATIONRESULT_TOO_LATERESULT_CANNOT_CANCELRESULT_LCUP_UNSUPPORTED_SCHEMERESULT_BUSYRESULT_AFFECT_MULTIPLE_DSASRESULT_UNAVAILABLERESULT_NOT_ALLOWED_ON_NON_LEAFRESULT_UNWILLING_TO_PERFORMRESULT_OTHERRESULT_LCUP_RELOAD_REQUIREDRESULT_ASSERTION_FAILEDRESULT_AUTHORIZATION_DENIEDRESULT_LCUP_RESOURCES_EXHAUSTEDRESULT_NOT_ALLOWED_ON_RDN#RESULT_INAPPROPRIATE_AUTHENTICATIONNc                   @      e Zd ZdS )LDAPExceptionN__name__
__module____qualname__ r;   r;   /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/ldap3/core/exceptions.pyr6   .       r6   c                       s8   e Zd Zd
 fdd	Zd
ddZdd Zdd	 Z  ZS )LDAPOperationResultNc                    sh   | t u r*|r*|tv r*tt t| t| }||_||_||_||_||_||_	|S tt | | }|S N)
r>   exception_tablesuper__new__resultdescriptiondnmessagetyperesponse)clsrC   rD   rE   rF   response_typerH   exc	__class__r;   r<   rB   3   s   zLDAPOperationResult.__new__c                 C   s(   || _ || _|| _|| _|| _|| _d S r?   )rC   rD   rE   rF   rG   rH   )selfrC   rD   rE   rF   rJ   rH   r;   r;   r<   __init__A   s   
zLDAPOperationResult.__init__c                    sz   | j j| jrt| jnd | jr| jnd | jr| jnd | jr | jnd | jr'| jnd | jr.| jnd g d	 fdd D S )Nz - c                    s   g | ]
} d urt |qS r?   )str).0itemsr;   r<   
<listcomp>R   s    z/LDAPOperationResult.__str__.<locals>.<listcomp>)
rM   r8   rC   rP   rD   rE   rF   rG   rH   joinrN   r;   rS   r<   __str__I   s   zLDAPOperationResult.__str__c                 C   s   |   S r?   )rX   rW   r;   r;   r<   __repr__T   s   zLDAPOperationResult.__repr__)NNNNNN)r8   r9   r:   rB   rO   rX   rY   __classcell__r;   r;   rL   r<   r>   2   s
    
r>   c                   @   r5   )LDAPOperationsErrorResultNr7   r;   r;   r;   r<   r[   X   r=   r[   c                   @   r5   )LDAPProtocolErrorResultNr7   r;   r;   r;   r<   r\   \   r=   r\   c                   @   r5   )LDAPTimeLimitExceededResultNr7   r;   r;   r;   r<   r]   `   r=   r]   c                   @   r5   )LDAPSizeLimitExceededResultNr7   r;   r;   r;   r<   r^   d   r=   r^   c                   @   r5   ) LDAPAuthMethodNotSupportedResultNr7   r;   r;   r;   r<   r_   h   r=   r_   c                   @   r5   )LDAPStrongerAuthRequiredResultNr7   r;   r;   r;   r<   r`   l   r=   r`   c                   @   r5   )LDAPReferralResultNr7   r;   r;   r;   r<   ra   p   r=   ra   c                   @   r5   )LDAPAdminLimitExceededResultNr7   r;   r;   r;   r<   rb   t   r=   rb   c                   @   r5   )&LDAPUnavailableCriticalExtensionResultNr7   r;   r;   r;   r<   rc   x   r=   rc   c                   @   r5   )!LDAPConfidentialityRequiredResultNr7   r;   r;   r;   r<   rd   |   r=   rd   c                   @   r5   )LDAPSASLBindInProgressResultNr7   r;   r;   r;   r<   re      r=   re   c                   @   r5   )LDAPNoSuchAttributeResultNr7   r;   r;   r;   r<   rf      r=   rf   c                   @   r5   ) LDAPUndefinedAttributeTypeResultNr7   r;   r;   r;   r<   rg      r=   rg   c                   @   r5   )LDAPInappropriateMatchingResultNr7   r;   r;   r;   r<   rh      r=   rh   c                   @   r5   )LDAPConstraintViolationResultNr7   r;   r;   r;   r<   ri      r=   ri   c                   @   r5   ) LDAPAttributeOrValueExistsResultNr7   r;   r;   r;   r<   rj      r=   rj   c                   @   r5   ) LDAPInvalidAttributeSyntaxResultNr7   r;   r;   r;   r<   rk      r=   rk   c                   @   r5   )LDAPNoSuchObjectResultNr7   r;   r;   r;   r<   rl      r=   rl   c                   @   r5   )LDAPAliasProblemResultNr7   r;   r;   r;   r<   rm      r=   rm   c                   @   r5   )LDAPInvalidDNSyntaxResultNr7   r;   r;   r;   r<   rn      r=   rn   c                   @   r5   )#LDAPAliasDereferencingProblemResultNr7   r;   r;   r;   r<   ro      r=   ro   c                   @   r5   )%LDAPInappropriateAuthenticationResultNr7   r;   r;   r;   r<   rp      r=   rp   c                   @   r5   )LDAPInvalidCredentialsResultNr7   r;   r;   r;   r<   rq      r=   rq   c                   @   r5   )"LDAPInsufficientAccessRightsResultNr7   r;   r;   r;   r<   rr      r=   rr   c                   @   r5   )LDAPBusyResultNr7   r;   r;   r;   r<   rs      r=   rs   c                   @   r5   )LDAPUnavailableResultNr7   r;   r;   r;   r<   rt      r=   rt   c                   @   r5   )LDAPUnwillingToPerformResultNr7   r;   r;   r;   r<   ru      r=   ru   c                   @   r5   )LDAPLoopDetectedResultNr7   r;   r;   r;   r<   rv      r=   rv   c                   @   r5   )LDAPNamingViolationResultNr7   r;   r;   r;   r<   rw      r=   rw   c                   @   r5   )LDAPObjectClassViolationResultNr7   r;   r;   r;   r<   rx      r=   rx   c                   @   r5   )LDAPNotAllowedOnNotLeafResultNr7   r;   r;   r;   r<   ry      r=   ry   c                   @   r5   )LDAPNotAllowedOnRDNResultNr7   r;   r;   r;   r<   rz      r=   rz   c                   @   r5   )LDAPEntryAlreadyExistsResultNr7   r;   r;   r;   r<   r{      r=   r{   c                   @   r5   )#LDAPObjectClassModsProhibitedResultNr7   r;   r;   r;   r<   r|      r=   r|   c                   @   r5   )LDAPAffectMultipleDSASResultNr7   r;   r;   r;   r<   r}      r=   r}   c                   @   r5   )LDAPOtherResultNr7   r;   r;   r;   r<   r~      r=   r~   c                   @   r5   ) LDAPLCUPResourcesExhaustedResultNr7   r;   r;   r;   r<   r      r=   r   c                   @   r5   )LDAPLCUPSecurityViolationResultNr7   r;   r;   r;   r<   r      r=   r   c                   @   r5   )LDAPLCUPInvalidDataResultNr7   r;   r;   r;   r<   r      r=   r   c                   @   r5   )LDAPLCUPUnsupportedSchemeResultNr7   r;   r;   r;   r<   r      r=   r   c                   @   r5   )LDAPLCUPReloadRequiredResultNr7   r;   r;   r;   r<   r      r=   r   c                   @   r5   )LDAPCanceledResultNr7   r;   r;   r;   r<   r      r=   r   c                   @   r5   )LDAPNoSuchOperationResultNr7   r;   r;   r;   r<   r      r=   r   c                   @   r5   )LDAPTooLateResultNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPCannotCancelResultNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPAssertionFailedResultNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPAuthorizationDeniedResultNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPESyncRefreshRequiredResultNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPExceptionErrorNr7   r;   r;   r;   r<   r   J  r=   r   c                   @   r5   )LDAPConfigurationErrorNr7   r;   r;   r;   r<   r   O  r=   r   c                   @   r5   )LDAPUnknownStrategyErrorNr7   r;   r;   r;   r<   r   S  r=   r   c                   @   r5   )$LDAPUnknownAuthenticationMethodErrorNr7   r;   r;   r;   r<   r   W  r=   r   c                   @   r5   )LDAPSSLConfigurationErrorNr7   r;   r;   r;   r<   r   [  r=   r   c                   @   r5   )LDAPDefinitionErrorNr7   r;   r;   r;   r<   r   _  r=   r   c                   @   r5   )LDAPPackageUnavailableErrorNr7   r;   r;   r;   r<   r   c  r=   r   c                   @   r5   )LDAPConfigurationParameterErrorNr7   r;   r;   r;   r<   r   g  r=   r   c                   @   r5   )LDAPKeyErrorNr7   r;   r;   r;   r<   r   l  r=   r   c                   @   r5   )LDAPObjectErrorNr7   r;   r;   r;   r<   r   p  r=   r   c                   @   r5   )LDAPAttributeErrorNr7   r;   r;   r;   r<   r   t  r=   r   c                   @   r5   )LDAPCursorErrorNr7   r;   r;   r;   r<   r   x  r=   r   c                   @   r5   )LDAPCursorAttributeErrorNr7   r;   r;   r;   r<   r   |  r=   r   c                   @   r5   )LDAPObjectDereferenceErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPSSLNotSupportedErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   ) LDAPInvalidTlsSpecificationErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInvalidHashAlgorithmErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )$LDAPSignatureVerificationFailedErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPBindErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInvalidServerErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )"LDAPSASLMechanismNotSupportedErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPConnectionIsReadOnlyErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPChangeErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPServerPoolErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPServerPoolExhaustedErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInvalidPortErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPStartTLSErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPCertificateErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPUserNameNotAllowedErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPUserNameIsMandatoryErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPPasswordIsMandatoryErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInvalidFilterErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInvalidScopeErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )"LDAPInvalidDereferenceAliasesErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInvalidValueErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPControlErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPExtensionErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPLDIFErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPSchemaErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPSASLPrepErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPSASLBindInProgressErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPMetricsErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPObjectClassErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInvalidDnErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPResponseTimeoutErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPTransactionErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPInfoErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPCommunicationErrorNr7   r;   r;   r;   r<   r   
  r=   r   c                   @   r5   )LDAPSocketOpenErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPSocketCloseErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPSocketReceiveErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPSocketSendErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )"LDAPSessionTerminatedByServerErrorNr7   r;   r;   r;   r<   r     r=   r   c                   @   r5   )LDAPUnknownResponseErrorNr7   r;   r;   r;   r<   r   "  r=   r   c                   @   r5   )LDAPUnknownRequestErrorNr7   r;   r;   r;   r<   r   &  r=   r   c                   @   r5   )LDAPReferralErrorNr7   r;   r;   r;   r<   r   *  r=   r   c                   @   r5   )&LDAPConnectionPoolNameIsMandatoryErrorNr7   r;   r;   r;   r<   r   /  r=   r   c                   @   r5   )!LDAPConnectionPoolNotStartedErrorNr7   r;   r;   r;   r<   r   3  r=   r   c                   @   s   e Zd Zdd ZdS )LDAPMaximumRetriesErrorc                 C   s   g }| j rnt| j trmt| j dkr|dt| j d   t| j dkrZ|d d}t| j d D ]&\}}t||krY|t|dd tt| d t|  t|}q3t| j d	krm|d
t| j d	   nt	
| g}t|S )Nr   zLDAPMaximumRetriesError: r   zException history:     z:    z#Maximum number of retries reached: )args
isinstancetuplelenappendrP   	enumeraterjustrG   r   rX   r   rV   )rN   rT   prev_excirK   r;   r;   r<   rX   9  s$   
0
zLDAPMaximumRetriesError.__str__N)r8   r9   r:   rX   r;   r;   r;   r<   r   8  s    r   c                 C   s@   | j dd t D v rt| j | t|ft S tdt|  )z
    Generates a new exception class of the requested type (subclass of LDAPCommunication) merged with the exception raised by the interpreter
    c                 S   s   g | ]}|j qS r;   )r8   )rQ   rI   r;   r;   r<   rU   V  s    z3communication_exception_factory.<locals>.<listcomp>z"unable to generate exception type )r8   r   __subclasses__rG   dictr   rP   )exc_to_raiserK   r;   r;   r<   communication_exception_factoryR  s   r   c                 C   s   t tjtt | ft S )zs
    Generates a new exception class of the requested type merged with the exception raised by the interpreter
    )rG   r   r8   r   )rK   r;   r;   r<   start_tls_exception_factory\  s   r   )__doc__osr   resultsr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   socket	Exceptionr6   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r@   r   r   r   r   r   r   ImportErrorr   r   KeyErrorAttributeErrorr   
ValueErrorr   	TypeErrorr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   errorr   r   r   r   r   r   r   r   r   r   r   r;   r;   r;   r<   <module>   s   &	
 !"2
