HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //proc/self/root/lib64/python3.6/site-packages/ldap/controls/__pycache__/sss.cpython-36.pyc
3

�`a0�@s�dZddgZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZm
Z
mZmZmZddlmZmZejdd	kZes�eZGd
d�dej�ZGdd
�d
ej�ZGdd�de�ZGdd�dej�ZGdd�de�Zee	ej<dS)z{
ldap.controls.sss - classes for Server Side Sorting
(see RFC 2891)

See https://www.python-ldap.org/ for project details.
�SSSRequestControl�SSSResponseControl�N)�
LDAPObject)�RequestControl�ResponseControl�KNOWN_RESPONSE_CONTROLS�DecodeControlTuples)�univ�	namedtype�tag�namedval�
constraint)�encoder�decoder�c
@sleZdZejejdej��ejdej�j	e
je
je
j
d�d��ejdejd�j	e
je
je
j
d�d���ZdS)	�SortKeyType�
attributeType�orderingRuler)�implicitTag�reverseOrderF�N)�__name__�
__module__�__qualname__r
�
NamedTypes�	NamedTyper	�OctetString�OptionalNamedType�subtyper�Tag�tagClassContext�tagFormatSimpleZDefaultedNamedTypeZBoolean�
componentType�r#r#�/usr/lib64/python3.6/sss.pyr$src@seZdZe�ZdS)�SortKeyListTypeN)rrrrr"r#r#r#r$r%0sr%c@s.eZdZdZdZddd�Zdd�Zd	d
�ZdS)rzXOrder result server side

        >>> s = SSSRequestControl(ordering_rules=['-cn'])
    z1.2.840.113556.1.4.473FNcCsVtj||j|�||_t|t�r&|g}x*|D]"}|jd�}t|�dks,td��q,WdS)N�:�z=syntax for ordering rule: [-]<attribute-type>[:ordering-rule])	r�__init__�controlType�ordering_rules�
isinstance�
basestring�split�len�AssertionError)�self�criticalityr*�ruler#r#r$r(;s


zSSSRequestControl.__init__cCs�t�}x�t|j�D]�\}}t�}|jd�}|r:|dd�}d|krR|jd�\}}n
|d}}|jd|�|rx|jd|�|r�|jdd�|j||�qW|S)N�-rr&rrr)r%�	enumerater*r�
startswithr-ZsetComponentByNameZsetComponentByPosition)r0�p�ir2�qZ
reverse_order�attribute_typeZ
ordering_ruler#r#r$�asn1Hs 

zSSSRequestControl.asn1cCstj|j��S)N)r�encoder:)r0r#r#r$�encodeControlValue[sz$SSSRequestControl.encodeControlValue)FN)rrr�__doc__r)r(r:r<r#r#r#r$r4s

c@s�eZdZejejdej�je	j
ddddd d!d"d#d$d%d&�ejjej
dddd	dd
ddddd�d��ejdej�jejejejd�d���ZdS)'�SortResultType�
sortResult�successr�operationsErrorr�timeLimitExceededr'�strongAuthRequired��adminLimitExceeded��noSuchAttribute��inappropriateMatching��insufficientAccessRights�2�busy�3�unwillingToPerform�5�other�P)ZnamedValues�subtypeSpecr)rN)r@r)rAr)rBr')rCrD)rErF)rGrH)rIrJ)rKrL)rMrN)rOrP)rQrR)rrrr
rrr	Z
EnumeratedrrZNamedValuesrSr
ZSingleValueConstraintrrrrr r!r"r#r#r#r$r>_s&
 r>c@s"eZdZdZddd�Zdd�ZdS)	rz1.2.840.113556.1.4.474FcCstj||j|�dS)N)rr(r))r0r1r#r#r$r(zszSSSResponseControl.__init__cCsjtj|t�d�\}}|s"td��|jd�}t|�|_|jd�}|j�rP||_nd|_|j|_	|j|_
dS)N)Zasn1Speczall data could not be decodedr?r)r�decoder>r/ZgetComponentByName�intr?ZhasValuer�resultZattribute_type_error)r0Zencodedr6�restZsort_resultr9r#r#r$�decodeControlValue}s


z%SSSResponseControl.decodeControlValueN)F)rrrr)r(rXr#r#r#r$rws
) r=�__all__�sysZldapZldap.ldapobjectrZ
ldap.controlsrrrrZpyasn1.typer	r
rrr
Zpyasn1.codec.berrr�version_infoZPY2�strr,�SequencerZ
SequenceOfr%rr>rr)r#r#r#r$�<module>s"	+