File tree 3 files changed +6
-5
lines changed
3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -308,8 +308,8 @@ def test_unknown_idp(self):
308
308
metadata_file = "remote_metadata_three_idps.xml" ,
309
309
)
310
310
311
- response = self .client .get (reverse ("saml2_login" ) + "?idp=https://unknown.org" )
312
- self .assertEqual (response . status_code , 403 )
311
+ response = self .client .get (reverse ("saml2_login" ) + "?idp=<b> https://unknown.org</b> " )
312
+ self .assertContains (response , "<b>https://unknown.org</b>" , status_code = 403 )
313
313
314
314
def test_login_authn_context (self ):
315
315
sp_kwargs = {
Original file line number Diff line number Diff line change 30
30
from django .template import TemplateDoesNotExist
31
31
from django .urls import reverse
32
32
from django .utils .decorators import method_decorator
33
+ from django .utils .html import escape
33
34
from django .utils .module_loading import import_string
34
35
from django .utils .translation import gettext_lazy as _
35
36
from django .views .decorators .csrf import csrf_exempt
@@ -152,9 +153,9 @@ def get_next_path(self, request: HttpRequest) -> str:
152
153
return next_path
153
154
154
155
def unknown_idp (self , request , idp ):
155
- msg = f"Error: IdP EntityID { idp } was not found in metadata"
156
+ msg = f"Error: IdP EntityID { escape ( idp ) } was not found in metadata"
156
157
logger .error (msg )
157
- return HttpResponse (msg . format ( "Please contact technical support." ) , status = 403 )
158
+ return HttpResponse (msg , status = 403 )
158
159
159
160
def load_sso_kwargs_scoping (self , sso_kwargs ):
160
161
"""Performs IdP Scoping if scoping param is present."""
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def read(*rnames):
27
27
28
28
setup (
29
29
name = "djangosaml2" ,
30
- version = "1.5.5 " ,
30
+ version = "1.5.6 " ,
31
31
description = "pysaml2 integration for Django" ,
32
32
long_description = read ("README.md" ),
33
33
long_description_content_type = "text/markdown" ,
You can’t perform that action at this time.
0 commit comments