+
    Sj%                     T   ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
HtHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHt ] P2                  R 4       tR tRR ltRR ltRR ltRR lt]! ]] 4      t! ! R R4      t"R t# ! R R4      t$ ! R R4      t% ! R R4      t&R# )    N)SequenceMatcher)Path)settings)FieldDoesNotExistImproperlyConfiguredValidationError)cached_propertylazy)format_htmlformat_html_join)import_string)gettext)ngettextc                  4    \        \        P                  4      # N)get_password_validatorsr   AUTH_PASSWORD_VALIDATORS     \/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/auth/password_validation.pyget_default_password_validatorsr      s    "8#D#DEEr   c                     . pV  F=  p \        VR ,          4      pTP                  T! R/ TP	                  R/ 4      B 4       K?  	  V#   \         d    Rp\        YBR ,          ,          4      hi ; i)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   &    r   r   r      s    J%		@!)F"34E 	%?)--	2">?@ &   	@4  'sv->'>??	@s   A&A.c                    . pVf   \        4       pV F  p VP                  W4       K  	  V'       d   \        V4      hR#   \         d   pTP                  T4        Rp?KP  Rp?ii ; i)z
Validate that 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   validater   r   )passworduserpassword_validatorserrorsr    errors   &&&   r   validate_passwordr*   )   sk     F"=?(		!x. )
 f%%   	!MM%  	!s   AA(A##A(c                `    Vf   \        4       pV F  p\        VRR 4      pV! W4       K  	  R# )zm
Inform all validators that have implemented a password_changed() method
that the password has been changed.
Npassword_changedc                      R # r   r   )as   *r   <lambda>"password_changed.<locals>.<lambda>D   s    Tr   )r   getattr)r%   r&   r'   r    r,   s   &&&  r   r,   r,   <   s5    
 "=?(	"9.@/R( )r   c                v    . pV f   \        4       p V  F"  pVP                  VP                  4       4       K$  	  V# )z?
Return a list of all help texts of all configured validators.
)r   r   get_help_text)r'   
help_textsr    s   &  r   password_validators_help_textsr5   H   s?     J"=?(	)1134 )r   c                l    \        V 4      p\        RRR V 4       4      pV'       d   \        RV4      # R# )zT
Return an HTML string with all help texts of all configured validators
in an <ul>.
 z<li>{}</li>c              3   &   "   T F  q3x  K	  	  R # 5ir   r   ).0	help_texts   & r   	<genexpr>6_password_validators_help_text_html.<locals>.<genexpr>[   s     E*YL*s   z<ul>{}</ul>)r5   r   r   )r'   r4   
help_itemss   &  r   #_password_validators_help_text_htmlr>   T   s=    
 00CDJ!
ME*EJ 6@;}j1GRGr   c                   D   a  ] tR t^ct o RtRR ltR	R ltR tR tRt	V t
R# )
MinimumLengthValidatorz4
Validate that the password is of a minimum length.
c                    Wn         R # r   
min_length)selfrC   s   &&r   __init__MinimumLengthValidator.__init__h   s    $r   Nc                    \        V4      V P                  8  d)   \        V P                  4       R RV P                  /R7      hR# )password_too_shortrC   codeparamsN)lenrC   r   get_error_messagerD   r%   r&   s   &&&r   r$   MinimumLengthValidator.validatek   s?    x=4??*!&&()$doo6  +r   c                R    \        R RV P                  4      V P                  ,          # )zBThis password is too short. It must contain at least %d character.zCThis password is too short. It must contain at least %d characters.r   rC   rD   s   &r   rM   (MinimumLengthValidator.get_error_messages   s*    TU
 oo	
r   c                V    \        R RV P                  4      RV P                  /,          # )z=Your password must contain at least %(min_length)d character.z>Your password must contain at least %(min_length)d characters.rC   rQ   rR   s   &r   r3   $MinimumLengthValidator.get_help_text}   s/    KLOO
 4??+	, 	,r   rB   )   r   )__name__
__module____qualname____firstlineno____doc__rE   r$   rM   r3   __static_attributes____classdictcell____classdict__s   @r   r@   r@   c   s#     %
, ,r   r@   c                ~    \        V 4      pV^,          V,          p\        V4      pV^
V,          8  ;'       d    WT8  # )ay  
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.
)rL   )r%   max_similarityvaluepwd_lenlength_bound_similarity	value_lens   &&&   r   exceeds_maximum_length_ratiorf      s@    0 (mG,q07:E
Ib9n$LL)LLr   c                   L   a  ] tR t^t o RtR	t]R3R ltR
R ltR tR t	Rt
V tR# ) UserAttributeSimilarityValidatora  
Validate that 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.
gffffff?c                B    Wn         VR 8  d   \        R4      hW n        R# )g?z#max_similarity must be at least 0.1N)user_attributes
ValueErrorra   )rD   rj   ra   s   &&&r   rE   )UserAttributeSimilarityValidator.__init__   s"    .CBCC,r   Nc                n   V'       g   R # VP                  4       pV P                   F  p\        W#R 4      pV'       d   \        V\        4      '       g   K/  VP                  4       p. \
        P                  ! RV4      OVNpV F  p\        WP                  V4      '       d   K!  \        WR7      P                  4       V P                  8  g   KL   \	        VP                  P                  V4      P                  4      p\        V P!                  4       RRV/R7      h	  K  	  R #   \         d    Tp L5i ; i)Nz\W+)r.   bpassword_too_similarverbose_namerI   )lowerrj   r1   
isinstancestrresplitrf   ra   r   quick_ratio_meta	get_fieldrp   r   r   rM   )	rD   r%   r&   attribute_namerb   value_lowervalue_parts
value_partrp   s	   &&&      r   r$   )UserAttributeSimilarityValidator.validate   s   >>#"22ND$7E
5# 6 6++-KGBHHV[9G;GK)
/11:  #h=IIK**+6'* JJ00@MM(
 *..03 .=  * 3& - 6'56s   .D$$D43D4c                    \        R 4      # )z4The password is too similar to the %(verbose_name)s._rR   s   &r   rM   2UserAttributeSimilarityValidator.get_error_message   s    GHHr   c                    \        R 4      # )uH   Your password can’t be too similar to your other personal information.r   rR   s   &r   r3   .UserAttributeSimilarityValidator.get_help_text   s    V
 	
r   )ra   rj   )username
first_name	last_nameemailr   )rW   rX   rY   rZ   r[   DEFAULT_USER_ATTRIBUTESrE   r$   rM   r3   r\   r]   r^   s   @r   rh   rh      s3     	 O'>s -@I
 
r   rh   c                   V   a  ] tR t^t o Rt]R 4       t]3R ltR	R ltR t	R t
RtV tR# )
CommonPasswordValidatora  
Validate that the password is not 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 (unhexed, lowercased and deduplicated), created by Royce
Williams:
https://gist.github.com/roycewilliams/226886fd01572964e1431ac8afc999ce
The password list must be lowercased to match the comparison in validate().
c                ^    \        \        4      P                  4       P                  R ,          # )zcommon-passwords.txt.gz)r   __file__resolveparentrR   s   &r   DEFAULT_PASSWORD_LIST_PATH2CommonPasswordValidator.DEFAULT_PASSWORD_LIST_PATH   s!    H~%%'..1JJJr   c                   V\         P                  J d   V P                  p \        P                  ! VR RR7      ;_uu_ 4       pV Uu0 uF  q3P	                  4       kK  	  upV n        RRR4       R# u upi   + '       g   i     R# ; i  \         d`    \        T4      ;_uu_ 4       pT Uu0 uF  q3P	                  4       kK  	  Mu upi upT n        RRR4        R#   + '       g   i      R# ; ii ; i)rtzutf-8)encodingN)r   r   gzipopenstrip	passwordsOSError)rD   password_list_pathfxs   &&  r   rE    CommonPasswordValidator.__init__   s    !8!S!SS!%!@!@	8-tgFF!56!7Q'')Q!7 GF!7 GFF 	8())Q56!7Q'')Q!7 *)))	8se   !B A7A2 A7(B 2A77B	B B C5)C.C
CC5C1*C51C5Nc                    VP                  4       P                  4       V P                  9   d   \        V P	                  4       R R7      hR# )password_too_commonrJ   N)rq   r   r   r   rM   rN   s   &&&r   r$    CommonPasswordValidator.validate   s?    >>!!#t~~5!&&(*  6r   c                    \        R 4      # )zThis password is too common.r   rR   s   &r   rM   )CommonPasswordValidator.get_error_message  s    /00r   c                    \        R 4      # )u2   Your password can’t be a commonly used password.r   rR   s   &r   r3   %CommonPasswordValidator.get_help_text  s    EFFr   )r   r   )rW   rX   rY   rZ   r[   r	   r   rE   r$   rM   r3   r\   r]   r^   s   @r   r   r      sA     	 K K +E 81G Gr   r   c                   :   a  ] tR tRt o RtRR ltR tR tRtV t	R# )	NumericPasswordValidatori  z5
Validate that the password is not entirely numeric.
Nc                h    VP                  4       '       d   \        V P                  4       R R7      hR# )password_entirely_numericr   N)isdigitr   rM   rN   s   &&&r   r$   !NumericPasswordValidator.validate  s2    !&&(0  r   c                    \        R 4      # )z"This password is entirely numeric.r   rR   s   &r   rM   *NumericPasswordValidator.get_error_message  s    566r   c                    \        R 4      # )u*   Your password can’t be entirely numeric.r   rR   s   &r   r3   &NumericPasswordValidator.get_help_text  s    =>>r   r   r   )
rW   rX   rY   rZ   r[   r$   rM   r3   r\   r]   r^   s   @r   r   r     s     7? ?r   r   )NNr   )'	functoolsr   rt   difflibr   pathlibr   django.confr   django.core.exceptionsr   r   r   django.utils.functionalr	   r
   django.utils.htmlr   r   django.utils.module_loadingr   django.utils.translationr   r   r   cacher   r   r*   r,   r5   r>   rs   "password_validators_help_text_htmlr@   rf   rh   r   r   r   r   r   <module>r      s      	 #    
 : ; 5 1 - F F &&	)		H &**Ms%S ", ,DM<:
 :
z%G %GP? ?r   