File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 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):
308308 metadata_file = "remote_metadata_three_idps.xml" ,
309309 )
310310
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 )
313313
314314 def test_login_authn_context (self ):
315315 sp_kwargs = {
Original file line number Diff line number Diff line change 3030from django .template import TemplateDoesNotExist
3131from django .urls import reverse
3232from django .utils .decorators import method_decorator
33+ from django .utils .html import escape
3334from django .utils .module_loading import import_string
3435from django .utils .translation import gettext_lazy as _
3536from django .views .decorators .csrf import csrf_exempt
@@ -152,9 +153,9 @@ def get_next_path(self, request: HttpRequest) -> str:
152153 return next_path
153154
154155 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"
156157 logger .error (msg )
157- return HttpResponse (msg . format ( "Please contact technical support." ) , status = 403 )
158+ return HttpResponse (msg , status = 403 )
158159
159160 def load_sso_kwargs_scoping (self , sso_kwargs ):
160161 """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):
2727
2828setup (
2929 name = "djangosaml2" ,
30- version = "1.5.5 " ,
30+ version = "1.5.6 " ,
3131 description = "pysaml2 integration for Django" ,
3232 long_description = read ("README.md" ),
3333 long_description_content_type = "text/markdown" ,
You can’t perform that action at this time.
0 commit comments