File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ import json
12from typing import TypeVar
23import cryptojwt .jwe .exception
34import satosa .context
@@ -98,7 +99,10 @@ def parse_and_validate(
9899 if (state := resp_data .get ("state" , None )):
99100 d ["state" ] = state
100101 if (presentation_submission := resp_data ["presentation_submission" ]):
101- d ["presentation_submission" ] = presentation_submission
102+ if isinstance (presentation_submission , dict ):
103+ d ["presentation_submission" ] = presentation_submission
104+ else :
105+ d ["presentation_submission" ] = json .loads (presentation_submission )
102106 return AuthorizeResponsePayload (** d )
103107 except Exception as e :
104108 raise AuthRespParsingException (
Original file line number Diff line number Diff line change 1+ import json
12import pytest
23import satosa .context
34
@@ -48,7 +49,7 @@ def test_direct_post_parser_good_case():
4849 ctx .request = {
4950 "vp_token" : vp_token ,
5051 "state" : state ,
51- "presentation_submission" : presentation_submission ,
52+ "presentation_submission" : json . dumps ( presentation_submission ) ,
5253 }
5354
5455 resp = parser .parse_and_validate (ctx )
@@ -87,7 +88,7 @@ def test_direct_post_response_bad_parse_case():
8788 ctx .qs_params = {
8889 "vp_token" : vp_token ,
8990 "state" : state ,
90- "presentation_submission" : presentation_submission ,
91+ "presentation_submission" : json . dumps ( presentation_submission ) ,
9192 }
9293
9394 try :
You can’t perform that action at this time.
0 commit comments