HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/lib64/python3.9/site-packages/gssapi/__pycache__/mechs.cpython-39.pyc
a

��_
�@s^ddlZddlmZddlmZddlmZddlm	Z	ed�Z
ed�ZGdd	�d	ej�Z
dS)
�N)�oids)�import_gssapi_extension)�misc)�_utils�rfc5587�rfc5801cs�eZdZdZd#�fdd�	Zedd��Zedd��Zed	d
��Zdd�Z	d
d�Z
dd�Zdd�Zedd��Z
edd��Zedd��Zedd��Zedd��Zed$dd��Zed%dd ��Zed&d!d"��Z�ZS)'�	Mechanisma0
    A GSSAPI Mechanism

    This class represents a mechanism and centralizes functions dealing with
    mechanisms and can be used with any calls.

    It inherits from the low-level GSSAPI :class:`~gssapi.raw.oids.OID` class,
    and thus can be used with both low-level and high-level API calls.
    Ncstt|��|||�S�N)�superr�__new__)�clsZcpy�elements��	__class__��2/usr/lib64/python3.9/site-packages/gssapi/mechs.pyrszMechanism.__new__cCs
t�|�S)zH
        Get the set of name types supported by this mechanism.
        )�rmiscZinquire_names_for_mech��selfrrr�
name_typesszMechanism.name_typescCstdurtd��t�|�S)N�=Your GSSAPI implementation does not have support for RFC 5801)r�NotImplementedErrorZinquire_saslname_for_mechrrrr�	_saslname szMechanism._saslnamecCstdurtd��t�|�S)N�=Your GSSAPI implementation does not have support for RFC 5587)rrZinquire_attrs_for_mechrrrr�_attrs'szMechanism._attrscCs*tttj�r|���t���S|��SdSr	)�
issubclass�str�six�	text_type�_bytes_desc�decoder�
_get_encodingrrrr�__str__/szMechanism.__str__cCs|���t���Sr	)rr rr!rrrr�__unicode__6szMechanism.__unicode__cCsB|j}tdur$|jr$|jjr$|jj}t|tj�r>|�t�	��}|Sr	)
�dotted_formrr�	mech_name�
isinstancerr�encoderr!�r�baserrrr9szMechanism._bytes_desccCs.d|j}tdur*d|jj�d�|jf}|S)zL
        Get a name representing the mechanism; always safe to call
        z<Mechanism (%s)>Nz<Mechanism %s (%s)>�UTF-8)r$rrr%r r(rrr�__repr__Cs
�zMechanism.__repr__cCs|jj�d�S)zV
        Get the SASL name for the mechanism

        :requires-ext:`rfc5801`
        r*)rZsasl_mech_namer rrrr�	sasl_namePszMechanism.sasl_namecCs|jj�d�S)zW
        Get the description of the mechanism

        :requires-ext:`rfc5801`
        r*)rZmech_descriptionr rrrr�descriptionYszMechanism.descriptioncCs|jjS)z�
        Get the known attributes of the mechanism; returns a set of OIDs
        ([OID])

        :requires-ext:`rfc5587`
        )rZknown_mech_attrsrrrr�known_attrsbszMechanism.known_attrscCs|jjS)zu
        Get the attributes of the mechanism; returns a set of OIDs ([OID])

        :requires-ext:`rfc5587`
        )rZ
mech_attrsrrrr�attrslszMechanism.attrscs�fdd�t��D�S)zG
        Get a generator of all mechanisms supported by GSSAPI
        c3s|]}�|�VqdSr	r��.0Zmech�rrr�	<genexpr>z�z&Mechanism.all_mechs.<locals>.<genexpr>)rZindicate_mechsr2rr2r�	all_mechsuszMechanism.all_mechscs�fdd�t�|�D�S)a
        Get a generator of mechanisms that may be able to process the name

        Args:
            name (Name): a name to inquire about

        Returns:
            [Mechanism]: a set of mechanisms which support this name

        Raises:
            GSSError
        c3s|]}�|�VqdSr	rr0r2rrr3�r4z&Mechanism.from_name.<locals>.<genexpr>)rZinquire_mechs_for_name)r�namerr2r�	from_name|szMechanism.from_namecCs<tdurtd��t|tj�r*|�t���}t�|�}||�S)a
        Create a Mechanism from its SASL name

        Args:
            name (str): SASL name of the desired mechanism

        Returns:
            Mechanism: the desired mechanism

        Raises:
            GSSError

        :requires-ext:`rfc5801`
        Nr)	rrr&rrr'rr!Zinquire_mech_for_saslname)rr6�mrrr�from_sasl_name�s
zMechanism.from_sasl_namecsrt|tj�rt|g�}t|tj�r,t|g�}t|tj�rBt|g�}tdurRtd��t�|||�}�fdd�|D�S)a�
        Get a generator of mechanisms supporting the specified attributes. See
        RFC 5587's :func:`indicate_mechs_by_attrs` for more information.

        Args:
            desired_attrs ([OID]): Desired attributes
            except_attrs ([OID]): Except attributes
            critical_attrs ([OID]): Critical attributes

        Returns:
            [Mechanism]: A set of mechanisms having the desired features.

        Raises:
            GSSError

        :requires-ext:`rfc5587`
        Nrc3s|]}�|�VqdSr	rr0r2rrr3�r4z'Mechanism.from_attrs.<locals>.<genexpr>)r&�roids�OID�setrrZindicate_mechs_by_attrs)rZ
desired_attrsZexcept_attrsZcritical_attrsZmechsrr2r�
from_attrs�s


�zMechanism.from_attrs)NN)N)N)NNN)�__name__�
__module__�__qualname__�__doc__r�propertyrrrr"r#rr+r,r-r.r/�classmethodr5r7r9r=�
__classcell__rrrrrs<	







	

�r)rZ
gssapi.rawrr:Z
gssapi._utilsrrrZgssapirrrr;rrrrr�<module>s