
idp_metadata_parser.py
About this file
We attempted to read from templates/app_lib_onelogin_saml2_idp_metadata_parser.py_hw.txt but failed.
Code Check Report
app/lib/onelogin/saml2/idp_metadata_parser.py:35:121: E501 line too long (132 > 120 characters) app/lib/onelogin/saml2/idp_metadata_parser.py:58:13: E722 do not use bare 'except' app/lib/onelogin/saml2/idp_metadata_parser.py:73:121: E501 line too long (132 > 120 characters) app/lib/onelogin/saml2/idp_metadata_parser.py:165:121: E501 line too long (176 > 120 characters) app/lib/onelogin/saml2/idp_metadata_parser.py:166:121: E501 line too long (176 > 120 characters)
Documentation drawn from source code
OneLogin_Saml2_IdPMetadataParser classCopyright (c) 2010-2018 OneLogin, Inc.MIT LicenseMetadata class of OneLogin's Python Toolkit.
OneLogin_Saml2_IdPMetadataParser(object):
A class that contain methods related to obtaining and parsing metadata from IdP
get_metadata(url, validate_cert=True):
Gets the metadata XML from the provided URL:param url: Url where the XML of the Identity Provider Metadata is published.:type url: string:param validate_cert: If the url uses https schema, that flag enables or not the verification of the associated certificate.:type validate_cert: bool:returns: metadata XML:rtype: string
parse_remote(url, validate_cert=True, entity_id=None, **kwargs):
Gets the metadata XML from the provided URL and parse it, returning a dict with extracted data:param url: Url where the XML of the Identity Provider Metadata is published.:type url: string:param validate_cert: If the url uses https schema, that flag enables or not the verification of the associated certificate.:type validate_cert: bool:param entity_id: Specify the entity_id of the EntityDescriptor that you want to parse a XMLthat contains multiple EntityDescriptor.:type entity_id: string:returns: settings dict with extracted data:rtype: dict
parse(
Parses the Identity Provider metadata and return a dict with extracted data.If there are multiple
merge_settings(settings, new_metadata_settings):
Will update the settings with the provided new settings data extracted from the IdP metadata:param settings: Current settings dict data:type settings: string:param new_metadata_settings: Settings to be merged (extracted from IdP metadata after parsing):type new_metadata_settings: string:returns: merged settings:rtype: dict
dict_deep_merge(a, b, path=None):
Deep-merge dictionary `b` into dictionary `a`.Kudos to http://stackoverflow.com/a/7205107/145400