File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,17 @@ def handler(event, context: LambdaContext) -> dict:
104104 if not domains .issubset (refresh_token ['domains' ]):
105105 return bad_request ('' , 'domain requested outside refresh_token' )
106106
107- # Validate no commas in subject or existing sub chain to avoid join ambiguity
107+ # Normalize and validate no commas in subject or existing sub chain to avoid join ambiguity
108108 if ',' in subject :
109109 return bad_request ('' , 'subject contains invalid comma' )
110+
110111 existing_sub = refresh_token .get ('sub' , [])
111- if any (',' in s for s in existing_sub if isinstance (s , str )):
112- return bad_request ('' , 'existing sub chain contains invalid comma' )
112+ if isinstance (existing_sub , str ):
113+ if ',' in existing_sub :
114+ return bad_request ('' , 'existing sub chain string contains invalid comma' )
115+ elif isinstance (existing_sub , list ):
116+ if any (',' in s for s in existing_sub if isinstance (s , str )):
117+ return bad_request ('' , 'existing sub chain array contains invalid comma' )
113118
114119 delegate_token = {
115120 'iat' : int (time .time ()),
You can’t perform that action at this time.
0 commit comments