[Django] #34391: Add async interface to contrib.auth

27 views
Skip to first unread message

Django

unread,
Mar 7, 2023, 8:04:17 PM3/7/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
----------------------------------------+------------------------
Reporter: Jon Janzen | Owner: nobody
Type: New feature | Status: new
Component: contrib.auth | Version: dev
Severity: Normal | Keywords: async
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
This module currently doesn't offer a way to work with it directly
asynchronously. Per the work in #31920 the middleware supports it, but if
you need to directly call any of the functions you need to manually wrap
them with the help of `sync_to_async`.

There are several functions here that could use an async version:
* `authenticate`
* `login`
* `logout`
* `get_user`
* `update_session_auth_hash`

I'd like to propose implementing them by just wrapping the synchronous
versions (for now). Later on we can asyncify the internals down to the
ORM. I've discussed doing this as part of a larger proposal at length
here: https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-
and-signals-and-maybe-sessions/18770

--
Ticket URL: <https://code.djangoproject.com/ticket/34391>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 7, 2023, 11:30:10 PM3/7/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
------------------------------+------------------------------------

Reporter: Jon Janzen | Owner: nobody
Type: New feature | Status: new
Component: contrib.auth | Version: dev
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* cc: Carlton Gibson (added)
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:1>

Django

unread,
Mar 7, 2023, 11:56:22 PM3/7/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
------------------------------+--------------------------------------
Reporter: Jon Janzen | Owner: Jon Janzen
Type: New feature | Status: assigned

Component: contrib.auth | Version: dev
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Jon Janzen):

* owner: nobody => Jon Janzen
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:2>

Django

unread,
Mar 8, 2023, 12:12:01 AM3/8/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
------------------------------+--------------------------------------
Reporter: Jon Janzen | Owner: Jon Janzen
Type: New feature | Status: assigned
Component: contrib.auth | Version: dev
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Jon Janzen):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/16636 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:3>

Django

unread,
Mar 8, 2023, 4:28:04 AM3/8/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
------------------------------+--------------------------------------
Reporter: Jon Janzen | Owner: Jon Janzen
Type: New feature | Status: assigned
Component: contrib.auth | Version: dev
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* needs_docs: 0 => 1
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:4>

Django

unread,
Mar 30, 2023, 12:12:56 AM3/30/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
------------------------------+--------------------------------------
Reporter: Jon Janzen | Owner: Jon Janzen
Type: New feature | Status: assigned
Component: contrib.auth | Version: dev
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Jon Janzen):

* needs_docs: 1 => 0
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:5>

Django

unread,
Jun 23, 2023, 3:52:12 PM6/23/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
------------------------------+--------------------------------------
Reporter: Jon Janzen | Owner: Jon Janzen
Type: New feature | Status: assigned
Component: contrib.auth | Version: dev
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"650ce967825aa192222391bfe3003c8d97e6f1d0" 650ce967]:
{{{
#!CommitTicketReference repository=""
revision="650ce967825aa192222391bfe3003c8d97e6f1d0"
Refs #34391 -- Updated asgiref dependency for 5.0 release series.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:6>

Django

unread,
Jun 27, 2023, 5:18:46 AM6/27/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
-------------------------------------+-------------------------------------

Reporter: Jon Janzen | Owner: Jon
| Janzen
Type: New feature | Status: assigned
Component: contrib.auth | Version: dev
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:7>

Django

unread,
Jun 27, 2023, 6:35:23 AM6/27/23
to django-...@googlegroups.com
#34391: Add async interface to contrib.auth
-------------------------------------+-------------------------------------
Reporter: Jon Janzen | Owner: Jon
| Janzen
Type: New feature | Status: closed
Component: contrib.auth | Version: dev
Severity: Normal | Resolution: fixed

Keywords: async | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"5e98959d9242c57a55c65847758781f82d386fa4" 5e98959]:
{{{
#!CommitTicketReference repository=""
revision="5e98959d9242c57a55c65847758781f82d386fa4"
Fixed #34391 -- Added async-compatible interface to auth functions and
related methods test clients.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34391#comment:8>

Reply all
Reply to author
Forward
0 new messages