This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree 3 files changed +16
-2
lines changed
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):
46
46
if "error_description" in self :
47
47
# Verify that the characters used are within the allow ranges
48
48
# %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" ]):
50
50
raise ValueError ("Characters outside allowed set" )
51
51
return True
52
52
Original file line number Diff line number Diff line change 34
34
35
35
__author__ = 'Roland Hedberg'
36
36
37
+ from oidcmsg .oauth2 import ResponseMessage
38
+
37
39
keys = [
38
40
{"type" : "RSA" , "use" : ["sig" ]},
39
41
{"type" : "RSA" , "use" : ["enc" ]},
@@ -496,3 +498,16 @@ def test_msg_ser():
496
498
msg_ser ([1 ,2 ], 'dict' )
497
499
with pytest .raises (OidcMsgError ):
498
500
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):
62
62
class TestEndSessionResponse (object ):
63
63
def test_example (self ):
64
64
esr = EndSessionResponse ()
65
- pass
66
65
67
66
68
67
class TestEndSessionRequest (object ):
You can’t perform that action at this time.
0 commit comments