diff options
| author | HappyDingning <ssdyny@foxmail.com> | 2023-05-15 00:12:22 +0800 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-05-18 09:39:04 +0200 |
| commit | 674c23999cb6982a9d447fedec4d72e135201fee (patch) | |
| tree | ee9a368e355adca083a2a3583b06ba8a07c935fb /docs | |
| parent | 4e73d8c04d15f9cbae067249c7ff39dec9d66eb1 (diff) | |
Fixed #34565 -- Added support for async checking of user passwords.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/auth.txt | 7 | ||||
| -rw-r--r-- | docs/releases/5.0.txt | 4 | ||||
| -rw-r--r-- | docs/topics/auth/customizing.txt | 7 | ||||
| -rw-r--r-- | docs/topics/auth/passwords.txt | 7 |
4 files changed, 25 insertions, 0 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt index 90ae5904a8..61fd74a38f 100644 --- a/docs/ref/contrib/auth.txt +++ b/docs/ref/contrib/auth.txt @@ -166,11 +166,18 @@ Methods were used. .. method:: check_password(raw_password) + .. method:: acheck_password(raw_password) + + *Asynchronous version*: ``acheck_password()`` Returns ``True`` if the given raw string is the correct password for the user. (This takes care of the password hashing in making the comparison.) + .. versionchanged:: 5.0 + + ``acheck_password()`` method was added. + .. method:: set_unusable_password() Marks the user as having no password set. This isn't the same as diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt index d40cd6a4f0..0c093720b9 100644 --- a/docs/releases/5.0.txt +++ b/docs/releases/5.0.txt @@ -153,6 +153,10 @@ Minor features * ``AuthenticationMiddleware`` now adds an :meth:`.HttpRequest.auser` asynchronous method that returns the currently logged-in user. +* The new :func:`django.contrib.auth.hashers.acheck_password` asynchronous + function and :meth:`.AbstractBaseUser.acheck_password` method allow + asynchronous checking of user passwords. + :mod:`django.contrib.contenttypes` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt index 6cc48cacb1..78bee37a0f 100644 --- a/docs/topics/auth/customizing.txt +++ b/docs/topics/auth/customizing.txt @@ -695,11 +695,18 @@ The following attributes and methods are available on any subclass of were used. .. method:: models.AbstractBaseUser.check_password(raw_password) + .. method:: models.AbstractBaseUser.acheck_password(raw_password) + + *Asynchronous version*: ``acheck_password()`` Returns ``True`` if the given raw string is the correct password for the user. (This takes care of the password hashing in making the comparison.) + .. versionchanged:: 5.0 + + ``acheck_password()`` method was added. + .. method:: models.AbstractBaseUser.set_unusable_password() Marks the user as having no password set. This isn't the same as diff --git a/docs/topics/auth/passwords.txt b/docs/topics/auth/passwords.txt index 695c8d2571..0876ac4f6e 100644 --- a/docs/topics/auth/passwords.txt +++ b/docs/topics/auth/passwords.txt @@ -478,6 +478,9 @@ to create and validate hashed passwords. You can use them independently from the ``User`` model. .. function:: check_password(password, encoded, setter=None, preferred="default") +.. function:: acheck_password(password, encoded, asetter=None, preferred="default") + + *Asynchronous version*: ``acheck_password()`` If you'd like to manually authenticate a user by comparing a plain-text password to the hashed password in the database, use the convenience @@ -490,6 +493,10 @@ from the ``User`` model. to use the default (first entry of ``PASSWORD_HASHERS`` setting). See :ref:`auth-included-hashers` for the algorithm name of each hasher. + .. versionchanged:: 5.0 + + ``acheck_password()`` method was added. + .. function:: make_password(password, salt=None, hasher='default') Creates a hashed password in the format used by this application. It takes |
