Skip to content

Commit c53d8ba

Browse files
committed
Fix SAMLACSView missing _prepare_django_request method
Added the missing _prepare_django_request method to SAMLACSView class that prepares Django request data for python3-saml. Bumped version to 0.5.14
1 parent b1118cd commit c53d8ba

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

django_forms_workflows/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Enterprise-grade, database-driven form builder with approval workflows
44
"""
55

6-
__version__ = "0.5.13"
6+
__version__ = "0.5.14"
77
__author__ = "Django Forms Workflows Contributors"
88
__license__ = "LGPL-3.0-only"
99

django_forms_workflows/sso_views.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,23 @@ class SAMLACSView(View):
104104
Receives SAML responses from the IdP and authenticates the user.
105105
"""
106106

107+
def _prepare_django_request(self, request):
108+
"""
109+
Prepare a Django request for python3-saml.
110+
111+
Returns a dict with the request data in the format expected by OneLogin_Saml2_Auth.
112+
"""
113+
return {
114+
"https": "on" if request.is_secure() else "off",
115+
"http_host": request.META["HTTP_HOST"],
116+
"script_name": request.META["PATH_INFO"],
117+
"server_port": request.META.get(
118+
"SERVER_PORT", "443" if request.is_secure() else "80"
119+
),
120+
"get_data": request.GET.copy(),
121+
"post_data": request.POST.copy(),
122+
}
123+
107124
def post(self, request):
108125
if not is_saml_available():
109126
return HttpResponseBadRequest(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-forms-workflows"
3-
version = "0.5.13"
3+
version = "0.5.14"
44
description = "Enterprise-grade, database-driven form builder with approval workflows and external data integration"
55
license = "LGPL-3.0-only"
66
readme = "README.md"

0 commit comments

Comments
 (0)