�
H�gt7 � �� � d Z ddlZ ej e� � ZddlZddlmZ dgZd� Z ddl
mZmZm
Z
e e� � G d� de� � � � Z G d� d e� � ZdS )
z1passlib.ifc - abstract interfaces used by Passlib� N)�deprecated_method�PasswordHashc � � � � fd�}|S )z5class decorator that re-creates class using metaclassc � �� �t | � � u r| S �| j | j | j � � � � � S �N)�type�__name__� __bases__�__dict__�copy)�cls�metas ��[/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/passlib/ifc.py�builderz(recreate_with_metaclass.<locals>.builder s? �� ��4��9�9����J��t�C�L�#�-���1B�1B�1D�1D�E�E�E� � )r r s ` r �recreate_with_metaclassr s( �� �F� F� F� F� F� �Nr )�ABCMeta�abstractmethod�abstractpropertyc � � e Zd ZdZdZdZdZdZee d� � � � � Z
eddd� � � ed
� � � � � Zee d� � � � � Z
ee dd�� � � � Zedd
�� � Zee d� � � � � Z edd�� � ed� � � � � Z edd�� � ed� � � � � ZdZdS )r z�This class describes an abstract interface which all password hashes
in Passlib adhere to. Under Python 2.6 and up, this is an actual
Abstract Base Class built using the :mod:`!abc` module.
See the Passlib docs for full documentation.
FNTc � � t d� � �)a
Hash secret, returning result.
Should handle generating salt, etc, and should return string
containing identifier, salt & other configuration, as well as digest.
:param \\*\\*settings_kwds:
Pass in settings to customize configuration of resulting hash.
.. deprecated:: 1.7
Starting with Passlib 1.7, callers should no longer pass settings keywords
(e.g. ``rounds`` or ``salt`` directly to :meth:`!hash`); should use
``.using(**settings).hash(secret)`` construction instead.
Support will be removed in Passlib 2.0.
:param \\*\\*context_kwds:
Specific algorithms may require context-specific information (such as the user login).
�must be implemented by subclass��NotImplementedError)r
�secret�setting_and_context_kwdss r �hashzPasswordHash.hashr s � �6 "�"C�D�D�Dr z1.7z2.0z.hash())�
deprecated�removed�replacementc � � | j |i |��S )a
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 )r
�args�kwdss r �encryptzPasswordHash.encrypt� s � � �s�x��&��&�&�&r c � � t d� � �)z.verify secret against hash, returns True/Falser r )r
r r �context_kwdss r �verifyzPasswordHash.verify� � � � "�"C�D�D�Dr c � � t d� � �)a�
Return another hasher object (typically a subclass of the current one),
which integrates the configuration options specified by ``kwds``.
This should *always* return a new object, even if no configuration options are changed.
.. todo::
document which options are accepted.
:returns:
typically returns a subclass for most hasher implementations.
.. todo::
add this method to main documentation.
r r )r
�relaxedr% s r �usingzPasswordHash.using� s � �&