plain.auth 0.20.7__py3-none-any.whl → 0.22.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plain/auth/CHANGELOG.md +20 -0
- plain/auth/views.py +5 -10
- {plain_auth-0.20.7.dist-info → plain_auth-0.22.0.dist-info}/METADATA +1 -1
- {plain_auth-0.20.7.dist-info → plain_auth-0.22.0.dist-info}/RECORD +6 -6
- {plain_auth-0.20.7.dist-info → plain_auth-0.22.0.dist-info}/WHEEL +0 -0
- {plain_auth-0.20.7.dist-info → plain_auth-0.22.0.dist-info}/licenses/LICENSE +0 -0
plain/auth/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# plain-auth changelog
|
|
2
2
|
|
|
3
|
+
## [0.22.0](https://github.com/dropseed/plain/releases/plain-auth@0.22.0) (2025-11-24)
|
|
4
|
+
|
|
5
|
+
### What's changed
|
|
6
|
+
|
|
7
|
+
- Replaced `AuthViewMixin` with `AuthView` class that inherits from `SessionView` for better typing and simpler view inheritance ([569afd6](https://github.com/dropseed/plain/commit/569afd606d))
|
|
8
|
+
|
|
9
|
+
### Upgrade instructions
|
|
10
|
+
|
|
11
|
+
- Replace `class MyView(AuthViewMixin, View)` with `class MyView(AuthView)` - the new `AuthView` class already inherits from the appropriate base classes
|
|
12
|
+
|
|
13
|
+
## [0.21.0](https://github.com/dropseed/plain/releases/plain-auth@0.21.0) (2025-11-12)
|
|
14
|
+
|
|
15
|
+
### What's changed
|
|
16
|
+
|
|
17
|
+
- Improved type checking compatibility by adding type ignore comment for mixin method resolution in `AuthViewMixin` ([f4dbcef](https://github.com/dropseed/plain/commit/f4dbcefa92))
|
|
18
|
+
|
|
19
|
+
### Upgrade instructions
|
|
20
|
+
|
|
21
|
+
- No changes required
|
|
22
|
+
|
|
3
23
|
## [0.20.7](https://github.com/dropseed/plain/releases/plain-auth@0.20.7) (2025-10-31)
|
|
4
24
|
|
|
5
25
|
### What's changed
|
plain/auth/views.py
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from functools import cached_property
|
|
4
|
-
from typing import
|
|
4
|
+
from typing import Any
|
|
5
5
|
from urllib.parse import urlparse, urlunparse
|
|
6
6
|
|
|
7
7
|
from plain.exceptions import PermissionDenied
|
|
8
8
|
from plain.http import (
|
|
9
9
|
Http404,
|
|
10
10
|
QueryDict,
|
|
11
|
-
|
|
11
|
+
ResponseBase,
|
|
12
12
|
ResponseRedirect,
|
|
13
13
|
)
|
|
14
14
|
from plain.runtime import settings
|
|
15
|
-
from plain.sessions.views import
|
|
15
|
+
from plain.sessions.views import SessionView
|
|
16
16
|
from plain.urls import reverse
|
|
17
17
|
from plain.utils.cache import patch_cache_control
|
|
18
18
|
from plain.views import View
|
|
@@ -20,9 +20,6 @@ from plain.views import View
|
|
|
20
20
|
from .sessions import logout
|
|
21
21
|
from .utils import resolve_url
|
|
22
22
|
|
|
23
|
-
if TYPE_CHECKING:
|
|
24
|
-
from plain.http import Request
|
|
25
|
-
|
|
26
23
|
try:
|
|
27
24
|
from plain.admin.impersonate import get_request_impersonator
|
|
28
25
|
except ImportError:
|
|
@@ -35,13 +32,11 @@ class LoginRequired(Exception):
|
|
|
35
32
|
self.redirect_field_name = redirect_field_name
|
|
36
33
|
|
|
37
34
|
|
|
38
|
-
class
|
|
35
|
+
class AuthView(SessionView):
|
|
39
36
|
login_required = False
|
|
40
37
|
admin_required = False # Implies login_required
|
|
41
38
|
login_url = settings.AUTH_LOGIN_URL
|
|
42
39
|
|
|
43
|
-
request: Request
|
|
44
|
-
|
|
45
40
|
@cached_property
|
|
46
41
|
def user(self) -> Any | None:
|
|
47
42
|
"""Get the authenticated user for this request."""
|
|
@@ -84,7 +79,7 @@ class AuthViewMixin(SessionViewMixin):
|
|
|
84
79
|
# Show a 404 so we don't expose admin urls to non-admin users
|
|
85
80
|
raise Http404()
|
|
86
81
|
|
|
87
|
-
def get_response(self) ->
|
|
82
|
+
def get_response(self) -> ResponseBase:
|
|
88
83
|
try:
|
|
89
84
|
self.check_auth()
|
|
90
85
|
except LoginRequired as e:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
plain/auth/CHANGELOG.md,sha256=
|
|
1
|
+
plain/auth/CHANGELOG.md,sha256=exRD-vtzfuTTesjNgJuLkh0RO6XtDV1pMv-To_f_Yas,7600
|
|
2
2
|
plain/auth/README.md,sha256=I1SeOyrBnF0GAjD7T0k5OlZ2bSHz9---nElinaobewc,4030
|
|
3
3
|
plain/auth/__init__.py,sha256=CrOsS74CPGN1nPTTfie13mPgdyVLRyZ1YwDPIA77uaA,179
|
|
4
4
|
plain/auth/default_settings.py,sha256=65VzDn3j61OMn78Lg6Zuds4A8QKzJJ_0G9KoFqAOIRo,466
|
|
@@ -7,8 +7,8 @@ plain/auth/sessions.py,sha256=xDp1EiB0cV5w3L5XioqO8vs77wnF8cvreExms3-e744,6015
|
|
|
7
7
|
plain/auth/templates.py,sha256=CVtuIdBgOgYB2o61zpOPJb6nMx_gU61i_3PDQx8FjVs,770
|
|
8
8
|
plain/auth/test.py,sha256=SHawhwarJEMVfaLkjpiuFVSWZoGIMwhzXreU_T1zvCE,1599
|
|
9
9
|
plain/auth/utils.py,sha256=9kKWh1QqxA8Esct-jBvTCdjBYOHpO_Tg1YeV9WxYmxg,1362
|
|
10
|
-
plain/auth/views.py,sha256=
|
|
11
|
-
plain_auth-0.
|
|
12
|
-
plain_auth-0.
|
|
13
|
-
plain_auth-0.
|
|
14
|
-
plain_auth-0.
|
|
10
|
+
plain/auth/views.py,sha256=5R3DxMil3j7iStomFH4GcJNG-m-YZzYgCS6UMdi2YjY,4924
|
|
11
|
+
plain_auth-0.22.0.dist-info/METADATA,sha256=j3q9wOhxWj9yxMk4qTHOv18HtYRN97lOIJngoq-dy74,4423
|
|
12
|
+
plain_auth-0.22.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
13
|
+
plain_auth-0.22.0.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
|
|
14
|
+
plain_auth-0.22.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|