403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/passlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/passlib/__pycache__/context.cpython-314.pyc
+
�THiB,��P�^RIHt^RIt^RIHt^RIHt^RIHt^RI	H
t
^RIHtH
t
Ht^RIHtHt^R	IHt^R
IHtHt^RIHtHt^RIHtHtR
R.t]!4tRRlt ]!!R.4t"]#!]$]$]$] ]$R7t%Rt&]!!RR.4t'!RR4t(!RR
4t)!RR])4t*R#)�)�annotationsN)�ConfigParser)�StringIO)�warn)�exc)�ExpectedStringError�ExpectedTypeError�PasslibConfigWarning)�_validate_handler_name�get_crypt_handler)�handlers)�
splitcomma�
to_unicode)�
numeric_types�unicode_or_bytes)�deprecated_method�memoized_property�CryptContext�LazyCryptContextc� �V^8�dQhRRRR/#)��value�str�returnzfloat | int�)�formats"�1/usr/lib/python3/dist-packages/passlib/context.py�__annotate__r#s����s��{��c���VPR4'd"\VPR44R,#\V4# \d\T4u#i;i)z>parse vary_rounds string to percent as [0,1) float, or integer�%g{�G�z�?)�endswith�float�rstrip�int�
ValueError)rs&r�_coerce_vary_roundsr'#sR���~�~�c����U�\�\�#�&�'�$�.�.���5�z������U�|���s�
A�A�A�salt)�
min_rounds�
max_rounds�default_rounds�vary_rounds�	salt_sizec�2�\VPR4VJ#)z3detect if handler is registered or a custom handlerN)r�name��handlers&r�_is_handler_registeredr2>s���W�\�\�4�0�G�;�;r�truncate_errorr,c��]tRt^GtRtRtRtRtRtRt	Rt
RtRtRt
RtRtRtRtRt/3RltR	t/3R
ltRt]R4tR
tRtRtRtRt]RRl4tRtRt RRlt!RRlt"]#R4t$RRlt%Rt&R#)�_CryptConfigagparses, validates, and stores CryptContext config

this is a helper used internally by CryptContext to handle
parsing, validation, and serialization of its config options.
split out from the main class, but not made public since
that just complicates interface too much (c.f. CryptPolicy)

:arg source: config as dict mapping ``(cat,scheme,option) -> value``
Nc	��VPVPR44VPV4VP4VP	4R#)N�NN�schemes)�_init_scheme_list�get�
_init_options�_init_default_schemes�
_init_records)�self�sources&&r�__init__�_CryptConfig.__init__ps@�����v�z�z�*A�B�C����6�"��"�"�$����rc
��.p.p\V\4'd\V4pT;'gRF�p\VR4'dTpVPp\V4MF\V\4'd\
V4pVPpM\R\V4:24hWc9d\RV:24hVPV4VPV4K�	\V4Vn\V4Vn
R#)z,initialize .handlers and .schemes attributesr/z)scheme must be name or CryptHandler, not z"multiple handlers with same name: Nr)�
isinstancerr�hasattrr/rr�	TypeError�type�KeyError�append�tupler
r8)r>�datar
r8�elemr1�schemes&&     rr9�_CryptConfig._init_scheme_listvs��������d�C� � ��d�#�D��J�J�B�J�D��t�V�$�$��� ����&�v�.��D�#�&�&�+�D�1�� �����?��T�
�~�N���
� ��!C�F�:�N�O�O�
�O�O�G�$��N�N�6�"�)�,�h���
��W�~��rc
� �VPpVPp/;Vnp/;Vnp\	4pVP4F�wwrxr�VP
V4TpV'gV'gV	\9dRpV'd`V!W�4wr�VR8Xd V	\9d\RV	R2\4VR8Xd\R\4WH,pW�,p
W�V	&K�V'dV	R8Xd\R4hV!WyV
4wr�WY,pW�V&K�	VPR4\\V44VnR# \dY�/Y�&EKi;i \d
YyT
//YH&EK/i;i \dYz/YY&EKGi;i)zIload config dict into internal representation,
and init .categories attr
�allzThe 'zv' option should be configured per-algorithm, and not set globally in the context; This will be an error in Passlib 2.0z�The 'all' scheme is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0; Please configure options on a per-algorithm basis.r8z4'schemes' context option is not allowed per categoryN)�_norm_scheme_option�_norm_context_option�_scheme_options�_context_options�set�items�add�_global_settingsrr
�DeprecationWarningrG�discardrI�sorted�
categories)r>r?�norm_scheme_option�norm_context_option�scheme_options�context_optionsr[�catrL�keyr�explicit_scheme�category_map�
option_maps&&            rr;�_CryptConfig._init_options�s���
"�5�5��"�7�7��02�2���~�24�4�����U�
�*0����%��S�#��N�N�3��$�O��v�#�1A�*A����/��;�
���U�?�s�2B�'B����u�%X�X�,��#�e�+��<�+�	�
0�#1�#9�L�0�%1�%6�
�+0�3���3�)�+�"�N���1��5�A�
��.�#2�#7�L�).��%�w*8�|	���4� ���z� 2�3����/$�9�-0�L��)�9�� �A�.1��<�-@�N�*�A��* �8�,/�<�O�(�8�s6�
E�E�
E8�E�E�E5�4E5�8F
�F
c	��V\9d\V:R24h\V\4'd&\PV4pV'd	V!V4pW3#)z1 option not allowed in CryptContext configuration)�_forbidden_scheme_optionsrGrCr�_coerce_scheme_optionsr:)r>rar�funcs&&& rrP� _CryptConfig._norm_scheme_option�sO���+�+��c�W�$U�V�W�W��e�S�!�!�)�-�-�c�2�D���U����z�rc	��VPpVR8Xd_\VR4'dVPpM#\V\4'g\VRR4hV'dW49d\
R4hW#3#VR8Xd�\V\4'd
\V4pM)\V\\34'g\VRR4hRV9d \V4^8�d\R4hW#3#V'dBVF;p\V\4'g\VRR4hWT9gK.\
R	V:24h	W#3#VR
8wd\
RV:24hW#3#)�defaultr/rz"default scheme not found in policy�
deprecatedz
str or seq�autoz<cannot list other schemes if ``deprecated=['auto']`` is usedzdeprecated elementz'deprecated scheme not found in policy: r8zunknown CryptContext keyword: )r8rDr/rCrr	rGr�listrI�lenr&)r>r`rarr8rLs&&&&  rrQ�!_CryptConfig._norm_context_option�sO���,�,���)���u�f�%�%��
�
����s�+�+�'��u�i�@�@��5�/��C�D�D�0�z��/�L�
 ��%��%�%�"�5�)�����e�}�5�5�'��|�\�J�J�����u�:��>�$�V���"��z���#�F�%�f�c�2�2�/��u�>R�S�S��,�&�E�f�Z�P���	$��z���I�
��;�C�7�C�D�D��z�rc
�8�VPPW4#)zoreturn dict mapping category->value for specific context option.

.. warning:: treat return value as readonly!
)rSr:)r>ra�_defaults&&&r�get_context_optionmap�"_CryptConfig.get_context_optionmaps��
�$�$�(�(��7�7rc
���VPV,pTPR4pT'dY1,pTeYT8wdTR3#TR3#TR3# \dRu#i;i \dTR3#i;i)z�return value of specific option, handling category inheritance.
also returns flag indicating whether value is category-specific.
NFT�NF)rSrGr:)r>�categoryrarcr�alts&&&   r�get_context_option_with_flag�)_CryptConfig.get_context_option_with_flags���	��0�0��5�L�� � ��&���
%�"�,���=�C�L���9�$�%1��e�|��u�e�|����	���	���
���e�|��
�s"�A�A!�
A�A�!A2�1A2c
�^�VPV,V,# \dTu#i;i)zcreturn all options for (scheme,category) combination

.. warning:: treat return value as readonly!
)rRrG)r>rLrxrls&&&&r�_get_scheme_optionmap�"_CryptConfig._get_scheme_optionmap/s1��
	��'�'��/��9�9���	��N�	�s��
,�,c	�Z�VPVPPV4,#�N)r
r8�index)r>rLs&&r�get_base_handler�_CryptConfig.get_base_handler9s ���}�}�T�\�\�/�/��7�8�8rc	��VPpRVP9d"V\PP,
pV#)�rounds)�setting_kwds�uh�	HasRounds�using_rounds_kwds)r1r�s& r�expand_settings�_CryptConfig.expand_settings<s5���+�+���w�+�+�+��B�L�L�:�:�:�L��rc
�n�VPpV!RR4P4pRpV'd)VP4pVPV!RV44VPVP	V44p\V4P
V4FpVPV4K	V'd3\X4P
V4FpVPV4K	V!VR4p	VPV	4V'd1XPV	4VPV!W44WF8wdRpWE3#)z�return composite dict of all options set for scheme.
includes options inherited from 'all' and from default category.
result can be modified.
returns (kwds, has_cat_specific_options)
rONFT)r}�copy�updater�r�rT�
difference�pop)
r>rLrx�
get_optionmap�kwds�has_cat_options�defkwds�allowed_settingsra�others
&&&       r�get_scheme_options_with_flag�)_CryptConfig.get_scheme_options_with_flagEs
���2�2�
��U�D�)�.�.�0������i�i�k�G��K�K�
�e�X�6�7� �/�/��0E�0E�f�0M�N���t�9�'�'�(8�9�C��H�H�S�M�:���7�|�.�.�/?�@�����C� �A��f�d�+�����E����N�N�5�!��K�K�
�f�7�8���"&���$�$rc
�N�VPpV!R4P4;q nV!R4pVPpV'gR#VP	R4;'gR
pVP	R4pV'g!VFpWu9gKWrR&M	\R4hWe9d\R4hVPFipVP	W�4p	VP	W�4p
V
'g'VFpWy9gKWrV&KA	\RV:R24hW�9gK[\RV:R	24h	R#)z�initialize maps containing default scheme for each category.

have to do this after _init_options(), since the default scheme
is affected by the list of deprecated schemes.
rlrmNz,must have at least one non-deprecated schemez#default scheme cannot be deprecatedz1must have at least one non-deprecated scheme for z	 categoryzdefault scheme for z category cannot be deprecatedr)rtr��_default_schemesr8r:r&r[)r>r��default_map�dep_mapr8�depsrlrLr`�cdeps�cdefaults&          rr<�"_CryptConfig._init_default_schemesms0���2�2�
�.;�I�.F�.K�.K�.M�M��+���-���,�,�����{�{�4� �&�&�B���/�/�$�'���!���%�(.��%��"�
!�!O�P�P�
�_��B�C�C��?�?�C��K�K��*�E�"���s�4�H��%�F��*�+1�C�(��&�
%�&�&)�W�I�7����"� �)�#��0N�O���#rc
��VPpW!,# \dMi;iTP'g\R4hTR,#)z+return default scheme for specific categoryz9no hash schemes configured for this CryptContext instanceN)r�rGr8)r>rx�defaultss&& r�default_scheme�_CryptConfig.default_scheme�sL���(�(��	��%�%���	��	���|�|�|��V�W�W���~�s��$�$c
�aaa�SPR4oVVV3RlpV!R4;'gRpV'dV!V4pVeWE8wdVR3#VR3#)z/is scheme deprecated under particular category?rmc�<�SPVSPR44pVfR#RV9dSSPV48g#SV9#)Nrn)r:r�)r`r?�depmaprLr>s& ���r�test�2_CryptConfig.is_deprecated_with_flag.<locals>.test�sM����Z�Z��V�Z�Z��%5�6�F��~�������!4�!4�S�!9�9�9��V�#�#rNFT)rt)r>rLrxr�rryr�sff&   @r�is_deprecated_with_flag�$_CryptConfig.is_deprecated_with_flag�sT����+�+�L�9��	$��T�
�#�#�e����x�.�C���5�<��D�y� ��e�|�rc	�f�/Vn/;qn\4;q nVPpRVP
,pVPFbpVPpVPVP4VF2pV!Wg4wr�VeV	'gKVP!WW3/VBWV3&K4	Kd	R#)Nr�)
�
_record_lists�_recordsrT�context_kwds�_get_record_options_with_flagr[r
r/r��_create_record)
r>�records�all_context_kwds�get_optionsr[r1rLr`r�r�s
&         rr=�_CryptConfig._init_records�s���
 ���"$�$��-�/2�u�4��,��8�8���t���.�
��}�}�G��\�\�F��#�#�G�$8�$8�9�!��(3�F�(@�%���;�/�/�+/�+>�+>�w�+T�t�+T�G�C�K�(�"�%rc	�^�VP!RRR/VBpY@JgQR4hYnY$n	T# \drp\P!R\	T44pT'dDTP^4T9d.TP^4p\
RTPRT:24hhRp?ii;i)�relaxedTz&.* unexpected keyword argument '(.*)'$zkeyword not supported by z
 handler: Nz"expected unique variant of handlerr)
�usingrE�re�matchr�grouprGr/�_Context__orig_handlerrm)r1rxrm�settings�subcls�err�mras&&&,    rr��_CryptConfig._create_record�s���
	��]�]�<�4�<�8�<�F��$�J�&J�J�$�(/�%�&���
��!�		����B�C��H�M�A��Q�W�W�Q�Z�8�+��g�g�a�j���/����~�Z��w�O���
��		�s�0�B,�A,B'�'B,c
��VPW4wr4VPW4wrVV'dRVR&V'dRpW43#)a9return composite dict of options for given scheme + category.

this is currently a private method, though some variant
of its output may eventually be made public.

given a scheme & category, it returns two things:
a set of all the keyword options to pass to :meth:`_create_record`,
and a bool flag indicating whether any of these options
were specific to the named category. if this flag is false,
the options are identical to the options for the default category.

the options dict includes all the scheme-specific settings,
as well as optional *deprecated* keyword.
Trm)r�r�)r>rLrxr�r�r�
not_inheriteds&&&    rr��*_CryptConfig._get_record_options_with_flag�sJ�� !%� A� A�&� S��� $�;�;�F�M����!%�D����"�O��$�$rc
��VPW3,# \dMi;iTe$\T\4'g\	TRR4hTe$\T\4'g\	TRR4hT'g?TPT4pT'gQhTP
Y24;q@PRT3&T#T'd0TPpYQR3,;qEY3&T# \dMi;i\RT:24h)z5return record for specific scheme & category (cached)Nzstr or NonerxrLz%crypt algorithm not found in policy: )r�rGrCrr	r��
get_record)r>rLrxrl�record�caches&&&   rr��_CryptConfig.get_records��	��=�=��!1�2�2���	��	����
�8�S�(A�(A�#�H�m�Z�H�H���j���&=�&=�#�F�M�8�D�D���)�)�(�3�G��N�7�59�_�_�W�5W�W�F�]�]�4��>�2��M��
��
�
��38���3F�F��v�/�0��
���
��
���>�v�j�I�J�Js��$�$�C!�!C/�.C/c
���VPV,# \dMi;iTPUu.uFq PY!4NK	Muupiup;q0PT&T#)zhreturn list of records for category (cached)

this is an internal helper used only by identify_record()
)r�rGr8r�)r>rxrLrs&&  r�_get_record_list�_CryptConfig._get_record_list*sh��	��%�%�h�/�/���	��	��=A�L�L�0
�<H�&�O�O�F�-�L��0
�	
��"�"�8�,��s��#�#�Ac
�&�\V\4'g
\VR4hVPV4FpVP	V4'gKVu#	V'gR#VP
'g\
R4h\P!R4h)z?internal helper to identify appropriate custom handler for hash�hashNzno crypt algorithms supportedzhash could not be identified)	rCrrr��identifyr8rGr�UnknownHashError)r>r�rx�requiredr�s&&&& r�identify_record�_CryptConfig.identify_record;sw���$� 0�1�1�%�d�F�3�3��+�+�H�5�F����t�$�$��
�6����|�|�|��:�;�;��"�"�#A�B�Brc	�t�VPR4FpVP'gKVu#	\R4h)NzLno disabled hasher present (perhaps add 'unix_disabled' to list of schemes?))r��is_disabled�RuntimeError)r>r�s& r�disabled_record�_CryptConfig.disabled_recordRs=���+�+�D�1�F��!�!�!��
�2��
@�
�	
rc#
�|"�VPpVPp\V4p\V4pRV9dVPR4V'd
VPMVP
pV'dR\
V43x�RVP,FpVF=pW8,V,p\V\4'd\
V4pVRV3V3x�K?	VF3p	W),V,p
\V
4FpWyV3W�,3x�K	K5	K�	R# \dK�i;i \dK]i;i5i)arregenerate original config.

this is an iterator which yields ``(cat,scheme,option),value`` items,
in the order they generally appear inside an INI file.
if interpreted as a dictionary, it should match the original
keywords passed to the CryptContext (aside from any canonization).

it's mainly used as the internal backend for most of the public
serialization methods.
r8Nr7r�)
rRrSrZ�remover
r8ror[rCrG)r>�resolver^r_�scheme_keys�context_keysrr`rarLr�s&&         r�iter_config�_CryptConfig.iter_config\s0����-�-���/�/���^�,���o�.����$����	�*�!(��
�
�d�l�l���)�4��;�6�6��T�_�_�,�,�C�#��2�+�0��5�E�"�%��.�.� $�U�����c�*�E�1�1�$�&��<�)�1�#�6�D� &�d�|��"�C�0�$�)�;�;� ,�
&�-��
 ����� ����sZ�AD<�D<�1*D<�D�+3D<�D*�.*D<�D'�#D<�&D'�'D<�*D9�5D<�8D9�9D<)	rSr�r�r�rRr[r�r
r8rwr�)T�F)'�__name__�
__module__�__qualname__�__firstlineno__�__doc__rRrSr
r8r[r�r�r�r�r@r9r;rPrQrtrzr}r��staticmethodr�r�r<r�r�r=r�r�r�r�r�rr�r��__static_attributes__rrrr5r5Gs�����O����H��G��J��L����H��M��&�>K4�Z	� �J35�8��,?A��9�����&%�P,�\	��&U�,����0%�6%K�N�"C�.�
��
�-<�-<rr5c�6�]tRtRtRtRtRtRt]R4t	]R6Rl4t
]R6Rl4tRtRt
R7R	ltR
t]R4tR8RltR8R
lt]R4tRtR9RltR:RltR;RltRt]R4t]R4t]R4tR<RltRRltR=RRllt R>Rlt!Rt"R?Rlt#]$!RR R!R"7R>R#l4t%]$!R$R R%7R>R&l4t&]$!R$R R%7R>R'l4t'R@R(lt(R>R)lt)]$!R$R R*R"7R+4t*R>R,lt+R>R-lt,R.t-].R/4t/R0t0R1t1R2t2RAR3lt3R4t4R5t5R#)Bri�a	Helper for hashing & verifying passwords using multiple algorithms.

Instances of this class allow applications to choose a specific
set of hash algorithms which they wish to support, set limits and defaults
for the rounds and salt sizes those algorithms should use, flag
which algorithms should be deprecated, and automatically handle
migrating users to stronger hashes when they log in.

Basic usage::

    >>> ctx = CryptContext(schemes=[...])

See the Passlib online documentation for details and full documentation.
Nc
��\V\4'd	V!R/VB#\W4'dV#V!4pVPV4V#)z2internal helper - accepts string, dict, or contextr)rC�dict�load)�clsr?r>s&& r�_norm_source�CryptContext._norm_source�sE���f�d�#�#��=��=� ��f�"�"��M��u���	�	�&���rc
��\V\4'g\VRR4hV!RR7pVPWVR7V#)acreate new CryptContext instance from an INI-formatted string.

:type source: str or bytes
:arg source:
    string containing INI-formatted content.

:type section: str
:param section:
    option name of section to read from, defaults to ``"passlib"``.

:type encoding: str
:arg encoding:
    optional encoding used when source is bytes, defaults to ``"utf-8"``.

:returns:
    new :class:`CryptContext` instance, configured based on the
    parameters in the *source* string.

Usage example::

    >>> from passlib.context import CryptContext
    >>> context = CryptContext.from_string('''
    ... [passlib]
    ... schemes = sha256_crypt, des_crypt
    ... sha256_crypt__default_rounds = 30000
    ... ''')

.. versionadded:: 1.6

.. seealso:: :meth:`to_string`, the inverse of this constructor.
zstr or bytesr?F��	_autoload��section�encoding)rCrr	r�)r�r?r�r�r>s&&&& r�from_string�CryptContext.from_string�sA��B�&�"2�3�3�#�F�N�H�E�E��U�#���	�	�&�H�	�=��rc
�>�V!RR7pVPWVR7V#)a}create new CryptContext instance from an INI-formatted file.

this functions exactly the same as :meth:`from_string`,
except that it loads from a local file.

:type path: str
:arg path:
    path to local file containing INI-formatted config.

:type section: str
:param section:
    option name of section to read from, defaults to ``"passlib"``.

:type encoding: str
:arg encoding:
    encoding used to load file, defaults to ``"utf-8"``.

:returns:
    new CryptContext instance, configured based on the parameters
    stored in the file *path*.

.. versionadded:: 1.6

.. seealso:: :meth:`from_string` for an equivalent usage example.
Fr�r�)�	load_path)r��pathr�r�r>s&&&& r�	from_path�CryptContext.from_path�s#��6�U�#�����t�x��@��rc
�v�\RR7pVPV4V'dVPVRR7V#)ayReturn copy of existing CryptContext instance.

This function returns a new CryptContext instance whose configuration
is exactly the same as the original, with the exception that any keywords
passed in will take precedence over the original settings.
As an example::

    >>> from passlib.context import CryptContext

    >>> # given an existing context...
    >>> ctx1 = CryptContext(["sha256_crypt", "md5_crypt"])

    >>> # copy can be used to make a clone, and update
    >>> # some of the settings at the same time...
    >>> ctx2 = custom_app_context.copy(default="md5_crypt")

    >>> # and the original will be unaffected by the change
    >>> ctx1.default_scheme()
    "sha256_crypt"
    >>> ctx2.default_scheme()
    "md5_crypt"

.. versionadded:: 1.6
    This method was previously named :meth:`!replace`. That alias
    was removed in Passlib 1.8.

.. seealso:: :meth:`update`
Fr�T�r�)rr�)r>r�r�s&, rr��CryptContext.copys3��@�u�-��
�
�
�4����J�J�t�D�J�)��rc
�&�VP!R/VB#)z7
alias for :meth:`copy`, to match PasswordHash.using()
r)r�)r>r�s&,rr��CryptContext.using's���y�y� �4� � rc	�j�VeWR&V'dVPV4R#V'dQR4hR#)Nr8z/_autoload=False and kwds are mutually exclusive)r�)r>r8r�r�s&&&,rr@�CryptContext.__init__-s/����%��O���I�I�d�O��N�N�N�8�trc	�"�R\V4R
R2#)z<CryptContext at 0x�0x�>)�id�r>s&r�__repr__�CryptContext.__repr__Bs��$�R��X�b�M��3�3rc
�l�\4pVPW4\VPV44#)z<helper read INI from stream, extract passlib section as dict)r�	read_filer�rU)�streamr��filename�ps&&& r�_parse_ini_stream�CryptContext._parse_ini_streamEs-��

�N��	���F�%��A�G�G�G�$�%�%rc
��\WR7;_uu_4pVPWSV4pRRR4VPXVR7# +'giL#;i)aMLoad new configuration into CryptContext from a local file.

This function is a wrapper for :meth:`load` which
loads a configuration string from the local file *path*,
instead of an in-memory source. Its behavior and options
are otherwise identical to :meth:`!load` when provided with
an INI-formatted string.

.. versionadded:: 1.6
)r�Nr�)�openrr�)r>r�r�r�r�rr�s&&&&&  rr��CryptContext.load_pathPsD���$�
*�
*�f��)�)�&�4�@�D�+��y�y��f�y�-�-�+�
*�s�A�A	c
�Xa�Rp\V\4'd+\WRR7pVP\	V4VR4pM]\V\
4'd)\
VPPRR74pRpM\VR4'g\VRR4hV'd0VPo\
V3R	lVP444pV'dQVPeCV'gR
#Tp\
VPPRR74pVPV4\V4pWpnVP4VP VnVP$VnVP('dVP*P-RR
4R
#R
VnR
#)a�Load new configuration into CryptContext, replacing existing config.

:arg source:
    source of new configuration to load.
    this value can be a number of different types:

    * a :class:`!dict` object, or compatible Mapping

        the key/value pairs will be interpreted the same
        keywords for the :class:`CryptContext` class constructor.

    * a :class:`!str` or :class:`!bytes` string

        this will be interpreted as an INI-formatted file,
        and appropriate key/value pairs will be loaded from
        the specified *section*.

    * another :class:`!CryptContext` object.

        this will export a snapshot of its configuration
        using :meth:`to_dict`.

:type update: bool
:param update:
    By default, :meth:`load` will replace the existing configuration
    entirely. If ``update=True``, it will preserve any existing
    configuration options that are not overridden by the new source,
    much like the :meth:`update` method.

:type section: str
:param section:
    When parsing an INI-formatted string, :meth:`load` will look for
    a section named ``"passlib"``. This option allows an alternate
    section name to be used. Ignored when loading from a dictionary.

:type encoding: str
:param encoding:
    Encoding to use when **source** is bytes.
    Defaults to ``"utf-8"``. Ignored when loading from a dictionary.

    .. deprecated:: 1.8

        This keyword, and support for bytes input, will be dropped in Passlib 2.0

:raises TypeError:
    * If the source cannot be identified.
    * If an unknown / malformed keyword is encountered.

:raises ValueError:
    If an invalid keyword value is encountered.

.. note::

    If an error occurs during a :meth:`!load` call, the :class:`!CryptContext`
    instance will be restored to the configuration it was in before
    the :meth:`!load` call was made; this is to ensure it is
    *never* left in an inconsistent state due to a load error.

.. versionadded:: 1.6
Tr?)�paramz&<string passed to CryptContext.load()>)r�FrUzstring or dictc3�<<"�TFwrS!V4V3x�K	R#5ir�r)�.0rar�parses&  �r�	<genexpr>�$CryptContext.load.<locals>.<genexpr>�s����O��*�#�5��:�u�-����N�_strip_unused_context_kwds)rCrrrrrr��_configr�rDr	�_parse_config_keyrUr�r5�_reset_dummy_verifyr��_get_recordr��_identify_recordr��__dict__r�r)	r>r?r�r�r��
parse_keys�tmp�configrs	&&&&&   @rr��CryptContext.load_sX���@�
��f�.�/�/����A�F��+�+��� �'�+S��F����
-�
-��&�.�.�4�4�T�4�B�C�F��J����)�)�#�F�,<�h�G�G���*�*�E��O�����O�O�F��d�l�l�.����C��$�,�,�2�2�4�2�@�A�F��M�M�#��
�f�%����� � �"�!�,�,��� &� 6� 6��������M�M���:�D�A�/3�D�+rc
���\V\4'gQhVPRR4PR4p\	V4pV^8XdRRV^,rTpM*V^8XdRpVwrEMV^8XdVwr4pM\RV:24hVR8XdRpMV'gVe\RV:24hVR8XdRpMV'gVe\RV:24hV'g\R	V:24hW4V3#)
z>helper used to parse ``cat__scheme__option`` keys into a tuple�.�__Nz'keys must have less than 3 separators: rlzempty category: �contextzempty scheme: zempty option: )rCr�replace�splitrprE)�ckey�parts�countr`rLras&     rr�CryptContext._parse_config_key�s����$��$�$�$�$����S�$�'�-�-�d�3���E�
���A�:�#�T�5��8��C��
�a�Z��C��K�F�C�
�a�Z�$��C���E�d�X�N�O�O��)���C�����.�t�h�7�8�8��Y���F��F�.��n�T�H�5�6�6���n�T�H�5�6�6��C��rc
���V'dK\V4^8�d\R4hV'd\R4hVPV^,RR7R#V'dVPVRR7R#R#)apHelper for quickly changing configuration.

This acts much like the :meth:`!dict.update` method:
it updates the context's configuration,
replacing the original value(s) for the specified keys,
and preserving the rest.
It accepts any :ref:`keyword <context-options>`
accepted by the :class:`!CryptContext` constructor.

.. versionadded:: 1.6

.. seealso:: :meth:`copy`
z(expected at most one positional argumentz.positional arg and keywords mutually exclusiveTr�N)rprEr��r>�argsr�s&*,rr��CryptContext.update�sY����4�y�1�}�� J�K�K��� P�Q�Q��I�I�d�1�g�d�I�+�
��I�I�d�4�I�(�rc
�aaa�SPPpV'd7\;QJd.VVV3RlV4FNK	5#!VVV3RlV44#V#)a�return schemes loaded into this CryptContext instance.

:type resolve: bool
:arg resolve:
    if ``True``, will return a tuple of :class:`~passlib.ifc.PasswordHash`
    objects instead of their names.

:returns:
    returns tuple of the schemes configured for this context
    via the *schemes* option.

.. versionadded:: 1.6
    This was previously available as ``CryptContext().policy.schemes()``

.. seealso:: the :ref:`schemes <context-schemes-option>` option for usage example.
c3�L<"�TFpSPVSSR7x�K	R#5i)��unconfiguredNr0)rrLrxr>r8s& ���rr�'CryptContext.schemes.<locals>.<genexpr>Es*�����%�F����V�X�L��I�I�%�s�!$)rr8rI)r>r�rxr8r8sf&ff rr8�CryptContext.schemes,sP���.�,�,�&�&����5��%��5�
�5��%���
��rc
�T�VPRWR7pV'dV#VP#)a�return name of scheme that :meth:`hash` will use by default.

:type resolve: bool
:arg resolve:
    if ``True``, will return a :class:`~passlib.ifc.PasswordHash`
    object instead of the name.

:type category: str or None
:param category:
    Optional :ref:`user category <user-categories>`.
    If specified, this will return the catgory-specific default scheme instead.

:returns:
    name of the default scheme.

.. seealso:: the :ref:`default <context-default-option>` option for usage example.

.. versionadded:: 1.6

.. versionchanged:: 1.7

    This now returns a hasher configured with any CryptContext-specific
    options (custom rounds settings, etc).  Previously this returned
    the base hasher from :mod:`passlib.hash`.
Nr7)r1r/)r>rxr�r8�hashers&&&& rr��CryptContext.default_schemeKs'��<���d�H��H�� �v�1�f�k�k�1rc
���VPW4pV'd
VP#V# \dMi;iTPP'd\RT:24h\R4h)ahelper to resolve name of scheme -> :class:`~passlib.ifc.PasswordHash` object used by scheme.

:arg scheme:
    This should identify the scheme to lookup.
    If omitted or set to ``None``, this will return the handler
    for the default scheme.

:arg category:
    If a user category is specified, and no scheme is provided,
    it will use the default for that category.
    Otherwise this parameter is ignored.

:param unconfigured:

    By default, this returns a handler object whose .hash()
    and .needs_update() methods will honor the configured
    provided by CryptContext.   See ``unconfigured=True``
    to get the underlying handler from before any context-specific
    configuration was applied.

:raises KeyError:
    If the scheme does not exist OR is not being used within this context.

:returns:
    :class:`~passlib.ifc.PasswordHash` object used to implement
    the named scheme within this context (this will usually
    be one of the objects from :mod:`passlib.hash`)

.. versionadded:: 1.6
    This was previously available as ``CryptContext().policy.get_handler()``

.. versionchanged:: 1.7

    This now returns a hasher configured with any CryptContext-specific
    options (custom rounds settings, etc).  Previously this returned
    the base hasher from :mod:`passlib.hash`.
z9crypt algorithm not found in this CryptContext instance: z8no crypt algorithms loaded in this CryptContext instance)r r�rGrr
)r>rLrxr8r<s&&&& rr1�CryptContext.handler|ss��L	��%�%�f�7�F���4�4�4��M���	��	���<�<� � � ��K�F�:�V��
��Q�R�Rs�$)�)�7�7c
��\;QJd(.RVPP4FNK	5#!RVPP44#)zCcheck if any handlers in this context aren't in the global registryc3�L"�TFp\V4'dKVx�K	R#5ir�)r2�rr1s& rr�:CryptContext._get_unregistered_handlers.<locals>.<genexpr>�s!���
�0��)�'�2�
�G�0�s�$�
$)rIrr
rs&r�_get_unregistered_handlers�'CryptContext._get_unregistered_handlers�sH���u�
��<�<�0�0�
�u�	
�u�
��<�<�0�0�
�
�	
rc
�.�VPP#)z�
return :class:`!set` containing union of all :ref:`contextual keywords <context-keywords>`
supported by the handlers in this context.

.. versionadded:: 1.6.6
)rr�rs&rr��CryptContext.context_kwds�s���|�|�(�(�(rc
�v�VwrpV'dRPY;'gRV4#V'dVRV2#V#)z*convert 3-part config key to single stringz
{}__{}__{}r*r))r)rar`rL�options&   r�_render_config_key�CryptContext._render_config_key�sE��"���V���&�&�s�,?�,?�i��H�H���X�R��x�(�(��
rc
��\V\\34'dRPV4pMc\V\4'dN\V\
4'd-V^,R8XdV'dVR
P
R4MRpM\V4p\V\4'gQRV:RV:24hVPRR4#)	z,render value to string suitable for INI file�, r,z.2f�0zexpected string for key: � r!z%%)	rCrorI�joinrr#r$rr+)rars&&r�_render_ini_value�CryptContext._render_ini_value�s���
�e�d�E�]�+�+��I�I�e�$�E���}�
-�
-��%��'�'�C��F�m�,C�8=�E�#�;�/�/��4�3���E�
���%��%�%�T�)B�3�'��5�)�'T�T�%��}�}�S�$�'�'rc
�xa�VPo\V3RlVPPV444#)a�Return current configuration as a dictionary.

:type resolve: bool
:arg resolve:
    if ``True``, the ``schemes`` key will contain a list of
    a :class:`~passlib.ifc.PasswordHash` objects instead of just
    their names.

This method dumps the current configuration of the CryptContext
instance. The key/value pairs should be in the format accepted
by the :class:`!CryptContext` class constructor, in fact
``CryptContext(**myctx.to_dict())`` will create an exact copy of ``myctx``.
As an example::

    >>> # you can dump the configuration of any crypt context...
    >>> from passlib.apps import ldap_nocrypt_context
    >>> ldap_nocrypt_context.to_dict()
    {'schemes': ['ldap_salted_sha1',
    'ldap_salted_md5',
    'ldap_sha1',
    'ldap_md5',
    'ldap_plaintext']}

.. versionadded:: 1.6
    This was previously available as ``CryptContext().policy.to_dict()``

.. seealso:: the :ref:`context-serialization-example` example in the tutorial.
c3�<<"�TFwrS!V4V3x�K	R#5ir�r)rrar�
render_keys&  �rr�'CryptContext.to_dict.<locals>.<genexpr>�s ����
�7X���Z��_�e�$�7X�r)rJr�rr�)r>r�rUs&&@r�to_dict�CryptContext.to_dict�s:���>�,�,�
��
�7;�|�|�7O�7O�PW�7X�
�
�	
rc�$�V^8�dQhRRRRRR/#)r�parserrr�rr�Noner)rs"rr�CryptContext.__annotate__s!����|��c��d�rc	
���VPV4VPP4F7wr4VPVVP	V4VPW44R7K9	R#)z(helper to write to ConfigParser instance)r�rIrN)�add_sectionrr�rTrJrQ)r>rZr�rars&&&  r�_write_to_parser�CryptContext._write_to_parsersY�����7�#��,�,�2�2�4�J�C��J�J���.�.�s�3��,�,�S�8�
�
�5rc��V^8�dQhRR/#)rrrr)rs"rrr\
s��&�&�c�&rc
�*�\4pVPW!4\4pVPV4VP	4pV'd7VPRPRP
RV4444VP4#)a�serialize to INI format and return as unicode string.

:param section:
    name of INI section to output, defaults to ``"passlib"``.

:returns:
    CryptContext configuration, serialized to a INI unicode string.

This function acts exactly like :meth:`to_dict`, except that it
serializes all the contents into a single human-readable string,
which can be hand edited, and/or stored in a file. The
output of this method is accepted by :meth:`from_string`,
:meth:`from_path`, and :meth:`load`. As an example::

    >>> # you can dump the configuration of any crypt context...
    >>> from passlib.apps import ldap_nocrypt_context
    >>> print ldap_nocrypt_context.to_string()
    [passlib]
    schemes = ldap_salted_sha1, ldap_salted_md5, ldap_sha1, ldap_md5, ldap_plaintext

.. versionadded:: 1.6
    This was previously available as ``CryptContext().policy.to_string()``

.. seealso:: the :ref:`context-serialization-example` example in the tutorial.
z�# NOTE: the {} handler(s) are not registered with Passlib,
# this string may not correctly reproduce the current configuration.

rMc3�L"�TFp\VP4x�K	R#5ir�)�reprr/rBs& rr�)CryptContext.to_string.<locals>.<genexpr>1s���"R�\�'�4����#5�#5�\�s�"$)rr_r�writerDrrP�getvalue)r>r�rZ�buf�unregistereds&&   r�	to_string�CryptContext.to_string
sv��4������f�.��j�����S���6�6�8����I�I�_��&����"R�\�"R�R�S�	
��|�|�~�rc
��V'd4\V\4'g
\VR4hVPW#4#VP	W4#)zCreturn record based on scheme, or failing that, by identifying hashr�)rCrrr r!�r>r�rLrxs&&&&r�_get_or_identify_record�$CryptContext._get_or_identify_recordOsB����d�$4�5�5�)�$��7�7��#�#�F�5�5��$�$�T�4�4rc
��V'gR#VPPPVP4pVFpVPVR4K	R#)a.
helper which removes any context keywords from **kwds**
that are known to be used by another scheme in this context,
but are NOT supported by handler specified by **record**.

.. note::
    as optimization, load() will set this method to None on a per-instance basis
    if there are no context kwds.
N)rr�r�r�)r>r�r��unused_kwdsras&&&  rr�'CryptContext._strip_unused_context_kwdsXsB�����l�l�/�/�:�:�6�;N�;N�O���C��H�H�S�$��rc
��Ve\R\4VPWV4pVP;'gVP	WR7#)a6Check if hash needs to be replaced for some reason,
in which case the secret should be re-hashed.

This function is the core of CryptContext's support for hash migration:
This function takes in a hash string, and checks the scheme,
number of rounds, and other properties against the current policy.
It returns ``True`` if the hash is using a deprecated scheme,
or is otherwise outside of the bounds specified by the policy
(e.g. the number of rounds is lower than :ref:`min_rounds <context-min-rounds-option>`
configuration for that algorithm).
If so, the password should be re-hashed using :meth:`hash`
Otherwise, it will return ``False``.

:type hash: str or bytes
:arg hash:
    The hash string to examine.

:type scheme: str or None
:param scheme:

    Optional scheme to use. Scheme must be one of the ones
    configured for this context (see the
    :ref:`schemes <context-schemes-option>` option).
    If no scheme is specified, it will be identified
    based on the value of *hash*.

    .. deprecated:: 1.7

        Support for this keyword is deprecated, and will be removed in Passlib 2.0.

:type category: str or None
:param category:
    Optional :ref:`user category <user-categories>`.
    If specified, this will cause any category-specific defaults to
    be used when determining if the hash needs to be updated
    (e.g. is below the minimum rounds).

:type secret: str, bytes, or None
:param secret:
    Optional secret associated with the provided ``hash``.
    This is not required, or even currently used for anything...
    it's for forward-compatibility with any future
    update checks that might need this information.
    If provided, Passlib assumes the secret has already been
    verified successfully against the hash.

    .. versionadded:: 1.6

:returns: ``True`` if hash should be replaced, otherwise ``False``.

:raises ValueError:
    If the hash did not match any of the configured :meth:`schemes`.

.. versionadded:: 1.6
    This method was previously named :meth:`hash_needs_update`.

.. seealso:: the :ref:`context-migration-example` example in the tutorial.
zqCryptContext.needs_update(): 'scheme' keyword is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0��secret)rrXrnrm�needs_update)r>r�rLrxrur�s&&&&& rrv�CryptContext.needs_updatehsT��v��
�B�"�
�
�-�-�d�H�E��� � �L�L�F�$7�$7��$7�$L�Lrz1.6z2.0zCryptContext.needs_update())rm�removed�replacementc
�&�VPWV4#)z�Legacy alias for :meth:`needs_update`.

.. deprecated:: 1.6
    This method was renamed to :meth:`!needs_update` in version 1.6.
    This alias will be removed in version 2.0, and should only
    be used for compatibility with Passlib 1.3 - 1.5.
)rvrms&&&&r�hash_needs_update�CryptContext.hash_needs_update�s��� � ��x�8�8rz1.7)rmrxc
��VPW4pVPpV'd	V!W44VP!R/VB#)z�Generate a config string for specified scheme.

.. deprecated:: 1.7

    This method will be removed in version 2.0, and should only
    be used for compatibility with Passlib 1.3 - 1.6.
r)r r�	genconfig)r>rLrxr�r��strip_unuseds&&&,  rr~�CryptContext.genconfig�s>���!�!�&�3���6�6�����*����+�(�+�+rc
��VPW#V4pVPpV'd	V!WV4VP!W3/VB#)z�Generate hash for the specified secret using another hash.

.. deprecated:: 1.7

    This method will be removed in version 2.0, and should only
    be used for compatibility with Passlib 1.3 - 1.6.
)rnr�genhash)r>rur%rLrxr�r�rs&&&&&,  rr��CryptContext.genhash�s@���-�-�f�h�G���6�6�����&��~�~�f�5��5�5rc
��VPWV4pVfR#V'dV'd
VP#V#VP#)a�Attempt to identify which algorithm the hash belongs to.

Note that this will only consider the algorithms
currently configured for this context
(see the :ref:`schemes <context-schemes-option>` option).
All registered algorithms will be checked, from first to last,
and whichever one positively identifies the hash first will be returned.

:type hash: str or bytes
:arg hash:
    The hash string to test.

:type category: str or None
:param category:
    Optional :ref:`user category <user-categories>`.
    Ignored by this function, this parameter
    is provided for symmetry with the other methods.

:type resolve: bool
:param resolve:
    If ``True``, returns the hash handler itself,
    instead of the name of the hash.

:type required: bool
:param required:
    If ``True``, this will raise a ValueError if the hash
    cannot be identified, instead of returning ``None``.

:returns:
    The handler which first identifies the hash,
    or ``None`` if none of the algorithms identify the hash.
N)r!r�r/)r>r�rxr�r�r8r�s&&&&&& rr��CryptContext.identify�s@��F�&�&�t�x�@���>�����4�4�4��M��{�{�rc
��Ve\R\4VPW#4pVPpV'd	V!WE4VP!V3/VB#)afrun secret through selected algorithm, returning resulting hash.

:type secret: str or bytes
:arg secret:
    the password to hash.

:type scheme: str or None
:param scheme:

    Optional scheme to use. Scheme must be one of the ones
    configured for this context (see the
    :ref:`schemes <context-schemes-option>` option).
    If no scheme is specified, the configured default
    will be used.

    .. deprecated:: 1.7

        Support for this keyword is deprecated, and will be removed in Passlib 2.0.

:type category: str or None
:param category:
    Optional :ref:`user category <user-categories>`.
    If specified, this will cause any category-specific defaults to
    be used when hashing the password (e.g. different default scheme,
    different default rounds values, etc).

:param \*\*kwds:
    All other keyword options are passed to the selected algorithm's
    :meth:`PasswordHash.hash() <passlib.ifc.PasswordHash.hash>` method.

:returns:
    The secret as encoded by the specified algorithm and options.
    The return value will always be a :class:`!str`.

:raises TypeError, ValueError:
    * If any of the arguments have an invalid type or value.
      This includes any keywords passed to the underlying hash's
      :meth:`PasswordHash.hash() <passlib.ifc.PasswordHash.hash>` method.

.. seealso:: the :ref:`context-basic-example` example in the tutorial
ziCryptContext.hash(): 'scheme' keyword is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0)rrXr rr�)r>rurLrxr�r�rs&&&&,  rr��CryptContext.hashsZ��V��
�B�"�
�
�!�!�&�3���6�6�����&��{�{�6�*�T�*�*rzCryptContext.hash()c
�&�VP!V/VB#)z�
Legacy alias for :meth:`hash`.

.. deprecated:: 1.7
    This method was renamed to :meth:`!hash` in version 1.7.
    This alias will be removed in version 2.0, and should only
    be used for compatibility with Passlib 1.3 - 1.6.
)r�r2s&*,r�encrypt�CryptContext.encrypt@s���y�y�$�'�$�'�'rc
���Ve\R\4VfVP4R#VPW#V4pVPpV'd	V!WV4VP
!W3/VB#)a�verify secret against an existing hash.

If no scheme is specified, this will attempt to identify
the scheme based on the contents of the provided hash
(limited to the schemes configured for this context).
It will then check whether the password verifies against the hash.

:type secret: str or bytes
:arg secret:
    the secret to verify

:type hash: str or bytes
:arg hash:
    hash string to compare to

    if ``None`` is passed in, this will be treated as "never verifying"

:type scheme: str
:param scheme:
    Optionally force context to use specific scheme.
    This is usually not needed, as most hashes can be unambiguously
    identified. Scheme must be one of the ones configured
    for this context
    (see the :ref:`schemes <context-schemes-option>` option).

    .. deprecated:: 1.7

        Support for this keyword is deprecated, and will be removed in Passlib 2.0.

:type category: str or None
:param category:
    Optional :ref:`user category <user-categories>` string.
    This is mainly used when generating new hashes, it has little
    effect when verifying; this keyword is mainly provided for symmetry.

:param \*\*kwds:
    All additional keywords are passed to the appropriate handler,
    and should match its :attr:`~passlib.ifc.PasswordHash.context_kwds`.

:returns:
    ``True`` if the password matched the hash, else ``False``.

:raises ValueError:
    * if the hash did not match any of the configured :meth:`schemes`.

    * if any of the arguments have an invalid value (this includes
      any keywords passed to the underlying hash's
      :meth:`PasswordHash.verify() <passlib.ifc.PasswordHash.verify>` method).

:raises TypeError:
    * if any of the arguments have an invalid type (this includes
      any keywords passed to the underlying hash's
      :meth:`PasswordHash.verify() <passlib.ifc.PasswordHash.verify>` method).

.. seealso:: the :ref:`context-basic-example` example in the tutorial
�kCryptContext.verify(): 'scheme' keyword is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0F)rrX�dummy_verifyrnr�verify)r>rur�rLrxr�r�rs&&&&&,  rr��CryptContext.verifyNsr��v��
�B�"�
�
�<�
������-�-�d�H�E���6�6�����&��}�}�V�2�T�2�2rc
��Ve\R\4VfVP4R#VPW#V4pVPpV'd"V'dVP4pV!W�4MTpVP!W3/VB'gR#VP'gVPW!R7'dRVP!V3RV/VB3#R#)aX	verify password and re-hash the password if needed, all in a single call.

This is a convenience method which takes care of all the following:
first it verifies the password (:meth:`~CryptContext.verify`), if this is successfull
it checks if the hash needs updating (:meth:`~CryptContext.needs_update`), and if so,
re-hashes the password (:meth:`~CryptContext.hash`), returning the replacement hash.
This series of steps is a very common task for applications
which wish to update deprecated hashes, and this call takes
care of all 3 steps efficiently.

:type secret: str or bytes
:arg secret:
    the secret to verify

:type secret: str or bytes
:arg hash:
    hash string to compare to.

    if ``None`` is passed in, this will be treated as "never verifying"

:type scheme: str
:param scheme:
    Optionally force context to use specific scheme.
    This is usually not needed, as most hashes can be unambiguously
    identified. Scheme must be one of the ones configured
    for this context
    (see the :ref:`schemes <context-schemes-option>` option).

    .. deprecated:: 1.7

        Support for this keyword is deprecated, and will be removed in Passlib 2.0.

:type category: str or None
:param category:
    Optional :ref:`user category <user-categories>`.
    If specified, this will cause any category-specific defaults to
    be used if the password has to be re-hashed.

:param \*\*kwds:
    all additional keywords are passed to the appropriate handler,
    and should match that hash's
    :attr:`PasswordHash.context_kwds <passlib.ifc.PasswordHash.context_kwds>`.

:returns:
    This function returns a tuple containing two elements:
    ``(verified, replacement_hash)``. The first is a boolean
    flag indicating whether the password verified,
    and the second an optional replacement hash.
    The tuple will always match one of the following 3 cases:

    * ``(False, None)`` indicates the secret failed to verify.
    * ``(True, None)`` indicates the secret verified correctly,
      and the hash does not need updating.
    * ``(True, str)`` indicates the secret verified correctly,
      but the current hash needs to be updated. The :class:`!str`
      will be the freshly generated hash, to replace the old one.

:raises TypeError, ValueError:
    For the same reasons as :meth:`verify`.

.. seealso:: the :ref:`context-migration-example` example in the tutorial.
r�rtTrx)FN)TN)
rrXr�rnrr�r�rmrvr�)	r>rur�rLrxr�r�r�
clean_kwdss	&&&&&,   r�verify_and_update�CryptContext.verify_and_update�s���@���B�"�
�
�<�
�������-�-�d�H�E���6�6���D�����J���,��J�
�}�}�V�8�Z�8�8�������� 3� 3�D� 3� H� H�����6�E�H�E��E�E�E��rztoo many secretsc
�8�VPVP4#)z.
precalculated hash for dummy_verify() to use
)r��
_dummy_secretrs&r�_dummy_hash�CryptContext._dummy_hash�s��
�y�y��+�+�,�,rc
�N�\V4PPV4R#)z.
flush memoized values used by dummy_verify()
N)rFr��clear_cachers&rr� CryptContext._reset_dummy_verifys��	
�T�
���*�*�4�0rc
�R�VPVPVP4R#)z�
Helper that applications can call when user wasn't found,
in order to simulate time it would take to hash a password.

Runs verify() against a dummy hash, to simulate verification
of a real account password.

.. versionadded:: 1.7
F)r�r�r�rs&rr��CryptContext.dummy_verify
s!��	
���D�&�&��(8�(8�9�rc
�D�VPVR4P'*#)a6
test if hash represents a usuable password --
i.e. does not represent an unusuable password such as ``"!"``,
which is recognized by the :class:`~passlib.hash.unix_disabled` hash.

:raises ValueError:
    if the hash is not recognized
    (typically solved by adding ``unix_disabled`` to the list of schemes).
N)r!r�)r>r�s&&r�
is_enabled�CryptContext.is_enableds ���(�(��t�4�@�@�@�@rc
�x�VPPpVP'gQhVPV4#)a�
return a string to disable logins for user,
usually by returning a non-verifying string such as ``"!"``.

:param hash:
    Callers can optionally provide the account's existing hash.
    Some disabled handlers (such as :class:`!unix_disabled`)
    will encode this into the returned value,
    so that it can be recovered via :meth:`enable`.

:raises RuntimeError:
    if this function is called w/o a disabled hasher
    (such as :class:`~passlib.hash.unix_disabled`) included
    in the list of schemes.

:returns:
    hash string which will be recognized as valid by the context,
    but is guaranteed to not validate against *any* password.
)rr�r��disable�r>r�r�s&& rr��CryptContext.disable#s4��(���-�-���!�!�!�!�!��~�~�d�#�#rc
�p�VPVR4pVP'dVPV4#V#)as
inverse of :meth:`disable` --
attempts to recover original hash which was converted
by a :meth:`!disable` call into a disabled hash --
thus restoring the user's original password.

:raises ValueError:
    if original hash not present, or if the disabled handler doesn't
    support encoding the original hash (e.g. ``django_disabled``)

:returns:
    the original hash.
N)r!r��enabler�s&& rr��CryptContext.enable;s6���&�&�t�T�2�������=�=��&�&��r)rr r!r)�passlib�utf-8)NT)Fr�r�)FNF)NFF)NNFr�)r�)NN)NNN)NFFFr�)6r�r�r�r�r�rr r!�classmethodr�r�r�r�r�r@rr�rr�r�rr�r8r�r1rD�propertyr�rJrQrWr_rjrnrrvrr{r~r�r�r�r�r�r�r�rr�rr�r�r�r�r�rrrrr�s���
�:�G��K��������$��$�L����<$�L!�O�*4��&��&�
.�m3�^� �� �8)�B�>2�b1S�f
��)��)������(��(�&"
�H�&�D5� � EM�N��%�5R��9��9��%��7�,�8�,��%��7�6�8�6�*�X8+�t��%�5J��	(��	(�M3�^[�|'�M��-��-�1��
A�$�0rc�@a�]tRtRtRtRtRRltV3RltRtRt	V;t
#)	riQa�CryptContext subclass which doesn't load handlers until needed.

This is a subclass of CryptContext which takes in a set of arguments
exactly like CryptContext, but won't import any handlers
(or even parse its arguments) until
the first time one of its methods is accessed.

:arg schemes:
    The first positional argument can be a list of schemes, or omitted,
    just like CryptContext.

:param onload:

    If a callable is passed in via this keyword,
    it will be invoked at lazy-load time
    with the following signature:
    ``onload(**kwds) -> kwds``;
    where ``kwds`` is all the additional kwds passed to LazyCryptContext.
    It should perform any additional deferred initialization,
    and return the final dict of options to be passed to CryptContext.

    .. versionadded:: 1.6

:param kwds:

    All additional keywords are passed to CryptContext;
    or to the *onload* function (if provided).

This is mainly used internally by modules such as :mod:`passlib.apps`,
which define a large number of contexts, but only a few of them will be needed
at any one time. Use of this class saves the memory needed to import
the specified handlers until the context instance is actually accessed.
As well, it allows constructing a context at *module-init* time,
but using :func:`!onload()` to provide dynamic configuration
at *application-run* time.

.. note::
    This class is only useful if you're referencing handler objects by name,
    and don't want them imported until runtime. If you want to have the config
    validated before your application runs, or are passing in already-imported
    handler instances, you should use :class:`CryptContext` instead.

.. versionadded:: 1.4
Nc	�"�VeWR&W nR#)Nr8)�
_lazy_kwds)r>r8r�s&&,rr@�LazyCryptContext.__init__�s����%��O��rc	�<�VPpRV9dVPR4pV!R/VBpV=\SV`!R/VB\VnR#)�onloadNr)r�r��superr@r�	__class__)r>r�r�r�s&  �r�
_lazy_init�LazyCryptContext._lazy_init�sI��������t���X�X�h�'�F��>�D�>�D��O�
��� �4� �%��rc	���VPR4'dVPR4'dVPeVP4\P	W4#)�_r))�
startswithr�r��object�__getattribute__)r>�attrs&&rr��!LazyCryptContext.__getattribute__�sD������$�$�����(=�(=��o�o�)��O�O���&�&�t�2�2r)r�r�r�)r�r�r�r�r�r�r@r�r�r��
__classcell__)r�s@rrrQs$���+�Z�J��
&�3�3r)+�
__future__rr��configparserr�ior�warningsrr�r�passlib.excrr	r
�passlib.registryrr�
passlib.utilsr
r�rr�passlib.utils.compatrr�passlib.utils.decorrr�__all__r��_UNSETr'rTrgr�r%rhr2rWr5rrrrr�<module>r�s���"�	�%����T�T�F����E�����
���� ���M������#����<��(�-�8�9��B	<�B	<�JB�B�J&G3�|�G3r

Youez - 2016 - github.com/yon3zu
LinuXploit