pyobs-auth 2.0.0.dev2__tar.gz → 2.0.0.dev3__tar.gz
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.
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/PKG-INFO +1 -1
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/views.py +4 -2
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyproject.toml +1 -1
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/.gitignore +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/LICENSE +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/__init__.py +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/apps.py +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/authentication.py +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/client.py +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/discovery.py +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/py.typed +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/settings.py +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/urls.py +0 -0
- {pyobs_auth-2.0.0.dev2 → pyobs_auth-2.0.0.dev3}/pyobs_auth/validation.py +0 -0
|
@@ -29,7 +29,9 @@ class LoginView(View):
|
|
|
29
29
|
|
|
30
30
|
request.session[SESSION_STATE_KEY] = authorization.state
|
|
31
31
|
request.session[SESSION_CODE_VERIFIER_KEY] = authorization.code_verifier
|
|
32
|
-
|
|
32
|
+
# `or "/"` (not just a dict default) because `?next=` with an empty value is a present-but-
|
|
33
|
+
# falsy key - `.get("next", "/")` alone would return "" instead of falling back to "/".
|
|
34
|
+
request.session[SESSION_NEXT_KEY] = request.GET.get("next") or "/"
|
|
33
35
|
|
|
34
36
|
return HttpResponseRedirect(authorization.url)
|
|
35
37
|
|
|
@@ -44,7 +46,7 @@ class CallbackView(View):
|
|
|
44
46
|
state = request.GET.get("state")
|
|
45
47
|
expected_state = request.session.pop(SESSION_STATE_KEY, None)
|
|
46
48
|
code_verifier = request.session.pop(SESSION_CODE_VERIFIER_KEY, None)
|
|
47
|
-
next_url = request.session.pop(SESSION_NEXT_KEY, "/")
|
|
49
|
+
next_url = request.session.pop(SESSION_NEXT_KEY, "/") or "/"
|
|
48
50
|
|
|
49
51
|
if not code or not state or not code_verifier or state != expected_state:
|
|
50
52
|
return HttpResponseBadRequest("Invalid or expired login state")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyobs-auth"
|
|
3
|
-
version = "2.0.0.
|
|
3
|
+
version = "2.0.0.dev3"
|
|
4
4
|
description = "Shared Keycloak/OIDC authentication client for pyobs web services"
|
|
5
5
|
authors = [{ name = "Tim-Oliver Husser", email = "thusser@uni-goettingen.de" }]
|
|
6
6
|
requires-python = ">=3.11"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|