This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def verify(self, **kwargs):
4646 if "error_description" in self :
4747 # Verify that the characters used are within the allow ranges
4848 # %x20-21 / %x23-5B / %x5D-7E
49- if all (x in error_chars for x in self ["error_description" ]):
49+ if not all (x in error_chars for x in self ["error_description" ]):
5050 raise ValueError ("Characters outside allowed set" )
5151 return True
5252
Original file line number Diff line number Diff line change 3434
3535__author__ = 'Roland Hedberg'
3636
37+ from oidcmsg .oauth2 import ResponseMessage
38+
3739keys = [
3840 {"type" : "RSA" , "use" : ["sig" ]},
3941 {"type" : "RSA" , "use" : ["enc" ]},
@@ -496,3 +498,16 @@ def test_msg_ser():
496498 msg_ser ([1 ,2 ], 'dict' )
497499 with pytest .raises (OidcMsgError ):
498500 msg_ser ([1 ,2 ], 'list' )
501+
502+
503+ def test_error_description ():
504+ msg = ResponseMessage (error = "foobar" , error_description = "ÅÄÖ" )
505+ with pytest .raises (ValueError ):
506+ msg .verify ()
507+
508+ msg = ResponseMessage (error = "foobar" , error_description = "abc\n def" )
509+ with pytest .raises (ValueError ):
510+ msg .verify ()
511+
512+ msg = ResponseMessage (error = "foobar" , error_description = "abc def" )
513+ msg .verify ()
Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ def full_path(local_file):
6262class TestEndSessionResponse (object ):
6363 def test_example (self ):
6464 esr = EndSessionResponse ()
65- pass
6665
6766
6867class TestEndSessionRequest (object ):
You can’t perform that action at this time.
0 commit comments