SAML-Toolkits / python3-saml

MIT License
682 stars 304 forks source link

tests fail: manager.add_key … TypeError: a bytes-like object is required, not 'NoneType' #272

Closed mcepl closed 1 year ago

mcepl commented 3 years ago

While running the test suite during the packaging the package for openSUSE I see this long list of failed errors:

[   32s] ______________ OneLogin_Saml2_Auth_Test.testBuildRequestSignature ______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testBuildRequestSignature>
[   32s] 
[   32s]     def testBuildRequestSignature(self):
[   32s]         """
[   32s]         Tests the build_request_signature method of the OneLogin_Saml2_Auth
[   32s]         """
[   32s]         settings = self.loadSettingsJSON()
[   32s]         message = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64'))
[   32s]         relay_state = 'http://relaystate.com'
[   32s]         parameters = {"SAMLRequest": message, "RelayState": relay_state}
[   32s]         auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings)
[   32s]     
[   32s] >       auth.add_request_signature(parameters)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:1090: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:516: in add_request_signature
[   32s]     return self.__build_signature(request_data, 'SAMLRequest', sign_algorithm)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.auth.OneLogin_Saml2_Auth object at 0x7f1807cac1d0>
[   32s] data = {'RelayState': 'http://relaystate.com', 'SAMLRequest': 'fZJNT4NAEIbvTfofCPfCLh8VNi2NSdWQ1Fat8eDFrMtgSWB3ZRbTny+ltTYG3N...n6dLaPhyMx4aXRV5AfW7wL6ivl1tVV9wMC0kd2nmKbJJ3oayRqEEcKmV9wOSsKIVWPEG9GGgeeZ6ISDwlUSstJb4IATxxJThQcZrvOMzhet2e802+AQ=='}
[   32s] saml_type = 'SAMLRequest'
[   32s] sign_algorithm = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
[   32s] 
[   32s]     def __build_signature(self, data, saml_type, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1):
[   32s]         """
[   32s]         Builds the Signature
[   32s]         :param data: The Request data
[   32s]         :type data: dict
[   32s]     
[   32s]         :param saml_type: The target URL the user should be redirected to
[   32s]         :type saml_type: string  SAMLRequest | SAMLResponse
[   32s]     
[   32s]         :param sign_algorithm: Signature algorithm method
[   32s]         :type sign_algorithm: string
[   32s]         """
[   32s]         assert saml_type in ('SAMLRequest', 'SAMLResponse')
[   32s]         key = self.get_settings().get_sp_key()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 "Trying to sign the %s but can't load the SP private key." % saml_type,
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: Trying to sign the SAMLRequest but can't load the SP private key.
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:573: OneLogin_Saml2_Error
[   32s] _____________ OneLogin_Saml2_Auth_Test.testBuildResponseSignature ______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testBuildResponseSignature>
[   32s] 
[   32s]     def testBuildResponseSignature(self):
[   32s]         """
[   32s]         Tests the build_response_signature method of the OneLogin_Saml2_Auth
[   32s]         """
[   32s]         settings = self.loadSettingsJSON()
[   32s]         message = self.file_contents(join(self.data_path, 'logout_responses', 'logout_response_deflated.xml.base64'))
[   32s]         relay_state = 'http://relaystate.com'
[   32s]         auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings)
[   32s]     
[   32s]         parameters = {"SAMLResponse": message, 'RelayState': relay_state}
[   32s]     
[   32s] >       auth.add_response_signature(parameters)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:1111: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:527: in add_response_signature
[   32s]     return self.__build_signature(response_data, 'SAMLResponse', sign_algorithm)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.auth.OneLogin_Saml2_Auth object at 0x7f1807cc96a0>
[   32s] data = {'RelayState': 'http://relaystate.com', 'SAMLResponse': 'fZJfa8IwFMXf/RSl77ZJ/wQbbGHMMQSnMMWHvUia3M5Cm4TeFPz4c0Wnwmqek...qQCsowkSaSkylhZASM0pTAmWwz1+W8sfHhtV1zc1soGcBKtbWDwPA/vm25jlm+dcD0Wf4SH8qtR4O1F08Pz2HHo5tteSkD0vfCCCB8Z1/PjLy0mPw==\n'}
[   32s] saml_type = 'SAMLResponse'
[   32s] sign_algorithm = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
[   32s] 
[   32s]     def __build_signature(self, data, saml_type, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1):
[   32s]         """
[   32s]         Builds the Signature
[   32s]         :param data: The Request data
[   32s]         :type data: dict
[   32s]     
[   32s]         :param saml_type: The target URL the user should be redirected to
[   32s]         :type saml_type: string  SAMLRequest | SAMLResponse
[   32s]     
[   32s]         :param sign_algorithm: Signature algorithm method
[   32s]         :type sign_algorithm: string
[   32s]         """
[   32s]         assert saml_type in ('SAMLRequest', 'SAMLResponse')
[   32s]         key = self.get_settings().get_sp_key()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 "Trying to sign the %s but can't load the SP private key." % saml_type,
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: Trying to sign the SAMLResponse but can't load the SP private key.
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:573: OneLogin_Saml2_Error
[   32s] _______________ OneLogin_Saml2_Auth_Test.testGetLastSAMLResponse _______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testGetLastSAMLResponse>
[   32s] 
[   32s]     def testGetLastSAMLResponse(self):
[   32s]         settings = self.loadSettingsJSON()
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64'))
[   32s]         message_wrapper = {'post_data': {'SAMLResponse': message}}
[   32s]         auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings)
[   32s]         auth.process_response()
[   32s]         expected_message = self.file_contents(join(self.data_path, 'responses', 'pretty_signed_message_response.xml'))
[   32s]         self.assertEqual(auth.get_last_response_xml(True), expected_message)
[   32s]     
[   32s]         # with encrypted assertion
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s]         message_wrapper = {'post_data': {'SAMLResponse': message}}
[   32s]         auth = OneLogin_Saml2_Auth(message_wrapper, old_settings=settings)
[   32s] >       auth.process_response()
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:1334: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:111: in process_response
[   32s]     response = self.response_class(self.__settings, self.__request_data['post_data']['SAMLResponse'])
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1807cc9c50>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f180771bc48>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ____________________ OneLogin_Saml2_Auth_Test.testGetNameId ____________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testGetNameId>
[   32s] 
[   32s]     def testGetNameId(self):
[   32s]         """
[   32s]         Tests the get_nameid method of the OneLogin_Saml2_Auth
[   32s]         """
[   32s]         settings = self.loadSettingsJSON()
[   32s]         request_data = self.get_request()
[   32s]         del request_data['get_data']
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         request_data['post_data'] = {
[   32s]             'SAMLResponse': message
[   32s]         }
[   32s]         auth = OneLogin_Saml2_Auth(request_data, old_settings=settings)
[   32s]         auth.process_response()
[   32s]         self.assertFalse(auth.is_authenticated())
[   32s]         self.assertEqual(auth.get_nameid(), None)
[   32s]     
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64'))
[   32s]         request_data['post_data'] = {
[   32s]             'SAMLResponse': message
[   32s]         }
[   32s]         auth = OneLogin_Saml2_Auth(request_data, old_settings=settings)
[   32s]         auth.process_response()
[   32s]         self.assertTrue(auth.is_authenticated())
[   32s]         self.assertEqual("492882615acf31c8096b627245d76ae53036c090", auth.get_nameid())
[   32s]     
[   32s]         settings_2 = self.loadSettingsJSON('settings2.json')
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'signed_message_encrypted_assertion2.xml.base64'))
[   32s]         request_data['post_data'] = {
[   32s]             'SAMLResponse': message
[   32s]         }
[   32s]         auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_2)
[   32s] >       auth.process_response()
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:977: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:111: in process_response
[   32s]     response = self.response_class(self.__settings, self.__request_data['post_data']['SAMLResponse'])
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f18076e8cf8>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807c11808>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] _________________ OneLogin_Saml2_Auth_Test.testGetNameIdFormat _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testGetNameIdFormat>
[   32s] 
[   32s]     def testGetNameIdFormat(self):
[   32s]         """
[   32s]         Tests the get_nameid_format method of the OneLogin_Saml2_Auth
[   32s]         """
[   32s]         settings = self.loadSettingsJSON()
[   32s]         request_data = self.get_request()
[   32s]         del request_data['get_data']
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         request_data['post_data'] = {
[   32s]             'SAMLResponse': message
[   32s]         }
[   32s]         auth = OneLogin_Saml2_Auth(request_data, old_settings=settings)
[   32s]         auth.process_response()
[   32s]         self.assertFalse(auth.is_authenticated())
[   32s]         self.assertEqual(auth.get_nameid_format(), None)
[   32s]     
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64'))
[   32s]         request_data['post_data'] = {
[   32s]             'SAMLResponse': message
[   32s]         }
[   32s]         auth = OneLogin_Saml2_Auth(request_data, old_settings=settings)
[   32s]         auth.process_response()
[   32s]         self.assertTrue(auth.is_authenticated())
[   32s]         self.assertEqual("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", auth.get_nameid_format())
[   32s]     
[   32s]         settings_2 = self.loadSettingsJSON('settings2.json')
[   32s]         message = self.file_contents(join(self.data_path, 'responses', 'signed_message_encrypted_assertion2.xml.base64'))
[   32s]         request_data['post_data'] = {
[   32s]             'SAMLResponse': message
[   32s]         }
[   32s]         auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_2)
[   32s] >       auth.process_response()
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:1012: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:111: in process_response
[   32s]     response = self.response_class(self.__settings, self.__request_data['post_data']['SAMLResponse'])
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1807862a90>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f18076ee748>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ___________________ OneLogin_Saml2_Auth_Test.testLoginSigned ___________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testLoginSigned>
[   32s] 
[   32s]     def testLoginSigned(self):
[   32s]         """
[   32s]         Tests the login method of the OneLogin_Saml2_Auth class
[   32s]         Case Login signed. An AuthnRequest signed is built an redirect executed
[   32s]         """
[   32s]         settings_info = self.loadSettingsJSON()
[   32s]         settings_info['security']['authnRequestsSigned'] = True
[   32s] >       auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:615: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:59: in __init__
[   32s]     self.__settings = OneLogin_Saml2_Settings(old_settings, custom_base_path)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.settings.OneLogin_Saml2_Settings object at 0x7f1807680048>
[   32s] settings = {'contactPerson': {'support': {'emailAddress': 'support@example.com', 'givenName': 'support_name'}, 'technical': {'ema...CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo'}, ...}
[   32s] custom_base_path = None, sp_validation_only = False
[   32s] 
[   32s]     def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False):
[   32s]         """
[   32s]         Initializes the settings:
[   32s]         - Sets the paths of the different folders
[   32s]         - Loads settings info from settings file or array/object provided
[   32s]     
[   32s]         :param settings: SAML Toolkit Settings
[   32s]         :type settings: dict
[   32s]     
[   32s]         :param custom_base_path: Path where are stored the settings file and the cert folder
[   32s]         :type custom_base_path: string
[   32s]     
[   32s]         :param sp_validation_only: Avoid the IdP validation
[   32s]         :type sp_validation_only: boolean
[   32s]         """
[   32s]         self.__sp_validation_only = sp_validation_only
[   32s]         self.__paths = {}
[   32s]         self.__strict = True
[   32s]         self.__debug = False
[   32s]         self.__sp = {}
[   32s]         self.__idp = {}
[   32s]         self.__security = {}
[   32s]         self.__contacts = {}
[   32s]         self.__organization = {}
[   32s]         self.__errors = []
[   32s]     
[   32s]         self.__load_paths(base_path=custom_base_path)
[   32s]         self.__update_paths(settings)
[   32s]     
[   32s]         if settings is None:
[   32s]             try:
[   32s]                 valid = self.__load_settings_from_file()
[   32s]             except Exception as e:
[   32s]                 raise e
[   32s]             if not valid:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings at the file: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s]                     ','.join(self.__errors)
[   32s]                 )
[   32s]         elif isinstance(settings, dict):
[   32s]             if not self.__load_settings_from_dict(settings):
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s] >                   ','.join(self.__errors)
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Invalid dict settings: sp_cert_not_found_and_required
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/settings.py:131: OneLogin_Saml2_Error
[   32s] __________________ OneLogin_Saml2_Auth_Test.testLogoutSigned ___________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testLogoutSigned>
[   32s] 
[   32s]     def testLogoutSigned(self):
[   32s]         """
[   32s]         Tests the logout method of the OneLogin_Saml2_Auth class
[   32s]         Case Logout signed. A logout Request signed in
[   32s]         the assertion is built and redirect executed
[   32s]         """
[   32s]         settings_info = self.loadSettingsJSON()
[   32s]         settings_info['security']['logoutRequestSigned'] = True
[   32s] >       auth = OneLogin_Saml2_Auth(self.get_request(), old_settings=settings_info)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:815: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:59: in __init__
[   32s]     self.__settings = OneLogin_Saml2_Settings(old_settings, custom_base_path)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.settings.OneLogin_Saml2_Settings object at 0x7f18078c14a8>
[   32s] settings = {'contactPerson': {'support': {'emailAddress': 'support@example.com', 'givenName': 'support_name'}, 'technical': {'ema...CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo'}, ...}
[   32s] custom_base_path = None, sp_validation_only = False
[   32s] 
[   32s]     def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False):
[   32s]         """
[   32s]         Initializes the settings:
[   32s]         - Sets the paths of the different folders
[   32s]         - Loads settings info from settings file or array/object provided
[   32s]     
[   32s]         :param settings: SAML Toolkit Settings
[   32s]         :type settings: dict
[   32s]     
[   32s]         :param custom_base_path: Path where are stored the settings file and the cert folder
[   32s]         :type custom_base_path: string
[   32s]     
[   32s]         :param sp_validation_only: Avoid the IdP validation
[   32s]         :type sp_validation_only: boolean
[   32s]         """
[   32s]         self.__sp_validation_only = sp_validation_only
[   32s]         self.__paths = {}
[   32s]         self.__strict = True
[   32s]         self.__debug = False
[   32s]         self.__sp = {}
[   32s]         self.__idp = {}
[   32s]         self.__security = {}
[   32s]         self.__contacts = {}
[   32s]         self.__organization = {}
[   32s]         self.__errors = []
[   32s]     
[   32s]         self.__load_paths(base_path=custom_base_path)
[   32s]         self.__update_paths(settings)
[   32s]     
[   32s]         if settings is None:
[   32s]             try:
[   32s]                 valid = self.__load_settings_from_file()
[   32s]             except Exception as e:
[   32s]                 raise e
[   32s]             if not valid:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings at the file: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s]                     ','.join(self.__errors)
[   32s]                 )
[   32s]         elif isinstance(settings, dict):
[   32s]             if not self.__load_settings_from_dict(settings):
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s] >                   ','.join(self.__errors)
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Invalid dict settings: sp_cert_not_found_and_required
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/settings.py:131: OneLogin_Saml2_Error
[   32s] _________ OneLogin_Saml2_Auth_Test.testProcessSLORequestSignedResponse _________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.auth_test.OneLogin_Saml2_Auth_Test testMethod=testProcessSLORequestSignedResponse>
[   32s] 
[   32s]     def testProcessSLORequestSignedResponse(self):
[   32s]         """
[   32s]         Tests the process_slo method of the OneLogin_Saml2_Auth class
[   32s]         Case Valid Logout Request, validating the relayState,
[   32s]         a signed LogoutResponse is created and a redirection executed
[   32s]         """
[   32s]         settings_info = self.loadSettingsJSON()
[   32s]         settings_info['security']['logoutResponseSigned'] = True
[   32s]         request_data = self.get_request()
[   32s]         message = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_deflated.xml.base64'))
[   32s]         # In order to avoid the destination problem
[   32s]         plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message))
[   32s]         current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data)
[   32s]         plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url)
[   32s]         message = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message)
[   32s]         request_data['get_data']['SAMLRequest'] = message
[   32s]         request_data['get_data']['RelayState'] = 'http://relaystate.com'
[   32s] >       auth = OneLogin_Saml2_Auth(request_data, old_settings=settings_info)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/auth_test.py:558: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/auth.py:59: in __init__
[   32s]     self.__settings = OneLogin_Saml2_Settings(old_settings, custom_base_path)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.settings.OneLogin_Saml2_Settings object at 0x7f18076c7320>
[   32s] settings = {'contactPerson': {'support': {'emailAddress': 'support@example.com', 'givenName': 'support_name'}, 'technical': {'ema...CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo'}, ...}
[   32s] custom_base_path = None, sp_validation_only = False
[   32s] 
[   32s]     def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False):
[   32s]         """
[   32s]         Initializes the settings:
[   32s]         - Sets the paths of the different folders
[   32s]         - Loads settings info from settings file or array/object provided
[   32s]     
[   32s]         :param settings: SAML Toolkit Settings
[   32s]         :type settings: dict
[   32s]     
[   32s]         :param custom_base_path: Path where are stored the settings file and the cert folder
[   32s]         :type custom_base_path: string
[   32s]     
[   32s]         :param sp_validation_only: Avoid the IdP validation
[   32s]         :type sp_validation_only: boolean
[   32s]         """
[   32s]         self.__sp_validation_only = sp_validation_only
[   32s]         self.__paths = {}
[   32s]         self.__strict = True
[   32s]         self.__debug = False
[   32s]         self.__sp = {}
[   32s]         self.__idp = {}
[   32s]         self.__security = {}
[   32s]         self.__contacts = {}
[   32s]         self.__organization = {}
[   32s]         self.__errors = []
[   32s]     
[   32s]         self.__load_paths(base_path=custom_base_path)
[   32s]         self.__update_paths(settings)
[   32s]     
[   32s]         if settings is None:
[   32s]             try:
[   32s]                 valid = self.__load_settings_from_file()
[   32s]             except Exception as e:
[   32s]                 raise e
[   32s]             if not valid:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings at the file: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s]                     ','.join(self.__errors)
[   32s]                 )
[   32s]         elif isinstance(settings, dict):
[   32s]             if not self.__load_settings_from_dict(settings):
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s] >                   ','.join(self.__errors)
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Invalid dict settings: sp_cert_not_found_and_required
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/settings.py:131: OneLogin_Saml2_Error
[   32s] __________ OneLogin_Saml2_Authn_Request_Test.testCreateEncSAMLRequest __________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.authn_request_test.OneLogin_Saml2_Authn_Request_Test testMethod=testCreateEncSAMLRequest>
[   32s] 
[   32s]     def testCreateEncSAMLRequest(self):
[   32s]         """
[   32s]         Tests the OneLogin_Saml2_Authn_Request Constructor.
[   32s]         The creation of a deflated SAML Request
[   32s]         """
[   32s]         settings = self.loadSettingsJSON()
[   32s]         settings['organization'] = {
[   32s]             'es': {
[   32s]                 'name': 'sp_prueba',
[   32s]                 'displayname': 'SP prueba',
[   32s]                 'url': 'http://sp.example.com'
[   32s]             }
[   32s]         }
[   32s]         settings['security']['wantNameIdEncrypted'] = True
[   32s] >       settings = OneLogin_Saml2_Settings(settings)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/authn_request_test.py:322: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.settings.OneLogin_Saml2_Settings object at 0x7f180807ea20>
[   32s] settings = {'contactPerson': {'support': {'emailAddress': 'support@example.com', 'givenName': 'support_name'}, 'technical': {'ema...CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo'}, ...}
[   32s] custom_base_path = None, sp_validation_only = False
[   32s] 
[   32s]     def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False):
[   32s]         """
[   32s]         Initializes the settings:
[   32s]         - Sets the paths of the different folders
[   32s]         - Loads settings info from settings file or array/object provided
[   32s]     
[   32s]         :param settings: SAML Toolkit Settings
[   32s]         :type settings: dict
[   32s]     
[   32s]         :param custom_base_path: Path where are stored the settings file and the cert folder
[   32s]         :type custom_base_path: string
[   32s]     
[   32s]         :param sp_validation_only: Avoid the IdP validation
[   32s]         :type sp_validation_only: boolean
[   32s]         """
[   32s]         self.__sp_validation_only = sp_validation_only
[   32s]         self.__paths = {}
[   32s]         self.__strict = True
[   32s]         self.__debug = False
[   32s]         self.__sp = {}
[   32s]         self.__idp = {}
[   32s]         self.__security = {}
[   32s]         self.__contacts = {}
[   32s]         self.__organization = {}
[   32s]         self.__errors = []
[   32s]     
[   32s]         self.__load_paths(base_path=custom_base_path)
[   32s]         self.__update_paths(settings)
[   32s]     
[   32s]         if settings is None:
[   32s]             try:
[   32s]                 valid = self.__load_settings_from_file()
[   32s]             except Exception as e:
[   32s]                 raise e
[   32s]             if not valid:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings at the file: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s]                     ','.join(self.__errors)
[   32s]                 )
[   32s]         elif isinstance(settings, dict):
[   32s]             if not self.__load_settings_from_dict(settings):
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s] >                   ','.join(self.__errors)
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Invalid dict settings: sp_cert_not_found_and_required
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/settings.py:131: OneLogin_Saml2_Error
[   32s] _______________ OneLogin_Saml2_Logout_Request_Test.testGetNameId _______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.logout_request_test.OneLogin_Saml2_Logout_Request_Test testMethod=testGetNameId>
[   32s] 
[   32s]     def testGetNameId(self):
[   32s]         """
[   32s]         Tests the get_nameid of the OneLogin_Saml2_LogoutRequest
[   32s]         """
[   32s]         request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml'))
[   32s]         name_id = OneLogin_Saml2_Logout_Request.get_nameid(request)
[   32s]         self.assertEqual(name_id, 'ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c')
[   32s]     
[   32s]         request_2 = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_encrypted_nameid.xml'))
[   32s]         with self.assertRaisesRegex(Exception, 'Key is required in order to decrypt the NameID'):
[   32s]             OneLogin_Saml2_Logout_Request.get_nameid(request_2)
[   32s]     
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         key = settings.get_sp_key()
[   32s] >       name_id_3 = OneLogin_Saml2_Logout_Request.get_nameid(request_2, key)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/logout_request_test.py:255: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/logout_request.py:216: in get_nameid
[   32s]     name_id = cls.get_nameid_data(request, key)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] cls = <class 'onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request'>
[   32s] request = '<samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"\n                     xmlns:saml="urn:oasis:n...lue>\n            </xenc:CipherData>\n        </xenc:EncryptedData>\n    </saml:EncryptedID>\n</samlp:LogoutRequest>\n'
[   32s] key = None
[   32s] 
[   32s]     @classmethod
[   32s]     def get_nameid_data(cls, request, key=None):
[   32s]         """
[   32s]         Gets the NameID Data of the the Logout Request
[   32s]         :param request: Logout Request Message
[   32s]         :type request: string|DOMDocument
[   32s]         :param key: The SP key
[   32s]         :type key: string
[   32s]         :return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
[   32s]         :rtype: dict
[   32s]         """
[   32s]         elem = OneLogin_Saml2_XML.to_etree(request)
[   32s]         name_id = None
[   32s]         encrypted_entries = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:EncryptedID')
[   32s]     
[   32s]         if len(encrypted_entries) == 1:
[   32s]             if key is None:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Private Key is required in order to decrypt the NameID, check settings',
[   32s] >                   OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Private Key is required in order to decrypt the NameID, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/logout_request.py:178: OneLogin_Saml2_Error
[   32s] _____________ OneLogin_Saml2_Logout_Request_Test.testGetNameIdData _____________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.logout_request_test.OneLogin_Saml2_Logout_Request_Test testMethod=testGetNameIdData>
[   32s] 
[   32s]     def testGetNameIdData(self):
[   32s]         """
[   32s]         Tests the get_nameid_data method of the OneLogin_Saml2_LogoutRequest
[   32s]         """
[   32s]         expected_name_id_data = {
[   32s]             'Value': 'ONELOGIN_1e442c129e1f822c8096086a1103c5ee2c7cae1c',
[   32s]             'Format': 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
[   32s]             'SPNameQualifier': 'http://idp.example.com/'
[   32s]         }
[   32s]     
[   32s]         request = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request.xml'))
[   32s]         name_id_data = OneLogin_Saml2_Logout_Request.get_nameid_data(request)
[   32s]         self.assertEqual(expected_name_id_data, name_id_data)
[   32s]     
[   32s]         dom = parseString(request)
[   32s]         name_id_data_2 = OneLogin_Saml2_Logout_Request.get_nameid_data(dom.toxml())
[   32s]         self.assertEqual(expected_name_id_data, name_id_data_2)
[   32s]     
[   32s]         request_2 = self.file_contents(join(self.data_path, 'logout_requests', 'logout_request_encrypted_nameid.xml'))
[   32s]         with self.assertRaisesRegex(Exception, 'Key is required in order to decrypt the NameID'):
[   32s]             OneLogin_Saml2_Logout_Request.get_nameid(request_2)
[   32s]     
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         key = settings.get_sp_key()
[   32s] >       name_id_data_4 = OneLogin_Saml2_Logout_Request.get_nameid_data(request_2, key)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/logout_request_test.py:195: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] cls = <class 'onelogin.saml2.logout_request.OneLogin_Saml2_Logout_Request'>
[   32s] request = '<samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"\n                     xmlns:saml="urn:oasis:n...lue>\n            </xenc:CipherData>\n        </xenc:EncryptedData>\n    </saml:EncryptedID>\n</samlp:LogoutRequest>\n'
[   32s] key = None
[   32s] 
[   32s]     @classmethod
[   32s]     def get_nameid_data(cls, request, key=None):
[   32s]         """
[   32s]         Gets the NameID Data of the the Logout Request
[   32s]         :param request: Logout Request Message
[   32s]         :type request: string|DOMDocument
[   32s]         :param key: The SP key
[   32s]         :type key: string
[   32s]         :return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
[   32s]         :rtype: dict
[   32s]         """
[   32s]         elem = OneLogin_Saml2_XML.to_etree(request)
[   32s]         name_id = None
[   32s]         encrypted_entries = OneLogin_Saml2_XML.query(elem, '/samlp:LogoutRequest/saml:EncryptedID')
[   32s]     
[   32s]         if len(encrypted_entries) == 1:
[   32s]             if key is None:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Private Key is required in order to decrypt the NameID, check settings',
[   32s] >                   OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Private Key is required in order to decrypt the NameID, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/logout_request.py:178: OneLogin_Saml2_Error
[   32s] ____________ OneLogin_Saml2_Metadata_Test.testAddX509KeyDescriptors ____________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.metadata_test.OneLogin_Saml2_Metadata_Test testMethod=testAddX509KeyDescriptors>
[   32s] 
[   32s]     def testAddX509KeyDescriptors(self):
[   32s]         """
[   32s]         Tests the addX509KeyDescriptors method of the OneLogin_Saml2_Metadata
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         sp_data = settings.get_sp_data()
[   32s]     
[   32s]         metadata = OneLogin_Saml2_Metadata.builder(sp_data)
[   32s]         self.assertNotIn('<md:KeyDescriptor use="signing"', metadata)
[   32s]         self.assertNotIn('<md:KeyDescriptor use="encryption"', metadata)
[   32s]     
[   32s]         metadata_without_descriptors = OneLogin_Saml2_Metadata.add_x509_key_descriptors(metadata, None)
[   32s]         self.assertNotIn('<md:KeyDescriptor use="signing"', metadata_without_descriptors)
[   32s]         self.assertNotIn('<md:KeyDescriptor use="encryption"', metadata_without_descriptors)
[   32s]     
[   32s]         metadata_without_descriptors = OneLogin_Saml2_Metadata.add_x509_key_descriptors(metadata, '')
[   32s]         self.assertNotIn('<md:KeyDescriptor use="signing"', metadata_without_descriptors)
[   32s]         self.assertNotIn('<md:KeyDescriptor use="encryption"', metadata_without_descriptors)
[   32s]     
[   32s]         cert_path = settings.get_cert_path()
[   32s] >       cert = self.file_contents(join(cert_path, 'sp.crt'))
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/metadata_test.py:281: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.metadata_test.OneLogin_Saml2_Metadata_Test testMethod=testAddX509KeyDescriptors>
[   32s] filename = '/home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/../../../tests/data/customPath/certs/sp.crt'
[   32s] 
[   32s]     def file_contents(self, filename):
[   32s] >       f = open(filename, 'r')
[   32s] E       FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/../../../tests/data/customPath/certs/sp.crt'
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/metadata_test.py:32: FileNotFoundError
[   32s] ________________ OneLogin_Saml2_Metadata_Test.testSignMetadata _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.metadata_test.OneLogin_Saml2_Metadata_Test testMethod=testSignMetadata>
[   32s] 
[   32s]     def testSignMetadata(self):
[   32s]         """
[   32s]         Tests the signMetadata method of the OneLogin_Saml2_Metadata
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         sp_data = settings.get_sp_data()
[   32s]         security = settings.get_security_data()
[   32s]     
[   32s]         metadata = OneLogin_Saml2_Metadata.builder(
[   32s]             sp_data, security['authnRequestsSigned'],
[   32s]             security['wantAssertionsSigned']
[   32s]         )
[   32s]     
[   32s]         self.assertIsNotNone(metadata)
[   32s]     
[   32s]         cert_path = settings.get_cert_path()
[   32s] >       key = self.file_contents(join(cert_path, 'sp.key'))
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/metadata_test.py:205: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.metadata_test.OneLogin_Saml2_Metadata_Test testMethod=testSignMetadata>
[   32s] filename = '/home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/../../../tests/data/customPath/certs/sp.key'
[   32s] 
[   32s]     def file_contents(self, filename):
[   32s] >       f = open(filename, 'r')
[   32s] E       FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/../../../tests/data/customPath/certs/sp.key'
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/metadata_test.py:32: FileNotFoundError
[   32s] _________________ OneLogin_Saml2_Response_Test.testCheckStatus _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testCheckStatus>
[   32s] 
[   32s]     def testCheckStatus(self):
[   32s]         """
[   32s]         Tests the check_status method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         response.check_status()
[   32s]     
[   32s]         xml_enc = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_enc = OneLogin_Saml2_Response(settings, xml_enc)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:533: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1807bf4eb8>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f18076235c8>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] __________________ OneLogin_Saml2_Response_Test.testConstruct __________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testConstruct>
[   32s] 
[   32s]     def testConstruct(self):
[   32s]         """
[   32s]         Tests the OneLogin_Saml2_Response Constructor.
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]     
[   32s]         self.assertIsInstance(response, OneLogin_Saml2_Response)
[   32s]     
[   32s]         xml_enc = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_enc = OneLogin_Saml2_Response(settings, xml_enc)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:82: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f18078c1b38>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807c04348>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ________________ OneLogin_Saml2_Response_Test.testGetAudiences _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testGetAudiences>
[   32s] 
[   32s]     def testGetAudiences(self):
[   32s]         """
[   32s]         Tests the get_audiences method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'no_audience.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertEqual([], response.get_audiences())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s]         self.assertEqual(['{audience}'], response_2.get_audiences())
[   32s]     
[   32s]         xml_3 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_3 = OneLogin_Saml2_Response(settings, xml_3)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:598: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f18075e4780>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807c056c8>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] _______________ OneLogin_Saml2_Response_Test.testGetInResponseTo _______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testGetInResponseTo>
[   32s] 
[   32s]     def testGetInResponseTo(self):
[   32s]         """
[   32s]         Tests the retrieval of the InResponseTo attribute
[   32s]         """
[   32s]     
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]     
[   32s]         # Response without an InResponseTo element should return None
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertIsNone(response.get_in_response_to())
[   32s]     
[   32s]         xml_3 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_3 = OneLogin_Saml2_Response(settings, xml_3)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:811: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f180780eba8>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f18078c0208>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] _________________ OneLogin_Saml2_Response_Test.testGetIssuers __________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testGetIssuers>
[   32s] 
[   32s]     def testGetIssuers(self):
[   32s]         """
[   32s]         Tests the get_issuers method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'adfs_response.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertEqual(['http://login.example.com/issuer'], response.get_issuers())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:645: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1807b6ad30>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f180767da48>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ________________ OneLogin_Saml2_Response_Test.testGetNameIdData ________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testGetNameIdData>
[   32s] 
[   32s]     def testGetNameIdData(self):
[   32s]         """
[   32s]         Tests the get_nameid_data method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         json_settings = self.loadSettingsJSON()
[   32s]         json_settings['strict'] = False
[   32s]         settings = OneLogin_Saml2_Settings(json_settings)
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         expected_nameid_data = {
[   32s]             'Value': 'support@onelogin.com',
[   32s]             'Format': 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'
[   32s]         }
[   32s]         nameid_data = response.get_nameid_data()
[   32s]         self.assertEqual(expected_nameid_data, nameid_data)
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s]         expected_nameid_data_2 = {
[   32s]             'Value': '2de11defd199f8d5bb63f9b7deb265ba5c675c10',
[   32s]             'Format': 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
[   32s]             'SPNameQualifier': 'http://stuff.com/endpoints/metadata.php'
[   32s]         }
[   32s] >       nameid_data_2 = response_2.get_nameid_data()
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:405: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:446: in get_nameid_data
[   32s]     nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] encrypted_data = <Element {http://www.w3.org/2001/04/xmlenc#}EncryptedData at 0x7f180786c708>
[   32s] key = None, debug = False, inplace = False
[   32s] 
[   32s]     @staticmethod
[   32s]     def decrypt_element(encrypted_data, key, debug=False, inplace=False):
[   32s]         """
[   32s]         Decrypts an encrypted element.
[   32s]     
[   32s]         :param encrypted_data: The encrypted data.
[   32s]         :type: lxml.etree.Element | DOMElement | basestring
[   32s]     
[   32s]         :param key: The key.
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param inplace: update passed data with decrypted result
[   32s]         :type: bool
[   32s]     
[   32s]         :returns: The decrypted element.
[   32s]         :rtype: lxml.etree.Element
[   32s]         """
[   32s]     
[   32s]         if isinstance(encrypted_data, Element):
[   32s]             encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
[   32s]         if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
[   32s]             encrypted_data = deepcopy(encrypted_data)
[   32s]         elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
[   32s]             encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         manager = xmlsec.KeysManager()
[   32s]     
[   32s] >       manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:706: TypeError
[   32s] _______________ OneLogin_Saml2_Response_Test.testGetSessionIndex _______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testGetSessionIndex>
[   32s] 
[   32s]     def testGetSessionIndex(self):
[   32s]         """
[   32s]         Tests the get_session_index method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertEqual('_531c32d283bdff7e04e487bcdbc4dd8d', response.get_session_index())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:672: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1807805978>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807c029c8>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ___________ OneLogin_Saml2_Response_Test.testGetSessionNotOnOrAfter ____________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testGetSessionNotOnOrAfter>
[   32s] 
[   32s]     def testGetSessionNotOnOrAfter(self):
[   32s]         """
[   32s]         Tests the get_session_not_on_or_after method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertEqual(1290203857, response.get_session_not_on_or_after())
[   32s]     
[   32s]         # An assertion that do not specified Session timeout should return NULL
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'response2.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s]         self.assertEqual(None, response_2.get_session_not_on_or_after())
[   32s]     
[   32s]         xml_3 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_3 = OneLogin_Saml2_Response(settings, xml_3)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:795: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f180807ecc0>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f180766f808>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] _______________ OneLogin_Saml2_Response_Test.testGetXMLDocument ________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testGetXMLDocument>
[   32s] 
[   32s]     def testGetXMLDocument(self):
[   32s]         """
[   32s]         Tests that we can retrieve the raw text of an encrypted XML response
[   32s]         without going through intermediate steps
[   32s]         """
[   32s]         json_settings = self.loadSettingsJSON()
[   32s]         settings = OneLogin_Saml2_Settings(json_settings)
[   32s]     
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         pretty_xml = self.file_contents(join(self.data_path, 'responses', 'pretty_signed_message_response.xml'))
[   32s]         self.assertEqual(etree.tostring(response.get_xml_document(), encoding='unicode', pretty_print=True), pretty_xml)
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:100: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1807bf4a58>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807804788>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] _____________ OneLogin_Saml2_Response_Test.testIsInValidEncIssues ______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testIsInValidEncIssues>
[   32s] 
[   32s]     def testIsInValidEncIssues(self):
[   32s]         """
[   32s]         Tests the is_valid method of the OneLogin_Saml2_Response class
[   32s]         Case Invalid Response, Invalid encryptation issues
[   32s]         """
[   32s]         settings_info = self.loadSettingsJSON()
[   32s]         request_data = {
[   32s]             'http_host': 'example.com',
[   32s]             'script_name': 'index.html'
[   32s]         }
[   32s]         current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data)
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'unsigned_response.xml.base64'))
[   32s]         plain_message = compat.to_string(OneLogin_Saml2_Utils.b64decode(xml))
[   32s]         plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/acs.php', current_url)
[   32s]         message = OneLogin_Saml2_Utils.b64encode(plain_message)
[   32s]     
[   32s]         settings_info['security']['wantAssertionsEncrypted'] = True
[   32s] >       settings = OneLogin_Saml2_Settings(settings_info)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:1449: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.settings.OneLogin_Saml2_Settings object at 0x7f1807863710>
[   32s] settings = {'contactPerson': {'support': {'emailAddress': 'support@example.com', 'givenName': 'support_name'}, 'technical': {'ema...CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo'}, ...}
[   32s] custom_base_path = None, sp_validation_only = False
[   32s] 
[   32s]     def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False):
[   32s]         """
[   32s]         Initializes the settings:
[   32s]         - Sets the paths of the different folders
[   32s]         - Loads settings info from settings file or array/object provided
[   32s]     
[   32s]         :param settings: SAML Toolkit Settings
[   32s]         :type settings: dict
[   32s]     
[   32s]         :param custom_base_path: Path where are stored the settings file and the cert folder
[   32s]         :type custom_base_path: string
[   32s]     
[   32s]         :param sp_validation_only: Avoid the IdP validation
[   32s]         :type sp_validation_only: boolean
[   32s]         """
[   32s]         self.__sp_validation_only = sp_validation_only
[   32s]         self.__paths = {}
[   32s]         self.__strict = True
[   32s]         self.__debug = False
[   32s]         self.__sp = {}
[   32s]         self.__idp = {}
[   32s]         self.__security = {}
[   32s]         self.__contacts = {}
[   32s]         self.__organization = {}
[   32s]         self.__errors = []
[   32s]     
[   32s]         self.__load_paths(base_path=custom_base_path)
[   32s]         self.__update_paths(settings)
[   32s]     
[   32s]         if settings is None:
[   32s]             try:
[   32s]                 valid = self.__load_settings_from_file()
[   32s]             except Exception as e:
[   32s]                 raise e
[   32s]             if not valid:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings at the file: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s]                     ','.join(self.__errors)
[   32s]                 )
[   32s]         elif isinstance(settings, dict):
[   32s]             if not self.__load_settings_from_dict(settings):
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s] >                   ','.join(self.__errors)
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Invalid dict settings: sp_cert_not_found_and_required
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/settings.py:131: OneLogin_Saml2_Error
[   32s] _________________ OneLogin_Saml2_Response_Test.testIsValidEnc __________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testIsValidEnc>
[   32s] 
[   32s]     def testIsValidEnc(self):
[   32s]         """
[   32s]         Tests the is_valid method of the OneLogin_Saml2_Response
[   32s]         Case valid encrypted assertion
[   32s]     
[   32s]         Signed data can't be modified, so Destination will always fail in
[   32s]         strict mode
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]     
[   32s]         # expired cert
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'double_signed_encrypted_assertion.xml.base64'))
[   32s] >       response = OneLogin_Saml2_Response(settings, xml)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:1593: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f180779b710>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807c2ec48>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] _________________ OneLogin_Saml2_Response_Test.testIsValidSign _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testIsValidSign>
[   32s] 
[   32s]     def testIsValidSign(self):
[   32s]         """
[   32s]         Tests the is_valid method of the OneLogin_Saml2_Response
[   32s]         Case valid sign response / sign assertion / both signed
[   32s]     
[   32s]         Strict mode will always fail due destination problem, if we manipulate
[   32s]         it the sign will fail.
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]     
[   32s]         # expired cert
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'signed_message_response.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertTrue(response.is_valid(self.get_request_data()))
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'signed_assertion_response.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s]         self.assertTrue(response_2.is_valid(self.get_request_data()))
[   32s]     
[   32s]         xml_3 = self.file_contents(join(self.data_path, 'responses', 'double_signed_response.xml.base64'))
[   32s]         response_3 = OneLogin_Saml2_Response(settings, xml_3)
[   32s]         self.assertTrue(response_3.is_valid(self.get_request_data()))
[   32s]     
[   32s]         settings_2 = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings2.json'))
[   32s]         xml_4 = self.file_contents(join(self.data_path, 'responses', 'signed_message_response2.xml.base64'))
[   32s] >       response_4 = OneLogin_Saml2_Response(settings_2, xml_4)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:1657: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1807648550>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f18079abb48>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ___________ OneLogin_Saml2_Response_Test.testIsValidSignFingerprint ____________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testIsValidSignFingerprint>
[   32s] 
[   32s]     def testIsValidSignFingerprint(self):
[   32s]         """
[   32s]         Tests the is_valid method of the OneLogin_Saml2_Response
[   32s]         Case valid sign response / sign assertion / both signed with fingerprint
[   32s]     
[   32s]         Strict mode will always fail due destination problem, if we manipulate
[   32s]         it the sign will fail.
[   32s]         """
[   32s] >       settings = OneLogin_Saml2_Settings(self.loadSettingsJSON("settings6.json"))
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:1697: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.settings.OneLogin_Saml2_Settings object at 0x7f18078c7ef0>
[   32s] settings = {'contactPerson': {'support': {'emailAddress': 'support@example.com', 'givenName': 'support_name'}, 'technical': {'ema...'http://idp.example.com/', 'singleLogoutService': {'url': 'http://idp.example.com/SingleLogoutService.php'}, ...}, ...}
[   32s] custom_base_path = None, sp_validation_only = False
[   32s] 
[   32s]     def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False):
[   32s]         """
[   32s]         Initializes the settings:
[   32s]         - Sets the paths of the different folders
[   32s]         - Loads settings info from settings file or array/object provided
[   32s]     
[   32s]         :param settings: SAML Toolkit Settings
[   32s]         :type settings: dict
[   32s]     
[   32s]         :param custom_base_path: Path where are stored the settings file and the cert folder
[   32s]         :type custom_base_path: string
[   32s]     
[   32s]         :param sp_validation_only: Avoid the IdP validation
[   32s]         :type sp_validation_only: boolean
[   32s]         """
[   32s]         self.__sp_validation_only = sp_validation_only
[   32s]         self.__paths = {}
[   32s]         self.__strict = True
[   32s]         self.__debug = False
[   32s]         self.__sp = {}
[   32s]         self.__idp = {}
[   32s]         self.__security = {}
[   32s]         self.__contacts = {}
[   32s]         self.__organization = {}
[   32s]         self.__errors = []
[   32s]     
[   32s]         self.__load_paths(base_path=custom_base_path)
[   32s]         self.__update_paths(settings)
[   32s]     
[   32s]         if settings is None:
[   32s]             try:
[   32s]                 valid = self.__load_settings_from_file()
[   32s]             except Exception as e:
[   32s]                 raise e
[   32s]             if not valid:
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings at the file: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s]                     ','.join(self.__errors)
[   32s]                 )
[   32s]         elif isinstance(settings, dict):
[   32s]             if not self.__load_settings_from_dict(settings):
[   32s]                 raise OneLogin_Saml2_Error(
[   32s]                     'Invalid dict settings: %s',
[   32s]                     OneLogin_Saml2_Error.SETTINGS_INVALID,
[   32s] >                   ','.join(self.__errors)
[   32s]                 )
[   32s] E               onelogin.saml2.errors.OneLogin_Saml2_Error: Invalid dict settings: sp_cert_not_found_and_required
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/settings.py:131: OneLogin_Saml2_Error
[   32s] _______________ OneLogin_Saml2_Response_Test.testQueryAssertions _______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testQueryAssertions>
[   32s] 
[   32s]     def testQueryAssertions(self):
[   32s]         """
[   32s]         Tests the __query_assertion and __query methods of the
[   32s]         OneLogin_Saml2_Response using the get_issuers call
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'adfs_response.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertEqual(['http://login.example.com/issuer'], response.get_issuers())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:612: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f1808ece7f0>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807c049c8>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ________________ OneLogin_Saml2_Response_Test.testReturnNameId _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testReturnNameId>
[   32s] 
[   32s]     def testReturnNameId(self):
[   32s]         """
[   32s]         Tests the get_nameid method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         json_settings = self.loadSettingsJSON()
[   32s]         json_settings['strict'] = False
[   32s]         settings = OneLogin_Saml2_Settings(json_settings)
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertEqual('support@onelogin.com', response.get_nameid())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] >       self.assertEqual('2de11defd199f8d5bb63f9b7deb265ba5c675c10', response_2.get_nameid())
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:117: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:491: in get_nameid
[   32s]     nameid_data = self.get_nameid_data()
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:446: in get_nameid_data
[   32s]     nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] encrypted_data = <Element {http://www.w3.org/2001/04/xmlenc#}EncryptedData at 0x7f1807b65ec8>
[   32s] key = None, debug = False, inplace = False
[   32s] 
[   32s]     @staticmethod
[   32s]     def decrypt_element(encrypted_data, key, debug=False, inplace=False):
[   32s]         """
[   32s]         Decrypts an encrypted element.
[   32s]     
[   32s]         :param encrypted_data: The encrypted data.
[   32s]         :type: lxml.etree.Element | DOMElement | basestring
[   32s]     
[   32s]         :param key: The key.
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param inplace: update passed data with decrypted result
[   32s]         :type: bool
[   32s]     
[   32s]         :returns: The decrypted element.
[   32s]         :rtype: lxml.etree.Element
[   32s]         """
[   32s]     
[   32s]         if isinstance(encrypted_data, Element):
[   32s]             encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
[   32s]         if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
[   32s]             encrypted_data = deepcopy(encrypted_data)
[   32s]         elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
[   32s]             encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         manager = xmlsec.KeysManager()
[   32s]     
[   32s] >       manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:706: TypeError
[   32s] _____________ OneLogin_Saml2_Response_Test.testReturnNameIdFormat ______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testReturnNameIdFormat>
[   32s] 
[   32s]     def testReturnNameIdFormat(self):
[   32s]         """
[   32s]         Tests the get_nameid_format method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         json_settings = self.loadSettingsJSON()
[   32s]         json_settings['strict'] = False
[   32s]         settings = OneLogin_Saml2_Settings(json_settings)
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertEqual('urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', response.get_nameid_format())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] >       self.assertEqual('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', response_2.get_nameid_format())
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:222: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:504: in get_nameid_format
[   32s]     nameid_data = self.get_nameid_data()
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:446: in get_nameid_data
[   32s]     nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] encrypted_data = <Element {http://www.w3.org/2001/04/xmlenc#}EncryptedData at 0x7f18078be388>
[   32s] key = None, debug = False, inplace = False
[   32s] 
[   32s]     @staticmethod
[   32s]     def decrypt_element(encrypted_data, key, debug=False, inplace=False):
[   32s]         """
[   32s]         Decrypts an encrypted element.
[   32s]     
[   32s]         :param encrypted_data: The encrypted data.
[   32s]         :type: lxml.etree.Element | DOMElement | basestring
[   32s]     
[   32s]         :param key: The key.
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param inplace: update passed data with decrypted result
[   32s]         :type: bool
[   32s]     
[   32s]         :returns: The decrypted element.
[   32s]         :rtype: lxml.etree.Element
[   32s]         """
[   32s]     
[   32s]         if isinstance(encrypted_data, Element):
[   32s]             encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
[   32s]         if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
[   32s]             encrypted_data = deepcopy(encrypted_data)
[   32s]         elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
[   32s]             encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         manager = xmlsec.KeysManager()
[   32s]     
[   32s] >       manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:706: TypeError
[   32s] __________ OneLogin_Saml2_Response_Test.testReturnNameIdNameQualifier __________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testReturnNameIdNameQualifier>
[   32s] 
[   32s]     def testReturnNameIdNameQualifier(self):
[   32s]         """
[   32s]         Tests the get_nameid_nq method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         json_settings = self.loadSettingsJSON()
[   32s]         json_settings['strict'] = False
[   32s]         settings = OneLogin_Saml2_Settings(json_settings)
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertIsNone(response.get_nameid_nq())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] >       self.assertIsNone(response_2.get_nameid_nq())
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:327: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:517: in get_nameid_nq
[   32s]     nameid_data = self.get_nameid_data()
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:446: in get_nameid_data
[   32s]     nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] encrypted_data = <Element {http://www.w3.org/2001/04/xmlenc#}EncryptedData at 0x7f1808ed0ec8>
[   32s] key = None, debug = False, inplace = False
[   32s] 
[   32s]     @staticmethod
[   32s]     def decrypt_element(encrypted_data, key, debug=False, inplace=False):
[   32s]         """
[   32s]         Decrypts an encrypted element.
[   32s]     
[   32s]         :param encrypted_data: The encrypted data.
[   32s]         :type: lxml.etree.Element | DOMElement | basestring
[   32s]     
[   32s]         :param key: The key.
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param inplace: update passed data with decrypted result
[   32s]         :type: bool
[   32s]     
[   32s]         :returns: The decrypted element.
[   32s]         :rtype: lxml.etree.Element
[   32s]         """
[   32s]     
[   32s]         if isinstance(encrypted_data, Element):
[   32s]             encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
[   32s]         if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
[   32s]             encrypted_data = deepcopy(encrypted_data)
[   32s]         elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
[   32s]             encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         manager = xmlsec.KeysManager()
[   32s]     
[   32s] >       manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:706: TypeError
[   32s] _________ OneLogin_Saml2_Response_Test.testReturnNameIdNameSPQualifier _________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testReturnNameIdNameSPQualifier>
[   32s] 
[   32s]     def testReturnNameIdNameSPQualifier(self):
[   32s]         """
[   32s]         Tests the get_nameid_spnq method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         json_settings = self.loadSettingsJSON()
[   32s]         json_settings['strict'] = False
[   32s]         settings = OneLogin_Saml2_Settings(json_settings)
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'response1.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertIsNone(response.get_nameid_spnq())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64'))
[   32s]         response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] >       self.assertEqual("http://stuff.com/endpoints/metadata.php", response_2.get_nameid_spnq())
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:361: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:530: in get_nameid_spnq
[   32s]     nameid_data = self.get_nameid_data()
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:446: in get_nameid_data
[   32s]     nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] encrypted_data = <Element {http://www.w3.org/2001/04/xmlenc#}EncryptedData at 0x7f1807527888>
[   32s] key = None, debug = False, inplace = False
[   32s] 
[   32s]     @staticmethod
[   32s]     def decrypt_element(encrypted_data, key, debug=False, inplace=False):
[   32s]         """
[   32s]         Decrypts an encrypted element.
[   32s]     
[   32s]         :param encrypted_data: The encrypted data.
[   32s]         :type: lxml.etree.Element | DOMElement | basestring
[   32s]     
[   32s]         :param key: The key.
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param inplace: update passed data with decrypted result
[   32s]         :type: bool
[   32s]     
[   32s]         :returns: The decrypted element.
[   32s]         :rtype: lxml.etree.Element
[   32s]         """
[   32s]     
[   32s]         if isinstance(encrypted_data, Element):
[   32s]             encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
[   32s]         if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
[   32s]             encrypted_data = deepcopy(encrypted_data)
[   32s]         elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
[   32s]             encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         manager = xmlsec.KeysManager()
[   32s]     
[   32s] >       manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:706: TypeError
[   32s] _____________ OneLogin_Saml2_Response_Test.testValidateTimestamps ______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test testMethod=testValidateTimestamps>
[   32s] 
[   32s]     def testValidateTimestamps(self):
[   32s]         """
[   32s]         Tests the validate_timestamps method of the OneLogin_Saml2_Response
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         xml = self.file_contents(join(self.data_path, 'responses', 'valid_response.xml.base64'))
[   32s]         response = OneLogin_Saml2_Response(settings, xml)
[   32s]         self.assertTrue(response.validate_timestamps())
[   32s]     
[   32s]         xml_2 = self.file_contents(join(self.data_path, 'responses', 'valid_encrypted_assertion.xml.base64'))
[   32s] >       response_2 = OneLogin_Saml2_Response(settings, xml_2)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/response_test.py:859: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:49: in __init__
[   32s]     self.decrypted_document = self.__decrypt_assertion(decrypted_document)
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.response.OneLogin_Saml2_Response object at 0x7f18076c7320>
[   32s] xml = <Element {urn:oasis:names:tc:SAML:2.0:protocol}Response at 0x7f1807772888>
[   32s] 
[   32s]     def __decrypt_assertion(self, xml):
[   32s]         """
[   32s]         Decrypts the Assertion
[   32s]     
[   32s]         :raises: Exception if no private key available
[   32s]         :param xml: Encrypted Assertion
[   32s]         :type xml: Element
[   32s]         :returns: Decrypted Assertion
[   32s]         :rtype: Element
[   32s]         """
[   32s]         key = self.__settings.get_sp_key()
[   32s]         debug = self.__settings.is_debug_active()
[   32s]     
[   32s]         if not key:
[   32s]             raise OneLogin_Saml2_Error(
[   32s]                 'No private key available to decrypt the assertion, check settings',
[   32s] >               OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND
[   32s]             )
[   32s] E           onelogin.saml2.errors.OneLogin_Saml2_Error: No private key available to decrypt the assertion, check settings
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/response.py:865: OneLogin_Saml2_Error
[   32s] ________________ OneLogin_Saml2_Settings_Test.testCheckSPCerts _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testCheckSPCerts>
[   32s] 
[   32s]     def testCheckSPCerts(self):
[   32s]         """
[   32s]         Tests the checkSPCerts method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s] >       self.assertTrue(settings.check_sp_certs())
[   32s] E       AssertionError: False is not true
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:370: AssertionError
[   32s] ________________ OneLogin_Saml2_Settings_Test.testFormatSPCert _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testFormatSPCert>
[   32s] 
[   32s]     def testFormatSPCert(self):
[   32s]         """
[   32s]         Tests the format_sp_cert method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]         settings_data = self.loadSettingsJSON()
[   32s]     
[   32s]         cert = "-----BEGIN CERTIFICATE-----\nMIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC\nTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD\nVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG\n9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4\nMTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi\nZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl\naWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO\nNoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS\nKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d\n1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8\nBUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n\nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar\nQ4/67OZfHd7R+POBXhophSMv1ZOo\n-----END CERTIFICATE-----\n"
[   32s]         settings = OneLogin_Saml2_Settings(settings_data)
[   32s] >       self.assertEqual(cert, settings.get_sp_cert())
[   32s] E       AssertionError: '-----BEGIN CERTIFICATE-----\nMIICgTCCAeo[900 chars]--\n' != None
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:339: AssertionError
[   32s] _________________ OneLogin_Saml2_Settings_Test.testGetIDPCert __________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetIDPCert>
[   32s] 
[   32s]     def testGetIDPCert(self):
[   32s]         """
[   32s]         Tests the get_idp_cert method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]     
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON('settings9.json'))
[   32s]         cert = "-----BEGIN CERTIFICATE-----\nMIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC\nTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD\nVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG\n9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4\nMTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi\nZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl\naWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO\nNoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS\nKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d\n1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8\nBUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n\nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar\nQ4/67OZfHd7R+POBXhophSMv1ZOo\n-----END CERTIFICATE-----"
[   32s] >       self.assertEqual(cert, settings.get_idp_cert())
[   32s] E       AssertionError: '-----BEGIN CERTIFICATE-----\nMIICgTCCAeo[898 chars]----' != None
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:302: AssertionError
[   32s] _________________ OneLogin_Saml2_Settings_Test.testGetLibPath __________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetLibPath>
[   32s] 
[   32s]     def testGetLibPath(self):
[   32s]         """
[   32s]         Tests getLibPath method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]         settingsInfo = self.loadSettingsJSON()
[   32s]         settings = OneLogin_Saml2_Settings(settingsInfo)
[   32s]         path = settings.get_base_path()
[   32s] >       self.assertEqual(settings.get_lib_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), 'src/onelogin/saml2/'))
[   32s] E       AssertionError: '/hom[18 chars]BUILDROOT/python-python3-saml-1.10.1-0.x86_64/[43 chars]ml2/' != '/hom[18 chars]BUILD/python3-saml-1.10.1/src/onelogin/saml2/'
[   32s] E       - /home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/
[   32s] E       + /home/abuild/rpmbuild/BUILD/python3-saml-1.10.1/src/onelogin/saml2/
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:168: AssertionError
[   32s] __________________ OneLogin_Saml2_Settings_Test.testGetSPCert __________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetSPCert>
[   32s] 
[   32s]     def testGetSPCert(self):
[   32s]         """
[   32s]         Tests the get_sp_cert method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]         settings_data = self.loadSettingsJSON()
[   32s]         cert = "-----BEGIN CERTIFICATE-----\nMIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC\nTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD\nVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG\n9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4\nMTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi\nZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl\naWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO\nNoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS\nKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d\n1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8\nBUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n\nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar\nQ4/67OZfHd7R+POBXhophSMv1ZOo\n-----END CERTIFICATE-----\n"
[   32s]         settings = OneLogin_Saml2_Settings(settings_data)
[   32s] >       self.assertEqual(cert, settings.get_sp_cert())
[   32s] E       AssertionError: '-----BEGIN CERTIFICATE-----\nMIICgTCCAeo[900 chars]--\n' != None
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:245: AssertionError
[   32s] ________________ OneLogin_Saml2_Settings_Test.testGetSPCertNew _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetSPCertNew>
[   32s] 
[   32s]     def testGetSPCertNew(self):
[   32s]         """
[   32s]         Tests the get_sp_cert_new method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]         settings_data = self.loadSettingsJSON()
[   32s]         cert = "-----BEGIN CERTIFICATE-----\nMIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMC\nTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYD\nVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG\n9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4\nMTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xi\nZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2Zl\naWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5v\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LO\nNoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHIS\nKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d\n1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8\nBUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7n\nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2Qar\nQ4/67OZfHd7R+POBXhophSMv1ZOo\n-----END CERTIFICATE-----\n"
[   32s]         settings = OneLogin_Saml2_Settings(settings_data)
[   32s] >       self.assertEqual(cert, settings.get_sp_cert())
[   32s] E       AssertionError: '-----BEGIN CERTIFICATE-----\nMIICgTCCAeo[900 chars]--\n' != None
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:266: AssertionError
[   32s] __________________ OneLogin_Saml2_Settings_Test.testGetSPKey ___________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetSPKey>
[   32s] 
[   32s]     def testGetSPKey(self):
[   32s]         """
[   32s]         Tests the get_sp_key method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]         settings_data = self.loadSettingsJSON()
[   32s]         key = "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9\nIbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+\nPbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQAB\nAoGAD4/Z4LWVWV6D1qMIp1Gzr0ZmdWTE1SPdZ7Ej8glGnCzPdguCPuzbhGXmIg0V\nJ5D+02wsqws1zd48JSMXXM8zkYZVwQYIPUsNn5FetQpwxDIMPmhHg+QNBgwOnk8J\nK2sIjjLPL7qY7Itv7LT7Gvm5qSOkZ33RCgXcgz+okEIQMYkCQQDzbTOyDL0c5WQV\n6A2k06T/azdhUdGXF9C0+WkWSfNaovmTgRXh1G+jMlr82Snz4p4/STt7P/XtyWzF\n3pkVgZr3AkEA7nPjXwHlttNEMo6AtxHd47nizK2NUN803ElIUT8P9KSCoERmSXq6\n6PDekGNic4ldpsSvOeYCk8MAYoDBy9kvVwJBAMLgX4xg6lzhv7hR5+pWjTb1rIY6\nrCHbrPfU264+UZXz9v2BT/VUznLF81WMvStD9xAPHpFS6R0OLghSZhdzhI0CQQDL\n8Duvfxzrn4b9QlmduV8wLERoT6rEVxKLsPVz316TGrxJvBZLk/cV0SRZE1cZf4uk\nXSWMfEcJ/0Zt+LdG1CqjAkEAqwLSglJ9Dy3HpgMz4vAAyZWzAxvyA1zW0no9GOLc\nPQnYaNUN/Fy2SYtETXTb0CQ9X1rt8ffkFP7ya+5TC83aMg==\n-----END RSA PRIVATE KEY-----\n"
[   32s]         settings = OneLogin_Saml2_Settings(settings_data)
[   32s] >       self.assertEqual(key, settings.get_sp_key())
[   32s] E       AssertionError: '-----BEGIN RSA PRIVATE KEY-----\nMIICXgI[862 chars]--\n' != None
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:281: AssertionError
[   32s] ________________ OneLogin_Saml2_Settings_Test.testGetSPMetadata ________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetSPMetadata>
[   32s] 
[   32s]     def testGetSPMetadata(self):
[   32s]         """
[   32s]         Tests the getSPMetadata method of the OneLogin_Saml2_Settings
[   32s]         Case unsigned metadata
[   32s]         """
[   32s]         settings_info = self.loadSettingsJSON()
[   32s]         settings_info['security']['wantNameIdEncrypted'] = False
[   32s]         settings_info['security']['wantAssertionsEncrypted'] = False
[   32s]         settings = OneLogin_Saml2_Settings(settings_info)
[   32s]         metadata = compat.to_string(settings.get_sp_metadata())
[   32s]     
[   32s]         self.assertNotEqual(len(metadata), 0)
[   32s]         self.assertIn('<md:SPSSODescriptor', metadata)
[   32s]         self.assertIn('entityID="http://stuff.com/endpoints/metadata.php"', metadata)
[   32s]         self.assertIn('AuthnRequestsSigned="false"', metadata)
[   32s]         self.assertIn('WantAssertionsSigned="false"', metadata)
[   32s] >       self.assertIn('<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://stuff.com/endpoints/endpoints/acs.php" index="1"/>', metadata)
[   32s] E       AssertionError: '<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://stuff.com/endpoints/endpoints/acs.php" index="1"/>' not found in '<?xml version="1.0"?>\n<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"\n                     validUntil="2021-07-18T09:24:36Z"\n                     cacheDuration="PT604800S"\n                     entityID="http://stuff.com/endpoints/metadata.php">\n    <md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">\n        <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"\n                                Location="http://stuff.com/endpoints/endpoints/sls.php" />\n        <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>\n        <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"\n                                     Location="http://stuff.com/endpoints/endpoints/acs.php"\n                                     index="1" />\n    </md:SPSSODescriptor>\n    <md:Organization>\n        <md:OrganizationName xml:lang="en-US">sp_test</md:OrganizationName>\n        <md:OrganizationDisplayName xml:lang="en-US">SP test</md:OrganizationDisplayName>\n        <md:OrganizationURL xml:lang="en-US">http://sp.example.com</md:OrganizationURL>\n    </md:Organization>\n    <md:ContactPerson contactType="technical">\n        <md:GivenName>technical_name</md:GivenName>\n        <md:EmailAddress>technical@example.com</md:EmailAddress>\n    </md:ContactPerson>\n    <md:ContactPerson contactType="support">\n        <md:GivenName>support_name</md:GivenName>\n        <md:EmailAddress>support@example.com</md:EmailAddress>\n    </md:ContactPerson>\n</md:EntityDescriptor>'
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:505: AssertionError
[   32s] _____________ OneLogin_Saml2_Settings_Test.testGetSPMetadataSigned _____________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetSPMetadataSigned>
[   32s] 
[   32s]     def testGetSPMetadataSigned(self):
[   32s]         """
[   32s]         Tests the getSPMetadata method of the OneLogin_Saml2_Settings
[   32s]         Case signed metadata
[   32s]         """
[   32s]         settings_info = self.loadSettingsJSON()
[   32s]         if 'security' not in settings_info:
[   32s]             settings_info['security'] = {}
[   32s]     
[   32s]         settings_info['security']['signMetadata'] = {}
[   32s]     
[   32s]         try:
[   32s]             OneLogin_Saml2_Settings(settings_info)
[   32s]             self.assertTrue(False)
[   32s]         except Exception as e:
[   32s]             self.assertIn('sp_signMetadata_invalid', str(e))
[   32s]     
[   32s]         # Default cert/key
[   32s]         settings_info['security']['signMetadata'] = True
[   32s] >       self.generateAndCheckMetadata(settings_info)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:563: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:587: in generateAndCheckMetadata
[   32s]     metadata = compat.to_string(settings.get_sp_metadata())
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <onelogin.saml2.settings.OneLogin_Saml2_Settings object at 0x7f180735e2e8>
[   32s] 
[   32s]     def get_sp_metadata(self):
[   32s]         """
[   32s]         Gets the SP metadata. The XML representation.
[   32s]         :returns: SP metadata (xml)
[   32s]         :rtype: string
[   32s]         """
[   32s]         metadata = self.metadata_class.builder(
[   32s]             self.__sp, self.__security['authnRequestsSigned'],
[   32s]             self.__security['wantAssertionsSigned'],
[   32s]             self.__security['metadataValidUntil'],
[   32s]             self.__security['metadataCacheDuration'],
[   32s]             self.get_contacts(), self.get_organization()
[   32s]         )
[   32s]     
[   32s]         add_encryption = self.__security['wantNameIdEncrypted'] or self.__security['wantAssertionsEncrypted']
[   32s]     
[   32s]         cert_new = self.get_sp_cert_new()
[   32s]         metadata = self.metadata_class.add_x509_key_descriptors(metadata, cert_new, add_encryption)
[   32s]     
[   32s]         cert = self.get_sp_cert()
[   32s]         metadata = self.metadata_class.add_x509_key_descriptors(metadata, cert, add_encryption)
[   32s]     
[   32s]         # Sign metadata
[   32s]         if 'signMetadata' in self.__security and self.__security['signMetadata'] is not False:
[   32s]             if self.__security['signMetadata'] is True:
[   32s]                 # Use the SP's normal key to sign the metadata:
[   32s]                 if not cert:
[   32s]                     raise OneLogin_Saml2_Error(
[   32s]                         'Cannot sign metadata: missing SP public key certificate.',
[   32s] >                       OneLogin_Saml2_Error.PUBLIC_CERT_FILE_NOT_FOUND
[   32s]                     )
[   32s] E                   onelogin.saml2.errors.OneLogin_Saml2_Error: Cannot sign metadata: missing SP public key certificate.
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/settings.py:689: OneLogin_Saml2_Error
[   32s] _______________ OneLogin_Saml2_Settings_Test.testGetSchemasPath ________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.settings_test.OneLogin_Saml2_Settings_Test testMethod=testGetSchemasPath>
[   32s] 
[   32s]     def testGetSchemasPath(self):
[   32s]         """
[   32s]         Tests getSchemasPath method of the OneLogin_Saml2_Settings
[   32s]         """
[   32s]         settingsInfo = self.loadSettingsJSON()
[   32s]         settings = OneLogin_Saml2_Settings(settingsInfo)
[   32s]         path = settings.get_base_path()
[   32s] >       self.assertEqual(settings.get_schemas_path(), join(dirname(dirname(dirname(dirname(dirname(__file__))))), 'src/onelogin/saml2/schemas/'))
[   32s] E       AssertionError: '/hom[18 chars]BUILDROOT/python-python3-saml-1.10.1-0.x86_64/[51 chars]mas/' != '/hom[18 chars]BUILD/python3-saml-1.10.1/src/onelogin/saml2/schemas/'
[   32s] E       - /home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/schemas/
[   32s] E       ?                            ---- -------                   --------- -  ---------------------- -----
[   32s] E       + /home/abuild/rpmbuild/BUILD/python3-saml-1.10.1/src/onelogin/saml2/schemas/
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/settings_test.py:189: AssertionError
[   32s] ____________________ OneLogin_Saml2_Utils_Test.testAddSign _____________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.utils_test.OneLogin_Saml2_Utils_Test testMethod=testAddSign>
[   32s] 
[   32s]     def testAddSign(self):
[   32s]         """
[   32s]         Tests the add_sign method of the OneLogin_Saml2_Utils
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         key = settings.get_sp_key()
[   32s]         cert = settings.get_sp_cert()
[   32s]     
[   32s]         xml_authn = b64decode(self.file_contents(join(self.data_path, 'requests', 'authn_request.xml.base64')))
[   32s] >       xml_authn_signed = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn, key, cert))
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/utils_test.py:734: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] xml = b'<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_ONELOGIN103428909abec424fa58327f79474984...lasses:Password\r\n        </saml:AuthnContextClassRef>\r\n    </samlp:RequestedAuthnContext>\r\n</samlp:AuthnRequest>'
[   32s] key = None, cert = None, debug = False
[   32s] sign_algorithm = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
[   32s] digest_algorithm = 'http://www.w3.org/2000/09/xmldsig#sha1'
[   32s] 
[   32s]     @staticmethod
[   32s]     def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1, digest_algorithm=OneLogin_Saml2_Constants.SHA1):
[   32s]         """
[   32s]         Adds signature key and senders certificate to an element (Message or
[   32s]         Assertion).
[   32s]     
[   32s]         :param xml: The element we should sign
[   32s]         :type: string | Document
[   32s]     
[   32s]         :param key: The private key
[   32s]         :type: string
[   32s]     
[   32s]         :param cert: The public
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param sign_algorithm: Signature algorithm method
[   32s]         :type sign_algorithm: string
[   32s]     
[   32s]         :param digest_algorithm: Digest algorithm method
[   32s]         :type digest_algorithm: string
[   32s]     
[   32s]         :returns: Signed XML
[   32s]         :rtype: string
[   32s]         """
[   32s]         if xml is None or xml == '':
[   32s]             raise Exception('Empty string supplied as input')
[   32s]     
[   32s]         elem = OneLogin_Saml2_XML.to_etree(xml)
[   32s]     
[   32s]         sign_algorithm_transform_map = {
[   32s]             OneLogin_Saml2_Constants.DSA_SHA1: xmlsec.Transform.DSA_SHA1,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512
[   32s]         }
[   32s]         sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA1)
[   32s]     
[   32s]         signature = xmlsec.template.create(elem, xmlsec.Transform.EXCL_C14N, sign_algorithm_transform, ns='ds')
[   32s]     
[   32s]         issuer = OneLogin_Saml2_XML.query(elem, '//saml:Issuer')
[   32s]         if len(issuer) > 0:
[   32s]             issuer = issuer[0]
[   32s]             issuer.addnext(signature)
[   32s]             elem_to_sign = issuer.getparent()
[   32s]         else:
[   32s]             entity_descriptor = OneLogin_Saml2_XML.query(elem, '//md:EntityDescriptor')
[   32s]             if len(entity_descriptor) > 0:
[   32s]                 elem.insert(0, signature)
[   32s]             else:
[   32s]                 elem[0].insert(0, signature)
[   32s]             elem_to_sign = elem
[   32s]     
[   32s]         elem_id = elem_to_sign.get('ID', None)
[   32s]         if elem_id is not None:
[   32s]             if elem_id:
[   32s]                 elem_id = '#' + elem_id
[   32s]         else:
[   32s]             generated_id = generated_id = OneLogin_Saml2_Utils.generate_unique_id()
[   32s]             elem_id = '#' + generated_id
[   32s]             elem_to_sign.attrib['ID'] = generated_id
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         xmlsec.tree.add_ids(elem_to_sign, ["ID"])
[   32s]     
[   32s]         digest_algorithm_transform_map = {
[   32s]             OneLogin_Saml2_Constants.SHA1: xmlsec.Transform.SHA1,
[   32s]             OneLogin_Saml2_Constants.SHA256: xmlsec.Transform.SHA256,
[   32s]             OneLogin_Saml2_Constants.SHA384: xmlsec.Transform.SHA384,
[   32s]             OneLogin_Saml2_Constants.SHA512: xmlsec.Transform.SHA512
[   32s]         }
[   32s]         digest_algorithm_transform = digest_algorithm_transform_map.get(digest_algorithm, xmlsec.Transform.SHA1)
[   32s]     
[   32s]         ref = xmlsec.template.add_reference(signature, digest_algorithm_transform, uri=elem_id)
[   32s]         xmlsec.template.add_transform(ref, xmlsec.Transform.ENVELOPED)
[   32s]         xmlsec.template.add_transform(ref, xmlsec.Transform.EXCL_C14N)
[   32s]         key_info = xmlsec.template.ensure_key_info(signature)
[   32s]         xmlsec.template.add_x509_data(key_info)
[   32s]     
[   32s]         dsig_ctx = xmlsec.SignatureContext()
[   32s] >       sign_key = xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None)
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:793: TypeError
[   32s] ________________ OneLogin_Saml2_Utils_Test.testAddSignCheckAlg _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.utils_test.OneLogin_Saml2_Utils_Test testMethod=testAddSignCheckAlg>
[   32s] 
[   32s]     def testAddSignCheckAlg(self):
[   32s]         """
[   32s]         Tests the add_sign method of the OneLogin_Saml2_Utils
[   32s]         Case: Review signature & digest algorithm
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         key = settings.get_sp_key()
[   32s]         cert = settings.get_sp_cert()
[   32s]     
[   32s]         xml_authn = b64decode(self.file_contents(join(self.data_path, 'requests', 'authn_request.xml.base64')))
[   32s] >       xml_authn_signed = compat.to_string(OneLogin_Saml2_Utils.add_sign(xml_authn, key, cert))
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/utils_test.py:798: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] xml = b'<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_ONELOGIN103428909abec424fa58327f79474984...lasses:Password\r\n        </saml:AuthnContextClassRef>\r\n    </samlp:RequestedAuthnContext>\r\n</samlp:AuthnRequest>'
[   32s] key = None, cert = None, debug = False
[   32s] sign_algorithm = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
[   32s] digest_algorithm = 'http://www.w3.org/2000/09/xmldsig#sha1'
[   32s] 
[   32s]     @staticmethod
[   32s]     def add_sign(xml, key, cert, debug=False, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1, digest_algorithm=OneLogin_Saml2_Constants.SHA1):
[   32s]         """
[   32s]         Adds signature key and senders certificate to an element (Message or
[   32s]         Assertion).
[   32s]     
[   32s]         :param xml: The element we should sign
[   32s]         :type: string | Document
[   32s]     
[   32s]         :param key: The private key
[   32s]         :type: string
[   32s]     
[   32s]         :param cert: The public
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param sign_algorithm: Signature algorithm method
[   32s]         :type sign_algorithm: string
[   32s]     
[   32s]         :param digest_algorithm: Digest algorithm method
[   32s]         :type digest_algorithm: string
[   32s]     
[   32s]         :returns: Signed XML
[   32s]         :rtype: string
[   32s]         """
[   32s]         if xml is None or xml == '':
[   32s]             raise Exception('Empty string supplied as input')
[   32s]     
[   32s]         elem = OneLogin_Saml2_XML.to_etree(xml)
[   32s]     
[   32s]         sign_algorithm_transform_map = {
[   32s]             OneLogin_Saml2_Constants.DSA_SHA1: xmlsec.Transform.DSA_SHA1,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA1: xmlsec.Transform.RSA_SHA1,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA256: xmlsec.Transform.RSA_SHA256,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA384: xmlsec.Transform.RSA_SHA384,
[   32s]             OneLogin_Saml2_Constants.RSA_SHA512: xmlsec.Transform.RSA_SHA512
[   32s]         }
[   32s]         sign_algorithm_transform = sign_algorithm_transform_map.get(sign_algorithm, xmlsec.Transform.RSA_SHA1)
[   32s]     
[   32s]         signature = xmlsec.template.create(elem, xmlsec.Transform.EXCL_C14N, sign_algorithm_transform, ns='ds')
[   32s]     
[   32s]         issuer = OneLogin_Saml2_XML.query(elem, '//saml:Issuer')
[   32s]         if len(issuer) > 0:
[   32s]             issuer = issuer[0]
[   32s]             issuer.addnext(signature)
[   32s]             elem_to_sign = issuer.getparent()
[   32s]         else:
[   32s]             entity_descriptor = OneLogin_Saml2_XML.query(elem, '//md:EntityDescriptor')
[   32s]             if len(entity_descriptor) > 0:
[   32s]                 elem.insert(0, signature)
[   32s]             else:
[   32s]                 elem[0].insert(0, signature)
[   32s]             elem_to_sign = elem
[   32s]     
[   32s]         elem_id = elem_to_sign.get('ID', None)
[   32s]         if elem_id is not None:
[   32s]             if elem_id:
[   32s]                 elem_id = '#' + elem_id
[   32s]         else:
[   32s]             generated_id = generated_id = OneLogin_Saml2_Utils.generate_unique_id()
[   32s]             elem_id = '#' + generated_id
[   32s]             elem_to_sign.attrib['ID'] = generated_id
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         xmlsec.tree.add_ids(elem_to_sign, ["ID"])
[   32s]     
[   32s]         digest_algorithm_transform_map = {
[   32s]             OneLogin_Saml2_Constants.SHA1: xmlsec.Transform.SHA1,
[   32s]             OneLogin_Saml2_Constants.SHA256: xmlsec.Transform.SHA256,
[   32s]             OneLogin_Saml2_Constants.SHA384: xmlsec.Transform.SHA384,
[   32s]             OneLogin_Saml2_Constants.SHA512: xmlsec.Transform.SHA512
[   32s]         }
[   32s]         digest_algorithm_transform = digest_algorithm_transform_map.get(digest_algorithm, xmlsec.Transform.SHA1)
[   32s]     
[   32s]         ref = xmlsec.template.add_reference(signature, digest_algorithm_transform, uri=elem_id)
[   32s]         xmlsec.template.add_transform(ref, xmlsec.Transform.ENVELOPED)
[   32s]         xmlsec.template.add_transform(ref, xmlsec.Transform.EXCL_C14N)
[   32s]         key_info = xmlsec.template.ensure_key_info(signature)
[   32s]         xmlsec.template.add_x509_data(key_info)
[   32s]     
[   32s]         dsig_ctx = xmlsec.SignatureContext()
[   32s] >       sign_key = xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None)
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:793: TypeError
[   32s] ____________ OneLogin_Saml2_Utils_Test.testCalculateX509Fingerprint ____________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.utils_test.OneLogin_Saml2_Utils_Test testMethod=testCalculateX509Fingerprint>
[   32s] 
[   32s]     def testCalculateX509Fingerprint(self):
[   32s]         """
[   32s]         Tests the calculateX509Fingerprint method of the OneLogin_Saml2_Utils
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]         cert_path = settings.get_cert_path()
[   32s]     
[   32s] >       key = self.file_contents(cert_path + 'sp.key')
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/utils_test.py:579: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.utils_test.OneLogin_Saml2_Utils_Test testMethod=testCalculateX509Fingerprint>
[   32s] filename = '/home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/../../../tests/data/customPath/certs/sp.key'
[   32s] 
[   32s]     def file_contents(self, filename):
[   32s] >       f = open(filename, 'r')
[   32s] E       FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/../../../tests/data/customPath/certs/sp.key'
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/utils_test.py:42: FileNotFoundError
[   32s] _________________ OneLogin_Saml2_Utils_Test.testDecryptElement _________________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.utils_test.OneLogin_Saml2_Utils_Test testMethod=testDecryptElement>
[   32s] 
[   32s]     def testDecryptElement(self):
[   32s]         """
[   32s]         Tests the decrypt_element method of the OneLogin_Saml2_Utils
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]     
[   32s]         key = settings.get_sp_key()
[   32s]     
[   32s]         xml_nameid_enc = b64decode(self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64')))
[   32s]         dom_nameid_enc = etree.fromstring(xml_nameid_enc)
[   32s]         encrypted_nameid_nodes = dom_nameid_enc.find('.//saml:EncryptedID', namespaces=OneLogin_Saml2_Constants.NSMAP)
[   32s]         encrypted_data = encrypted_nameid_nodes[0]
[   32s] >       decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/utils_test.py:635: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] encrypted_data = <Element {http://www.w3.org/2001/04/xmlenc#}EncryptedData at 0x7f1807c453c8>
[   32s] key = None, debug = False, inplace = False
[   32s] 
[   32s]     @staticmethod
[   32s]     def decrypt_element(encrypted_data, key, debug=False, inplace=False):
[   32s]         """
[   32s]         Decrypts an encrypted element.
[   32s]     
[   32s]         :param encrypted_data: The encrypted data.
[   32s]         :type: lxml.etree.Element | DOMElement | basestring
[   32s]     
[   32s]         :param key: The key.
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param inplace: update passed data with decrypted result
[   32s]         :type: bool
[   32s]     
[   32s]         :returns: The decrypted element.
[   32s]         :rtype: lxml.etree.Element
[   32s]         """
[   32s]     
[   32s]         if isinstance(encrypted_data, Element):
[   32s]             encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
[   32s]         if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
[   32s]             encrypted_data = deepcopy(encrypted_data)
[   32s]         elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
[   32s]             encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         manager = xmlsec.KeysManager()
[   32s]     
[   32s] >       manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:706: TypeError
[   32s] _____________ OneLogin_Saml2_Utils_Test.testDecryptElementInplace ______________
[   32s] 
[   32s] self = <tests.src.OneLogin.saml2_tests.utils_test.OneLogin_Saml2_Utils_Test testMethod=testDecryptElementInplace>
[   32s] 
[   32s]     def testDecryptElementInplace(self):
[   32s]         """
[   32s]         Tests the decrypt_element method of the OneLogin_Saml2_Utils with inplace=True
[   32s]         """
[   32s]         settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
[   32s]     
[   32s]         key = settings.get_sp_key()
[   32s]     
[   32s]         xml_nameid_enc = b64decode(self.file_contents(join(self.data_path, 'responses', 'response_encrypted_nameid.xml.base64')))
[   32s]         dom = fromstring(xml_nameid_enc)
[   32s]         encrypted_node = dom.xpath('//saml:EncryptedID/xenc:EncryptedData', namespaces=OneLogin_Saml2_Constants.NSMAP)[0]
[   32s]     
[   32s]         # can be decrypted twice when copy the node first
[   32s]         for _ in range(2):
[   32s] >           decrypted_nameid = OneLogin_Saml2_Utils.decrypt_element(encrypted_node, key, inplace=False)
[   32s] 
[   32s] tests/src/OneLogin/saml2_tests/utils_test.py:712: 
[   32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   32s] 
[   32s] encrypted_data = <Element {http://www.w3.org/2001/04/xmlenc#}EncryptedData at 0x7f18073f1d88>
[   32s] key = None, debug = False, inplace = False
[   32s] 
[   32s]     @staticmethod
[   32s]     def decrypt_element(encrypted_data, key, debug=False, inplace=False):
[   32s]         """
[   32s]         Decrypts an encrypted element.
[   32s]     
[   32s]         :param encrypted_data: The encrypted data.
[   32s]         :type: lxml.etree.Element | DOMElement | basestring
[   32s]     
[   32s]         :param key: The key.
[   32s]         :type: string
[   32s]     
[   32s]         :param debug: Activate the xmlsec debug
[   32s]         :type: bool
[   32s]     
[   32s]         :param inplace: update passed data with decrypted result
[   32s]         :type: bool
[   32s]     
[   32s]         :returns: The decrypted element.
[   32s]         :rtype: lxml.etree.Element
[   32s]         """
[   32s]     
[   32s]         if isinstance(encrypted_data, Element):
[   32s]             encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
[   32s]         if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
[   32s]             encrypted_data = deepcopy(encrypted_data)
[   32s]         elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
[   32s]             encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
[   32s]     
[   32s]         xmlsec.enable_debug_trace(debug)
[   32s]         manager = xmlsec.KeysManager()
[   32s]     
[   32s] >       manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
[   32s] E       TypeError: a bytes-like object is required, not 'NoneType'
[   32s] 
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/utils.py:706: TypeError
[   32s] =============================== warnings summary ===============================
[   32s] ../../BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/xmlparser.py:16
[   32s]   /home/abuild/rpmbuild/BUILDROOT/python-python3-saml-1.10.1-0.x86_64/usr/lib/python3.6/site-packages/onelogin/saml2/xmlparser.py:16: DeprecationWarning: defusedxml.lxml is no longer supported and will be removed in a future release.
[   32s]     from defusedxml.lxml import DTDForbidden, EntitiesForbidden, NotSupportedError
[   32s] 
[   32s] -- Docs: https://docs.pytest.org/en/stable/warnings.html
[   32s] =========================== short test summary info ============================
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testBuildRequestSignature
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testBuildResponseSignature
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testGetLastSAMLResponse
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testGetNameId
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testGetNameIdFormat
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testLoginSigned
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testLogoutSigned
[   32s] FAILED tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testProcessSLORequestSignedResponse
[   32s] FAILED tests/src/OneLogin/saml2_tests/authn_request_test.py::OneLogin_Saml2_Authn_Request_Test::testCreateEncSAMLRequest
[   32s] FAILED tests/src/OneLogin/saml2_tests/logout_request_test.py::OneLogin_Saml2_Logout_Request_Test::testGetNameId
[   32s] FAILED tests/src/OneLogin/saml2_tests/logout_request_test.py::OneLogin_Saml2_Logout_Request_Test::testGetNameIdData
[   32s] FAILED tests/src/OneLogin/saml2_tests/metadata_test.py::OneLogin_Saml2_Metadata_Test::testAddX509KeyDescriptors
[   32s] FAILED tests/src/OneLogin/saml2_tests/metadata_test.py::OneLogin_Saml2_Metadata_Test::testSignMetadata
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testCheckStatus
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testConstruct
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testGetAudiences
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testGetInResponseTo
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testGetIssuers
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testGetNameIdData
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testGetSessionIndex
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testGetSessionNotOnOrAfter
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testGetXMLDocument
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testIsInValidEncIssues
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testIsValidEnc
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testIsValidSign
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testIsValidSignFingerprint
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testQueryAssertions
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testReturnNameId
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testReturnNameIdFormat
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testReturnNameIdNameQualifier
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testReturnNameIdNameSPQualifier
[   32s] FAILED tests/src/OneLogin/saml2_tests/response_test.py::OneLogin_Saml2_Response_Test::testValidateTimestamps
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testCheckSPCerts
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testFormatSPCert
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetIDPCert
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetLibPath
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetSPCert
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetSPCertNew
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetSPKey
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetSPMetadata
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetSPMetadataSigned
[   32s] FAILED tests/src/OneLogin/saml2_tests/settings_test.py::OneLogin_Saml2_Settings_Test::testGetSchemasPath
[   32s] FAILED tests/src/OneLogin/saml2_tests/utils_test.py::OneLogin_Saml2_Utils_Test::testAddSign
[   32s] FAILED tests/src/OneLogin/saml2_tests/utils_test.py::OneLogin_Saml2_Utils_Test::testAddSignCheckAlg
[   32s] FAILED tests/src/OneLogin/saml2_tests/utils_test.py::OneLogin_Saml2_Utils_Test::testCalculateX509Fingerprint
[   32s] FAILED tests/src/OneLogin/saml2_tests/utils_test.py::OneLogin_Saml2_Utils_Test::testDecryptElement
[   32s] FAILED tests/src/OneLogin/saml2_tests/utils_test.py::OneLogin_Saml2_Utils_Test::testDecryptElementInplace
[   32s] =========== 47 failed, 201 passed, 7 deselected, 1 warning in 3.00s ============

Complete build log with all details steps done and packages used.

pitbulk commented 3 years ago

As you can see Github Actions CI raises no error.

Do you have more info about in what system was the command executed?

Can you try run xmlsec test there as well?

mcepl commented 1 year ago

Do you have more info about in what system was the command executed?

Complete build log should be enough, shouldn’t it?

Can you try run xmlsec test there as well?

Tests in https://build.opensuse.org/package/show/openSUSE:Factory/python-xmlsec work just fine (see its build log).

mcepl commented 1 year ago

Problem is still the same, unchanged with 1.15.0:

_log.txt