def check_sp_settings(self, settings):
assert isinstance(settings, dict)<EOL>errors = []<EOL>if not isinstance(settings, dict) or not settings:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>if not settings.get('<STR_LIT>'):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>old_sp = self.__sp<EOL>self.__sp = settings['<STR_LIT>']<EOL>sp = settings['<STR_LIT>']<EOL>security = settings.get('<STR_LIT>', {})<EOL>if not sp.get('<STR_LIT>'):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>if not sp.get('<STR_LIT>', {}).get('<STR_LIT:url>'):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>elif not validate_url(sp['<STR_LIT>']['<STR_LIT:url>']):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>if sp.get('<STR_LIT>'):<EOL><INDENT>attributeConsumingService = sp['<STR_LIT>']<EOL>if '<STR_LIT>' not in attributeConsumingService:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>elif not isinstance(attributeConsumingService['<STR_LIT>'], basestring):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in attributeConsumingService:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>elif not isinstance(attributeConsumingService['<STR_LIT>'], list):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>for req_attrib in attributeConsumingService['<STR_LIT>']:<EOL><INDENT>if '<STR_LIT:name>' not in req_attrib:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:name>' in req_attrib and not req_attrib['<STR_LIT:name>'].strip():<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in req_attrib and type(req_attrib['<STR_LIT>']) != list:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in req_attrib and type(req_attrib['<STR_LIT>']) != bool:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>if "<STR_LIT>" in attributeConsumingService and not isinstance(attributeConsumingService['<STR_LIT>'], basestring):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT><DEDENT>slo_url = sp.get('<STR_LIT>', {}).get('<STR_LIT:url>')<EOL>if slo_url and not validate_url(slo_url):<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in security and isinstance(security['<STR_LIT>'], dict):<EOL><INDENT>if '<STR_LIT>' not in security['<STR_LIT>'] or'<STR_LIT>' not in security['<STR_LIT>']:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT><DEDENT>authn_sign = bool(security.get('<STR_LIT>'))<EOL>logout_req_sign = bool(security.get('<STR_LIT>'))<EOL>logout_res_sign = bool(security.get('<STR_LIT>'))<EOL>want_assert_enc = bool(security.get('<STR_LIT>'))<EOL>want_nameid_enc = bool(security.get('<STR_LIT>'))<EOL>if not self.check_sp_certs():<EOL><INDENT>if authn_sign or logout_req_sign or logout_res_sign orwant_assert_enc or want_nameid_enc:<EOL><INDENT>errors.append('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>if '<STR_LIT>' in settings:<EOL><INDENT>types = settings['<STR_LIT>'].keys()<EOL>valid_types = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>for c_type in types:<EOL><INDENT>if c_type not in valid_types:<EOL><INDENT>errors.append('<STR_LIT>')<EOL>break<EOL><DEDENT><DEDENT>for c_type in settings['<STR_LIT>']:<EOL><INDENT>contact = settings['<STR_LIT>'][c_type]<EOL>if ('<STR_LIT>' not in contact or len(contact['<STR_LIT>']) == <NUM_LIT:0>) or('<STR_LIT>' not in contact or len(contact['<STR_LIT>']) == <NUM_LIT:0>):<EOL><INDENT>errors.append('<STR_LIT>')<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if '<STR_LIT>' in settings:<EOL><INDENT>for org in settings['<STR_LIT>']:<EOL><INDENT>organization = settings['<STR_LIT>'][org]<EOL>if ('<STR_LIT:name>' not in organization or len(organization['<STR_LIT:name>']) == <NUM_LIT:0>) or('<STR_LIT>' not in organization or len(organization['<STR_LIT>']) == <NUM_LIT:0>) or('<STR_LIT:url>' not in organization or len(organization['<STR_LIT:url>']) == <NUM_LIT:0>):<EOL><INDENT>errors.append('<STR_LIT>')<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if '<STR_LIT>' in locals():<EOL><INDENT>self.__sp = old_sp<EOL><DEDENT><DEDENT>return errors<EOL>
Checks the SP settings info.

:param settings: Dict with settings data
:type settings: dict

:returns: Errors found on the SP settings data
:rtype: list