Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit d2656c4

Browse files
committed
list_deser should transform str into list of str.
1 parent 711c799 commit d2656c4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/oidcmsg/message.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,11 @@ def list_deserializer(val, sformat="urlencoded"):
871871
return val.split(" ")
872872
elif isinstance(val, list) and len(val) == 1:
873873
return val[0].split(" ")
874-
else:
875-
return val
874+
elif sformat == "dict":
875+
if isinstance(val, str):
876+
val = [val]
877+
878+
return val
876879

877880

878881
def sp_sep_list_serializer(vals, sformat="urlencoded", lev=0):

tests/test_06_oidc.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,4 +1614,11 @@ def test_ID_Token_space_in_id():
16141614
"iat": 1632495659
16151615
})
16161616

1617-
assert idt["aud"] == "client_ifCttPphtLxtPWd20602 ^.+/"
1617+
assert idt["aud"] == ["client_ifCttPphtLxtPWd20602 ^.+/"]
1618+
1619+
idt = IdToken(**{'at_hash': 'rgMbiR-Dj11dQjxhCyLkOw', 'sub': 'user-subject-1234531',
1620+
'aud': 'client_dVCwIQuSKklinFP70742;#__$',
1621+
'iss': 'https://www.certification.openid.net/test/a/idpy/', 'exp': 1632639462,
1622+
'nonce': 'hUT3RhSooxC9CilrD8al6bGx', 'iat': 1632639162})
1623+
1624+
assert idt["aud"] == ["client_dVCwIQuSKklinFP70742;#__$"]

0 commit comments

Comments
 (0)