|
46 | 46 | root_logger = logging.getLogger(__name__) |
47 | 47 | root_logger.level = logging.NOTSET |
48 | 48 |
|
| 49 | + |
49 | 50 | NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:assertion' |
50 | 51 | # TEMPLATE = '{urn:oasis:names:tc:SAML:2.0:assertion}%s' |
51 | 52 | # XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance' |
52 | 53 |
|
| 54 | +# spaceone's https://github.com/IdentityPython/pysaml2/pull/326 |
| 55 | +SAMLP_NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:protocol' |
| 56 | +XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance' |
| 57 | +XS_NAMESPACE = 'http://www.w3.org/2001/XMLSchema' |
| 58 | +DS_NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#' |
| 59 | +MD_NAMESPACE = "urn:oasis:names:tc:SAML:2.0:metadata" |
| 60 | +MDUI_NAMESPACE = "urn:oasis:names:tc:SAML:metadata:ui" |
| 61 | +DEFAULT_NS_PREFIXES = {'saml': NAMESPACE, 'samlp': SAMLP_NAMESPACE, |
| 62 | + 'ds': DS_NAMESPACE, 'xsi': XSI_NAMESPACE, |
| 63 | + 'xs': XS_NAMESPACE, |
| 64 | + 'mdui': MDUI_NAMESPACE, |
| 65 | + 'md': MD_NAMESPACE, |
| 66 | + # 'alg': TODO: algsupport.DIGEST_METHODS|SIGNING_METHODS shoulb be moved before mapping them here |
| 67 | + # TODO: <ns1:EntityAttributes> |
| 68 | + } |
| 69 | + |
| 70 | + |
53 | 71 | NAMEID_FORMAT_EMAILADDRESS = ( |
54 | 72 | "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress") |
55 | 73 |
|
@@ -687,7 +705,7 @@ def to_string_force_namespace(self, nspair): |
687 | 705 |
|
688 | 706 | return ElementTree.tostring(elem, encoding="UTF-8") |
689 | 707 |
|
690 | | - def to_string(self, nspair=None): |
| 708 | + def to_string(self, nspair=DEFAULT_NS_PREFIXES): |
691 | 709 | """Converts the Saml object to a string containing XML. |
692 | 710 |
|
693 | 711 | :param nspair: A dictionary of prefixes and uris to use when |
|
0 commit comments