403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/contrib/auth/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/contrib/auth/__pycache__/password_validation.cpython-311.pyc
�

�|�e�"��n�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZddl
mZddlmZmZddlmZdd	lmZmZejd�
��d���Zd�Zdd
�Zdd�Zdd�Zdd�Zeee��Z Gd�d��Z!d�Z"Gd�d��Z#Gd�d��Z$Gd�d��Z%dS)�N)�SequenceMatcher)�Path)�settings)�FieldDoesNotExist�ImproperlyConfigured�ValidationError)�lazy)�format_html�format_html_join)�
import_string)�gettext�ngettext)�maxsizec�4�ttj��S�N)�get_password_validatorsr�AUTH_PASSWORD_VALIDATORS���I/usr/lib/python3/dist-packages/django/contrib/auth/password_validation.py�get_default_password_validatorsrs��"�8�#D�E�E�Erc���g}|D]p}	t|d��}n(#t$rd}t||dz���wxYw|�|di|�di�������q|S)N�NAMEzZThe module in NAME could not be imported: %s. Check your AUTH_PASSWORD_VALIDATORS setting.�OPTIONSr)r�ImportErrorr�append�get)�validator_config�
validators�	validator�klass�msgs     rrrs����J�%�A�A�	�	@�!�)�F�"3�4�4�E�E���	@�	@�	@�n�C�&�s�Y�v�->�'>�?�?�?�	@����	���%�%�?�?�)�-�-�	�2�">�">�?�?�@�@�@�@��s	��%Ac���g}|�t��}|D]E}	|�||���#t$r}|�|��Yd}~�>d}~wwxYw|rt|���dS)z�
    Validate whether the password meets all validator requirements.

    If the password is valid, return ``None``.
    If the password is invalid, raise ValidationError with all error messages.
    N)r�validaterr)�password�user�password_validators�errorsr �errors      r�validate_passwordr*#s����F��"�=�?�?��(�!�!�	�	!����x��.�.�.�.���	!�	!�	!��M�M�%� � � � � � � � �����	!����
�&��f�%�%�%�&�&s�/�
A�A�Ac�l�|�t��}|D] }t|dd���}|||���!dS)zy
    Inform all validators that have implemented a password_changed() method
    that the password has been changed.
    N�password_changedc��dSrr)�as r�<lambda>z"password_changed.<locals>.<lambda>>s��T�r)r�getattr)r%r&r'r r,s     rr,r,6sZ��
�"�=�?�?��(�)�)�	�"�9�.@�/�/�R�R�����4�(�(�(�(�)�)rc��g}|�t��}|D])}|�|������*|S)zG
    Return a list of all help texts of all configured validators.
    )rr�
get_help_text)r'�
help_textsr s   r�password_validators_help_textsr4BsS���J��"�=�?�?��(�5�5�	����)�1�1�3�3�4�4�4�4��rc�~�t|��}tddd�|D����}|rtd|��ndS)z`
    Return an HTML string with all help texts of all configured validators
    in an <ul>.
    �z<li>{}</li>c3�K�|]}|fV��dSrr)�.0�	help_texts  r�	<genexpr>z6_password_validators_help_text_html.<locals>.<genexpr>Ts$����5_�5_�y�y�l�5_�5_�5_�5_�5_�5_rz<ul>{}</ul>)r4rr
)r'r3�
help_itemss   r�#_password_validators_help_text_htmlr<NsM��
0�0C�D�D�J�!�"�m�5_�5_�T^�5_�5_�5_�`�`�J�5?�G�;�}�j�1�1�1�R�Grc�(�eZdZdZdd�Zdd�Zd�ZdS)	�MinimumLengthValidatorz?
    Validate whether the password is of a minimum length.
    �c��||_dSr)�
min_length)�selfrAs  r�__init__zMinimumLengthValidator.__init___s
��$����rNc��t|��|jkr-ttdd|j��dd|ji����dS)NzNThis password is too short. It must contain at least %(min_length)d character.zOThis password is too short. It must contain at least %(min_length)d characters.�password_too_shortrA��code�params)�lenrArr�rBr%r&s   rr$zMinimumLengthValidator.validatebs[���x�=�=�4�?�*�*�!��d�e��O���
*�$�d�o�6����
�+�*rc�B�tdd|j��d|jizS)Nz=Your password must contain at least %(min_length)d character.z>Your password must contain at least %(min_length)d characters.rA)rrA�rBs rr2z$MinimumLengthValidator.get_help_textns0���K�L��O�
�
��4�?�+�	,�	,r)r?r)�__name__�
__module__�__qualname__�__doc__rCr$r2rrrr>r>[sU��������%�%�%�%�
�
�
�
�,�,�,�,�,rr>c�l�t|��}|dz|z}t|��}|d|zko||kS)a�
    Test that value is within a reasonable range of password.

    The following ratio calculations are based on testing SequenceMatcher like
    this:

    for i in range(0,6):
      print(10**i, SequenceMatcher(a='A', b='A'*(10**i)).quick_ratio())

    which yields:

    1 1.0
    10 0.18181818181818182
    100 0.019801980198019802
    1000 0.001998001998001998
    10000 0.00019998000199980003
    100000 1.999980000199998e-05

    This means a length_ratio of 10 should never yield a similarity higher than
    0.2, for 100 this is down to 0.02 and for 1000 it is 0.002. This can be
    calculated via 2 / length_ratio. As a result we avoid the potentially
    expensive sequence matching.
    ��
)rI)r%�max_similarity�value�pwd_len�length_bound_similarity�	value_lens      r�exceeds_maximum_length_ratiorYvsD��0�(�m�m�G�,�q�0�7�:���E�
�
�I��b�9�n�$�L��5L�)L�Lrc�0�eZdZdZdZedfd�Zdd�Zd�ZdS)	� UserAttributeSimilarityValidatora�
    Validate whether the password is sufficiently different from the user's
    attributes.

    If no specific attributes are provided, look at a sensible list of
    defaults. Attributes that don't exist are ignored. Comparison is made to
    not only the full attribute value, but also its components, so that, for
    example, a password is validated against either part of an email address,
    as well as the full address.
    )�username�
first_name�	last_name�emailgffffff�?c�L�||_|dkrtd���||_dS)Ng�������?z#max_similarity must be at least 0.1)�user_attributes�
ValueErrorrT)rBrarTs   rrCz)UserAttributeSimilarityValidator.__init__�s2��.����C����B�C�C�C�,����rNc�L�|sdS|���}|jD�]}t||d��}|rt|t��s�,|���}tjd|��|gz}|D]�}t||j|��r�t||����
��|jkra	t	|j�|��j
��}n#t$r|}YnwxYwtt!d��dd|i��������dS)Nz\W+)r.�bz4The password is too similar to the %(verbose_name)s.�password_too_similar�verbose_namerF)�lowerrar0�
isinstance�str�re�splitrYrTr�quick_ratio�_meta�	get_fieldrfrr�_)	rBr%r&�attribute_namerU�value_lower�value_parts�
value_partrfs	         rr$z)UserAttributeSimilarityValidator.validate�s`���	��F��>�>�#�#��"�2�	�	�N��D�.�$�7�7�E��
�
�5�#� 6� 6�
���+�+�-�-�K��(�6�;�7�7�;�-�G�K�)�
�
�
�/��$�:M�z�Z�Z���"�X��<�<�<�H�H�J�J�d�Na�a�a�6�'*�4�:�+?�+?��+O�+O�+\�']�']����,�6�6�6�'5����6����)��P�Q�Q�3� .��=�����b�
�
	�	s�,C.�.C=�<C=c� �td��S)NuHYour password can’t be too similar to your other personal information.�rorLs rr2z.UserAttributeSimilarityValidator.get_help_text�s���[�\�\�\rr)rMrNrOrP�DEFAULT_USER_ATTRIBUTESrCr$r2rrrr[r[�sh������	�	�O��'>�s�-�-�-�-�����2]�]�]�]�]rr[c�t�eZdZdZee�����jdzZefd�Z	dd�Z
d�ZdS)�CommonPasswordValidatora�
    Validate whether the password is a common password.

    The password is rejected if it occurs in a provided list of passwords,
    which may be gzipped. The list Django ships with contains 20000 common
    passwords (lowercased and deduplicated), created by Royce Williams:
    https://gist.github.com/roycewilliams/281ce539915a947a23db17137d91aeb7
    The password list must be lowercased to match the comparison in validate().
    zcommon-passwords.txt.gzc� �	tj|dd���5}d�|D��|_ddd��dS#1swxYwYdS#t$r>t|��5}d�|D��|_ddd��YdS#1swxYwYYdSwxYw)N�rtzutf-8)�encodingc�6�h|]}|�����Sr��strip�r8�xs  r�	<setcomp>z3CommonPasswordValidator.__init__.<locals>.<setcomp>�� ��!7�!7�!7��!�'�'�)�)�!7�!7�!7rc�6�h|]}|�����Srr}rs  rr�z3CommonPasswordValidator.__init__.<locals>.<setcomp>�r�r)�gzip�open�	passwords�OSError)rB�password_list_path�fs   rrCz CommonPasswordValidator.__init__�s?��	8���-�t�g�F�F�F�
8�!�!7�!7�Q�!7�!7�!7���
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8�
8�
8���	8�	8�	8��(�)�)�
8�Q�!7�!7�Q�!7�!7�!7���
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8�
8�
8�
8�	8���sQ�A�8�A�<�A�<�A�B
�A>�0B
�>B	�B
�B	�B
�B
Nc��|������|jvrtt	d��d����dS)NzThis password is too common.�password_too_common�rG)rgr~r�rrorJs   rr$z CommonPasswordValidator.validate�sS���>�>���!�!�#�#�t�~�5�5�!��0�1�1�*����
�6�5rc� �td��S)Nu2Your password can’t be a commonly used password.rurLs rr2z%CommonPasswordValidator.get_help_text�s���E�F�F�Frr)rMrNrOrPr�__file__�resolve�parent�DEFAULT_PASSWORD_LIST_PATHrCr$r2rrrrxrx�s���������"&��h���!7�!7�!9�!9�!@�C\�!\��*D�8�8�8�8�����G�G�G�G�Grrxc� �eZdZdZdd�Zd�ZdS)�NumericPasswordValidatorz8
    Validate whether the password is alphanumeric.
    Nc�j�|���rttd��d����dS)Nz"This password is entirely numeric.�password_entirely_numericr�)�isdigitrrorJs   rr$z!NumericPasswordValidator.validate�sF�������	�!��6�7�7�0����
�	�	rc� �td��S)Nu*Your password can’t be entirely numeric.rurLs rr2z&NumericPasswordValidator.get_help_text�s���=�>�>�>rr)rMrNrOrPr$r2rrrr�r��sA������������?�?�?�?�?rr�)NNr)&�	functoolsr�rj�difflibr�pathlibr�django.confr�django.core.exceptionsrrr�django.utils.functionalr	�django.utils.htmlr
r�django.utils.module_loadingr�django.utils.translationr
ror�	lru_cacherrr*r,r4r<ri�"password_validators_help_text_htmlr>rYr[rxr�rrr�<module>r�sU����������	�	�	�	�#�#�#�#�#�#������� � � � � � �����������)�(�(�(�(�(�;�;�;�;�;�;�;�;�5�5�5�5�5�5�;�;�;�;�;�;�;�;����T�"�"�"�F�F�#�"�F�
�
�
�&�&�&�&�&	)�	)�	)�	)�	�	�	�	�H�H�H�H�&*�T�*M�s�%S�%S�"�,�,�,�,�,�,�,�,�6M�M�M�<-]�-]�-]�-]�-]�-]�-]�-]�`G�G�G�G�G�G�G�G�>?�?�?�?�?�?�?�?�?�?r

Youez - 2016 - github.com/yon3zu
LinuXploit