
metadata.py
About this file
We attempted to read from templates/app_lib_onelogin_saml2_metadata.py_hw.txt but failed.
Code Check Report
app/lib/onelogin/saml2/metadata.py:38:121: E501 line too long (123 > 120 characters) app/lib/onelogin/saml2/metadata.py:103:121: E501 line too long (139 > 120 characters) app/lib/onelogin/saml2/metadata.py:104:121: E501 line too long (167 > 120 characters) app/lib/onelogin/saml2/metadata.py:105:121: E501 line too long (135 > 120 characters) app/lib/onelogin/saml2/metadata.py:106:121: E501 line too long (136 > 120 characters) app/lib/onelogin/saml2/metadata.py:147:121: E501 line too long (135 > 120 characters) app/lib/onelogin/saml2/metadata.py:154:121: E501 line too long (210 > 120 characters) app/lib/onelogin/saml2/metadata.py:195:121: E501 line too long (141 > 120 characters) app/lib/onelogin/saml2/metadata.py:227:121: E501 line too long (122 > 120 characters)
Documentation drawn from source code
OneLoginSaml2Metadata classCopyright (c) 2010-2018 OneLogin, Inc.MIT LicenseMetadata class of OneLogin's Python Toolkit.
OneLogin_Saml2_Metadata(object):
A class that contains methods related to the metadata of the SP
builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None):
Builds the metadata of the SP:param sp: The SP data:type sp: string:param authnsign: authnRequestsSigned attribute:type authnsign: string:param wsign: wantAssertionsSigned attribute:type wsign: string:param valid_until: Metadata's expiry date:type valid_until: string|DateTime|Timestamp:param cache_duration: Duration of the cache in seconds:type cache_duration: int|string:param contacts: Contacts info:type contacts: dict:param organization: Organization info:type organization: dictorganization_names.append("""
sign_metadata(metadata, key, cert, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1, digest_algorithm=OneLogin_Saml2_Constants.SHA1):
Signs the metadata with the key/cert provided:param metadata: SAML Metadata XML:type metadata: string:param key: x509 key:type key: string:param cert: x509 cert:type cert: string:returns: Signed Metadata:rtype: string:param sign_algorithm: Signature algorithm method:type sign_algorithm: string:param digest_algorithm: Digest algorithm method:type digest_algorithm: string
__add_x509_key_descriptors(root, cert, signing):
add_x509_key_descriptors(metadata, cert=None, add_encryption=True):
Adds the x509 descriptors (sign/encryption) to the metadataThe same cert will be used for sign/encrypt:param metadata: SAML Metadata XML:type metadata: string:param cert: x509 cert:type cert: string:param add_encryption: Determines if the KeyDescriptor[use="encryption"] should be added.:type add_encryption: boolean:returns: Metadata with KeyDescriptors:rtype: string