@@ -496,7 +496,7 @@ def get_urlinfo(info):
496496
497497 def post_parse_response (self , response , ** kwargs ):
498498 """
499- This method does post processing of the service response.
499+ This method does post- processing of the service response.
500500 Each service have their own version of this method.
501501
502502 :param response: The service response
@@ -542,6 +542,9 @@ def _do_jwt(self, info):
542542 def _do_response (self , info , sformat , ** kwargs ):
543543 _context = self .upstream_get ("context" )
544544
545+ if isinstance (info , list ): # Don't have support for sformat=list
546+ return info
547+
545548 try :
546549 resp = self .response_cls ().deserialize (info , sformat , iss = _context .issuer , ** kwargs )
547550 except Exception as err :
@@ -569,7 +572,7 @@ def parse_response(
569572 state : Optional [str ] = "" ,
570573 behaviour_args : Optional [dict ] = None ,
571574 ** kwargs ,
572- ):
575+ ) :
573576 """
574577 This the start of a pipeline that will:
575578
@@ -631,22 +634,27 @@ def parse_response(
631634 LOGGER .debug ("response_cls: %s" , self .response_cls .__name__ )
632635
633636 if resp is None :
634- if not info :
637+ if self .response_cls == list and info == []:
638+ return info
639+ elif not info :
635640 LOGGER .error ("Missing or faulty response" )
636641 raise ResponseError ("Missing or faulty response" )
637642
638643 if sformat == "text" :
639644 resp = info
640645 else :
641646 resp = self ._do_response (info , sformat , ** kwargs )
642- LOGGER .debug ('Initial response parsing => "%s"' , resp .to_dict ())
647+ if isinstance (resp , Message ):
648+ LOGGER .debug (f'Initial response parsing => "{ resp .to_dict ()} "' )
649+ else :
650+ LOGGER .debug (f'Initial response parsing => "{ resp } "' )
643651
644652 # is this an error message
645653 if sformat == "text" :
646654 pass
647655 elif is_error_message (resp ):
648656 LOGGER .debug ("Error response: %s" , resp )
649- else :
657+ elif isinstance ( resp , Message ) :
650658 vargs = self .gather_verify_arguments (response = resp , behaviour_args = behaviour_args )
651659 LOGGER .debug ("Verify response with %s" , vargs )
652660 try :
0 commit comments