#NEWLINE# def response_factory( xmlstr , conf , return_addrs = None , outstanding_queries = None , timeslack = 0 , decode = True , request_id = 0 , origxml = None , asynchop = True , allow_unsolicited = False , want_assertions_signed = False ) : #NEWLINE# #INDENT# sec_context = security_context ( conf ) #NEWLINE# if ( not timeslack ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# timeslack = int ( conf . accepted_time_diff ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# timeslack = 0 #NEWLINE# #UNINDENT# #UNINDENT# attribute_converters = conf . attribute_converters #NEWLINE# entity_id = conf . entityid #NEWLINE# extension_schema = conf . extension_schema #NEWLINE# response = StatusResponse ( sec_context , return_addrs , timeslack , request_id , asynchop ) #NEWLINE# try : #NEWLINE# #INDENT# response . loads ( xmlstr , decode , origxml ) #NEWLINE# if ( response . response . assertion or response . response . encrypted_assertion ) : #NEWLINE# #INDENT# authnresp = AuthnResponse ( sec_context , attribute_converters , entity_id , return_addrs , outstanding_queries , timeslack , asynchop , allow_unsolicited , extension_schema = extension_schema , want_assertions_signed = want_assertions_signed ) #NEWLINE# authnresp . update ( response ) #NEWLINE# return authnresp #NEWLINE# #UNINDENT# #UNINDENT# except TypeError : #NEWLINE# #INDENT# response . signature_check = sec_context . correctly_signed_logout_response #NEWLINE# response . loads ( xmlstr , decode , origxml ) #NEWLINE# logoutresp = LogoutResponse ( sec_context , return_addrs , timeslack , asynchop = asynchop ) #NEWLINE# logoutresp . update ( response ) #NEWLINE# return logoutresp #NEWLINE# #UNINDENT# return response