summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2022-10-01 01:02:00 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2022-10-01 18:19:11 +0300
commitc280a912057a3caa82d0ec3b64bb9d208a28677e (patch)
tree7a0567d734fd9d27d30964c51f414a2c20328ec9 /src
parent3007eb7231a6f4e4006614643e67354698900aef (diff)
downloadpysaml2-c280a912057a3caa82d0ec3b64bb9d208a28677e.tar.gz
Format code with black and isort
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/saml2/__init__.py155
-rw-r--r--src/saml2/algsupport.py64
-rw-r--r--src/saml2/argtree.py2
-rw-r--r--src/saml2/assertion.py210
-rw-r--r--src/saml2/attribute_converter.py134
-rw-r--r--src/saml2/attribute_resolver.py10
-rw-r--r--src/saml2/attributemaps/__init__.py2
-rw-r--r--src/saml2/attributemaps/adfs_v1x.py24
-rw-r--r--src/saml2/attributemaps/adfs_v20.py86
-rw-r--r--src/saml2/attributemaps/basic.py672
-rw-r--r--src/saml2/attributemaps/saml_uri.py914
-rw-r--r--src/saml2/attributemaps/shibboleth_uri.py382
-rw-r--r--src/saml2/authn.py48
-rw-r--r--src/saml2/authn_context/__init__.py57
-rw-r--r--src/saml2/authn_context/ippword.py2422
-rw-r--r--src/saml2/authn_context/mobiletwofactor.py2213
-rw-r--r--src/saml2/authn_context/ppt.py2360
-rw-r--r--src/saml2/authn_context/pword.py2258
-rw-r--r--src/saml2/authn_context/sslcert.py2132
-rwxr-xr-xsrc/saml2/authn_context/timesync.py2362
-rw-r--r--src/saml2/cache.py40
-rw-r--r--src/saml2/cert.py99
-rw-r--r--src/saml2/client.py138
-rw-r--r--src/saml2/client_base.py285
-rw-r--r--src/saml2/config.py29
-rw-r--r--src/saml2/cryptography/pki.py2
-rw-r--r--src/saml2/cryptography/symmetric.py45
-rw-r--r--src/saml2/discovery.py19
-rw-r--r--src/saml2/ecp.py57
-rw-r--r--src/saml2/ecp_client.py81
-rw-r--r--src/saml2/entity.py333
-rw-r--r--src/saml2/entity_category/__init__.py4
-rw-r--r--src/saml2/entity_category/at_egov_pvp2.py42
-rw-r--r--src/saml2/entity_category/edugain.py14
-rw-r--r--src/saml2/entity_category/incommon.py13
-rw-r--r--src/saml2/entity_category/refeds.py14
-rw-r--r--src/saml2/entity_category/swamid.py109
-rw-r--r--src/saml2/eptid.py17
-rw-r--r--src/saml2/extension/algsupport.py75
-rw-r--r--src/saml2/extension/dri.py263
-rw-r--r--src/saml2/extension/idpdisc.py10
-rw-r--r--src/saml2/extension/mdattr.py62
-rw-r--r--src/saml2/extension/mdrpi.py199
-rw-r--r--src/saml2/extension/mdui.py263
-rw-r--r--src/saml2/extension/pefim.py53
-rw-r--r--src/saml2/extension/reqinit.py11
-rw-r--r--src/saml2/extension/requested_attributes.py127
-rw-r--r--src/saml2/extension/shibmd.py59
-rw-r--r--src/saml2/extension/sp_type.py19
-rw-r--r--src/saml2/filter.py5
-rw-r--r--src/saml2/httpbase.py125
-rw-r--r--src/saml2/httputil.py117
-rw-r--r--src/saml2/ident.py76
-rw-r--r--src/saml2/mcache.py28
-rw-r--r--src/saml2/md.py1856
-rw-r--r--src/saml2/mdbcache.py57
-rw-r--r--src/saml2/mdie.py35
-rw-r--r--src/saml2/mdstore.py464
-rw-r--r--src/saml2/metadata.py211
-rw-r--r--src/saml2/mongo_store.py58
-rw-r--r--src/saml2/pack.py115
-rw-r--r--src/saml2/population.py7
-rw-r--r--src/saml2/profile/__init__.py4
-rw-r--r--src/saml2/profile/ecp.py195
-rw-r--r--src/saml2/profile/paos.py131
-rw-r--r--src/saml2/profile/samlec.py6
-rw-r--r--src/saml2/request.py128
-rw-r--r--src/saml2/response.py556
-rw-r--r--src/saml2/s2repoze/plugins/challenge_decider.py12
-rw-r--r--src/saml2/s2repoze/plugins/entitlement.py3
-rw-r--r--src/saml2/s2repoze/plugins/formswithhidden.py17
-rw-r--r--src/saml2/s2repoze/plugins/ini.py3
-rw-r--r--src/saml2/s2repoze/plugins/sp.py116
-rw-r--r--src/saml2/s_utils.py80
-rw-r--r--src/saml2/saml.py1546
-rw-r--r--src/saml2/samlp.py1789
-rw-r--r--src/saml2/schema/__init__.py2
-rw-r--r--src/saml2/schema/soap.py543
-rw-r--r--src/saml2/schema/soapenv.py197
-rw-r--r--src/saml2/schema/wsdl.py940
-rw-r--r--src/saml2/sdb.py12
-rw-r--r--src/saml2/server.py367
-rw-r--r--src/saml2/sigver.py852
-rw-r--r--src/saml2/soap.py74
-rw-r--r--src/saml2/time_util.py81
-rw-r--r--src/saml2/tools/make_metadata.py40
-rw-r--r--src/saml2/tools/mdexport.py35
-rw-r--r--src/saml2/tools/mdexport_test.py17
-rw-r--r--src/saml2/tools/mdimport.py13
-rw-r--r--src/saml2/tools/merge_metadata.py34
-rw-r--r--src/saml2/tools/parse_xsd2.py457
-rw-r--r--src/saml2/tools/sync_attrmaps.py23
-rw-r--r--src/saml2/tools/verify_metadata.py33
-rw-r--r--src/saml2/userinfo/__init__.py5
-rw-r--r--src/saml2/userinfo/ldapinfo.py13
-rw-r--r--src/saml2/validate.py84
-rw-r--r--src/saml2/virtual_org.py11
-rw-r--r--src/saml2/ws/__init__.py2
-rw-r--r--src/saml2/ws/wsaddr.py349
-rw-r--r--src/saml2/ws/wspol.py287
-rw-r--r--src/saml2/ws/wssec.py534
-rw-r--r--src/saml2/ws/wstrust.py1281
-rw-r--r--src/saml2/ws/wsutil.py183
-rw-r--r--src/saml2/xml/schema/__init__.py25
-rw-r--r--src/saml2/xmldsig/__init__.py1470
-rw-r--r--src/saml2/xmlenc/__init__.py746
-rw-r--r--src/saml2test/__init__.py22
-rw-r--r--src/saml2test/check.py59
-rw-r--r--src/saml2test/interaction.py49
-rw-r--r--src/saml2test/opfunc.py43
-rw-r--r--src/saml2test/status.py5
-rw-r--r--src/saml2test/tool.py99
-rw-r--r--src/utility/metadata.py27
113 files changed, 17937 insertions, 17806 deletions
diff --git a/src/saml2/__init__.py b/src/saml2/__init__.py
index 6588a741..89105003 100644
--- a/src/saml2/__init__.py
+++ b/src/saml2/__init__.py
@@ -21,13 +21,14 @@ import logging
import six
-from saml2.version import version as __version__
from saml2.validate import valid_instance
+from saml2.version import version as __version__
+
try:
from xml.etree import cElementTree as ElementTree
- if ElementTree.VERSION < '1.3.0':
+ if ElementTree.VERSION < "1.3.0":
# cElementTree has no support for register_namespace
# neither _namespace_map, thus we sacrify performance
# for correctness
@@ -37,17 +38,17 @@ except ImportError:
import cElementTree as ElementTree
except ImportError:
from elementtree import ElementTree
+
import defusedxml.ElementTree
logger = logging.getLogger(__name__)
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:assertion'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:assertion"
# TEMPLATE = '{urn:oasis:names:tc:SAML:2.0:assertion}%s'
# XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'
-NAMEID_FORMAT_EMAILADDRESS = (
- "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress")
+NAMEID_FORMAT_EMAILADDRESS = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
# These are defined in saml2.saml
# NAME_FORMAT_UNSPECIFIED = (
@@ -64,17 +65,17 @@ VERSION = "2.0"
# The specification was later updated with errata, and the new version is here:
# http://www.oasis-open.org/committees/download.php/56779/sstc-saml-bindings-errata-2.0-wd-06.pdf
# parse a SOAP header, make a SOAP request, and receive a SOAP response
-BINDING_SOAP = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP'
+BINDING_SOAP = "urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
# parse a PAOS header, make a PAOS request, and receive a PAOS response
-BINDING_PAOS = 'urn:oasis:names:tc:SAML:2.0:bindings:PAOS'
+BINDING_PAOS = "urn:oasis:names:tc:SAML:2.0:bindings:PAOS"
# URI encoded messages
-BINDING_HTTP_REDIRECT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
+BINDING_HTTP_REDIRECT = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
# HTML encoded messages
-BINDING_HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
+BINDING_HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
# sensitive messages are transported over a backchannel
-BINDING_HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'
+BINDING_HTTP_ARTIFACT = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
# as uri response encoded message
-BINDING_URI = 'urn:oasis:names:tc:SAML:2.0:bindings:URI'
+BINDING_URI = "urn:oasis:names:tc:SAML:2.0:bindings:URI"
def class_name(instance):
@@ -96,13 +97,12 @@ def create_class_from_xml_string(target_class, xml_string):
not match those of the target class.
"""
if not isinstance(xml_string, six.binary_type):
- xml_string = xml_string.encode('utf-8')
+ xml_string = xml_string.encode("utf-8")
tree = defusedxml.ElementTree.fromstring(xml_string)
return create_class_from_element_tree(target_class, tree)
-def create_class_from_element_tree(target_class, tree, namespace=None,
- tag=None):
+def create_class_from_element_tree(target_class, tree, namespace=None, tag=None):
"""Instantiates the class and populates members according to the tree.
Note: Only use this function with classes that have c_namespace and c_tag
@@ -126,7 +126,7 @@ def create_class_from_element_tree(target_class, tree, namespace=None,
namespace = target_class.c_namespace
if tag is None:
tag = target_class.c_tag
- if tree.tag == '{%s}%s' % (namespace, tag):
+ if tree.tag == "{%s}%s" % (namespace, tag):
target = target_class()
target.harvest_element_tree(tree)
return target
@@ -136,6 +136,7 @@ def create_class_from_element_tree(target_class, tree, namespace=None,
class Error(Exception):
"""Exception class thrown by this module."""
+
pass
@@ -152,8 +153,7 @@ class ExtensionElement(object):
extension are turned into ExtensionElements as well.
"""
- def __init__(self, tag, namespace=None, attributes=None,
- children=None, text=None):
+ def __init__(self, tag, namespace=None, attributes=None, children=None, text=None):
"""Constructor for ExtensionElement
:param namespace: The XML namespace for this element.
@@ -173,7 +173,7 @@ class ExtensionElement(object):
self.text = text
def to_string(self):
- """ Serialize the object into a XML string """
+ """Serialize the object into a XML string"""
element_tree = self.transfer_to_element_tree()
return ElementTree.tostring(element_tree, encoding="UTF-8")
@@ -181,10 +181,10 @@ class ExtensionElement(object):
if self.tag is None:
return None
- element_tree = ElementTree.Element('')
+ element_tree = ElementTree.Element("")
if self.namespace is not None:
- element_tree.tag = '{%s}%s' % (self.namespace, self.tag)
+ element_tree.tag = "{%s}%s" % (self.namespace, self.tag)
else:
element_tree.tag = self.tag
@@ -248,7 +248,7 @@ class ExtensionElement(object):
return results
def loadd(self, ava):
- """ expects a special set of keys """
+ """expects a special set of keys"""
if "attributes" in ava:
for key, val in ava["attributes"].items():
@@ -285,9 +285,9 @@ def extension_element_from_string(xml_string):
def _extension_element_from_element_tree(element_tree):
elementc_tag = element_tree.tag
- if '}' in elementc_tag:
- namespace = elementc_tag[1:elementc_tag.index('}')]
- tag = elementc_tag[elementc_tag.index('}') + 1:]
+ if "}" in elementc_tag:
+ namespace = elementc_tag[1 : elementc_tag.index("}")]
+ tag = elementc_tag[elementc_tag.index("}") + 1 :]
else:
namespace = None
tag = elementc_tag
@@ -304,8 +304,7 @@ class ExtensionContainer(object):
c_tag = ""
c_namespace = ""
- def __init__(self, text=None, extension_elements=None,
- extension_attributes=None):
+ def __init__(self, text=None, extension_elements=None, extension_attributes=None):
self.text = text
self.extension_elements = extension_elements or []
@@ -322,8 +321,7 @@ class ExtensionContainer(object):
self.text = tree.text
def _convert_element_tree_to_member(self, child_tree):
- self.extension_elements.append(_extension_element_from_element_tree(
- child_tree))
+ self.extension_elements.append(_extension_element_from_element_tree(child_tree))
def _convert_element_attribute_to_member(self, attribute, value):
self.extension_attributes[attribute] = value
@@ -373,7 +371,7 @@ class ExtensionContainer(object):
return results
def extensions_as_elements(self, tag, schema):
- """ Return extensions that has the given tag and belongs to the
+ """Return extensions that has the given tag and belongs to the
given schema as native elements of that schema.
:param tag: The tag of the element
@@ -397,8 +395,7 @@ class ExtensionContainer(object):
self.extension_attributes[name] = value
-def make_vals(val, klass, klass_inst=None, prop=None, part=False,
- base64encode=False):
+def make_vals(val, klass, klass_inst=None, prop=None, part=False, base64encode=False):
"""
Creates a class instance with a specified value, the specified
class instance may be a value on a property in a defined class instance.
@@ -423,8 +420,7 @@ def make_vals(val, klass, klass_inst=None, prop=None, part=False,
cinst = klass().set_text(val)
except ValueError:
if not part:
- cis = [make_vals(sval, klass, klass_inst, prop, True,
- base64encode) for sval in val]
+ cis = [make_vals(sval, klass, klass_inst, prop, True, base64encode) for sval in val]
setattr(klass_inst, prop, cis)
else:
raise
@@ -485,12 +481,9 @@ class SamlBase(ExtensionContainer):
if isinstance(member_class, list):
if getattr(self, member_name) is None:
setattr(self, member_name, [])
- getattr(self, member_name).append(
- create_class_from_element_tree(member_class[0], child_tree))
+ getattr(self, member_name).append(create_class_from_element_tree(member_class[0], child_tree))
else:
- setattr(self, member_name,
- create_class_from_element_tree(member_class,
- child_tree))
+ setattr(self, member_name, create_class_from_element_tree(member_class, child_tree))
else:
ExtensionContainer._convert_element_tree_to_member(self, child_tree)
@@ -503,8 +496,7 @@ class SamlBase(ExtensionContainer):
setattr(self, self.__class__.c_attributes[attribute][0], value)
else:
# If it doesn't appear in the attribute list it's an extension
- ExtensionContainer._convert_element_attribute_to_member(
- self, attribute, value)
+ ExtensionContainer._convert_element_attribute_to_member(self, attribute, value)
# Three methods to create an ElementTree from an object
def _add_members_to_element_tree(self, tree):
@@ -521,8 +513,7 @@ class SamlBase(ExtensionContainer):
else:
member.become_child_element_of(tree)
# Convert the members of this class which are XML attributes.
- for xml_attribute, attribute_info in \
- iter(self.__class__.c_attributes.items()):
+ for xml_attribute, attribute_info in iter(self.__class__.c_attributes.items()):
(member_name, member_type, required) = attribute_info
member = getattr(self, member_name)
if member is not None:
@@ -551,8 +542,7 @@ class SamlBase(ExtensionContainer):
should not be called on in this class.
"""
- new_tree = ElementTree.Element('{%s}%s' % (self.__class__.c_namespace,
- self.__class__.c_tag))
+ new_tree = ElementTree.Element("{%s}%s" % (self.__class__.c_namespace, self.__class__.c_tag))
self._add_members_to_element_tree(new_tree)
return new_tree
@@ -604,43 +594,33 @@ class SamlBase(ExtensionContainer):
prefix_map["encas%d" % len(prefix_map)] = uri
return prefix_map
- def get_xml_string_with_self_contained_assertion_within_advice_encrypted_assertion(
- self, assertion_tag, advice_tag):
- for tmp_encrypted_assertion in \
- self.assertion.advice.encrypted_assertion:
+ def get_xml_string_with_self_contained_assertion_within_advice_encrypted_assertion(self, assertion_tag, advice_tag):
+ for tmp_encrypted_assertion in self.assertion.advice.encrypted_assertion:
if tmp_encrypted_assertion.encrypted_data is None:
- prefix_map = self.get_prefix_map([
- tmp_encrypted_assertion._to_element_tree().find(
- assertion_tag)])
+ prefix_map = self.get_prefix_map([tmp_encrypted_assertion._to_element_tree().find(assertion_tag)])
tree = self._to_element_tree()
- encs = tree.find(assertion_tag).find(advice_tag).findall(
- tmp_encrypted_assertion._to_element_tree().tag)
+ encs = tree.find(assertion_tag).find(advice_tag).findall(tmp_encrypted_assertion._to_element_tree().tag)
for enc in encs:
assertion = enc.find(assertion_tag)
if assertion is not None:
self.set_prefixes(assertion, prefix_map)
- return ElementTree.tostring(tree, encoding="UTF-8").decode('utf-8')
+ return ElementTree.tostring(tree, encoding="UTF-8").decode("utf-8")
- def get_xml_string_with_self_contained_assertion_within_encrypted_assertion(
- self, assertion_tag):
- """ Makes a encrypted assertion only containing self contained
+ def get_xml_string_with_self_contained_assertion_within_encrypted_assertion(self, assertion_tag):
+ """Makes a encrypted assertion only containing self contained
namespaces.
:param assertion_tag: Tag for the assertion to be transformed.
:return: A new samlp.Resonse in string representation.
"""
- prefix_map = self.get_prefix_map(
- [self.encrypted_assertion._to_element_tree().find(assertion_tag)])
+ prefix_map = self.get_prefix_map([self.encrypted_assertion._to_element_tree().find(assertion_tag)])
tree = self._to_element_tree()
- self.set_prefixes(
- tree.find(
- self.encrypted_assertion._to_element_tree().tag).find(
- assertion_tag), prefix_map)
+ self.set_prefixes(tree.find(self.encrypted_assertion._to_element_tree().tag).find(assertion_tag), prefix_map)
- return ElementTree.tostring(tree, encoding="UTF-8").decode('utf-8')
+ return ElementTree.tostring(tree, encoding="UTF-8").decode("utf-8")
def set_prefixes(self, elem, prefix_map):
@@ -710,29 +690,29 @@ class SamlBase(ExtensionContainer):
# Yes this is confusing. http://bugs.python.org/issue10942
x = self.to_string()
if not isinstance(x, six.string_types):
- x = x.decode('utf-8')
+ x = x.decode("utf-8")
return x
def keyswv(self):
- """ Return the keys of attributes or children that has values
+ """Return the keys of attributes or children that has values
:return: list of keys
"""
return [key for key, val in self.__dict__.items() if val]
def keys(self):
- """ Return all the keys that represent possible attributes and
+ """Return all the keys that represent possible attributes and
children.
:return: list of keys
"""
- keys = ['text']
+ keys = ["text"]
keys.extend([n for (n, t, r) in self.c_attributes.values()])
keys.extend([v[0] for v in self.c_children.values()])
return keys
def children_with_values(self):
- """ Returns all children that has values
+ """Returns all children that has values
:return: Possibly empty list of children.
"""
@@ -750,7 +730,7 @@ class SamlBase(ExtensionContainer):
# noinspection PyUnusedLocal
def set_text(self, val, base64encode=False):
- """ Sets the text property of this instance.
+ """Sets the text property of this instance.
:param val: The value of the text property
:param base64encode: Whether the value should be base64encoded
@@ -805,17 +785,14 @@ class SamlBase(ExtensionContainer):
# print("### %s" % ava[prop])
# means there can be a list of values
if isinstance(klassdef, list):
- make_vals(ava[prop], klassdef[0], self, prop,
- base64encode=base64encode)
+ make_vals(ava[prop], klassdef[0], self, prop, base64encode=base64encode)
else:
- cis = make_vals(ava[prop], klassdef, self, prop, True,
- base64encode)
+ cis = make_vals(ava[prop], klassdef, self, prop, True, base64encode)
setattr(self, prop, cis)
if "extension_elements" in ava:
for item in ava["extension_elements"]:
- self.extension_elements.append(ExtensionElement(
- item["tag"]).loadd(item))
+ self.extension_elements.append(ExtensionElement(item["tag"]).loadd(item))
if "extension_attributes" in ava:
for key, val in ava["extension_attributes"].items():
@@ -865,7 +842,7 @@ class SamlBase(ExtensionContainer):
return True
def child_class(self, child):
- """ Return the class a child element should be an instance of
+ """Return the class a child element should be an instance of
:param child: The name of the child element
:return: The class
@@ -879,7 +856,7 @@ class SamlBase(ExtensionContainer):
return None
def child_cardinality(self, child):
- """ Return the cardinality of a child element
+ """Return the cardinality of a child element
:param child: The name of the child element
:return: The cardinality as a 2-tuple (min, max).
@@ -933,27 +910,23 @@ def element_to_extension_element(element):
:return: An extension element instance
"""
- exel = ExtensionElement(element.c_tag, element.c_namespace,
- text=element.text)
+ exel = ExtensionElement(element.c_tag, element.c_namespace, text=element.text)
exel.attributes.update(element.extension_attributes)
exel.children.extend(element.extension_elements)
- for xml_attribute, (member_name, typ, req) in \
- iter(element.c_attributes.items()):
+ for xml_attribute, (member_name, typ, req) in iter(element.c_attributes.items()):
member_value = getattr(element, member_name)
if member_value is not None:
exel.attributes[xml_attribute] = member_value
- exel.children.extend([element_to_extension_element(c) for c in
- element.children_with_values()])
+ exel.children.extend([element_to_extension_element(c) for c in element.children_with_values()])
return exel
-def extension_element_to_element(extension_element, translation_functions,
- namespace=None):
- """ Convert an extension element to a normal element.
+def extension_element_to_element(extension_element, translation_functions, namespace=None):
+ """Convert an extension element to a normal element.
In order to do this you need to have an idea of what type of
element it is. Or rather which module it belongs to.
@@ -982,7 +955,7 @@ def extension_element_to_element(extension_element, translation_functions,
def extension_elements_to_elements(extension_elements, schemas, keep_unmatched=False):
- """ Create a list of elements each one matching one of the
+ """Create a list of elements each one matching one of the
given extension elements. This is of course dependent on the access
to schemas that describe the extension elements.
@@ -1009,11 +982,7 @@ def extension_elements_to_elements(extension_elements, schemas, keep_unmatched=F
convert_results = (
inst
for schema in schemas
- for inst in [
- extension_element_to_element(
- extension_element, schema.ELEMENT_FROM_STRING, schema.NAMESPACE
- )
- ]
+ for inst in [extension_element_to_element(extension_element, schema.ELEMENT_FROM_STRING, schema.NAMESPACE)]
if inst
)
result = next(convert_results, extension_element if keep_unmatched else None)
diff --git a/src/saml2/algsupport.py b/src/saml2/algsupport.py
index 93580d65..7293b120 100644
--- a/src/saml2/algsupport.py
+++ b/src/saml2/algsupport.py
@@ -1,48 +1,51 @@
-from subprocess import Popen, PIPE
-from saml2.sigver import get_xmlsec_binary
-from saml2.extension.algsupport import SigningMethod
+from subprocess import PIPE
+from subprocess import Popen
+
from saml2.extension.algsupport import DigestMethod
+from saml2.extension.algsupport import SigningMethod
+from saml2.sigver import get_xmlsec_binary
+
-__author__ = 'roland'
+__author__ = "roland"
DIGEST_METHODS = {
- "hmac-md5": 'http://www.w3.org/2001/04/xmldsig-more#md5', # test framework only!
- "hmac-sha1": 'http://www.w3.org/2000/09/xmldsig#sha1',
- "hmac-sha224": 'http://www.w3.org/2001/04/xmldsig-more#sha224',
- "hmac-sha256": 'http://www.w3.org/2001/04/xmlenc#sha256',
- "hmac-sha384": 'http://www.w3.org/2001/04/xmldsig-more#sha384',
- "hmac-sha512": 'http://www.w3.org/2001/04/xmlenc#sha512',
- "hmac-ripemd160": 'http://www.w3.org/2001/04/xmlenc#ripemd160'
+ "hmac-md5": "http://www.w3.org/2001/04/xmldsig-more#md5", # test framework only!
+ "hmac-sha1": "http://www.w3.org/2000/09/xmldsig#sha1",
+ "hmac-sha224": "http://www.w3.org/2001/04/xmldsig-more#sha224",
+ "hmac-sha256": "http://www.w3.org/2001/04/xmlenc#sha256",
+ "hmac-sha384": "http://www.w3.org/2001/04/xmldsig-more#sha384",
+ "hmac-sha512": "http://www.w3.org/2001/04/xmlenc#sha512",
+ "hmac-ripemd160": "http://www.w3.org/2001/04/xmlenc#ripemd160",
}
SIGNING_METHODS = {
- "rsa-md5": 'http://www.w3.org/2001/04/xmldsig-more#rsa-md5',
- "rsa-ripemd160": 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160',
- "rsa-sha1": 'http://www.w3.org/2000/09/xmldsig#rsa-sha1',
- "rsa-sha224": 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224',
- "rsa-sha256": 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
- "rsa-sha384": 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384',
- "rsa-sha512": 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512',
- "dsa-sha1": 'http://www.w3.org/2000/09/xmldsig#dsa-sha1',
- 'dsa-sha256': 'http://www.w3.org/2009/xmldsig11#dsa-sha256',
- 'ecdsa-sha1': 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1',
- 'ecdsa-sha224': 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224',
- 'ecdsa-sha256': 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256',
- 'ecdsa-sha384': 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384',
- 'ecdsa-sha512': 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512',
+ "rsa-md5": "http://www.w3.org/2001/04/xmldsig-more#rsa-md5",
+ "rsa-ripemd160": "http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160",
+ "rsa-sha1": "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
+ "rsa-sha224": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha224",
+ "rsa-sha256": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
+ "rsa-sha384": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384",
+ "rsa-sha512": "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512",
+ "dsa-sha1": "http://www.w3.org/2000/09/xmldsig#dsa-sha1",
+ "dsa-sha256": "http://www.w3.org/2009/xmldsig11#dsa-sha256",
+ "ecdsa-sha1": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1",
+ "ecdsa-sha224": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224",
+ "ecdsa-sha256": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256",
+ "ecdsa-sha384": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384",
+ "ecdsa-sha512": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512",
}
def get_algorithm_support(xmlsec):
- com_list = [xmlsec, '--list-transforms']
+ com_list = [xmlsec, "--list-transforms"]
pof = Popen(com_list, stderr=PIPE, stdout=PIPE)
p_out, p_err = pof.communicate()
- p_out = p_out.decode('utf-8')
- p_err = p_err.decode('utf-8')
+ p_out = p_out.decode("utf-8")
+ p_err = p_err.decode("utf-8")
if not p_err:
p = p_out.splitlines()
- algs = [x.strip('"') for x in p[1].split(',')]
+ algs = [x.strip('"') for x in p[1].split(",")]
digest = []
signing = []
for alg in algs:
@@ -68,7 +71,8 @@ def algorithm_support_in_metadata(xmlsec):
element_list.append(SigningMethod(algorithm=SIGNING_METHODS[alg]))
return element_list
-if __name__ == '__main__':
+
+if __name__ == "__main__":
xmlsec = get_xmlsec_binary()
res = get_algorithm_support(xmlsec)
print(res)
diff --git a/src/saml2/argtree.py b/src/saml2/argtree.py
index 468b7f07..3cc579ff 100644
--- a/src/saml2/argtree.py
+++ b/src/saml2/argtree.py
@@ -1,4 +1,4 @@
-__author__ = 'roland'
+__author__ = "roland"
def find_paths(cls, arg, path=None, seen=None, res=None, lev=0):
diff --git a/src/saml2/assertion.py b/src/saml2/assertion.py
index c946338a..237bca7b 100644
--- a/src/saml2/assertion.py
+++ b/src/saml2/assertion.py
@@ -4,27 +4,29 @@ import copy
import importlib
import logging
import re
-import six
from warnings import warn as _warn
+import six
+
from saml2 import saml
from saml2 import xmlenc
-from saml2.attribute_converter import from_local, ac_factory
+from saml2.attribute_converter import ac_factory
+from saml2.attribute_converter import from_local
from saml2.attribute_converter import get_local_name
+from saml2.s_utils import MissingValue
from saml2.s_utils import assertion_factory
from saml2.s_utils import factory
from saml2.s_utils import sid
-from saml2.s_utils import MissingValue
from saml2.saml import NAME_FORMAT_URI
-from saml2.time_util import instant
from saml2.time_util import in_a_while
+from saml2.time_util import instant
logger = logging.getLogger(__name__)
def _filter_values(vals, vlist=None, must=False):
- """ Removes values from *vals* that does not appear in vlist
+ """Removes values from *vals* that does not appear in vlist
:param vals: The values that are to be filtered
:param vlist: required or optional value
@@ -35,7 +37,7 @@ def _filter_values(vals, vlist=None, must=False):
if not vlist: # No value specified equals any value
return vals
- if vals is None: # cannot iterate over None, return early
+ if vals is None: # cannot iterate over None, return early
return vals
if isinstance(vlist, six.string_types):
@@ -71,9 +73,8 @@ def _match(attr, ava):
return None
-def filter_on_attributes(ava, required=None, optional=None, acs=None,
- fail_on_unfulfilled_requirements=True):
- """ Filter
+def filter_on_attributes(ava, required=None, optional=None, acs=None, fail_on_unfulfilled_requirements=True):
+ """Filter
:param ava: An attribute value assertion as a dictionary
:param required: list of RequestedAttribute instances defined to be
@@ -89,11 +90,7 @@ def filter_on_attributes(ava, required=None, optional=None, acs=None,
name = attr["name"].lower()
name_format = attr.get("name_format")
friendly_name = attr.get("friendly_name")
- local_name = (
- get_local_name(acs, name, name_format)
- or friendly_name
- or ""
- )
+ local_name = get_local_name(acs, name, name_format) or friendly_name or ""
_fn = (
_match(local_name, ava)
# In the unlikely case that someone has provided us with URIs as attribute names
@@ -101,11 +98,8 @@ def filter_on_attributes(ava, required=None, optional=None, acs=None,
)
return _fn
-
def _apply_attr_value_restrictions(attr, res, must=False):
- values = [
- av["text"] for av in attr.get("attribute_value", [])
- ]
+ values = [av["text"] for av in attr.get("attribute_value", [])]
try:
res[_fn].extend(_filter_values(ava[_fn], values))
@@ -141,7 +135,7 @@ def filter_on_attributes(ava, required=None, optional=None, acs=None,
def filter_on_demands(ava, required=None, optional=None):
- """ Never return more than is needed. Filters out everything
+ """Never return more than is needed. Filters out everything
the server is prepared to return but the receiver doesn't ask for
:param ava: Attribute value assertion as a dictionary
@@ -162,9 +156,7 @@ def filter_on_demands(ava, required=None, optional=None):
if vals:
for val in vals:
if val not in ava[lava[attr]]:
- raise MissingValue(
- "Required attribute value missing: %s,%s" % (attr,
- val))
+ raise MissingValue("Required attribute value missing: %s,%s" % (attr, val))
else:
raise MissingValue("Required attribute missing: %s" % (attr,))
@@ -225,7 +217,7 @@ def filter_on_wire_representation(ava, acs, required=None, optional=None):
def filter_attribute_value_assertions(ava, attribute_restrictions=None):
- """ Will weed out attribute values and values according to the
+ """Will weed out attribute values and values according to the
rules defined in the attribute restrictions. If filtering results in
an attribute without values, then the attribute is removed from the
assertion.
@@ -276,7 +268,7 @@ def restriction_from_attribute_spec(attributes):
def compile(restrictions):
- """ This is only for IdPs or AAs, and it's about limiting what
+ """This is only for IdPs or AAs, and it's about limiting what
is returned to the SP.
In the configuration file, restrictions on which values that
can be returned are specified with the help of regular expressions.
@@ -310,9 +302,7 @@ def compile(restrictions):
for key, values in attribute_restrictions.items():
lkey = key.lower()
values = [] if not values else values
- _attribute_restrictions[lkey] = (
- [re.compile(value) for value in values] or None
- )
+ _attribute_restrictions[lkey] = [re.compile(value) for value in values] or None
spec["attribute_restrictions"] = _attribute_restrictions or None
return restrictions
@@ -346,19 +336,12 @@ class Policy(object):
if not self._restrictions:
return default
- ra_info = (
- self.metadata_store.registration_info(sp_entity_id) or {}
- if self.metadata_store is not None
- else {}
- )
+ ra_info = self.metadata_store.registration_info(sp_entity_id) or {} if self.metadata_store is not None else {}
ra_entity_id = ra_info.get("registration_authority")
sp_restrictions = self._restrictions.get(sp_entity_id)
ra_restrictions = self._restrictions.get(ra_entity_id)
- default_restrictions = (
- self._restrictions.get("default")
- or self._restrictions.get("")
- )
+ default_restrictions = self._restrictions.get("default") or self._restrictions.get("")
restrictions = (
sp_restrictions
if sp_restrictions is not None
@@ -370,22 +353,18 @@ class Policy(object):
)
attribute_restriction = restrictions.get(attribute)
- restriction = (
- attribute_restriction
- if attribute_restriction is not None
- else default
- )
+ restriction = attribute_restriction if attribute_restriction is not None else default
return restriction
def get_nameid_format(self, sp_entity_id):
- """ Get the NameIDFormat to used for the entity id
+ """Get the NameIDFormat to used for the entity id
:param: The SP entity ID
:retur: The format
"""
return self.get("nameid_format", sp_entity_id, saml.NAMEID_FORMAT_TRANSIENT)
def get_name_form(self, sp_entity_id):
- """ Get the NameFormat to used for the entity id
+ """Get the NameFormat to used for the entity id
:param: The SP entity ID
:retur: The format
"""
@@ -393,7 +372,7 @@ class Policy(object):
return self.get("name_form", sp_entity_id, default=NAME_FORMAT_URI)
def get_lifetime(self, sp_entity_id):
- """ The lifetime of the assertion
+ """The lifetime of the assertion
:param sp_entity_id: The SP entity ID
:param: lifetime as a dictionary
"""
@@ -401,7 +380,7 @@ class Policy(object):
return self.get("lifetime", sp_entity_id, {"hours": 1})
def get_attribute_restrictions(self, sp_entity_id):
- """ Return the attribute restriction for SP that want the information
+ """Return the attribute restriction for SP that want the information
:param sp_entity_id: The SP entity ID
:return: The restrictions
@@ -410,7 +389,7 @@ class Policy(object):
return self.get("attribute_restrictions", sp_entity_id)
def get_fail_on_missing_requested(self, sp_entity_id):
- """ Return the whether the IdP should should fail if the SPs
+ """Return the whether the IdP should should fail if the SPs
requested attributes could not be found.
:param sp_entity_id: The SP entity ID
@@ -450,15 +429,10 @@ class Policy(object):
def post_entity_categories(maps, sp_entity_id=None, mds=None, required=None):
restrictions = {}
required_friendly_names = [
- d.get('friendly_name') or get_local_name(
- acs=self.acs, attr=d['name'], name_format=d['name_format']
- )
+ d.get("friendly_name") or get_local_name(acs=self.acs, attr=d["name"], name_format=d["name_format"])
for d in (required or [])
]
- required = [
- friendly_name.lower()
- for friendly_name in required_friendly_names
- ]
+ required = [friendly_name.lower() for friendly_name in required_friendly_names]
if mds:
ecs = mds.entity_categories(sp_entity_id)
@@ -486,7 +460,7 @@ class Policy(object):
for attr in attrs:
restrictions[attr] = None
else:
- restrictions[''] = None
+ restrictions[""] = None
return restrictions
@@ -504,7 +478,7 @@ class Policy(object):
return result2
def not_on_or_after(self, sp_entity_id):
- """ When the assertion stops being valid, should not be
+ """When the assertion stops being valid, should not be
used after this time.
:param sp_entity_id: The SP entity ID
@@ -514,7 +488,7 @@ class Policy(object):
return in_a_while(**self.get_lifetime(sp_entity_id))
def filter(self, ava, sp_entity_id, mdstore=None, required=None, optional=None):
- """ What attribute and attribute values returns depends on what
+ """What attribute and attribute values returns depends on what
the SP or the registration authority has said it wants in the request
or in the metadata file and what the IdP/AA wants to release.
An assumption is that what the SP or the registration authority
@@ -564,7 +538,7 @@ class Policy(object):
return subject_ava or {}
def restrict(self, ava, sp_entity_id, metadata=None):
- """ Identity attribute names are expected to be expressed as FriendlyNames
+ """Identity attribute names are expected to be expressed as FriendlyNames
:return: A filtered ava according to the IdPs/AAs rules and
the list of required/optional attributes according to the SP.
@@ -580,11 +554,7 @@ class Policy(object):
_warn(warn_msg, DeprecationWarning)
metadata_store = metadata or self.metadata_store
- spec = (
- metadata_store.attribute_requirement(sp_entity_id) or {}
- if metadata_store
- else {}
- )
+ spec = metadata_store.attribute_requirement(sp_entity_id) or {} if metadata_store else {}
return self.filter(
ava,
sp_entity_id,
@@ -593,7 +563,7 @@ class Policy(object):
)
def conditions(self, sp_entity_id):
- """ Return a saml.Condition instance
+ """Return a saml.Condition instance
:param sp_entity_id: The SP entity ID
:return: A saml.Condition instance
@@ -625,13 +595,13 @@ def _authn_context_class_ref(authn_class, authn_auth=None):
"""
cntx_class = factory(saml.AuthnContextClassRef, text=authn_class)
if authn_auth:
- return factory(saml.AuthnContext,
- authn_context_class_ref=cntx_class,
- authenticating_authority=factory(
- saml.AuthenticatingAuthority, text=authn_auth))
+ return factory(
+ saml.AuthnContext,
+ authn_context_class_ref=cntx_class,
+ authenticating_authority=factory(saml.AuthenticatingAuthority, text=authn_auth),
+ )
else:
- return factory(saml.AuthnContext,
- authn_context_class_ref=cntx_class)
+ return factory(saml.AuthnContext, authn_context_class_ref=cntx_class)
def _authn_context_decl(decl, authn_auth=None):
@@ -641,10 +611,11 @@ def _authn_context_decl(decl, authn_auth=None):
:param authn_auth: Authenticating Authority
:return: An AuthnContext instance
"""
- return factory(saml.AuthnContext,
- authn_context_decl=decl,
- authenticating_authority=factory(
- saml.AuthenticatingAuthority, text=authn_auth))
+ return factory(
+ saml.AuthnContext,
+ authn_context_decl=decl,
+ authenticating_authority=factory(saml.AuthenticatingAuthority, text=authn_auth),
+ )
def _authn_context_decl_ref(decl_ref, authn_auth=None):
@@ -654,15 +625,22 @@ def _authn_context_decl_ref(decl_ref, authn_auth=None):
:param authn_auth: Authenticating Authority
:return: An AuthnContext instance
"""
- return factory(saml.AuthnContext,
- authn_context_decl_ref=decl_ref,
- authenticating_authority=factory(
- saml.AuthenticatingAuthority, text=authn_auth))
-
-
-def authn_statement(authn_class=None, authn_auth=None,
- authn_decl=None, authn_decl_ref=None, authn_instant="",
- subject_locality="", session_not_on_or_after=None):
+ return factory(
+ saml.AuthnContext,
+ authn_context_decl_ref=decl_ref,
+ authenticating_authority=factory(saml.AuthenticatingAuthority, text=authn_auth),
+ )
+
+
+def authn_statement(
+ authn_class=None,
+ authn_auth=None,
+ authn_decl=None,
+ authn_decl_ref=None,
+ authn_instant="",
+ subject_locality="",
+ session_not_on_or_after=None,
+):
"""
Construct the AuthnStatement
:param authn_class: Authentication Context Class reference
@@ -687,29 +665,31 @@ def authn_statement(authn_class=None, authn_auth=None,
authn_instant=_instant,
session_index=sid(),
session_not_on_or_after=session_not_on_or_after,
- authn_context=_authn_context_class_ref(
- authn_class, authn_auth))
+ authn_context=_authn_context_class_ref(authn_class, authn_auth),
+ )
elif authn_decl:
res = factory(
saml.AuthnStatement,
authn_instant=_instant,
session_index=sid(),
session_not_on_or_after=session_not_on_or_after,
- authn_context=_authn_context_decl(authn_decl, authn_auth))
+ authn_context=_authn_context_decl(authn_decl, authn_auth),
+ )
elif authn_decl_ref:
res = factory(
saml.AuthnStatement,
authn_instant=_instant,
session_index=sid(),
session_not_on_or_after=session_not_on_or_after,
- authn_context=_authn_context_decl_ref(authn_decl_ref,
- authn_auth))
+ authn_context=_authn_context_decl_ref(authn_decl_ref, authn_auth),
+ )
else:
res = factory(
saml.AuthnStatement,
authn_instant=_instant,
session_index=sid(),
- session_not_on_or_after=session_not_on_or_after)
+ session_not_on_or_after=session_not_on_or_after,
+ )
if subject_locality:
res.subject_locality = saml.SubjectLocality(text=subject_locality)
@@ -746,7 +726,7 @@ def do_subject_confirmation(not_on_or_after, key_info=None, **treeargs):
def do_subject(not_on_or_after, name_id, **farg):
- specs = farg['subject_confirmation']
+ specs = farg["subject_confirmation"]
if isinstance(specs, list):
res = [do_subject_confirmation(not_on_or_after, **s) for s in specs]
@@ -757,18 +737,32 @@ def do_subject(not_on_or_after, name_id, **farg):
class Assertion(dict):
- """ Handles assertions about subjects """
+ """Handles assertions about subjects"""
def __init__(self, dic=None):
dict.__init__(self, dic)
self.acs = []
- def construct(self, sp_entity_id, attrconvs, policy, issuer, farg,
- authn_class=None, authn_auth=None, authn_decl=None,
- encrypt=None, sec_context=None, authn_decl_ref=None,
- authn_instant="", subject_locality="", authn_statem=None,
- name_id=None, session_not_on_or_after=None):
- """ Construct the Assertion
+ def construct(
+ self,
+ sp_entity_id,
+ attrconvs,
+ policy,
+ issuer,
+ farg,
+ authn_class=None,
+ authn_auth=None,
+ authn_decl=None,
+ encrypt=None,
+ sec_context=None,
+ authn_decl_ref=None,
+ authn_instant="",
+ subject_locality="",
+ authn_statem=None,
+ name_id=None,
+ session_not_on_or_after=None,
+ ):
+ """Construct the Assertion
:param sp_entity_id: The entityid of the SP
:param in_response_to: An identifier of the message, this message is
@@ -793,9 +787,7 @@ class Assertion(dict):
_name_format = policy.get_name_form(sp_entity_id)
- attr_statement = saml.AttributeStatement(
- attribute=from_local(attrconvs, self, _name_format)
- )
+ attr_statement = saml.AttributeStatement(attribute=from_local(attrconvs, self, _name_format))
if encrypt == "attributes":
for attr in attr_statement.attribute:
@@ -813,17 +805,19 @@ class Assertion(dict):
if authn_statem:
_authn_statement = authn_statem
elif authn_auth or authn_class or authn_decl or authn_decl_ref:
- _authn_statement = authn_statement(authn_class, authn_auth,
- authn_decl, authn_decl_ref,
- authn_instant,
- subject_locality,
- session_not_on_or_after=session_not_on_or_after)
+ _authn_statement = authn_statement(
+ authn_class,
+ authn_auth,
+ authn_decl,
+ authn_decl_ref,
+ authn_instant,
+ subject_locality,
+ session_not_on_or_after=session_not_on_or_after,
+ )
else:
_authn_statement = None
- subject = do_subject(
- policy.not_on_or_after(sp_entity_id), name_id, **farg['subject']
- )
+ subject = do_subject(policy.not_on_or_after(sp_entity_id), name_id, **farg["subject"])
_ass = assertion_factory(issuer=issuer, conditions=conds, subject=subject)
if _authn_statement:
@@ -835,7 +829,7 @@ class Assertion(dict):
return _ass
def apply_policy(self, sp_entity_id, policy):
- """ Apply policy to the assertion I'm representing
+ """Apply policy to the assertion I'm representing
:param sp_entity_id: The SP entity ID
:param policy: The policy
diff --git a/src/saml2/attribute_converter.py b/src/saml2/attribute_converter.py
index da071738..900384f9 100644
--- a/src/saml2/attribute_converter.py
+++ b/src/saml2/attribute_converter.py
@@ -2,18 +2,22 @@
# -*- coding: utf-8 -*-
#
+from importlib import import_module
+import logging
import os
import sys
-from importlib import import_module
-from saml2.s_utils import factory
-from saml2.s_utils import do_ava
-from saml2 import saml, ExtensionElement, NAMESPACE
-from saml2 import extension_elements_to_elements
+from saml2 import NAMESPACE
+from saml2 import ExtensionElement
from saml2 import SAMLError
-from saml2.saml import NAME_FORMAT_UNSPECIFIED, NAMEID_FORMAT_PERSISTENT
+from saml2 import extension_elements_to_elements
+from saml2 import saml
+from saml2.s_utils import do_ava
+from saml2.s_utils import factory
+from saml2.saml import NAME_FORMAT_UNSPECIFIED
+from saml2.saml import NAMEID_FORMAT_PERSISTENT
+
-import logging
logger = logging.getLogger(__name__)
@@ -26,7 +30,7 @@ class ConverterError(SAMLError):
def load_maps(dirspec):
- """ load the attribute maps
+ """load the attribute maps
:param dirspec: a directory specification
:return: a dictionary with the name of the map as key and the
@@ -98,14 +102,12 @@ def _find_maps_in_module(module):
for key, item in module.__dict__.items():
if key.startswith("__"):
continue
- if isinstance(item, dict) and "identifier" in item and (
- "to" in item or "fro" in item
- ):
+ if isinstance(item, dict) and "identifier" in item and ("to" in item or "fro" in item):
yield item
def to_local(acs, statement, allow_unknown_attributes=False):
- """ Replaces the attribute names in a attribute value assertion with the
+ """Replaces the attribute names in a attribute value assertion with the
equivalent name from a local name format.
:param acs: List of Attribute Converters
@@ -117,7 +119,7 @@ def to_local(acs, statement, allow_unknown_attributes=False):
def list_to_local(acs, attrlist, allow_unknown_attributes=False):
- """ Replaces the attribute names in a attribute value assertion with the
+ """Replaces the attribute names in a attribute value assertion with the
equivalent name from a local name format.
:param acs: List of Attribute Converters
@@ -136,10 +138,7 @@ def list_to_local(acs, attrlist, allow_unknown_attributes=False):
try:
_func = acsd[attr.name_format].ava_from
except KeyError:
- if (
- attr.name_format == NAME_FORMAT_UNSPECIFIED
- or allow_unknown_attributes
- ):
+ if attr.name_format == NAME_FORMAT_UNSPECIFIED or allow_unknown_attributes:
_func = acs[0].lcd_ava_from
else:
logger.info("Unsupported attribute name format: %s", attr.name_format)
@@ -166,9 +165,9 @@ def list_to_local(acs, attrlist, allow_unknown_attributes=False):
def from_local(acs, ava, name_format):
for aconv in acs:
- #print(ac.format, name_format)
+ # print(ac.format, name_format)
if aconv.name_format == name_format:
- #print("Found a name_form converter")
+ # print("Found a name_form converter")
return aconv.to_(ava)
return None
@@ -182,9 +181,9 @@ def from_local_name(acs, attr, name_format):
:return: An Attribute instance
"""
for aconv in acs:
- #print(ac.format, name_format)
+ # print(ac.format, name_format)
if aconv.name_format == name_format:
- #print("Found a name_form converter")
+ # print("Found a name_form converter")
return aconv.to_format(attr)
return attr
@@ -205,7 +204,7 @@ def to_local_name(acs, attr):
def get_local_name(acs, attr, name_format):
for aconv in acs:
- #print(ac.format, name_format)
+ # print(ac.format, name_format)
if aconv.name_format == name_format:
return aconv._fro.get(attr)
@@ -229,8 +228,8 @@ def d_to_local_name(acs, attr):
class AttributeConverter(object):
- """ Converts from an attribute statement to a key,value dictionary and
- vice-versa """
+ """Converts from an attribute statement to a key,value dictionary and
+ vice-versa"""
def __init__(self, name_format=""):
self.name_format = name_format
@@ -238,27 +237,24 @@ class AttributeConverter(object):
self._fro = None
def adjust(self):
- """ If one of the transformations is not defined it is expected to
+ """If one of the transformations is not defined it is expected to
be the mirror image of the other.
"""
if self._fro is None and self._to is not None:
- self._fro = dict(
- [(value.lower(), key) for key, value in self._to.items()])
+ self._fro = dict([(value.lower(), key) for key, value in self._to.items()])
if self._to is None and self._fro is not None:
- self._to = dict(
- [(value.lower(), key) for key, value in self._fro.items()])
+ self._to = dict([(value.lower(), key) for key, value in self._fro.items()])
def from_dict(self, mapdict):
- """ Import the attribute map from a dictionary
+ """Import the attribute map from a dictionary
:param mapdict: The dictionary
"""
self.name_format = mapdict["identifier"]
try:
- self._fro = dict(
- [(k.lower(), v) for k, v in mapdict["fro"].items()])
+ self._fro = dict([(k.lower(), v) for k, v in mapdict["fro"].items()])
except KeyError:
pass
try:
@@ -280,13 +276,11 @@ class AttributeConverter(object):
:return:
"""
name = attribute.name.strip()
- values = [
- (value.text or '').strip()
- for value in attribute.attribute_value]
+ values = [(value.text or "").strip() for value in attribute.attribute_value]
return name, values
def fail_safe_fro(self, statement):
- """ In case there is not formats defined or if the name format is
+ """In case there is not formats defined or if the name format is
undefined
:param statement: AttributeStatement instance
@@ -294,8 +288,7 @@ class AttributeConverter(object):
"""
result = {}
for attribute in statement.attribute:
- if attribute.name_format and \
- attribute.name_format != NAME_FORMAT_UNSPECIFIED:
+ if attribute.name_format and attribute.name_format != NAME_FORMAT_UNSPECIFIED:
continue
try:
name = attribute.friendly_name.strip()
@@ -305,7 +298,7 @@ class AttributeConverter(object):
result[name] = []
for value in attribute.attribute_value:
if not value.text:
- result[name].append('')
+ result[name].append("")
else:
result[name].append(value.text.strip())
return result
@@ -327,8 +320,7 @@ class AttributeConverter(object):
val = []
for value in attribute.attribute_value:
if value.extension_elements:
- ext = extension_elements_to_elements(value.extension_elements,
- [saml])
+ ext = extension_elements_to_elements(value.extension_elements, [saml])
for ex in ext:
if attr == "eduPersonTargetedID" and ex.text:
val.append(ex.text.strip())
@@ -342,14 +334,14 @@ class AttributeConverter(object):
cval["value"] = ex.text.strip()
val.append({ex.c_tag: cval})
elif not value.text:
- val.append('')
+ val.append("")
else:
val.append(value.text.strip())
return attr, val
def fro(self, statement):
- """ Get the attributes and the attribute values.
+ """Get the attributes and the attribute values.
:param statement: The AttributeStatement.
:return: A dictionary containing attributes and values
@@ -360,8 +352,7 @@ class AttributeConverter(object):
result = {}
for attribute in statement.attribute:
- if attribute.name_format and self.name_format and \
- attribute.name_format != self.name_format:
+ if attribute.name_format and self.name_format and attribute.name_format != self.name_format:
continue
try:
@@ -374,7 +365,7 @@ class AttributeConverter(object):
return result
def to_format(self, attr):
- """ Creates an Attribute instance with name, name_format and
+ """Creates an Attribute instance with name, name_format and
friendly_name
:param attr: The local name of the attribute
@@ -386,18 +377,15 @@ class AttributeConverter(object):
try:
_attr = self._to[attr.lower()]
except KeyError:
- _attr = ''
+ _attr = ""
if _attr:
- return factory(saml.Attribute,
- name=_attr,
- name_format=self.name_format,
- friendly_name=attr)
+ return factory(saml.Attribute, name=_attr, name_format=self.name_format, friendly_name=attr)
else:
return factory(saml.Attribute, name=attr)
def from_format(self, attr):
- """ Find out the local name of an attribute
+ """Find out the local name of an attribute
:param attr: An saml.Attribute instance
:return: The local attribute name or "" if no mapping could be made
@@ -417,7 +405,7 @@ class AttributeConverter(object):
return ""
def d_from_format(self, attr):
- """ Find out the local name of an attribute
+ """Find out the local name of an attribute
:param attr: An Attribute dictionary
:return: The local attribute name or "" if no mapping could be made
@@ -437,7 +425,7 @@ class AttributeConverter(object):
return ""
def to_(self, attrvals):
- """ Create a list of Attribute instances.
+ """Create a list of Attribute instances.
:param attrvals: A dictionary of attributes and values
:return: A list of Attribute instances
@@ -451,15 +439,17 @@ class AttributeConverter(object):
attr_value = self.to_eptid_value(value)
else:
attr_value = do_ava(value)
- attributes.append(factory(saml.Attribute,
- name=name,
- name_format=self.name_format,
- friendly_name=key,
- attribute_value=attr_value))
+ attributes.append(
+ factory(
+ saml.Attribute,
+ name=name,
+ name_format=self.name_format,
+ friendly_name=key,
+ attribute_value=attr_value,
+ )
+ )
else:
- attributes.append(factory(saml.Attribute,
- name=key,
- attribute_value=do_ava(value)))
+ attributes.append(factory(saml.Attribute, name=key, attribute_value=do_ava(value)))
return attributes
@@ -492,26 +482,21 @@ class AttributeConverter(object):
if isinstance(value, dict)
else {"Format": NAMEID_FORMAT_PERSISTENT}
)
- element = ExtensionElement(
- "NameID", NAMESPACE, attributes=attributes, text=text
- )
+ element = ExtensionElement("NameID", NAMESPACE, attributes=attributes, text=text)
return element
- attribute_values = [
- saml.AttributeValue(extension_elements=[_create_nameid_ext_el(v)])
- for v in values
- ]
+ attribute_values = [saml.AttributeValue(extension_elements=[_create_nameid_ext_el(v)]) for v in values]
return attribute_values
class AttributeConverterNOOP(AttributeConverter):
- """ Does a NOOP conversion, that is no conversion is made """
+ """Does a NOOP conversion, that is no conversion is made"""
def __init__(self, name_format=""):
AttributeConverter.__init__(self, name_format)
def to_(self, attrvals):
- """ Create a list of Attribute instances.
+ """Create a list of Attribute instances.
:param attrvals: A dictionary of attributes and values
:return: A list of Attribute instances
@@ -519,9 +504,8 @@ class AttributeConverterNOOP(AttributeConverter):
attributes = []
for key, value in attrvals.items():
key = key.lower()
- attributes.append(factory(saml.Attribute,
- name=key,
- name_format=self.name_format,
- attribute_value=do_ava(value)))
+ attributes.append(
+ factory(saml.Attribute, name=key, name_format=self.name_format, attribute_value=do_ava(value))
+ )
return attributes
diff --git a/src/saml2/attribute_resolver.py b/src/saml2/attribute_resolver.py
index 7646e080..c89dd095 100644
--- a/src/saml2/attribute_resolver.py
+++ b/src/saml2/attribute_resolver.py
@@ -7,7 +7,8 @@ Contains classes and functions that a SAML2.0 Service Provider (SP) may use
to do attribute aggregation.
"""
import logging
-#from saml2 import client
+
+# from saml2 import client
from saml2 import BINDING_SOAP
@@ -36,14 +37,11 @@ class AttributeResolver(object):
for member in vo_members:
for ass in self.metadata.attribute_consuming_service(member):
for attr_serv in ass.attribute_service:
- logger.info(
- "Send attribute request to %s", attr_serv.location)
+ logger.info("Send attribute request to %s", attr_serv.location)
if attr_serv.binding != BINDING_SOAP:
continue
# attribute query assumes SOAP binding
- session_info = self.saml2client.attribute_query(
- name_id, attr_serv.location, issuer_id=issuer
- )
+ session_info = self.saml2client.attribute_query(name_id, attr_serv.location, issuer_id=issuer)
if session_info:
result.append(session_info)
return result
diff --git a/src/saml2/attributemaps/__init__.py b/src/saml2/attributemaps/__init__.py
index d041d3f1..203875e7 100644
--- a/src/saml2/attributemaps/__init__.py
+++ b/src/saml2/attributemaps/__init__.py
@@ -1,2 +1,2 @@
-__author__ = 'rohe0002'
+__author__ = "rohe0002"
__all__ = ["adfs_v1x", "adfs_v20", "basic", "saml_uri", "shibboleth_uri"]
diff --git a/src/saml2/attributemaps/adfs_v1x.py b/src/saml2/attributemaps/adfs_v1x.py
index 0f8d01a5..69f99fbd 100644
--- a/src/saml2/attributemaps/adfs_v1x.py
+++ b/src/saml2/attributemaps/adfs_v1x.py
@@ -1,18 +1,18 @@
-CLAIMS = 'http://schemas.xmlsoap.org/claims/'
+CLAIMS = "http://schemas.xmlsoap.org/claims/"
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
- 'fro': {
- CLAIMS+'commonname': 'commonName',
- CLAIMS+'emailaddress': 'emailAddress',
- CLAIMS+'group': 'group',
- CLAIMS+'upn': 'upn',
+ "fro": {
+ CLAIMS + "commonname": "commonName",
+ CLAIMS + "emailaddress": "emailAddress",
+ CLAIMS + "group": "group",
+ CLAIMS + "upn": "upn",
+ },
+ "to": {
+ "commonName": CLAIMS + "commonname",
+ "emailAddress": CLAIMS + "emailaddress",
+ "group": CLAIMS + "group",
+ "upn": CLAIMS + "upn",
},
- 'to': {
- 'commonName': CLAIMS+'commonname',
- 'emailAddress': CLAIMS+'emailaddress',
- 'group': CLAIMS+'group',
- 'upn': CLAIMS+'upn',
- }
}
diff --git a/src/saml2/attributemaps/adfs_v20.py b/src/saml2/attributemaps/adfs_v20.py
index 94150d07..ab2e3088 100644
--- a/src/saml2/attributemaps/adfs_v20.py
+++ b/src/saml2/attributemaps/adfs_v20.py
@@ -1,49 +1,49 @@
-CLAIMS = 'http://schemas.xmlsoap.org/claims/'
-COM_WS_CLAIMS = 'http://schemas.xmlsoap.com/ws/2005/05/identity/claims/'
-MS_CLAIMS = 'http://schemas.microsoft.com/ws/2008/06/identity/claims/'
-ORG_WS_CLAIMS = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/'
+CLAIMS = "http://schemas.xmlsoap.org/claims/"
+COM_WS_CLAIMS = "http://schemas.xmlsoap.com/ws/2005/05/identity/claims/"
+MS_CLAIMS = "http://schemas.microsoft.com/ws/2008/06/identity/claims/"
+ORG_WS_CLAIMS = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/"
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
- 'fro': {
- CLAIMS+'commonname': 'commonName',
- CLAIMS+'group': 'group',
- COM_WS_CLAIMS+'denyonlysid': 'denyOnlySid',
- MS_CLAIMS+'authenticationmethod': 'authenticationMethod',
- MS_CLAIMS+'denyonlyprimarygroupsid': 'denyOnlyPrimaryGroupSid',
- MS_CLAIMS+'denyonlyprimarysid': 'denyOnlyPrimarySid',
- MS_CLAIMS+'groupsid': 'groupSid',
- MS_CLAIMS+'primarygroupsid': 'primaryGroupSid',
- MS_CLAIMS+'primarysid': 'primarySid',
- MS_CLAIMS+'role': 'role',
- MS_CLAIMS+'windowsaccountname': 'windowsAccountName',
- ORG_WS_CLAIMS+'emailaddress': 'emailAddress',
- ORG_WS_CLAIMS+'givenname': 'givenName',
- ORG_WS_CLAIMS+'name': 'name',
- ORG_WS_CLAIMS+'nameidentifier': 'nameId',
- ORG_WS_CLAIMS+'privatepersonalidentifier': 'privatePersonalId',
- ORG_WS_CLAIMS+'surname': 'surname',
- ORG_WS_CLAIMS+'upn': 'upn',
+ "fro": {
+ CLAIMS + "commonname": "commonName",
+ CLAIMS + "group": "group",
+ COM_WS_CLAIMS + "denyonlysid": "denyOnlySid",
+ MS_CLAIMS + "authenticationmethod": "authenticationMethod",
+ MS_CLAIMS + "denyonlyprimarygroupsid": "denyOnlyPrimaryGroupSid",
+ MS_CLAIMS + "denyonlyprimarysid": "denyOnlyPrimarySid",
+ MS_CLAIMS + "groupsid": "groupSid",
+ MS_CLAIMS + "primarygroupsid": "primaryGroupSid",
+ MS_CLAIMS + "primarysid": "primarySid",
+ MS_CLAIMS + "role": "role",
+ MS_CLAIMS + "windowsaccountname": "windowsAccountName",
+ ORG_WS_CLAIMS + "emailaddress": "emailAddress",
+ ORG_WS_CLAIMS + "givenname": "givenName",
+ ORG_WS_CLAIMS + "name": "name",
+ ORG_WS_CLAIMS + "nameidentifier": "nameId",
+ ORG_WS_CLAIMS + "privatepersonalidentifier": "privatePersonalId",
+ ORG_WS_CLAIMS + "surname": "surname",
+ ORG_WS_CLAIMS + "upn": "upn",
+ },
+ "to": {
+ "authenticationMethod": MS_CLAIMS + "authenticationmethod",
+ "commonName": CLAIMS + "commonname",
+ "denyOnlyPrimaryGroupSid": MS_CLAIMS + "denyonlyprimarygroupsid",
+ "denyOnlyPrimarySid": MS_CLAIMS + "denyonlyprimarysid",
+ "denyOnlySid": COM_WS_CLAIMS + "denyonlysid",
+ "emailAddress": ORG_WS_CLAIMS + "emailaddress",
+ "givenName": ORG_WS_CLAIMS + "givenname",
+ "group": CLAIMS + "group",
+ "groupSid": MS_CLAIMS + "groupsid",
+ "name": ORG_WS_CLAIMS + "name",
+ "nameId": ORG_WS_CLAIMS + "nameidentifier",
+ "primaryGroupSid": MS_CLAIMS + "primarygroupsid",
+ "primarySid": MS_CLAIMS + "primarysid",
+ "privatePersonalId": ORG_WS_CLAIMS + "privatepersonalidentifier",
+ "role": MS_CLAIMS + "role",
+ "surname": ORG_WS_CLAIMS + "surname",
+ "upn": ORG_WS_CLAIMS + "upn",
+ "windowsAccountName": MS_CLAIMS + "windowsaccountname",
},
- 'to': {
- 'authenticationMethod': MS_CLAIMS+'authenticationmethod',
- 'commonName': CLAIMS+'commonname',
- 'denyOnlyPrimaryGroupSid': MS_CLAIMS+'denyonlyprimarygroupsid',
- 'denyOnlyPrimarySid': MS_CLAIMS+'denyonlyprimarysid',
- 'denyOnlySid': COM_WS_CLAIMS+'denyonlysid',
- 'emailAddress': ORG_WS_CLAIMS+'emailaddress',
- 'givenName': ORG_WS_CLAIMS+'givenname',
- 'group': CLAIMS+'group',
- 'groupSid': MS_CLAIMS+'groupsid',
- 'name': ORG_WS_CLAIMS+'name',
- 'nameId': ORG_WS_CLAIMS+'nameidentifier',
- 'primaryGroupSid': MS_CLAIMS+'primarygroupsid',
- 'primarySid': MS_CLAIMS+'primarysid',
- 'privatePersonalId': ORG_WS_CLAIMS+'privatepersonalidentifier',
- 'role': MS_CLAIMS+'role',
- 'surname': ORG_WS_CLAIMS+'surname',
- 'upn': ORG_WS_CLAIMS+'upn',
- 'windowsAccountName': MS_CLAIMS+'windowsaccountname',
- }
}
diff --git a/src/saml2/attributemaps/basic.py b/src/saml2/attributemaps/basic.py
index 621e9789..9ad8fb54 100644
--- a/src/saml2/attributemaps/basic.py
+++ b/src/saml2/attributemaps/basic.py
@@ -1,342 +1,342 @@
-DEF = 'urn:mace:dir:attribute-def:'
+DEF = "urn:mace:dir:attribute-def:"
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
- 'fro': {
- DEF+'aRecord': 'aRecord',
- DEF+'aliasedEntryName': 'aliasedEntryName',
- DEF+'aliasedObjectName': 'aliasedObjectName',
- DEF+'associatedDomain': 'associatedDomain',
- DEF+'associatedName': 'associatedName',
- DEF+'audio': 'audio',
- DEF+'authorityRevocationList': 'authorityRevocationList',
- DEF+'buildingName': 'buildingName',
- DEF+'businessCategory': 'businessCategory',
- DEF+'c': 'c',
- DEF+'cACertificate': 'cACertificate',
- DEF+'cNAMERecord': 'cNAMERecord',
- DEF+'carLicense': 'carLicense',
- DEF+'certificateRevocationList': 'certificateRevocationList',
- DEF+'cn': 'cn',
- DEF+'co': 'co',
- DEF+'commonName': 'commonName',
- DEF+'countryName': 'countryName',
- DEF+'crossCertificatePair': 'crossCertificatePair',
- DEF+'dITRedirect': 'dITRedirect',
- DEF+'dSAQuality': 'dSAQuality',
- DEF+'dc': 'dc',
- DEF+'deltaRevocationList': 'deltaRevocationList',
- DEF+'departmentNumber': 'departmentNumber',
- DEF+'description': 'description',
- DEF+'destinationIndicator': 'destinationIndicator',
- DEF+'displayName': 'displayName',
- DEF+'distinguishedName': 'distinguishedName',
- DEF+'dmdName': 'dmdName',
- DEF+'dnQualifier': 'dnQualifier',
- DEF+'documentAuthor': 'documentAuthor',
- DEF+'documentIdentifier': 'documentIdentifier',
- DEF+'documentLocation': 'documentLocation',
- DEF+'documentPublisher': 'documentPublisher',
- DEF+'documentTitle': 'documentTitle',
- DEF+'documentVersion': 'documentVersion',
- DEF+'domainComponent': 'domainComponent',
- DEF+'drink': 'drink',
- DEF+'eduOrgHomePageURI': 'eduOrgHomePageURI',
- DEF+'eduOrgIdentityAuthNPolicyURI': 'eduOrgIdentityAuthNPolicyURI',
- DEF+'eduOrgLegalName': 'eduOrgLegalName',
- DEF+'eduOrgSuperiorURI': 'eduOrgSuperiorURI',
- DEF+'eduOrgWhitePagesURI': 'eduOrgWhitePagesURI',
- DEF+'eduCourseOffering': 'eduCourseOffering',
- DEF+'eduCourseMember': 'eduCourseMember',
- DEF+'eduPersonAffiliation': 'eduPersonAffiliation',
- DEF+'eduPersonEntitlement': 'eduPersonEntitlement',
- DEF+'eduPersonNickname': 'eduPersonNickname',
- DEF+'eduPersonOrgDN': 'eduPersonOrgDN',
- DEF+'eduPersonOrgUnitDN': 'eduPersonOrgUnitDN',
- DEF+'eduPersonPrimaryAffiliation': 'eduPersonPrimaryAffiliation',
- DEF+'eduPersonPrimaryOrgUnitDN': 'eduPersonPrimaryOrgUnitDN',
- DEF+'eduPersonPrincipalName': 'eduPersonPrincipalName',
- DEF+'eduPersonPrincipalNamePrior': 'eduPersonPrincipalNamePrior',
- DEF+'eduPersonScopedAffiliation': 'eduPersonScopedAffiliation',
- DEF+'eduPersonTargetedID': 'eduPersonTargetedID',
- DEF+'eduPersonAssurance': 'eduPersonAssurance',
- DEF+'eduPersonUniqueId': 'eduPersonUniqueId',
- DEF+'eduPersonOrcid': 'eduPersonOrcid',
- DEF+'email': 'email',
- DEF+'emailAddress': 'emailAddress',
- DEF+'employeeNumber': 'employeeNumber',
- DEF+'employeeType': 'employeeType',
- DEF+'enhancedSearchGuide': 'enhancedSearchGuide',
- DEF+'facsimileTelephoneNumber': 'facsimileTelephoneNumber',
- DEF+'favouriteDrink': 'favouriteDrink',
- DEF+'fax': 'fax',
- DEF+'federationFeideSchemaVersion': 'federationFeideSchemaVersion',
- DEF+'friendlyCountryName': 'friendlyCountryName',
- DEF+'generationQualifier': 'generationQualifier',
- DEF+'givenName': 'givenName',
- DEF+'gn': 'gn',
- DEF+'homePhone': 'homePhone',
- DEF+'homePostalAddress': 'homePostalAddress',
- DEF+'homeTelephoneNumber': 'homeTelephoneNumber',
- DEF+'host': 'host',
- DEF+'houseIdentifier': 'houseIdentifier',
- DEF+'info': 'info',
- DEF+'initials': 'initials',
- DEF+'internationaliSDNNumber': 'internationaliSDNNumber',
- DEF+'isMemberOf': 'isMemberOf',
- DEF+'janetMailbox': 'janetMailbox',
- DEF+'jpegPhoto': 'jpegPhoto',
- DEF+'knowledgeInformation': 'knowledgeInformation',
- DEF+'l': 'l',
- DEF+'labeledURI': 'labeledURI',
- DEF+'localityName': 'localityName',
- DEF+'mDRecord': 'mDRecord',
- DEF+'mXRecord': 'mXRecord',
- DEF+'mail': 'mail',
- DEF+'mailPreferenceOption': 'mailPreferenceOption',
- DEF+'manager': 'manager',
- DEF+'member': 'member',
- DEF+'mobile': 'mobile',
- DEF+'mobileTelephoneNumber': 'mobileTelephoneNumber',
- DEF+'nSRecord': 'nSRecord',
- DEF+'name': 'name',
- DEF+'norEduOrgAcronym': 'norEduOrgAcronym',
- DEF+'norEduOrgNIN': 'norEduOrgNIN',
- DEF+'norEduOrgSchemaVersion': 'norEduOrgSchemaVersion',
- DEF+'norEduOrgUniqueIdentifier': 'norEduOrgUniqueIdentifier',
- DEF+'norEduOrgUniqueNumber': 'norEduOrgUniqueNumber',
- DEF+'norEduOrgUnitUniqueIdentifier': 'norEduOrgUnitUniqueIdentifier',
- DEF+'norEduOrgUnitUniqueNumber': 'norEduOrgUnitUniqueNumber',
- DEF+'norEduPersonBirthDate': 'norEduPersonBirthDate',
- DEF+'norEduPersonLIN': 'norEduPersonLIN',
- DEF+'norEduPersonNIN': 'norEduPersonNIN',
- DEF+'o': 'o',
- DEF+'objectClass': 'objectClass',
- DEF+'organizationName': 'organizationName',
- DEF+'organizationalStatus': 'organizationalStatus',
- DEF+'organizationalUnitName': 'organizationalUnitName',
- DEF+'otherMailbox': 'otherMailbox',
- DEF+'ou': 'ou',
- DEF+'owner': 'owner',
- DEF+'pager': 'pager',
- DEF+'pagerTelephoneNumber': 'pagerTelephoneNumber',
- DEF+'personalSignature': 'personalSignature',
- DEF+'personalTitle': 'personalTitle',
- DEF+'photo': 'photo',
- DEF+'physicalDeliveryOfficeName': 'physicalDeliveryOfficeName',
- DEF+'pkcs9email': 'pkcs9email',
- DEF+'postOfficeBox': 'postOfficeBox',
- DEF+'postalAddress': 'postalAddress',
- DEF+'postalCode': 'postalCode',
- DEF+'preferredDeliveryMethod': 'preferredDeliveryMethod',
- DEF+'preferredLanguage': 'preferredLanguage',
- DEF+'presentationAddress': 'presentationAddress',
- DEF+'protocolInformation': 'protocolInformation',
- DEF+'pseudonym': 'pseudonym',
- DEF+'registeredAddress': 'registeredAddress',
- DEF+'rfc822Mailbox': 'rfc822Mailbox',
- DEF+'roleOccupant': 'roleOccupant',
- DEF+'roomNumber': 'roomNumber',
- DEF+'sOARecord': 'sOARecord',
- DEF+'searchGuide': 'searchGuide',
- DEF+'secretary': 'secretary',
- DEF+'seeAlso': 'seeAlso',
- DEF+'serialNumber': 'serialNumber',
- DEF+'singleLevelQuality': 'singleLevelQuality',
- DEF+'sn': 'sn',
- DEF+'st': 'st',
- DEF+'stateOrProvinceName': 'stateOrProvinceName',
- DEF+'street': 'street',
- DEF+'streetAddress': 'streetAddress',
- DEF+'subtreeMaximumQuality': 'subtreeMaximumQuality',
- DEF+'subtreeMinimumQuality': 'subtreeMinimumQuality',
- DEF+'supportedAlgorithms': 'supportedAlgorithms',
- DEF+'supportedApplicationContext': 'supportedApplicationContext',
- DEF+'surname': 'surname',
- DEF+'telephoneNumber': 'telephoneNumber',
- DEF+'teletexTerminalIdentifier': 'teletexTerminalIdentifier',
- DEF+'telexNumber': 'telexNumber',
- DEF+'textEncodedORAddress': 'textEncodedORAddress',
- DEF+'title': 'title',
- DEF+'uid': 'uid',
- DEF+'uniqueIdentifier': 'uniqueIdentifier',
- DEF+'uniqueMember': 'uniqueMember',
- DEF+'userCertificate': 'userCertificate',
- DEF+'userClass': 'userClass',
- DEF+'userPKCS12': 'userPKCS12',
- DEF+'userPassword': 'userPassword',
- DEF+'userSMIMECertificate': 'userSMIMECertificate',
- DEF+'userid': 'userid',
- DEF+'x121Address': 'x121Address',
- DEF+'x500UniqueIdentifier': 'x500UniqueIdentifier',
+ "fro": {
+ DEF + "aRecord": "aRecord",
+ DEF + "aliasedEntryName": "aliasedEntryName",
+ DEF + "aliasedObjectName": "aliasedObjectName",
+ DEF + "associatedDomain": "associatedDomain",
+ DEF + "associatedName": "associatedName",
+ DEF + "audio": "audio",
+ DEF + "authorityRevocationList": "authorityRevocationList",
+ DEF + "buildingName": "buildingName",
+ DEF + "businessCategory": "businessCategory",
+ DEF + "c": "c",
+ DEF + "cACertificate": "cACertificate",
+ DEF + "cNAMERecord": "cNAMERecord",
+ DEF + "carLicense": "carLicense",
+ DEF + "certificateRevocationList": "certificateRevocationList",
+ DEF + "cn": "cn",
+ DEF + "co": "co",
+ DEF + "commonName": "commonName",
+ DEF + "countryName": "countryName",
+ DEF + "crossCertificatePair": "crossCertificatePair",
+ DEF + "dITRedirect": "dITRedirect",
+ DEF + "dSAQuality": "dSAQuality",
+ DEF + "dc": "dc",
+ DEF + "deltaRevocationList": "deltaRevocationList",
+ DEF + "departmentNumber": "departmentNumber",
+ DEF + "description": "description",
+ DEF + "destinationIndicator": "destinationIndicator",
+ DEF + "displayName": "displayName",
+ DEF + "distinguishedName": "distinguishedName",
+ DEF + "dmdName": "dmdName",
+ DEF + "dnQualifier": "dnQualifier",
+ DEF + "documentAuthor": "documentAuthor",
+ DEF + "documentIdentifier": "documentIdentifier",
+ DEF + "documentLocation": "documentLocation",
+ DEF + "documentPublisher": "documentPublisher",
+ DEF + "documentTitle": "documentTitle",
+ DEF + "documentVersion": "documentVersion",
+ DEF + "domainComponent": "domainComponent",
+ DEF + "drink": "drink",
+ DEF + "eduOrgHomePageURI": "eduOrgHomePageURI",
+ DEF + "eduOrgIdentityAuthNPolicyURI": "eduOrgIdentityAuthNPolicyURI",
+ DEF + "eduOrgLegalName": "eduOrgLegalName",
+ DEF + "eduOrgSuperiorURI": "eduOrgSuperiorURI",
+ DEF + "eduOrgWhitePagesURI": "eduOrgWhitePagesURI",
+ DEF + "eduCourseOffering": "eduCourseOffering",
+ DEF + "eduCourseMember": "eduCourseMember",
+ DEF + "eduPersonAffiliation": "eduPersonAffiliation",
+ DEF + "eduPersonEntitlement": "eduPersonEntitlement",
+ DEF + "eduPersonNickname": "eduPersonNickname",
+ DEF + "eduPersonOrgDN": "eduPersonOrgDN",
+ DEF + "eduPersonOrgUnitDN": "eduPersonOrgUnitDN",
+ DEF + "eduPersonPrimaryAffiliation": "eduPersonPrimaryAffiliation",
+ DEF + "eduPersonPrimaryOrgUnitDN": "eduPersonPrimaryOrgUnitDN",
+ DEF + "eduPersonPrincipalName": "eduPersonPrincipalName",
+ DEF + "eduPersonPrincipalNamePrior": "eduPersonPrincipalNamePrior",
+ DEF + "eduPersonScopedAffiliation": "eduPersonScopedAffiliation",
+ DEF + "eduPersonTargetedID": "eduPersonTargetedID",
+ DEF + "eduPersonAssurance": "eduPersonAssurance",
+ DEF + "eduPersonUniqueId": "eduPersonUniqueId",
+ DEF + "eduPersonOrcid": "eduPersonOrcid",
+ DEF + "email": "email",
+ DEF + "emailAddress": "emailAddress",
+ DEF + "employeeNumber": "employeeNumber",
+ DEF + "employeeType": "employeeType",
+ DEF + "enhancedSearchGuide": "enhancedSearchGuide",
+ DEF + "facsimileTelephoneNumber": "facsimileTelephoneNumber",
+ DEF + "favouriteDrink": "favouriteDrink",
+ DEF + "fax": "fax",
+ DEF + "federationFeideSchemaVersion": "federationFeideSchemaVersion",
+ DEF + "friendlyCountryName": "friendlyCountryName",
+ DEF + "generationQualifier": "generationQualifier",
+ DEF + "givenName": "givenName",
+ DEF + "gn": "gn",
+ DEF + "homePhone": "homePhone",
+ DEF + "homePostalAddress": "homePostalAddress",
+ DEF + "homeTelephoneNumber": "homeTelephoneNumber",
+ DEF + "host": "host",
+ DEF + "houseIdentifier": "houseIdentifier",
+ DEF + "info": "info",
+ DEF + "initials": "initials",
+ DEF + "internationaliSDNNumber": "internationaliSDNNumber",
+ DEF + "isMemberOf": "isMemberOf",
+ DEF + "janetMailbox": "janetMailbox",
+ DEF + "jpegPhoto": "jpegPhoto",
+ DEF + "knowledgeInformation": "knowledgeInformation",
+ DEF + "l": "l",
+ DEF + "labeledURI": "labeledURI",
+ DEF + "localityName": "localityName",
+ DEF + "mDRecord": "mDRecord",
+ DEF + "mXRecord": "mXRecord",
+ DEF + "mail": "mail",
+ DEF + "mailPreferenceOption": "mailPreferenceOption",
+ DEF + "manager": "manager",
+ DEF + "member": "member",
+ DEF + "mobile": "mobile",
+ DEF + "mobileTelephoneNumber": "mobileTelephoneNumber",
+ DEF + "nSRecord": "nSRecord",
+ DEF + "name": "name",
+ DEF + "norEduOrgAcronym": "norEduOrgAcronym",
+ DEF + "norEduOrgNIN": "norEduOrgNIN",
+ DEF + "norEduOrgSchemaVersion": "norEduOrgSchemaVersion",
+ DEF + "norEduOrgUniqueIdentifier": "norEduOrgUniqueIdentifier",
+ DEF + "norEduOrgUniqueNumber": "norEduOrgUniqueNumber",
+ DEF + "norEduOrgUnitUniqueIdentifier": "norEduOrgUnitUniqueIdentifier",
+ DEF + "norEduOrgUnitUniqueNumber": "norEduOrgUnitUniqueNumber",
+ DEF + "norEduPersonBirthDate": "norEduPersonBirthDate",
+ DEF + "norEduPersonLIN": "norEduPersonLIN",
+ DEF + "norEduPersonNIN": "norEduPersonNIN",
+ DEF + "o": "o",
+ DEF + "objectClass": "objectClass",
+ DEF + "organizationName": "organizationName",
+ DEF + "organizationalStatus": "organizationalStatus",
+ DEF + "organizationalUnitName": "organizationalUnitName",
+ DEF + "otherMailbox": "otherMailbox",
+ DEF + "ou": "ou",
+ DEF + "owner": "owner",
+ DEF + "pager": "pager",
+ DEF + "pagerTelephoneNumber": "pagerTelephoneNumber",
+ DEF + "personalSignature": "personalSignature",
+ DEF + "personalTitle": "personalTitle",
+ DEF + "photo": "photo",
+ DEF + "physicalDeliveryOfficeName": "physicalDeliveryOfficeName",
+ DEF + "pkcs9email": "pkcs9email",
+ DEF + "postOfficeBox": "postOfficeBox",
+ DEF + "postalAddress": "postalAddress",
+ DEF + "postalCode": "postalCode",
+ DEF + "preferredDeliveryMethod": "preferredDeliveryMethod",
+ DEF + "preferredLanguage": "preferredLanguage",
+ DEF + "presentationAddress": "presentationAddress",
+ DEF + "protocolInformation": "protocolInformation",
+ DEF + "pseudonym": "pseudonym",
+ DEF + "registeredAddress": "registeredAddress",
+ DEF + "rfc822Mailbox": "rfc822Mailbox",
+ DEF + "roleOccupant": "roleOccupant",
+ DEF + "roomNumber": "roomNumber",
+ DEF + "sOARecord": "sOARecord",
+ DEF + "searchGuide": "searchGuide",
+ DEF + "secretary": "secretary",
+ DEF + "seeAlso": "seeAlso",
+ DEF + "serialNumber": "serialNumber",
+ DEF + "singleLevelQuality": "singleLevelQuality",
+ DEF + "sn": "sn",
+ DEF + "st": "st",
+ DEF + "stateOrProvinceName": "stateOrProvinceName",
+ DEF + "street": "street",
+ DEF + "streetAddress": "streetAddress",
+ DEF + "subtreeMaximumQuality": "subtreeMaximumQuality",
+ DEF + "subtreeMinimumQuality": "subtreeMinimumQuality",
+ DEF + "supportedAlgorithms": "supportedAlgorithms",
+ DEF + "supportedApplicationContext": "supportedApplicationContext",
+ DEF + "surname": "surname",
+ DEF + "telephoneNumber": "telephoneNumber",
+ DEF + "teletexTerminalIdentifier": "teletexTerminalIdentifier",
+ DEF + "telexNumber": "telexNumber",
+ DEF + "textEncodedORAddress": "textEncodedORAddress",
+ DEF + "title": "title",
+ DEF + "uid": "uid",
+ DEF + "uniqueIdentifier": "uniqueIdentifier",
+ DEF + "uniqueMember": "uniqueMember",
+ DEF + "userCertificate": "userCertificate",
+ DEF + "userClass": "userClass",
+ DEF + "userPKCS12": "userPKCS12",
+ DEF + "userPassword": "userPassword",
+ DEF + "userSMIMECertificate": "userSMIMECertificate",
+ DEF + "userid": "userid",
+ DEF + "x121Address": "x121Address",
+ DEF + "x500UniqueIdentifier": "x500UniqueIdentifier",
+ },
+ "to": {
+ "aRecord": DEF + "aRecord",
+ "aliasedEntryName": DEF + "aliasedEntryName",
+ "aliasedObjectName": DEF + "aliasedObjectName",
+ "associatedDomain": DEF + "associatedDomain",
+ "associatedName": DEF + "associatedName",
+ "audio": DEF + "audio",
+ "authorityRevocationList": DEF + "authorityRevocationList",
+ "buildingName": DEF + "buildingName",
+ "businessCategory": DEF + "businessCategory",
+ "c": DEF + "c",
+ "cACertificate": DEF + "cACertificate",
+ "cNAMERecord": DEF + "cNAMERecord",
+ "carLicense": DEF + "carLicense",
+ "certificateRevocationList": DEF + "certificateRevocationList",
+ "cn": DEF + "cn",
+ "co": DEF + "co",
+ "commonName": DEF + "commonName",
+ "countryName": DEF + "countryName",
+ "crossCertificatePair": DEF + "crossCertificatePair",
+ "dITRedirect": DEF + "dITRedirect",
+ "dSAQuality": DEF + "dSAQuality",
+ "dc": DEF + "dc",
+ "deltaRevocationList": DEF + "deltaRevocationList",
+ "departmentNumber": DEF + "departmentNumber",
+ "description": DEF + "description",
+ "destinationIndicator": DEF + "destinationIndicator",
+ "displayName": DEF + "displayName",
+ "distinguishedName": DEF + "distinguishedName",
+ "dmdName": DEF + "dmdName",
+ "dnQualifier": DEF + "dnQualifier",
+ "documentAuthor": DEF + "documentAuthor",
+ "documentIdentifier": DEF + "documentIdentifier",
+ "documentLocation": DEF + "documentLocation",
+ "documentPublisher": DEF + "documentPublisher",
+ "documentTitle": DEF + "documentTitle",
+ "documentVersion": DEF + "documentVersion",
+ "domainComponent": DEF + "domainComponent",
+ "drink": DEF + "drink",
+ "eduOrgHomePageURI": DEF + "eduOrgHomePageURI",
+ "eduOrgIdentityAuthNPolicyURI": DEF + "eduOrgIdentityAuthNPolicyURI",
+ "eduOrgLegalName": DEF + "eduOrgLegalName",
+ "eduOrgSuperiorURI": DEF + "eduOrgSuperiorURI",
+ "eduOrgWhitePagesURI": DEF + "eduOrgWhitePagesURI",
+ "eduCourseMember": DEF + "eduCourseMember",
+ "eduCourseOffering": DEF + "eduCourseOffering",
+ "eduPersonAffiliation": DEF + "eduPersonAffiliation",
+ "eduPersonEntitlement": DEF + "eduPersonEntitlement",
+ "eduPersonNickname": DEF + "eduPersonNickname",
+ "eduPersonOrgDN": DEF + "eduPersonOrgDN",
+ "eduPersonOrgUnitDN": DEF + "eduPersonOrgUnitDN",
+ "eduPersonPrimaryAffiliation": DEF + "eduPersonPrimaryAffiliation",
+ "eduPersonPrimaryOrgUnitDN": DEF + "eduPersonPrimaryOrgUnitDN",
+ "eduPersonPrincipalName": DEF + "eduPersonPrincipalName",
+ "eduPersonPrincipalNamePrior": DEF + "eduPersonPrincipalNamePrior",
+ "eduPersonScopedAffiliation": DEF + "eduPersonScopedAffiliation",
+ "eduPersonTargetedID": DEF + "eduPersonTargetedID",
+ "eduPersonAssurance": DEF + "eduPersonAssurance",
+ "eduPersonUniqueId": DEF + "eduPersonUniqueId",
+ "eduPersonOrcid": DEF + "eduPersonOrcid",
+ "email": DEF + "email",
+ "emailAddress": DEF + "emailAddress",
+ "employeeNumber": DEF + "employeeNumber",
+ "employeeType": DEF + "employeeType",
+ "enhancedSearchGuide": DEF + "enhancedSearchGuide",
+ "facsimileTelephoneNumber": DEF + "facsimileTelephoneNumber",
+ "favouriteDrink": DEF + "favouriteDrink",
+ "fax": DEF + "fax",
+ "federationFeideSchemaVersion": DEF + "federationFeideSchemaVersion",
+ "friendlyCountryName": DEF + "friendlyCountryName",
+ "generationQualifier": DEF + "generationQualifier",
+ "givenName": DEF + "givenName",
+ "gn": DEF + "gn",
+ "homePhone": DEF + "homePhone",
+ "homePostalAddress": DEF + "homePostalAddress",
+ "homeTelephoneNumber": DEF + "homeTelephoneNumber",
+ "host": DEF + "host",
+ "houseIdentifier": DEF + "houseIdentifier",
+ "info": DEF + "info",
+ "initials": DEF + "initials",
+ "internationaliSDNNumber": DEF + "internationaliSDNNumber",
+ "isMemberOf": DEF + "isMemberOf",
+ "janetMailbox": DEF + "janetMailbox",
+ "jpegPhoto": DEF + "jpegPhoto",
+ "knowledgeInformation": DEF + "knowledgeInformation",
+ "l": DEF + "l",
+ "labeledURI": DEF + "labeledURI",
+ "localityName": DEF + "localityName",
+ "mDRecord": DEF + "mDRecord",
+ "mXRecord": DEF + "mXRecord",
+ "mail": DEF + "mail",
+ "mailPreferenceOption": DEF + "mailPreferenceOption",
+ "manager": DEF + "manager",
+ "member": DEF + "member",
+ "mobile": DEF + "mobile",
+ "mobileTelephoneNumber": DEF + "mobileTelephoneNumber",
+ "nSRecord": DEF + "nSRecord",
+ "name": DEF + "name",
+ "norEduOrgAcronym": DEF + "norEduOrgAcronym",
+ "norEduOrgNIN": DEF + "norEduOrgNIN",
+ "norEduOrgSchemaVersion": DEF + "norEduOrgSchemaVersion",
+ "norEduOrgUniqueIdentifier": DEF + "norEduOrgUniqueIdentifier",
+ "norEduOrgUniqueNumber": DEF + "norEduOrgUniqueNumber",
+ "norEduOrgUnitUniqueIdentifier": DEF + "norEduOrgUnitUniqueIdentifier",
+ "norEduOrgUnitUniqueNumber": DEF + "norEduOrgUnitUniqueNumber",
+ "norEduPersonBirthDate": DEF + "norEduPersonBirthDate",
+ "norEduPersonLIN": DEF + "norEduPersonLIN",
+ "norEduPersonNIN": DEF + "norEduPersonNIN",
+ "o": DEF + "o",
+ "objectClass": DEF + "objectClass",
+ "organizationName": DEF + "organizationName",
+ "organizationalStatus": DEF + "organizationalStatus",
+ "organizationalUnitName": DEF + "organizationalUnitName",
+ "otherMailbox": DEF + "otherMailbox",
+ "ou": DEF + "ou",
+ "owner": DEF + "owner",
+ "pager": DEF + "pager",
+ "pagerTelephoneNumber": DEF + "pagerTelephoneNumber",
+ "personalSignature": DEF + "personalSignature",
+ "personalTitle": DEF + "personalTitle",
+ "photo": DEF + "photo",
+ "physicalDeliveryOfficeName": DEF + "physicalDeliveryOfficeName",
+ "pkcs9email": DEF + "pkcs9email",
+ "postOfficeBox": DEF + "postOfficeBox",
+ "postalAddress": DEF + "postalAddress",
+ "postalCode": DEF + "postalCode",
+ "preferredDeliveryMethod": DEF + "preferredDeliveryMethod",
+ "preferredLanguage": DEF + "preferredLanguage",
+ "presentationAddress": DEF + "presentationAddress",
+ "protocolInformation": DEF + "protocolInformation",
+ "pseudonym": DEF + "pseudonym",
+ "registeredAddress": DEF + "registeredAddress",
+ "rfc822Mailbox": DEF + "rfc822Mailbox",
+ "roleOccupant": DEF + "roleOccupant",
+ "roomNumber": DEF + "roomNumber",
+ "sOARecord": DEF + "sOARecord",
+ "searchGuide": DEF + "searchGuide",
+ "secretary": DEF + "secretary",
+ "seeAlso": DEF + "seeAlso",
+ "serialNumber": DEF + "serialNumber",
+ "singleLevelQuality": DEF + "singleLevelQuality",
+ "sn": DEF + "sn",
+ "st": DEF + "st",
+ "stateOrProvinceName": DEF + "stateOrProvinceName",
+ "street": DEF + "street",
+ "streetAddress": DEF + "streetAddress",
+ "subtreeMaximumQuality": DEF + "subtreeMaximumQuality",
+ "subtreeMinimumQuality": DEF + "subtreeMinimumQuality",
+ "supportedAlgorithms": DEF + "supportedAlgorithms",
+ "supportedApplicationContext": DEF + "supportedApplicationContext",
+ "surname": DEF + "surname",
+ "telephoneNumber": DEF + "telephoneNumber",
+ "teletexTerminalIdentifier": DEF + "teletexTerminalIdentifier",
+ "telexNumber": DEF + "telexNumber",
+ "textEncodedORAddress": DEF + "textEncodedORAddress",
+ "title": DEF + "title",
+ "uid": DEF + "uid",
+ "uniqueIdentifier": DEF + "uniqueIdentifier",
+ "uniqueMember": DEF + "uniqueMember",
+ "userCertificate": DEF + "userCertificate",
+ "userClass": DEF + "userClass",
+ "userPKCS12": DEF + "userPKCS12",
+ "userPassword": DEF + "userPassword",
+ "userSMIMECertificate": DEF + "userSMIMECertificate",
+ "userid": DEF + "userid",
+ "x121Address": DEF + "x121Address",
+ "x500UniqueIdentifier": DEF + "x500UniqueIdentifier",
},
- 'to': {
- 'aRecord': DEF+'aRecord',
- 'aliasedEntryName': DEF+'aliasedEntryName',
- 'aliasedObjectName': DEF+'aliasedObjectName',
- 'associatedDomain': DEF+'associatedDomain',
- 'associatedName': DEF+'associatedName',
- 'audio': DEF+'audio',
- 'authorityRevocationList': DEF+'authorityRevocationList',
- 'buildingName': DEF+'buildingName',
- 'businessCategory': DEF+'businessCategory',
- 'c': DEF+'c',
- 'cACertificate': DEF+'cACertificate',
- 'cNAMERecord': DEF+'cNAMERecord',
- 'carLicense': DEF+'carLicense',
- 'certificateRevocationList': DEF+'certificateRevocationList',
- 'cn': DEF+'cn',
- 'co': DEF+'co',
- 'commonName': DEF+'commonName',
- 'countryName': DEF+'countryName',
- 'crossCertificatePair': DEF+'crossCertificatePair',
- 'dITRedirect': DEF+'dITRedirect',
- 'dSAQuality': DEF+'dSAQuality',
- 'dc': DEF+'dc',
- 'deltaRevocationList': DEF+'deltaRevocationList',
- 'departmentNumber': DEF+'departmentNumber',
- 'description': DEF+'description',
- 'destinationIndicator': DEF+'destinationIndicator',
- 'displayName': DEF+'displayName',
- 'distinguishedName': DEF+'distinguishedName',
- 'dmdName': DEF+'dmdName',
- 'dnQualifier': DEF+'dnQualifier',
- 'documentAuthor': DEF+'documentAuthor',
- 'documentIdentifier': DEF+'documentIdentifier',
- 'documentLocation': DEF+'documentLocation',
- 'documentPublisher': DEF+'documentPublisher',
- 'documentTitle': DEF+'documentTitle',
- 'documentVersion': DEF+'documentVersion',
- 'domainComponent': DEF+'domainComponent',
- 'drink': DEF+'drink',
- 'eduOrgHomePageURI': DEF+'eduOrgHomePageURI',
- 'eduOrgIdentityAuthNPolicyURI': DEF+'eduOrgIdentityAuthNPolicyURI',
- 'eduOrgLegalName': DEF+'eduOrgLegalName',
- 'eduOrgSuperiorURI': DEF+'eduOrgSuperiorURI',
- 'eduOrgWhitePagesURI': DEF+'eduOrgWhitePagesURI',
- 'eduCourseMember': DEF+'eduCourseMember',
- 'eduCourseOffering': DEF+'eduCourseOffering',
- 'eduPersonAffiliation': DEF+'eduPersonAffiliation',
- 'eduPersonEntitlement': DEF+'eduPersonEntitlement',
- 'eduPersonNickname': DEF+'eduPersonNickname',
- 'eduPersonOrgDN': DEF+'eduPersonOrgDN',
- 'eduPersonOrgUnitDN': DEF+'eduPersonOrgUnitDN',
- 'eduPersonPrimaryAffiliation': DEF+'eduPersonPrimaryAffiliation',
- 'eduPersonPrimaryOrgUnitDN': DEF+'eduPersonPrimaryOrgUnitDN',
- 'eduPersonPrincipalName': DEF+'eduPersonPrincipalName',
- 'eduPersonPrincipalNamePrior': DEF+'eduPersonPrincipalNamePrior',
- 'eduPersonScopedAffiliation': DEF+'eduPersonScopedAffiliation',
- 'eduPersonTargetedID': DEF+'eduPersonTargetedID',
- 'eduPersonAssurance': DEF+'eduPersonAssurance',
- 'eduPersonUniqueId': DEF+'eduPersonUniqueId',
- 'eduPersonOrcid': DEF+'eduPersonOrcid',
- 'email': DEF+'email',
- 'emailAddress': DEF+'emailAddress',
- 'employeeNumber': DEF+'employeeNumber',
- 'employeeType': DEF+'employeeType',
- 'enhancedSearchGuide': DEF+'enhancedSearchGuide',
- 'facsimileTelephoneNumber': DEF+'facsimileTelephoneNumber',
- 'favouriteDrink': DEF+'favouriteDrink',
- 'fax': DEF+'fax',
- 'federationFeideSchemaVersion': DEF+'federationFeideSchemaVersion',
- 'friendlyCountryName': DEF+'friendlyCountryName',
- 'generationQualifier': DEF+'generationQualifier',
- 'givenName': DEF+'givenName',
- 'gn': DEF+'gn',
- 'homePhone': DEF+'homePhone',
- 'homePostalAddress': DEF+'homePostalAddress',
- 'homeTelephoneNumber': DEF+'homeTelephoneNumber',
- 'host': DEF+'host',
- 'houseIdentifier': DEF+'houseIdentifier',
- 'info': DEF+'info',
- 'initials': DEF+'initials',
- 'internationaliSDNNumber': DEF+'internationaliSDNNumber',
- 'isMemberOf': DEF+'isMemberOf',
- 'janetMailbox': DEF+'janetMailbox',
- 'jpegPhoto': DEF+'jpegPhoto',
- 'knowledgeInformation': DEF+'knowledgeInformation',
- 'l': DEF+'l',
- 'labeledURI': DEF+'labeledURI',
- 'localityName': DEF+'localityName',
- 'mDRecord': DEF+'mDRecord',
- 'mXRecord': DEF+'mXRecord',
- 'mail': DEF+'mail',
- 'mailPreferenceOption': DEF+'mailPreferenceOption',
- 'manager': DEF+'manager',
- 'member': DEF+'member',
- 'mobile': DEF+'mobile',
- 'mobileTelephoneNumber': DEF+'mobileTelephoneNumber',
- 'nSRecord': DEF+'nSRecord',
- 'name': DEF+'name',
- 'norEduOrgAcronym': DEF+'norEduOrgAcronym',
- 'norEduOrgNIN': DEF+'norEduOrgNIN',
- 'norEduOrgSchemaVersion': DEF+'norEduOrgSchemaVersion',
- 'norEduOrgUniqueIdentifier': DEF+'norEduOrgUniqueIdentifier',
- 'norEduOrgUniqueNumber': DEF+'norEduOrgUniqueNumber',
- 'norEduOrgUnitUniqueIdentifier': DEF+'norEduOrgUnitUniqueIdentifier',
- 'norEduOrgUnitUniqueNumber': DEF+'norEduOrgUnitUniqueNumber',
- 'norEduPersonBirthDate': DEF+'norEduPersonBirthDate',
- 'norEduPersonLIN': DEF+'norEduPersonLIN',
- 'norEduPersonNIN': DEF+'norEduPersonNIN',
- 'o': DEF+'o',
- 'objectClass': DEF+'objectClass',
- 'organizationName': DEF+'organizationName',
- 'organizationalStatus': DEF+'organizationalStatus',
- 'organizationalUnitName': DEF+'organizationalUnitName',
- 'otherMailbox': DEF+'otherMailbox',
- 'ou': DEF+'ou',
- 'owner': DEF+'owner',
- 'pager': DEF+'pager',
- 'pagerTelephoneNumber': DEF+'pagerTelephoneNumber',
- 'personalSignature': DEF+'personalSignature',
- 'personalTitle': DEF+'personalTitle',
- 'photo': DEF+'photo',
- 'physicalDeliveryOfficeName': DEF+'physicalDeliveryOfficeName',
- 'pkcs9email': DEF+'pkcs9email',
- 'postOfficeBox': DEF+'postOfficeBox',
- 'postalAddress': DEF+'postalAddress',
- 'postalCode': DEF+'postalCode',
- 'preferredDeliveryMethod': DEF+'preferredDeliveryMethod',
- 'preferredLanguage': DEF+'preferredLanguage',
- 'presentationAddress': DEF+'presentationAddress',
- 'protocolInformation': DEF+'protocolInformation',
- 'pseudonym': DEF+'pseudonym',
- 'registeredAddress': DEF+'registeredAddress',
- 'rfc822Mailbox': DEF+'rfc822Mailbox',
- 'roleOccupant': DEF+'roleOccupant',
- 'roomNumber': DEF+'roomNumber',
- 'sOARecord': DEF+'sOARecord',
- 'searchGuide': DEF+'searchGuide',
- 'secretary': DEF+'secretary',
- 'seeAlso': DEF+'seeAlso',
- 'serialNumber': DEF+'serialNumber',
- 'singleLevelQuality': DEF+'singleLevelQuality',
- 'sn': DEF+'sn',
- 'st': DEF+'st',
- 'stateOrProvinceName': DEF+'stateOrProvinceName',
- 'street': DEF+'street',
- 'streetAddress': DEF+'streetAddress',
- 'subtreeMaximumQuality': DEF+'subtreeMaximumQuality',
- 'subtreeMinimumQuality': DEF+'subtreeMinimumQuality',
- 'supportedAlgorithms': DEF+'supportedAlgorithms',
- 'supportedApplicationContext': DEF+'supportedApplicationContext',
- 'surname': DEF+'surname',
- 'telephoneNumber': DEF+'telephoneNumber',
- 'teletexTerminalIdentifier': DEF+'teletexTerminalIdentifier',
- 'telexNumber': DEF+'telexNumber',
- 'textEncodedORAddress': DEF+'textEncodedORAddress',
- 'title': DEF+'title',
- 'uid': DEF+'uid',
- 'uniqueIdentifier': DEF+'uniqueIdentifier',
- 'uniqueMember': DEF+'uniqueMember',
- 'userCertificate': DEF+'userCertificate',
- 'userClass': DEF+'userClass',
- 'userPKCS12': DEF+'userPKCS12',
- 'userPassword': DEF+'userPassword',
- 'userSMIMECertificate': DEF+'userSMIMECertificate',
- 'userid': DEF+'userid',
- 'x121Address': DEF+'x121Address',
- 'x500UniqueIdentifier': DEF+'x500UniqueIdentifier',
- }
}
diff --git a/src/saml2/attributemaps/saml_uri.py b/src/saml2/attributemaps/saml_uri.py
index 5dd83cae..b574b08e 100644
--- a/src/saml2/attributemaps/saml_uri.py
+++ b/src/saml2/attributemaps/saml_uri.py
@@ -1,490 +1,490 @@
-EDUCOURSE_OID = 'urn:oid:1.3.6.1.4.1.5923.1.6.1.'
-EDUPERSON_OID = 'urn:oid:1.3.6.1.4.1.5923.1.1.1.'
-EDUMEMBER1_OID = 'urn:oid:1.3.6.1.4.1.5923.1.5.1.'
+EDUCOURSE_OID = "urn:oid:1.3.6.1.4.1.5923.1.6.1."
+EDUPERSON_OID = "urn:oid:1.3.6.1.4.1.5923.1.1.1."
+EDUMEMBER1_OID = "urn:oid:1.3.6.1.4.1.5923.1.5.1."
# voPerson class References:
# - https://github.com/voperson/voperson/blob/2.0.0/voPerson.md#voperson-object-class-definition
-VOPERSON_V2_OID = 'urn:oid:1.3.6.1.4.1.25178.4.1.'
+VOPERSON_V2_OID = "urn:oid:1.3.6.1.4.1.25178.4.1."
# ldap.gv.at definitions as specified in:
# http://www.ref.gv.at/AG-IZ-PVP2-Version-2-1-0-2.2754.0.html
-LDAPGVAT_OID = 'urn:oid:1.2.40.0.10.2.1.1.'
+LDAPGVAT_OID = "urn:oid:1.2.40.0.10.2.1.1."
-UCL_DIR_PILOT = 'urn:oid:0.9.2342.19200300.100.1.'
-X500ATTR_OID = 'urn:oid:2.5.4.'
+UCL_DIR_PILOT = "urn:oid:0.9.2342.19200300.100.1."
+X500ATTR_OID = "urn:oid:2.5.4."
LDAPGVAT_UCL_DIR_PILOT = UCL_DIR_PILOT
LDAPGVAT_X500ATTR_OID = X500ATTR_OID
-NETSCAPE_LDAP = 'urn:oid:2.16.840.1.113730.3.1.'
-NOREDUPERSON_OID = 'urn:oid:1.3.6.1.4.1.2428.90.1.'
-PKCS_9 = 'urn:oid:1.2.840.113549.1.9.1.'
-SCHAC = 'urn:oid:1.3.6.1.4.1.25178.1.2.'
-SIS = 'urn:oid:1.2.752.194.10.2.'
-UMICH = 'urn:oid:1.3.6.1.4.1.250.1.57.'
+NETSCAPE_LDAP = "urn:oid:2.16.840.1.113730.3.1."
+NOREDUPERSON_OID = "urn:oid:1.3.6.1.4.1.2428.90.1."
+PKCS_9 = "urn:oid:1.2.840.113549.1.9.1."
+SCHAC = "urn:oid:1.3.6.1.4.1.25178.1.2."
+SIS = "urn:oid:1.2.752.194.10.2."
+UMICH = "urn:oid:1.3.6.1.4.1.250.1.57."
# openosi-0.82.schema http://www.openosi.org/osi/display/ldap/Home
-OPENOSI_OID = 'urn:oid:1.3.6.1.4.1.27630.2.1.1.'
-SWISSEDUPERSON_OID = 'urn:oid:2.16.756.1.2.5.1.1.'
+OPENOSI_OID = "urn:oid:1.3.6.1.4.1.27630.2.1.1."
+SWISSEDUPERSON_OID = "urn:oid:2.16.756.1.2.5.1.1."
-EIDAS_NATURALPERSON = 'http://eidas.europa.eu/attributes/naturalperson/'
-EIDAS_LEGALPERSON = 'http://eidas.europa.eu/attributes/legalperson/'
+EIDAS_NATURALPERSON = "http://eidas.europa.eu/attributes/naturalperson/"
+EIDAS_LEGALPERSON = "http://eidas.europa.eu/attributes/legalperson/"
# SAML subject id specification
# https://docs.oasis-open.org/security/saml-subject-id-attr/v1.0/cs01/saml-subject-id-attr-v1.0-cs01.html
-SAML_SUBJECT_ID = 'urn:oasis:names:tc:SAML:attribute:'
+SAML_SUBJECT_ID = "urn:oasis:names:tc:SAML:attribute:"
# umbrellaID specification - https://www.umbrellaid.org
# https://github.com/Umbrella-Commiters/UmbrellaIdP3/blob/master/schema/99-user.ldif
-UMBRELLA_EAAUser_ID = 'urn:oid:1.3.6.1.4.1.42750.1.1.'
+UMBRELLA_EAAUser_ID = "urn:oid:1.3.6.1.4.1.42750.1.1."
# PKIX specification (SMI Security for PKIX Personal Data Attributes)
# https://tools.ietf.org/html/rfc7299
-PKIX_OID = 'urn:oid:1.3.6.1.5.5.7.9.'
+PKIX_OID = "urn:oid:1.3.6.1.5.5.7.9."
# INERA specification
# Closet public spec source I could find, sadly in swedish
# https://www.sambi.se/wordpress/wp-content/uploads/2017/06/Sambi_Attributspecifikation_1.1.pdf
-INERA_OID = 'urn:oid:1.2.752.29.4.'
+INERA_OID = "urn:oid:1.2.752.29.4."
# DIGG specification
# https://docs.swedenconnect.se/technical-framework/latest/ELN-0604_-_Attribute_Specification_for_the_Swedish_eID_Framework.html
-DIGG_OID = 'urn:oid:1.2.752.201.3.'
+DIGG_OID = "urn:oid:1.2.752.201.3."
MAP = {
- 'identifier': 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri',
- 'fro': {
- DIGG_OID+'1': 'orgAffiliation',
- DIGG_OID+'2': 'transactionIdentifier',
- DIGG_OID+'3': 'authContextParams',
- DIGG_OID+'4': 'prid',
- DIGG_OID+'5': 'pridPersistence',
- DIGG_OID+'6': 'personalIdentityNumberBinding',
- DIGG_OID+'7': 'eidasPersonIdentifier',
- DIGG_OID+'8': 'birthName',
- DIGG_OID+'9': 'eidasNaturalPersonAddress',
- DIGG_OID+'10': 'userCertificate',
- DIGG_OID+'11': 'userSignature',
- DIGG_OID+'12': 'sad',
- DIGG_OID+'13': 'authServerSignature',
- DIGG_OID+'14': 'signMessageDigest',
- EIDAS_LEGALPERSON+'LegalPersonIdentifier': 'LegalPersonIdentifier',
- EIDAS_LEGALPERSON+'LegalPersonAddress': 'LegalAddress',
- EIDAS_LEGALPERSON+'LegalName': 'LegalName',
- EIDAS_LEGALPERSON+'VATRegistrationNumber': 'VATRegistration',
- EIDAS_LEGALPERSON+'TaxReference': 'TaxReference',
- EIDAS_LEGALPERSON+'BusinessCodes': 'BusinessCodes',
- EIDAS_LEGALPERSON+'LEI': 'LEI',
- EIDAS_LEGALPERSON+'EORI': 'EORI',
- EIDAS_LEGALPERSON+'SEED': 'SEED',
- EIDAS_LEGALPERSON+'SIC': 'SIC',
- EIDAS_LEGALPERSON+'D-2012-17-EUIdentifier': 'D-2012-17-EUIdentifier',
- EIDAS_NATURALPERSON+'PersonIdentifier': 'PersonIdentifier',
- EIDAS_NATURALPERSON+'CurrentFamilyName': 'FamilyName',
- EIDAS_NATURALPERSON+'CurrentGivenName': 'FirstName',
- EIDAS_NATURALPERSON+'DateOfBirth': 'DateOfBirth',
- EIDAS_NATURALPERSON+'BirthName': 'BirthName',
- EIDAS_NATURALPERSON+'PlaceOfBirth': 'PlaceOfBirth',
- EIDAS_NATURALPERSON+'CurrentAddress': 'CurrentAddress',
- EIDAS_NATURALPERSON+'Gender': 'Gender',
- EDUCOURSE_OID+'1': 'eduCourseOffering',
- EDUCOURSE_OID+'2': 'eduCourseMember',
- EDUMEMBER1_OID+'1': 'isMemberOf',
- EDUPERSON_OID+'1': 'eduPersonAffiliation',
- EDUPERSON_OID+'2': 'eduPersonNickname',
- EDUPERSON_OID+'3': 'eduPersonOrgDN',
- EDUPERSON_OID+'4': 'eduPersonOrgUnitDN',
- EDUPERSON_OID+'5': 'eduPersonPrimaryAffiliation',
- EDUPERSON_OID+'6': 'eduPersonPrincipalName',
- EDUPERSON_OID+'7': 'eduPersonEntitlement',
- EDUPERSON_OID+'8': 'eduPersonPrimaryOrgUnitDN',
- EDUPERSON_OID+'9': 'eduPersonScopedAffiliation',
- EDUPERSON_OID+'10': 'eduPersonTargetedID',
- EDUPERSON_OID+'11': 'eduPersonAssurance',
- EDUPERSON_OID+'12': 'eduPersonPrincipalNamePrior',
- EDUPERSON_OID+'13': 'eduPersonUniqueId',
- EDUPERSON_OID+'16': 'eduPersonOrcid',
- INERA_OID+'1': 'employeeHsaId',
- INERA_OID+'13': 'personalIdentityNumber',
- LDAPGVAT_OID+'1': 'PVP-GID',
- LDAPGVAT_OID+'149': 'PVP-BPK',
- LDAPGVAT_OID+'153': 'PVP-OU-OKZ',
- LDAPGVAT_OID+'261.10': 'PVP-VERSION',
- LDAPGVAT_OID+'261.20': 'PVP-PRINCIPAL-NAME',
- LDAPGVAT_OID+'261.24': 'PVP-PARTICIPANT-OKZ',
- LDAPGVAT_OID+'261.30': 'PVP-ROLES',
- LDAPGVAT_OID+'261.40': 'PVP-INVOICE-RECPT-ID',
- LDAPGVAT_OID+'261.50': 'PVP-COST-CENTER-ID',
- LDAPGVAT_OID+'261.60': 'PVP-CHARGE-CODE',
- LDAPGVAT_OID+'3': 'PVP-OU-GV-OU-ID',
- LDAPGVAT_OID+'33': 'PVP-FUNCTION',
- LDAPGVAT_OID+'55': 'PVP-BIRTHDATE',
- LDAPGVAT_OID+'71': 'PVP-PARTICIPANT-ID',
- LDAPGVAT_UCL_DIR_PILOT+'1': 'PVP-USERID',
- LDAPGVAT_UCL_DIR_PILOT+'3': 'PVP-MAIL',
- LDAPGVAT_X500ATTR_OID+'11': 'PVP-OU',
- LDAPGVAT_X500ATTR_OID+'20': 'PVP-TEL',
- LDAPGVAT_X500ATTR_OID+'42': 'PVP-GIVENNAME',
- NETSCAPE_LDAP+'1': 'carLicense',
- NETSCAPE_LDAP+'2': 'departmentNumber',
- NETSCAPE_LDAP+'3': 'employeeNumber',
- NETSCAPE_LDAP+'4': 'employeeType',
- NETSCAPE_LDAP+'39': 'preferredLanguage',
- NETSCAPE_LDAP+'40': 'userSMIMECertificate',
- NETSCAPE_LDAP+'216': 'userPKCS12',
- NETSCAPE_LDAP+'241': 'displayName',
- NOREDUPERSON_OID+'1': 'norEduOrgUniqueNumber',
- NOREDUPERSON_OID+'2': 'norEduOrgUnitUniqueNumber',
- NOREDUPERSON_OID+'3': 'norEduPersonBirthDate',
- NOREDUPERSON_OID+'4': 'norEduPersonLIN',
- NOREDUPERSON_OID+'5': 'norEduPersonNIN',
- NOREDUPERSON_OID+'6': 'norEduOrgAcronym',
- NOREDUPERSON_OID+'7': 'norEduOrgUniqueIdentifier',
- NOREDUPERSON_OID+'8': 'norEduOrgUnitUniqueIdentifier',
- NOREDUPERSON_OID+'9': 'federationFeideSchemaVersion',
- NOREDUPERSON_OID+'10': 'norEduPersonLegalName',
- NOREDUPERSON_OID+'11': 'norEduOrgSchemaVersion',
- NOREDUPERSON_OID+'12': 'norEduOrgNIN',
- OPENOSI_OID+'17': 'osiHomeUrl',
- OPENOSI_OID+'19': 'osiPreferredTZ',
- OPENOSI_OID+'72': 'osiICardTimeLastUpdated',
- OPENOSI_OID+'104': 'osiMiddleName',
- OPENOSI_OID+'107': 'osiOtherEmail',
- OPENOSI_OID+'109': 'osiOtherHomePhone',
- OPENOSI_OID+'120': 'osiWorkURL',
- PKCS_9+'1': 'email',
- PKIX_OID+'1': 'dateOfBirth',
- PKIX_OID+'2': 'placeOfBirth',
- PKIX_OID+'3': 'gender',
- PKIX_OID+'4': 'countryOfCitizenship',
- PKIX_OID+'5': 'countryOfResidence',
- SAML_SUBJECT_ID+'subject-id': 'subject-id',
- SAML_SUBJECT_ID+'pairwise-id': 'pairwise-id',
- SCHAC+'1': 'schacMotherTongue',
- SCHAC+'2': 'schacGender',
- SCHAC+'3': 'schacDateOfBirth',
- SCHAC+'4': 'schacPlaceOfBirth',
- SCHAC+'5': 'schacCountryOfCitizenship',
- SCHAC+'6': 'schacSn1',
- SCHAC+'7': 'schacSn2',
- SCHAC+'8': 'schacPersonalTitle',
- SCHAC+'9': 'schacHomeOrganization',
- SCHAC+'10': 'schacHomeOrganizationType',
- SCHAC+'11': 'schacCountryOfResidence',
- SCHAC+'12': 'schacUserPresenceID',
- SCHAC+'13': 'schacPersonalPosition',
- SCHAC+'14': 'schacPersonalUniqueCode',
- SCHAC+'15': 'schacPersonalUniqueID',
- SCHAC+'17': 'schacExpiryDate',
- SCHAC+'18': 'schacUserPrivateAttribute',
- SCHAC+'19': 'schacUserStatus',
- SCHAC+'20': 'schacProjectMembership',
- SCHAC+'21': 'schacProjectSpecificRole',
- SIS+'1': 'sisLegalGuardianFor',
- SIS+'2': 'sisSchoolGrade',
- UCL_DIR_PILOT+'1': 'uid',
- UCL_DIR_PILOT+'3': 'mail',
- UCL_DIR_PILOT+'25': 'dc',
- UCL_DIR_PILOT+'37': 'associatedDomain',
- UCL_DIR_PILOT+'43': 'co',
- UCL_DIR_PILOT+'60': 'jpegPhoto',
- UMBRELLA_EAAUser_ID+'1': 'EAAHash',
- UMBRELLA_EAAUser_ID+'3': 'EAAKey',
- UMICH+'57': 'labeledURI',
- X500ATTR_OID+'2': 'knowledgeInformation',
- X500ATTR_OID+'3': 'cn',
- X500ATTR_OID+'4': 'sn',
- X500ATTR_OID+'5': 'serialNumber',
- X500ATTR_OID+'6': 'c',
- X500ATTR_OID+'7': 'l',
- X500ATTR_OID+'8': 'st',
- X500ATTR_OID+'9': 'street',
- X500ATTR_OID+'10': 'o',
- X500ATTR_OID+'11': 'ou',
- X500ATTR_OID+'12': 'title',
- X500ATTR_OID+'14': 'searchGuide',
- X500ATTR_OID+'15': 'businessCategory',
- X500ATTR_OID+'16': 'postalAddress',
- X500ATTR_OID+'17': 'postalCode',
- X500ATTR_OID+'18': 'postOfficeBox',
- X500ATTR_OID+'19': 'physicalDeliveryOfficeName',
- X500ATTR_OID+'20': 'telephoneNumber',
- X500ATTR_OID+'21': 'telexNumber',
- X500ATTR_OID+'22': 'teletexTerminalIdentifier',
- X500ATTR_OID+'23': 'facsimileTelephoneNumber',
- X500ATTR_OID+'24': 'x121Address',
- X500ATTR_OID+'25': 'internationaliSDNNumber',
- X500ATTR_OID+'26': 'registeredAddress',
- X500ATTR_OID+'27': 'destinationIndicator',
- X500ATTR_OID+'28': 'preferredDeliveryMethod',
- X500ATTR_OID+'29': 'presentationAddress',
- X500ATTR_OID+'30': 'supportedApplicationContext',
- X500ATTR_OID+'31': 'member',
- X500ATTR_OID+'32': 'owner',
- X500ATTR_OID+'33': 'roleOccupant',
- X500ATTR_OID+'36': 'userCertificate',
- X500ATTR_OID+'37': 'cACertificate',
- X500ATTR_OID+'38': 'authorityRevocationList',
- X500ATTR_OID+'39': 'certificateRevocationList',
- X500ATTR_OID+'40': 'crossCertificatePair',
- X500ATTR_OID+'42': 'givenName',
- X500ATTR_OID+'43': 'initials',
- X500ATTR_OID+'44': 'generationQualifier',
- X500ATTR_OID+'45': 'x500UniqueIdentifier',
- X500ATTR_OID+'46': 'dnQualifier',
- X500ATTR_OID+'47': 'enhancedSearchGuide',
- X500ATTR_OID+'48': 'protocolInformation',
- X500ATTR_OID+'50': 'uniqueMember',
- X500ATTR_OID+'51': 'houseIdentifier',
- X500ATTR_OID+'52': 'supportedAlgorithms',
- X500ATTR_OID+'53': 'deltaRevocationList',
- X500ATTR_OID+'54': 'dmdName',
- X500ATTR_OID+'65': 'pseudonym',
- SWISSEDUPERSON_OID+'1': 'swissEduPersonUniqueID',
- SWISSEDUPERSON_OID+'2': 'swissEduPersonDateOfBirth',
- SWISSEDUPERSON_OID+'3': 'swissEduPersonGender',
- SWISSEDUPERSON_OID+'4': 'swissEduPersonHomeOrganization',
- SWISSEDUPERSON_OID+'5': 'swissEduPersonHomeOrganizationType',
- SWISSEDUPERSON_OID+'6': 'swissEduPersonStudyBranch1',
- SWISSEDUPERSON_OID+'7': 'swissEduPersonStudyBranch2',
- SWISSEDUPERSON_OID+'8': 'swissEduPersonStudyBranch3',
- SWISSEDUPERSON_OID+'9': 'swissEduPersonStudyLevel',
- SWISSEDUPERSON_OID+'10': 'swissEduPersonStaffCategory',
- SWISSEDUPERSON_OID+'11': 'swissEduPersonMatriculationNumber',
- SWISSEDUPERSON_OID+'12': 'swissEduPersonCardUID',
- SWISSEDUPERSON_OID+'13': 'swissEduID',
- SWISSEDUPERSON_OID+'1023': 'swissLibraryPersonAffiliation',
- SWISSEDUPERSON_OID+'1025': 'swissLibraryPersonResidence',
- VOPERSON_V2_OID+'1': 'voPersonApplicationUID',
- VOPERSON_V2_OID+'2': 'voPersonAuthorName',
- VOPERSON_V2_OID+'3': 'voPersonCertificateDN',
- VOPERSON_V2_OID+'4': 'voPersonCertificateIssuerDN',
- VOPERSON_V2_OID+'5': 'voPersonExternalID',
- VOPERSON_V2_OID+'6': 'voPersonID',
- VOPERSON_V2_OID+'7': 'voPersonPolicyAgreement',
- VOPERSON_V2_OID+'8': 'voPersonSoRID',
- VOPERSON_V2_OID+'9': 'voPersonStatus',
- VOPERSON_V2_OID+'10': 'voPersonAffiliation',
- VOPERSON_V2_OID+'11': 'voPersonExternalAffiliation',
- VOPERSON_V2_OID+'12': 'voPersonScopedAffiliation',
- VOPERSON_V2_OID+'13': 'voPersonApplicationPassword',
- VOPERSON_V2_OID+'14': 'voPersonVerifiedEmail',
- VOPERSON_V2_OID+'15': 'voPersonToken',
+ "identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri",
+ "fro": {
+ DIGG_OID + "1": "orgAffiliation",
+ DIGG_OID + "2": "transactionIdentifier",
+ DIGG_OID + "3": "authContextParams",
+ DIGG_OID + "4": "prid",
+ DIGG_OID + "5": "pridPersistence",
+ DIGG_OID + "6": "personalIdentityNumberBinding",
+ DIGG_OID + "7": "eidasPersonIdentifier",
+ DIGG_OID + "8": "birthName",
+ DIGG_OID + "9": "eidasNaturalPersonAddress",
+ DIGG_OID + "10": "userCertificate",
+ DIGG_OID + "11": "userSignature",
+ DIGG_OID + "12": "sad",
+ DIGG_OID + "13": "authServerSignature",
+ DIGG_OID + "14": "signMessageDigest",
+ EIDAS_LEGALPERSON + "LegalPersonIdentifier": "LegalPersonIdentifier",
+ EIDAS_LEGALPERSON + "LegalPersonAddress": "LegalAddress",
+ EIDAS_LEGALPERSON + "LegalName": "LegalName",
+ EIDAS_LEGALPERSON + "VATRegistrationNumber": "VATRegistration",
+ EIDAS_LEGALPERSON + "TaxReference": "TaxReference",
+ EIDAS_LEGALPERSON + "BusinessCodes": "BusinessCodes",
+ EIDAS_LEGALPERSON + "LEI": "LEI",
+ EIDAS_LEGALPERSON + "EORI": "EORI",
+ EIDAS_LEGALPERSON + "SEED": "SEED",
+ EIDAS_LEGALPERSON + "SIC": "SIC",
+ EIDAS_LEGALPERSON + "D-2012-17-EUIdentifier": "D-2012-17-EUIdentifier",
+ EIDAS_NATURALPERSON + "PersonIdentifier": "PersonIdentifier",
+ EIDAS_NATURALPERSON + "CurrentFamilyName": "FamilyName",
+ EIDAS_NATURALPERSON + "CurrentGivenName": "FirstName",
+ EIDAS_NATURALPERSON + "DateOfBirth": "DateOfBirth",
+ EIDAS_NATURALPERSON + "BirthName": "BirthName",
+ EIDAS_NATURALPERSON + "PlaceOfBirth": "PlaceOfBirth",
+ EIDAS_NATURALPERSON + "CurrentAddress": "CurrentAddress",
+ EIDAS_NATURALPERSON + "Gender": "Gender",
+ EDUCOURSE_OID + "1": "eduCourseOffering",
+ EDUCOURSE_OID + "2": "eduCourseMember",
+ EDUMEMBER1_OID + "1": "isMemberOf",
+ EDUPERSON_OID + "1": "eduPersonAffiliation",
+ EDUPERSON_OID + "2": "eduPersonNickname",
+ EDUPERSON_OID + "3": "eduPersonOrgDN",
+ EDUPERSON_OID + "4": "eduPersonOrgUnitDN",
+ EDUPERSON_OID + "5": "eduPersonPrimaryAffiliation",
+ EDUPERSON_OID + "6": "eduPersonPrincipalName",
+ EDUPERSON_OID + "7": "eduPersonEntitlement",
+ EDUPERSON_OID + "8": "eduPersonPrimaryOrgUnitDN",
+ EDUPERSON_OID + "9": "eduPersonScopedAffiliation",
+ EDUPERSON_OID + "10": "eduPersonTargetedID",
+ EDUPERSON_OID + "11": "eduPersonAssurance",
+ EDUPERSON_OID + "12": "eduPersonPrincipalNamePrior",
+ EDUPERSON_OID + "13": "eduPersonUniqueId",
+ EDUPERSON_OID + "16": "eduPersonOrcid",
+ INERA_OID + "1": "employeeHsaId",
+ INERA_OID + "13": "personalIdentityNumber",
+ LDAPGVAT_OID + "1": "PVP-GID",
+ LDAPGVAT_OID + "149": "PVP-BPK",
+ LDAPGVAT_OID + "153": "PVP-OU-OKZ",
+ LDAPGVAT_OID + "261.10": "PVP-VERSION",
+ LDAPGVAT_OID + "261.20": "PVP-PRINCIPAL-NAME",
+ LDAPGVAT_OID + "261.24": "PVP-PARTICIPANT-OKZ",
+ LDAPGVAT_OID + "261.30": "PVP-ROLES",
+ LDAPGVAT_OID + "261.40": "PVP-INVOICE-RECPT-ID",
+ LDAPGVAT_OID + "261.50": "PVP-COST-CENTER-ID",
+ LDAPGVAT_OID + "261.60": "PVP-CHARGE-CODE",
+ LDAPGVAT_OID + "3": "PVP-OU-GV-OU-ID",
+ LDAPGVAT_OID + "33": "PVP-FUNCTION",
+ LDAPGVAT_OID + "55": "PVP-BIRTHDATE",
+ LDAPGVAT_OID + "71": "PVP-PARTICIPANT-ID",
+ LDAPGVAT_UCL_DIR_PILOT + "1": "PVP-USERID",
+ LDAPGVAT_UCL_DIR_PILOT + "3": "PVP-MAIL",
+ LDAPGVAT_X500ATTR_OID + "11": "PVP-OU",
+ LDAPGVAT_X500ATTR_OID + "20": "PVP-TEL",
+ LDAPGVAT_X500ATTR_OID + "42": "PVP-GIVENNAME",
+ NETSCAPE_LDAP + "1": "carLicense",
+ NETSCAPE_LDAP + "2": "departmentNumber",
+ NETSCAPE_LDAP + "3": "employeeNumber",
+ NETSCAPE_LDAP + "4": "employeeType",
+ NETSCAPE_LDAP + "39": "preferredLanguage",
+ NETSCAPE_LDAP + "40": "userSMIMECertificate",
+ NETSCAPE_LDAP + "216": "userPKCS12",
+ NETSCAPE_LDAP + "241": "displayName",
+ NOREDUPERSON_OID + "1": "norEduOrgUniqueNumber",
+ NOREDUPERSON_OID + "2": "norEduOrgUnitUniqueNumber",
+ NOREDUPERSON_OID + "3": "norEduPersonBirthDate",
+ NOREDUPERSON_OID + "4": "norEduPersonLIN",
+ NOREDUPERSON_OID + "5": "norEduPersonNIN",
+ NOREDUPERSON_OID + "6": "norEduOrgAcronym",
+ NOREDUPERSON_OID + "7": "norEduOrgUniqueIdentifier",
+ NOREDUPERSON_OID + "8": "norEduOrgUnitUniqueIdentifier",
+ NOREDUPERSON_OID + "9": "federationFeideSchemaVersion",
+ NOREDUPERSON_OID + "10": "norEduPersonLegalName",
+ NOREDUPERSON_OID + "11": "norEduOrgSchemaVersion",
+ NOREDUPERSON_OID + "12": "norEduOrgNIN",
+ OPENOSI_OID + "17": "osiHomeUrl",
+ OPENOSI_OID + "19": "osiPreferredTZ",
+ OPENOSI_OID + "72": "osiICardTimeLastUpdated",
+ OPENOSI_OID + "104": "osiMiddleName",
+ OPENOSI_OID + "107": "osiOtherEmail",
+ OPENOSI_OID + "109": "osiOtherHomePhone",
+ OPENOSI_OID + "120": "osiWorkURL",
+ PKCS_9 + "1": "email",
+ PKIX_OID + "1": "dateOfBirth",
+ PKIX_OID + "2": "placeOfBirth",
+ PKIX_OID + "3": "gender",
+ PKIX_OID + "4": "countryOfCitizenship",
+ PKIX_OID + "5": "countryOfResidence",
+ SAML_SUBJECT_ID + "subject-id": "subject-id",
+ SAML_SUBJECT_ID + "pairwise-id": "pairwise-id",
+ SCHAC + "1": "schacMotherTongue",
+ SCHAC + "2": "schacGender",
+ SCHAC + "3": "schacDateOfBirth",
+ SCHAC + "4": "schacPlaceOfBirth",
+ SCHAC + "5": "schacCountryOfCitizenship",
+ SCHAC + "6": "schacSn1",
+ SCHAC + "7": "schacSn2",
+ SCHAC + "8": "schacPersonalTitle",
+ SCHAC + "9": "schacHomeOrganization",
+ SCHAC + "10": "schacHomeOrganizationType",
+ SCHAC + "11": "schacCountryOfResidence",
+ SCHAC + "12": "schacUserPresenceID",
+ SCHAC + "13": "schacPersonalPosition",
+ SCHAC + "14": "schacPersonalUniqueCode",
+ SCHAC + "15": "schacPersonalUniqueID",
+ SCHAC + "17": "schacExpiryDate",
+ SCHAC + "18": "schacUserPrivateAttribute",
+ SCHAC + "19": "schacUserStatus",
+ SCHAC + "20": "schacProjectMembership",
+ SCHAC + "21": "schacProjectSpecificRole",
+ SIS + "1": "sisLegalGuardianFor",
+ SIS + "2": "sisSchoolGrade",
+ UCL_DIR_PILOT + "1": "uid",
+ UCL_DIR_PILOT + "3": "mail",
+ UCL_DIR_PILOT + "25": "dc",
+ UCL_DIR_PILOT + "37": "associatedDomain",
+ UCL_DIR_PILOT + "43": "co",
+ UCL_DIR_PILOT + "60": "jpegPhoto",
+ UMBRELLA_EAAUser_ID + "1": "EAAHash",
+ UMBRELLA_EAAUser_ID + "3": "EAAKey",
+ UMICH + "57": "labeledURI",
+ X500ATTR_OID + "2": "knowledgeInformation",
+ X500ATTR_OID + "3": "cn",
+ X500ATTR_OID + "4": "sn",
+ X500ATTR_OID + "5": "serialNumber",
+ X500ATTR_OID + "6": "c",
+ X500ATTR_OID + "7": "l",
+ X500ATTR_OID + "8": "st",
+ X500ATTR_OID + "9": "street",
+ X500ATTR_OID + "10": "o",
+ X500ATTR_OID + "11": "ou",
+ X500ATTR_OID + "12": "title",
+ X500ATTR_OID + "14": "searchGuide",
+ X500ATTR_OID + "15": "businessCategory",
+ X500ATTR_OID + "16": "postalAddress",
+ X500ATTR_OID + "17": "postalCode",
+ X500ATTR_OID + "18": "postOfficeBox",
+ X500ATTR_OID + "19": "physicalDeliveryOfficeName",
+ X500ATTR_OID + "20": "telephoneNumber",
+ X500ATTR_OID + "21": "telexNumber",
+ X500ATTR_OID + "22": "teletexTerminalIdentifier",
+ X500ATTR_OID + "23": "facsimileTelephoneNumber",
+ X500ATTR_OID + "24": "x121Address",
+ X500ATTR_OID + "25": "internationaliSDNNumber",
+ X500ATTR_OID + "26": "registeredAddress",
+ X500ATTR_OID + "27": "destinationIndicator",
+ X500ATTR_OID + "28": "preferredDeliveryMethod",
+ X500ATTR_OID + "29": "presentationAddress",
+ X500ATTR_OID + "30": "supportedApplicationContext",
+ X500ATTR_OID + "31": "member",
+ X500ATTR_OID + "32": "owner",
+ X500ATTR_OID + "33": "roleOccupant",
+ X500ATTR_OID + "36": "userCertificate",
+ X500ATTR_OID + "37": "cACertificate",
+ X500ATTR_OID + "38": "authorityRevocationList",
+ X500ATTR_OID + "39": "certificateRevocationList",
+ X500ATTR_OID + "40": "crossCertificatePair",
+ X500ATTR_OID + "42": "givenName",
+ X500ATTR_OID + "43": "initials",
+ X500ATTR_OID + "44": "generationQualifier",
+ X500ATTR_OID + "45": "x500UniqueIdentifier",
+ X500ATTR_OID + "46": "dnQualifier",
+ X500ATTR_OID + "47": "enhancedSearchGuide",
+ X500ATTR_OID + "48": "protocolInformation",
+ X500ATTR_OID + "50": "uniqueMember",
+ X500ATTR_OID + "51": "houseIdentifier",
+ X500ATTR_OID + "52": "supportedAlgorithms",
+ X500ATTR_OID + "53": "deltaRevocationList",
+ X500ATTR_OID + "54": "dmdName",
+ X500ATTR_OID + "65": "pseudonym",
+ SWISSEDUPERSON_OID + "1": "swissEduPersonUniqueID",
+ SWISSEDUPERSON_OID + "2": "swissEduPersonDateOfBirth",
+ SWISSEDUPERSON_OID + "3": "swissEduPersonGender",
+ SWISSEDUPERSON_OID + "4": "swissEduPersonHomeOrganization",
+ SWISSEDUPERSON_OID + "5": "swissEduPersonHomeOrganizationType",
+ SWISSEDUPERSON_OID + "6": "swissEduPersonStudyBranch1",
+ SWISSEDUPERSON_OID + "7": "swissEduPersonStudyBranch2",
+ SWISSEDUPERSON_OID + "8": "swissEduPersonStudyBranch3",
+ SWISSEDUPERSON_OID + "9": "swissEduPersonStudyLevel",
+ SWISSEDUPERSON_OID + "10": "swissEduPersonStaffCategory",
+ SWISSEDUPERSON_OID + "11": "swissEduPersonMatriculationNumber",
+ SWISSEDUPERSON_OID + "12": "swissEduPersonCardUID",
+ SWISSEDUPERSON_OID + "13": "swissEduID",
+ SWISSEDUPERSON_OID + "1023": "swissLibraryPersonAffiliation",
+ SWISSEDUPERSON_OID + "1025": "swissLibraryPersonResidence",
+ VOPERSON_V2_OID + "1": "voPersonApplicationUID",
+ VOPERSON_V2_OID + "2": "voPersonAuthorName",
+ VOPERSON_V2_OID + "3": "voPersonCertificateDN",
+ VOPERSON_V2_OID + "4": "voPersonCertificateIssuerDN",
+ VOPERSON_V2_OID + "5": "voPersonExternalID",
+ VOPERSON_V2_OID + "6": "voPersonID",
+ VOPERSON_V2_OID + "7": "voPersonPolicyAgreement",
+ VOPERSON_V2_OID + "8": "voPersonSoRID",
+ VOPERSON_V2_OID + "9": "voPersonStatus",
+ VOPERSON_V2_OID + "10": "voPersonAffiliation",
+ VOPERSON_V2_OID + "11": "voPersonExternalAffiliation",
+ VOPERSON_V2_OID + "12": "voPersonScopedAffiliation",
+ VOPERSON_V2_OID + "13": "voPersonApplicationPassword",
+ VOPERSON_V2_OID + "14": "voPersonVerifiedEmail",
+ VOPERSON_V2_OID + "15": "voPersonToken",
},
- 'to': {
- 'LegalPersonIdentifier': EIDAS_LEGALPERSON+'LegalPersonIdentifier',
- 'LegalAddress': EIDAS_LEGALPERSON+'LegalPersonAddress',
- 'LegalName': EIDAS_LEGALPERSON+'LegalName',
- 'VATRegistration': EIDAS_LEGALPERSON+'VATRegistrationNumber',
- 'TaxReference': EIDAS_LEGALPERSON+'TaxReference',
- 'BusinessCodes': EIDAS_LEGALPERSON+'BusinessCodes',
- 'LEI': EIDAS_LEGALPERSON+'LEI',
- 'EORI': EIDAS_LEGALPERSON+'EORI',
- 'SEED': EIDAS_LEGALPERSON+'SEED',
- 'SIC': EIDAS_LEGALPERSON+'SIC',
- 'D-2012-17-EUIdentifier': EIDAS_LEGALPERSON+'D-2012-17-EUIdentifier',
- 'PersonIdentifier': EIDAS_NATURALPERSON+'PersonIdentifier',
- 'FamilyName': EIDAS_NATURALPERSON+'CurrentFamilyName',
- 'FirstName': EIDAS_NATURALPERSON+'CurrentGivenName',
- 'DateOfBirth': EIDAS_NATURALPERSON+'DateOfBirth',
- 'BirthName': EIDAS_NATURALPERSON+'BirthName',
- 'PlaceOfBirth': EIDAS_NATURALPERSON+'PlaceOfBirth',
- 'CurrentAddress': EIDAS_NATURALPERSON+'CurrentAddress',
- 'Gender': EIDAS_NATURALPERSON+'Gender',
- 'associatedDomain': UCL_DIR_PILOT+'37',
- 'authContextParams': DIGG_OID+'3',
- 'authorityRevocationList': X500ATTR_OID+'38',
- 'authServerSignature': DIGG_OID+'13',
- 'birthName': DIGG_OID+'8',
- 'businessCategory': X500ATTR_OID+'15',
- 'c': X500ATTR_OID+'6',
- 'cACertificate': X500ATTR_OID+'37',
- 'carLicense': NETSCAPE_LDAP+'1',
- 'certificateRevocationList': X500ATTR_OID+'39',
- 'cn': X500ATTR_OID+'3',
- 'co': UCL_DIR_PILOT+'43',
- 'countryOfCitizenship': PKIX_OID+'4',
- 'countryOfResidence': PKIX_OID+'5',
- 'crossCertificatePair': X500ATTR_OID+'40',
- 'dateOfBirth': PKIX_OID+'1',
- 'dc': UCL_DIR_PILOT+'25',
- 'deltaRevocationList': X500ATTR_OID+'53',
- 'departmentNumber': NETSCAPE_LDAP+'2',
- 'destinationIndicator': X500ATTR_OID+'27',
- 'displayName': NETSCAPE_LDAP+'241',
- 'dmdName': X500ATTR_OID+'54',
- 'dnQualifier': X500ATTR_OID+'46',
- 'EAAHash': UMBRELLA_EAAUser_ID+'1',
- 'EAAKey': UMBRELLA_EAAUser_ID+'3',
- 'eduCourseMember': EDUCOURSE_OID+'2',
- 'eduCourseOffering': EDUCOURSE_OID+'1',
- 'eduPersonAffiliation': EDUPERSON_OID+'1',
- 'eduPersonEntitlement': EDUPERSON_OID+'7',
- 'eduPersonNickname': EDUPERSON_OID+'2',
- 'eduPersonOrgDN': EDUPERSON_OID+'3',
- 'eduPersonOrgUnitDN': EDUPERSON_OID+'4',
- 'eduPersonPrimaryAffiliation': EDUPERSON_OID+'5',
- 'eduPersonPrimaryOrgUnitDN': EDUPERSON_OID+'8',
- 'eduPersonPrincipalName': EDUPERSON_OID+'6',
- 'eduPersonPrincipalNamePrior': EDUPERSON_OID+'12',
- 'eduPersonScopedAffiliation': EDUPERSON_OID+'9',
- 'eduPersonTargetedID': EDUPERSON_OID+'10',
- 'eduPersonAssurance': EDUPERSON_OID+'11',
- 'eduPersonUniqueId': EDUPERSON_OID+'13',
- 'eduPersonOrcid': EDUPERSON_OID+'16',
- 'eidasNaturalPersonAddress': DIGG_OID+'9',
- 'eidasPersonIdentifier': DIGG_OID+'7',
- 'email': PKCS_9+'1',
- 'employeeHsaId': INERA_OID+'1',
- 'employeeNumber': NETSCAPE_LDAP+'3',
- 'employeeType': NETSCAPE_LDAP+'4',
- 'enhancedSearchGuide': X500ATTR_OID+'47',
- 'facsimileTelephoneNumber': X500ATTR_OID+'23',
- 'federationFeideSchemaVersion': NOREDUPERSON_OID+'9',
- 'gender': PKIX_OID+'3',
- 'generationQualifier': X500ATTR_OID+'44',
- 'givenName': X500ATTR_OID+'42',
- 'houseIdentifier': X500ATTR_OID+'51',
- 'initials': X500ATTR_OID+'43',
- 'internationaliSDNNumber': X500ATTR_OID+'25',
- 'isMemberOf': EDUMEMBER1_OID+'1',
- 'jpegPhoto': UCL_DIR_PILOT+'60',
- 'knowledgeInformation': X500ATTR_OID+'2',
- 'l': X500ATTR_OID+'7',
- 'labeledURI': UMICH+'57',
- 'mail': UCL_DIR_PILOT+'3',
- 'member': X500ATTR_OID+'31',
- 'norEduOrgAcronym': NOREDUPERSON_OID+'6',
- 'norEduOrgNIN': NOREDUPERSON_OID+'12',
- 'norEduOrgSchemaVersion': NOREDUPERSON_OID+'11',
- 'norEduOrgUniqueIdentifier': NOREDUPERSON_OID+'7',
- 'norEduOrgUniqueNumber': NOREDUPERSON_OID+'1',
- 'norEduOrgUnitUniqueIdentifier': NOREDUPERSON_OID+'8',
- 'norEduOrgUnitUniqueNumber': NOREDUPERSON_OID+'2',
- 'norEduPersonBirthDate': NOREDUPERSON_OID+'3',
- 'norEduPersonLIN': NOREDUPERSON_OID+'4',
- 'norEduPersonLegalName': NOREDUPERSON_OID+'10',
- 'norEduPersonNIN': NOREDUPERSON_OID+'5',
- 'o': X500ATTR_OID+'10',
- 'osiHomeUrl': OPENOSI_OID+'17',
- 'osiPreferredTZ': OPENOSI_OID+'19',
- 'osiICardTimeLastUpdated': OPENOSI_OID+'72',
- 'osiMiddleName': OPENOSI_OID+'104',
- 'osiOtherEmail': OPENOSI_OID+'107',
- 'osiOtherHomePhone': OPENOSI_OID+'109',
- 'osiWorkURL': OPENOSI_OID+'120',
- 'ou': X500ATTR_OID+'11',
- 'orgAffiliation': DIGG_OID+'1',
- 'owner': X500ATTR_OID+'32',
- 'pairwise-id': SAML_SUBJECT_ID+'pairwise-id',
- 'personalIdentityNumber': INERA_OID+'13',
- 'personalIdentityNumberBinding': DIGG_OID+'6',
- 'physicalDeliveryOfficeName': X500ATTR_OID+'19',
- 'placeOfBirth': PKIX_OID+'2',
- 'postOfficeBox': X500ATTR_OID+'18',
- 'postalAddress': X500ATTR_OID+'16',
- 'postalCode': X500ATTR_OID+'17',
- 'preferredDeliveryMethod': X500ATTR_OID+'28',
- 'preferredLanguage': NETSCAPE_LDAP+'39',
- 'presentationAddress': X500ATTR_OID+'29',
- 'prid': DIGG_OID+'4',
- 'pridPersistence': DIGG_OID+'5',
- 'protocolInformation': X500ATTR_OID+'48',
- 'pseudonym': X500ATTR_OID+'65',
- 'PVP-USERID': LDAPGVAT_UCL_DIR_PILOT+'1',
- 'PVP-MAIL': LDAPGVAT_UCL_DIR_PILOT+'3',
- 'PVP-GID': LDAPGVAT_OID+'1',
- 'PVP-BPK': LDAPGVAT_OID+'149',
- 'PVP-OU-OKZ': LDAPGVAT_OID+'153',
- 'PVP-VERSION': LDAPGVAT_OID+'261.10',
- 'PVP-PRINCIPAL-NAME': LDAPGVAT_OID+'261.20',
- 'PVP-PARTICIPANT-OKZ': LDAPGVAT_OID+'261.24',
- 'PVP-ROLES': LDAPGVAT_OID+'261.30',
- 'PVP-INVOICE-RECPT-ID': LDAPGVAT_OID+'261.40',
- 'PVP-COST-CENTER-ID': LDAPGVAT_OID+'261.50',
- 'PVP-CHARGE-CODE': LDAPGVAT_OID+'261.60',
- 'PVP-OU-GV-OU-ID': LDAPGVAT_OID+'3',
- 'PVP-FUNCTION': LDAPGVAT_OID+'33',
- 'PVP-BIRTHDATE': LDAPGVAT_OID+'55',
- 'PVP-PARTICIPANT-ID': LDAPGVAT_OID+'71',
- 'PVP-OU': LDAPGVAT_X500ATTR_OID+'11',
- 'PVP-TEL': LDAPGVAT_X500ATTR_OID+'20',
- 'PVP-GIVENNAME': LDAPGVAT_X500ATTR_OID+'42',
- 'registeredAddress': X500ATTR_OID+'26',
- 'roleOccupant': X500ATTR_OID+'33',
- 'sad': DIGG_OID+'12',
- 'schacCountryOfCitizenship': SCHAC+'5',
- 'schacCountryOfResidence': SCHAC+'11',
- 'schacDateOfBirth': SCHAC+'3',
- 'schacExpiryDate': SCHAC+'17',
- 'schacGender': SCHAC+'2',
- 'schacHomeOrganization': SCHAC+'9',
- 'schacHomeOrganizationType': SCHAC+'10',
- 'schacMotherTongue': SCHAC+'1',
- 'schacPersonalPosition': SCHAC+'13',
- 'schacPersonalTitle': SCHAC+'8',
- 'schacPersonalUniqueCode': SCHAC+'14',
- 'schacPersonalUniqueID': SCHAC+'15',
- 'schacPlaceOfBirth': SCHAC+'4',
- 'schacProjectMembership': SCHAC+'20',
- 'schacProjectSpecificRole': SCHAC+'21',
- 'schacSn1': SCHAC+'6',
- 'schacSn2': SCHAC+'7',
- 'schacUserPresenceID': SCHAC+'12',
- 'schacUserPrivateAttribute': SCHAC+'18',
- 'schacUserStatus': SCHAC+'19',
- 'searchGuide': X500ATTR_OID+'14',
- 'serialNumber': X500ATTR_OID+'5',
- 'signMessageDigest': DIGG_OID+'14',
- 'sisLegalGuardianFor': SIS+'1',
- 'sisSchoolGrade': SIS+'2',
- 'sn': X500ATTR_OID+'4',
- 'st': X500ATTR_OID+'8',
- 'street': X500ATTR_OID+'9',
- 'subject-id': SAML_SUBJECT_ID+'subject-id',
- 'supportedAlgorithms': X500ATTR_OID+'52',
- 'supportedApplicationContext': X500ATTR_OID+'30',
- 'telephoneNumber': X500ATTR_OID+'20',
- 'teletexTerminalIdentifier': X500ATTR_OID+'22',
- 'telexNumber': X500ATTR_OID+'21',
- 'title': X500ATTR_OID+'12',
- 'transactionIdentifier': DIGG_OID+'2',
- 'uid': UCL_DIR_PILOT+'1',
- 'uniqueMember': X500ATTR_OID+'50',
- 'userCertificate': X500ATTR_OID+'36',
+ "to": {
+ "LegalPersonIdentifier": EIDAS_LEGALPERSON + "LegalPersonIdentifier",
+ "LegalAddress": EIDAS_LEGALPERSON + "LegalPersonAddress",
+ "LegalName": EIDAS_LEGALPERSON + "LegalName",
+ "VATRegistration": EIDAS_LEGALPERSON + "VATRegistrationNumber",
+ "TaxReference": EIDAS_LEGALPERSON + "TaxReference",
+ "BusinessCodes": EIDAS_LEGALPERSON + "BusinessCodes",
+ "LEI": EIDAS_LEGALPERSON + "LEI",
+ "EORI": EIDAS_LEGALPERSON + "EORI",
+ "SEED": EIDAS_LEGALPERSON + "SEED",
+ "SIC": EIDAS_LEGALPERSON + "SIC",
+ "D-2012-17-EUIdentifier": EIDAS_LEGALPERSON + "D-2012-17-EUIdentifier",
+ "PersonIdentifier": EIDAS_NATURALPERSON + "PersonIdentifier",
+ "FamilyName": EIDAS_NATURALPERSON + "CurrentFamilyName",
+ "FirstName": EIDAS_NATURALPERSON + "CurrentGivenName",
+ "DateOfBirth": EIDAS_NATURALPERSON + "DateOfBirth",
+ "BirthName": EIDAS_NATURALPERSON + "BirthName",
+ "PlaceOfBirth": EIDAS_NATURALPERSON + "PlaceOfBirth",
+ "CurrentAddress": EIDAS_NATURALPERSON + "CurrentAddress",
+ "Gender": EIDAS_NATURALPERSON + "Gender",
+ "associatedDomain": UCL_DIR_PILOT + "37",
+ "authContextParams": DIGG_OID + "3",
+ "authorityRevocationList": X500ATTR_OID + "38",
+ "authServerSignature": DIGG_OID + "13",
+ "birthName": DIGG_OID + "8",
+ "businessCategory": X500ATTR_OID + "15",
+ "c": X500ATTR_OID + "6",
+ "cACertificate": X500ATTR_OID + "37",
+ "carLicense": NETSCAPE_LDAP + "1",
+ "certificateRevocationList": X500ATTR_OID + "39",
+ "cn": X500ATTR_OID + "3",
+ "co": UCL_DIR_PILOT + "43",
+ "countryOfCitizenship": PKIX_OID + "4",
+ "countryOfResidence": PKIX_OID + "5",
+ "crossCertificatePair": X500ATTR_OID + "40",
+ "dateOfBirth": PKIX_OID + "1",
+ "dc": UCL_DIR_PILOT + "25",
+ "deltaRevocationList": X500ATTR_OID + "53",
+ "departmentNumber": NETSCAPE_LDAP + "2",
+ "destinationIndicator": X500ATTR_OID + "27",
+ "displayName": NETSCAPE_LDAP + "241",
+ "dmdName": X500ATTR_OID + "54",
+ "dnQualifier": X500ATTR_OID + "46",
+ "EAAHash": UMBRELLA_EAAUser_ID + "1",
+ "EAAKey": UMBRELLA_EAAUser_ID + "3",
+ "eduCourseMember": EDUCOURSE_OID + "2",
+ "eduCourseOffering": EDUCOURSE_OID + "1",
+ "eduPersonAffiliation": EDUPERSON_OID + "1",
+ "eduPersonEntitlement": EDUPERSON_OID + "7",
+ "eduPersonNickname": EDUPERSON_OID + "2",
+ "eduPersonOrgDN": EDUPERSON_OID + "3",
+ "eduPersonOrgUnitDN": EDUPERSON_OID + "4",
+ "eduPersonPrimaryAffiliation": EDUPERSON_OID + "5",
+ "eduPersonPrimaryOrgUnitDN": EDUPERSON_OID + "8",
+ "eduPersonPrincipalName": EDUPERSON_OID + "6",
+ "eduPersonPrincipalNamePrior": EDUPERSON_OID + "12",
+ "eduPersonScopedAffiliation": EDUPERSON_OID + "9",
+ "eduPersonTargetedID": EDUPERSON_OID + "10",
+ "eduPersonAssurance": EDUPERSON_OID + "11",
+ "eduPersonUniqueId": EDUPERSON_OID + "13",
+ "eduPersonOrcid": EDUPERSON_OID + "16",
+ "eidasNaturalPersonAddress": DIGG_OID + "9",
+ "eidasPersonIdentifier": DIGG_OID + "7",
+ "email": PKCS_9 + "1",
+ "employeeHsaId": INERA_OID + "1",
+ "employeeNumber": NETSCAPE_LDAP + "3",
+ "employeeType": NETSCAPE_LDAP + "4",
+ "enhancedSearchGuide": X500ATTR_OID + "47",
+ "facsimileTelephoneNumber": X500ATTR_OID + "23",
+ "federationFeideSchemaVersion": NOREDUPERSON_OID + "9",
+ "gender": PKIX_OID + "3",
+ "generationQualifier": X500ATTR_OID + "44",
+ "givenName": X500ATTR_OID + "42",
+ "houseIdentifier": X500ATTR_OID + "51",
+ "initials": X500ATTR_OID + "43",
+ "internationaliSDNNumber": X500ATTR_OID + "25",
+ "isMemberOf": EDUMEMBER1_OID + "1",
+ "jpegPhoto": UCL_DIR_PILOT + "60",
+ "knowledgeInformation": X500ATTR_OID + "2",
+ "l": X500ATTR_OID + "7",
+ "labeledURI": UMICH + "57",
+ "mail": UCL_DIR_PILOT + "3",
+ "member": X500ATTR_OID + "31",
+ "norEduOrgAcronym": NOREDUPERSON_OID + "6",
+ "norEduOrgNIN": NOREDUPERSON_OID + "12",
+ "norEduOrgSchemaVersion": NOREDUPERSON_OID + "11",
+ "norEduOrgUniqueIdentifier": NOREDUPERSON_OID + "7",
+ "norEduOrgUniqueNumber": NOREDUPERSON_OID + "1",
+ "norEduOrgUnitUniqueIdentifier": NOREDUPERSON_OID + "8",
+ "norEduOrgUnitUniqueNumber": NOREDUPERSON_OID + "2",
+ "norEduPersonBirthDate": NOREDUPERSON_OID + "3",
+ "norEduPersonLIN": NOREDUPERSON_OID + "4",
+ "norEduPersonLegalName": NOREDUPERSON_OID + "10",
+ "norEduPersonNIN": NOREDUPERSON_OID + "5",
+ "o": X500ATTR_OID + "10",
+ "osiHomeUrl": OPENOSI_OID + "17",
+ "osiPreferredTZ": OPENOSI_OID + "19",
+ "osiICardTimeLastUpdated": OPENOSI_OID + "72",
+ "osiMiddleName": OPENOSI_OID + "104",
+ "osiOtherEmail": OPENOSI_OID + "107",
+ "osiOtherHomePhone": OPENOSI_OID + "109",
+ "osiWorkURL": OPENOSI_OID + "120",
+ "ou": X500ATTR_OID + "11",
+ "orgAffiliation": DIGG_OID + "1",
+ "owner": X500ATTR_OID + "32",
+ "pairwise-id": SAML_SUBJECT_ID + "pairwise-id",
+ "personalIdentityNumber": INERA_OID + "13",
+ "personalIdentityNumberBinding": DIGG_OID + "6",
+ "physicalDeliveryOfficeName": X500ATTR_OID + "19",
+ "placeOfBirth": PKIX_OID + "2",
+ "postOfficeBox": X500ATTR_OID + "18",
+ "postalAddress": X500ATTR_OID + "16",
+ "postalCode": X500ATTR_OID + "17",
+ "preferredDeliveryMethod": X500ATTR_OID + "28",
+ "preferredLanguage": NETSCAPE_LDAP + "39",
+ "presentationAddress": X500ATTR_OID + "29",
+ "prid": DIGG_OID + "4",
+ "pridPersistence": DIGG_OID + "5",
+ "protocolInformation": X500ATTR_OID + "48",
+ "pseudonym": X500ATTR_OID + "65",
+ "PVP-USERID": LDAPGVAT_UCL_DIR_PILOT + "1",
+ "PVP-MAIL": LDAPGVAT_UCL_DIR_PILOT + "3",
+ "PVP-GID": LDAPGVAT_OID + "1",
+ "PVP-BPK": LDAPGVAT_OID + "149",
+ "PVP-OU-OKZ": LDAPGVAT_OID + "153",
+ "PVP-VERSION": LDAPGVAT_OID + "261.10",
+ "PVP-PRINCIPAL-NAME": LDAPGVAT_OID + "261.20",
+ "PVP-PARTICIPANT-OKZ": LDAPGVAT_OID + "261.24",
+ "PVP-ROLES": LDAPGVAT_OID + "261.30",
+ "PVP-INVOICE-RECPT-ID": LDAPGVAT_OID + "261.40",
+ "PVP-COST-CENTER-ID": LDAPGVAT_OID + "261.50",
+ "PVP-CHARGE-CODE": LDAPGVAT_OID + "261.60",
+ "PVP-OU-GV-OU-ID": LDAPGVAT_OID + "3",
+ "PVP-FUNCTION": LDAPGVAT_OID + "33",
+ "PVP-BIRTHDATE": LDAPGVAT_OID + "55",
+ "PVP-PARTICIPANT-ID": LDAPGVAT_OID + "71",
+ "PVP-OU": LDAPGVAT_X500ATTR_OID + "11",
+ "PVP-TEL": LDAPGVAT_X500ATTR_OID + "20",
+ "PVP-GIVENNAME": LDAPGVAT_X500ATTR_OID + "42",
+ "registeredAddress": X500ATTR_OID + "26",
+ "roleOccupant": X500ATTR_OID + "33",
+ "sad": DIGG_OID + "12",
+ "schacCountryOfCitizenship": SCHAC + "5",
+ "schacCountryOfResidence": SCHAC + "11",
+ "schacDateOfBirth": SCHAC + "3",
+ "schacExpiryDate": SCHAC + "17",
+ "schacGender": SCHAC + "2",
+ "schacHomeOrganization": SCHAC + "9",
+ "schacHomeOrganizationType": SCHAC + "10",
+ "schacMotherTongue": SCHAC + "1",
+ "schacPersonalPosition": SCHAC + "13",
+ "schacPersonalTitle": SCHAC + "8",
+ "schacPersonalUniqueCode": SCHAC + "14",
+ "schacPersonalUniqueID": SCHAC + "15",
+ "schacPlaceOfBirth": SCHAC + "4",
+ "schacProjectMembership": SCHAC + "20",
+ "schacProjectSpecificRole": SCHAC + "21",
+ "schacSn1": SCHAC + "6",
+ "schacSn2": SCHAC + "7",
+ "schacUserPresenceID": SCHAC + "12",
+ "schacUserPrivateAttribute": SCHAC + "18",
+ "schacUserStatus": SCHAC + "19",
+ "searchGuide": X500ATTR_OID + "14",
+ "serialNumber": X500ATTR_OID + "5",
+ "signMessageDigest": DIGG_OID + "14",
+ "sisLegalGuardianFor": SIS + "1",
+ "sisSchoolGrade": SIS + "2",
+ "sn": X500ATTR_OID + "4",
+ "st": X500ATTR_OID + "8",
+ "street": X500ATTR_OID + "9",
+ "subject-id": SAML_SUBJECT_ID + "subject-id",
+ "supportedAlgorithms": X500ATTR_OID + "52",
+ "supportedApplicationContext": X500ATTR_OID + "30",
+ "telephoneNumber": X500ATTR_OID + "20",
+ "teletexTerminalIdentifier": X500ATTR_OID + "22",
+ "telexNumber": X500ATTR_OID + "21",
+ "title": X500ATTR_OID + "12",
+ "transactionIdentifier": DIGG_OID + "2",
+ "uid": UCL_DIR_PILOT + "1",
+ "uniqueMember": X500ATTR_OID + "50",
+ "userCertificate": X500ATTR_OID + "36",
# 'userCertificate': DIGG_OID+'10',
- 'userPKCS12': NETSCAPE_LDAP+'216',
- 'userSMIMECertificate': NETSCAPE_LDAP+'40',
- 'userSignature': DIGG_OID+'11',
- 'x121Address': X500ATTR_OID+'24',
- 'x500UniqueIdentifier': X500ATTR_OID+'45',
- 'swissEduPersonUniqueID': SWISSEDUPERSON_OID+'1',
- 'swissEduPersonDateOfBirth': SWISSEDUPERSON_OID+'2',
- 'swissEduPersonGender': SWISSEDUPERSON_OID+'3',
- 'swissEduPersonHomeOrganization': SWISSEDUPERSON_OID+'4',
- 'swissEduPersonHomeOrganizationType': SWISSEDUPERSON_OID+'5',
- 'swissEduPersonStudyBranch1': SWISSEDUPERSON_OID+'6',
- 'swissEduPersonStudyBranch2': SWISSEDUPERSON_OID+'7',
- 'swissEduPersonStudyBranch3': SWISSEDUPERSON_OID+'8',
- 'swissEduPersonStudyLevel': SWISSEDUPERSON_OID+'9',
- 'swissEduPersonStaffCategory': SWISSEDUPERSON_OID+'10',
- 'swissEduPersonMatriculationNumber': SWISSEDUPERSON_OID+'11',
- 'swissEduPersonCardUID': SWISSEDUPERSON_OID+'12',
- 'swissEduID': SWISSEDUPERSON_OID+'13',
- 'swissLibraryPersonAffiliation': SWISSEDUPERSON_OID+'1023',
- 'swissLibraryPersonResidence': SWISSEDUPERSON_OID+'1025',
- 'voPersonAffiliation': VOPERSON_V2_OID+'10',
- 'voPersonApplicationPassword': VOPERSON_V2_OID+'13',
- 'voPersonApplicationUID': VOPERSON_V2_OID+'1',
- 'voPersonAuthorName': VOPERSON_V2_OID+'2',
- 'voPersonCertificateDN': VOPERSON_V2_OID+'3',
- 'voPersonCertificateIssuerDN': VOPERSON_V2_OID+'4',
- 'voPersonExternalAffiliation': VOPERSON_V2_OID+'11',
- 'voPersonExternalID': VOPERSON_V2_OID+'5',
- 'voPersonID': VOPERSON_V2_OID+'6',
- 'voPersonPolicyAgreement': VOPERSON_V2_OID+'7',
- 'voPersonScopedAffiliation': VOPERSON_V2_OID+'12',
- 'voPersonSoRID': VOPERSON_V2_OID+'8',
- 'voPersonStatus': VOPERSON_V2_OID+'9',
- 'voPersonToken': VOPERSON_V2_OID+'15',
- 'voPersonVerifiedEmail': VOPERSON_V2_OID+'14',
- }
+ "userPKCS12": NETSCAPE_LDAP + "216",
+ "userSMIMECertificate": NETSCAPE_LDAP + "40",
+ "userSignature": DIGG_OID + "11",
+ "x121Address": X500ATTR_OID + "24",
+ "x500UniqueIdentifier": X500ATTR_OID + "45",
+ "swissEduPersonUniqueID": SWISSEDUPERSON_OID + "1",
+ "swissEduPersonDateOfBirth": SWISSEDUPERSON_OID + "2",
+ "swissEduPersonGender": SWISSEDUPERSON_OID + "3",
+ "swissEduPersonHomeOrganization": SWISSEDUPERSON_OID + "4",
+ "swissEduPersonHomeOrganizationType": SWISSEDUPERSON_OID + "5",
+ "swissEduPersonStudyBranch1": SWISSEDUPERSON_OID + "6",
+ "swissEduPersonStudyBranch2": SWISSEDUPERSON_OID + "7",
+ "swissEduPersonStudyBranch3": SWISSEDUPERSON_OID + "8",
+ "swissEduPersonStudyLevel": SWISSEDUPERSON_OID + "9",
+ "swissEduPersonStaffCategory": SWISSEDUPERSON_OID + "10",
+ "swissEduPersonMatriculationNumber": SWISSEDUPERSON_OID + "11",
+ "swissEduPersonCardUID": SWISSEDUPERSON_OID + "12",
+ "swissEduID": SWISSEDUPERSON_OID + "13",
+ "swissLibraryPersonAffiliation": SWISSEDUPERSON_OID + "1023",
+ "swissLibraryPersonResidence": SWISSEDUPERSON_OID + "1025",
+ "voPersonAffiliation": VOPERSON_V2_OID + "10",
+ "voPersonApplicationPassword": VOPERSON_V2_OID + "13",
+ "voPersonApplicationUID": VOPERSON_V2_OID + "1",
+ "voPersonAuthorName": VOPERSON_V2_OID + "2",
+ "voPersonCertificateDN": VOPERSON_V2_OID + "3",
+ "voPersonCertificateIssuerDN": VOPERSON_V2_OID + "4",
+ "voPersonExternalAffiliation": VOPERSON_V2_OID + "11",
+ "voPersonExternalID": VOPERSON_V2_OID + "5",
+ "voPersonID": VOPERSON_V2_OID + "6",
+ "voPersonPolicyAgreement": VOPERSON_V2_OID + "7",
+ "voPersonScopedAffiliation": VOPERSON_V2_OID + "12",
+ "voPersonSoRID": VOPERSON_V2_OID + "8",
+ "voPersonStatus": VOPERSON_V2_OID + "9",
+ "voPersonToken": VOPERSON_V2_OID + "15",
+ "voPersonVerifiedEmail": VOPERSON_V2_OID + "14",
+ },
}
diff --git a/src/saml2/attributemaps/shibboleth_uri.py b/src/saml2/attributemaps/shibboleth_uri.py
index 54de4735..6de6b276 100644
--- a/src/saml2/attributemaps/shibboleth_uri.py
+++ b/src/saml2/attributemaps/shibboleth_uri.py
@@ -1,197 +1,197 @@
-EDUPERSON_OID = 'urn:oid:1.3.6.1.4.1.5923.1.1.1.'
-NETSCAPE_LDAP = 'urn:oid:2.16.840.1.113730.3.1.'
-NOREDUPERSON_OID = 'urn:oid:1.3.6.1.4.1.2428.90.1.'
-PKCS_9 = 'urn:oid:1.2.840.113549.1.9.'
-UCL_DIR_PILOT = 'urn:oid:0.9.2342.19200300.100.1.'
-UMICH = 'urn:oid:1.3.6.1.4.1.250.1.57.'
-X500ATTR = 'urn:oid:2.5.4.'
+EDUPERSON_OID = "urn:oid:1.3.6.1.4.1.5923.1.1.1."
+NETSCAPE_LDAP = "urn:oid:2.16.840.1.113730.3.1."
+NOREDUPERSON_OID = "urn:oid:1.3.6.1.4.1.2428.90.1."
+PKCS_9 = "urn:oid:1.2.840.113549.1.9."
+UCL_DIR_PILOT = "urn:oid:0.9.2342.19200300.100.1."
+UMICH = "urn:oid:1.3.6.1.4.1.250.1.57."
+X500ATTR = "urn:oid:2.5.4."
MAP = {
"identifier": "urn:mace:shibboleth:1.0:attributeNamespace:uri",
- 'fro': {
- EDUPERSON_OID+'1': 'eduPersonAffiliation',
- EDUPERSON_OID+'2': 'eduPersonNickname',
- EDUPERSON_OID+'3': 'eduPersonOrgDN',
- EDUPERSON_OID+'4': 'eduPersonOrgUnitDN',
- EDUPERSON_OID+'5': 'eduPersonPrimaryAffiliation',
- EDUPERSON_OID+'6': 'eduPersonPrincipalName',
- EDUPERSON_OID+'7': 'eduPersonEntitlement',
- EDUPERSON_OID+'8': 'eduPersonPrimaryOrgUnitDN',
- EDUPERSON_OID+'9': 'eduPersonScopedAffiliation',
- EDUPERSON_OID+'10': 'eduPersonTargetedID',
- EDUPERSON_OID+'11': 'eduPersonAssurance',
- EDUPERSON_OID+'12': 'eduPersonPrincipalNamePrior',
- EDUPERSON_OID+'13': 'eduPersonUniqueId',
- EDUPERSON_OID+'16': 'eduPersonOrcid',
- NETSCAPE_LDAP+'1': 'carLicense',
- NETSCAPE_LDAP+'2': 'departmentNumber',
- NETSCAPE_LDAP+'3': 'employeeNumber',
- NETSCAPE_LDAP+'4': 'employeeType',
- NETSCAPE_LDAP+'39': 'preferredLanguage',
- NETSCAPE_LDAP+'40': 'userSMIMECertificate',
- NETSCAPE_LDAP+'216': 'userPKCS12',
- NETSCAPE_LDAP+'241': 'displayName',
- NOREDUPERSON_OID+'1': 'norEduOrgUniqueNumber',
- NOREDUPERSON_OID+'2': 'norEduOrgUnitUniqueNumber',
- NOREDUPERSON_OID+'3': 'norEduPersonBirthDate',
- NOREDUPERSON_OID+'4': 'norEduPersonLIN',
- NOREDUPERSON_OID+'5': 'norEduPersonNIN',
- NOREDUPERSON_OID+'6': 'norEduOrgAcronym',
- NOREDUPERSON_OID+'7': 'norEduOrgUniqueIdentifier',
- NOREDUPERSON_OID+'8': 'norEduOrgUnitUniqueIdentifier',
- NOREDUPERSON_OID+'9': 'federationFeideSchemaVersion',
- PKCS_9+'1': 'email',
- UCL_DIR_PILOT+'3': 'mail',
- UCL_DIR_PILOT+'25': 'dc',
- UCL_DIR_PILOT+'37': 'associatedDomain',
- UCL_DIR_PILOT+'60': 'jpegPhoto',
- X500ATTR+'2': 'knowledgeInformation',
- X500ATTR+'4': 'sn',
- X500ATTR+'5': 'serialNumber',
- X500ATTR+'6': 'c',
- X500ATTR+'7': 'l',
- X500ATTR+'8': 'st',
- X500ATTR+'9': 'street',
- X500ATTR+'10': 'o',
- X500ATTR+'11': 'ou',
- X500ATTR+'12': 'title',
- X500ATTR+'14': 'searchGuide',
- X500ATTR+'15': 'businessCategory',
- X500ATTR+'16': 'postalAddress',
- X500ATTR+'17': 'postalCode',
- X500ATTR+'18': 'postOfficeBox',
- X500ATTR+'19': 'physicalDeliveryOfficeName',
- X500ATTR+'20': 'telephoneNumber',
- X500ATTR+'21': 'telexNumber',
- X500ATTR+'22': 'teletexTerminalIdentifier',
- X500ATTR+'23': 'facsimileTelephoneNumber',
- X500ATTR+'24': 'x121Address',
- X500ATTR+'25': 'internationaliSDNNumber',
- X500ATTR+'26': 'registeredAddress',
- X500ATTR+'27': 'destinationIndicator',
- X500ATTR+'28': 'preferredDeliveryMethod',
- X500ATTR+'29': 'presentationAddress',
- X500ATTR+'30': 'supportedApplicationContext',
- X500ATTR+'31': 'member',
- X500ATTR+'32': 'owner',
- X500ATTR+'33': 'roleOccupant',
- X500ATTR+'36': 'userCertificate',
- X500ATTR+'37': 'cACertificate',
- X500ATTR+'38': 'authorityRevocationList',
- X500ATTR+'39': 'certificateRevocationList',
- X500ATTR+'40': 'crossCertificatePair',
- X500ATTR+'42': 'givenName',
- X500ATTR+'43': 'initials',
- X500ATTR+'44': 'generationQualifier',
- X500ATTR+'45': 'x500UniqueIdentifier',
- X500ATTR+'46': 'dnQualifier',
- X500ATTR+'47': 'enhancedSearchGuide',
- X500ATTR+'48': 'protocolInformation',
- X500ATTR+'50': 'uniqueMember',
- X500ATTR+'51': 'houseIdentifier',
- X500ATTR+'52': 'supportedAlgorithms',
- X500ATTR+'53': 'deltaRevocationList',
- X500ATTR+'54': 'dmdName',
- X500ATTR+'65': 'pseudonym',
+ "fro": {
+ EDUPERSON_OID + "1": "eduPersonAffiliation",
+ EDUPERSON_OID + "2": "eduPersonNickname",
+ EDUPERSON_OID + "3": "eduPersonOrgDN",
+ EDUPERSON_OID + "4": "eduPersonOrgUnitDN",
+ EDUPERSON_OID + "5": "eduPersonPrimaryAffiliation",
+ EDUPERSON_OID + "6": "eduPersonPrincipalName",
+ EDUPERSON_OID + "7": "eduPersonEntitlement",
+ EDUPERSON_OID + "8": "eduPersonPrimaryOrgUnitDN",
+ EDUPERSON_OID + "9": "eduPersonScopedAffiliation",
+ EDUPERSON_OID + "10": "eduPersonTargetedID",
+ EDUPERSON_OID + "11": "eduPersonAssurance",
+ EDUPERSON_OID + "12": "eduPersonPrincipalNamePrior",
+ EDUPERSON_OID + "13": "eduPersonUniqueId",
+ EDUPERSON_OID + "16": "eduPersonOrcid",
+ NETSCAPE_LDAP + "1": "carLicense",
+ NETSCAPE_LDAP + "2": "departmentNumber",
+ NETSCAPE_LDAP + "3": "employeeNumber",
+ NETSCAPE_LDAP + "4": "employeeType",
+ NETSCAPE_LDAP + "39": "preferredLanguage",
+ NETSCAPE_LDAP + "40": "userSMIMECertificate",
+ NETSCAPE_LDAP + "216": "userPKCS12",
+ NETSCAPE_LDAP + "241": "displayName",
+ NOREDUPERSON_OID + "1": "norEduOrgUniqueNumber",
+ NOREDUPERSON_OID + "2": "norEduOrgUnitUniqueNumber",
+ NOREDUPERSON_OID + "3": "norEduPersonBirthDate",
+ NOREDUPERSON_OID + "4": "norEduPersonLIN",
+ NOREDUPERSON_OID + "5": "norEduPersonNIN",
+ NOREDUPERSON_OID + "6": "norEduOrgAcronym",
+ NOREDUPERSON_OID + "7": "norEduOrgUniqueIdentifier",
+ NOREDUPERSON_OID + "8": "norEduOrgUnitUniqueIdentifier",
+ NOREDUPERSON_OID + "9": "federationFeideSchemaVersion",
+ PKCS_9 + "1": "email",
+ UCL_DIR_PILOT + "3": "mail",
+ UCL_DIR_PILOT + "25": "dc",
+ UCL_DIR_PILOT + "37": "associatedDomain",
+ UCL_DIR_PILOT + "60": "jpegPhoto",
+ X500ATTR + "2": "knowledgeInformation",
+ X500ATTR + "4": "sn",
+ X500ATTR + "5": "serialNumber",
+ X500ATTR + "6": "c",
+ X500ATTR + "7": "l",
+ X500ATTR + "8": "st",
+ X500ATTR + "9": "street",
+ X500ATTR + "10": "o",
+ X500ATTR + "11": "ou",
+ X500ATTR + "12": "title",
+ X500ATTR + "14": "searchGuide",
+ X500ATTR + "15": "businessCategory",
+ X500ATTR + "16": "postalAddress",
+ X500ATTR + "17": "postalCode",
+ X500ATTR + "18": "postOfficeBox",
+ X500ATTR + "19": "physicalDeliveryOfficeName",
+ X500ATTR + "20": "telephoneNumber",
+ X500ATTR + "21": "telexNumber",
+ X500ATTR + "22": "teletexTerminalIdentifier",
+ X500ATTR + "23": "facsimileTelephoneNumber",
+ X500ATTR + "24": "x121Address",
+ X500ATTR + "25": "internationaliSDNNumber",
+ X500ATTR + "26": "registeredAddress",
+ X500ATTR + "27": "destinationIndicator",
+ X500ATTR + "28": "preferredDeliveryMethod",
+ X500ATTR + "29": "presentationAddress",
+ X500ATTR + "30": "supportedApplicationContext",
+ X500ATTR + "31": "member",
+ X500ATTR + "32": "owner",
+ X500ATTR + "33": "roleOccupant",
+ X500ATTR + "36": "userCertificate",
+ X500ATTR + "37": "cACertificate",
+ X500ATTR + "38": "authorityRevocationList",
+ X500ATTR + "39": "certificateRevocationList",
+ X500ATTR + "40": "crossCertificatePair",
+ X500ATTR + "42": "givenName",
+ X500ATTR + "43": "initials",
+ X500ATTR + "44": "generationQualifier",
+ X500ATTR + "45": "x500UniqueIdentifier",
+ X500ATTR + "46": "dnQualifier",
+ X500ATTR + "47": "enhancedSearchGuide",
+ X500ATTR + "48": "protocolInformation",
+ X500ATTR + "50": "uniqueMember",
+ X500ATTR + "51": "houseIdentifier",
+ X500ATTR + "52": "supportedAlgorithms",
+ X500ATTR + "53": "deltaRevocationList",
+ X500ATTR + "54": "dmdName",
+ X500ATTR + "65": "pseudonym",
+ },
+ "to": {
+ "associatedDomain": UCL_DIR_PILOT + "37",
+ "authorityRevocationList": X500ATTR + "38",
+ "businessCategory": X500ATTR + "15",
+ "c": X500ATTR + "6",
+ "cACertificate": X500ATTR + "37",
+ "carLicense": NETSCAPE_LDAP + "1",
+ "certificateRevocationList": X500ATTR + "39",
+ "countryName": X500ATTR + "6",
+ "crossCertificatePair": X500ATTR + "40",
+ "dc": UCL_DIR_PILOT + "25",
+ "deltaRevocationList": X500ATTR + "53",
+ "departmentNumber": NETSCAPE_LDAP + "2",
+ "destinationIndicator": X500ATTR + "27",
+ "displayName": NETSCAPE_LDAP + "241",
+ "dmdName": X500ATTR + "54",
+ "dnQualifier": X500ATTR + "46",
+ "domainComponent": UCL_DIR_PILOT + "25",
+ "eduPersonAffiliation": EDUPERSON_OID + "1",
+ "eduPersonEntitlement": EDUPERSON_OID + "7",
+ "eduPersonNickname": EDUPERSON_OID + "2",
+ "eduPersonOrgDN": EDUPERSON_OID + "3",
+ "eduPersonOrgUnitDN": EDUPERSON_OID + "4",
+ "eduPersonPrimaryAffiliation": EDUPERSON_OID + "5",
+ "eduPersonPrimaryOrgUnitDN": EDUPERSON_OID + "8",
+ "eduPersonPrincipalName": EDUPERSON_OID + "6",
+ "eduPersonPrincipalNamePrior": EDUPERSON_OID + "12",
+ "eduPersonScopedAffiliation": EDUPERSON_OID + "9",
+ "eduPersonTargetedID": EDUPERSON_OID + "10",
+ "eduPersonAssurance": EDUPERSON_OID + "11",
+ "eduPersonUniqueId": EDUPERSON_OID + "13",
+ "eduPersonOrcid": EDUPERSON_OID + "16",
+ "email": PKCS_9 + "1",
+ "emailAddress": PKCS_9 + "1",
+ "employeeNumber": NETSCAPE_LDAP + "3",
+ "employeeType": NETSCAPE_LDAP + "4",
+ "enhancedSearchGuide": X500ATTR + "47",
+ "facsimileTelephoneNumber": X500ATTR + "23",
+ "fax": X500ATTR + "23",
+ "federationFeideSchemaVersion": NOREDUPERSON_OID + "9",
+ "generationQualifier": X500ATTR + "44",
+ "givenName": X500ATTR + "42",
+ "gn": X500ATTR + "42",
+ "houseIdentifier": X500ATTR + "51",
+ "initials": X500ATTR + "43",
+ "internationaliSDNNumber": X500ATTR + "25",
+ "jpegPhoto": UCL_DIR_PILOT + "60",
+ "knowledgeInformation": X500ATTR + "2",
+ "l": X500ATTR + "7",
+ "localityName": X500ATTR + "7",
+ "mail": UCL_DIR_PILOT + "3",
+ "member": X500ATTR + "31",
+ "norEduOrgAcronym": NOREDUPERSON_OID + "6",
+ "norEduOrgUniqueIdentifier": NOREDUPERSON_OID + "7",
+ "norEduOrgUniqueNumber": NOREDUPERSON_OID + "1",
+ "norEduOrgUnitUniqueIdentifier": NOREDUPERSON_OID + "8",
+ "norEduOrgUnitUniqueNumber": NOREDUPERSON_OID + "2",
+ "norEduPersonBirthDate": NOREDUPERSON_OID + "3",
+ "norEduPersonLIN": NOREDUPERSON_OID + "4",
+ "norEduPersonNIN": NOREDUPERSON_OID + "5",
+ "o": X500ATTR + "10",
+ "organizationName": X500ATTR + "10",
+ "organizationalUnitName": X500ATTR + "11",
+ "ou": X500ATTR + "11",
+ "owner": X500ATTR + "32",
+ "physicalDeliveryOfficeName": X500ATTR + "19",
+ "pkcs9email": PKCS_9 + "1",
+ "postOfficeBox": X500ATTR + "18",
+ "postalAddress": X500ATTR + "16",
+ "postalCode": X500ATTR + "17",
+ "preferredDeliveryMethod": X500ATTR + "28",
+ "preferredLanguage": NETSCAPE_LDAP + "39",
+ "presentationAddress": X500ATTR + "29",
+ "protocolInformation": X500ATTR + "48",
+ "pseudonym": X500ATTR + "65",
+ "registeredAddress": X500ATTR + "26",
+ "rfc822Mailbox": UCL_DIR_PILOT + "3",
+ "roleOccupant": X500ATTR + "33",
+ "searchGuide": X500ATTR + "14",
+ "serialNumber": X500ATTR + "5",
+ "sn": X500ATTR + "4",
+ "st": X500ATTR + "8",
+ "stateOrProvinceName": X500ATTR + "8",
+ "street": X500ATTR + "9",
+ "streetAddress": X500ATTR + "9",
+ "supportedAlgorithms": X500ATTR + "52",
+ "supportedApplicationContext": X500ATTR + "30",
+ "surname": X500ATTR + "4",
+ "telephoneNumber": X500ATTR + "20",
+ "teletexTerminalIdentifier": X500ATTR + "22",
+ "telexNumber": X500ATTR + "21",
+ "title": X500ATTR + "12",
+ "uniqueMember": X500ATTR + "50",
+ "userCertificate": X500ATTR + "36",
+ "userPKCS12": NETSCAPE_LDAP + "216",
+ "userSMIMECertificate": NETSCAPE_LDAP + "40",
+ "x121Address": X500ATTR + "24",
+ "x500UniqueIdentifier": X500ATTR + "45",
},
- 'to': {
- 'associatedDomain': UCL_DIR_PILOT+'37',
- 'authorityRevocationList': X500ATTR+'38',
- 'businessCategory': X500ATTR+'15',
- 'c': X500ATTR+'6',
- 'cACertificate': X500ATTR+'37',
- 'carLicense': NETSCAPE_LDAP+'1',
- 'certificateRevocationList': X500ATTR+'39',
- 'countryName': X500ATTR+'6',
- 'crossCertificatePair': X500ATTR+'40',
- 'dc': UCL_DIR_PILOT+'25',
- 'deltaRevocationList': X500ATTR+'53',
- 'departmentNumber': NETSCAPE_LDAP+'2',
- 'destinationIndicator': X500ATTR+'27',
- 'displayName': NETSCAPE_LDAP+'241',
- 'dmdName': X500ATTR+'54',
- 'dnQualifier': X500ATTR+'46',
- 'domainComponent': UCL_DIR_PILOT+'25',
- 'eduPersonAffiliation': EDUPERSON_OID+'1',
- 'eduPersonEntitlement': EDUPERSON_OID+'7',
- 'eduPersonNickname': EDUPERSON_OID+'2',
- 'eduPersonOrgDN': EDUPERSON_OID+'3',
- 'eduPersonOrgUnitDN': EDUPERSON_OID+'4',
- 'eduPersonPrimaryAffiliation': EDUPERSON_OID+'5',
- 'eduPersonPrimaryOrgUnitDN': EDUPERSON_OID+'8',
- 'eduPersonPrincipalName': EDUPERSON_OID+'6',
- 'eduPersonPrincipalNamePrior': EDUPERSON_OID+'12',
- 'eduPersonScopedAffiliation': EDUPERSON_OID+'9',
- 'eduPersonTargetedID': EDUPERSON_OID+'10',
- 'eduPersonAssurance': EDUPERSON_OID+'11',
- 'eduPersonUniqueId': EDUPERSON_OID+'13',
- 'eduPersonOrcid': EDUPERSON_OID+'16',
- 'email': PKCS_9+'1',
- 'emailAddress': PKCS_9+'1',
- 'employeeNumber': NETSCAPE_LDAP+'3',
- 'employeeType': NETSCAPE_LDAP+'4',
- 'enhancedSearchGuide': X500ATTR+'47',
- 'facsimileTelephoneNumber': X500ATTR+'23',
- 'fax': X500ATTR+'23',
- 'federationFeideSchemaVersion': NOREDUPERSON_OID+'9',
- 'generationQualifier': X500ATTR+'44',
- 'givenName': X500ATTR+'42',
- 'gn': X500ATTR+'42',
- 'houseIdentifier': X500ATTR+'51',
- 'initials': X500ATTR+'43',
- 'internationaliSDNNumber': X500ATTR+'25',
- 'jpegPhoto': UCL_DIR_PILOT+'60',
- 'knowledgeInformation': X500ATTR+'2',
- 'l': X500ATTR+'7',
- 'localityName': X500ATTR+'7',
- 'mail': UCL_DIR_PILOT+'3',
- 'member': X500ATTR+'31',
- 'norEduOrgAcronym': NOREDUPERSON_OID+'6',
- 'norEduOrgUniqueIdentifier': NOREDUPERSON_OID+'7',
- 'norEduOrgUniqueNumber': NOREDUPERSON_OID+'1',
- 'norEduOrgUnitUniqueIdentifier': NOREDUPERSON_OID+'8',
- 'norEduOrgUnitUniqueNumber': NOREDUPERSON_OID+'2',
- 'norEduPersonBirthDate': NOREDUPERSON_OID+'3',
- 'norEduPersonLIN': NOREDUPERSON_OID+'4',
- 'norEduPersonNIN': NOREDUPERSON_OID+'5',
- 'o': X500ATTR+'10',
- 'organizationName': X500ATTR+'10',
- 'organizationalUnitName': X500ATTR+'11',
- 'ou': X500ATTR+'11',
- 'owner': X500ATTR+'32',
- 'physicalDeliveryOfficeName': X500ATTR+'19',
- 'pkcs9email': PKCS_9+'1',
- 'postOfficeBox': X500ATTR+'18',
- 'postalAddress': X500ATTR+'16',
- 'postalCode': X500ATTR+'17',
- 'preferredDeliveryMethod': X500ATTR+'28',
- 'preferredLanguage': NETSCAPE_LDAP+'39',
- 'presentationAddress': X500ATTR+'29',
- 'protocolInformation': X500ATTR+'48',
- 'pseudonym': X500ATTR+'65',
- 'registeredAddress': X500ATTR+'26',
- 'rfc822Mailbox': UCL_DIR_PILOT+'3',
- 'roleOccupant': X500ATTR+'33',
- 'searchGuide': X500ATTR+'14',
- 'serialNumber': X500ATTR+'5',
- 'sn': X500ATTR+'4',
- 'st': X500ATTR+'8',
- 'stateOrProvinceName': X500ATTR+'8',
- 'street': X500ATTR+'9',
- 'streetAddress': X500ATTR+'9',
- 'supportedAlgorithms': X500ATTR+'52',
- 'supportedApplicationContext': X500ATTR+'30',
- 'surname': X500ATTR+'4',
- 'telephoneNumber': X500ATTR+'20',
- 'teletexTerminalIdentifier': X500ATTR+'22',
- 'telexNumber': X500ATTR+'21',
- 'title': X500ATTR+'12',
- 'uniqueMember': X500ATTR+'50',
- 'userCertificate': X500ATTR+'36',
- 'userPKCS12': NETSCAPE_LDAP+'216',
- 'userSMIMECertificate': NETSCAPE_LDAP+'40',
- 'x121Address': X500ATTR+'24',
- 'x500UniqueIdentifier': X500ATTR+'45',
- }
}
diff --git a/src/saml2/authn.py b/src/saml2/authn.py
index 480d8996..e476d89b 100644
--- a/src/saml2/authn.py
+++ b/src/saml2/authn.py
@@ -1,17 +1,21 @@
import logging
-import six
import time
+
+import six
+from six.moves.urllib.parse import parse_qs
+from six.moves.urllib.parse import urlencode
+from six.moves.urllib.parse import urlsplit
+
from saml2 import SAMLError
import saml2.cryptography.symmetric
-from saml2.httputil import Response
-from saml2.httputil import make_cookie
from saml2.httputil import Redirect
+from saml2.httputil import Response
from saml2.httputil import Unauthorized
+from saml2.httputil import make_cookie
from saml2.httputil import parse_cookie
-from six.moves.urllib.parse import urlencode, parse_qs, urlsplit
-__author__ = 'rolandh'
+__author__ = "rolandh"
logger = logging.getLogger(__name__)
@@ -103,6 +107,7 @@ def create_return_url(base, query, **kwargs):
class UsernamePasswordMako(UserAuthnMethod):
"""Do user authentication using the normal username password form
using Mako as template system"""
+
cookie_name = "userpassmako"
def __init__(self, srv, mako_template, template_lookup, pwd, return_to):
@@ -122,8 +127,7 @@ class UsernamePasswordMako(UserAuthnMethod):
self.query_param = "upm_answer"
self.symmetric = saml2.cryptography.symmetric.Default(srv.symkey)
- def __call__(self, cookie=None, policy_url=None, logo_url=None,
- query="", **kwargs):
+ def __call__(self, cookie=None, policy_url=None, logo_url=None, query="", **kwargs):
"""
Put up the login form
"""
@@ -134,12 +138,14 @@ class UsernamePasswordMako(UserAuthnMethod):
resp = Response(headers=headers)
- argv = {"login": "",
- "password": "",
- "action": "verify",
- "policy_url": policy_url,
- "logo_url": logo_url,
- "query": query}
+ argv = {
+ "login": "",
+ "password": "",
+ "action": "verify",
+ "policy_url": policy_url,
+ "logo_url": logo_url,
+ "query": query,
+ }
logger.info("do_authentication argv: %s" % argv)
mte = self.template_lookup.get_template(self.mako_template)
resp.message = mte.render(**argv)
@@ -175,8 +181,7 @@ class UsernamePasswordMako(UserAuthnMethod):
info = self.symmetric.encrypt(msg.encode())
self.active[info] = timestamp
cookie = make_cookie(self.cookie_name, info, self.srv.seed)
- return_to = create_return_url(self.return_to, _dict["query"][0],
- **{self.query_param: "true"})
+ return_to = create_return_url(self.return_to, _dict["query"][0], **{self.query_param: "true"})
resp = Redirect(return_to, headers=[cookie])
except (ValueError, KeyError):
resp = Unauthorized("Unknown user or wrong password")
@@ -189,8 +194,7 @@ class UsernamePasswordMako(UserAuthnMethod):
else:
logger.debug("kwargs: %s" % kwargs)
try:
- info, timestamp = parse_cookie(self.cookie_name,
- self.srv.seed, cookie)
+ info, timestamp = parse_cookie(self.cookie_name, self.srv.seed, cookie)
if self.active[info] == timestamp:
msg = self.symmetric.decrypt(info).decode()
uid, _ts = msg.split("::")
@@ -233,21 +237,19 @@ class AuthnMethodChooser(object):
else:
pass # TODO
+
try:
import ldap
-
class LDAPAuthn(UsernamePasswordMako):
- def __init__(self, srv, ldapsrv, return_to,
- dn_pattern, mako_template, template_lookup):
+ def __init__(self, srv, ldapsrv, return_to, dn_pattern, mako_template, template_lookup):
"""
:param srv: The server instance
:param ldapsrv: Which LDAP server to us
:param return_to: Where to send the user after authentication
:return:
"""
- UsernamePasswordMako.__init__(self, srv, mako_template, template_lookup,
- None, return_to)
+ UsernamePasswordMako.__init__(self, srv, mako_template, template_lookup, None, return_to)
self.ldap = ldap.initialize(ldapsrv)
self.ldap.protocol_version = 3
@@ -266,6 +268,8 @@ try:
self.ldap.simple_bind_s(_dn, pwd)
except Exception:
raise AssertionError()
+
except ImportError:
+
class LDAPAuthn(UserAuthnMethod):
pass
diff --git a/src/saml2/authn_context/__init__.py b/src/saml2/authn_context/__init__.py
index 3abdf74c..0dd4d5fb 100644
--- a/src/saml2/authn_context/__init__.py
+++ b/src/saml2/authn_context/__init__.py
@@ -1,20 +1,20 @@
-from saml2.saml import AuthnContext, AuthnContextClassRef
+from saml2.saml import AuthnContext
+from saml2.saml import AuthnContextClassRef
from saml2.samlp import RequestedAuthnContext
-__author__ = 'rolandh'
+
+__author__ = "rolandh"
from saml2 import extension_elements_to_elements
+
UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified"
-INTERNETPROTOCOLPASSWORD = \
- 'urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword'
-MOBILETWOFACTORCONTRACT = \
- 'urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract'
-PASSWORDPROTECTEDTRANSPORT = \
- 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'
-PASSWORD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'
-TLSCLIENT = 'urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient'
+INTERNETPROTOCOLPASSWORD = "urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword"
+MOBILETWOFACTORCONTRACT = "urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract"
+PASSWORDPROTECTEDTRANSPORT = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
+PASSWORD = "urn:oasis:names:tc:SAML:2.0:ac:classes:Password"
+TLSCLIENT = "urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient"
TIMESYNCTOKEN = "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken"
AL1 = "http://idmanagement.gov/icam/2009/12/saml_2.0_profile/assurancelevel1"
@@ -28,7 +28,8 @@ from saml2.authn_context import ppt
from saml2.authn_context import pword
from saml2.authn_context import sslcert
-CMP_TYPE = ['exact', 'minimum', 'maximum', 'better']
+
+CMP_TYPE = ["exact", "minimum", "maximum", "better"]
class AuthnBroker(object):
@@ -68,20 +69,10 @@ class AuthnBroker(object):
if spec.authn_context_class_ref:
key = spec.authn_context_class_ref.text
- _info = {
- "class_ref": key,
- "method": method,
- "level": level,
- "authn_auth": authn_authority
- }
+ _info = {"class_ref": key, "method": method, "level": level, "authn_auth": authn_authority}
elif spec.authn_context_decl:
key = spec.authn_context_decl.c_namespace
- _info = {
- "method": method,
- "decl": spec.authn_context_decl,
- "level": level,
- "authn_auth": authn_authority
- }
+ _info = {"method": method, "decl": spec.authn_context_decl, "level": level, "authn_auth": authn_authority}
else:
raise NotImplementedError()
@@ -114,8 +105,7 @@ class AuthnBroker(object):
_remain.append(_ref)
if level and level != item["level"]:
_remain.append(_ref)
- if authn_authority and \
- authn_authority != item["authn_authority"]:
+ if authn_authority and authn_authority != item["authn_authority"]:
_remain.append(_ref)
if _remain:
self.db[_cls_ref] = _remain
@@ -169,21 +159,19 @@ class AuthnBroker(object):
_cmp = req_authn_context.comparison
else:
_cmp = "exact"
- if _cmp == 'exact':
+ if _cmp == "exact":
res = []
for cls_ref in req_authn_context.authn_context_class_ref:
- res += (self._pick_by_class_ref(cls_ref.text, _cmp))
+ res += self._pick_by_class_ref(cls_ref.text, _cmp)
return res
else:
- return self._pick_by_class_ref(
- req_authn_context.authn_context_class_ref[0].text, _cmp)
+ return self._pick_by_class_ref(req_authn_context.authn_context_class_ref[0].text, _cmp)
elif req_authn_context.authn_context_decl_ref:
if req_authn_context.comparison:
_cmp = req_authn_context.comparison
else:
_cmp = "exact"
- return self._pick_by_class_ref(
- req_authn_context.authn_context_decl_ref, _cmp)
+ return self._pick_by_class_ref(req_authn_context.authn_context_decl_ref, _cmp)
def match(self, requested, provided):
if requested == provided:
@@ -210,8 +198,7 @@ def authn_context_factory(text):
def authn_context_decl_from_extension_elements(extelems):
- res = extension_elements_to_elements(extelems, [ippword, mobiletwofactor,
- ppt, pword, sslcert])
+ res = extension_elements_to_elements(extelems, [ippword, mobiletwofactor, ppt, pword, sslcert])
try:
return res[0]
except IndexError:
@@ -226,5 +213,5 @@ def requested_authn_context(class_ref, comparison="minimum"):
if not isinstance(class_ref, list):
class_ref = [class_ref]
return RequestedAuthnContext(
- authn_context_class_ref=[AuthnContextClassRef(text=i) for i in class_ref],
- comparison=comparison)
+ authn_context_class_ref=[AuthnContextClassRef(text=i) for i in class_ref], comparison=comparison
+ )
diff --git a/src/saml2/authn_context/ippword.py b/src/saml2/authn_context/ippword.py
index 47655d8d..f3feebbc 100644
--- a/src/saml2/authn_context/ippword.py
+++ b/src/saml2/authn_context/ippword.py
@@ -14,30 +14,32 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword"
class PhysicalVerification(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PhysicalVerification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PhysicalVerification element"""
- c_tag = 'PhysicalVerification'
+ c_tag = "PhysicalVerification"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['credentialLevel'] = ('credential_level', 'None', False)
-
- def __init__(self,
- credential_level=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["credentialLevel"] = ("credential_level", "None", False)
+
+ def __init__(
+ self,
+ credential_level=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.credential_level = credential_level
@@ -47,26 +49,28 @@ def physical_verification_from_string(xml_string):
class Generation(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Generation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Generation element"""
- c_tag = 'Generation'
+ c_tag = "Generation"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['mechanism'] = ('mechanism', 'None', True)
-
- def __init__(self,
- mechanism=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["mechanism"] = ("mechanism", "None", True)
+
+ def __init__(
+ self,
+ mechanism=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.mechanism = mechanism
@@ -76,12 +80,11 @@ def generation_from_string(xml_string):
class NymType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:nymType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:nymType element"""
- c_tag = 'nymType'
+ c_tag = "nymType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['anonymity', 'verinymity', 'pseudonymity']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["anonymity", "verinymity", "pseudonymity"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -93,57 +96,59 @@ def nym_type__from_string(xml_string):
class GoverningAgreementRefType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreementRefType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreementRefType element"""
- c_tag = 'GoverningAgreementRefType'
+ c_tag = "GoverningAgreementRefType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['governingAgreementRef'] = (
- 'governing_agreement_ref', 'anyURI', True)
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["governingAgreementRef"] = ("governing_agreement_ref", "anyURI", True)
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref
def governing_agreement_ref_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementRefType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementRefType_, xml_string)
class KeySharingType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeySharingType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeySharingType element"""
- c_tag = 'KeySharingType'
+ c_tag = "KeySharingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['sharing'] = ('sharing', 'boolean', True)
-
- def __init__(self,
- sharing=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["sharing"] = ("sharing", "boolean", True)
+
+ def __init__(
+ self,
+ sharing=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.sharing = sharing
@@ -153,28 +158,30 @@ def key_sharing_type__from_string(xml_string):
class RestrictedLengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:RestrictedLengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:RestrictedLengthType element"""
- c_tag = 'RestrictedLengthType'
+ c_tag = "RestrictedLengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'None', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "None", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -185,30 +192,32 @@ def restricted_length_type__from_string(xml_string):
class AlphabetType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AlphabetType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AlphabetType element"""
- c_tag = 'AlphabetType'
+ c_tag = "AlphabetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['requiredChars'] = ('required_chars', 'string', True)
- c_attributes['excludedChars'] = ('excluded_chars', 'string', False)
- c_attributes['case'] = ('case', 'string', False)
-
- def __init__(self,
- required_chars=None,
- excluded_chars=None,
- case=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["requiredChars"] = ("required_chars", "string", True)
+ c_attributes["excludedChars"] = ("excluded_chars", "string", False)
+ c_attributes["case"] = ("case", "string", False)
+
+ def __init__(
+ self,
+ required_chars=None,
+ excluded_chars=None,
+ case=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.required_chars = required_chars
self.excluded_chars = excluded_chars
@@ -220,12 +229,11 @@ def alphabet_type__from_string(xml_string):
class DeviceTypeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:DeviceTypeType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:DeviceTypeType element"""
- c_tag = 'DeviceTypeType'
+ c_tag = "DeviceTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['hardware', 'software']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["hardware", "software"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -237,11 +245,11 @@ def device_type_type__from_string(xml_string):
class BooleanType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:booleanType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:booleanType element"""
- c_tag = 'booleanType'
+ c_tag = "booleanType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN', 'enumeration': ['true', 'false']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["true", "false"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -253,30 +261,32 @@ def boolean_type__from_string(xml_string):
class TimeSyncTokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TimeSyncTokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TimeSyncTokenType element"""
- c_tag = 'TimeSyncTokenType'
+ c_tag = "TimeSyncTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['DeviceType'] = ('device_type', DeviceTypeType_, True)
- c_attributes['SeedLength'] = ('seed_length', 'integer', True)
- c_attributes['DeviceInHand'] = ('device_in_hand', BooleanType_, True)
-
- def __init__(self,
- device_type=None,
- seed_length=None,
- device_in_hand=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["DeviceType"] = ("device_type", DeviceTypeType_, True)
+ c_attributes["SeedLength"] = ("seed_length", "integer", True)
+ c_attributes["DeviceInHand"] = ("device_in_hand", BooleanType_, True)
+
+ def __init__(
+ self,
+ device_type=None,
+ seed_length=None,
+ device_in_hand=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.device_type = device_type
self.seed_length = seed_length
@@ -288,69 +298,71 @@ def time_sync_token_type__from_string(xml_string):
class ActivationLimitDurationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitDurationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitDurationType element"""
- c_tag = 'ActivationLimitDurationType'
+ c_tag = "ActivationLimitDurationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['duration'] = ('duration', 'duration', True)
-
- def __init__(self,
- duration=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["duration"] = ("duration", "duration", True)
+
+ def __init__(
+ self,
+ duration=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.duration = duration
def activation_limit_duration_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDurationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDurationType_, xml_string)
class ActivationLimitUsagesType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitUsagesType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitUsagesType element"""
- c_tag = 'ActivationLimitUsagesType'
+ c_tag = "ActivationLimitUsagesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['number'] = ('number', 'integer', True)
-
- def __init__(self,
- number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["number"] = ("number", "integer", True)
+
+ def __init__(
+ self,
+ number=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.number = number
def activation_limit_usages_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitUsagesType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitUsagesType_, xml_string)
class ActivationLimitSessionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitSessionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitSessionType element"""
- c_tag = 'ActivationLimitSessionType'
+ c_tag = "ActivationLimitSessionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -359,33 +371,34 @@ class ActivationLimitSessionType_(SamlBase):
def activation_limit_session_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSessionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSessionType_, xml_string)
class LengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:LengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:LengthType element"""
- c_tag = 'LengthType'
+ c_tag = "LengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'integer', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "integer", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -396,13 +409,14 @@ def length_type__from_string(xml_string):
class MediumType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:mediumType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:mediumType element"""
- c_tag = 'mediumType'
+ c_tag = "mediumType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['memory', 'smartcard', 'token',
- 'MobileDevice', 'MobileAuthCard']}
+ c_value_type = {
+ "base": "xs:NMTOKEN",
+ "enumeration": ["memory", "smartcard", "token", "MobileDevice", "MobileAuthCard"],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -414,26 +428,28 @@ def medium_type__from_string(xml_string):
class KeyStorageType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyStorageType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyStorageType element"""
- c_tag = 'KeyStorageType'
+ c_tag = "KeyStorageType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['medium'] = ('medium', MediumType_, True)
-
- def __init__(self,
- medium=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["medium"] = ("medium", MediumType_, True)
+
+ def __init__(
+ self,
+ medium=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.medium = medium
@@ -443,9 +459,9 @@ def key_storage_type__from_string(xml_string):
class ExtensionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ExtensionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ExtensionType element"""
- c_tag = 'ExtensionType'
+ c_tag = "ExtensionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -458,9 +474,9 @@ def extension_type__from_string(xml_string):
class KeySharing(KeySharingType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeySharing element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeySharing element"""
- c_tag = 'KeySharing'
+ c_tag = "KeySharing"
c_namespace = NAMESPACE
c_children = KeySharingType_.c_children.copy()
c_attributes = KeySharingType_.c_attributes.copy()
@@ -473,9 +489,9 @@ def key_sharing_from_string(xml_string):
class KeyStorage(KeyStorageType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyStorage element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyStorage element"""
- c_tag = 'KeyStorage'
+ c_tag = "KeyStorage"
c_namespace = NAMESPACE
c_children = KeyStorageType_.c_children.copy()
c_attributes = KeyStorageType_.c_attributes.copy()
@@ -488,9 +504,9 @@ def key_storage_from_string(xml_string):
class TimeSyncToken(TimeSyncTokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TimeSyncToken element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TimeSyncToken element"""
- c_tag = 'TimeSyncToken'
+ c_tag = "TimeSyncToken"
c_namespace = NAMESPACE
c_children = TimeSyncTokenType_.c_children.copy()
c_attributes = TimeSyncTokenType_.c_attributes.copy()
@@ -503,9 +519,9 @@ def time_sync_token_from_string(xml_string):
class Length(LengthType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Length element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Length element"""
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = LengthType_.c_children.copy()
c_attributes = LengthType_.c_attributes.copy()
@@ -518,9 +534,9 @@ def length_from_string(xml_string):
class GoverningAgreementRef(GoverningAgreementRefType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreementRef element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreementRef element"""
- c_tag = 'GoverningAgreementRef'
+ c_tag = "GoverningAgreementRef"
c_namespace = NAMESPACE
c_children = GoverningAgreementRefType_.c_children.copy()
c_attributes = GoverningAgreementRefType_.c_attributes.copy()
@@ -533,41 +549,43 @@ def governing_agreement_ref_from_string(xml_string):
class GoverningAgreementsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreementsType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreementsType element"""
- c_tag = 'GoverningAgreementsType'
+ c_tag = "GoverningAgreementsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}GoverningAgreementRef'] = (
- 'governing_agreement_ref', [GoverningAgreementRef])
- c_cardinality['governing_agreement_ref'] = {"min": 1}
- c_child_order.extend(['governing_agreement_ref'])
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}GoverningAgreementRef"] = (
+ "governing_agreement_ref",
+ [GoverningAgreementRef],
+ )
+ c_cardinality["governing_agreement_ref"] = {"min": 1}
+ c_child_order.extend(["governing_agreement_ref"])
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref or []
def governing_agreements_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementsType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementsType_, xml_string)
class RestrictedPasswordType_Length(RestrictedLengthType_):
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = RestrictedLengthType_.c_children.copy()
c_attributes = RestrictedLengthType_.c_attributes.copy()
@@ -576,14 +594,13 @@ class RestrictedPasswordType_Length(RestrictedLengthType_):
def restricted_password_type__length_from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_Length,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_Length, xml_string)
class Alphabet(AlphabetType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Alphabet element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Alphabet element"""
- c_tag = 'Alphabet'
+ c_tag = "Alphabet"
c_namespace = NAMESPACE
c_children = AlphabetType_.c_children.copy()
c_attributes = AlphabetType_.c_attributes.copy()
@@ -596,9 +613,9 @@ def alphabet_from_string(xml_string):
class ActivationLimitDuration(ActivationLimitDurationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitDuration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitDuration element"""
- c_tag = 'ActivationLimitDuration'
+ c_tag = "ActivationLimitDuration"
c_namespace = NAMESPACE
c_children = ActivationLimitDurationType_.c_children.copy()
c_attributes = ActivationLimitDurationType_.c_attributes.copy()
@@ -607,14 +624,13 @@ class ActivationLimitDuration(ActivationLimitDurationType_):
def activation_limit_duration_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDuration,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDuration, xml_string)
class ActivationLimitUsages(ActivationLimitUsagesType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitUsages element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitUsages element"""
- c_tag = 'ActivationLimitUsages'
+ c_tag = "ActivationLimitUsages"
c_namespace = NAMESPACE
c_children = ActivationLimitUsagesType_.c_children.copy()
c_attributes = ActivationLimitUsagesType_.c_attributes.copy()
@@ -627,9 +643,9 @@ def activation_limit_usages_from_string(xml_string):
class ActivationLimitSession(ActivationLimitSessionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitSession element"""
- c_tag = 'ActivationLimitSession'
+ c_tag = "ActivationLimitSession"
c_namespace = NAMESPACE
c_children = ActivationLimitSessionType_.c_children.copy()
c_attributes = ActivationLimitSessionType_.c_attributes.copy()
@@ -638,14 +654,13 @@ class ActivationLimitSession(ActivationLimitSessionType_):
def activation_limit_session_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSession,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSession, xml_string)
class Extension(ExtensionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Extension element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Extension element"""
- c_tag = 'Extension'
+ c_tag = "Extension"
c_namespace = NAMESPACE
c_children = ExtensionType_.c_children.copy()
c_attributes = ExtensionType_.c_attributes.copy()
@@ -658,69 +673,74 @@ def extension_from_string(xml_string):
class SharedSecretChallengeResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SharedSecretChallengeResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SharedSecretChallengeResponseType element"""
- c_tag = 'SharedSecretChallengeResponseType'
+ c_tag = "SharedSecretChallengeResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['method'] = ('method', 'anyURI', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- method=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["method"] = ("method", "anyURI", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ method=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.method = method
def shared_secret_challenge_response_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- SharedSecretChallengeResponseType_, xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponseType_, xml_string)
class PublicKeyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PublicKeyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PublicKeyType element"""
- c_tag = 'PublicKeyType'
+ c_tag = "PublicKeyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['keyValidation'] = ('key_validation', 'None', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- key_validation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["keyValidation"] = ("key_validation", "None", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ key_validation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.key_validation = key_validation
@@ -731,9 +751,9 @@ def public_key_type__from_string(xml_string):
class GoverningAgreements(GoverningAgreementsType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreements element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:GoverningAgreements element"""
- c_tag = 'GoverningAgreements'
+ c_tag = "GoverningAgreements"
c_namespace = NAMESPACE
c_children = GoverningAgreementsType_.c_children.copy()
c_attributes = GoverningAgreementsType_.c_attributes.copy()
@@ -746,48 +766,47 @@ def governing_agreements_from_string(xml_string):
class PasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PasswordType element"""
- c_tag = 'PasswordType'
+ c_tag = "PasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'alphabet', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "alphabet", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -801,42 +820,46 @@ def password_type__from_string(xml_string):
class RestrictedPasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:RestrictedPasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:RestrictedPasswordType element"""
- c_tag = 'RestrictedPasswordType'
+ c_tag = "RestrictedPasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Length'] = (
- 'length', RestrictedPasswordType_Length)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Length"] = (
+ "length",
+ RestrictedPasswordType_Length,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.generation = generation
@@ -845,39 +868,42 @@ class RestrictedPasswordType_(SamlBase):
def restricted_password_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_, xml_string)
class TokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TokenType element"""
- c_tag = 'TokenType'
+ c_tag = "TokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}TimeSyncToken'] = (
- 'time_sync_token', TimeSyncToken)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['time_sync_token', 'extension'])
-
- def __init__(self,
- time_sync_token=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}TimeSyncToken"] = (
+ "time_sync_token",
+ TimeSyncToken,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["time_sync_token", "extension"])
+
+ def __init__(
+ self,
+ time_sync_token=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.time_sync_token = time_sync_token
self.extension = extension or []
@@ -888,42 +914,45 @@ def token_type__from_string(xml_string):
class ActivationLimitType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimitType element"""
- c_tag = 'ActivationLimitType'
+ c_tag = "ActivationLimitType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimitDuration'] = (
- 'activation_limit_duration', ActivationLimitDuration)
- c_cardinality['activation_limit_duration'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimitUsages'] = (
- 'activation_limit_usages', ActivationLimitUsages)
- c_cardinality['activation_limit_usages'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimitSession'] = (
- 'activation_limit_session', ActivationLimitSession)
- c_cardinality['activation_limit_session'] = {"min": 0, "max": 1}
- c_child_order.extend(
- ['activation_limit_duration', 'activation_limit_usages',
- 'activation_limit_session'])
-
- def __init__(self,
- activation_limit_duration=None,
- activation_limit_usages=None,
- activation_limit_session=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimitDuration"] = (
+ "activation_limit_duration",
+ ActivationLimitDuration,
+ )
+ c_cardinality["activation_limit_duration"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimitUsages"] = (
+ "activation_limit_usages",
+ ActivationLimitUsages,
+ )
+ c_cardinality["activation_limit_usages"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimitSession"] = (
+ "activation_limit_session",
+ ActivationLimitSession,
+ )
+ c_cardinality["activation_limit_session"] = {"min": 0, "max": 1}
+ c_child_order.extend(["activation_limit_duration", "activation_limit_usages", "activation_limit_session"])
+
+ def __init__(
+ self,
+ activation_limit_duration=None,
+ activation_limit_usages=None,
+ activation_limit_session=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_limit_duration = activation_limit_duration
self.activation_limit_usages = activation_limit_usages
@@ -935,30 +964,33 @@ def activation_limit_type__from_string(xml_string):
class ExtensionOnlyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ExtensionOnlyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ExtensionOnlyType element"""
- c_tag = 'ExtensionOnlyType'
+ c_tag = "ExtensionOnlyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
@@ -968,9 +1000,9 @@ def extension_only_type__from_string(xml_string):
class WrittenConsent(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:WrittenConsent element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:WrittenConsent element"""
- c_tag = 'WrittenConsent'
+ c_tag = "WrittenConsent"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -983,9 +1015,9 @@ def written_consent_from_string(xml_string):
class SubscriberLineNumber(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SubscriberLineNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SubscriberLineNumber element"""
- c_tag = 'SubscriberLineNumber'
+ c_tag = "SubscriberLineNumber"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -998,9 +1030,9 @@ def subscriber_line_number_from_string(xml_string):
class UserSuffix(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:UserSuffix element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:UserSuffix element"""
- c_tag = 'UserSuffix'
+ c_tag = "UserSuffix"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1013,9 +1045,9 @@ def user_suffix_from_string(xml_string):
class Password(PasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Password element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Password element"""
- c_tag = 'Password'
+ c_tag = "Password"
c_namespace = NAMESPACE
c_children = PasswordType_.c_children.copy()
c_attributes = PasswordType_.c_attributes.copy()
@@ -1028,9 +1060,9 @@ def password_from_string(xml_string):
class Token(TokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Token element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Token element"""
- c_tag = 'Token'
+ c_tag = "Token"
c_namespace = NAMESPACE
c_children = TokenType_.c_children.copy()
c_attributes = TokenType_.c_attributes.copy()
@@ -1043,9 +1075,9 @@ def token_from_string(xml_string):
class Smartcard(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Smartcard element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Smartcard element"""
- c_tag = 'Smartcard'
+ c_tag = "Smartcard"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1058,9 +1090,9 @@ def smartcard_from_string(xml_string):
class ActivationLimit(ActivationLimitType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationLimit element"""
- c_tag = 'ActivationLimit'
+ c_tag = "ActivationLimit"
c_namespace = NAMESPACE
c_children = ActivationLimitType_.c_children.copy()
c_attributes = ActivationLimitType_.c_attributes.copy()
@@ -1073,9 +1105,9 @@ def activation_limit_from_string(xml_string):
class PreviousSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PreviousSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PreviousSession element"""
- c_tag = 'PreviousSession'
+ c_tag = "PreviousSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1088,9 +1120,9 @@ def previous_session_from_string(xml_string):
class ResumeSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ResumeSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ResumeSession element"""
- c_tag = 'ResumeSession'
+ c_tag = "ResumeSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1103,9 +1135,9 @@ def resume_session_from_string(xml_string):
class ZeroKnowledge(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ZeroKnowledge element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ZeroKnowledge element"""
- c_tag = 'ZeroKnowledge'
+ c_tag = "ZeroKnowledge"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1118,9 +1150,9 @@ def zero_knowledge_from_string(xml_string):
class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SharedSecretChallengeResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SharedSecretChallengeResponse element"""
- c_tag = 'SharedSecretChallengeResponse'
+ c_tag = "SharedSecretChallengeResponse"
c_namespace = NAMESPACE
c_children = SharedSecretChallengeResponseType_.c_children.copy()
c_attributes = SharedSecretChallengeResponseType_.c_attributes.copy()
@@ -1129,14 +1161,13 @@ class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
def shared_secret_challenge_response_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretChallengeResponse,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponse, xml_string)
class DigSig(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:DigSig element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:DigSig element"""
- c_tag = 'DigSig'
+ c_tag = "DigSig"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1149,9 +1180,9 @@ def dig_sig_from_string(xml_string):
class AsymmetricDecryption(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AsymmetricDecryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AsymmetricDecryption element"""
- c_tag = 'AsymmetricDecryption'
+ c_tag = "AsymmetricDecryption"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1164,9 +1195,9 @@ def asymmetric_decryption_from_string(xml_string):
class AsymmetricKeyAgreement(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AsymmetricKeyAgreement element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AsymmetricKeyAgreement element"""
- c_tag = 'AsymmetricKeyAgreement'
+ c_tag = "AsymmetricKeyAgreement"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1175,14 +1206,13 @@ class AsymmetricKeyAgreement(PublicKeyType_):
def asymmetric_key_agreement_from_string(xml_string):
- return saml2.create_class_from_xml_string(AsymmetricKeyAgreement,
- xml_string)
+ return saml2.create_class_from_xml_string(AsymmetricKeyAgreement, xml_string)
class IPAddress(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:IPAddress element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:IPAddress element"""
- c_tag = 'IPAddress'
+ c_tag = "IPAddress"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1195,9 +1225,9 @@ def ip_address_from_string(xml_string):
class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SharedSecretDynamicPlaintext element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SharedSecretDynamicPlaintext element"""
- c_tag = 'SharedSecretDynamicPlaintext'
+ c_tag = "SharedSecretDynamicPlaintext"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1206,14 +1236,13 @@ class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
def shared_secret_dynamic_plaintext_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext, xml_string)
class HTTP(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:HTTP element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:HTTP element"""
- c_tag = 'HTTP'
+ c_tag = "HTTP"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1226,9 +1255,9 @@ def http_from_string(xml_string):
class IPSec(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:IPSec element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:IPSec element"""
- c_tag = 'IPSec'
+ c_tag = "IPSec"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1241,9 +1270,9 @@ def ip_sec_from_string(xml_string):
class WTLS(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:WTLS element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:WTLS element"""
- c_tag = 'WTLS'
+ c_tag = "WTLS"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1256,9 +1285,9 @@ def wtls_from_string(xml_string):
class MobileNetworkNoEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:MobileNetworkNoEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:MobileNetworkNoEncryption element"""
- c_tag = 'MobileNetworkNoEncryption'
+ c_tag = "MobileNetworkNoEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1267,14 +1296,13 @@ class MobileNetworkNoEncryption(ExtensionOnlyType_):
def mobile_network_no_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkNoEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkNoEncryption, xml_string)
class MobileNetworkRadioEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:MobileNetworkRadioEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:MobileNetworkRadioEncryption element"""
- c_tag = 'MobileNetworkRadioEncryption'
+ c_tag = "MobileNetworkRadioEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1283,14 +1311,13 @@ class MobileNetworkRadioEncryption(ExtensionOnlyType_):
def mobile_network_radio_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption, xml_string)
class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:MobileNetworkEndToEndEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:MobileNetworkEndToEndEncryption element"""
- c_tag = 'MobileNetworkEndToEndEncryption'
+ c_tag = "MobileNetworkEndToEndEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1299,14 +1326,13 @@ class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
def mobile_network_end_to_end_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption, xml_string)
class SSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SSL element"""
- c_tag = 'SSL'
+ c_tag = "SSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1319,9 +1345,9 @@ def ssl_from_string(xml_string):
class PSTN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PSTN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PSTN element"""
- c_tag = 'PSTN'
+ c_tag = "PSTN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1334,9 +1360,9 @@ def pstn_from_string(xml_string):
class ISDN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ISDN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ISDN element"""
- c_tag = 'ISDN'
+ c_tag = "ISDN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1349,9 +1375,9 @@ def isdn_from_string(xml_string):
class ADSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ADSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ADSL element"""
- c_tag = 'ADSL'
+ c_tag = "ADSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1364,9 +1390,9 @@ def adsl_from_string(xml_string):
class SwitchAudit(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SwitchAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SwitchAudit element"""
- c_tag = 'SwitchAudit'
+ c_tag = "SwitchAudit"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1379,9 +1405,9 @@ def switch_audit_from_string(xml_string):
class DeactivationCallCenter(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:DeactivationCallCenter element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:DeactivationCallCenter element"""
- c_tag = 'DeactivationCallCenter'
+ c_tag = "DeactivationCallCenter"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1390,54 +1416,57 @@ class DeactivationCallCenter(ExtensionOnlyType_):
def deactivation_call_center_from_string(xml_string):
- return saml2.create_class_from_xml_string(DeactivationCallCenter,
- xml_string)
+ return saml2.create_class_from_xml_string(DeactivationCallCenter, xml_string)
class IdentificationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:IdentificationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:IdentificationType element"""
- c_tag = 'IdentificationType'
+ c_tag = "IdentificationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PhysicalVerification'] = (
- 'physical_verification', PhysicalVerification)
- c_cardinality['physical_verification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}WrittenConsent'] = (
- 'written_consent', WrittenConsent)
- c_cardinality['written_consent'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['nym'] = ('nym', NymType_, False)
- c_child_order.extend(
- ['physical_verification', 'written_consent', 'governing_agreements',
- 'extension'])
-
- def __init__(self,
- physical_verification=None,
- written_consent=None,
- governing_agreements=None,
- extension=None,
- nym=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PhysicalVerification"] = (
+ "physical_verification",
+ PhysicalVerification,
+ )
+ c_cardinality["physical_verification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}WrittenConsent"] = (
+ "written_consent",
+ WrittenConsent,
+ )
+ c_cardinality["written_consent"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["nym"] = ("nym", NymType_, False)
+ c_child_order.extend(["physical_verification", "written_consent", "governing_agreements", "extension"])
+
+ def __init__(
+ self,
+ physical_verification=None,
+ written_consent=None,
+ governing_agreements=None,
+ extension=None,
+ nym=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.physical_verification = physical_verification
self.written_consent = written_consent
@@ -1451,83 +1480,86 @@ def identification_type__from_string(xml_string):
class AuthenticatorTransportProtocolType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticatorTransportProtocolType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticatorTransportProtocolType element"""
- c_tag = 'AuthenticatorTransportProtocolType'
+ c_tag = "AuthenticatorTransportProtocolType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}HTTP'] = (
- 'http', HTTP)
- c_cardinality['http'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SSL'] = (
- 'ssl', SSL)
- c_cardinality['ssl'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}MobileNetworkNoEncryption'] = (
- 'mobile_network_no_encryption', MobileNetworkNoEncryption)
- c_cardinality['mobile_network_no_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}MobileNetworkRadioEncryption'] = (
- 'mobile_network_radio_encryption', MobileNetworkRadioEncryption)
- c_cardinality['mobile_network_radio_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}MobileNetworkEndToEndEncryption'] = (
- 'mobile_network_end_to_end_encryption', MobileNetworkEndToEndEncryption)
- c_cardinality['mobile_network_end_to_end_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}WTLS'] = (
- 'wtls', WTLS)
- c_cardinality['wtls'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}IPSec'] = (
- 'ip_sec', IPSec)
- c_cardinality['ip_sec'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PSTN'] = (
- 'pstn', PSTN)
- c_cardinality['pstn'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ISDN'] = (
- 'isdn', ISDN)
- c_cardinality['isdn'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ADSL'] = (
- 'adsl', ADSL)
- c_cardinality['adsl'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['http', 'ssl', 'mobile_network_no_encryption',
- 'mobile_network_radio_encryption',
- 'mobile_network_end_to_end_encryption', 'wtls',
- 'ip_sec', 'pstn', 'isdn', 'adsl', 'extension'])
-
- def __init__(self,
- http=None,
- ssl=None,
- mobile_network_no_encryption=None,
- mobile_network_radio_encryption=None,
- mobile_network_end_to_end_encryption=None,
- wtls=None,
- ip_sec=None,
- pstn=None,
- isdn=None,
- adsl=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}HTTP"] = ("http", HTTP)
+ c_cardinality["http"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SSL"] = ("ssl", SSL)
+ c_cardinality["ssl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}MobileNetworkNoEncryption"] = (
+ "mobile_network_no_encryption",
+ MobileNetworkNoEncryption,
+ )
+ c_cardinality["mobile_network_no_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}MobileNetworkRadioEncryption"] = (
+ "mobile_network_radio_encryption",
+ MobileNetworkRadioEncryption,
+ )
+ c_cardinality["mobile_network_radio_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}MobileNetworkEndToEndEncryption"] = (
+ "mobile_network_end_to_end_encryption",
+ MobileNetworkEndToEndEncryption,
+ )
+ c_cardinality["mobile_network_end_to_end_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}WTLS"] = ("wtls", WTLS)
+ c_cardinality["wtls"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}IPSec"] = ("ip_sec", IPSec)
+ c_cardinality["ip_sec"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PSTN"] = ("pstn", PSTN)
+ c_cardinality["pstn"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ISDN"] = ("isdn", ISDN)
+ c_cardinality["isdn"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ADSL"] = ("adsl", ADSL)
+ c_cardinality["adsl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ [
+ "http",
+ "ssl",
+ "mobile_network_no_encryption",
+ "mobile_network_radio_encryption",
+ "mobile_network_end_to_end_encryption",
+ "wtls",
+ "ip_sec",
+ "pstn",
+ "isdn",
+ "adsl",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ http=None,
+ ssl=None,
+ mobile_network_no_encryption=None,
+ mobile_network_radio_encryption=None,
+ mobile_network_end_to_end_encryption=None,
+ wtls=None,
+ ip_sec=None,
+ pstn=None,
+ isdn=None,
+ adsl=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.http = http
self.ssl = ssl
@@ -1543,14 +1575,13 @@ class AuthenticatorTransportProtocolType_(SamlBase):
def authenticator_transport_protocol_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- AuthenticatorTransportProtocolType_, xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocolType_, xml_string)
class RestrictedPassword(RestrictedPasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:RestrictedPassword element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:RestrictedPassword element"""
- c_tag = 'RestrictedPassword'
+ c_tag = "RestrictedPassword"
c_namespace = NAMESPACE
c_children = RestrictedPasswordType_.c_children.copy()
c_attributes = RestrictedPasswordType_.c_attributes.copy()
@@ -1563,51 +1594,51 @@ def restricted_password_from_string(xml_string):
class ActivationPinType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationPinType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationPinType element"""
- c_tag = 'ActivationPinType'
+ c_tag = "ActivationPinType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimit'] = (
- 'activation_limit', ActivationLimit)
- c_cardinality['activation_limit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['length', 'alphabet', 'generation', 'activation_limit', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- activation_limit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationLimit"] = (
+ "activation_limit",
+ ActivationLimit,
+ )
+ c_cardinality["activation_limit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["length", "alphabet", "generation", "activation_limit", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ activation_limit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -1621,35 +1652,39 @@ def activation_pin_type__from_string(xml_string):
class SecurityAuditType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecurityAuditType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecurityAuditType element"""
- c_tag = 'SecurityAuditType'
+ c_tag = "SecurityAuditType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SwitchAudit'] = (
- 'switch_audit', SwitchAudit)
- c_cardinality['switch_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['switch_audit', 'extension'])
-
- def __init__(self,
- switch_audit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SwitchAudit"] = (
+ "switch_audit",
+ SwitchAudit,
+ )
+ c_cardinality["switch_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["switch_audit", "extension"])
+
+ def __init__(
+ self,
+ switch_audit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.switch_audit = switch_audit
self.extension = extension or []
@@ -1660,38 +1695,37 @@ def security_audit_type__from_string(xml_string):
class AuthenticatorBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticatorBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticatorBaseType element"""
- c_tag = 'AuthenticatorBaseType'
+ c_tag = "AuthenticatorBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Password'] = (
- 'password', Password)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}IPAddress'] = (
- 'ip_address', IPAddress)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['password', 'ip_address', 'extension'])
-
- def __init__(self,
- password=None,
- ip_address=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Password"] = ("password", Password)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}IPAddress"] = ("ip_address", IPAddress)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["password", "ip_address", "extension"])
+
+ def __init__(
+ self,
+ password=None,
+ ip_address=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.password = password
self.ip_address = ip_address
@@ -1699,14 +1733,13 @@ class AuthenticatorBaseType_(SamlBase):
def authenticator_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorBaseType_, xml_string)
class Identification(IdentificationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Identification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Identification element"""
- c_tag = 'Identification'
+ c_tag = "Identification"
c_namespace = NAMESPACE
c_children = IdentificationType_.c_children.copy()
c_attributes = IdentificationType_.c_attributes.copy()
@@ -1719,9 +1752,9 @@ def identification_from_string(xml_string):
class ActivationPin(ActivationPinType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationPin element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ActivationPin element"""
- c_tag = 'ActivationPin'
+ c_tag = "ActivationPin"
c_namespace = NAMESPACE
c_children = ActivationPinType_.c_children.copy()
c_attributes = ActivationPinType_.c_attributes.copy()
@@ -1734,9 +1767,9 @@ def activation_pin_from_string(xml_string):
class Authenticator(AuthenticatorBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Authenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:Authenticator element"""
- c_tag = 'Authenticator'
+ c_tag = "Authenticator"
c_namespace = NAMESPACE
c_children = AuthenticatorBaseType_.c_children.copy()
c_attributes = AuthenticatorBaseType_.c_attributes.copy()
@@ -1749,9 +1782,9 @@ def authenticator_from_string(xml_string):
class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticatorTransportProtocol element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticatorTransportProtocol element"""
- c_tag = 'AuthenticatorTransportProtocol'
+ c_tag = "AuthenticatorTransportProtocol"
c_namespace = NAMESPACE
c_children = AuthenticatorTransportProtocolType_.c_children.copy()
c_attributes = AuthenticatorTransportProtocolType_.c_attributes.copy()
@@ -1760,14 +1793,13 @@ class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
def authenticator_transport_protocol_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol, xml_string)
class SecurityAudit(SecurityAuditType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecurityAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecurityAudit element"""
- c_tag = 'SecurityAudit'
+ c_tag = "SecurityAudit"
c_namespace = NAMESPACE
c_children = SecurityAuditType_.c_children.copy()
c_attributes = SecurityAuditType_.c_attributes.copy()
@@ -1780,41 +1812,45 @@ def security_audit_from_string(xml_string):
class OperationalProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:OperationalProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:OperationalProtectionType element"""
- c_tag = 'OperationalProtectionType'
+ c_tag = "OperationalProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SecurityAudit'] = (
- 'security_audit', SecurityAudit)
- c_cardinality['security_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}DeactivationCallCenter'] = (
- 'deactivation_call_center', DeactivationCallCenter)
- c_cardinality['deactivation_call_center'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['security_audit', 'deactivation_call_center', 'extension'])
-
- def __init__(self,
- security_audit=None,
- deactivation_call_center=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SecurityAudit"] = (
+ "security_audit",
+ SecurityAudit,
+ )
+ c_cardinality["security_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}DeactivationCallCenter"] = (
+ "deactivation_call_center",
+ DeactivationCallCenter,
+ )
+ c_cardinality["deactivation_call_center"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["security_audit", "deactivation_call_center", "extension"])
+
+ def __init__(
+ self,
+ security_audit=None,
+ deactivation_call_center=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.security_audit = security_audit
self.deactivation_call_center = deactivation_call_center
@@ -1822,64 +1858,60 @@ class OperationalProtectionType_(SamlBase):
def operational_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(OperationalProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(OperationalProtectionType_, xml_string)
class PrincipalAuthenticationMechanismType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrincipalAuthenticationMechanismType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrincipalAuthenticationMechanismType element"""
- c_tag = 'PrincipalAuthenticationMechanismType'
+ c_tag = "PrincipalAuthenticationMechanismType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Token'] = (
- 'token', Token)
- c_cardinality['token'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Smartcard'] = (
- 'smartcard', Smartcard)
- c_cardinality['smartcard'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['preauth'] = ('preauth', 'integer', False)
- c_child_order.extend(
- ['password', 'restricted_password', 'token', 'smartcard',
- 'activation_pin', 'extension'])
-
- def __init__(self,
- password=None,
- restricted_password=None,
- token=None,
- smartcard=None,
- activation_pin=None,
- extension=None,
- preauth=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Token"] = ("token", Token)
+ c_cardinality["token"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Smartcard"] = ("smartcard", Smartcard)
+ c_cardinality["smartcard"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationPin"] = (
+ "activation_pin",
+ ActivationPin,
+ )
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["preauth"] = ("preauth", "integer", False)
+ c_child_order.extend(["password", "restricted_password", "token", "smartcard", "activation_pin", "extension"])
+
+ def __init__(
+ self,
+ password=None,
+ restricted_password=None,
+ token=None,
+ smartcard=None,
+ activation_pin=None,
+ extension=None,
+ preauth=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.password = password
self.restricted_password = restricted_password
@@ -1891,41 +1923,43 @@ class PrincipalAuthenticationMechanismType_(SamlBase):
def principal_authentication_mechanism_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- PrincipalAuthenticationMechanismType_, xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanismType_, xml_string)
class KeyActivationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyActivationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyActivationType element"""
- c_tag = 'KeyActivationType'
+ c_tag = "KeyActivationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword' \
- '}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['activation_pin', 'extension'])
-
- def __init__(self,
- activation_pin=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ActivationPin"] = (
+ "activation_pin",
+ ActivationPin,
+ )
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword" "}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["activation_pin", "extension"])
+
+ def __init__(
+ self,
+ activation_pin=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_pin = activation_pin
self.extension = extension or []
@@ -1936,9 +1970,9 @@ def key_activation_type__from_string(xml_string):
class KeyActivation(KeyActivationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyActivation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:KeyActivation element"""
- c_tag = 'KeyActivation'
+ c_tag = "KeyActivation"
c_namespace = NAMESPACE
c_children = KeyActivationType_.c_children.copy()
c_attributes = KeyActivationType_.c_attributes.copy()
@@ -1951,9 +1985,9 @@ def key_activation_from_string(xml_string):
class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrincipalAuthenticationMechanism element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrincipalAuthenticationMechanism element"""
- c_tag = 'PrincipalAuthenticationMechanism'
+ c_tag = "PrincipalAuthenticationMechanism"
c_namespace = NAMESPACE
c_children = PrincipalAuthenticationMechanismType_.c_children.copy()
c_attributes = PrincipalAuthenticationMechanismType_.c_attributes.copy()
@@ -1962,14 +1996,13 @@ class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
def principal_authentication_mechanism_from_string(xml_string):
- return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism,
- xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism, xml_string)
class OperationalProtection(OperationalProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:OperationalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:OperationalProtection element"""
- c_tag = 'OperationalProtection'
+ c_tag = "OperationalProtection"
c_namespace = NAMESPACE
c_children = OperationalProtectionType_.c_children.copy()
c_attributes = OperationalProtectionType_.c_attributes.copy()
@@ -1982,46 +2015,51 @@ def operational_protection_from_string(xml_string):
class PrivateKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrivateKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrivateKeyProtectionType element"""
- c_tag = 'PrivateKeyProtectionType'
+ c_tag = "PrivateKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeySharing'] = (
- 'key_sharing', KeySharing)
- c_cardinality['key_sharing'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['key_activation', 'key_storage', 'key_sharing', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- key_sharing=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyStorage"] = (
+ "key_storage",
+ KeyStorage,
+ )
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeySharing"] = (
+ "key_sharing",
+ KeySharing,
+ )
+ c_cardinality["key_sharing"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "key_sharing", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ key_sharing=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -2030,45 +2068,49 @@ class PrivateKeyProtectionType_(SamlBase):
def private_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(PrivateKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(PrivateKeyProtectionType_, xml_string)
class SecretKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecretKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecretKeyProtectionType element"""
- c_tag = 'SecretKeyProtectionType'
+ c_tag = "SecretKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['key_activation', 'key_storage', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}KeyStorage"] = (
+ "key_storage",
+ KeyStorage,
+ )
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -2076,51 +2118,56 @@ class SecretKeyProtectionType_(SamlBase):
def secret_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SecretKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SecretKeyProtectionType_, xml_string)
class AuthnMethodBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthnMethodBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthnMethodBaseType element"""
- c_tag = 'AuthnMethodBaseType'
+ c_tag = "AuthnMethodBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PrincipalAuthenticationMechanism'] = (
- 'principal_authentication_mechanism', PrincipalAuthenticationMechanism)
- c_cardinality['principal_authentication_mechanism'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Authenticator'] = (
- 'authenticator', Authenticator)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AuthenticatorTransportProtocol'] = (
- 'authenticator_transport_protocol', AuthenticatorTransportProtocol)
- c_cardinality['authenticator_transport_protocol'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword' \
- '}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['principal_authentication_mechanism', 'authenticator',
- 'authenticator_transport_protocol', 'extension'])
-
- def __init__(self,
- principal_authentication_mechanism=None,
- authenticator=None,
- authenticator_transport_protocol=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PrincipalAuthenticationMechanism"] = (
+ "principal_authentication_mechanism",
+ PrincipalAuthenticationMechanism,
+ )
+ c_cardinality["principal_authentication_mechanism"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Authenticator"] = (
+ "authenticator",
+ Authenticator,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AuthenticatorTransportProtocol"] = (
+ "authenticator_transport_protocol",
+ AuthenticatorTransportProtocol,
+ )
+ c_cardinality["authenticator_transport_protocol"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword" "}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ ["principal_authentication_mechanism", "authenticator", "authenticator_transport_protocol", "extension"]
+ )
+
+ def __init__(
+ self,
+ principal_authentication_mechanism=None,
+ authenticator=None,
+ authenticator_transport_protocol=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.principal_authentication_mechanism = principal_authentication_mechanism
self.authenticator = authenticator
@@ -2133,9 +2180,9 @@ def authn_method_base_type__from_string(xml_string):
class SecretKeyProtection(SecretKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecretKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:SecretKeyProtection element"""
- c_tag = 'SecretKeyProtection'
+ c_tag = "SecretKeyProtection"
c_namespace = NAMESPACE
c_children = SecretKeyProtectionType_.c_children.copy()
c_attributes = SecretKeyProtectionType_.c_attributes.copy()
@@ -2148,9 +2195,9 @@ def secret_key_protection_from_string(xml_string):
class PrivateKeyProtection(PrivateKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrivateKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:PrivateKeyProtection element"""
- c_tag = 'PrivateKeyProtection'
+ c_tag = "PrivateKeyProtection"
c_namespace = NAMESPACE
c_children = PrivateKeyProtectionType_.c_children.copy()
c_attributes = PrivateKeyProtectionType_.c_attributes.copy()
@@ -2163,9 +2210,9 @@ def private_key_protection_from_string(xml_string):
class AuthnMethod(AuthnMethodBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthnMethod element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthnMethod element"""
- c_tag = 'AuthnMethod'
+ c_tag = "AuthnMethod"
c_namespace = NAMESPACE
c_children = AuthnMethodBaseType_.c_children.copy()
c_attributes = AuthnMethodBaseType_.c_attributes.copy()
@@ -2178,41 +2225,45 @@ def authn_method_from_string(xml_string):
class TechnicalProtectionBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TechnicalProtectionBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TechnicalProtectionBaseType element"""
- c_tag = 'TechnicalProtectionBaseType'
+ c_tag = "TechnicalProtectionBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PrivateKeyProtection'] = (
- 'private_key_protection', PrivateKeyProtection)
- c_cardinality['private_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SecretKeyProtection'] = (
- 'secret_key_protection', SecretKeyProtection)
- c_cardinality['secret_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['private_key_protection', 'secret_key_protection', 'extension'])
-
- def __init__(self,
- private_key_protection=None,
- secret_key_protection=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PrivateKeyProtection"] = (
+ "private_key_protection",
+ PrivateKeyProtection,
+ )
+ c_cardinality["private_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SecretKeyProtection"] = (
+ "secret_key_protection",
+ SecretKeyProtection,
+ )
+ c_cardinality["secret_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["private_key_protection", "secret_key_protection", "extension"])
+
+ def __init__(
+ self,
+ private_key_protection=None,
+ secret_key_protection=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.private_key_protection = private_key_protection
self.secret_key_protection = secret_key_protection
@@ -2220,14 +2271,13 @@ class TechnicalProtectionBaseType_(SamlBase):
def technical_protection_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_, xml_string)
class TechnicalProtection(TechnicalProtectionBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TechnicalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:TechnicalProtection element"""
- c_tag = 'TechnicalProtection'
+ c_tag = "TechnicalProtection"
c_namespace = NAMESPACE
c_children = TechnicalProtectionBaseType_.c_children.copy()
c_attributes = TechnicalProtectionBaseType_.c_attributes.copy()
@@ -2240,58 +2290,73 @@ def technical_protection_from_string(xml_string):
class AuthnContextDeclarationBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthnContextDeclarationBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthnContextDeclarationBaseType element"""
- c_tag = 'AuthnContextDeclarationBaseType'
+ c_tag = "AuthnContextDeclarationBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Identification'] = (
- 'identification', Identification)
- c_cardinality['identification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}TechnicalProtection'] = (
- 'technical_protection', TechnicalProtection)
- c_cardinality['technical_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}OperationalProtection'] = (
- 'operational_protection', OperationalProtection)
- c_cardinality['operational_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AuthnMethod'] = (
- 'authn_method', AuthnMethod)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ID'] = ('id', 'ID', False)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Identification"] = (
+ "identification",
+ Identification,
+ )
+ c_cardinality["identification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}TechnicalProtection"] = (
+ "technical_protection",
+ TechnicalProtection,
+ )
+ c_cardinality["technical_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}OperationalProtection"] = (
+ "operational_protection",
+ OperationalProtection,
+ )
+ c_cardinality["operational_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AuthnMethod"] = (
+ "authn_method",
+ AuthnMethod,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ID"] = ("id", "ID", False)
c_child_order.extend(
- ['identification', 'technical_protection', 'operational_protection',
- 'authn_method', 'governing_agreements', 'extension'])
-
- def __init__(self,
- identification=None,
- technical_protection=None,
- operational_protection=None,
- authn_method=None,
- governing_agreements=None,
- extension=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "identification",
+ "technical_protection",
+ "operational_protection",
+ "authn_method",
+ "governing_agreements",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ identification=None,
+ technical_protection=None,
+ operational_protection=None,
+ authn_method=None,
+ governing_agreements=None,
+ extension=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.identification = identification
self.technical_protection = technical_protection
@@ -2303,14 +2368,13 @@ class AuthnContextDeclarationBaseType_(SamlBase):
def authn_context_declaration_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_, xml_string)
class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticationContextDeclaration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:AuthenticationContextDeclaration element"""
- c_tag = 'AuthenticationContextDeclaration'
+ c_tag = "AuthenticationContextDeclaration"
c_namespace = NAMESPACE
c_children = AuthnContextDeclarationBaseType_.c_children.copy()
c_attributes = AuthnContextDeclarationBaseType_.c_attributes.copy()
@@ -2319,110 +2383,128 @@ class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
def authentication_context_declaration_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticationContextDeclaration,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticationContextDeclaration, xml_string)
-#..................
+# ..................
# ['ComplexAuthenticator', 'ComplexAuthenticatorType']
class ComplexAuthenticatorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ComplexAuthenticatorType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ComplexAuthenticatorType element"""
- c_tag = 'ComplexAuthenticatorType'
+ c_tag = "ComplexAuthenticatorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PreviousSession'] = (
- 'previous_session', PreviousSession)
- c_cardinality['previous_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ResumeSession'] = (
- 'resume_session', ResumeSession)
- c_cardinality['resume_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}DigSig'] = (
- 'dig_sig', DigSig)
- c_cardinality['dig_sig'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ZeroKnowledge'] = (
- 'zero_knowledge', ZeroKnowledge)
- c_cardinality['zero_knowledge'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}IPAddress'] = (
- 'ip_address', IPAddress)
- c_cardinality['ip_address'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AsymmetricDecryption'] = (
- 'asymmetric_decryption', AsymmetricDecryption)
- c_cardinality['asymmetric_decryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AsymmetricKeyAgreement'] = (
- 'asymmetric_key_agreement', AsymmetricKeyAgreement)
- c_cardinality['asymmetric_key_agreement'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SubscriberLineNumber'] = (
- 'subscriber_line_number', SubscriberLineNumber)
- c_cardinality['subscriber_line_number'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}UserSuffix'] = (
- 'user_suffix', UserSuffix)
- c_cardinality['user_suffix'] = {"min": 0, "max": 1}
- c_cardinality['complex_authenticator'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}PreviousSession"] = (
+ "previous_session",
+ PreviousSession,
+ )
+ c_cardinality["previous_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ResumeSession"] = (
+ "resume_session",
+ ResumeSession,
+ )
+ c_cardinality["resume_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}DigSig"] = ("dig_sig", DigSig)
+ c_cardinality["dig_sig"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ZeroKnowledge"] = (
+ "zero_knowledge",
+ ZeroKnowledge,
+ )
+ c_cardinality["zero_knowledge"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}IPAddress"] = ("ip_address", IPAddress)
+ c_cardinality["ip_address"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AsymmetricDecryption"] = (
+ "asymmetric_decryption",
+ AsymmetricDecryption,
+ )
+ c_cardinality["asymmetric_decryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}AsymmetricKeyAgreement"] = (
+ "asymmetric_key_agreement",
+ AsymmetricKeyAgreement,
+ )
+ c_cardinality["asymmetric_key_agreement"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}SubscriberLineNumber"] = (
+ "subscriber_line_number",
+ SubscriberLineNumber,
+ )
+ c_cardinality["subscriber_line_number"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}UserSuffix"] = (
+ "user_suffix",
+ UserSuffix,
+ )
+ c_cardinality["user_suffix"] = {"min": 0, "max": 1}
+ c_cardinality["complex_authenticator"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
c_child_order.extend(
- ['previous_session', 'resume_session', 'dig_sig', 'password',
- 'restricted_password', 'zero_knowledge',
- 'shared_secret_challenge_response', 'shared_secret_dynamic_plaintext',
- 'ip_address', 'asymmetric_decryption', 'asymmetric_key_agreement',
- 'subscriber_line_number', 'user_suffix', 'complex_authenticator',
- 'extension'])
-
- def __init__(self,
- previous_session=None,
- resume_session=None,
- dig_sig=None,
- password=None,
- restricted_password=None,
- zero_knowledge=None,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- ip_address=None,
- asymmetric_decryption=None,
- asymmetric_key_agreement=None,
- subscriber_line_number=None,
- user_suffix=None,
- complex_authenticator=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "previous_session",
+ "resume_session",
+ "dig_sig",
+ "password",
+ "restricted_password",
+ "zero_knowledge",
+ "shared_secret_challenge_response",
+ "shared_secret_dynamic_plaintext",
+ "ip_address",
+ "asymmetric_decryption",
+ "asymmetric_key_agreement",
+ "subscriber_line_number",
+ "user_suffix",
+ "complex_authenticator",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ previous_session=None,
+ resume_session=None,
+ dig_sig=None,
+ password=None,
+ restricted_password=None,
+ zero_knowledge=None,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ ip_address=None,
+ asymmetric_decryption=None,
+ asymmetric_key_agreement=None,
+ subscriber_line_number=None,
+ user_suffix=None,
+ complex_authenticator=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.previous_session = previous_session
self.resume_session = resume_session
@@ -2442,14 +2524,13 @@ class ComplexAuthenticatorType_(SamlBase):
def complex_authenticator_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ComplexAuthenticatorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ComplexAuthenticatorType_, xml_string)
class ComplexAuthenticator(ComplexAuthenticatorType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ComplexAuthenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:ComplexAuthenticator element"""
- c_tag = 'ComplexAuthenticator'
+ c_tag = "ComplexAuthenticator"
c_namespace = NAMESPACE
c_children = ComplexAuthenticatorType_.c_children.copy()
c_attributes = ComplexAuthenticatorType_.c_attributes.copy()
@@ -2463,11 +2544,11 @@ def complex_authenticator_from_string(xml_string):
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ComplexAuthenticatorType_.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
+ "{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ComplexAuthenticator"
+] = ("complex_authenticator", ComplexAuthenticator)
ComplexAuthenticator.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
+ "{urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword}ComplexAuthenticator"
+] = ("complex_authenticator", ComplexAuthenticator)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELEMENT_FROM_STRING = {
@@ -2567,102 +2648,101 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'AuthenticationContextDeclaration': AuthenticationContextDeclaration,
- 'Identification': Identification,
- 'PhysicalVerification': PhysicalVerification,
- 'WrittenConsent': WrittenConsent,
- 'TechnicalProtection': TechnicalProtection,
- 'SecretKeyProtection': SecretKeyProtection,
- 'PrivateKeyProtection': PrivateKeyProtection,
- 'KeyActivation': KeyActivation,
- 'KeySharing': KeySharing,
- 'KeyStorage': KeyStorage,
- 'SubscriberLineNumber': SubscriberLineNumber,
- 'UserSuffix': UserSuffix,
- 'Password': Password,
- 'ActivationPin': ActivationPin,
- 'Token': Token,
- 'TimeSyncToken': TimeSyncToken,
- 'Smartcard': Smartcard,
- 'Length': Length,
- 'ActivationLimit': ActivationLimit,
- 'Generation': Generation,
- 'AuthnMethod': AuthnMethod,
- 'PrincipalAuthenticationMechanism': PrincipalAuthenticationMechanism,
- 'Authenticator': Authenticator,
- 'ComplexAuthenticator': ComplexAuthenticator,
- 'PreviousSession': PreviousSession,
- 'ResumeSession': ResumeSession,
- 'ZeroKnowledge': ZeroKnowledge,
- 'SharedSecretChallengeResponse': SharedSecretChallengeResponse,
- 'SharedSecretChallengeResponseType': SharedSecretChallengeResponseType_,
- 'DigSig': DigSig,
- 'AsymmetricDecryption': AsymmetricDecryption,
- 'AsymmetricKeyAgreement': AsymmetricKeyAgreement,
- 'PublicKeyType': PublicKeyType_,
- 'IPAddress': IPAddress,
- 'SharedSecretDynamicPlaintext': SharedSecretDynamicPlaintext,
- 'AuthenticatorTransportProtocol': AuthenticatorTransportProtocol,
- 'HTTP': HTTP,
- 'IPSec': IPSec,
- 'WTLS': WTLS,
- 'MobileNetworkNoEncryption': MobileNetworkNoEncryption,
- 'MobileNetworkRadioEncryption': MobileNetworkRadioEncryption,
- 'MobileNetworkEndToEndEncryption': MobileNetworkEndToEndEncryption,
- 'SSL': SSL,
- 'PSTN': PSTN,
- 'ISDN': ISDN,
- 'ADSL': ADSL,
- 'OperationalProtection': OperationalProtection,
- 'SecurityAudit': SecurityAudit,
- 'SwitchAudit': SwitchAudit,
- 'DeactivationCallCenter': DeactivationCallCenter,
- 'GoverningAgreements': GoverningAgreements,
- 'GoverningAgreementRef': GoverningAgreementRef,
- 'nymType': NymType_,
- 'IdentificationType': IdentificationType_,
- 'TechnicalProtectionBaseType': TechnicalProtectionBaseType_,
- 'OperationalProtectionType': OperationalProtectionType_,
- 'GoverningAgreementsType': GoverningAgreementsType_,
- 'GoverningAgreementRefType': GoverningAgreementRefType_,
- 'PrincipalAuthenticationMechanismType': PrincipalAuthenticationMechanismType_,
- 'ComplexAuthenticatorType': ComplexAuthenticatorType_,
- 'AuthenticatorTransportProtocolType': AuthenticatorTransportProtocolType_,
- 'KeyActivationType': KeyActivationType_,
- 'KeySharingType': KeySharingType_,
- 'PrivateKeyProtectionType': PrivateKeyProtectionType_,
- 'PasswordType': PasswordType_,
- 'RestrictedPassword': RestrictedPassword,
- 'RestrictedPasswordType': RestrictedPasswordType_,
- 'RestrictedLengthType': RestrictedLengthType_,
- 'ActivationPinType': ActivationPinType_,
- 'Alphabet': Alphabet,
- 'AlphabetType': AlphabetType_,
- 'TokenType': TokenType_,
- 'DeviceTypeType': DeviceTypeType_,
- 'booleanType': BooleanType_,
- 'TimeSyncTokenType': TimeSyncTokenType_,
- 'ActivationLimitType': ActivationLimitType_,
- 'ActivationLimitDuration': ActivationLimitDuration,
- 'ActivationLimitUsages': ActivationLimitUsages,
- 'ActivationLimitSession': ActivationLimitSession,
- 'ActivationLimitDurationType': ActivationLimitDurationType_,
- 'ActivationLimitUsagesType': ActivationLimitUsagesType_,
- 'ActivationLimitSessionType': ActivationLimitSessionType_,
- 'LengthType': LengthType_,
- 'mediumType': MediumType_,
- 'KeyStorageType': KeyStorageType_,
- 'SecretKeyProtectionType': SecretKeyProtectionType_,
- 'SecurityAuditType': SecurityAuditType_,
- 'ExtensionOnlyType': ExtensionOnlyType_,
- 'Extension': Extension,
- 'ExtensionType': ExtensionType_,
- 'AuthnContextDeclarationBaseType': AuthnContextDeclarationBaseType_,
- 'AuthnMethodBaseType': AuthnMethodBaseType_,
- 'AuthenticatorBaseType': AuthenticatorBaseType_,
+ "AuthenticationContextDeclaration": AuthenticationContextDeclaration,
+ "Identification": Identification,
+ "PhysicalVerification": PhysicalVerification,
+ "WrittenConsent": WrittenConsent,
+ "TechnicalProtection": TechnicalProtection,
+ "SecretKeyProtection": SecretKeyProtection,
+ "PrivateKeyProtection": PrivateKeyProtection,
+ "KeyActivation": KeyActivation,
+ "KeySharing": KeySharing,
+ "KeyStorage": KeyStorage,
+ "SubscriberLineNumber": SubscriberLineNumber,
+ "UserSuffix": UserSuffix,
+ "Password": Password,
+ "ActivationPin": ActivationPin,
+ "Token": Token,
+ "TimeSyncToken": TimeSyncToken,
+ "Smartcard": Smartcard,
+ "Length": Length,
+ "ActivationLimit": ActivationLimit,
+ "Generation": Generation,
+ "AuthnMethod": AuthnMethod,
+ "PrincipalAuthenticationMechanism": PrincipalAuthenticationMechanism,
+ "Authenticator": Authenticator,
+ "ComplexAuthenticator": ComplexAuthenticator,
+ "PreviousSession": PreviousSession,
+ "ResumeSession": ResumeSession,
+ "ZeroKnowledge": ZeroKnowledge,
+ "SharedSecretChallengeResponse": SharedSecretChallengeResponse,
+ "SharedSecretChallengeResponseType": SharedSecretChallengeResponseType_,
+ "DigSig": DigSig,
+ "AsymmetricDecryption": AsymmetricDecryption,
+ "AsymmetricKeyAgreement": AsymmetricKeyAgreement,
+ "PublicKeyType": PublicKeyType_,
+ "IPAddress": IPAddress,
+ "SharedSecretDynamicPlaintext": SharedSecretDynamicPlaintext,
+ "AuthenticatorTransportProtocol": AuthenticatorTransportProtocol,
+ "HTTP": HTTP,
+ "IPSec": IPSec,
+ "WTLS": WTLS,
+ "MobileNetworkNoEncryption": MobileNetworkNoEncryption,
+ "MobileNetworkRadioEncryption": MobileNetworkRadioEncryption,
+ "MobileNetworkEndToEndEncryption": MobileNetworkEndToEndEncryption,
+ "SSL": SSL,
+ "PSTN": PSTN,
+ "ISDN": ISDN,
+ "ADSL": ADSL,
+ "OperationalProtection": OperationalProtection,
+ "SecurityAudit": SecurityAudit,
+ "SwitchAudit": SwitchAudit,
+ "DeactivationCallCenter": DeactivationCallCenter,
+ "GoverningAgreements": GoverningAgreements,
+ "GoverningAgreementRef": GoverningAgreementRef,
+ "nymType": NymType_,
+ "IdentificationType": IdentificationType_,
+ "TechnicalProtectionBaseType": TechnicalProtectionBaseType_,
+ "OperationalProtectionType": OperationalProtectionType_,
+ "GoverningAgreementsType": GoverningAgreementsType_,
+ "GoverningAgreementRefType": GoverningAgreementRefType_,
+ "PrincipalAuthenticationMechanismType": PrincipalAuthenticationMechanismType_,
+ "ComplexAuthenticatorType": ComplexAuthenticatorType_,
+ "AuthenticatorTransportProtocolType": AuthenticatorTransportProtocolType_,
+ "KeyActivationType": KeyActivationType_,
+ "KeySharingType": KeySharingType_,
+ "PrivateKeyProtectionType": PrivateKeyProtectionType_,
+ "PasswordType": PasswordType_,
+ "RestrictedPassword": RestrictedPassword,
+ "RestrictedPasswordType": RestrictedPasswordType_,
+ "RestrictedLengthType": RestrictedLengthType_,
+ "ActivationPinType": ActivationPinType_,
+ "Alphabet": Alphabet,
+ "AlphabetType": AlphabetType_,
+ "TokenType": TokenType_,
+ "DeviceTypeType": DeviceTypeType_,
+ "booleanType": BooleanType_,
+ "TimeSyncTokenType": TimeSyncTokenType_,
+ "ActivationLimitType": ActivationLimitType_,
+ "ActivationLimitDuration": ActivationLimitDuration,
+ "ActivationLimitUsages": ActivationLimitUsages,
+ "ActivationLimitSession": ActivationLimitSession,
+ "ActivationLimitDurationType": ActivationLimitDurationType_,
+ "ActivationLimitUsagesType": ActivationLimitUsagesType_,
+ "ActivationLimitSessionType": ActivationLimitSessionType_,
+ "LengthType": LengthType_,
+ "mediumType": MediumType_,
+ "KeyStorageType": KeyStorageType_,
+ "SecretKeyProtectionType": SecretKeyProtectionType_,
+ "SecurityAuditType": SecurityAuditType_,
+ "ExtensionOnlyType": ExtensionOnlyType_,
+ "Extension": Extension,
+ "ExtensionType": ExtensionType_,
+ "AuthnContextDeclarationBaseType": AuthnContextDeclarationBaseType_,
+ "AuthnMethodBaseType": AuthnMethodBaseType_,
+ "AuthenticatorBaseType": AuthenticatorBaseType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/authn_context/mobiletwofactor.py b/src/saml2/authn_context/mobiletwofactor.py
index af033742..50c40c61 100644
--- a/src/saml2/authn_context/mobiletwofactor.py
+++ b/src/saml2/authn_context/mobiletwofactor.py
@@ -15,30 +15,32 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract"
class PhysicalVerification(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PhysicalVerification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PhysicalVerification element"""
- c_tag = 'PhysicalVerification'
+ c_tag = "PhysicalVerification"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['credentialLevel'] = ('credential_level', 'None', False)
-
- def __init__(self,
- credential_level=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["credentialLevel"] = ("credential_level", "None", False)
+
+ def __init__(
+ self,
+ credential_level=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.credential_level = credential_level
@@ -48,26 +50,28 @@ def physical_verification_from_string(xml_string):
class Generation(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Generation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Generation element"""
- c_tag = 'Generation'
+ c_tag = "Generation"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['mechanism'] = ('mechanism', 'None', True)
-
- def __init__(self,
- mechanism=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["mechanism"] = ("mechanism", "None", True)
+
+ def __init__(
+ self,
+ mechanism=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.mechanism = mechanism
@@ -77,12 +81,11 @@ def generation_from_string(xml_string):
class NymType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:nymType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:nymType element"""
- c_tag = 'nymType'
+ c_tag = "nymType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['anonymity', 'verinymity', 'pseudonymity']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["anonymity", "verinymity", "pseudonymity"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -94,57 +97,59 @@ def nym_type__from_string(xml_string):
class GoverningAgreementRefType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreementRefType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreementRefType element"""
- c_tag = 'GoverningAgreementRefType'
+ c_tag = "GoverningAgreementRefType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['governingAgreementRef'] = (
- 'governing_agreement_ref', 'anyURI', True)
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["governingAgreementRef"] = ("governing_agreement_ref", "anyURI", True)
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref
def governing_agreement_ref_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementRefType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementRefType_, xml_string)
class KeySharingType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeySharingType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeySharingType element"""
- c_tag = 'KeySharingType'
+ c_tag = "KeySharingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['sharing'] = ('sharing', 'boolean', True)
-
- def __init__(self,
- sharing=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["sharing"] = ("sharing", "boolean", True)
+
+ def __init__(
+ self,
+ sharing=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.sharing = sharing
@@ -154,28 +159,30 @@ def key_sharing_type__from_string(xml_string):
class RestrictedLengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:RestrictedLengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:RestrictedLengthType element"""
- c_tag = 'RestrictedLengthType'
+ c_tag = "RestrictedLengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'None', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "None", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -186,30 +193,32 @@ def restricted_length_type__from_string(xml_string):
class AlphabetType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AlphabetType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AlphabetType element"""
- c_tag = 'AlphabetType'
+ c_tag = "AlphabetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['requiredChars'] = ('required_chars', 'string', True)
- c_attributes['excludedChars'] = ('excluded_chars', 'string', False)
- c_attributes['case'] = ('case', 'string', False)
-
- def __init__(self,
- required_chars=None,
- excluded_chars=None,
- case=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["requiredChars"] = ("required_chars", "string", True)
+ c_attributes["excludedChars"] = ("excluded_chars", "string", False)
+ c_attributes["case"] = ("case", "string", False)
+
+ def __init__(
+ self,
+ required_chars=None,
+ excluded_chars=None,
+ case=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.required_chars = required_chars
self.excluded_chars = excluded_chars
@@ -221,12 +230,11 @@ def alphabet_type__from_string(xml_string):
class DeviceTypeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:DeviceTypeType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:DeviceTypeType element"""
- c_tag = 'DeviceTypeType'
+ c_tag = "DeviceTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['hardware', 'software']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["hardware", "software"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -238,11 +246,11 @@ def device_type_type__from_string(xml_string):
class BooleanType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:booleanType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:booleanType element"""
- c_tag = 'booleanType'
+ c_tag = "booleanType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN', 'enumeration': ['true', 'false']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["true", "false"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -254,30 +262,32 @@ def boolean_type__from_string(xml_string):
class TimeSyncTokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TimeSyncTokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TimeSyncTokenType element"""
- c_tag = 'TimeSyncTokenType'
+ c_tag = "TimeSyncTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['DeviceType'] = ('device_type', DeviceTypeType_, True)
- c_attributes['SeedLength'] = ('seed_length', 'integer', True)
- c_attributes['DeviceInHand'] = ('device_in_hand', BooleanType_, True)
-
- def __init__(self,
- device_type=None,
- seed_length=None,
- device_in_hand=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["DeviceType"] = ("device_type", DeviceTypeType_, True)
+ c_attributes["SeedLength"] = ("seed_length", "integer", True)
+ c_attributes["DeviceInHand"] = ("device_in_hand", BooleanType_, True)
+
+ def __init__(
+ self,
+ device_type=None,
+ seed_length=None,
+ device_in_hand=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.device_type = device_type
self.seed_length = seed_length
@@ -289,69 +299,71 @@ def time_sync_token_type__from_string(xml_string):
class ActivationLimitDurationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitDurationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitDurationType element"""
- c_tag = 'ActivationLimitDurationType'
+ c_tag = "ActivationLimitDurationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['duration'] = ('duration', 'duration', True)
-
- def __init__(self,
- duration=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["duration"] = ("duration", "duration", True)
+
+ def __init__(
+ self,
+ duration=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.duration = duration
def activation_limit_duration_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDurationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDurationType_, xml_string)
class ActivationLimitUsagesType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitUsagesType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitUsagesType element"""
- c_tag = 'ActivationLimitUsagesType'
+ c_tag = "ActivationLimitUsagesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['number'] = ('number', 'integer', True)
-
- def __init__(self,
- number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["number"] = ("number", "integer", True)
+
+ def __init__(
+ self,
+ number=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.number = number
def activation_limit_usages_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitUsagesType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitUsagesType_, xml_string)
class ActivationLimitSessionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitSessionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitSessionType element"""
- c_tag = 'ActivationLimitSessionType'
+ c_tag = "ActivationLimitSessionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -360,33 +372,34 @@ class ActivationLimitSessionType_(SamlBase):
def activation_limit_session_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSessionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSessionType_, xml_string)
class LengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:LengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:LengthType element"""
- c_tag = 'LengthType'
+ c_tag = "LengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'integer', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "integer", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -397,13 +410,14 @@ def length_type__from_string(xml_string):
class MediumType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:mediumType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:mediumType element"""
- c_tag = 'mediumType'
+ c_tag = "mediumType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['memory', 'smartcard', 'token',
- 'MobileDevice', 'MobileAuthCard']}
+ c_value_type = {
+ "base": "xs:NMTOKEN",
+ "enumeration": ["memory", "smartcard", "token", "MobileDevice", "MobileAuthCard"],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -415,9 +429,9 @@ def medium_type__from_string(xml_string):
class ExtensionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ExtensionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ExtensionType element"""
- c_tag = 'ExtensionType'
+ c_tag = "ExtensionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -430,26 +444,28 @@ def extension_type__from_string(xml_string):
class KeyStorageType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyStorageType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyStorageType element"""
- c_tag = 'KeyStorageType'
+ c_tag = "KeyStorageType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['medium'] = ('medium', 'None', True)
-
- def __init__(self,
- medium=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["medium"] = ("medium", "None", True)
+
+ def __init__(
+ self,
+ medium=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.medium = medium
@@ -459,9 +475,9 @@ def key_storage_type__from_string(xml_string):
class KeySharing(KeySharingType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeySharing element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeySharing element"""
- c_tag = 'KeySharing'
+ c_tag = "KeySharing"
c_namespace = NAMESPACE
c_children = KeySharingType_.c_children.copy()
c_attributes = KeySharingType_.c_attributes.copy()
@@ -474,9 +490,9 @@ def key_sharing_from_string(xml_string):
class KeyStorage(KeyStorageType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyStorage element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyStorage element"""
- c_tag = 'KeyStorage'
+ c_tag = "KeyStorage"
c_namespace = NAMESPACE
c_children = KeyStorageType_.c_children.copy()
c_attributes = KeyStorageType_.c_attributes.copy()
@@ -489,9 +505,9 @@ def key_storage_from_string(xml_string):
class TimeSyncToken(TimeSyncTokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TimeSyncToken element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TimeSyncToken element"""
- c_tag = 'TimeSyncToken'
+ c_tag = "TimeSyncToken"
c_namespace = NAMESPACE
c_children = TimeSyncTokenType_.c_children.copy()
c_attributes = TimeSyncTokenType_.c_attributes.copy()
@@ -504,9 +520,9 @@ def time_sync_token_from_string(xml_string):
class Length(LengthType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Length element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Length element"""
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = LengthType_.c_children.copy()
c_attributes = LengthType_.c_attributes.copy()
@@ -519,9 +535,9 @@ def length_from_string(xml_string):
class GoverningAgreementRef(GoverningAgreementRefType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreementRef element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreementRef element"""
- c_tag = 'GoverningAgreementRef'
+ c_tag = "GoverningAgreementRef"
c_namespace = NAMESPACE
c_children = GoverningAgreementRefType_.c_children.copy()
c_attributes = GoverningAgreementRefType_.c_attributes.copy()
@@ -534,41 +550,43 @@ def governing_agreement_ref_from_string(xml_string):
class GoverningAgreementsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreementsType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreementsType element"""
- c_tag = 'GoverningAgreementsType'
+ c_tag = "GoverningAgreementsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}GoverningAgreementRef'] = (
- 'governing_agreement_ref', [GoverningAgreementRef])
- c_cardinality['governing_agreement_ref'] = {"min": 1}
- c_child_order.extend(['governing_agreement_ref'])
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}GoverningAgreementRef"] = (
+ "governing_agreement_ref",
+ [GoverningAgreementRef],
+ )
+ c_cardinality["governing_agreement_ref"] = {"min": 1}
+ c_child_order.extend(["governing_agreement_ref"])
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref or []
def governing_agreements_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementsType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementsType_, xml_string)
class RestrictedPasswordType_Length(RestrictedLengthType_):
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = RestrictedLengthType_.c_children.copy()
c_attributes = RestrictedLengthType_.c_attributes.copy()
@@ -577,14 +595,13 @@ class RestrictedPasswordType_Length(RestrictedLengthType_):
def restricted_password_type__length_from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_Length,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_Length, xml_string)
class Alphabet(AlphabetType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Alphabet element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Alphabet element"""
- c_tag = 'Alphabet'
+ c_tag = "Alphabet"
c_namespace = NAMESPACE
c_children = AlphabetType_.c_children.copy()
c_attributes = AlphabetType_.c_attributes.copy()
@@ -597,9 +614,9 @@ def alphabet_from_string(xml_string):
class ActivationLimitDuration(ActivationLimitDurationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitDuration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitDuration element"""
- c_tag = 'ActivationLimitDuration'
+ c_tag = "ActivationLimitDuration"
c_namespace = NAMESPACE
c_children = ActivationLimitDurationType_.c_children.copy()
c_attributes = ActivationLimitDurationType_.c_attributes.copy()
@@ -608,14 +625,13 @@ class ActivationLimitDuration(ActivationLimitDurationType_):
def activation_limit_duration_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDuration,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDuration, xml_string)
class ActivationLimitUsages(ActivationLimitUsagesType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitUsages element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitUsages element"""
- c_tag = 'ActivationLimitUsages'
+ c_tag = "ActivationLimitUsages"
c_namespace = NAMESPACE
c_children = ActivationLimitUsagesType_.c_children.copy()
c_attributes = ActivationLimitUsagesType_.c_attributes.copy()
@@ -628,9 +644,9 @@ def activation_limit_usages_from_string(xml_string):
class ActivationLimitSession(ActivationLimitSessionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitSession element"""
- c_tag = 'ActivationLimitSession'
+ c_tag = "ActivationLimitSession"
c_namespace = NAMESPACE
c_children = ActivationLimitSessionType_.c_children.copy()
c_attributes = ActivationLimitSessionType_.c_attributes.copy()
@@ -639,14 +655,13 @@ class ActivationLimitSession(ActivationLimitSessionType_):
def activation_limit_session_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSession,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSession, xml_string)
class Extension(ExtensionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Extension element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Extension element"""
- c_tag = 'Extension'
+ c_tag = "Extension"
c_namespace = NAMESPACE
c_children = ExtensionType_.c_children.copy()
c_attributes = ExtensionType_.c_attributes.copy()
@@ -659,69 +674,68 @@ def extension_from_string(xml_string):
class SharedSecretChallengeResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SharedSecretChallengeResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SharedSecretChallengeResponseType element"""
- c_tag = 'SharedSecretChallengeResponseType'
+ c_tag = "SharedSecretChallengeResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['method'] = ('method', 'anyURI', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- method=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["method"] = ("method", "anyURI", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ method=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.method = method
def shared_secret_challenge_response_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- SharedSecretChallengeResponseType_, xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponseType_, xml_string)
class PublicKeyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PublicKeyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PublicKeyType element"""
- c_tag = 'PublicKeyType'
+ c_tag = "PublicKeyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['keyValidation'] = ('key_validation', 'None', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- key_validation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["keyValidation"] = ("key_validation", "None", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ key_validation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.key_validation = key_validation
@@ -732,9 +746,9 @@ def public_key_type__from_string(xml_string):
class GoverningAgreements(GoverningAgreementsType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreements element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:GoverningAgreements element"""
- c_tag = 'GoverningAgreements'
+ c_tag = "GoverningAgreements"
c_namespace = NAMESPACE
c_children = GoverningAgreementsType_.c_children.copy()
c_attributes = GoverningAgreementsType_.c_attributes.copy()
@@ -747,48 +761,44 @@ def governing_agreements_from_string(xml_string):
class PasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PasswordType element"""
- c_tag = 'PasswordType'
+ c_tag = "PasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'alphabet', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "alphabet", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -802,42 +812,43 @@ def password_type__from_string(xml_string):
class RestrictedPasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:RestrictedPasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:RestrictedPasswordType element"""
- c_tag = 'RestrictedPasswordType'
+ c_tag = "RestrictedPasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Length'] = (
- 'length', RestrictedPasswordType_Length)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Length"] = (
+ "length",
+ RestrictedPasswordType_Length,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.generation = generation
@@ -846,39 +857,39 @@ class RestrictedPasswordType_(SamlBase):
def restricted_password_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_, xml_string)
class TokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TokenType element"""
- c_tag = 'TokenType'
+ c_tag = "TokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}TimeSyncToken'] = (
- 'time_sync_token', TimeSyncToken)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['time_sync_token', 'extension'])
-
- def __init__(self,
- time_sync_token=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}TimeSyncToken"] = (
+ "time_sync_token",
+ TimeSyncToken,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["time_sync_token", "extension"])
+
+ def __init__(
+ self,
+ time_sync_token=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.time_sync_token = time_sync_token
self.extension = extension or []
@@ -889,42 +900,45 @@ def token_type__from_string(xml_string):
class ActivationLimitType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimitType element"""
- c_tag = 'ActivationLimitType'
+ c_tag = "ActivationLimitType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimitDuration'] = (
- 'activation_limit_duration', ActivationLimitDuration)
- c_cardinality['activation_limit_duration'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimitUsages'] = (
- 'activation_limit_usages', ActivationLimitUsages)
- c_cardinality['activation_limit_usages'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimitSession'] = (
- 'activation_limit_session', ActivationLimitSession)
- c_cardinality['activation_limit_session'] = {"min": 0, "max": 1}
- c_child_order.extend(
- ['activation_limit_duration', 'activation_limit_usages',
- 'activation_limit_session'])
-
- def __init__(self,
- activation_limit_duration=None,
- activation_limit_usages=None,
- activation_limit_session=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimitDuration"] = (
+ "activation_limit_duration",
+ ActivationLimitDuration,
+ )
+ c_cardinality["activation_limit_duration"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimitUsages"] = (
+ "activation_limit_usages",
+ ActivationLimitUsages,
+ )
+ c_cardinality["activation_limit_usages"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimitSession"] = (
+ "activation_limit_session",
+ ActivationLimitSession,
+ )
+ c_cardinality["activation_limit_session"] = {"min": 0, "max": 1}
+ c_child_order.extend(["activation_limit_duration", "activation_limit_usages", "activation_limit_session"])
+
+ def __init__(
+ self,
+ activation_limit_duration=None,
+ activation_limit_usages=None,
+ activation_limit_session=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_limit_duration = activation_limit_duration
self.activation_limit_usages = activation_limit_usages
@@ -936,30 +950,30 @@ def activation_limit_type__from_string(xml_string):
class ExtensionOnlyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ExtensionOnlyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ExtensionOnlyType element"""
- c_tag = 'ExtensionOnlyType'
+ c_tag = "ExtensionOnlyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
@@ -969,9 +983,9 @@ def extension_only_type__from_string(xml_string):
class WrittenConsent(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:WrittenConsent element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:WrittenConsent element"""
- c_tag = 'WrittenConsent'
+ c_tag = "WrittenConsent"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -984,9 +998,9 @@ def written_consent_from_string(xml_string):
class SubscriberLineNumber(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SubscriberLineNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SubscriberLineNumber element"""
- c_tag = 'SubscriberLineNumber'
+ c_tag = "SubscriberLineNumber"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -999,9 +1013,9 @@ def subscriber_line_number_from_string(xml_string):
class UserSuffix(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:UserSuffix element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:UserSuffix element"""
- c_tag = 'UserSuffix'
+ c_tag = "UserSuffix"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1014,9 +1028,9 @@ def user_suffix_from_string(xml_string):
class Password(PasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Password element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Password element"""
- c_tag = 'Password'
+ c_tag = "Password"
c_namespace = NAMESPACE
c_children = PasswordType_.c_children.copy()
c_attributes = PasswordType_.c_attributes.copy()
@@ -1029,9 +1043,9 @@ def password_from_string(xml_string):
class Token(TokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Token element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Token element"""
- c_tag = 'Token'
+ c_tag = "Token"
c_namespace = NAMESPACE
c_children = TokenType_.c_children.copy()
c_attributes = TokenType_.c_attributes.copy()
@@ -1044,9 +1058,9 @@ def token_from_string(xml_string):
class Smartcard(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Smartcard element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Smartcard element"""
- c_tag = 'Smartcard'
+ c_tag = "Smartcard"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1059,9 +1073,9 @@ def smartcard_from_string(xml_string):
class ActivationLimit(ActivationLimitType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationLimit element"""
- c_tag = 'ActivationLimit'
+ c_tag = "ActivationLimit"
c_namespace = NAMESPACE
c_children = ActivationLimitType_.c_children.copy()
c_attributes = ActivationLimitType_.c_attributes.copy()
@@ -1074,9 +1088,9 @@ def activation_limit_from_string(xml_string):
class PreviousSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PreviousSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PreviousSession element"""
- c_tag = 'PreviousSession'
+ c_tag = "PreviousSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1089,9 +1103,9 @@ def previous_session_from_string(xml_string):
class ResumeSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ResumeSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ResumeSession element"""
- c_tag = 'ResumeSession'
+ c_tag = "ResumeSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1104,9 +1118,9 @@ def resume_session_from_string(xml_string):
class ZeroKnowledge(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ZeroKnowledge element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ZeroKnowledge element"""
- c_tag = 'ZeroKnowledge'
+ c_tag = "ZeroKnowledge"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1119,9 +1133,9 @@ def zero_knowledge_from_string(xml_string):
class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SharedSecretChallengeResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SharedSecretChallengeResponse element"""
- c_tag = 'SharedSecretChallengeResponse'
+ c_tag = "SharedSecretChallengeResponse"
c_namespace = NAMESPACE
c_children = SharedSecretChallengeResponseType_.c_children.copy()
c_attributes = SharedSecretChallengeResponseType_.c_attributes.copy()
@@ -1130,14 +1144,13 @@ class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
def shared_secret_challenge_response_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretChallengeResponse,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponse, xml_string)
class DigSig(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:DigSig element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:DigSig element"""
- c_tag = 'DigSig'
+ c_tag = "DigSig"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1150,9 +1163,9 @@ def dig_sig_from_string(xml_string):
class AsymmetricDecryption(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AsymmetricDecryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AsymmetricDecryption element"""
- c_tag = 'AsymmetricDecryption'
+ c_tag = "AsymmetricDecryption"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1165,9 +1178,9 @@ def asymmetric_decryption_from_string(xml_string):
class AsymmetricKeyAgreement(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AsymmetricKeyAgreement element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AsymmetricKeyAgreement element"""
- c_tag = 'AsymmetricKeyAgreement'
+ c_tag = "AsymmetricKeyAgreement"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1176,14 +1189,13 @@ class AsymmetricKeyAgreement(PublicKeyType_):
def asymmetric_key_agreement_from_string(xml_string):
- return saml2.create_class_from_xml_string(AsymmetricKeyAgreement,
- xml_string)
+ return saml2.create_class_from_xml_string(AsymmetricKeyAgreement, xml_string)
class IPAddress(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:IPAddress element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:IPAddress element"""
- c_tag = 'IPAddress'
+ c_tag = "IPAddress"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1196,9 +1208,9 @@ def ip_address_from_string(xml_string):
class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SharedSecretDynamicPlaintext element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SharedSecretDynamicPlaintext element"""
- c_tag = 'SharedSecretDynamicPlaintext'
+ c_tag = "SharedSecretDynamicPlaintext"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1207,14 +1219,13 @@ class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
def shared_secret_dynamic_plaintext_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext, xml_string)
class HTTP(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:HTTP element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:HTTP element"""
- c_tag = 'HTTP'
+ c_tag = "HTTP"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1227,9 +1238,9 @@ def http_from_string(xml_string):
class IPSec(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:IPSec element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:IPSec element"""
- c_tag = 'IPSec'
+ c_tag = "IPSec"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1242,9 +1253,9 @@ def ip_sec_from_string(xml_string):
class WTLS(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:WTLS element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:WTLS element"""
- c_tag = 'WTLS'
+ c_tag = "WTLS"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1257,9 +1268,9 @@ def wtls_from_string(xml_string):
class MobileNetworkNoEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:MobileNetworkNoEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:MobileNetworkNoEncryption element"""
- c_tag = 'MobileNetworkNoEncryption'
+ c_tag = "MobileNetworkNoEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1268,14 +1279,13 @@ class MobileNetworkNoEncryption(ExtensionOnlyType_):
def mobile_network_no_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkNoEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkNoEncryption, xml_string)
class MobileNetworkRadioEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:MobileNetworkRadioEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:MobileNetworkRadioEncryption element"""
- c_tag = 'MobileNetworkRadioEncryption'
+ c_tag = "MobileNetworkRadioEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1284,14 +1294,13 @@ class MobileNetworkRadioEncryption(ExtensionOnlyType_):
def mobile_network_radio_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption, xml_string)
class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:MobileNetworkEndToEndEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:MobileNetworkEndToEndEncryption element"""
- c_tag = 'MobileNetworkEndToEndEncryption'
+ c_tag = "MobileNetworkEndToEndEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1300,14 +1309,13 @@ class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
def mobile_network_end_to_end_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption, xml_string)
class SSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SSL element"""
- c_tag = 'SSL'
+ c_tag = "SSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1320,9 +1328,9 @@ def ssl_from_string(xml_string):
class PSTN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PSTN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PSTN element"""
- c_tag = 'PSTN'
+ c_tag = "PSTN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1335,9 +1343,9 @@ def pstn_from_string(xml_string):
class ISDN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ISDN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ISDN element"""
- c_tag = 'ISDN'
+ c_tag = "ISDN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1350,9 +1358,9 @@ def isdn_from_string(xml_string):
class ADSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ADSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ADSL element"""
- c_tag = 'ADSL'
+ c_tag = "ADSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1365,9 +1373,9 @@ def adsl_from_string(xml_string):
class SwitchAudit(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SwitchAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SwitchAudit element"""
- c_tag = 'SwitchAudit'
+ c_tag = "SwitchAudit"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1380,9 +1388,9 @@ def switch_audit_from_string(xml_string):
class DeactivationCallCenter(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:DeactivationCallCenter element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:DeactivationCallCenter element"""
- c_tag = 'DeactivationCallCenter'
+ c_tag = "DeactivationCallCenter"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1391,14 +1399,13 @@ class DeactivationCallCenter(ExtensionOnlyType_):
def deactivation_call_center_from_string(xml_string):
- return saml2.create_class_from_xml_string(DeactivationCallCenter,
- xml_string)
+ return saml2.create_class_from_xml_string(DeactivationCallCenter, xml_string)
class RestrictedPassword(RestrictedPasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:RestrictedPassword element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:RestrictedPassword element"""
- c_tag = 'RestrictedPassword'
+ c_tag = "RestrictedPassword"
c_namespace = NAMESPACE
c_children = RestrictedPasswordType_.c_children.copy()
c_attributes = RestrictedPasswordType_.c_attributes.copy()
@@ -1411,51 +1418,48 @@ def restricted_password_from_string(xml_string):
class ActivationPinType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationPinType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationPinType element"""
- c_tag = 'ActivationPinType'
+ c_tag = "ActivationPinType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimit'] = (
- 'activation_limit', ActivationLimit)
- c_cardinality['activation_limit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['length', 'alphabet', 'generation', 'activation_limit', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- activation_limit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationLimit"] = (
+ "activation_limit",
+ ActivationLimit,
+ )
+ c_cardinality["activation_limit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["length", "alphabet", "generation", "activation_limit", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ activation_limit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -1469,41 +1473,41 @@ def activation_pin_type__from_string(xml_string):
class ComplexAuthenticatorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ComplexAuthenticatorType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ComplexAuthenticatorType element"""
- c_tag = 'ComplexAuthenticatorType'
+ c_tag = "ComplexAuthenticatorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Password'] = (
- 'password', Password)
- c_child_order.extend(
- ['shared_secret_challenge_response', 'shared_secret_dynamic_plaintext',
- 'password'])
-
- def __init__(self,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- password=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Password"] = ("password", Password)
+ c_child_order.extend(["shared_secret_challenge_response", "shared_secret_dynamic_plaintext", "password"])
+
+ def __init__(
+ self,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ password=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.shared_secret_challenge_response = shared_secret_challenge_response
self.shared_secret_dynamic_plaintext = shared_secret_dynamic_plaintext
@@ -1511,63 +1515,67 @@ class ComplexAuthenticatorType_(SamlBase):
def complex_authenticator_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ComplexAuthenticatorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ComplexAuthenticatorType_, xml_string)
class AuthenticatorTransportProtocolType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticatorTransportProtocolType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticatorTransportProtocolType element"""
- c_tag = 'AuthenticatorTransportProtocolType'
+ c_tag = "AuthenticatorTransportProtocolType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SSL'] = (
- 'ssl', SSL)
- c_cardinality['ssl'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}MobileNetworkNoEncryption'] = (
- 'mobile_network_no_encryption', MobileNetworkNoEncryption)
- c_cardinality['mobile_network_no_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}MobileNetworkRadioEncryption'] = (
- 'mobile_network_radio_encryption', MobileNetworkRadioEncryption)
- c_cardinality['mobile_network_radio_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}MobileNetworkEndToEndEncryption'] = (
- 'mobile_network_end_to_end_encryption', MobileNetworkEndToEndEncryption)
- c_cardinality['mobile_network_end_to_end_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}WTLS'] = (
- 'wtls', WTLS)
- c_cardinality['wtls'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['ssl', 'mobile_network_no_encryption',
- 'mobile_network_radio_encryption',
- 'mobile_network_end_to_end_encryption', 'wtls',
- 'extension'])
-
- def __init__(self,
- ssl=None,
- mobile_network_no_encryption=None,
- mobile_network_radio_encryption=None,
- mobile_network_end_to_end_encryption=None,
- wtls=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SSL"] = ("ssl", SSL)
+ c_cardinality["ssl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}MobileNetworkNoEncryption"] = (
+ "mobile_network_no_encryption",
+ MobileNetworkNoEncryption,
+ )
+ c_cardinality["mobile_network_no_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}MobileNetworkRadioEncryption"] = (
+ "mobile_network_radio_encryption",
+ MobileNetworkRadioEncryption,
+ )
+ c_cardinality["mobile_network_radio_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}MobileNetworkEndToEndEncryption"] = (
+ "mobile_network_end_to_end_encryption",
+ MobileNetworkEndToEndEncryption,
+ )
+ c_cardinality["mobile_network_end_to_end_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}WTLS"] = ("wtls", WTLS)
+ c_cardinality["wtls"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ [
+ "ssl",
+ "mobile_network_no_encryption",
+ "mobile_network_radio_encryption",
+ "mobile_network_end_to_end_encryption",
+ "wtls",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ ssl=None,
+ mobile_network_no_encryption=None,
+ mobile_network_radio_encryption=None,
+ mobile_network_end_to_end_encryption=None,
+ wtls=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.ssl = ssl
self.mobile_network_no_encryption = mobile_network_no_encryption
@@ -1578,39 +1586,39 @@ class AuthenticatorTransportProtocolType_(SamlBase):
def authenticator_transport_protocol_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- AuthenticatorTransportProtocolType_, xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocolType_, xml_string)
class SecurityAuditType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecurityAuditType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecurityAuditType element"""
- c_tag = 'SecurityAuditType'
+ c_tag = "SecurityAuditType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SwitchAudit'] = (
- 'switch_audit', SwitchAudit)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['switch_audit', 'extension'])
-
- def __init__(self,
- switch_audit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SwitchAudit"] = (
+ "switch_audit",
+ SwitchAudit,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["switch_audit", "extension"])
+
+ def __init__(
+ self,
+ switch_audit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.switch_audit = switch_audit
self.extension = extension or []
@@ -1621,46 +1629,47 @@ def security_audit_type__from_string(xml_string):
class IdentificationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:IdentificationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:IdentificationType element"""
- c_tag = 'IdentificationType'
+ c_tag = "IdentificationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}PhysicalVerification'] = (
- 'physical_verification', PhysicalVerification)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}WrittenConsent'] = (
- 'written_consent', WrittenConsent)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['nym'] = ('nym', 'None', False)
- c_child_order.extend(
- ['physical_verification', 'written_consent', 'governing_agreements',
- 'extension'])
-
- def __init__(self,
- physical_verification=None,
- written_consent=None,
- governing_agreements=None,
- extension=None,
- nym=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}PhysicalVerification"] = (
+ "physical_verification",
+ PhysicalVerification,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}WrittenConsent"] = (
+ "written_consent",
+ WrittenConsent,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["nym"] = ("nym", "None", False)
+ c_child_order.extend(["physical_verification", "written_consent", "governing_agreements", "extension"])
+
+ def __init__(
+ self,
+ physical_verification=None,
+ written_consent=None,
+ governing_agreements=None,
+ extension=None,
+ nym=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.physical_verification = physical_verification
self.written_consent = written_consent
@@ -1674,9 +1683,9 @@ def identification_type__from_string(xml_string):
class Identification(IdentificationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Identification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Identification element"""
- c_tag = 'Identification'
+ c_tag = "Identification"
c_namespace = NAMESPACE
c_children = IdentificationType_.c_children.copy()
c_attributes = IdentificationType_.c_attributes.copy()
@@ -1689,9 +1698,9 @@ def identification_from_string(xml_string):
class ActivationPin(ActivationPinType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationPin element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ActivationPin element"""
- c_tag = 'ActivationPin'
+ c_tag = "ActivationPin"
c_namespace = NAMESPACE
c_children = ActivationPinType_.c_children.copy()
c_attributes = ActivationPinType_.c_attributes.copy()
@@ -1704,9 +1713,9 @@ def activation_pin_from_string(xml_string):
class ComplexAuthenticator(ComplexAuthenticatorType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ComplexAuthenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:ComplexAuthenticator element"""
- c_tag = 'ComplexAuthenticator'
+ c_tag = "ComplexAuthenticator"
c_namespace = NAMESPACE
c_children = ComplexAuthenticatorType_.c_children.copy()
c_attributes = ComplexAuthenticatorType_.c_attributes.copy()
@@ -1719,9 +1728,9 @@ def complex_authenticator_from_string(xml_string):
class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticatorTransportProtocol element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticatorTransportProtocol element"""
- c_tag = 'AuthenticatorTransportProtocol'
+ c_tag = "AuthenticatorTransportProtocol"
c_namespace = NAMESPACE
c_children = AuthenticatorTransportProtocolType_.c_children.copy()
c_attributes = AuthenticatorTransportProtocolType_.c_attributes.copy()
@@ -1730,14 +1739,13 @@ class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
def authenticator_transport_protocol_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol, xml_string)
class SecurityAudit(SecurityAuditType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecurityAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecurityAudit element"""
- c_tag = 'SecurityAudit'
+ c_tag = "SecurityAudit"
c_namespace = NAMESPACE
c_children = SecurityAuditType_.c_children.copy()
c_attributes = SecurityAuditType_.c_attributes.copy()
@@ -1750,59 +1758,53 @@ def security_audit_from_string(xml_string):
class PrincipalAuthenticationMechanismType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrincipalAuthenticationMechanismType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrincipalAuthenticationMechanismType element"""
- c_tag = 'PrincipalAuthenticationMechanismType'
+ c_tag = "PrincipalAuthenticationMechanismType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Token'] = (
- 'token', Token)
- c_cardinality['token'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Smartcard'] = (
- 'smartcard', Smartcard)
- c_cardinality['smartcard'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['preauth'] = ('preauth', 'integer', False)
- c_child_order.extend(
- ['password', 'restricted_password', 'token', 'smartcard',
- 'activation_pin', 'extension'])
-
- def __init__(self,
- password=None,
- restricted_password=None,
- token=None,
- smartcard=None,
- activation_pin=None,
- extension=None,
- preauth=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Token"] = ("token", Token)
+ c_cardinality["token"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Smartcard"] = ("smartcard", Smartcard)
+ c_cardinality["smartcard"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationPin"] = (
+ "activation_pin",
+ ActivationPin,
+ )
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["preauth"] = ("preauth", "integer", False)
+ c_child_order.extend(["password", "restricted_password", "token", "smartcard", "activation_pin", "extension"])
+
+ def __init__(
+ self,
+ password=None,
+ restricted_password=None,
+ token=None,
+ smartcard=None,
+ activation_pin=None,
+ extension=None,
+ preauth=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.password = password
self.restricted_password = restricted_password
@@ -1814,40 +1816,40 @@ class PrincipalAuthenticationMechanismType_(SamlBase):
def principal_authentication_mechanism_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- PrincipalAuthenticationMechanismType_, xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanismType_, xml_string)
class KeyActivationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyActivationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyActivationType element"""
- c_tag = 'KeyActivationType'
+ c_tag = "KeyActivationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['activation_pin', 'extension'])
-
- def __init__(self,
- activation_pin=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ActivationPin"] = (
+ "activation_pin",
+ ActivationPin,
+ )
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["activation_pin", "extension"])
+
+ def __init__(
+ self,
+ activation_pin=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_pin = activation_pin
self.extension = extension or []
@@ -1858,68 +1860,80 @@ def key_activation_type__from_string(xml_string):
class AuthenticatorBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticatorBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticatorBaseType element"""
- c_tag = 'AuthenticatorBaseType'
+ c_tag = "AuthenticatorBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}DigSig'] = (
- 'dig_sig', DigSig)
- c_cardinality['dig_sig'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ZeroKnowledge'] = (
- 'zero_knowledge', ZeroKnowledge)
- c_cardinality['zero_knowledge'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AsymmetricDecryption'] = (
- 'asymmetric_decryption', AsymmetricDecryption)
- c_cardinality['asymmetric_decryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AsymmetricKeyAgreement'] = (
- 'asymmetric_key_agreement', AsymmetricKeyAgreement)
- c_cardinality['asymmetric_key_agreement'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
- c_cardinality['complex_authenticator'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}DigSig"] = ("dig_sig", DigSig)
+ c_cardinality["dig_sig"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ZeroKnowledge"] = (
+ "zero_knowledge",
+ ZeroKnowledge,
+ )
+ c_cardinality["zero_knowledge"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AsymmetricDecryption"] = (
+ "asymmetric_decryption",
+ AsymmetricDecryption,
+ )
+ c_cardinality["asymmetric_decryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AsymmetricKeyAgreement"] = (
+ "asymmetric_key_agreement",
+ AsymmetricKeyAgreement,
+ )
+ c_cardinality["asymmetric_key_agreement"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+ )
+ c_cardinality["complex_authenticator"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
c_child_order.extend(
- ['dig_sig', 'zero_knowledge', 'shared_secret_challenge_response',
- 'shared_secret_dynamic_plaintext', 'asymmetric_decryption',
- 'asymmetric_key_agreement', 'complex_authenticator', 'extension'])
-
- def __init__(self,
- dig_sig=None,
- zero_knowledge=None,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- asymmetric_decryption=None,
- asymmetric_key_agreement=None,
- complex_authenticator=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "dig_sig",
+ "zero_knowledge",
+ "shared_secret_challenge_response",
+ "shared_secret_dynamic_plaintext",
+ "asymmetric_decryption",
+ "asymmetric_key_agreement",
+ "complex_authenticator",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ dig_sig=None,
+ zero_knowledge=None,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ asymmetric_decryption=None,
+ asymmetric_key_agreement=None,
+ complex_authenticator=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.dig_sig = dig_sig
self.zero_knowledge = zero_knowledge
@@ -1932,44 +1946,44 @@ class AuthenticatorBaseType_(SamlBase):
def authenticator_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorBaseType_, xml_string)
class OperationalProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:OperationalProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:OperationalProtectionType element"""
- c_tag = 'OperationalProtectionType'
+ c_tag = "OperationalProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SecurityAudit'] = (
- 'security_audit', SecurityAudit)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}DeactivationCallCenter'] = (
- 'deactivation_call_center', DeactivationCallCenter)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['security_audit', 'deactivation_call_center', 'extension'])
-
- def __init__(self,
- security_audit=None,
- deactivation_call_center=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SecurityAudit"] = (
+ "security_audit",
+ SecurityAudit,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}DeactivationCallCenter"] = (
+ "deactivation_call_center",
+ DeactivationCallCenter,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["security_audit", "deactivation_call_center", "extension"])
+
+ def __init__(
+ self,
+ security_audit=None,
+ deactivation_call_center=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.security_audit = security_audit
self.deactivation_call_center = deactivation_call_center
@@ -1977,14 +1991,13 @@ class OperationalProtectionType_(SamlBase):
def operational_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(OperationalProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(OperationalProtectionType_, xml_string)
class KeyActivation(KeyActivationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyActivation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:KeyActivation element"""
- c_tag = 'KeyActivation'
+ c_tag = "KeyActivation"
c_namespace = NAMESPACE
c_children = KeyActivationType_.c_children.copy()
c_attributes = KeyActivationType_.c_attributes.copy()
@@ -1997,9 +2010,9 @@ def key_activation_from_string(xml_string):
class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrincipalAuthenticationMechanism element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrincipalAuthenticationMechanism element"""
- c_tag = 'PrincipalAuthenticationMechanism'
+ c_tag = "PrincipalAuthenticationMechanism"
c_namespace = NAMESPACE
c_children = PrincipalAuthenticationMechanismType_.c_children.copy()
c_attributes = PrincipalAuthenticationMechanismType_.c_attributes.copy()
@@ -2008,14 +2021,13 @@ class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
def principal_authentication_mechanism_from_string(xml_string):
- return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism,
- xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism, xml_string)
class Authenticator(AuthenticatorBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Authenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:Authenticator element"""
- c_tag = 'Authenticator'
+ c_tag = "Authenticator"
c_namespace = NAMESPACE
c_children = AuthenticatorBaseType_.c_children.copy()
c_attributes = AuthenticatorBaseType_.c_attributes.copy()
@@ -2028,9 +2040,9 @@ def authenticator_from_string(xml_string):
class OperationalProtection(OperationalProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:OperationalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:OperationalProtection element"""
- c_tag = 'OperationalProtection'
+ c_tag = "OperationalProtection"
c_namespace = NAMESPACE
c_children = OperationalProtectionType_.c_children.copy()
c_attributes = OperationalProtectionType_.c_attributes.copy()
@@ -2043,45 +2055,49 @@ def operational_protection_from_string(xml_string):
class AuthnMethodBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthnMethodBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthnMethodBaseType element"""
- c_tag = 'AuthnMethodBaseType'
+ c_tag = "AuthnMethodBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}PrincipalAuthenticationMechanism'] = (
- 'principal_authentication_mechanism', PrincipalAuthenticationMechanism)
- c_cardinality['principal_authentication_mechanism'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Authenticator'] = (
- 'authenticator', Authenticator)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AuthenticatorTransportProtocol'] = (
- 'authenticator_transport_protocol', AuthenticatorTransportProtocol)
- c_cardinality['authenticator_transport_protocol'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['principal_authentication_mechanism', 'authenticator',
- 'authenticator_transport_protocol', 'extension'])
-
- def __init__(self,
- principal_authentication_mechanism=None,
- authenticator=None,
- authenticator_transport_protocol=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}PrincipalAuthenticationMechanism"] = (
+ "principal_authentication_mechanism",
+ PrincipalAuthenticationMechanism,
+ )
+ c_cardinality["principal_authentication_mechanism"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Authenticator"] = (
+ "authenticator",
+ Authenticator,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AuthenticatorTransportProtocol"] = (
+ "authenticator_transport_protocol",
+ AuthenticatorTransportProtocol,
+ )
+ c_cardinality["authenticator_transport_protocol"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ ["principal_authentication_mechanism", "authenticator", "authenticator_transport_protocol", "extension"]
+ )
+
+ def __init__(
+ self,
+ principal_authentication_mechanism=None,
+ authenticator=None,
+ authenticator_transport_protocol=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.principal_authentication_mechanism = principal_authentication_mechanism
self.authenticator = authenticator
@@ -2094,38 +2110,40 @@ def authn_method_base_type__from_string(xml_string):
class PrivateKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrivateKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrivateKeyProtectionType element"""
- c_tag = 'PrivateKeyProtectionType'
+ c_tag = "PrivateKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['key_activation', 'key_storage', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyStorage"] = (
+ "key_storage",
+ KeyStorage,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -2133,44 +2151,47 @@ class PrivateKeyProtectionType_(SamlBase):
def private_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(PrivateKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(PrivateKeyProtectionType_, xml_string)
class SecretKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecretKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecretKeyProtectionType element"""
- c_tag = 'SecretKeyProtectionType'
+ c_tag = "SecretKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract' \
- '}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['key_activation', 'key_storage', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}KeyStorage"] = (
+ "key_storage",
+ KeyStorage,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract" "}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -2178,14 +2199,13 @@ class SecretKeyProtectionType_(SamlBase):
def secret_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SecretKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SecretKeyProtectionType_, xml_string)
class SecretKeyProtection(SecretKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecretKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:SecretKeyProtection element"""
- c_tag = 'SecretKeyProtection'
+ c_tag = "SecretKeyProtection"
c_namespace = NAMESPACE
c_children = SecretKeyProtectionType_.c_children.copy()
c_attributes = SecretKeyProtectionType_.c_attributes.copy()
@@ -2198,9 +2218,9 @@ def secret_key_protection_from_string(xml_string):
class PrivateKeyProtection(PrivateKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrivateKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:PrivateKeyProtection element"""
- c_tag = 'PrivateKeyProtection'
+ c_tag = "PrivateKeyProtection"
c_namespace = NAMESPACE
c_children = PrivateKeyProtectionType_.c_children.copy()
c_attributes = PrivateKeyProtectionType_.c_attributes.copy()
@@ -2213,9 +2233,9 @@ def private_key_protection_from_string(xml_string):
class AuthnMethod(AuthnMethodBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthnMethod element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthnMethod element"""
- c_tag = 'AuthnMethod'
+ c_tag = "AuthnMethod"
c_namespace = NAMESPACE
c_children = AuthnMethodBaseType_.c_children.copy()
c_attributes = AuthnMethodBaseType_.c_attributes.copy()
@@ -2228,41 +2248,42 @@ def authn_method_from_string(xml_string):
class TechnicalProtectionBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TechnicalProtectionBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TechnicalProtectionBaseType element"""
- c_tag = 'TechnicalProtectionBaseType'
+ c_tag = "TechnicalProtectionBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}PrivateKeyProtection'] = (
- 'private_key_protection', PrivateKeyProtection)
- c_cardinality['private_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SecretKeyProtection'] = (
- 'secret_key_protection', SecretKeyProtection)
- c_cardinality['secret_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['private_key_protection', 'secret_key_protection', 'extension'])
-
- def __init__(self,
- private_key_protection=None,
- secret_key_protection=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}PrivateKeyProtection"] = (
+ "private_key_protection",
+ PrivateKeyProtection,
+ )
+ c_cardinality["private_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}SecretKeyProtection"] = (
+ "secret_key_protection",
+ SecretKeyProtection,
+ )
+ c_cardinality["secret_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["private_key_protection", "secret_key_protection", "extension"])
+
+ def __init__(
+ self,
+ private_key_protection=None,
+ secret_key_protection=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.private_key_protection = private_key_protection
self.secret_key_protection = secret_key_protection
@@ -2270,14 +2291,13 @@ class TechnicalProtectionBaseType_(SamlBase):
def technical_protection_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_, xml_string)
class TechnicalProtection(TechnicalProtectionBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TechnicalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:TechnicalProtection element"""
- c_tag = 'TechnicalProtection'
+ c_tag = "TechnicalProtection"
c_namespace = NAMESPACE
c_children = TechnicalProtectionBaseType_.c_children.copy()
c_attributes = TechnicalProtectionBaseType_.c_attributes.copy()
@@ -2290,58 +2310,70 @@ def technical_protection_from_string(xml_string):
class AuthnContextDeclarationBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthnContextDeclarationBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthnContextDeclarationBaseType element"""
- c_tag = 'AuthnContextDeclarationBaseType'
+ c_tag = "AuthnContextDeclarationBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Identification'] = (
- 'identification', Identification)
- c_cardinality['identification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}TechnicalProtection'] = (
- 'technical_protection', TechnicalProtection)
- c_cardinality['technical_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}OperationalProtection'] = (
- 'operational_protection', OperationalProtection)
- c_cardinality['operational_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AuthnMethod'] = (
- 'authn_method', AuthnMethod)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ID'] = ('id', 'ID', False)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Identification"] = (
+ "identification",
+ Identification,
+ )
+ c_cardinality["identification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}TechnicalProtection"] = (
+ "technical_protection",
+ TechnicalProtection,
+ )
+ c_cardinality["technical_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}OperationalProtection"] = (
+ "operational_protection",
+ OperationalProtection,
+ )
+ c_cardinality["operational_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}AuthnMethod"] = (
+ "authn_method",
+ AuthnMethod,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ID"] = ("id", "ID", False)
c_child_order.extend(
- ['identification', 'technical_protection', 'operational_protection',
- 'authn_method', 'governing_agreements', 'extension'])
-
- def __init__(self,
- identification=None,
- technical_protection=None,
- operational_protection=None,
- authn_method=None,
- governing_agreements=None,
- extension=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "identification",
+ "technical_protection",
+ "operational_protection",
+ "authn_method",
+ "governing_agreements",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ identification=None,
+ technical_protection=None,
+ operational_protection=None,
+ authn_method=None,
+ governing_agreements=None,
+ extension=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.identification = identification
self.technical_protection = technical_protection
@@ -2353,14 +2385,13 @@ class AuthnContextDeclarationBaseType_(SamlBase):
def authn_context_declaration_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_, xml_string)
class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticationContextDeclaration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract:AuthenticationContextDeclaration element"""
- c_tag = 'AuthenticationContextDeclaration'
+ c_tag = "AuthenticationContextDeclaration"
c_namespace = NAMESPACE
c_children = AuthnContextDeclarationBaseType_.c_children.copy()
c_attributes = AuthnContextDeclarationBaseType_.c_attributes.copy()
@@ -2369,8 +2400,7 @@ class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
def authentication_context_declaration_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticationContextDeclaration,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticationContextDeclaration, xml_string)
ELEMENT_FROM_STRING = {
@@ -2470,102 +2500,101 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'AuthenticationContextDeclaration': AuthenticationContextDeclaration,
- 'Identification': Identification,
- 'PhysicalVerification': PhysicalVerification,
- 'WrittenConsent': WrittenConsent,
- 'TechnicalProtection': TechnicalProtection,
- 'SecretKeyProtection': SecretKeyProtection,
- 'PrivateKeyProtection': PrivateKeyProtection,
- 'KeyActivation': KeyActivation,
- 'KeySharing': KeySharing,
- 'KeyStorage': KeyStorage,
- 'SubscriberLineNumber': SubscriberLineNumber,
- 'UserSuffix': UserSuffix,
- 'Password': Password,
- 'ActivationPin': ActivationPin,
- 'Token': Token,
- 'TimeSyncToken': TimeSyncToken,
- 'Smartcard': Smartcard,
- 'Length': Length,
- 'ActivationLimit': ActivationLimit,
- 'Generation': Generation,
- 'AuthnMethod': AuthnMethod,
- 'PrincipalAuthenticationMechanism': PrincipalAuthenticationMechanism,
- 'Authenticator': Authenticator,
- 'ComplexAuthenticator': ComplexAuthenticator,
- 'PreviousSession': PreviousSession,
- 'ResumeSession': ResumeSession,
- 'ZeroKnowledge': ZeroKnowledge,
- 'SharedSecretChallengeResponse': SharedSecretChallengeResponse,
- 'SharedSecretChallengeResponseType': SharedSecretChallengeResponseType_,
- 'DigSig': DigSig,
- 'AsymmetricDecryption': AsymmetricDecryption,
- 'AsymmetricKeyAgreement': AsymmetricKeyAgreement,
- 'PublicKeyType': PublicKeyType_,
- 'IPAddress': IPAddress,
- 'SharedSecretDynamicPlaintext': SharedSecretDynamicPlaintext,
- 'AuthenticatorTransportProtocol': AuthenticatorTransportProtocol,
- 'HTTP': HTTP,
- 'IPSec': IPSec,
- 'WTLS': WTLS,
- 'MobileNetworkNoEncryption': MobileNetworkNoEncryption,
- 'MobileNetworkRadioEncryption': MobileNetworkRadioEncryption,
- 'MobileNetworkEndToEndEncryption': MobileNetworkEndToEndEncryption,
- 'SSL': SSL,
- 'PSTN': PSTN,
- 'ISDN': ISDN,
- 'ADSL': ADSL,
- 'OperationalProtection': OperationalProtection,
- 'SecurityAudit': SecurityAudit,
- 'SwitchAudit': SwitchAudit,
- 'DeactivationCallCenter': DeactivationCallCenter,
- 'GoverningAgreements': GoverningAgreements,
- 'GoverningAgreementRef': GoverningAgreementRef,
- 'nymType': NymType_,
- 'GoverningAgreementsType': GoverningAgreementsType_,
- 'GoverningAgreementRefType': GoverningAgreementRefType_,
- 'PrincipalAuthenticationMechanismType': PrincipalAuthenticationMechanismType_,
- 'KeyActivationType': KeyActivationType_,
- 'KeySharingType': KeySharingType_,
- 'PasswordType': PasswordType_,
- 'RestrictedPassword': RestrictedPassword,
- 'RestrictedPasswordType': RestrictedPasswordType_,
- 'RestrictedLengthType': RestrictedLengthType_,
- 'ActivationPinType': ActivationPinType_,
- 'Alphabet': Alphabet,
- 'AlphabetType': AlphabetType_,
- 'TokenType': TokenType_,
- 'DeviceTypeType': DeviceTypeType_,
- 'booleanType': BooleanType_,
- 'TimeSyncTokenType': TimeSyncTokenType_,
- 'ActivationLimitType': ActivationLimitType_,
- 'ActivationLimitDuration': ActivationLimitDuration,
- 'ActivationLimitUsages': ActivationLimitUsages,
- 'ActivationLimitSession': ActivationLimitSession,
- 'ActivationLimitDurationType': ActivationLimitDurationType_,
- 'ActivationLimitUsagesType': ActivationLimitUsagesType_,
- 'ActivationLimitSessionType': ActivationLimitSessionType_,
- 'LengthType': LengthType_,
- 'mediumType': MediumType_,
- 'ExtensionOnlyType': ExtensionOnlyType_,
- 'Extension': Extension,
- 'ExtensionType': ExtensionType_,
- 'AuthnContextDeclarationBaseType': AuthnContextDeclarationBaseType_,
- 'AuthnMethodBaseType': AuthnMethodBaseType_,
- 'AuthenticatorBaseType': AuthenticatorBaseType_,
- 'ComplexAuthenticatorType': ComplexAuthenticatorType_,
- 'AuthenticatorTransportProtocolType': AuthenticatorTransportProtocolType_,
- 'OperationalProtectionType': OperationalProtectionType_,
- 'TechnicalProtectionBaseType': TechnicalProtectionBaseType_,
- 'PrivateKeyProtectionType': PrivateKeyProtectionType_,
- 'SecretKeyProtectionType': SecretKeyProtectionType_,
- 'KeyStorageType': KeyStorageType_,
- 'SecurityAuditType': SecurityAuditType_,
- 'IdentificationType': IdentificationType_,
+ "AuthenticationContextDeclaration": AuthenticationContextDeclaration,
+ "Identification": Identification,
+ "PhysicalVerification": PhysicalVerification,
+ "WrittenConsent": WrittenConsent,
+ "TechnicalProtection": TechnicalProtection,
+ "SecretKeyProtection": SecretKeyProtection,
+ "PrivateKeyProtection": PrivateKeyProtection,
+ "KeyActivation": KeyActivation,
+ "KeySharing": KeySharing,
+ "KeyStorage": KeyStorage,
+ "SubscriberLineNumber": SubscriberLineNumber,
+ "UserSuffix": UserSuffix,
+ "Password": Password,
+ "ActivationPin": ActivationPin,
+ "Token": Token,
+ "TimeSyncToken": TimeSyncToken,
+ "Smartcard": Smartcard,
+ "Length": Length,
+ "ActivationLimit": ActivationLimit,
+ "Generation": Generation,
+ "AuthnMethod": AuthnMethod,
+ "PrincipalAuthenticationMechanism": PrincipalAuthenticationMechanism,
+ "Authenticator": Authenticator,
+ "ComplexAuthenticator": ComplexAuthenticator,
+ "PreviousSession": PreviousSession,
+ "ResumeSession": ResumeSession,
+ "ZeroKnowledge": ZeroKnowledge,
+ "SharedSecretChallengeResponse": SharedSecretChallengeResponse,
+ "SharedSecretChallengeResponseType": SharedSecretChallengeResponseType_,
+ "DigSig": DigSig,
+ "AsymmetricDecryption": AsymmetricDecryption,
+ "AsymmetricKeyAgreement": AsymmetricKeyAgreement,
+ "PublicKeyType": PublicKeyType_,
+ "IPAddress": IPAddress,
+ "SharedSecretDynamicPlaintext": SharedSecretDynamicPlaintext,
+ "AuthenticatorTransportProtocol": AuthenticatorTransportProtocol,
+ "HTTP": HTTP,
+ "IPSec": IPSec,
+ "WTLS": WTLS,
+ "MobileNetworkNoEncryption": MobileNetworkNoEncryption,
+ "MobileNetworkRadioEncryption": MobileNetworkRadioEncryption,
+ "MobileNetworkEndToEndEncryption": MobileNetworkEndToEndEncryption,
+ "SSL": SSL,
+ "PSTN": PSTN,
+ "ISDN": ISDN,
+ "ADSL": ADSL,
+ "OperationalProtection": OperationalProtection,
+ "SecurityAudit": SecurityAudit,
+ "SwitchAudit": SwitchAudit,
+ "DeactivationCallCenter": DeactivationCallCenter,
+ "GoverningAgreements": GoverningAgreements,
+ "GoverningAgreementRef": GoverningAgreementRef,
+ "nymType": NymType_,
+ "GoverningAgreementsType": GoverningAgreementsType_,
+ "GoverningAgreementRefType": GoverningAgreementRefType_,
+ "PrincipalAuthenticationMechanismType": PrincipalAuthenticationMechanismType_,
+ "KeyActivationType": KeyActivationType_,
+ "KeySharingType": KeySharingType_,
+ "PasswordType": PasswordType_,
+ "RestrictedPassword": RestrictedPassword,
+ "RestrictedPasswordType": RestrictedPasswordType_,
+ "RestrictedLengthType": RestrictedLengthType_,
+ "ActivationPinType": ActivationPinType_,
+ "Alphabet": Alphabet,
+ "AlphabetType": AlphabetType_,
+ "TokenType": TokenType_,
+ "DeviceTypeType": DeviceTypeType_,
+ "booleanType": BooleanType_,
+ "TimeSyncTokenType": TimeSyncTokenType_,
+ "ActivationLimitType": ActivationLimitType_,
+ "ActivationLimitDuration": ActivationLimitDuration,
+ "ActivationLimitUsages": ActivationLimitUsages,
+ "ActivationLimitSession": ActivationLimitSession,
+ "ActivationLimitDurationType": ActivationLimitDurationType_,
+ "ActivationLimitUsagesType": ActivationLimitUsagesType_,
+ "ActivationLimitSessionType": ActivationLimitSessionType_,
+ "LengthType": LengthType_,
+ "mediumType": MediumType_,
+ "ExtensionOnlyType": ExtensionOnlyType_,
+ "Extension": Extension,
+ "ExtensionType": ExtensionType_,
+ "AuthnContextDeclarationBaseType": AuthnContextDeclarationBaseType_,
+ "AuthnMethodBaseType": AuthnMethodBaseType_,
+ "AuthenticatorBaseType": AuthenticatorBaseType_,
+ "ComplexAuthenticatorType": ComplexAuthenticatorType_,
+ "AuthenticatorTransportProtocolType": AuthenticatorTransportProtocolType_,
+ "OperationalProtectionType": OperationalProtectionType_,
+ "TechnicalProtectionBaseType": TechnicalProtectionBaseType_,
+ "PrivateKeyProtectionType": PrivateKeyProtectionType_,
+ "SecretKeyProtectionType": SecretKeyProtectionType_,
+ "KeyStorageType": KeyStorageType_,
+ "SecurityAuditType": SecurityAuditType_,
+ "IdentificationType": IdentificationType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/authn_context/ppt.py b/src/saml2/authn_context/ppt.py
index 6635ad88..baba191c 100644
--- a/src/saml2/authn_context/ppt.py
+++ b/src/saml2/authn_context/ppt.py
@@ -12,30 +12,32 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
class PhysicalVerification(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PhysicalVerification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PhysicalVerification element"""
- c_tag = 'PhysicalVerification'
+ c_tag = "PhysicalVerification"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['credentialLevel'] = ('credential_level', 'None', False)
-
- def __init__(self,
- credential_level=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["credentialLevel"] = ("credential_level", "None", False)
+
+ def __init__(
+ self,
+ credential_level=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.credential_level = credential_level
@@ -45,26 +47,28 @@ def physical_verification_from_string(xml_string):
class Generation(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Generation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Generation element"""
- c_tag = 'Generation'
+ c_tag = "Generation"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['mechanism'] = ('mechanism', 'None', True)
-
- def __init__(self,
- mechanism=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["mechanism"] = ("mechanism", "None", True)
+
+ def __init__(
+ self,
+ mechanism=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.mechanism = mechanism
@@ -74,12 +78,11 @@ def generation_from_string(xml_string):
class NymType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:nymType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:nymType element"""
- c_tag = 'nymType'
+ c_tag = "nymType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['anonymity', 'verinymity', 'pseudonymity']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["anonymity", "verinymity", "pseudonymity"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -91,57 +94,59 @@ def nym_type__from_string(xml_string):
class GoverningAgreementRefType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreementRefType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreementRefType element"""
- c_tag = 'GoverningAgreementRefType'
+ c_tag = "GoverningAgreementRefType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['governingAgreementRef'] = (
- 'governing_agreement_ref', 'anyURI', True)
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["governingAgreementRef"] = ("governing_agreement_ref", "anyURI", True)
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref
def governing_agreement_ref_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementRefType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementRefType_, xml_string)
class KeySharingType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeySharingType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeySharingType element"""
- c_tag = 'KeySharingType'
+ c_tag = "KeySharingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['sharing'] = ('sharing', 'boolean', True)
-
- def __init__(self,
- sharing=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["sharing"] = ("sharing", "boolean", True)
+
+ def __init__(
+ self,
+ sharing=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.sharing = sharing
@@ -151,28 +156,30 @@ def key_sharing_type__from_string(xml_string):
class RestrictedLengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:RestrictedLengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:RestrictedLengthType element"""
- c_tag = 'RestrictedLengthType'
+ c_tag = "RestrictedLengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'None', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "None", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -183,30 +190,32 @@ def restricted_length_type__from_string(xml_string):
class AlphabetType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AlphabetType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AlphabetType element"""
- c_tag = 'AlphabetType'
+ c_tag = "AlphabetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['requiredChars'] = ('required_chars', 'string', True)
- c_attributes['excludedChars'] = ('excluded_chars', 'string', False)
- c_attributes['case'] = ('case', 'string', False)
-
- def __init__(self,
- required_chars=None,
- excluded_chars=None,
- case=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["requiredChars"] = ("required_chars", "string", True)
+ c_attributes["excludedChars"] = ("excluded_chars", "string", False)
+ c_attributes["case"] = ("case", "string", False)
+
+ def __init__(
+ self,
+ required_chars=None,
+ excluded_chars=None,
+ case=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.required_chars = required_chars
self.excluded_chars = excluded_chars
@@ -218,12 +227,11 @@ def alphabet_type__from_string(xml_string):
class DeviceTypeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:DeviceTypeType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:DeviceTypeType element"""
- c_tag = 'DeviceTypeType'
+ c_tag = "DeviceTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['hardware', 'software']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["hardware", "software"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -235,11 +243,11 @@ def device_type_type__from_string(xml_string):
class BooleanType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:booleanType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:booleanType element"""
- c_tag = 'booleanType'
+ c_tag = "booleanType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN', 'enumeration': ['true', 'false']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["true", "false"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -251,30 +259,32 @@ def boolean_type__from_string(xml_string):
class TimeSyncTokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TimeSyncTokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TimeSyncTokenType element"""
- c_tag = 'TimeSyncTokenType'
+ c_tag = "TimeSyncTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['DeviceType'] = ('device_type', DeviceTypeType_, True)
- c_attributes['SeedLength'] = ('seed_length', 'integer', True)
- c_attributes['DeviceInHand'] = ('device_in_hand', BooleanType_, True)
-
- def __init__(self,
- device_type=None,
- seed_length=None,
- device_in_hand=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["DeviceType"] = ("device_type", DeviceTypeType_, True)
+ c_attributes["SeedLength"] = ("seed_length", "integer", True)
+ c_attributes["DeviceInHand"] = ("device_in_hand", BooleanType_, True)
+
+ def __init__(
+ self,
+ device_type=None,
+ seed_length=None,
+ device_in_hand=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.device_type = device_type
self.seed_length = seed_length
@@ -286,69 +296,71 @@ def time_sync_token_type__from_string(xml_string):
class ActivationLimitDurationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitDurationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitDurationType element"""
- c_tag = 'ActivationLimitDurationType'
+ c_tag = "ActivationLimitDurationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['duration'] = ('duration', 'duration', True)
-
- def __init__(self,
- duration=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["duration"] = ("duration", "duration", True)
+
+ def __init__(
+ self,
+ duration=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.duration = duration
def activation_limit_duration_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDurationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDurationType_, xml_string)
class ActivationLimitUsagesType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitUsagesType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitUsagesType element"""
- c_tag = 'ActivationLimitUsagesType'
+ c_tag = "ActivationLimitUsagesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['number'] = ('number', 'integer', True)
-
- def __init__(self,
- number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["number"] = ("number", "integer", True)
+
+ def __init__(
+ self,
+ number=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.number = number
def activation_limit_usages_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitUsagesType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitUsagesType_, xml_string)
class ActivationLimitSessionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitSessionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitSessionType element"""
- c_tag = 'ActivationLimitSessionType'
+ c_tag = "ActivationLimitSessionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -357,33 +369,34 @@ class ActivationLimitSessionType_(SamlBase):
def activation_limit_session_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSessionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSessionType_, xml_string)
class LengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:LengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:LengthType element"""
- c_tag = 'LengthType'
+ c_tag = "LengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'integer', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "integer", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -394,13 +407,14 @@ def length_type__from_string(xml_string):
class MediumType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:mediumType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:mediumType element"""
- c_tag = 'mediumType'
+ c_tag = "mediumType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['memory', 'smartcard', 'token',
- 'MobileDevice', 'MobileAuthCard']}
+ c_value_type = {
+ "base": "xs:NMTOKEN",
+ "enumeration": ["memory", "smartcard", "token", "MobileDevice", "MobileAuthCard"],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -412,26 +426,28 @@ def medium_type__from_string(xml_string):
class KeyStorageType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyStorageType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyStorageType element"""
- c_tag = 'KeyStorageType'
+ c_tag = "KeyStorageType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['medium'] = ('medium', MediumType_, True)
-
- def __init__(self,
- medium=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["medium"] = ("medium", MediumType_, True)
+
+ def __init__(
+ self,
+ medium=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.medium = medium
@@ -441,9 +457,9 @@ def key_storage_type__from_string(xml_string):
class ExtensionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ExtensionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ExtensionType element"""
- c_tag = 'ExtensionType'
+ c_tag = "ExtensionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -456,9 +472,9 @@ def extension_type__from_string(xml_string):
class KeySharing(KeySharingType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeySharing element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeySharing element"""
- c_tag = 'KeySharing'
+ c_tag = "KeySharing"
c_namespace = NAMESPACE
c_children = KeySharingType_.c_children.copy()
c_attributes = KeySharingType_.c_attributes.copy()
@@ -471,9 +487,9 @@ def key_sharing_from_string(xml_string):
class KeyStorage(KeyStorageType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyStorage element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyStorage element"""
- c_tag = 'KeyStorage'
+ c_tag = "KeyStorage"
c_namespace = NAMESPACE
c_children = KeyStorageType_.c_children.copy()
c_attributes = KeyStorageType_.c_attributes.copy()
@@ -486,9 +502,9 @@ def key_storage_from_string(xml_string):
class TimeSyncToken(TimeSyncTokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TimeSyncToken element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TimeSyncToken element"""
- c_tag = 'TimeSyncToken'
+ c_tag = "TimeSyncToken"
c_namespace = NAMESPACE
c_children = TimeSyncTokenType_.c_children.copy()
c_attributes = TimeSyncTokenType_.c_attributes.copy()
@@ -501,9 +517,9 @@ def time_sync_token_from_string(xml_string):
class Length(LengthType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Length element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Length element"""
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = LengthType_.c_children.copy()
c_attributes = LengthType_.c_attributes.copy()
@@ -516,9 +532,9 @@ def length_from_string(xml_string):
class GoverningAgreementRef(GoverningAgreementRefType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreementRef element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreementRef element"""
- c_tag = 'GoverningAgreementRef'
+ c_tag = "GoverningAgreementRef"
c_namespace = NAMESPACE
c_children = GoverningAgreementRefType_.c_children.copy()
c_attributes = GoverningAgreementRefType_.c_attributes.copy()
@@ -531,41 +547,43 @@ def governing_agreement_ref_from_string(xml_string):
class GoverningAgreementsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreementsType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreementsType element"""
- c_tag = 'GoverningAgreementsType'
+ c_tag = "GoverningAgreementsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}GoverningAgreementRef'] = (
- 'governing_agreement_ref', [GoverningAgreementRef])
- c_cardinality['governing_agreement_ref'] = {"min": 1}
- c_child_order.extend(['governing_agreement_ref'])
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}GoverningAgreementRef"] = (
+ "governing_agreement_ref",
+ [GoverningAgreementRef],
+ )
+ c_cardinality["governing_agreement_ref"] = {"min": 1}
+ c_child_order.extend(["governing_agreement_ref"])
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref or []
def governing_agreements_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementsType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementsType_, xml_string)
class RestrictedPasswordType_Length(RestrictedLengthType_):
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = RestrictedLengthType_.c_children.copy()
c_attributes = RestrictedLengthType_.c_attributes.copy()
@@ -574,14 +592,13 @@ class RestrictedPasswordType_Length(RestrictedLengthType_):
def restricted_password_type__length_from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_Length,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_Length, xml_string)
class Alphabet(AlphabetType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Alphabet element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Alphabet element"""
- c_tag = 'Alphabet'
+ c_tag = "Alphabet"
c_namespace = NAMESPACE
c_children = AlphabetType_.c_children.copy()
c_attributes = AlphabetType_.c_attributes.copy()
@@ -594,9 +611,9 @@ def alphabet_from_string(xml_string):
class ActivationLimitDuration(ActivationLimitDurationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitDuration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitDuration element"""
- c_tag = 'ActivationLimitDuration'
+ c_tag = "ActivationLimitDuration"
c_namespace = NAMESPACE
c_children = ActivationLimitDurationType_.c_children.copy()
c_attributes = ActivationLimitDurationType_.c_attributes.copy()
@@ -605,14 +622,13 @@ class ActivationLimitDuration(ActivationLimitDurationType_):
def activation_limit_duration_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDuration,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDuration, xml_string)
class ActivationLimitUsages(ActivationLimitUsagesType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitUsages element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitUsages element"""
- c_tag = 'ActivationLimitUsages'
+ c_tag = "ActivationLimitUsages"
c_namespace = NAMESPACE
c_children = ActivationLimitUsagesType_.c_children.copy()
c_attributes = ActivationLimitUsagesType_.c_attributes.copy()
@@ -625,9 +641,9 @@ def activation_limit_usages_from_string(xml_string):
class ActivationLimitSession(ActivationLimitSessionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitSession element"""
- c_tag = 'ActivationLimitSession'
+ c_tag = "ActivationLimitSession"
c_namespace = NAMESPACE
c_children = ActivationLimitSessionType_.c_children.copy()
c_attributes = ActivationLimitSessionType_.c_attributes.copy()
@@ -636,14 +652,13 @@ class ActivationLimitSession(ActivationLimitSessionType_):
def activation_limit_session_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSession,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSession, xml_string)
class Extension(ExtensionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Extension element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Extension element"""
- c_tag = 'Extension'
+ c_tag = "Extension"
c_namespace = NAMESPACE
c_children = ExtensionType_.c_children.copy()
c_attributes = ExtensionType_.c_attributes.copy()
@@ -656,69 +671,74 @@ def extension_from_string(xml_string):
class SharedSecretChallengeResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SharedSecretChallengeResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SharedSecretChallengeResponseType element"""
- c_tag = 'SharedSecretChallengeResponseType'
+ c_tag = "SharedSecretChallengeResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['method'] = ('method', 'anyURI', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- method=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["method"] = ("method", "anyURI", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ method=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.method = method
def shared_secret_challenge_response_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- SharedSecretChallengeResponseType_, xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponseType_, xml_string)
class PublicKeyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PublicKeyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PublicKeyType element"""
- c_tag = 'PublicKeyType'
+ c_tag = "PublicKeyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['keyValidation'] = ('key_validation', 'None', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- key_validation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["keyValidation"] = ("key_validation", "None", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ key_validation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.key_validation = key_validation
@@ -729,9 +749,9 @@ def public_key_type__from_string(xml_string):
class GoverningAgreements(GoverningAgreementsType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreements element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:GoverningAgreements element"""
- c_tag = 'GoverningAgreements'
+ c_tag = "GoverningAgreements"
c_namespace = NAMESPACE
c_children = GoverningAgreementsType_.c_children.copy()
c_attributes = GoverningAgreementsType_.c_attributes.copy()
@@ -744,48 +764,47 @@ def governing_agreements_from_string(xml_string):
class PasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PasswordType element"""
- c_tag = 'PasswordType'
+ c_tag = "PasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'alphabet', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "alphabet", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -799,42 +818,46 @@ def password_type__from_string(xml_string):
class RestrictedPasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:RestrictedPasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:RestrictedPasswordType element"""
- c_tag = 'RestrictedPasswordType'
+ c_tag = "RestrictedPasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Length'] = (
- 'length', RestrictedPasswordType_Length)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Length"] = (
+ "length",
+ RestrictedPasswordType_Length,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.generation = generation
@@ -843,39 +866,42 @@ class RestrictedPasswordType_(SamlBase):
def restricted_password_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_, xml_string)
class TokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TokenType element"""
- c_tag = 'TokenType'
+ c_tag = "TokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}TimeSyncToken'] = (
- 'time_sync_token', TimeSyncToken)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['time_sync_token', 'extension'])
-
- def __init__(self,
- time_sync_token=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}TimeSyncToken"] = (
+ "time_sync_token",
+ TimeSyncToken,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["time_sync_token", "extension"])
+
+ def __init__(
+ self,
+ time_sync_token=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.time_sync_token = time_sync_token
self.extension = extension or []
@@ -886,42 +912,45 @@ def token_type__from_string(xml_string):
class ActivationLimitType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimitType element"""
- c_tag = 'ActivationLimitType'
+ c_tag = "ActivationLimitType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimitDuration'] = (
- 'activation_limit_duration', ActivationLimitDuration)
- c_cardinality['activation_limit_duration'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimitUsages'] = (
- 'activation_limit_usages', ActivationLimitUsages)
- c_cardinality['activation_limit_usages'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimitSession'] = (
- 'activation_limit_session', ActivationLimitSession)
- c_cardinality['activation_limit_session'] = {"min": 0, "max": 1}
- c_child_order.extend(
- ['activation_limit_duration', 'activation_limit_usages',
- 'activation_limit_session'])
-
- def __init__(self,
- activation_limit_duration=None,
- activation_limit_usages=None,
- activation_limit_session=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimitDuration"] = (
+ "activation_limit_duration",
+ ActivationLimitDuration,
+ )
+ c_cardinality["activation_limit_duration"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimitUsages"] = (
+ "activation_limit_usages",
+ ActivationLimitUsages,
+ )
+ c_cardinality["activation_limit_usages"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimitSession"] = (
+ "activation_limit_session",
+ ActivationLimitSession,
+ )
+ c_cardinality["activation_limit_session"] = {"min": 0, "max": 1}
+ c_child_order.extend(["activation_limit_duration", "activation_limit_usages", "activation_limit_session"])
+
+ def __init__(
+ self,
+ activation_limit_duration=None,
+ activation_limit_usages=None,
+ activation_limit_session=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_limit_duration = activation_limit_duration
self.activation_limit_usages = activation_limit_usages
@@ -933,30 +962,33 @@ def activation_limit_type__from_string(xml_string):
class ExtensionOnlyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ExtensionOnlyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ExtensionOnlyType element"""
- c_tag = 'ExtensionOnlyType'
+ c_tag = "ExtensionOnlyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
@@ -966,9 +998,9 @@ def extension_only_type__from_string(xml_string):
class WrittenConsent(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:WrittenConsent element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:WrittenConsent element"""
- c_tag = 'WrittenConsent'
+ c_tag = "WrittenConsent"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -981,9 +1013,9 @@ def written_consent_from_string(xml_string):
class SubscriberLineNumber(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SubscriberLineNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SubscriberLineNumber element"""
- c_tag = 'SubscriberLineNumber'
+ c_tag = "SubscriberLineNumber"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -996,9 +1028,9 @@ def subscriber_line_number_from_string(xml_string):
class UserSuffix(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:UserSuffix element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:UserSuffix element"""
- c_tag = 'UserSuffix'
+ c_tag = "UserSuffix"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1011,9 +1043,9 @@ def user_suffix_from_string(xml_string):
class Password(PasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Password element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Password element"""
- c_tag = 'Password'
+ c_tag = "Password"
c_namespace = NAMESPACE
c_children = PasswordType_.c_children.copy()
c_attributes = PasswordType_.c_attributes.copy()
@@ -1026,9 +1058,9 @@ def password_from_string(xml_string):
class Token(TokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Token element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Token element"""
- c_tag = 'Token'
+ c_tag = "Token"
c_namespace = NAMESPACE
c_children = TokenType_.c_children.copy()
c_attributes = TokenType_.c_attributes.copy()
@@ -1041,9 +1073,9 @@ def token_from_string(xml_string):
class Smartcard(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Smartcard element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Smartcard element"""
- c_tag = 'Smartcard'
+ c_tag = "Smartcard"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1056,9 +1088,9 @@ def smartcard_from_string(xml_string):
class ActivationLimit(ActivationLimitType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationLimit element"""
- c_tag = 'ActivationLimit'
+ c_tag = "ActivationLimit"
c_namespace = NAMESPACE
c_children = ActivationLimitType_.c_children.copy()
c_attributes = ActivationLimitType_.c_attributes.copy()
@@ -1071,9 +1103,9 @@ def activation_limit_from_string(xml_string):
class PreviousSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PreviousSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PreviousSession element"""
- c_tag = 'PreviousSession'
+ c_tag = "PreviousSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1086,9 +1118,9 @@ def previous_session_from_string(xml_string):
class ResumeSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ResumeSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ResumeSession element"""
- c_tag = 'ResumeSession'
+ c_tag = "ResumeSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1101,9 +1133,9 @@ def resume_session_from_string(xml_string):
class ZeroKnowledge(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ZeroKnowledge element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ZeroKnowledge element"""
- c_tag = 'ZeroKnowledge'
+ c_tag = "ZeroKnowledge"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1116,9 +1148,9 @@ def zero_knowledge_from_string(xml_string):
class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SharedSecretChallengeResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SharedSecretChallengeResponse element"""
- c_tag = 'SharedSecretChallengeResponse'
+ c_tag = "SharedSecretChallengeResponse"
c_namespace = NAMESPACE
c_children = SharedSecretChallengeResponseType_.c_children.copy()
c_attributes = SharedSecretChallengeResponseType_.c_attributes.copy()
@@ -1127,14 +1159,13 @@ class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
def shared_secret_challenge_response_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretChallengeResponse,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponse, xml_string)
class DigSig(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:DigSig element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:DigSig element"""
- c_tag = 'DigSig'
+ c_tag = "DigSig"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1147,9 +1178,9 @@ def dig_sig_from_string(xml_string):
class AsymmetricDecryption(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AsymmetricDecryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AsymmetricDecryption element"""
- c_tag = 'AsymmetricDecryption'
+ c_tag = "AsymmetricDecryption"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1162,9 +1193,9 @@ def asymmetric_decryption_from_string(xml_string):
class AsymmetricKeyAgreement(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AsymmetricKeyAgreement element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AsymmetricKeyAgreement element"""
- c_tag = 'AsymmetricKeyAgreement'
+ c_tag = "AsymmetricKeyAgreement"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1173,14 +1204,13 @@ class AsymmetricKeyAgreement(PublicKeyType_):
def asymmetric_key_agreement_from_string(xml_string):
- return saml2.create_class_from_xml_string(AsymmetricKeyAgreement,
- xml_string)
+ return saml2.create_class_from_xml_string(AsymmetricKeyAgreement, xml_string)
class IPAddress(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:IPAddress element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:IPAddress element"""
- c_tag = 'IPAddress'
+ c_tag = "IPAddress"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1193,9 +1223,9 @@ def ip_address_from_string(xml_string):
class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SharedSecretDynamicPlaintext element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SharedSecretDynamicPlaintext element"""
- c_tag = 'SharedSecretDynamicPlaintext'
+ c_tag = "SharedSecretDynamicPlaintext"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1204,14 +1234,13 @@ class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
def shared_secret_dynamic_plaintext_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext, xml_string)
class HTTP(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:HTTP element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:HTTP element"""
- c_tag = 'HTTP'
+ c_tag = "HTTP"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1224,9 +1253,9 @@ def http_from_string(xml_string):
class IPSec(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:IPSec element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:IPSec element"""
- c_tag = 'IPSec'
+ c_tag = "IPSec"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1239,9 +1268,9 @@ def ip_sec_from_string(xml_string):
class WTLS(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:WTLS element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:WTLS element"""
- c_tag = 'WTLS'
+ c_tag = "WTLS"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1254,9 +1283,9 @@ def wtls_from_string(xml_string):
class MobileNetworkNoEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:MobileNetworkNoEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:MobileNetworkNoEncryption element"""
- c_tag = 'MobileNetworkNoEncryption'
+ c_tag = "MobileNetworkNoEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1265,14 +1294,13 @@ class MobileNetworkNoEncryption(ExtensionOnlyType_):
def mobile_network_no_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkNoEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkNoEncryption, xml_string)
class MobileNetworkRadioEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:MobileNetworkRadioEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:MobileNetworkRadioEncryption element"""
- c_tag = 'MobileNetworkRadioEncryption'
+ c_tag = "MobileNetworkRadioEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1281,14 +1309,13 @@ class MobileNetworkRadioEncryption(ExtensionOnlyType_):
def mobile_network_radio_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption, xml_string)
class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:MobileNetworkEndToEndEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:MobileNetworkEndToEndEncryption element"""
- c_tag = 'MobileNetworkEndToEndEncryption'
+ c_tag = "MobileNetworkEndToEndEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1297,14 +1324,13 @@ class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
def mobile_network_end_to_end_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption, xml_string)
class SSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SSL element"""
- c_tag = 'SSL'
+ c_tag = "SSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1317,9 +1343,9 @@ def ssl_from_string(xml_string):
class PSTN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PSTN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PSTN element"""
- c_tag = 'PSTN'
+ c_tag = "PSTN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1332,9 +1358,9 @@ def pstn_from_string(xml_string):
class ISDN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ISDN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ISDN element"""
- c_tag = 'ISDN'
+ c_tag = "ISDN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1347,9 +1373,9 @@ def isdn_from_string(xml_string):
class ADSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ADSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ADSL element"""
- c_tag = 'ADSL'
+ c_tag = "ADSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1362,9 +1388,9 @@ def adsl_from_string(xml_string):
class SwitchAudit(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SwitchAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SwitchAudit element"""
- c_tag = 'SwitchAudit'
+ c_tag = "SwitchAudit"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1377,9 +1403,9 @@ def switch_audit_from_string(xml_string):
class DeactivationCallCenter(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:DeactivationCallCenter element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:DeactivationCallCenter element"""
- c_tag = 'DeactivationCallCenter'
+ c_tag = "DeactivationCallCenter"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1388,54 +1414,57 @@ class DeactivationCallCenter(ExtensionOnlyType_):
def deactivation_call_center_from_string(xml_string):
- return saml2.create_class_from_xml_string(DeactivationCallCenter,
- xml_string)
+ return saml2.create_class_from_xml_string(DeactivationCallCenter, xml_string)
class IdentificationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:IdentificationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:IdentificationType element"""
- c_tag = 'IdentificationType'
+ c_tag = "IdentificationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PhysicalVerification'] = (
- 'physical_verification', PhysicalVerification)
- c_cardinality['physical_verification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}WrittenConsent'] = (
- 'written_consent', WrittenConsent)
- c_cardinality['written_consent'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['nym'] = ('nym', NymType_, False)
- c_child_order.extend(
- ['physical_verification', 'written_consent', 'governing_agreements',
- 'extension'])
-
- def __init__(self,
- physical_verification=None,
- written_consent=None,
- governing_agreements=None,
- extension=None,
- nym=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PhysicalVerification"] = (
+ "physical_verification",
+ PhysicalVerification,
+ )
+ c_cardinality["physical_verification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}WrittenConsent"] = (
+ "written_consent",
+ WrittenConsent,
+ )
+ c_cardinality["written_consent"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["nym"] = ("nym", NymType_, False)
+ c_child_order.extend(["physical_verification", "written_consent", "governing_agreements", "extension"])
+
+ def __init__(
+ self,
+ physical_verification=None,
+ written_consent=None,
+ governing_agreements=None,
+ extension=None,
+ nym=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.physical_verification = physical_verification
self.written_consent = written_consent
@@ -1449,9 +1478,9 @@ def identification_type__from_string(xml_string):
class RestrictedPassword(RestrictedPasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:RestrictedPassword element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:RestrictedPassword element"""
- c_tag = 'RestrictedPassword'
+ c_tag = "RestrictedPassword"
c_namespace = NAMESPACE
c_children = RestrictedPasswordType_.c_children.copy()
c_attributes = RestrictedPasswordType_.c_attributes.copy()
@@ -1464,51 +1493,51 @@ def restricted_password_from_string(xml_string):
class ActivationPinType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationPinType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationPinType element"""
- c_tag = 'ActivationPinType'
+ c_tag = "ActivationPinType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimit'] = (
- 'activation_limit', ActivationLimit)
- c_cardinality['activation_limit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['length', 'alphabet', 'generation', 'activation_limit', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- activation_limit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Generation"] = (
+ "generation",
+ Generation,
+ )
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationLimit"] = (
+ "activation_limit",
+ ActivationLimit,
+ )
+ c_cardinality["activation_limit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["length", "alphabet", "generation", "activation_limit", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ activation_limit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -1522,35 +1551,39 @@ def activation_pin_type__from_string(xml_string):
class SecurityAuditType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecurityAuditType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecurityAuditType element"""
- c_tag = 'SecurityAuditType'
+ c_tag = "SecurityAuditType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SwitchAudit'] = (
- 'switch_audit', SwitchAudit)
- c_cardinality['switch_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['switch_audit', 'extension'])
-
- def __init__(self,
- switch_audit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SwitchAudit"] = (
+ "switch_audit",
+ SwitchAudit,
+ )
+ c_cardinality["switch_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["switch_audit", "extension"])
+
+ def __init__(
+ self,
+ switch_audit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.switch_audit = switch_audit
self.extension = extension or []
@@ -1561,90 +1594,98 @@ def security_audit_type__from_string(xml_string):
class AuthenticatorBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticatorBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticatorBaseType element"""
- c_tag = 'AuthenticatorBaseType'
+ c_tag = "AuthenticatorBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_child_order.extend(['restricted_password'])
-
- def __init__(self,
- restricted_password=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_child_order.extend(["restricted_password"])
+
+ def __init__(
+ self,
+ restricted_password=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.restricted_password = restricted_password
def authenticator_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorBaseType_, xml_string)
class AuthenticatorTransportProtocolType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticatorTransportProtocolType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticatorTransportProtocolType element"""
- c_tag = 'AuthenticatorTransportProtocolType'
+ c_tag = "AuthenticatorTransportProtocolType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SSL'] = (
- 'ssl', SSL)
- c_cardinality['ssl'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}MobileNetworkRadioEncryption'] = (
- 'mobile_network_radio_encryption', MobileNetworkRadioEncryption)
- c_cardinality['mobile_network_radio_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}MobileNetworkEndToEndEncryption'] = (
- 'mobile_network_end_to_end_encryption', MobileNetworkEndToEndEncryption)
- c_cardinality['mobile_network_end_to_end_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}WTLS'] = (
- 'wtls', WTLS)
- c_cardinality['wtls'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}IPSec'] = (
- 'ip_sec', IPSec)
- c_cardinality['ip_sec'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['ssl', 'mobile_network_radio_encryption',
- 'mobile_network_end_to_end_encryption', 'wtls',
- 'ip_sec', 'extension'])
-
- def __init__(self,
- ssl=None,
- mobile_network_radio_encryption=None,
- mobile_network_end_to_end_encryption=None,
- wtls=None,
- ip_sec=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SSL"] = ("ssl", SSL)
+ c_cardinality["ssl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}MobileNetworkRadioEncryption"] = (
+ "mobile_network_radio_encryption",
+ MobileNetworkRadioEncryption,
+ )
+ c_cardinality["mobile_network_radio_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}MobileNetworkEndToEndEncryption"] = (
+ "mobile_network_end_to_end_encryption",
+ MobileNetworkEndToEndEncryption,
+ )
+ c_cardinality["mobile_network_end_to_end_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}WTLS"] = ("wtls", WTLS)
+ c_cardinality["wtls"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}IPSec"] = ("ip_sec", IPSec)
+ c_cardinality["ip_sec"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ [
+ "ssl",
+ "mobile_network_radio_encryption",
+ "mobile_network_end_to_end_encryption",
+ "wtls",
+ "ip_sec",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ ssl=None,
+ mobile_network_radio_encryption=None,
+ mobile_network_end_to_end_encryption=None,
+ wtls=None,
+ ip_sec=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.ssl = ssl
self.mobile_network_radio_encryption = mobile_network_radio_encryption
@@ -1655,14 +1696,13 @@ class AuthenticatorTransportProtocolType_(SamlBase):
def authenticator_transport_protocol_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- AuthenticatorTransportProtocolType_, xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocolType_, xml_string)
class Identification(IdentificationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Identification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Identification element"""
- c_tag = 'Identification'
+ c_tag = "Identification"
c_namespace = NAMESPACE
c_children = IdentificationType_.c_children.copy()
c_attributes = IdentificationType_.c_attributes.copy()
@@ -1675,9 +1715,9 @@ def identification_from_string(xml_string):
class ActivationPin(ActivationPinType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationPin element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ActivationPin element"""
- c_tag = 'ActivationPin'
+ c_tag = "ActivationPin"
c_namespace = NAMESPACE
c_children = ActivationPinType_.c_children.copy()
c_attributes = ActivationPinType_.c_attributes.copy()
@@ -1690,9 +1730,9 @@ def activation_pin_from_string(xml_string):
class Authenticator(AuthenticatorBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Authenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:Authenticator element"""
- c_tag = 'Authenticator'
+ c_tag = "Authenticator"
c_namespace = NAMESPACE
c_children = AuthenticatorBaseType_.c_children.copy()
c_attributes = AuthenticatorBaseType_.c_attributes.copy()
@@ -1705,9 +1745,9 @@ def authenticator_from_string(xml_string):
class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticatorTransportProtocol element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticatorTransportProtocol element"""
- c_tag = 'AuthenticatorTransportProtocol'
+ c_tag = "AuthenticatorTransportProtocol"
c_namespace = NAMESPACE
c_children = AuthenticatorTransportProtocolType_.c_children.copy()
c_attributes = AuthenticatorTransportProtocolType_.c_attributes.copy()
@@ -1716,14 +1756,13 @@ class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
def authenticator_transport_protocol_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol, xml_string)
class SecurityAudit(SecurityAuditType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecurityAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecurityAudit element"""
- c_tag = 'SecurityAudit'
+ c_tag = "SecurityAudit"
c_namespace = NAMESPACE
c_children = SecurityAuditType_.c_children.copy()
c_attributes = SecurityAuditType_.c_attributes.copy()
@@ -1736,41 +1775,45 @@ def security_audit_from_string(xml_string):
class OperationalProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:OperationalProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:OperationalProtectionType element"""
- c_tag = 'OperationalProtectionType'
+ c_tag = "OperationalProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SecurityAudit'] = (
- 'security_audit', SecurityAudit)
- c_cardinality['security_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}DeactivationCallCenter'] = (
- 'deactivation_call_center', DeactivationCallCenter)
- c_cardinality['deactivation_call_center'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['security_audit', 'deactivation_call_center', 'extension'])
-
- def __init__(self,
- security_audit=None,
- deactivation_call_center=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SecurityAudit"] = (
+ "security_audit",
+ SecurityAudit,
+ )
+ c_cardinality["security_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}DeactivationCallCenter"] = (
+ "deactivation_call_center",
+ DeactivationCallCenter,
+ )
+ c_cardinality["deactivation_call_center"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["security_audit", "deactivation_call_center", "extension"])
+
+ def __init__(
+ self,
+ security_audit=None,
+ deactivation_call_center=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.security_audit = security_audit
self.deactivation_call_center = deactivation_call_center
@@ -1778,64 +1821,63 @@ class OperationalProtectionType_(SamlBase):
def operational_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(OperationalProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(OperationalProtectionType_, xml_string)
class PrincipalAuthenticationMechanismType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrincipalAuthenticationMechanismType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrincipalAuthenticationMechanismType element"""
- c_tag = 'PrincipalAuthenticationMechanismType'
+ c_tag = "PrincipalAuthenticationMechanismType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Token'] = (
- 'token', Token)
- c_cardinality['token'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Smartcard'] = (
- 'smartcard', Smartcard)
- c_cardinality['smartcard'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['preauth'] = ('preauth', 'integer', False)
- c_child_order.extend(
- ['password', 'restricted_password', 'token', 'smartcard',
- 'activation_pin', 'extension'])
-
- def __init__(self,
- password=None,
- restricted_password=None,
- token=None,
- smartcard=None,
- activation_pin=None,
- extension=None,
- preauth=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Token"] = ("token", Token)
+ c_cardinality["token"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Smartcard"] = (
+ "smartcard",
+ Smartcard,
+ )
+ c_cardinality["smartcard"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationPin"] = (
+ "activation_pin",
+ ActivationPin,
+ )
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["preauth"] = ("preauth", "integer", False)
+ c_child_order.extend(["password", "restricted_password", "token", "smartcard", "activation_pin", "extension"])
+
+ def __init__(
+ self,
+ password=None,
+ restricted_password=None,
+ token=None,
+ smartcard=None,
+ activation_pin=None,
+ extension=None,
+ preauth=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.password = password
self.restricted_password = restricted_password
@@ -1847,40 +1889,43 @@ class PrincipalAuthenticationMechanismType_(SamlBase):
def principal_authentication_mechanism_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- PrincipalAuthenticationMechanismType_, xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanismType_, xml_string)
class KeyActivationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyActivationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyActivationType element"""
- c_tag = 'KeyActivationType'
+ c_tag = "KeyActivationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['activation_pin', 'extension'])
-
- def __init__(self,
- activation_pin=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ActivationPin"] = (
+ "activation_pin",
+ ActivationPin,
+ )
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["activation_pin", "extension"])
+
+ def __init__(
+ self,
+ activation_pin=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_pin = activation_pin
self.extension = extension or []
@@ -1891,9 +1936,9 @@ def key_activation_type__from_string(xml_string):
class KeyActivation(KeyActivationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyActivation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:KeyActivation element"""
- c_tag = 'KeyActivation'
+ c_tag = "KeyActivation"
c_namespace = NAMESPACE
c_children = KeyActivationType_.c_children.copy()
c_attributes = KeyActivationType_.c_attributes.copy()
@@ -1906,9 +1951,9 @@ def key_activation_from_string(xml_string):
class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrincipalAuthenticationMechanism element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrincipalAuthenticationMechanism element"""
- c_tag = 'PrincipalAuthenticationMechanism'
+ c_tag = "PrincipalAuthenticationMechanism"
c_namespace = NAMESPACE
c_children = PrincipalAuthenticationMechanismType_.c_children.copy()
c_attributes = PrincipalAuthenticationMechanismType_.c_attributes.copy()
@@ -1917,14 +1962,13 @@ class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
def principal_authentication_mechanism_from_string(xml_string):
- return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism,
- xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism, xml_string)
class OperationalProtection(OperationalProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:OperationalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:OperationalProtection element"""
- c_tag = 'OperationalProtection'
+ c_tag = "OperationalProtection"
c_namespace = NAMESPACE
c_children = OperationalProtectionType_.c_children.copy()
c_attributes = OperationalProtectionType_.c_attributes.copy()
@@ -1937,48 +1981,51 @@ def operational_protection_from_string(xml_string):
class PrivateKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrivateKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrivateKeyProtectionType element"""
- c_tag = 'PrivateKeyProtectionType'
+ c_tag = "PrivateKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyStorage'] = (
-
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeySharing'] = (
- 'key_sharing', KeySharing)
- c_cardinality['key_sharing'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' \
- '}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['key_activation', 'key_storage', 'key_sharing', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- key_sharing=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyStorage"] = (
+ "key_storage",
+ KeyStorage,
+ )
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeySharing"] = (
+ "key_sharing",
+ KeySharing,
+ )
+ c_cardinality["key_sharing"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" "}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "key_sharing", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ key_sharing=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -1987,45 +2034,49 @@ class PrivateKeyProtectionType_(SamlBase):
def private_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(PrivateKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(PrivateKeyProtectionType_, xml_string)
class SecretKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecretKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecretKeyProtectionType element"""
- c_tag = 'SecretKeyProtectionType'
+ c_tag = "SecretKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['key_activation', 'key_storage', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}KeyStorage"] = (
+ "key_storage",
+ KeyStorage,
+ )
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -2033,49 +2084,54 @@ class SecretKeyProtectionType_(SamlBase):
def secret_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SecretKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SecretKeyProtectionType_, xml_string)
class AuthnMethodBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthnMethodBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthnMethodBaseType element"""
- c_tag = 'AuthnMethodBaseType'
+ c_tag = "AuthnMethodBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PrincipalAuthenticationMechanism'] = (
- 'principal_authentication_mechanism', PrincipalAuthenticationMechanism)
- c_cardinality['principal_authentication_mechanism'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Authenticator'] = (
- 'authenticator', Authenticator)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AuthenticatorTransportProtocol'] = (
- 'authenticator_transport_protocol', AuthenticatorTransportProtocol)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['principal_authentication_mechanism', 'authenticator',
- 'authenticator_transport_protocol', 'extension'])
-
- def __init__(self,
- principal_authentication_mechanism=None,
- authenticator=None,
- authenticator_transport_protocol=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ "{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PrincipalAuthenticationMechanism"
+ ] = ("principal_authentication_mechanism", PrincipalAuthenticationMechanism)
+ c_cardinality["principal_authentication_mechanism"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Authenticator"] = (
+ "authenticator",
+ Authenticator,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AuthenticatorTransportProtocol"] = (
+ "authenticator_transport_protocol",
+ AuthenticatorTransportProtocol,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ ["principal_authentication_mechanism", "authenticator", "authenticator_transport_protocol", "extension"]
+ )
+
+ def __init__(
+ self,
+ principal_authentication_mechanism=None,
+ authenticator=None,
+ authenticator_transport_protocol=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.principal_authentication_mechanism = principal_authentication_mechanism
self.authenticator = authenticator
@@ -2088,9 +2144,9 @@ def authn_method_base_type__from_string(xml_string):
class SecretKeyProtection(SecretKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecretKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:SecretKeyProtection element"""
- c_tag = 'SecretKeyProtection'
+ c_tag = "SecretKeyProtection"
c_namespace = NAMESPACE
c_children = SecretKeyProtectionType_.c_children.copy()
c_attributes = SecretKeyProtectionType_.c_attributes.copy()
@@ -2103,9 +2159,9 @@ def secret_key_protection_from_string(xml_string):
class PrivateKeyProtection(PrivateKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrivateKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:PrivateKeyProtection element"""
- c_tag = 'PrivateKeyProtection'
+ c_tag = "PrivateKeyProtection"
c_namespace = NAMESPACE
c_children = PrivateKeyProtectionType_.c_children.copy()
c_attributes = PrivateKeyProtectionType_.c_attributes.copy()
@@ -2118,9 +2174,9 @@ def private_key_protection_from_string(xml_string):
class AuthnMethod(AuthnMethodBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthnMethod element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthnMethod element"""
- c_tag = 'AuthnMethod'
+ c_tag = "AuthnMethod"
c_namespace = NAMESPACE
c_children = AuthnMethodBaseType_.c_children.copy()
c_attributes = AuthnMethodBaseType_.c_attributes.copy()
@@ -2133,42 +2189,45 @@ def authn_method_from_string(xml_string):
class TechnicalProtectionBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TechnicalProtectionBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TechnicalProtectionBaseType element"""
- c_tag = 'TechnicalProtectionBaseType'
+ c_tag = "TechnicalProtectionBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PrivateKeyProtection'] = (
- 'private_key_protection', PrivateKeyProtection)
- c_cardinality['private_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SecretKeyProtection'] = (
- 'secret_key_protection', SecretKeyProtection)
- c_cardinality['secret_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' \
- '}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['private_key_protection', 'secret_key_protection', 'extension'])
-
- def __init__(self,
- private_key_protection=None,
- secret_key_protection=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PrivateKeyProtection"] = (
+ "private_key_protection",
+ PrivateKeyProtection,
+ )
+ c_cardinality["private_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SecretKeyProtection"] = (
+ "secret_key_protection",
+ SecretKeyProtection,
+ )
+ c_cardinality["secret_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" "}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["private_key_protection", "secret_key_protection", "extension"])
+
+ def __init__(
+ self,
+ private_key_protection=None,
+ secret_key_protection=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.private_key_protection = private_key_protection
self.secret_key_protection = secret_key_protection
@@ -2176,14 +2235,13 @@ class TechnicalProtectionBaseType_(SamlBase):
def technical_protection_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_, xml_string)
class TechnicalProtection(TechnicalProtectionBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TechnicalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:TechnicalProtection element"""
- c_tag = 'TechnicalProtection'
+ c_tag = "TechnicalProtection"
c_namespace = NAMESPACE
c_children = TechnicalProtectionBaseType_.c_children.copy()
c_attributes = TechnicalProtectionBaseType_.c_attributes.copy()
@@ -2196,58 +2254,73 @@ def technical_protection_from_string(xml_string):
class AuthnContextDeclarationBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthnContextDeclarationBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthnContextDeclarationBaseType element"""
- c_tag = 'AuthnContextDeclarationBaseType'
+ c_tag = "AuthnContextDeclarationBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Identification'] = (
- 'identification', Identification)
- c_cardinality['identification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}TechnicalProtection'] = (
- 'technical_protection', TechnicalProtection)
- c_cardinality['technical_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}OperationalProtection'] = (
- 'operational_protection', OperationalProtection)
- c_cardinality['operational_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AuthnMethod'] = (
- 'authn_method', AuthnMethod)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ID'] = ('id', 'ID', False)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Identification"] = (
+ "identification",
+ Identification,
+ )
+ c_cardinality["identification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}TechnicalProtection"] = (
+ "technical_protection",
+ TechnicalProtection,
+ )
+ c_cardinality["technical_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}OperationalProtection"] = (
+ "operational_protection",
+ OperationalProtection,
+ )
+ c_cardinality["operational_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AuthnMethod"] = (
+ "authn_method",
+ AuthnMethod,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ID"] = ("id", "ID", False)
c_child_order.extend(
- ['identification', 'technical_protection', 'operational_protection',
- 'authn_method', 'governing_agreements', 'extension'])
-
- def __init__(self,
- identification=None,
- technical_protection=None,
- operational_protection=None,
- authn_method=None,
- governing_agreements=None,
- extension=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "identification",
+ "technical_protection",
+ "operational_protection",
+ "authn_method",
+ "governing_agreements",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ identification=None,
+ technical_protection=None,
+ operational_protection=None,
+ authn_method=None,
+ governing_agreements=None,
+ extension=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.identification = identification
self.technical_protection = technical_protection
@@ -2259,14 +2332,13 @@ class AuthnContextDeclarationBaseType_(SamlBase):
def authn_context_declaration_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_, xml_string)
class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticationContextDeclaration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:AuthenticationContextDeclaration element"""
- c_tag = 'AuthenticationContextDeclaration'
+ c_tag = "AuthenticationContextDeclaration"
c_namespace = NAMESPACE
c_children = AuthnContextDeclarationBaseType_.c_children.copy()
c_attributes = AuthnContextDeclarationBaseType_.c_attributes.copy()
@@ -2275,109 +2347,129 @@ class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
def authentication_context_declaration_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticationContextDeclaration,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticationContextDeclaration, xml_string)
class ComplexAuthenticatorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ComplexAuthenticatorType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ComplexAuthenticatorType element"""
- c_tag = 'ComplexAuthenticatorType'
+ c_tag = "ComplexAuthenticatorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PreviousSession'] = (
-
- 'previous_session', PreviousSession)
- c_cardinality['previous_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ResumeSession'] = (
- 'resume_session', ResumeSession)
- c_cardinality['resume_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}DigSig'] = (
- 'dig_sig', DigSig)
- c_cardinality['dig_sig'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ZeroKnowledge'] = (
- 'zero_knowledge', ZeroKnowledge)
- c_cardinality['zero_knowledge'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}IPAddress'] = (
- 'ip_address', IPAddress)
- c_cardinality['ip_address'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AsymmetricDecryption'] = (
- 'asymmetric_decryption', AsymmetricDecryption)
- c_cardinality['asymmetric_decryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AsymmetricKeyAgreement'] = (
- 'asymmetric_key_agreement', AsymmetricKeyAgreement)
- c_cardinality['asymmetric_key_agreement'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SubscriberLineNumber'] = (
- 'subscriber_line_number', SubscriberLineNumber)
- c_cardinality['subscriber_line_number'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}UserSuffix'] = (
- 'user_suffix', UserSuffix)
- c_cardinality['user_suffix'] = {"min": 0, "max": 1}
- c_cardinality['complex_authenticator'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}PreviousSession"] = (
+ "previous_session",
+ PreviousSession,
+ )
+ c_cardinality["previous_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ResumeSession"] = (
+ "resume_session",
+ ResumeSession,
+ )
+ c_cardinality["resume_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}DigSig"] = ("dig_sig", DigSig)
+ c_cardinality["dig_sig"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ZeroKnowledge"] = (
+ "zero_knowledge",
+ ZeroKnowledge,
+ )
+ c_cardinality["zero_knowledge"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}IPAddress"] = (
+ "ip_address",
+ IPAddress,
+ )
+ c_cardinality["ip_address"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AsymmetricDecryption"] = (
+ "asymmetric_decryption",
+ AsymmetricDecryption,
+ )
+ c_cardinality["asymmetric_decryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}AsymmetricKeyAgreement"] = (
+ "asymmetric_key_agreement",
+ AsymmetricKeyAgreement,
+ )
+ c_cardinality["asymmetric_key_agreement"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}SubscriberLineNumber"] = (
+ "subscriber_line_number",
+ SubscriberLineNumber,
+ )
+ c_cardinality["subscriber_line_number"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}UserSuffix"] = (
+ "user_suffix",
+ UserSuffix,
+ )
+ c_cardinality["user_suffix"] = {"min": 0, "max": 1}
+ c_cardinality["complex_authenticator"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}Extension"] = (
+ "extension",
+ [Extension],
+ )
+ c_cardinality["extension"] = {"min": 0}
c_child_order.extend(
- ['previous_session', 'resume_session', 'dig_sig', 'password',
- 'restricted_password', 'zero_knowledge',
- 'shared_secret_challenge_response', 'shared_secret_dynamic_plaintext',
- 'ip_address', 'asymmetric_decryption', 'asymmetric_key_agreement',
- 'subscriber_line_number', 'user_suffix', 'complex_authenticator',
- 'extension'])
-
- def __init__(self,
- previous_session=None,
- resume_session=None,
- dig_sig=None,
- password=None,
- restricted_password=None,
- zero_knowledge=None,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- ip_address=None,
- asymmetric_decryption=None,
- asymmetric_key_agreement=None,
- subscriber_line_number=None,
- user_suffix=None,
- complex_authenticator=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "previous_session",
+ "resume_session",
+ "dig_sig",
+ "password",
+ "restricted_password",
+ "zero_knowledge",
+ "shared_secret_challenge_response",
+ "shared_secret_dynamic_plaintext",
+ "ip_address",
+ "asymmetric_decryption",
+ "asymmetric_key_agreement",
+ "subscriber_line_number",
+ "user_suffix",
+ "complex_authenticator",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ previous_session=None,
+ resume_session=None,
+ dig_sig=None,
+ password=None,
+ restricted_password=None,
+ zero_knowledge=None,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ ip_address=None,
+ asymmetric_decryption=None,
+ asymmetric_key_agreement=None,
+ subscriber_line_number=None,
+ user_suffix=None,
+ complex_authenticator=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.previous_session = previous_session
self.resume_session = resume_session
@@ -2397,14 +2489,13 @@ class ComplexAuthenticatorType_(SamlBase):
def complex_authenticator_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ComplexAuthenticatorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ComplexAuthenticatorType_, xml_string)
class ComplexAuthenticator(ComplexAuthenticatorType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ComplexAuthenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport:ComplexAuthenticator element"""
- c_tag = 'ComplexAuthenticator'
+ c_tag = "ComplexAuthenticator"
c_namespace = NAMESPACE
c_children = ComplexAuthenticatorType_.c_children.copy()
c_attributes = ComplexAuthenticatorType_.c_attributes.copy()
@@ -2418,11 +2509,11 @@ def complex_authenticator_from_string(xml_string):
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ComplexAuthenticatorType_.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
+ "{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ComplexAuthenticator"
+] = ("complex_authenticator", ComplexAuthenticator)
ComplexAuthenticator.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
+ "{urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport}ComplexAuthenticator"
+] = ("complex_authenticator", ComplexAuthenticator)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELEMENT_FROM_STRING = {
@@ -2522,102 +2613,101 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'AuthenticationContextDeclaration': AuthenticationContextDeclaration,
- 'Identification': Identification,
- 'PhysicalVerification': PhysicalVerification,
- 'WrittenConsent': WrittenConsent,
- 'TechnicalProtection': TechnicalProtection,
- 'SecretKeyProtection': SecretKeyProtection,
- 'PrivateKeyProtection': PrivateKeyProtection,
- 'KeyActivation': KeyActivation,
- 'KeySharing': KeySharing,
- 'KeyStorage': KeyStorage,
- 'SubscriberLineNumber': SubscriberLineNumber,
- 'UserSuffix': UserSuffix,
- 'Password': Password,
- 'ActivationPin': ActivationPin,
- 'Token': Token,
- 'TimeSyncToken': TimeSyncToken,
- 'Smartcard': Smartcard,
- 'Length': Length,
- 'ActivationLimit': ActivationLimit,
- 'Generation': Generation,
- 'AuthnMethod': AuthnMethod,
- 'PrincipalAuthenticationMechanism': PrincipalAuthenticationMechanism,
- 'Authenticator': Authenticator,
- 'ComplexAuthenticator': ComplexAuthenticator,
- 'PreviousSession': PreviousSession,
- 'ResumeSession': ResumeSession,
- 'ZeroKnowledge': ZeroKnowledge,
- 'SharedSecretChallengeResponse': SharedSecretChallengeResponse,
- 'SharedSecretChallengeResponseType': SharedSecretChallengeResponseType_,
- 'DigSig': DigSig,
- 'AsymmetricDecryption': AsymmetricDecryption,
- 'AsymmetricKeyAgreement': AsymmetricKeyAgreement,
- 'PublicKeyType': PublicKeyType_,
- 'IPAddress': IPAddress,
- 'SharedSecretDynamicPlaintext': SharedSecretDynamicPlaintext,
- 'AuthenticatorTransportProtocol': AuthenticatorTransportProtocol,
- 'HTTP': HTTP,
- 'IPSec': IPSec,
- 'WTLS': WTLS,
- 'MobileNetworkNoEncryption': MobileNetworkNoEncryption,
- 'MobileNetworkRadioEncryption': MobileNetworkRadioEncryption,
- 'MobileNetworkEndToEndEncryption': MobileNetworkEndToEndEncryption,
- 'SSL': SSL,
- 'PSTN': PSTN,
- 'ISDN': ISDN,
- 'ADSL': ADSL,
- 'OperationalProtection': OperationalProtection,
- 'SecurityAudit': SecurityAudit,
- 'SwitchAudit': SwitchAudit,
- 'DeactivationCallCenter': DeactivationCallCenter,
- 'GoverningAgreements': GoverningAgreements,
- 'GoverningAgreementRef': GoverningAgreementRef,
- 'nymType': NymType_,
- 'IdentificationType': IdentificationType_,
- 'TechnicalProtectionBaseType': TechnicalProtectionBaseType_,
- 'OperationalProtectionType': OperationalProtectionType_,
- 'GoverningAgreementsType': GoverningAgreementsType_,
- 'GoverningAgreementRefType': GoverningAgreementRefType_,
- 'PrincipalAuthenticationMechanismType': PrincipalAuthenticationMechanismType_,
- 'ComplexAuthenticatorType': ComplexAuthenticatorType_,
- 'KeyActivationType': KeyActivationType_,
- 'KeySharingType': KeySharingType_,
- 'PrivateKeyProtectionType': PrivateKeyProtectionType_,
- 'PasswordType': PasswordType_,
- 'RestrictedPassword': RestrictedPassword,
- 'RestrictedPasswordType': RestrictedPasswordType_,
- 'RestrictedLengthType': RestrictedLengthType_,
- 'ActivationPinType': ActivationPinType_,
- 'Alphabet': Alphabet,
- 'AlphabetType': AlphabetType_,
- 'TokenType': TokenType_,
- 'DeviceTypeType': DeviceTypeType_,
- 'booleanType': BooleanType_,
- 'TimeSyncTokenType': TimeSyncTokenType_,
- 'ActivationLimitType': ActivationLimitType_,
- 'ActivationLimitDuration': ActivationLimitDuration,
- 'ActivationLimitUsages': ActivationLimitUsages,
- 'ActivationLimitSession': ActivationLimitSession,
- 'ActivationLimitDurationType': ActivationLimitDurationType_,
- 'ActivationLimitUsagesType': ActivationLimitUsagesType_,
- 'ActivationLimitSessionType': ActivationLimitSessionType_,
- 'LengthType': LengthType_,
- 'mediumType': MediumType_,
- 'KeyStorageType': KeyStorageType_,
- 'SecretKeyProtectionType': SecretKeyProtectionType_,
- 'SecurityAuditType': SecurityAuditType_,
- 'ExtensionOnlyType': ExtensionOnlyType_,
- 'Extension': Extension,
- 'ExtensionType': ExtensionType_,
- 'AuthnContextDeclarationBaseType': AuthnContextDeclarationBaseType_,
- 'AuthnMethodBaseType': AuthnMethodBaseType_,
- 'AuthenticatorBaseType': AuthenticatorBaseType_,
- 'AuthenticatorTransportProtocolType': AuthenticatorTransportProtocolType_,
+ "AuthenticationContextDeclaration": AuthenticationContextDeclaration,
+ "Identification": Identification,
+ "PhysicalVerification": PhysicalVerification,
+ "WrittenConsent": WrittenConsent,
+ "TechnicalProtection": TechnicalProtection,
+ "SecretKeyProtection": SecretKeyProtection,
+ "PrivateKeyProtection": PrivateKeyProtection,
+ "KeyActivation": KeyActivation,
+ "KeySharing": KeySharing,
+ "KeyStorage": KeyStorage,
+ "SubscriberLineNumber": SubscriberLineNumber,
+ "UserSuffix": UserSuffix,
+ "Password": Password,
+ "ActivationPin": ActivationPin,
+ "Token": Token,
+ "TimeSyncToken": TimeSyncToken,
+ "Smartcard": Smartcard,
+ "Length": Length,
+ "ActivationLimit": ActivationLimit,
+ "Generation": Generation,
+ "AuthnMethod": AuthnMethod,
+ "PrincipalAuthenticationMechanism": PrincipalAuthenticationMechanism,
+ "Authenticator": Authenticator,
+ "ComplexAuthenticator": ComplexAuthenticator,
+ "PreviousSession": PreviousSession,
+ "ResumeSession": ResumeSession,
+ "ZeroKnowledge": ZeroKnowledge,
+ "SharedSecretChallengeResponse": SharedSecretChallengeResponse,
+ "SharedSecretChallengeResponseType": SharedSecretChallengeResponseType_,
+ "DigSig": DigSig,
+ "AsymmetricDecryption": AsymmetricDecryption,
+ "AsymmetricKeyAgreement": AsymmetricKeyAgreement,
+ "PublicKeyType": PublicKeyType_,
+ "IPAddress": IPAddress,
+ "SharedSecretDynamicPlaintext": SharedSecretDynamicPlaintext,
+ "AuthenticatorTransportProtocol": AuthenticatorTransportProtocol,
+ "HTTP": HTTP,
+ "IPSec": IPSec,
+ "WTLS": WTLS,
+ "MobileNetworkNoEncryption": MobileNetworkNoEncryption,
+ "MobileNetworkRadioEncryption": MobileNetworkRadioEncryption,
+ "MobileNetworkEndToEndEncryption": MobileNetworkEndToEndEncryption,
+ "SSL": SSL,
+ "PSTN": PSTN,
+ "ISDN": ISDN,
+ "ADSL": ADSL,
+ "OperationalProtection": OperationalProtection,
+ "SecurityAudit": SecurityAudit,
+ "SwitchAudit": SwitchAudit,
+ "DeactivationCallCenter": DeactivationCallCenter,
+ "GoverningAgreements": GoverningAgreements,
+ "GoverningAgreementRef": GoverningAgreementRef,
+ "nymType": NymType_,
+ "IdentificationType": IdentificationType_,
+ "TechnicalProtectionBaseType": TechnicalProtectionBaseType_,
+ "OperationalProtectionType": OperationalProtectionType_,
+ "GoverningAgreementsType": GoverningAgreementsType_,
+ "GoverningAgreementRefType": GoverningAgreementRefType_,
+ "PrincipalAuthenticationMechanismType": PrincipalAuthenticationMechanismType_,
+ "ComplexAuthenticatorType": ComplexAuthenticatorType_,
+ "KeyActivationType": KeyActivationType_,
+ "KeySharingType": KeySharingType_,
+ "PrivateKeyProtectionType": PrivateKeyProtectionType_,
+ "PasswordType": PasswordType_,
+ "RestrictedPassword": RestrictedPassword,
+ "RestrictedPasswordType": RestrictedPasswordType_,
+ "RestrictedLengthType": RestrictedLengthType_,
+ "ActivationPinType": ActivationPinType_,
+ "Alphabet": Alphabet,
+ "AlphabetType": AlphabetType_,
+ "TokenType": TokenType_,
+ "DeviceTypeType": DeviceTypeType_,
+ "booleanType": BooleanType_,
+ "TimeSyncTokenType": TimeSyncTokenType_,
+ "ActivationLimitType": ActivationLimitType_,
+ "ActivationLimitDuration": ActivationLimitDuration,
+ "ActivationLimitUsages": ActivationLimitUsages,
+ "ActivationLimitSession": ActivationLimitSession,
+ "ActivationLimitDurationType": ActivationLimitDurationType_,
+ "ActivationLimitUsagesType": ActivationLimitUsagesType_,
+ "ActivationLimitSessionType": ActivationLimitSessionType_,
+ "LengthType": LengthType_,
+ "mediumType": MediumType_,
+ "KeyStorageType": KeyStorageType_,
+ "SecretKeyProtectionType": SecretKeyProtectionType_,
+ "SecurityAuditType": SecurityAuditType_,
+ "ExtensionOnlyType": ExtensionOnlyType_,
+ "Extension": Extension,
+ "ExtensionType": ExtensionType_,
+ "AuthnContextDeclarationBaseType": AuthnContextDeclarationBaseType_,
+ "AuthnMethodBaseType": AuthnMethodBaseType_,
+ "AuthenticatorBaseType": AuthenticatorBaseType_,
+ "AuthenticatorTransportProtocolType": AuthenticatorTransportProtocolType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/authn_context/pword.py b/src/saml2/authn_context/pword.py
index e4ddd601..7e8f6225 100644
--- a/src/saml2/authn_context/pword.py
+++ b/src/saml2/authn_context/pword.py
@@ -14,30 +14,32 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:ac:classes:Password"
class PhysicalVerification(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PhysicalVerification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PhysicalVerification element"""
- c_tag = 'PhysicalVerification'
+ c_tag = "PhysicalVerification"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['credentialLevel'] = ('credential_level', 'None', False)
-
- def __init__(self,
- credential_level=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["credentialLevel"] = ("credential_level", "None", False)
+
+ def __init__(
+ self,
+ credential_level=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.credential_level = credential_level
@@ -47,26 +49,28 @@ def physical_verification_from_string(xml_string):
class Generation(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Generation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Generation element"""
- c_tag = 'Generation'
+ c_tag = "Generation"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['mechanism'] = ('mechanism', 'None', True)
-
- def __init__(self,
- mechanism=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["mechanism"] = ("mechanism", "None", True)
+
+ def __init__(
+ self,
+ mechanism=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.mechanism = mechanism
@@ -76,12 +80,11 @@ def generation_from_string(xml_string):
class NymType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:nymType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:nymType element"""
- c_tag = 'nymType'
+ c_tag = "nymType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['anonymity', 'verinymity', 'pseudonymity']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["anonymity", "verinymity", "pseudonymity"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -93,57 +96,59 @@ def nym_type__from_string(xml_string):
class GoverningAgreementRefType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreementRefType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreementRefType element"""
- c_tag = 'GoverningAgreementRefType'
+ c_tag = "GoverningAgreementRefType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['governingAgreementRef'] = (
- 'governing_agreement_ref', 'anyURI', True)
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["governingAgreementRef"] = ("governing_agreement_ref", "anyURI", True)
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref
def governing_agreement_ref_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementRefType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementRefType_, xml_string)
class KeySharingType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeySharingType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeySharingType element"""
- c_tag = 'KeySharingType'
+ c_tag = "KeySharingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['sharing'] = ('sharing', 'boolean', True)
-
- def __init__(self,
- sharing=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["sharing"] = ("sharing", "boolean", True)
+
+ def __init__(
+ self,
+ sharing=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.sharing = sharing
@@ -153,28 +158,30 @@ def key_sharing_type__from_string(xml_string):
class RestrictedLengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:RestrictedLengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:RestrictedLengthType element"""
- c_tag = 'RestrictedLengthType'
+ c_tag = "RestrictedLengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'None', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "None", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -185,30 +192,32 @@ def restricted_length_type__from_string(xml_string):
class AlphabetType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AlphabetType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AlphabetType element"""
- c_tag = 'AlphabetType'
+ c_tag = "AlphabetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['requiredChars'] = ('required_chars', 'string', True)
- c_attributes['excludedChars'] = ('excluded_chars', 'string', False)
- c_attributes['case'] = ('case', 'string', False)
-
- def __init__(self,
- required_chars=None,
- excluded_chars=None,
- case=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["requiredChars"] = ("required_chars", "string", True)
+ c_attributes["excludedChars"] = ("excluded_chars", "string", False)
+ c_attributes["case"] = ("case", "string", False)
+
+ def __init__(
+ self,
+ required_chars=None,
+ excluded_chars=None,
+ case=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.required_chars = required_chars
self.excluded_chars = excluded_chars
@@ -220,12 +229,11 @@ def alphabet_type__from_string(xml_string):
class DeviceTypeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:DeviceTypeType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:DeviceTypeType element"""
- c_tag = 'DeviceTypeType'
+ c_tag = "DeviceTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['hardware', 'software']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["hardware", "software"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -237,11 +245,11 @@ def device_type_type__from_string(xml_string):
class BooleanType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:booleanType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:booleanType element"""
- c_tag = 'booleanType'
+ c_tag = "booleanType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN', 'enumeration': ['true', 'false']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["true", "false"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -253,30 +261,32 @@ def boolean_type__from_string(xml_string):
class TimeSyncTokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TimeSyncTokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TimeSyncTokenType element"""
- c_tag = 'TimeSyncTokenType'
+ c_tag = "TimeSyncTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['DeviceType'] = ('device_type', DeviceTypeType_, True)
- c_attributes['SeedLength'] = ('seed_length', 'integer', True)
- c_attributes['DeviceInHand'] = ('device_in_hand', BooleanType_, True)
-
- def __init__(self,
- device_type=None,
- seed_length=None,
- device_in_hand=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["DeviceType"] = ("device_type", DeviceTypeType_, True)
+ c_attributes["SeedLength"] = ("seed_length", "integer", True)
+ c_attributes["DeviceInHand"] = ("device_in_hand", BooleanType_, True)
+
+ def __init__(
+ self,
+ device_type=None,
+ seed_length=None,
+ device_in_hand=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.device_type = device_type
self.seed_length = seed_length
@@ -288,69 +298,71 @@ def time_sync_token_type__from_string(xml_string):
class ActivationLimitDurationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitDurationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitDurationType element"""
- c_tag = 'ActivationLimitDurationType'
+ c_tag = "ActivationLimitDurationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['duration'] = ('duration', 'duration', True)
-
- def __init__(self,
- duration=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["duration"] = ("duration", "duration", True)
+
+ def __init__(
+ self,
+ duration=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.duration = duration
def activation_limit_duration_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDurationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDurationType_, xml_string)
class ActivationLimitUsagesType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitUsagesType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitUsagesType element"""
- c_tag = 'ActivationLimitUsagesType'
+ c_tag = "ActivationLimitUsagesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['number'] = ('number', 'integer', True)
-
- def __init__(self,
- number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["number"] = ("number", "integer", True)
+
+ def __init__(
+ self,
+ number=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.number = number
def activation_limit_usages_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitUsagesType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitUsagesType_, xml_string)
class ActivationLimitSessionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitSessionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitSessionType element"""
- c_tag = 'ActivationLimitSessionType'
+ c_tag = "ActivationLimitSessionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -359,33 +371,34 @@ class ActivationLimitSessionType_(SamlBase):
def activation_limit_session_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSessionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSessionType_, xml_string)
class LengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:LengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:LengthType element"""
- c_tag = 'LengthType'
+ c_tag = "LengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'integer', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "integer", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -396,13 +409,14 @@ def length_type__from_string(xml_string):
class MediumType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:mediumType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:mediumType element"""
- c_tag = 'mediumType'
+ c_tag = "mediumType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['memory', 'smartcard', 'token',
- 'MobileDevice', 'MobileAuthCard']}
+ c_value_type = {
+ "base": "xs:NMTOKEN",
+ "enumeration": ["memory", "smartcard", "token", "MobileDevice", "MobileAuthCard"],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -414,26 +428,28 @@ def medium_type__from_string(xml_string):
class KeyStorageType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyStorageType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyStorageType element"""
- c_tag = 'KeyStorageType'
+ c_tag = "KeyStorageType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['medium'] = ('medium', MediumType_, True)
-
- def __init__(self,
- medium=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["medium"] = ("medium", MediumType_, True)
+
+ def __init__(
+ self,
+ medium=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.medium = medium
@@ -443,9 +459,9 @@ def key_storage_type__from_string(xml_string):
class ExtensionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ExtensionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ExtensionType element"""
- c_tag = 'ExtensionType'
+ c_tag = "ExtensionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -458,9 +474,9 @@ def extension_type__from_string(xml_string):
class KeySharing(KeySharingType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeySharing element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeySharing element"""
- c_tag = 'KeySharing'
+ c_tag = "KeySharing"
c_namespace = NAMESPACE
c_children = KeySharingType_.c_children.copy()
c_attributes = KeySharingType_.c_attributes.copy()
@@ -473,9 +489,9 @@ def key_sharing_from_string(xml_string):
class KeyStorage(KeyStorageType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyStorage element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyStorage element"""
- c_tag = 'KeyStorage'
+ c_tag = "KeyStorage"
c_namespace = NAMESPACE
c_children = KeyStorageType_.c_children.copy()
c_attributes = KeyStorageType_.c_attributes.copy()
@@ -488,9 +504,9 @@ def key_storage_from_string(xml_string):
class TimeSyncToken(TimeSyncTokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TimeSyncToken element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TimeSyncToken element"""
- c_tag = 'TimeSyncToken'
+ c_tag = "TimeSyncToken"
c_namespace = NAMESPACE
c_children = TimeSyncTokenType_.c_children.copy()
c_attributes = TimeSyncTokenType_.c_attributes.copy()
@@ -503,9 +519,9 @@ def time_sync_token_from_string(xml_string):
class Length(LengthType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Length element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Length element"""
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = LengthType_.c_children.copy()
c_attributes = LengthType_.c_attributes.copy()
@@ -518,9 +534,9 @@ def length_from_string(xml_string):
class GoverningAgreementRef(GoverningAgreementRefType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreementRef element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreementRef element"""
- c_tag = 'GoverningAgreementRef'
+ c_tag = "GoverningAgreementRef"
c_namespace = NAMESPACE
c_children = GoverningAgreementRefType_.c_children.copy()
c_attributes = GoverningAgreementRefType_.c_attributes.copy()
@@ -533,41 +549,43 @@ def governing_agreement_ref_from_string(xml_string):
class GoverningAgreementsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreementsType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreementsType element"""
- c_tag = 'GoverningAgreementsType'
+ c_tag = "GoverningAgreementsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}GoverningAgreementRef'] = (
- 'governing_agreement_ref', [GoverningAgreementRef])
- c_cardinality['governing_agreement_ref'] = {"min": 1}
- c_child_order.extend(['governing_agreement_ref'])
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}GoverningAgreementRef"] = (
+ "governing_agreement_ref",
+ [GoverningAgreementRef],
+ )
+ c_cardinality["governing_agreement_ref"] = {"min": 1}
+ c_child_order.extend(["governing_agreement_ref"])
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref or []
def governing_agreements_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementsType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementsType_, xml_string)
class RestrictedPasswordType_Length(RestrictedLengthType_):
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = RestrictedLengthType_.c_children.copy()
c_attributes = RestrictedLengthType_.c_attributes.copy()
@@ -576,14 +594,13 @@ class RestrictedPasswordType_Length(RestrictedLengthType_):
def restricted_password_type__length_from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_Length,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_Length, xml_string)
class Alphabet(AlphabetType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Alphabet element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Alphabet element"""
- c_tag = 'Alphabet'
+ c_tag = "Alphabet"
c_namespace = NAMESPACE
c_children = AlphabetType_.c_children.copy()
c_attributes = AlphabetType_.c_attributes.copy()
@@ -596,9 +613,9 @@ def alphabet_from_string(xml_string):
class ActivationLimitDuration(ActivationLimitDurationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitDuration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitDuration element"""
- c_tag = 'ActivationLimitDuration'
+ c_tag = "ActivationLimitDuration"
c_namespace = NAMESPACE
c_children = ActivationLimitDurationType_.c_children.copy()
c_attributes = ActivationLimitDurationType_.c_attributes.copy()
@@ -607,14 +624,13 @@ class ActivationLimitDuration(ActivationLimitDurationType_):
def activation_limit_duration_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDuration,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDuration, xml_string)
class ActivationLimitUsages(ActivationLimitUsagesType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitUsages element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitUsages element"""
- c_tag = 'ActivationLimitUsages'
+ c_tag = "ActivationLimitUsages"
c_namespace = NAMESPACE
c_children = ActivationLimitUsagesType_.c_children.copy()
c_attributes = ActivationLimitUsagesType_.c_attributes.copy()
@@ -627,9 +643,9 @@ def activation_limit_usages_from_string(xml_string):
class ActivationLimitSession(ActivationLimitSessionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitSession element"""
- c_tag = 'ActivationLimitSession'
+ c_tag = "ActivationLimitSession"
c_namespace = NAMESPACE
c_children = ActivationLimitSessionType_.c_children.copy()
c_attributes = ActivationLimitSessionType_.c_attributes.copy()
@@ -638,14 +654,13 @@ class ActivationLimitSession(ActivationLimitSessionType_):
def activation_limit_session_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSession,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSession, xml_string)
class Extension(ExtensionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Extension element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Extension element"""
- c_tag = 'Extension'
+ c_tag = "Extension"
c_namespace = NAMESPACE
c_children = ExtensionType_.c_children.copy()
c_attributes = ExtensionType_.c_attributes.copy()
@@ -658,67 +673,68 @@ def extension_from_string(xml_string):
class SharedSecretChallengeResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SharedSecretChallengeResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SharedSecretChallengeResponseType element"""
- c_tag = 'SharedSecretChallengeResponseType'
+ c_tag = "SharedSecretChallengeResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['method'] = ('method', 'anyURI', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- method=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["method"] = ("method", "anyURI", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ method=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.method = method
def shared_secret_challenge_response_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- SharedSecretChallengeResponseType_, xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponseType_, xml_string)
class PublicKeyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PublicKeyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PublicKeyType element"""
- c_tag = 'PublicKeyType'
+ c_tag = "PublicKeyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['keyValidation'] = ('key_validation', 'None', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- key_validation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["keyValidation"] = ("key_validation", "None", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ key_validation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.key_validation = key_validation
@@ -729,9 +745,9 @@ def public_key_type__from_string(xml_string):
class GoverningAgreements(GoverningAgreementsType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreements element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:GoverningAgreements element"""
- c_tag = 'GoverningAgreements'
+ c_tag = "GoverningAgreements"
c_namespace = NAMESPACE
c_children = GoverningAgreementsType_.c_children.copy()
c_attributes = GoverningAgreementsType_.c_attributes.copy()
@@ -744,45 +760,41 @@ def governing_agreements_from_string(xml_string):
class PasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PasswordType element"""
- c_tag = 'PasswordType'
+ c_tag = "PasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'alphabet', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "alphabet", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -796,40 +808,37 @@ def password_type__from_string(xml_string):
class RestrictedPasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:RestrictedPasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:RestrictedPasswordType element"""
- c_tag = 'RestrictedPasswordType'
+ c_tag = "RestrictedPasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Length'] = (
- 'length', RestrictedPasswordType_Length)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Length"] = ("length", RestrictedPasswordType_Length)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.generation = generation
@@ -838,38 +847,36 @@ class RestrictedPasswordType_(SamlBase):
def restricted_password_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_, xml_string)
class TokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TokenType element"""
- c_tag = 'TokenType'
+ c_tag = "TokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}TimeSyncToken'] = (
- 'time_sync_token', TimeSyncToken)
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['time_sync_token', 'extension'])
-
- def __init__(self,
- time_sync_token=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}TimeSyncToken"] = ("time_sync_token", TimeSyncToken)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["time_sync_token", "extension"])
+
+ def __init__(
+ self,
+ time_sync_token=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.time_sync_token = time_sync_token
self.extension = extension or []
@@ -880,42 +887,45 @@ def token_type__from_string(xml_string):
class ActivationLimitType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimitType element"""
- c_tag = 'ActivationLimitType'
+ c_tag = "ActivationLimitType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimitDuration'] = (
- 'activation_limit_duration', ActivationLimitDuration)
- c_cardinality['activation_limit_duration'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimitUsages'] = (
- 'activation_limit_usages', ActivationLimitUsages)
- c_cardinality['activation_limit_usages'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimitSession'] = (
- 'activation_limit_session', ActivationLimitSession)
- c_cardinality['activation_limit_session'] = {"min": 0, "max": 1}
- c_child_order.extend(
- ['activation_limit_duration', 'activation_limit_usages',
- 'activation_limit_session'])
-
- def __init__(self,
- activation_limit_duration=None,
- activation_limit_usages=None,
- activation_limit_session=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimitDuration"] = (
+ "activation_limit_duration",
+ ActivationLimitDuration,
+ )
+ c_cardinality["activation_limit_duration"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimitUsages"] = (
+ "activation_limit_usages",
+ ActivationLimitUsages,
+ )
+ c_cardinality["activation_limit_usages"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimitSession"] = (
+ "activation_limit_session",
+ ActivationLimitSession,
+ )
+ c_cardinality["activation_limit_session"] = {"min": 0, "max": 1}
+ c_child_order.extend(["activation_limit_duration", "activation_limit_usages", "activation_limit_session"])
+
+ def __init__(
+ self,
+ activation_limit_duration=None,
+ activation_limit_usages=None,
+ activation_limit_session=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_limit_duration = activation_limit_duration
self.activation_limit_usages = activation_limit_usages
@@ -927,29 +937,30 @@ def activation_limit_type__from_string(xml_string):
class ExtensionOnlyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ExtensionOnlyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ExtensionOnlyType element"""
- c_tag = 'ExtensionOnlyType'
+ c_tag = "ExtensionOnlyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
@@ -959,9 +970,9 @@ def extension_only_type__from_string(xml_string):
class WrittenConsent(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:WrittenConsent element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:WrittenConsent element"""
- c_tag = 'WrittenConsent'
+ c_tag = "WrittenConsent"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -974,9 +985,9 @@ def written_consent_from_string(xml_string):
class SubscriberLineNumber(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SubscriberLineNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SubscriberLineNumber element"""
- c_tag = 'SubscriberLineNumber'
+ c_tag = "SubscriberLineNumber"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -989,9 +1000,9 @@ def subscriber_line_number_from_string(xml_string):
class UserSuffix(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:UserSuffix element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:UserSuffix element"""
- c_tag = 'UserSuffix'
+ c_tag = "UserSuffix"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1004,9 +1015,9 @@ def user_suffix_from_string(xml_string):
class Password(PasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Password element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Password element"""
- c_tag = 'Password'
+ c_tag = "Password"
c_namespace = NAMESPACE
c_children = PasswordType_.c_children.copy()
c_attributes = PasswordType_.c_attributes.copy()
@@ -1019,9 +1030,9 @@ def password_from_string(xml_string):
class Token(TokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Token element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Token element"""
- c_tag = 'Token'
+ c_tag = "Token"
c_namespace = NAMESPACE
c_children = TokenType_.c_children.copy()
c_attributes = TokenType_.c_attributes.copy()
@@ -1034,9 +1045,9 @@ def token_from_string(xml_string):
class Smartcard(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Smartcard element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Smartcard element"""
- c_tag = 'Smartcard'
+ c_tag = "Smartcard"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1049,9 +1060,9 @@ def smartcard_from_string(xml_string):
class ActivationLimit(ActivationLimitType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationLimit element"""
- c_tag = 'ActivationLimit'
+ c_tag = "ActivationLimit"
c_namespace = NAMESPACE
c_children = ActivationLimitType_.c_children.copy()
c_attributes = ActivationLimitType_.c_attributes.copy()
@@ -1064,9 +1075,9 @@ def activation_limit_from_string(xml_string):
class PreviousSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PreviousSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PreviousSession element"""
- c_tag = 'PreviousSession'
+ c_tag = "PreviousSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1079,9 +1090,9 @@ def previous_session_from_string(xml_string):
class ResumeSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ResumeSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ResumeSession element"""
- c_tag = 'ResumeSession'
+ c_tag = "ResumeSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1094,9 +1105,9 @@ def resume_session_from_string(xml_string):
class ZeroKnowledge(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ZeroKnowledge element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ZeroKnowledge element"""
- c_tag = 'ZeroKnowledge'
+ c_tag = "ZeroKnowledge"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1109,9 +1120,9 @@ def zero_knowledge_from_string(xml_string):
class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SharedSecretChallengeResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SharedSecretChallengeResponse element"""
- c_tag = 'SharedSecretChallengeResponse'
+ c_tag = "SharedSecretChallengeResponse"
c_namespace = NAMESPACE
c_children = SharedSecretChallengeResponseType_.c_children.copy()
c_attributes = SharedSecretChallengeResponseType_.c_attributes.copy()
@@ -1120,14 +1131,13 @@ class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
def shared_secret_challenge_response_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretChallengeResponse,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponse, xml_string)
class DigSig(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:DigSig element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:DigSig element"""
- c_tag = 'DigSig'
+ c_tag = "DigSig"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1140,9 +1150,9 @@ def dig_sig_from_string(xml_string):
class AsymmetricDecryption(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AsymmetricDecryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AsymmetricDecryption element"""
- c_tag = 'AsymmetricDecryption'
+ c_tag = "AsymmetricDecryption"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1155,9 +1165,9 @@ def asymmetric_decryption_from_string(xml_string):
class AsymmetricKeyAgreement(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AsymmetricKeyAgreement element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AsymmetricKeyAgreement element"""
- c_tag = 'AsymmetricKeyAgreement'
+ c_tag = "AsymmetricKeyAgreement"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1166,14 +1176,13 @@ class AsymmetricKeyAgreement(PublicKeyType_):
def asymmetric_key_agreement_from_string(xml_string):
- return saml2.create_class_from_xml_string(AsymmetricKeyAgreement,
- xml_string)
+ return saml2.create_class_from_xml_string(AsymmetricKeyAgreement, xml_string)
class IPAddress(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:IPAddress element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:IPAddress element"""
- c_tag = 'IPAddress'
+ c_tag = "IPAddress"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1186,9 +1195,9 @@ def ip_address_from_string(xml_string):
class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SharedSecretDynamicPlaintext element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SharedSecretDynamicPlaintext element"""
- c_tag = 'SharedSecretDynamicPlaintext'
+ c_tag = "SharedSecretDynamicPlaintext"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1197,14 +1206,13 @@ class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
def shared_secret_dynamic_plaintext_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext, xml_string)
class HTTP(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:HTTP element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:HTTP element"""
- c_tag = 'HTTP'
+ c_tag = "HTTP"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1217,9 +1225,9 @@ def http_from_string(xml_string):
class IPSec(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:IPSec element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:IPSec element"""
- c_tag = 'IPSec'
+ c_tag = "IPSec"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1232,9 +1240,9 @@ def ip_sec_from_string(xml_string):
class WTLS(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:WTLS element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:WTLS element"""
- c_tag = 'WTLS'
+ c_tag = "WTLS"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1247,9 +1255,9 @@ def wtls_from_string(xml_string):
class MobileNetworkNoEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:MobileNetworkNoEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:MobileNetworkNoEncryption element"""
- c_tag = 'MobileNetworkNoEncryption'
+ c_tag = "MobileNetworkNoEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1258,14 +1266,13 @@ class MobileNetworkNoEncryption(ExtensionOnlyType_):
def mobile_network_no_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkNoEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkNoEncryption, xml_string)
class MobileNetworkRadioEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:MobileNetworkRadioEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:MobileNetworkRadioEncryption element"""
- c_tag = 'MobileNetworkRadioEncryption'
+ c_tag = "MobileNetworkRadioEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1274,14 +1281,13 @@ class MobileNetworkRadioEncryption(ExtensionOnlyType_):
def mobile_network_radio_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption, xml_string)
class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:MobileNetworkEndToEndEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:MobileNetworkEndToEndEncryption element"""
- c_tag = 'MobileNetworkEndToEndEncryption'
+ c_tag = "MobileNetworkEndToEndEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1290,14 +1296,13 @@ class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
def mobile_network_end_to_end_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption, xml_string)
class SSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SSL element"""
- c_tag = 'SSL'
+ c_tag = "SSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1310,9 +1315,9 @@ def ssl_from_string(xml_string):
class PSTN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PSTN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PSTN element"""
- c_tag = 'PSTN'
+ c_tag = "PSTN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1325,9 +1330,9 @@ def pstn_from_string(xml_string):
class ISDN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ISDN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ISDN element"""
- c_tag = 'ISDN'
+ c_tag = "ISDN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1340,9 +1345,9 @@ def isdn_from_string(xml_string):
class ADSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ADSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ADSL element"""
- c_tag = 'ADSL'
+ c_tag = "ADSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1355,9 +1360,9 @@ def adsl_from_string(xml_string):
class SwitchAudit(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SwitchAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SwitchAudit element"""
- c_tag = 'SwitchAudit'
+ c_tag = "SwitchAudit"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1370,9 +1375,9 @@ def switch_audit_from_string(xml_string):
class DeactivationCallCenter(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:DeactivationCallCenter element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:DeactivationCallCenter element"""
- c_tag = 'DeactivationCallCenter'
+ c_tag = "DeactivationCallCenter"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1381,53 +1386,51 @@ class DeactivationCallCenter(ExtensionOnlyType_):
def deactivation_call_center_from_string(xml_string):
- return saml2.create_class_from_xml_string(DeactivationCallCenter,
- xml_string)
+ return saml2.create_class_from_xml_string(DeactivationCallCenter, xml_string)
class IdentificationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:IdentificationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:IdentificationType element"""
- c_tag = 'IdentificationType'
+ c_tag = "IdentificationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PhysicalVerification'] = (
- 'physical_verification', PhysicalVerification)
- c_cardinality['physical_verification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}WrittenConsent'] = (
- 'written_consent', WrittenConsent)
- c_cardinality['written_consent'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['nym'] = ('nym', NymType_, False)
- c_child_order.extend(
- ['physical_verification', 'written_consent', 'governing_agreements',
- 'extension'])
-
- def __init__(self,
- physical_verification=None,
- written_consent=None,
- governing_agreements=None,
- extension=None,
- nym=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PhysicalVerification"] = (
+ "physical_verification",
+ PhysicalVerification,
+ )
+ c_cardinality["physical_verification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}WrittenConsent"] = ("written_consent", WrittenConsent)
+ c_cardinality["written_consent"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["nym"] = ("nym", NymType_, False)
+ c_child_order.extend(["physical_verification", "written_consent", "governing_agreements", "extension"])
+
+ def __init__(
+ self,
+ physical_verification=None,
+ written_consent=None,
+ governing_agreements=None,
+ extension=None,
+ nym=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.physical_verification = physical_verification
self.written_consent = written_consent
@@ -1441,75 +1444,83 @@ def identification_type__from_string(xml_string):
class AuthenticatorTransportProtocolType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticatorTransportProtocolType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticatorTransportProtocolType element"""
- c_tag = 'AuthenticatorTransportProtocolType'
+ c_tag = "AuthenticatorTransportProtocolType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}HTTP'] = (
- 'http', HTTP)
- c_cardinality['http'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SSL'] = (
- 'ssl', SSL)
- c_cardinality['ssl'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}MobileNetworkNoEncryption'] = (
- 'mobile_network_no_encryption', MobileNetworkNoEncryption)
- c_cardinality['mobile_network_no_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}MobileNetworkRadioEncryption'] = (
- 'mobile_network_radio_encryption', MobileNetworkRadioEncryption)
- c_cardinality['mobile_network_radio_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}MobileNetworkEndToEndEncryption'] = (
- 'mobile_network_end_to_end_encryption', MobileNetworkEndToEndEncryption)
- c_cardinality['mobile_network_end_to_end_encryption'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}WTLS'] = (
- 'wtls', WTLS)
- c_cardinality['wtls'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}IPSec'] = (
- 'ip_sec', IPSec)
- c_cardinality['ip_sec'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PSTN'] = (
- 'pstn', PSTN)
- c_cardinality['pstn'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ISDN'] = (
- 'isdn', ISDN)
- c_cardinality['isdn'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ADSL'] = (
- 'adsl', ADSL)
- c_cardinality['adsl'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['http', 'ssl', 'mobile_network_no_encryption',
- 'mobile_network_radio_encryption',
- 'mobile_network_end_to_end_encryption', 'wtls',
- 'ip_sec', 'pstn', 'isdn', 'adsl', 'extension'])
-
- def __init__(self,
- http=None,
- ssl=None,
- mobile_network_no_encryption=None,
- mobile_network_radio_encryption=None,
- mobile_network_end_to_end_encryption=None,
- wtls=None,
- ip_sec=None,
- pstn=None,
- isdn=None,
- adsl=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}HTTP"] = ("http", HTTP)
+ c_cardinality["http"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SSL"] = ("ssl", SSL)
+ c_cardinality["ssl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}MobileNetworkNoEncryption"] = (
+ "mobile_network_no_encryption",
+ MobileNetworkNoEncryption,
+ )
+ c_cardinality["mobile_network_no_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}MobileNetworkRadioEncryption"] = (
+ "mobile_network_radio_encryption",
+ MobileNetworkRadioEncryption,
+ )
+ c_cardinality["mobile_network_radio_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}MobileNetworkEndToEndEncryption"] = (
+ "mobile_network_end_to_end_encryption",
+ MobileNetworkEndToEndEncryption,
+ )
+ c_cardinality["mobile_network_end_to_end_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}WTLS"] = ("wtls", WTLS)
+ c_cardinality["wtls"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}IPSec"] = ("ip_sec", IPSec)
+ c_cardinality["ip_sec"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PSTN"] = ("pstn", PSTN)
+ c_cardinality["pstn"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ISDN"] = ("isdn", ISDN)
+ c_cardinality["isdn"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ADSL"] = ("adsl", ADSL)
+ c_cardinality["adsl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ [
+ "http",
+ "ssl",
+ "mobile_network_no_encryption",
+ "mobile_network_radio_encryption",
+ "mobile_network_end_to_end_encryption",
+ "wtls",
+ "ip_sec",
+ "pstn",
+ "isdn",
+ "adsl",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ http=None,
+ ssl=None,
+ mobile_network_no_encryption=None,
+ mobile_network_radio_encryption=None,
+ mobile_network_end_to_end_encryption=None,
+ wtls=None,
+ ip_sec=None,
+ pstn=None,
+ isdn=None,
+ adsl=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.http = http
self.ssl = ssl
@@ -1525,14 +1536,13 @@ class AuthenticatorTransportProtocolType_(SamlBase):
def authenticator_transport_protocol_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- AuthenticatorTransportProtocolType_, xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocolType_, xml_string)
class RestrictedPassword(RestrictedPasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:RestrictedPassword element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:RestrictedPassword element"""
- c_tag = 'RestrictedPassword'
+ c_tag = "RestrictedPassword"
c_namespace = NAMESPACE
c_children = RestrictedPasswordType_.c_children.copy()
c_attributes = RestrictedPasswordType_.c_attributes.copy()
@@ -1545,48 +1555,45 @@ def restricted_password_from_string(xml_string):
class ActivationPinType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationPinType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationPinType element"""
- c_tag = 'ActivationPinType'
+ c_tag = "ActivationPinType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimit'] = (
- 'activation_limit', ActivationLimit)
- c_cardinality['activation_limit'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['length', 'alphabet', 'generation', 'activation_limit', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- activation_limit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationLimit"] = (
+ "activation_limit",
+ ActivationLimit,
+ )
+ c_cardinality["activation_limit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["length", "alphabet", "generation", "activation_limit", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ activation_limit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -1600,34 +1607,33 @@ def activation_pin_type__from_string(xml_string):
class SecurityAuditType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecurityAuditType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecurityAuditType element"""
- c_tag = 'SecurityAuditType'
+ c_tag = "SecurityAuditType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SwitchAudit'] = (
- 'switch_audit', SwitchAudit)
- c_cardinality['switch_audit'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['switch_audit', 'extension'])
-
- def __init__(self,
- switch_audit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SwitchAudit"] = ("switch_audit", SwitchAudit)
+ c_cardinality["switch_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["switch_audit", "extension"])
+
+ def __init__(
+ self,
+ switch_audit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.switch_audit = switch_audit
self.extension = extension or []
@@ -1638,43 +1644,44 @@ def security_audit_type__from_string(xml_string):
class AuthenticatorBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticatorBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticatorBaseType element"""
- c_tag = 'AuthenticatorBaseType'
+ c_tag = "AuthenticatorBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}RestrictedPassword'] = (
-
- 'restricted_password', RestrictedPassword)
- c_child_order.extend(['restricted_password'])
-
- def __init__(self,
- restricted_password=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_child_order.extend(["restricted_password"])
+
+ def __init__(
+ self,
+ restricted_password=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.restricted_password = restricted_password
def authenticator_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorBaseType_, xml_string)
class Identification(IdentificationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Identification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Identification element"""
- c_tag = 'Identification'
+ c_tag = "Identification"
c_namespace = NAMESPACE
c_children = IdentificationType_.c_children.copy()
c_attributes = IdentificationType_.c_attributes.copy()
@@ -1687,9 +1694,9 @@ def identification_from_string(xml_string):
class ActivationPin(ActivationPinType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationPin element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ActivationPin element"""
- c_tag = 'ActivationPin'
+ c_tag = "ActivationPin"
c_namespace = NAMESPACE
c_children = ActivationPinType_.c_children.copy()
c_attributes = ActivationPinType_.c_attributes.copy()
@@ -1702,9 +1709,9 @@ def activation_pin_from_string(xml_string):
class Authenticator(AuthenticatorBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Authenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Authenticator element"""
- c_tag = 'Authenticator'
+ c_tag = "Authenticator"
c_namespace = NAMESPACE
c_children = AuthenticatorBaseType_.c_children.copy()
c_attributes = AuthenticatorBaseType_.c_attributes.copy()
@@ -1717,9 +1724,9 @@ def authenticator_from_string(xml_string):
class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticatorTransportProtocol element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticatorTransportProtocol element"""
- c_tag = 'AuthenticatorTransportProtocol'
+ c_tag = "AuthenticatorTransportProtocol"
c_namespace = NAMESPACE
c_children = AuthenticatorTransportProtocolType_.c_children.copy()
c_attributes = AuthenticatorTransportProtocolType_.c_attributes.copy()
@@ -1728,14 +1735,13 @@ class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
def authenticator_transport_protocol_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol, xml_string)
class SecurityAudit(SecurityAuditType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecurityAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecurityAudit element"""
- c_tag = 'SecurityAudit'
+ c_tag = "SecurityAudit"
c_namespace = NAMESPACE
c_children = SecurityAuditType_.c_children.copy()
c_attributes = SecurityAuditType_.c_attributes.copy()
@@ -1748,40 +1754,39 @@ def security_audit_from_string(xml_string):
class OperationalProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:OperationalProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:OperationalProtectionType element"""
- c_tag = 'OperationalProtectionType'
+ c_tag = "OperationalProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SecurityAudit'] = (
- 'security_audit', SecurityAudit)
- c_cardinality['security_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}DeactivationCallCenter'] = (
- 'deactivation_call_center', DeactivationCallCenter)
- c_cardinality['deactivation_call_center'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['security_audit', 'deactivation_call_center', 'extension'])
-
- def __init__(self,
- security_audit=None,
- deactivation_call_center=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SecurityAudit"] = ("security_audit", SecurityAudit)
+ c_cardinality["security_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}DeactivationCallCenter"] = (
+ "deactivation_call_center",
+ DeactivationCallCenter,
+ )
+ c_cardinality["deactivation_call_center"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["security_audit", "deactivation_call_center", "extension"])
+
+ def __init__(
+ self,
+ security_audit=None,
+ deactivation_call_center=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.security_audit = security_audit
self.deactivation_call_center = deactivation_call_center
@@ -1789,60 +1794,54 @@ class OperationalProtectionType_(SamlBase):
def operational_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(OperationalProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(OperationalProtectionType_, xml_string)
class PrincipalAuthenticationMechanismType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrincipalAuthenticationMechanismType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrincipalAuthenticationMechanismType element"""
- c_tag = 'PrincipalAuthenticationMechanismType'
+ c_tag = "PrincipalAuthenticationMechanismType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Token'] = (
- 'token', Token)
- c_cardinality['token'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Smartcard'] = (
- 'smartcard', Smartcard)
- c_cardinality['smartcard'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['preauth'] = ('preauth', 'integer', False)
- c_child_order.extend(
- ['password', 'restricted_password', 'token', 'smartcard',
- 'activation_pin', 'extension'])
-
- def __init__(self,
- password=None,
- restricted_password=None,
- token=None,
- smartcard=None,
- activation_pin=None,
- extension=None,
- preauth=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Token"] = ("token", Token)
+ c_cardinality["token"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Smartcard"] = ("smartcard", Smartcard)
+ c_cardinality["smartcard"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationPin"] = ("activation_pin", ActivationPin)
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["preauth"] = ("preauth", "integer", False)
+ c_child_order.extend(["password", "restricted_password", "token", "smartcard", "activation_pin", "extension"])
+
+ def __init__(
+ self,
+ password=None,
+ restricted_password=None,
+ token=None,
+ smartcard=None,
+ activation_pin=None,
+ extension=None,
+ preauth=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.password = password
self.restricted_password = restricted_password
@@ -1854,39 +1853,37 @@ class PrincipalAuthenticationMechanismType_(SamlBase):
def principal_authentication_mechanism_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- PrincipalAuthenticationMechanismType_, xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanismType_, xml_string)
class KeyActivationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyActivationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyActivationType element"""
- c_tag = 'KeyActivationType'
+ c_tag = "KeyActivationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['activation_pin', 'extension'])
-
- def __init__(self,
- activation_pin=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ActivationPin"] = ("activation_pin", ActivationPin)
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["activation_pin", "extension"])
+
+ def __init__(
+ self,
+ activation_pin=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_pin = activation_pin
self.extension = extension or []
@@ -1897,9 +1894,9 @@ def key_activation_type__from_string(xml_string):
class KeyActivation(KeyActivationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyActivation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:KeyActivation element"""
- c_tag = 'KeyActivation'
+ c_tag = "KeyActivation"
c_namespace = NAMESPACE
c_children = KeyActivationType_.c_children.copy()
c_attributes = KeyActivationType_.c_attributes.copy()
@@ -1912,9 +1909,9 @@ def key_activation_from_string(xml_string):
class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrincipalAuthenticationMechanism element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrincipalAuthenticationMechanism element"""
- c_tag = 'PrincipalAuthenticationMechanism'
+ c_tag = "PrincipalAuthenticationMechanism"
c_namespace = NAMESPACE
c_children = PrincipalAuthenticationMechanismType_.c_children.copy()
c_attributes = PrincipalAuthenticationMechanismType_.c_attributes.copy()
@@ -1923,14 +1920,13 @@ class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
def principal_authentication_mechanism_from_string(xml_string):
- return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism,
- xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism, xml_string)
class OperationalProtection(OperationalProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:OperationalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:OperationalProtection element"""
- c_tag = 'OperationalProtection'
+ c_tag = "OperationalProtection"
c_namespace = NAMESPACE
c_children = OperationalProtectionType_.c_children.copy()
c_attributes = OperationalProtectionType_.c_attributes.copy()
@@ -1943,45 +1939,39 @@ def operational_protection_from_string(xml_string):
class PrivateKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrivateKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrivateKeyProtectionType element"""
- c_tag = 'PrivateKeyProtectionType'
+ c_tag = "PrivateKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeySharing'] = (
- 'key_sharing', KeySharing)
- c_cardinality['key_sharing'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['key_activation', 'key_storage', 'key_sharing', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- key_sharing=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyActivation"] = ("key_activation", KeyActivation)
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyStorage"] = ("key_storage", KeyStorage)
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeySharing"] = ("key_sharing", KeySharing)
+ c_cardinality["key_sharing"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "key_sharing", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ key_sharing=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -1990,44 +1980,40 @@ class PrivateKeyProtectionType_(SamlBase):
def private_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(PrivateKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(PrivateKeyProtectionType_, xml_string)
class SecretKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecretKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecretKeyProtectionType element"""
- c_tag = 'SecretKeyProtectionType'
+ c_tag = "SecretKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['key_activation', 'key_storage', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyActivation"] = ("key_activation", KeyActivation)
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}KeyStorage"] = ("key_storage", KeyStorage)
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -2035,50 +2021,50 @@ class SecretKeyProtectionType_(SamlBase):
def secret_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SecretKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SecretKeyProtectionType_, xml_string)
class AuthnMethodBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthnMethodBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthnMethodBaseType element"""
- c_tag = 'AuthnMethodBaseType'
+ c_tag = "AuthnMethodBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PrincipalAuthenticationMechanism'] = (
-
- 'principal_authentication_mechanism', PrincipalAuthenticationMechanism)
- c_cardinality['principal_authentication_mechanism'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Authenticator'] = (
- 'authenticator', Authenticator)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AuthenticatorTransportProtocol'] = (
- 'authenticator_transport_protocol', AuthenticatorTransportProtocol)
- c_cardinality['authenticator_transport_protocol'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['principal_authentication_mechanism', 'authenticator',
- 'authenticator_transport_protocol', 'extension'])
-
- def __init__(self,
- principal_authentication_mechanism=None,
- authenticator=None,
- authenticator_transport_protocol=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PrincipalAuthenticationMechanism"] = (
+ "principal_authentication_mechanism",
+ PrincipalAuthenticationMechanism,
+ )
+ c_cardinality["principal_authentication_mechanism"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Authenticator"] = ("authenticator", Authenticator)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AuthenticatorTransportProtocol"] = (
+ "authenticator_transport_protocol",
+ AuthenticatorTransportProtocol,
+ )
+ c_cardinality["authenticator_transport_protocol"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ ["principal_authentication_mechanism", "authenticator", "authenticator_transport_protocol", "extension"]
+ )
+
+ def __init__(
+ self,
+ principal_authentication_mechanism=None,
+ authenticator=None,
+ authenticator_transport_protocol=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.principal_authentication_mechanism = principal_authentication_mechanism
self.authenticator = authenticator
@@ -2091,9 +2077,9 @@ def authn_method_base_type__from_string(xml_string):
class SecretKeyProtection(SecretKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecretKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:SecretKeyProtection element"""
- c_tag = 'SecretKeyProtection'
+ c_tag = "SecretKeyProtection"
c_namespace = NAMESPACE
c_children = SecretKeyProtectionType_.c_children.copy()
c_attributes = SecretKeyProtectionType_.c_attributes.copy()
@@ -2106,9 +2092,9 @@ def secret_key_protection_from_string(xml_string):
class PrivateKeyProtection(PrivateKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrivateKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:PrivateKeyProtection element"""
- c_tag = 'PrivateKeyProtection'
+ c_tag = "PrivateKeyProtection"
c_namespace = NAMESPACE
c_children = PrivateKeyProtectionType_.c_children.copy()
c_attributes = PrivateKeyProtectionType_.c_attributes.copy()
@@ -2121,9 +2107,9 @@ def private_key_protection_from_string(xml_string):
class AuthnMethod(AuthnMethodBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthnMethod element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthnMethod element"""
- c_tag = 'AuthnMethod'
+ c_tag = "AuthnMethod"
c_namespace = NAMESPACE
c_children = AuthnMethodBaseType_.c_children.copy()
c_attributes = AuthnMethodBaseType_.c_attributes.copy()
@@ -2136,40 +2122,42 @@ def authn_method_from_string(xml_string):
class TechnicalProtectionBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TechnicalProtectionBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TechnicalProtectionBaseType element"""
- c_tag = 'TechnicalProtectionBaseType'
+ c_tag = "TechnicalProtectionBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PrivateKeyProtection'] = (
- 'private_key_protection', PrivateKeyProtection)
- c_cardinality['private_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SecretKeyProtection'] = (
- 'secret_key_protection', SecretKeyProtection)
- c_cardinality['secret_key_protection'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['private_key_protection', 'secret_key_protection', 'extension'])
-
- def __init__(self,
- private_key_protection=None,
- secret_key_protection=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PrivateKeyProtection"] = (
+ "private_key_protection",
+ PrivateKeyProtection,
+ )
+ c_cardinality["private_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SecretKeyProtection"] = (
+ "secret_key_protection",
+ SecretKeyProtection,
+ )
+ c_cardinality["secret_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["private_key_protection", "secret_key_protection", "extension"])
+
+ def __init__(
+ self,
+ private_key_protection=None,
+ secret_key_protection=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.private_key_protection = private_key_protection
self.secret_key_protection = secret_key_protection
@@ -2177,14 +2165,13 @@ class TechnicalProtectionBaseType_(SamlBase):
def technical_protection_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_, xml_string)
class TechnicalProtection(TechnicalProtectionBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TechnicalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:TechnicalProtection element"""
- c_tag = 'TechnicalProtection'
+ c_tag = "TechnicalProtection"
c_namespace = NAMESPACE
c_children = TechnicalProtectionBaseType_.c_children.copy()
c_attributes = TechnicalProtectionBaseType_.c_attributes.copy()
@@ -2197,57 +2184,64 @@ def technical_protection_from_string(xml_string):
class AuthnContextDeclarationBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthnContextDeclarationBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthnContextDeclarationBaseType element"""
- c_tag = 'AuthnContextDeclarationBaseType'
+ c_tag = "AuthnContextDeclarationBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Identification'] = (
- 'identification', Identification)
- c_cardinality['identification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}TechnicalProtection'] = (
- 'technical_protection', TechnicalProtection)
- c_cardinality['technical_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}OperationalProtection'] = (
- 'operational_protection', OperationalProtection)
- c_cardinality['operational_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AuthnMethod'] = (
- 'authn_method', AuthnMethod)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ID'] = ('id', 'ID', False)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Identification"] = ("identification", Identification)
+ c_cardinality["identification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}TechnicalProtection"] = (
+ "technical_protection",
+ TechnicalProtection,
+ )
+ c_cardinality["technical_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}OperationalProtection"] = (
+ "operational_protection",
+ OperationalProtection,
+ )
+ c_cardinality["operational_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AuthnMethod"] = ("authn_method", AuthnMethod)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ID"] = ("id", "ID", False)
c_child_order.extend(
- ['identification', 'technical_protection', 'operational_protection',
- 'authn_method', 'governing_agreements', 'extension'])
-
- def __init__(self,
- identification=None,
- technical_protection=None,
- operational_protection=None,
- authn_method=None,
- governing_agreements=None,
- extension=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "identification",
+ "technical_protection",
+ "operational_protection",
+ "authn_method",
+ "governing_agreements",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ identification=None,
+ technical_protection=None,
+ operational_protection=None,
+ authn_method=None,
+ governing_agreements=None,
+ extension=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.identification = identification
self.technical_protection = technical_protection
@@ -2259,14 +2253,13 @@ class AuthnContextDeclarationBaseType_(SamlBase):
def authn_context_declaration_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_, xml_string)
class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticationContextDeclaration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:AuthenticationContextDeclaration element"""
- c_tag = 'AuthenticationContextDeclaration'
+ c_tag = "AuthenticationContextDeclaration"
c_namespace = NAMESPACE
c_children = AuthnContextDeclarationBaseType_.c_children.copy()
c_attributes = AuthnContextDeclarationBaseType_.c_attributes.copy()
@@ -2275,107 +2268,116 @@ class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
def authentication_context_declaration_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticationContextDeclaration,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticationContextDeclaration, xml_string)
-#..................
+# ..................
# ['ComplexAuthenticator', 'ComplexAuthenticatorType']
class ComplexAuthenticatorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ComplexAuthenticatorType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ComplexAuthenticatorType element"""
- c_tag = 'ComplexAuthenticatorType'
+ c_tag = "ComplexAuthenticatorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PreviousSession'] = (
- 'previous_session', PreviousSession)
- c_cardinality['previous_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ResumeSession'] = (
- 'resume_session', ResumeSession)
- c_cardinality['resume_session'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}DigSig'] = (
- 'dig_sig', DigSig)
- c_cardinality['dig_sig'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}RestrictedPassword' \
- ''] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ZeroKnowledge'] = (
- 'zero_knowledge', ZeroKnowledge)
- c_cardinality['zero_knowledge'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}IPAddress'] = (
- 'ip_address', IPAddress)
- c_cardinality['ip_address'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AsymmetricDecryption'] = (
- 'asymmetric_decryption', AsymmetricDecryption)
- c_cardinality['asymmetric_decryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AsymmetricKeyAgreement'] = (
- 'asymmetric_key_agreement', AsymmetricKeyAgreement)
- c_cardinality['asymmetric_key_agreement'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SubscriberLineNumber'] = (
- 'subscriber_line_number', SubscriberLineNumber)
- c_cardinality['subscriber_line_number'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}UserSuffix'] = (
- 'user_suffix', UserSuffix)
- c_cardinality['user_suffix'] = {"min": 0, "max": 1}
- c_cardinality['complex_authenticator'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}PreviousSession"] = (
+ "previous_session",
+ PreviousSession,
+ )
+ c_cardinality["previous_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ResumeSession"] = ("resume_session", ResumeSession)
+ c_cardinality["resume_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}DigSig"] = ("dig_sig", DigSig)
+ c_cardinality["dig_sig"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}RestrictedPassword" ""] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ZeroKnowledge"] = ("zero_knowledge", ZeroKnowledge)
+ c_cardinality["zero_knowledge"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}IPAddress"] = ("ip_address", IPAddress)
+ c_cardinality["ip_address"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AsymmetricDecryption"] = (
+ "asymmetric_decryption",
+ AsymmetricDecryption,
+ )
+ c_cardinality["asymmetric_decryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}AsymmetricKeyAgreement"] = (
+ "asymmetric_key_agreement",
+ AsymmetricKeyAgreement,
+ )
+ c_cardinality["asymmetric_key_agreement"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}SubscriberLineNumber"] = (
+ "subscriber_line_number",
+ SubscriberLineNumber,
+ )
+ c_cardinality["subscriber_line_number"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}UserSuffix"] = ("user_suffix", UserSuffix)
+ c_cardinality["user_suffix"] = {"min": 0, "max": 1}
+ c_cardinality["complex_authenticator"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
c_child_order.extend(
- ['previous_session', 'resume_session', 'dig_sig', 'password',
- 'restricted_password', 'zero_knowledge',
- 'shared_secret_challenge_response', 'shared_secret_dynamic_plaintext',
- 'ip_address', 'asymmetric_decryption', 'asymmetric_key_agreement',
- 'subscriber_line_number', 'user_suffix', 'complex_authenticator',
- 'extension'])
-
- def __init__(self,
- previous_session=None,
- resume_session=None,
- dig_sig=None,
- password=None,
- restricted_password=None,
- zero_knowledge=None,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- ip_address=None,
- asymmetric_decryption=None,
- asymmetric_key_agreement=None,
- subscriber_line_number=None,
- user_suffix=None,
- complex_authenticator=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "previous_session",
+ "resume_session",
+ "dig_sig",
+ "password",
+ "restricted_password",
+ "zero_knowledge",
+ "shared_secret_challenge_response",
+ "shared_secret_dynamic_plaintext",
+ "ip_address",
+ "asymmetric_decryption",
+ "asymmetric_key_agreement",
+ "subscriber_line_number",
+ "user_suffix",
+ "complex_authenticator",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ previous_session=None,
+ resume_session=None,
+ dig_sig=None,
+ password=None,
+ restricted_password=None,
+ zero_knowledge=None,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ ip_address=None,
+ asymmetric_decryption=None,
+ asymmetric_key_agreement=None,
+ subscriber_line_number=None,
+ user_suffix=None,
+ complex_authenticator=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.previous_session = previous_session
self.resume_session = resume_session
@@ -2395,14 +2397,13 @@ class ComplexAuthenticatorType_(SamlBase):
def complex_authenticator_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ComplexAuthenticatorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ComplexAuthenticatorType_, xml_string)
class ComplexAuthenticator(ComplexAuthenticatorType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ComplexAuthenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:ComplexAuthenticator element"""
- c_tag = 'ComplexAuthenticator'
+ c_tag = "ComplexAuthenticator"
c_namespace = NAMESPACE
c_children = ComplexAuthenticatorType_.c_children.copy()
c_attributes = ComplexAuthenticatorType_.c_attributes.copy()
@@ -2415,12 +2416,14 @@ def complex_authenticator_from_string(xml_string):
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-ComplexAuthenticatorType_.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
-ComplexAuthenticator.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
+ComplexAuthenticatorType_.c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+)
+ComplexAuthenticator.c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:Password}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELEMENT_FROM_STRING = {
@@ -2520,102 +2523,101 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'AuthenticationContextDeclaration': AuthenticationContextDeclaration,
- 'Identification': Identification,
- 'PhysicalVerification': PhysicalVerification,
- 'WrittenConsent': WrittenConsent,
- 'TechnicalProtection': TechnicalProtection,
- 'SecretKeyProtection': SecretKeyProtection,
- 'PrivateKeyProtection': PrivateKeyProtection,
- 'KeyActivation': KeyActivation,
- 'KeySharing': KeySharing,
- 'KeyStorage': KeyStorage,
- 'SubscriberLineNumber': SubscriberLineNumber,
- 'UserSuffix': UserSuffix,
- 'Password': Password,
- 'ActivationPin': ActivationPin,
- 'Token': Token,
- 'TimeSyncToken': TimeSyncToken,
- 'Smartcard': Smartcard,
- 'Length': Length,
- 'ActivationLimit': ActivationLimit,
- 'Generation': Generation,
- 'AuthnMethod': AuthnMethod,
- 'PrincipalAuthenticationMechanism': PrincipalAuthenticationMechanism,
- 'Authenticator': Authenticator,
- 'ComplexAuthenticator': ComplexAuthenticator,
- 'PreviousSession': PreviousSession,
- 'ResumeSession': ResumeSession,
- 'ZeroKnowledge': ZeroKnowledge,
- 'SharedSecretChallengeResponse': SharedSecretChallengeResponse,
- 'SharedSecretChallengeResponseType': SharedSecretChallengeResponseType_,
- 'DigSig': DigSig,
- 'AsymmetricDecryption': AsymmetricDecryption,
- 'AsymmetricKeyAgreement': AsymmetricKeyAgreement,
- 'PublicKeyType': PublicKeyType_,
- 'IPAddress': IPAddress,
- 'SharedSecretDynamicPlaintext': SharedSecretDynamicPlaintext,
- 'AuthenticatorTransportProtocol': AuthenticatorTransportProtocol,
- 'HTTP': HTTP,
- 'IPSec': IPSec,
- 'WTLS': WTLS,
- 'MobileNetworkNoEncryption': MobileNetworkNoEncryption,
- 'MobileNetworkRadioEncryption': MobileNetworkRadioEncryption,
- 'MobileNetworkEndToEndEncryption': MobileNetworkEndToEndEncryption,
- 'SSL': SSL,
- 'PSTN': PSTN,
- 'ISDN': ISDN,
- 'ADSL': ADSL,
- 'OperationalProtection': OperationalProtection,
- 'SecurityAudit': SecurityAudit,
- 'SwitchAudit': SwitchAudit,
- 'DeactivationCallCenter': DeactivationCallCenter,
- 'GoverningAgreements': GoverningAgreements,
- 'GoverningAgreementRef': GoverningAgreementRef,
- 'nymType': NymType_,
- 'IdentificationType': IdentificationType_,
- 'TechnicalProtectionBaseType': TechnicalProtectionBaseType_,
- 'OperationalProtectionType': OperationalProtectionType_,
- 'GoverningAgreementsType': GoverningAgreementsType_,
- 'GoverningAgreementRefType': GoverningAgreementRefType_,
- 'PrincipalAuthenticationMechanismType': PrincipalAuthenticationMechanismType_,
- 'ComplexAuthenticatorType': ComplexAuthenticatorType_,
- 'AuthenticatorTransportProtocolType': AuthenticatorTransportProtocolType_,
- 'KeyActivationType': KeyActivationType_,
- 'KeySharingType': KeySharingType_,
- 'PrivateKeyProtectionType': PrivateKeyProtectionType_,
- 'PasswordType': PasswordType_,
- 'RestrictedPassword': RestrictedPassword,
- 'RestrictedPasswordType': RestrictedPasswordType_,
- 'RestrictedLengthType': RestrictedLengthType_,
- 'ActivationPinType': ActivationPinType_,
- 'Alphabet': Alphabet,
- 'AlphabetType': AlphabetType_,
- 'TokenType': TokenType_,
- 'DeviceTypeType': DeviceTypeType_,
- 'booleanType': BooleanType_,
- 'TimeSyncTokenType': TimeSyncTokenType_,
- 'ActivationLimitType': ActivationLimitType_,
- 'ActivationLimitDuration': ActivationLimitDuration,
- 'ActivationLimitUsages': ActivationLimitUsages,
- 'ActivationLimitSession': ActivationLimitSession,
- 'ActivationLimitDurationType': ActivationLimitDurationType_,
- 'ActivationLimitUsagesType': ActivationLimitUsagesType_,
- 'ActivationLimitSessionType': ActivationLimitSessionType_,
- 'LengthType': LengthType_,
- 'mediumType': MediumType_,
- 'KeyStorageType': KeyStorageType_,
- 'SecretKeyProtectionType': SecretKeyProtectionType_,
- 'SecurityAuditType': SecurityAuditType_,
- 'ExtensionOnlyType': ExtensionOnlyType_,
- 'Extension': Extension,
- 'ExtensionType': ExtensionType_,
- 'AuthnContextDeclarationBaseType': AuthnContextDeclarationBaseType_,
- 'AuthnMethodBaseType': AuthnMethodBaseType_,
- 'AuthenticatorBaseType': AuthenticatorBaseType_,
+ "AuthenticationContextDeclaration": AuthenticationContextDeclaration,
+ "Identification": Identification,
+ "PhysicalVerification": PhysicalVerification,
+ "WrittenConsent": WrittenConsent,
+ "TechnicalProtection": TechnicalProtection,
+ "SecretKeyProtection": SecretKeyProtection,
+ "PrivateKeyProtection": PrivateKeyProtection,
+ "KeyActivation": KeyActivation,
+ "KeySharing": KeySharing,
+ "KeyStorage": KeyStorage,
+ "SubscriberLineNumber": SubscriberLineNumber,
+ "UserSuffix": UserSuffix,
+ "Password": Password,
+ "ActivationPin": ActivationPin,
+ "Token": Token,
+ "TimeSyncToken": TimeSyncToken,
+ "Smartcard": Smartcard,
+ "Length": Length,
+ "ActivationLimit": ActivationLimit,
+ "Generation": Generation,
+ "AuthnMethod": AuthnMethod,
+ "PrincipalAuthenticationMechanism": PrincipalAuthenticationMechanism,
+ "Authenticator": Authenticator,
+ "ComplexAuthenticator": ComplexAuthenticator,
+ "PreviousSession": PreviousSession,
+ "ResumeSession": ResumeSession,
+ "ZeroKnowledge": ZeroKnowledge,
+ "SharedSecretChallengeResponse": SharedSecretChallengeResponse,
+ "SharedSecretChallengeResponseType": SharedSecretChallengeResponseType_,
+ "DigSig": DigSig,
+ "AsymmetricDecryption": AsymmetricDecryption,
+ "AsymmetricKeyAgreement": AsymmetricKeyAgreement,
+ "PublicKeyType": PublicKeyType_,
+ "IPAddress": IPAddress,
+ "SharedSecretDynamicPlaintext": SharedSecretDynamicPlaintext,
+ "AuthenticatorTransportProtocol": AuthenticatorTransportProtocol,
+ "HTTP": HTTP,
+ "IPSec": IPSec,
+ "WTLS": WTLS,
+ "MobileNetworkNoEncryption": MobileNetworkNoEncryption,
+ "MobileNetworkRadioEncryption": MobileNetworkRadioEncryption,
+ "MobileNetworkEndToEndEncryption": MobileNetworkEndToEndEncryption,
+ "SSL": SSL,
+ "PSTN": PSTN,
+ "ISDN": ISDN,
+ "ADSL": ADSL,
+ "OperationalProtection": OperationalProtection,
+ "SecurityAudit": SecurityAudit,
+ "SwitchAudit": SwitchAudit,
+ "DeactivationCallCenter": DeactivationCallCenter,
+ "GoverningAgreements": GoverningAgreements,
+ "GoverningAgreementRef": GoverningAgreementRef,
+ "nymType": NymType_,
+ "IdentificationType": IdentificationType_,
+ "TechnicalProtectionBaseType": TechnicalProtectionBaseType_,
+ "OperationalProtectionType": OperationalProtectionType_,
+ "GoverningAgreementsType": GoverningAgreementsType_,
+ "GoverningAgreementRefType": GoverningAgreementRefType_,
+ "PrincipalAuthenticationMechanismType": PrincipalAuthenticationMechanismType_,
+ "ComplexAuthenticatorType": ComplexAuthenticatorType_,
+ "AuthenticatorTransportProtocolType": AuthenticatorTransportProtocolType_,
+ "KeyActivationType": KeyActivationType_,
+ "KeySharingType": KeySharingType_,
+ "PrivateKeyProtectionType": PrivateKeyProtectionType_,
+ "PasswordType": PasswordType_,
+ "RestrictedPassword": RestrictedPassword,
+ "RestrictedPasswordType": RestrictedPasswordType_,
+ "RestrictedLengthType": RestrictedLengthType_,
+ "ActivationPinType": ActivationPinType_,
+ "Alphabet": Alphabet,
+ "AlphabetType": AlphabetType_,
+ "TokenType": TokenType_,
+ "DeviceTypeType": DeviceTypeType_,
+ "booleanType": BooleanType_,
+ "TimeSyncTokenType": TimeSyncTokenType_,
+ "ActivationLimitType": ActivationLimitType_,
+ "ActivationLimitDuration": ActivationLimitDuration,
+ "ActivationLimitUsages": ActivationLimitUsages,
+ "ActivationLimitSession": ActivationLimitSession,
+ "ActivationLimitDurationType": ActivationLimitDurationType_,
+ "ActivationLimitUsagesType": ActivationLimitUsagesType_,
+ "ActivationLimitSessionType": ActivationLimitSessionType_,
+ "LengthType": LengthType_,
+ "mediumType": MediumType_,
+ "KeyStorageType": KeyStorageType_,
+ "SecretKeyProtectionType": SecretKeyProtectionType_,
+ "SecurityAuditType": SecurityAuditType_,
+ "ExtensionOnlyType": ExtensionOnlyType_,
+ "Extension": Extension,
+ "ExtensionType": ExtensionType_,
+ "AuthnContextDeclarationBaseType": AuthnContextDeclarationBaseType_,
+ "AuthnMethodBaseType": AuthnMethodBaseType_,
+ "AuthenticatorBaseType": AuthenticatorBaseType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/authn_context/sslcert.py b/src/saml2/authn_context/sslcert.py
index 80dd2b8b..e7a1c9f1 100644
--- a/src/saml2/authn_context/sslcert.py
+++ b/src/saml2/authn_context/sslcert.py
@@ -13,30 +13,32 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient"
class PhysicalVerification(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PhysicalVerification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PhysicalVerification element"""
- c_tag = 'PhysicalVerification'
+ c_tag = "PhysicalVerification"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['credentialLevel'] = ('credential_level', 'None', False)
-
- def __init__(self,
- credential_level=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["credentialLevel"] = ("credential_level", "None", False)
+
+ def __init__(
+ self,
+ credential_level=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.credential_level = credential_level
@@ -46,26 +48,28 @@ def physical_verification_from_string(xml_string):
class Generation(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Generation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Generation element"""
- c_tag = 'Generation'
+ c_tag = "Generation"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['mechanism'] = ('mechanism', 'None', True)
-
- def __init__(self,
- mechanism=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["mechanism"] = ("mechanism", "None", True)
+
+ def __init__(
+ self,
+ mechanism=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.mechanism = mechanism
@@ -75,12 +79,11 @@ def generation_from_string(xml_string):
class NymType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:nymType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:nymType element"""
- c_tag = 'nymType'
+ c_tag = "nymType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['anonymity', 'verinymity', 'pseudonymity']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["anonymity", "verinymity", "pseudonymity"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -92,57 +95,59 @@ def nym_type__from_string(xml_string):
class GoverningAgreementRefType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreementRefType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreementRefType element"""
- c_tag = 'GoverningAgreementRefType'
+ c_tag = "GoverningAgreementRefType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['governingAgreementRef'] = (
- 'governing_agreement_ref', 'anyURI', True)
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["governingAgreementRef"] = ("governing_agreement_ref", "anyURI", True)
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref
def governing_agreement_ref_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementRefType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementRefType_, xml_string)
class KeySharingType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeySharingType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeySharingType element"""
- c_tag = 'KeySharingType'
+ c_tag = "KeySharingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['sharing'] = ('sharing', 'boolean', True)
-
- def __init__(self,
- sharing=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["sharing"] = ("sharing", "boolean", True)
+
+ def __init__(
+ self,
+ sharing=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.sharing = sharing
@@ -152,28 +157,30 @@ def key_sharing_type__from_string(xml_string):
class RestrictedLengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:RestrictedLengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:RestrictedLengthType element"""
- c_tag = 'RestrictedLengthType'
+ c_tag = "RestrictedLengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'None', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "None", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -184,30 +191,32 @@ def restricted_length_type__from_string(xml_string):
class AlphabetType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AlphabetType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AlphabetType element"""
- c_tag = 'AlphabetType'
+ c_tag = "AlphabetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['requiredChars'] = ('required_chars', 'string', True)
- c_attributes['excludedChars'] = ('excluded_chars', 'string', False)
- c_attributes['case'] = ('case', 'string', False)
-
- def __init__(self,
- required_chars=None,
- excluded_chars=None,
- case=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["requiredChars"] = ("required_chars", "string", True)
+ c_attributes["excludedChars"] = ("excluded_chars", "string", False)
+ c_attributes["case"] = ("case", "string", False)
+
+ def __init__(
+ self,
+ required_chars=None,
+ excluded_chars=None,
+ case=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.required_chars = required_chars
self.excluded_chars = excluded_chars
@@ -219,12 +228,11 @@ def alphabet_type__from_string(xml_string):
class DeviceTypeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:DeviceTypeType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:DeviceTypeType element"""
- c_tag = 'DeviceTypeType'
+ c_tag = "DeviceTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['hardware', 'software']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["hardware", "software"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -236,11 +244,11 @@ def device_type_type__from_string(xml_string):
class BooleanType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:booleanType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:booleanType element"""
- c_tag = 'booleanType'
+ c_tag = "booleanType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN', 'enumeration': ['true', 'false']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["true", "false"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -252,30 +260,32 @@ def boolean_type__from_string(xml_string):
class TimeSyncTokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TimeSyncTokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TimeSyncTokenType element"""
- c_tag = 'TimeSyncTokenType'
+ c_tag = "TimeSyncTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['DeviceType'] = ('device_type', DeviceTypeType_, True)
- c_attributes['SeedLength'] = ('seed_length', 'integer', True)
- c_attributes['DeviceInHand'] = ('device_in_hand', BooleanType_, True)
-
- def __init__(self,
- device_type=None,
- seed_length=None,
- device_in_hand=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["DeviceType"] = ("device_type", DeviceTypeType_, True)
+ c_attributes["SeedLength"] = ("seed_length", "integer", True)
+ c_attributes["DeviceInHand"] = ("device_in_hand", BooleanType_, True)
+
+ def __init__(
+ self,
+ device_type=None,
+ seed_length=None,
+ device_in_hand=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.device_type = device_type
self.seed_length = seed_length
@@ -287,69 +297,71 @@ def time_sync_token_type__from_string(xml_string):
class ActivationLimitDurationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitDurationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitDurationType element"""
- c_tag = 'ActivationLimitDurationType'
+ c_tag = "ActivationLimitDurationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['duration'] = ('duration', 'duration', True)
-
- def __init__(self,
- duration=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["duration"] = ("duration", "duration", True)
+
+ def __init__(
+ self,
+ duration=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.duration = duration
def activation_limit_duration_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDurationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDurationType_, xml_string)
class ActivationLimitUsagesType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitUsagesType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitUsagesType element"""
- c_tag = 'ActivationLimitUsagesType'
+ c_tag = "ActivationLimitUsagesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['number'] = ('number', 'integer', True)
-
- def __init__(self,
- number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["number"] = ("number", "integer", True)
+
+ def __init__(
+ self,
+ number=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.number = number
def activation_limit_usages_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitUsagesType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitUsagesType_, xml_string)
class ActivationLimitSessionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitSessionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitSessionType element"""
- c_tag = 'ActivationLimitSessionType'
+ c_tag = "ActivationLimitSessionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -358,33 +370,34 @@ class ActivationLimitSessionType_(SamlBase):
def activation_limit_session_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSessionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSessionType_, xml_string)
class LengthType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:LengthType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:LengthType element"""
- c_tag = 'LengthType'
+ c_tag = "LengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'integer', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["min"] = ("min", "integer", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(
+ self,
+ min=None,
+ max=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.min = min
self.max = max
@@ -395,13 +408,14 @@ def length_type__from_string(xml_string):
class MediumType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:mediumType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:mediumType element"""
- c_tag = 'mediumType'
+ c_tag = "mediumType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['memory', 'smartcard', 'token',
- 'MobileDevice', 'MobileAuthCard']}
+ c_value_type = {
+ "base": "xs:NMTOKEN",
+ "enumeration": ["memory", "smartcard", "token", "MobileDevice", "MobileAuthCard"],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -413,26 +427,28 @@ def medium_type__from_string(xml_string):
class KeyStorageType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyStorageType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyStorageType element"""
- c_tag = 'KeyStorageType'
+ c_tag = "KeyStorageType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['medium'] = ('medium', MediumType_, True)
-
- def __init__(self,
- medium=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["medium"] = ("medium", MediumType_, True)
+
+ def __init__(
+ self,
+ medium=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.medium = medium
@@ -442,9 +458,9 @@ def key_storage_type__from_string(xml_string):
class ExtensionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ExtensionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ExtensionType element"""
- c_tag = 'ExtensionType'
+ c_tag = "ExtensionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -457,25 +473,26 @@ def extension_type__from_string(xml_string):
class PublicKeyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PublicKeyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PublicKeyType element"""
- c_tag = 'PublicKeyType'
+ c_tag = "PublicKeyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['keyValidation'] = ('key_validation', 'anyURI', False)
-
- def __init__(self,
- key_validation="urn:oasis:names:tc:SAML:2.0:ac:classes:X509",
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["keyValidation"] = ("key_validation", "anyURI", False)
+
+ def __init__(
+ self,
+ key_validation="urn:oasis:names:tc:SAML:2.0:ac:classes:X509",
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
def public_key_type__from_string(xml_string):
@@ -483,9 +500,9 @@ def public_key_type__from_string(xml_string):
class KeySharing(KeySharingType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeySharing element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeySharing element"""
- c_tag = 'KeySharing'
+ c_tag = "KeySharing"
c_namespace = NAMESPACE
c_children = KeySharingType_.c_children.copy()
c_attributes = KeySharingType_.c_attributes.copy()
@@ -498,9 +515,9 @@ def key_sharing_from_string(xml_string):
class KeyStorage(KeyStorageType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyStorage element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyStorage element"""
- c_tag = 'KeyStorage'
+ c_tag = "KeyStorage"
c_namespace = NAMESPACE
c_children = KeyStorageType_.c_children.copy()
c_attributes = KeyStorageType_.c_attributes.copy()
@@ -513,9 +530,9 @@ def key_storage_from_string(xml_string):
class TimeSyncToken(TimeSyncTokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TimeSyncToken element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TimeSyncToken element"""
- c_tag = 'TimeSyncToken'
+ c_tag = "TimeSyncToken"
c_namespace = NAMESPACE
c_children = TimeSyncTokenType_.c_children.copy()
c_attributes = TimeSyncTokenType_.c_attributes.copy()
@@ -528,9 +545,9 @@ def time_sync_token_from_string(xml_string):
class Length(LengthType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Length element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Length element"""
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = LengthType_.c_children.copy()
c_attributes = LengthType_.c_attributes.copy()
@@ -543,9 +560,9 @@ def length_from_string(xml_string):
class DigSig(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:DigSig element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:DigSig element"""
- c_tag = 'DigSig'
+ c_tag = "DigSig"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -558,9 +575,9 @@ def dig_sig_from_string(xml_string):
class AsymmetricDecryption(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AsymmetricDecryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AsymmetricDecryption element"""
- c_tag = 'AsymmetricDecryption'
+ c_tag = "AsymmetricDecryption"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -573,9 +590,9 @@ def asymmetric_decryption_from_string(xml_string):
class AsymmetricKeyAgreement(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AsymmetricKeyAgreement element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AsymmetricKeyAgreement element"""
- c_tag = 'AsymmetricKeyAgreement'
+ c_tag = "AsymmetricKeyAgreement"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -584,14 +601,13 @@ class AsymmetricKeyAgreement(PublicKeyType_):
def asymmetric_key_agreement_from_string(xml_string):
- return saml2.create_class_from_xml_string(AsymmetricKeyAgreement,
- xml_string)
+ return saml2.create_class_from_xml_string(AsymmetricKeyAgreement, xml_string)
class GoverningAgreementRef(GoverningAgreementRefType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreementRef element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreementRef element"""
- c_tag = 'GoverningAgreementRef'
+ c_tag = "GoverningAgreementRef"
c_namespace = NAMESPACE
c_children = GoverningAgreementRefType_.c_children.copy()
c_attributes = GoverningAgreementRefType_.c_attributes.copy()
@@ -604,41 +620,43 @@ def governing_agreement_ref_from_string(xml_string):
class GoverningAgreementsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreementsType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreementsType element"""
- c_tag = 'GoverningAgreementsType'
+ c_tag = "GoverningAgreementsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}GoverningAgreementRef'] = (
- 'governing_agreement_ref', [GoverningAgreementRef])
- c_cardinality['governing_agreement_ref'] = {"min": 1}
- c_child_order.extend(['governing_agreement_ref'])
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}GoverningAgreementRef"] = (
+ "governing_agreement_ref",
+ [GoverningAgreementRef],
+ )
+ c_cardinality["governing_agreement_ref"] = {"min": 1}
+ c_child_order.extend(["governing_agreement_ref"])
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref or []
def governing_agreements_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementsType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementsType_, xml_string)
class RestrictedPasswordType_Length(RestrictedLengthType_):
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = RestrictedLengthType_.c_children.copy()
c_attributes = RestrictedLengthType_.c_attributes.copy()
@@ -647,14 +665,13 @@ class RestrictedPasswordType_Length(RestrictedLengthType_):
def restricted_password_type__length_from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_Length,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_Length, xml_string)
class Alphabet(AlphabetType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Alphabet element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Alphabet element"""
- c_tag = 'Alphabet'
+ c_tag = "Alphabet"
c_namespace = NAMESPACE
c_children = AlphabetType_.c_children.copy()
c_attributes = AlphabetType_.c_attributes.copy()
@@ -667,9 +684,9 @@ def alphabet_from_string(xml_string):
class ActivationLimitDuration(ActivationLimitDurationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitDuration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitDuration element"""
- c_tag = 'ActivationLimitDuration'
+ c_tag = "ActivationLimitDuration"
c_namespace = NAMESPACE
c_children = ActivationLimitDurationType_.c_children.copy()
c_attributes = ActivationLimitDurationType_.c_attributes.copy()
@@ -678,14 +695,13 @@ class ActivationLimitDuration(ActivationLimitDurationType_):
def activation_limit_duration_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDuration,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDuration, xml_string)
class ActivationLimitUsages(ActivationLimitUsagesType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitUsages element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitUsages element"""
- c_tag = 'ActivationLimitUsages'
+ c_tag = "ActivationLimitUsages"
c_namespace = NAMESPACE
c_children = ActivationLimitUsagesType_.c_children.copy()
c_attributes = ActivationLimitUsagesType_.c_attributes.copy()
@@ -698,9 +714,9 @@ def activation_limit_usages_from_string(xml_string):
class ActivationLimitSession(ActivationLimitSessionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitSession element"""
- c_tag = 'ActivationLimitSession'
+ c_tag = "ActivationLimitSession"
c_namespace = NAMESPACE
c_children = ActivationLimitSessionType_.c_children.copy()
c_attributes = ActivationLimitSessionType_.c_attributes.copy()
@@ -709,14 +725,13 @@ class ActivationLimitSession(ActivationLimitSessionType_):
def activation_limit_session_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSession,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSession, xml_string)
class Extension(ExtensionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Extension element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Extension element"""
- c_tag = 'Extension'
+ c_tag = "Extension"
c_namespace = NAMESPACE
c_children = ExtensionType_.c_children.copy()
c_attributes = ExtensionType_.c_attributes.copy()
@@ -729,41 +744,41 @@ def extension_from_string(xml_string):
class AuthenticatorBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticatorBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticatorBaseType element"""
- c_tag = 'AuthenticatorBaseType'
+ c_tag = "AuthenticatorBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}DigSig'] = (
- 'dig_sig', DigSig)
- c_child_order.extend(['dig_sig'])
-
- def __init__(self,
- dig_sig=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}DigSig"] = ("dig_sig", DigSig)
+ c_child_order.extend(["dig_sig"])
+
+ def __init__(
+ self,
+ dig_sig=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.dig_sig = dig_sig
def authenticator_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorBaseType_, xml_string)
class Authenticator(AuthenticatorBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Authenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Authenticator element"""
- c_tag = 'Authenticator'
+ c_tag = "Authenticator"
c_namespace = NAMESPACE
c_children = AuthenticatorBaseType_.c_children.copy()
c_attributes = AuthenticatorBaseType_.c_attributes.copy()
@@ -776,46 +791,45 @@ def authenticator_from_string(xml_string):
class SharedSecretChallengeResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SharedSecretChallengeResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SharedSecretChallengeResponseType element"""
- c_tag = 'SharedSecretChallengeResponseType'
+ c_tag = "SharedSecretChallengeResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['method'] = ('method', 'anyURI', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- method=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["method"] = ("method", "anyURI", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ method=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.method = method
def shared_secret_challenge_response_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- SharedSecretChallengeResponseType_, xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponseType_, xml_string)
class GoverningAgreements(GoverningAgreementsType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreements element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:GoverningAgreements element"""
- c_tag = 'GoverningAgreements'
+ c_tag = "GoverningAgreements"
c_namespace = NAMESPACE
c_children = GoverningAgreementsType_.c_children.copy()
c_attributes = GoverningAgreementsType_.c_attributes.copy()
@@ -828,46 +842,41 @@ def governing_agreements_from_string(xml_string):
class PasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PasswordType element"""
- c_tag = 'PasswordType'
+ c_tag = "PasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'alphabet', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "alphabet", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -881,41 +890,37 @@ def password_type__from_string(xml_string):
class RestrictedPasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:RestrictedPasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:RestrictedPasswordType element"""
- c_tag = 'RestrictedPasswordType'
+ c_tag = "RestrictedPasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Length'] = (
- 'length', RestrictedPasswordType_Length)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Length"] = ("length", RestrictedPasswordType_Length)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.generation = generation
@@ -924,39 +929,36 @@ class RestrictedPasswordType_(SamlBase):
def restricted_password_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_, xml_string)
class TokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TokenType element"""
- c_tag = 'TokenType'
+ c_tag = "TokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}TimeSyncToken'] = (
- 'time_sync_token', TimeSyncToken)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['time_sync_token', 'extension'])
-
- def __init__(self,
- time_sync_token=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}TimeSyncToken"] = ("time_sync_token", TimeSyncToken)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["time_sync_token", "extension"])
+
+ def __init__(
+ self,
+ time_sync_token=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.time_sync_token = time_sync_token
self.extension = extension or []
@@ -967,42 +969,45 @@ def token_type__from_string(xml_string):
class ActivationLimitType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitType element"""
- c_tag = 'ActivationLimitType'
+ c_tag = "ActivationLimitType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimitDuration'] = (
- 'activation_limit_duration', ActivationLimitDuration)
- c_cardinality['activation_limit_duration'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimitUsages'] = (
- 'activation_limit_usages', ActivationLimitUsages)
- c_cardinality['activation_limit_usages'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimitSession'] = (
- 'activation_limit_session', ActivationLimitSession)
- c_cardinality['activation_limit_session'] = {"min": 0, "max": 1}
- c_child_order.extend(
- ['activation_limit_duration', 'activation_limit_usages',
- 'activation_limit_session'])
-
- def __init__(self,
- activation_limit_duration=None,
- activation_limit_usages=None,
- activation_limit_session=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimitDuration"] = (
+ "activation_limit_duration",
+ ActivationLimitDuration,
+ )
+ c_cardinality["activation_limit_duration"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimitUsages"] = (
+ "activation_limit_usages",
+ ActivationLimitUsages,
+ )
+ c_cardinality["activation_limit_usages"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimitSession"] = (
+ "activation_limit_session",
+ ActivationLimitSession,
+ )
+ c_cardinality["activation_limit_session"] = {"min": 0, "max": 1}
+ c_child_order.extend(["activation_limit_duration", "activation_limit_usages", "activation_limit_session"])
+
+ def __init__(
+ self,
+ activation_limit_duration=None,
+ activation_limit_usages=None,
+ activation_limit_session=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_limit_duration = activation_limit_duration
self.activation_limit_usages = activation_limit_usages
@@ -1014,30 +1019,30 @@ def activation_limit_type__from_string(xml_string):
class ExtensionOnlyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ExtensionOnlyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ExtensionOnlyType element"""
- c_tag = 'ExtensionOnlyType'
+ c_tag = "ExtensionOnlyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
@@ -1047,9 +1052,9 @@ def extension_only_type__from_string(xml_string):
class WrittenConsent(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:WrittenConsent element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:WrittenConsent element"""
- c_tag = 'WrittenConsent'
+ c_tag = "WrittenConsent"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1062,9 +1067,9 @@ def written_consent_from_string(xml_string):
class SubscriberLineNumber(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SubscriberLineNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SubscriberLineNumber element"""
- c_tag = 'SubscriberLineNumber'
+ c_tag = "SubscriberLineNumber"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1077,9 +1082,9 @@ def subscriber_line_number_from_string(xml_string):
class UserSuffix(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:UserSuffix element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:UserSuffix element"""
- c_tag = 'UserSuffix'
+ c_tag = "UserSuffix"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1092,9 +1097,9 @@ def user_suffix_from_string(xml_string):
class Password(PasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Password element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Password element"""
- c_tag = 'Password'
+ c_tag = "Password"
c_namespace = NAMESPACE
c_children = PasswordType_.c_children.copy()
c_attributes = PasswordType_.c_attributes.copy()
@@ -1107,9 +1112,9 @@ def password_from_string(xml_string):
class Token(TokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Token element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Token element"""
- c_tag = 'Token'
+ c_tag = "Token"
c_namespace = NAMESPACE
c_children = TokenType_.c_children.copy()
c_attributes = TokenType_.c_attributes.copy()
@@ -1122,9 +1127,9 @@ def token_from_string(xml_string):
class Smartcard(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Smartcard element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Smartcard element"""
- c_tag = 'Smartcard'
+ c_tag = "Smartcard"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1137,9 +1142,9 @@ def smartcard_from_string(xml_string):
class ActivationLimit(ActivationLimitType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimit element"""
- c_tag = 'ActivationLimit'
+ c_tag = "ActivationLimit"
c_namespace = NAMESPACE
c_children = ActivationLimitType_.c_children.copy()
c_attributes = ActivationLimitType_.c_attributes.copy()
@@ -1152,9 +1157,9 @@ def activation_limit_from_string(xml_string):
class PreviousSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PreviousSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PreviousSession element"""
- c_tag = 'PreviousSession'
+ c_tag = "PreviousSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1167,9 +1172,9 @@ def previous_session_from_string(xml_string):
class ResumeSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ResumeSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ResumeSession element"""
- c_tag = 'ResumeSession'
+ c_tag = "ResumeSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1182,9 +1187,9 @@ def resume_session_from_string(xml_string):
class ZeroKnowledge(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ZeroKnowledge element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ZeroKnowledge element"""
- c_tag = 'ZeroKnowledge'
+ c_tag = "ZeroKnowledge"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1197,9 +1202,9 @@ def zero_knowledge_from_string(xml_string):
class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SharedSecretChallengeResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SharedSecretChallengeResponse element"""
- c_tag = 'SharedSecretChallengeResponse'
+ c_tag = "SharedSecretChallengeResponse"
c_namespace = NAMESPACE
c_children = SharedSecretChallengeResponseType_.c_children.copy()
c_attributes = SharedSecretChallengeResponseType_.c_attributes.copy()
@@ -1208,14 +1213,13 @@ class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
def shared_secret_challenge_response_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretChallengeResponse,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponse, xml_string)
class IPAddress(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:IPAddress element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:IPAddress element"""
- c_tag = 'IPAddress'
+ c_tag = "IPAddress"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1228,9 +1232,9 @@ def ip_address_from_string(xml_string):
class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SharedSecretDynamicPlaintext element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SharedSecretDynamicPlaintext element"""
- c_tag = 'SharedSecretDynamicPlaintext'
+ c_tag = "SharedSecretDynamicPlaintext"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1239,14 +1243,13 @@ class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
def shared_secret_dynamic_plaintext_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext, xml_string)
class HTTP(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:HTTP element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:HTTP element"""
- c_tag = 'HTTP'
+ c_tag = "HTTP"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1259,9 +1262,9 @@ def http_from_string(xml_string):
class IPSec(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:IPSec element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:IPSec element"""
- c_tag = 'IPSec'
+ c_tag = "IPSec"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1274,9 +1277,9 @@ def ip_sec_from_string(xml_string):
class WTLS(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:WTLS element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:WTLS element"""
- c_tag = 'WTLS'
+ c_tag = "WTLS"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1289,9 +1292,9 @@ def wtls_from_string(xml_string):
class MobileNetworkNoEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:MobileNetworkNoEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:MobileNetworkNoEncryption element"""
- c_tag = 'MobileNetworkNoEncryption'
+ c_tag = "MobileNetworkNoEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1300,14 +1303,13 @@ class MobileNetworkNoEncryption(ExtensionOnlyType_):
def mobile_network_no_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkNoEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkNoEncryption, xml_string)
class MobileNetworkRadioEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:MobileNetworkRadioEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:MobileNetworkRadioEncryption element"""
- c_tag = 'MobileNetworkRadioEncryption'
+ c_tag = "MobileNetworkRadioEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1316,14 +1318,13 @@ class MobileNetworkRadioEncryption(ExtensionOnlyType_):
def mobile_network_radio_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption, xml_string)
class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:MobileNetworkEndToEndEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:MobileNetworkEndToEndEncryption element"""
- c_tag = 'MobileNetworkEndToEndEncryption'
+ c_tag = "MobileNetworkEndToEndEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1332,14 +1333,13 @@ class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
def mobile_network_end_to_end_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption, xml_string)
class SSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SSL element"""
- c_tag = 'SSL'
+ c_tag = "SSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1352,9 +1352,9 @@ def ssl_from_string(xml_string):
class PSTN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PSTN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PSTN element"""
- c_tag = 'PSTN'
+ c_tag = "PSTN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1367,9 +1367,9 @@ def pstn_from_string(xml_string):
class ISDN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ISDN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ISDN element"""
- c_tag = 'ISDN'
+ c_tag = "ISDN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1382,9 +1382,9 @@ def isdn_from_string(xml_string):
class ADSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ADSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ADSL element"""
- c_tag = 'ADSL'
+ c_tag = "ADSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1397,9 +1397,9 @@ def adsl_from_string(xml_string):
class SwitchAudit(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SwitchAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SwitchAudit element"""
- c_tag = 'SwitchAudit'
+ c_tag = "SwitchAudit"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1412,9 +1412,9 @@ def switch_audit_from_string(xml_string):
class DeactivationCallCenter(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:DeactivationCallCenter element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:DeactivationCallCenter element"""
- c_tag = 'DeactivationCallCenter'
+ c_tag = "DeactivationCallCenter"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1423,54 +1423,51 @@ class DeactivationCallCenter(ExtensionOnlyType_):
def deactivation_call_center_from_string(xml_string):
- return saml2.create_class_from_xml_string(DeactivationCallCenter,
- xml_string)
+ return saml2.create_class_from_xml_string(DeactivationCallCenter, xml_string)
class IdentificationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:IdentificationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:IdentificationType element"""
- c_tag = 'IdentificationType'
+ c_tag = "IdentificationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PhysicalVerification'] = (
- 'physical_verification', PhysicalVerification)
- c_cardinality['physical_verification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}WrittenConsent'] = (
- 'written_consent', WrittenConsent)
- c_cardinality['written_consent'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['nym'] = ('nym', NymType_, False)
- c_child_order.extend(
- ['physical_verification', 'written_consent', 'governing_agreements',
- 'extension'])
-
- def __init__(self,
- physical_verification=None,
- written_consent=None,
- governing_agreements=None,
- extension=None,
- nym=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PhysicalVerification"] = (
+ "physical_verification",
+ PhysicalVerification,
+ )
+ c_cardinality["physical_verification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}WrittenConsent"] = ("written_consent", WrittenConsent)
+ c_cardinality["written_consent"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["nym"] = ("nym", NymType_, False)
+ c_child_order.extend(["physical_verification", "written_consent", "governing_agreements", "extension"])
+
+ def __init__(
+ self,
+ physical_verification=None,
+ written_consent=None,
+ governing_agreements=None,
+ extension=None,
+ nym=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.physical_verification = physical_verification
self.written_consent = written_consent
@@ -1484,9 +1481,9 @@ def identification_type__from_string(xml_string):
class RestrictedPassword(RestrictedPasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:RestrictedPassword element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:RestrictedPassword element"""
- c_tag = 'RestrictedPassword'
+ c_tag = "RestrictedPassword"
c_namespace = NAMESPACE
c_children = RestrictedPasswordType_.c_children.copy()
c_attributes = RestrictedPasswordType_.c_attributes.copy()
@@ -1499,49 +1496,45 @@ def restricted_password_from_string(xml_string):
class ActivationPinType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationPinType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationPinType element"""
- c_tag = 'ActivationPinType'
+ c_tag = "ActivationPinType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimit'] = (
- 'activation_limit', ActivationLimit)
- c_cardinality['activation_limit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['length', 'alphabet', 'generation', 'activation_limit', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- activation_limit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationLimit"] = (
+ "activation_limit",
+ ActivationLimit,
+ )
+ c_cardinality["activation_limit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["length", "alphabet", "generation", "activation_limit", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ activation_limit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -1555,35 +1548,33 @@ def activation_pin_type__from_string(xml_string):
class SecurityAuditType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecurityAuditType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecurityAuditType element"""
- c_tag = 'SecurityAuditType'
+ c_tag = "SecurityAuditType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SwitchAudit'] = (
- 'switch_audit', SwitchAudit)
- c_cardinality['switch_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['switch_audit', 'extension'])
-
- def __init__(self,
- switch_audit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SwitchAudit"] = ("switch_audit", SwitchAudit)
+ c_cardinality["switch_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["switch_audit", "extension"])
+
+ def __init__(
+ self,
+ switch_audit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.switch_audit = switch_audit
self.extension = extension or []
@@ -1594,74 +1585,74 @@ def security_audit_type__from_string(xml_string):
class PrincipalAuthenticationMechanismType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrincipalAuthenticationMechanismType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrincipalAuthenticationMechanismType element"""
- c_tag = 'PrincipalAuthenticationMechanismType'
+ c_tag = "PrincipalAuthenticationMechanismType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_attributes['preauth'] = ('preauth', 'integer', False)
- c_child_order.extend(['restricted_password'])
-
- def __init__(self,
- restricted_password=None,
- preauth=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_attributes["preauth"] = ("preauth", "integer", False)
+ c_child_order.extend(["restricted_password"])
+
+ def __init__(
+ self,
+ restricted_password=None,
+ preauth=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.restricted_password = restricted_password
self.preauth = preauth
def principal_authentication_mechanism_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- PrincipalAuthenticationMechanismType_, xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanismType_, xml_string)
class AuthenticatorTransportProtocolType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticatorTransportProtocolType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticatorTransportProtocolType element"""
- c_tag = 'AuthenticatorTransportProtocolType'
+ c_tag = "AuthenticatorTransportProtocolType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SSL'] = (
- 'ssl', SSL)
- c_cardinality['ssl'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}WTLS'] = (
- 'wtls', WTLS)
- c_cardinality['wtls'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['ssl', 'wtls', 'extension'])
-
- def __init__(self,
- ssl=None,
- wtls=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SSL"] = ("ssl", SSL)
+ c_cardinality["ssl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}WTLS"] = ("wtls", WTLS)
+ c_cardinality["wtls"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["ssl", "wtls", "extension"])
+
+ def __init__(
+ self,
+ ssl=None,
+ wtls=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.ssl = ssl
self.wtls = wtls
@@ -1669,14 +1660,13 @@ class AuthenticatorTransportProtocolType_(SamlBase):
def authenticator_transport_protocol_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- AuthenticatorTransportProtocolType_, xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocolType_, xml_string)
class Identification(IdentificationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Identification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:Identification element"""
- c_tag = 'Identification'
+ c_tag = "Identification"
c_namespace = NAMESPACE
c_children = IdentificationType_.c_children.copy()
c_attributes = IdentificationType_.c_attributes.copy()
@@ -1689,9 +1679,9 @@ def identification_from_string(xml_string):
class ActivationPin(ActivationPinType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationPin element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationPin element"""
- c_tag = 'ActivationPin'
+ c_tag = "ActivationPin"
c_namespace = NAMESPACE
c_children = ActivationPinType_.c_children.copy()
c_attributes = ActivationPinType_.c_attributes.copy()
@@ -1704,9 +1694,9 @@ def activation_pin_from_string(xml_string):
class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrincipalAuthenticationMechanism element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrincipalAuthenticationMechanism element"""
- c_tag = 'PrincipalAuthenticationMechanism'
+ c_tag = "PrincipalAuthenticationMechanism"
c_namespace = NAMESPACE
c_children = PrincipalAuthenticationMechanismType_.c_children.copy()
c_attributes = PrincipalAuthenticationMechanismType_.c_attributes.copy()
@@ -1715,14 +1705,13 @@ class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
def principal_authentication_mechanism_from_string(xml_string):
- return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism,
- xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism, xml_string)
class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticatorTransportProtocol element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticatorTransportProtocol element"""
- c_tag = 'AuthenticatorTransportProtocol'
+ c_tag = "AuthenticatorTransportProtocol"
c_namespace = NAMESPACE
c_children = AuthenticatorTransportProtocolType_.c_children.copy()
c_attributes = AuthenticatorTransportProtocolType_.c_attributes.copy()
@@ -1731,14 +1720,13 @@ class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
def authenticator_transport_protocol_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol, xml_string)
class SecurityAudit(SecurityAuditType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecurityAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecurityAudit element"""
- c_tag = 'SecurityAudit'
+ c_tag = "SecurityAudit"
c_namespace = NAMESPACE
c_children = SecurityAuditType_.c_children.copy()
c_attributes = SecurityAuditType_.c_attributes.copy()
@@ -1751,41 +1739,39 @@ def security_audit_from_string(xml_string):
class OperationalProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:OperationalProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:OperationalProtectionType element"""
- c_tag = 'OperationalProtectionType'
+ c_tag = "OperationalProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SecurityAudit'] = (
- 'security_audit', SecurityAudit)
- c_cardinality['security_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}DeactivationCallCenter'] = (
- 'deactivation_call_center', DeactivationCallCenter)
- c_cardinality['deactivation_call_center'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['security_audit', 'deactivation_call_center', 'extension'])
-
- def __init__(self,
- security_audit=None,
- deactivation_call_center=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SecurityAudit"] = ("security_audit", SecurityAudit)
+ c_cardinality["security_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}DeactivationCallCenter"] = (
+ "deactivation_call_center",
+ DeactivationCallCenter,
+ )
+ c_cardinality["deactivation_call_center"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["security_audit", "deactivation_call_center", "extension"])
+
+ def __init__(
+ self,
+ security_audit=None,
+ deactivation_call_center=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.security_audit = security_audit
self.deactivation_call_center = deactivation_call_center
@@ -1793,40 +1779,37 @@ class OperationalProtectionType_(SamlBase):
def operational_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(OperationalProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(OperationalProtectionType_, xml_string)
class KeyActivationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyActivationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyActivationType element"""
- c_tag = 'KeyActivationType'
+ c_tag = "KeyActivationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['activation_pin', 'extension'])
-
- def __init__(self,
- activation_pin=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ActivationPin"] = ("activation_pin", ActivationPin)
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["activation_pin", "extension"])
+
+ def __init__(
+ self,
+ activation_pin=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_pin = activation_pin
self.extension = extension or []
@@ -1837,44 +1820,45 @@ def key_activation_type__from_string(xml_string):
class AuthnMethodBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthnMethodBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthnMethodBaseType element"""
- c_tag = 'AuthnMethodBaseType'
+ c_tag = "AuthnMethodBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PrincipalAuthenticationMechanism'] = (
- 'principal_authentication_mechanism', PrincipalAuthenticationMechanism)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Authenticator'] = (
- 'authenticator', Authenticator)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AuthenticatorTransportProtocol'] = (
- 'authenticator_transport_protocol', AuthenticatorTransportProtocol)
- c_cardinality['authenticator_transport_protocol'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['principal_authentication_mechanism', 'authenticator',
- 'authenticator_transport_protocol', 'extension'])
-
- def __init__(self,
- principal_authentication_mechanism=None,
- authenticator=None,
- authenticator_transport_protocol=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PrincipalAuthenticationMechanism"] = (
+ "principal_authentication_mechanism",
+ PrincipalAuthenticationMechanism,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Authenticator"] = ("authenticator", Authenticator)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AuthenticatorTransportProtocol"] = (
+ "authenticator_transport_protocol",
+ AuthenticatorTransportProtocol,
+ )
+ c_cardinality["authenticator_transport_protocol"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ ["principal_authentication_mechanism", "authenticator", "authenticator_transport_protocol", "extension"]
+ )
+
+ def __init__(
+ self,
+ principal_authentication_mechanism=None,
+ authenticator=None,
+ authenticator_transport_protocol=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.principal_authentication_mechanism = principal_authentication_mechanism
self.authenticator = authenticator
@@ -1887,9 +1871,9 @@ def authn_method_base_type__from_string(xml_string):
class KeyActivation(KeyActivationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyActivation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:KeyActivation element"""
- c_tag = 'KeyActivation'
+ c_tag = "KeyActivation"
c_namespace = NAMESPACE
c_children = KeyActivationType_.c_children.copy()
c_attributes = KeyActivationType_.c_attributes.copy()
@@ -1902,9 +1886,9 @@ def key_activation_from_string(xml_string):
class AuthnMethod(AuthnMethodBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthnMethod element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthnMethod element"""
- c_tag = 'AuthnMethod'
+ c_tag = "AuthnMethod"
c_namespace = NAMESPACE
c_children = AuthnMethodBaseType_.c_children.copy()
c_attributes = AuthnMethodBaseType_.c_attributes.copy()
@@ -1917,9 +1901,9 @@ def authn_method_from_string(xml_string):
class OperationalProtection(OperationalProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:OperationalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:OperationalProtection element"""
- c_tag = 'OperationalProtection'
+ c_tag = "OperationalProtection"
c_namespace = NAMESPACE
c_children = OperationalProtectionType_.c_children.copy()
c_attributes = OperationalProtectionType_.c_attributes.copy()
@@ -1932,46 +1916,39 @@ def operational_protection_from_string(xml_string):
class PrivateKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrivateKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrivateKeyProtectionType element"""
- c_tag = 'PrivateKeyProtectionType'
+ c_tag = "PrivateKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeySharing'] = (
- 'key_sharing', KeySharing)
- c_cardinality['key_sharing'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['key_activation', 'key_storage', 'key_sharing', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- key_sharing=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyActivation"] = ("key_activation", KeyActivation)
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyStorage"] = ("key_storage", KeyStorage)
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeySharing"] = ("key_sharing", KeySharing)
+ c_cardinality["key_sharing"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "key_sharing", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ key_sharing=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -1980,45 +1957,40 @@ class PrivateKeyProtectionType_(SamlBase):
def private_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(PrivateKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(PrivateKeyProtectionType_, xml_string)
class SecretKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecretKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecretKeyProtectionType element"""
- c_tag = 'SecretKeyProtectionType'
+ c_tag = "SecretKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['key_activation', 'key_storage', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyActivation"] = ("key_activation", KeyActivation)
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}KeyStorage"] = ("key_storage", KeyStorage)
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -2026,14 +1998,13 @@ class SecretKeyProtectionType_(SamlBase):
def secret_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SecretKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SecretKeyProtectionType_, xml_string)
class SecretKeyProtection(SecretKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecretKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:SecretKeyProtection element"""
- c_tag = 'SecretKeyProtection'
+ c_tag = "SecretKeyProtection"
c_namespace = NAMESPACE
c_children = SecretKeyProtectionType_.c_children.copy()
c_attributes = SecretKeyProtectionType_.c_attributes.copy()
@@ -2046,9 +2017,9 @@ def secret_key_protection_from_string(xml_string):
class PrivateKeyProtection(PrivateKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrivateKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:PrivateKeyProtection element"""
- c_tag = 'PrivateKeyProtection'
+ c_tag = "PrivateKeyProtection"
c_namespace = NAMESPACE
c_children = PrivateKeyProtectionType_.c_children.copy()
c_attributes = PrivateKeyProtectionType_.c_attributes.copy()
@@ -2061,41 +2032,42 @@ def private_key_protection_from_string(xml_string):
class TechnicalProtectionBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TechnicalProtectionBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TechnicalProtectionBaseType element"""
- c_tag = 'TechnicalProtectionBaseType'
+ c_tag = "TechnicalProtectionBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PrivateKeyProtection'] = (
- 'private_key_protection', PrivateKeyProtection)
- c_cardinality['private_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SecretKeyProtection'] = (
- 'secret_key_protection', SecretKeyProtection)
- c_cardinality['secret_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['private_key_protection', 'secret_key_protection', 'extension'])
-
- def __init__(self,
- private_key_protection=None,
- secret_key_protection=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PrivateKeyProtection"] = (
+ "private_key_protection",
+ PrivateKeyProtection,
+ )
+ c_cardinality["private_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SecretKeyProtection"] = (
+ "secret_key_protection",
+ SecretKeyProtection,
+ )
+ c_cardinality["secret_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["private_key_protection", "secret_key_protection", "extension"])
+
+ def __init__(
+ self,
+ private_key_protection=None,
+ secret_key_protection=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.private_key_protection = private_key_protection
self.secret_key_protection = secret_key_protection
@@ -2103,14 +2075,13 @@ class TechnicalProtectionBaseType_(SamlBase):
def technical_protection_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_, xml_string)
class TechnicalProtection(TechnicalProtectionBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TechnicalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:TechnicalProtection element"""
- c_tag = 'TechnicalProtection'
+ c_tag = "TechnicalProtection"
c_namespace = NAMESPACE
c_children = TechnicalProtectionBaseType_.c_children.copy()
c_attributes = TechnicalProtectionBaseType_.c_attributes.copy()
@@ -2123,58 +2094,64 @@ def technical_protection_from_string(xml_string):
class AuthnContextDeclarationBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthnContextDeclarationBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthnContextDeclarationBaseType element"""
- c_tag = 'AuthnContextDeclarationBaseType'
+ c_tag = "AuthnContextDeclarationBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Identification'] = (
- 'identification', Identification)
- c_cardinality['identification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}TechnicalProtection'] = (
- 'technical_protection', TechnicalProtection)
- c_cardinality['technical_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}OperationalProtection'] = (
- 'operational_protection', OperationalProtection)
- c_cardinality['operational_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AuthnMethod'] = (
- 'authn_method', AuthnMethod)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ID'] = ('id', 'ID', False)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Identification"] = ("identification", Identification)
+ c_cardinality["identification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}TechnicalProtection"] = (
+ "technical_protection",
+ TechnicalProtection,
+ )
+ c_cardinality["technical_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}OperationalProtection"] = (
+ "operational_protection",
+ OperationalProtection,
+ )
+ c_cardinality["operational_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AuthnMethod"] = ("authn_method", AuthnMethod)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ID"] = ("id", "ID", False)
c_child_order.extend(
- ['identification', 'technical_protection', 'operational_protection',
- 'authn_method', 'governing_agreements', 'extension'])
-
- def __init__(self,
- identification=None,
- technical_protection=None,
- operational_protection=None,
- authn_method=None,
- governing_agreements=None,
- extension=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "identification",
+ "technical_protection",
+ "operational_protection",
+ "authn_method",
+ "governing_agreements",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ identification=None,
+ technical_protection=None,
+ operational_protection=None,
+ authn_method=None,
+ governing_agreements=None,
+ extension=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.identification = identification
self.technical_protection = technical_protection
@@ -2186,14 +2163,13 @@ class AuthnContextDeclarationBaseType_(SamlBase):
def authn_context_declaration_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_, xml_string)
class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticationContextDeclaration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:AuthenticationContextDeclaration element"""
- c_tag = 'AuthenticationContextDeclaration'
+ c_tag = "AuthenticationContextDeclaration"
c_namespace = NAMESPACE
c_children = AuthnContextDeclarationBaseType_.c_children.copy()
c_attributes = AuthnContextDeclarationBaseType_.c_attributes.copy()
@@ -2202,108 +2178,116 @@ class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
def authentication_context_declaration_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticationContextDeclaration,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticationContextDeclaration, xml_string)
-#..................
+# ..................
# ['ComplexAuthenticatorType', 'ComplexAuthenticator']
class ComplexAuthenticatorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ComplexAuthenticatorType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ComplexAuthenticatorType element"""
- c_tag = 'ComplexAuthenticatorType'
+ c_tag = "ComplexAuthenticatorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PreviousSession'] = (
- 'previous_session', PreviousSession)
- c_cardinality['previous_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ResumeSession'] = (
- 'resume_session', ResumeSession)
- c_cardinality['resume_session'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}DigSig'] = (
- 'dig_sig', DigSig)
- c_cardinality['dig_sig'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ZeroKnowledge'] = (
- 'zero_knowledge', ZeroKnowledge)
- c_cardinality['zero_knowledge'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}IPAddress'] = (
- 'ip_address', IPAddress)
- c_cardinality['ip_address'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AsymmetricDecryption'] = (
- 'asymmetric_decryption', AsymmetricDecryption)
- c_cardinality['asymmetric_decryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AsymmetricKeyAgreement'] = (
- 'asymmetric_key_agreement', AsymmetricKeyAgreement)
- c_cardinality['asymmetric_key_agreement'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SubscriberLineNumber'] = (
- 'subscriber_line_number', SubscriberLineNumber)
- c_cardinality['subscriber_line_number'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}UserSuffix'] = (
- 'user_suffix', UserSuffix)
- c_cardinality['user_suffix'] = {"min": 0, "max": 1}
- c_cardinality['complex_authenticator'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}PreviousSession"] = (
+ "previous_session",
+ PreviousSession,
+ )
+ c_cardinality["previous_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ResumeSession"] = ("resume_session", ResumeSession)
+ c_cardinality["resume_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}DigSig"] = ("dig_sig", DigSig)
+ c_cardinality["dig_sig"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ZeroKnowledge"] = ("zero_knowledge", ZeroKnowledge)
+ c_cardinality["zero_knowledge"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}IPAddress"] = ("ip_address", IPAddress)
+ c_cardinality["ip_address"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AsymmetricDecryption"] = (
+ "asymmetric_decryption",
+ AsymmetricDecryption,
+ )
+ c_cardinality["asymmetric_decryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}AsymmetricKeyAgreement"] = (
+ "asymmetric_key_agreement",
+ AsymmetricKeyAgreement,
+ )
+ c_cardinality["asymmetric_key_agreement"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}SubscriberLineNumber"] = (
+ "subscriber_line_number",
+ SubscriberLineNumber,
+ )
+ c_cardinality["subscriber_line_number"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}UserSuffix"] = ("user_suffix", UserSuffix)
+ c_cardinality["user_suffix"] = {"min": 0, "max": 1}
+ c_cardinality["complex_authenticator"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
c_child_order.extend(
- ['previous_session', 'resume_session', 'dig_sig', 'password',
- 'restricted_password', 'zero_knowledge',
- 'shared_secret_challenge_response', 'shared_secret_dynamic_plaintext',
- 'ip_address', 'asymmetric_decryption', 'asymmetric_key_agreement',
- 'subscriber_line_number', 'user_suffix', 'complex_authenticator',
- 'extension'])
-
- def __init__(self,
- previous_session=None,
- resume_session=None,
- dig_sig=None,
- password=None,
- restricted_password=None,
- zero_knowledge=None,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- ip_address=None,
- asymmetric_decryption=None,
- asymmetric_key_agreement=None,
- subscriber_line_number=None,
- user_suffix=None,
- complex_authenticator=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "previous_session",
+ "resume_session",
+ "dig_sig",
+ "password",
+ "restricted_password",
+ "zero_knowledge",
+ "shared_secret_challenge_response",
+ "shared_secret_dynamic_plaintext",
+ "ip_address",
+ "asymmetric_decryption",
+ "asymmetric_key_agreement",
+ "subscriber_line_number",
+ "user_suffix",
+ "complex_authenticator",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ previous_session=None,
+ resume_session=None,
+ dig_sig=None,
+ password=None,
+ restricted_password=None,
+ zero_knowledge=None,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ ip_address=None,
+ asymmetric_decryption=None,
+ asymmetric_key_agreement=None,
+ subscriber_line_number=None,
+ user_suffix=None,
+ complex_authenticator=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.previous_session = previous_session
self.resume_session = resume_session
@@ -2323,14 +2307,13 @@ class ComplexAuthenticatorType_(SamlBase):
def complex_authenticator_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ComplexAuthenticatorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ComplexAuthenticatorType_, xml_string)
class ComplexAuthenticator(ComplexAuthenticatorType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ComplexAuthenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ComplexAuthenticator element"""
- c_tag = 'ComplexAuthenticator'
+ c_tag = "ComplexAuthenticator"
c_namespace = NAMESPACE
c_children = ComplexAuthenticatorType_.c_children.copy()
c_attributes = ComplexAuthenticatorType_.c_attributes.copy()
@@ -2343,12 +2326,14 @@ def complex_authenticator_from_string(xml_string):
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-ComplexAuthenticatorType_.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
-ComplexAuthenticator.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
+ComplexAuthenticatorType_.c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+)
+ComplexAuthenticator.c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELEMENT_FROM_STRING = {
@@ -2448,102 +2433,101 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'AuthenticationContextDeclaration': AuthenticationContextDeclaration,
- 'Identification': Identification,
- 'PhysicalVerification': PhysicalVerification,
- 'WrittenConsent': WrittenConsent,
- 'TechnicalProtection': TechnicalProtection,
- 'SecretKeyProtection': SecretKeyProtection,
- 'PrivateKeyProtection': PrivateKeyProtection,
- 'KeyActivation': KeyActivation,
- 'KeySharing': KeySharing,
- 'KeyStorage': KeyStorage,
- 'SubscriberLineNumber': SubscriberLineNumber,
- 'UserSuffix': UserSuffix,
- 'Password': Password,
- 'ActivationPin': ActivationPin,
- 'Token': Token,
- 'TimeSyncToken': TimeSyncToken,
- 'Smartcard': Smartcard,
- 'Length': Length,
- 'ActivationLimit': ActivationLimit,
- 'Generation': Generation,
- 'AuthnMethod': AuthnMethod,
- 'PrincipalAuthenticationMechanism': PrincipalAuthenticationMechanism,
- 'Authenticator': Authenticator,
- 'ComplexAuthenticator': ComplexAuthenticator,
- 'PreviousSession': PreviousSession,
- 'ResumeSession': ResumeSession,
- 'ZeroKnowledge': ZeroKnowledge,
- 'SharedSecretChallengeResponse': SharedSecretChallengeResponse,
- 'SharedSecretChallengeResponseType': SharedSecretChallengeResponseType_,
- 'DigSig': DigSig,
- 'AsymmetricDecryption': AsymmetricDecryption,
- 'AsymmetricKeyAgreement': AsymmetricKeyAgreement,
- 'IPAddress': IPAddress,
- 'SharedSecretDynamicPlaintext': SharedSecretDynamicPlaintext,
- 'AuthenticatorTransportProtocol': AuthenticatorTransportProtocol,
- 'HTTP': HTTP,
- 'IPSec': IPSec,
- 'WTLS': WTLS,
- 'MobileNetworkNoEncryption': MobileNetworkNoEncryption,
- 'MobileNetworkRadioEncryption': MobileNetworkRadioEncryption,
- 'MobileNetworkEndToEndEncryption': MobileNetworkEndToEndEncryption,
- 'SSL': SSL,
- 'PSTN': PSTN,
- 'ISDN': ISDN,
- 'ADSL': ADSL,
- 'OperationalProtection': OperationalProtection,
- 'SecurityAudit': SecurityAudit,
- 'SwitchAudit': SwitchAudit,
- 'DeactivationCallCenter': DeactivationCallCenter,
- 'GoverningAgreements': GoverningAgreements,
- 'GoverningAgreementRef': GoverningAgreementRef,
- 'nymType': NymType_,
- 'IdentificationType': IdentificationType_,
- 'TechnicalProtectionBaseType': TechnicalProtectionBaseType_,
- 'OperationalProtectionType': OperationalProtectionType_,
- 'GoverningAgreementsType': GoverningAgreementsType_,
- 'GoverningAgreementRefType': GoverningAgreementRefType_,
- 'ComplexAuthenticatorType': ComplexAuthenticatorType_,
- 'KeyActivationType': KeyActivationType_,
- 'KeySharingType': KeySharingType_,
- 'PrivateKeyProtectionType': PrivateKeyProtectionType_,
- 'PasswordType': PasswordType_,
- 'RestrictedPassword': RestrictedPassword,
- 'RestrictedPasswordType': RestrictedPasswordType_,
- 'RestrictedLengthType': RestrictedLengthType_,
- 'ActivationPinType': ActivationPinType_,
- 'Alphabet': Alphabet,
- 'AlphabetType': AlphabetType_,
- 'TokenType': TokenType_,
- 'DeviceTypeType': DeviceTypeType_,
- 'booleanType': BooleanType_,
- 'TimeSyncTokenType': TimeSyncTokenType_,
- 'ActivationLimitType': ActivationLimitType_,
- 'ActivationLimitDuration': ActivationLimitDuration,
- 'ActivationLimitUsages': ActivationLimitUsages,
- 'ActivationLimitSession': ActivationLimitSession,
- 'ActivationLimitDurationType': ActivationLimitDurationType_,
- 'ActivationLimitUsagesType': ActivationLimitUsagesType_,
- 'ActivationLimitSessionType': ActivationLimitSessionType_,
- 'LengthType': LengthType_,
- 'mediumType': MediumType_,
- 'KeyStorageType': KeyStorageType_,
- 'SecretKeyProtectionType': SecretKeyProtectionType_,
- 'SecurityAuditType': SecurityAuditType_,
- 'ExtensionOnlyType': ExtensionOnlyType_,
- 'Extension': Extension,
- 'ExtensionType': ExtensionType_,
- 'AuthnContextDeclarationBaseType': AuthnContextDeclarationBaseType_,
- 'AuthnMethodBaseType': AuthnMethodBaseType_,
- 'PrincipalAuthenticationMechanismType': PrincipalAuthenticationMechanismType_,
- 'AuthenticatorBaseType': AuthenticatorBaseType_,
- 'PublicKeyType': PublicKeyType_,
- 'AuthenticatorTransportProtocolType': AuthenticatorTransportProtocolType_,
+ "AuthenticationContextDeclaration": AuthenticationContextDeclaration,
+ "Identification": Identification,
+ "PhysicalVerification": PhysicalVerification,
+ "WrittenConsent": WrittenConsent,
+ "TechnicalProtection": TechnicalProtection,
+ "SecretKeyProtection": SecretKeyProtection,
+ "PrivateKeyProtection": PrivateKeyProtection,
+ "KeyActivation": KeyActivation,
+ "KeySharing": KeySharing,
+ "KeyStorage": KeyStorage,
+ "SubscriberLineNumber": SubscriberLineNumber,
+ "UserSuffix": UserSuffix,
+ "Password": Password,
+ "ActivationPin": ActivationPin,
+ "Token": Token,
+ "TimeSyncToken": TimeSyncToken,
+ "Smartcard": Smartcard,
+ "Length": Length,
+ "ActivationLimit": ActivationLimit,
+ "Generation": Generation,
+ "AuthnMethod": AuthnMethod,
+ "PrincipalAuthenticationMechanism": PrincipalAuthenticationMechanism,
+ "Authenticator": Authenticator,
+ "ComplexAuthenticator": ComplexAuthenticator,
+ "PreviousSession": PreviousSession,
+ "ResumeSession": ResumeSession,
+ "ZeroKnowledge": ZeroKnowledge,
+ "SharedSecretChallengeResponse": SharedSecretChallengeResponse,
+ "SharedSecretChallengeResponseType": SharedSecretChallengeResponseType_,
+ "DigSig": DigSig,
+ "AsymmetricDecryption": AsymmetricDecryption,
+ "AsymmetricKeyAgreement": AsymmetricKeyAgreement,
+ "IPAddress": IPAddress,
+ "SharedSecretDynamicPlaintext": SharedSecretDynamicPlaintext,
+ "AuthenticatorTransportProtocol": AuthenticatorTransportProtocol,
+ "HTTP": HTTP,
+ "IPSec": IPSec,
+ "WTLS": WTLS,
+ "MobileNetworkNoEncryption": MobileNetworkNoEncryption,
+ "MobileNetworkRadioEncryption": MobileNetworkRadioEncryption,
+ "MobileNetworkEndToEndEncryption": MobileNetworkEndToEndEncryption,
+ "SSL": SSL,
+ "PSTN": PSTN,
+ "ISDN": ISDN,
+ "ADSL": ADSL,
+ "OperationalProtection": OperationalProtection,
+ "SecurityAudit": SecurityAudit,
+ "SwitchAudit": SwitchAudit,
+ "DeactivationCallCenter": DeactivationCallCenter,
+ "GoverningAgreements": GoverningAgreements,
+ "GoverningAgreementRef": GoverningAgreementRef,
+ "nymType": NymType_,
+ "IdentificationType": IdentificationType_,
+ "TechnicalProtectionBaseType": TechnicalProtectionBaseType_,
+ "OperationalProtectionType": OperationalProtectionType_,
+ "GoverningAgreementsType": GoverningAgreementsType_,
+ "GoverningAgreementRefType": GoverningAgreementRefType_,
+ "ComplexAuthenticatorType": ComplexAuthenticatorType_,
+ "KeyActivationType": KeyActivationType_,
+ "KeySharingType": KeySharingType_,
+ "PrivateKeyProtectionType": PrivateKeyProtectionType_,
+ "PasswordType": PasswordType_,
+ "RestrictedPassword": RestrictedPassword,
+ "RestrictedPasswordType": RestrictedPasswordType_,
+ "RestrictedLengthType": RestrictedLengthType_,
+ "ActivationPinType": ActivationPinType_,
+ "Alphabet": Alphabet,
+ "AlphabetType": AlphabetType_,
+ "TokenType": TokenType_,
+ "DeviceTypeType": DeviceTypeType_,
+ "booleanType": BooleanType_,
+ "TimeSyncTokenType": TimeSyncTokenType_,
+ "ActivationLimitType": ActivationLimitType_,
+ "ActivationLimitDuration": ActivationLimitDuration,
+ "ActivationLimitUsages": ActivationLimitUsages,
+ "ActivationLimitSession": ActivationLimitSession,
+ "ActivationLimitDurationType": ActivationLimitDurationType_,
+ "ActivationLimitUsagesType": ActivationLimitUsagesType_,
+ "ActivationLimitSessionType": ActivationLimitSessionType_,
+ "LengthType": LengthType_,
+ "mediumType": MediumType_,
+ "KeyStorageType": KeyStorageType_,
+ "SecretKeyProtectionType": SecretKeyProtectionType_,
+ "SecurityAuditType": SecurityAuditType_,
+ "ExtensionOnlyType": ExtensionOnlyType_,
+ "Extension": Extension,
+ "ExtensionType": ExtensionType_,
+ "AuthnContextDeclarationBaseType": AuthnContextDeclarationBaseType_,
+ "AuthnMethodBaseType": AuthnMethodBaseType_,
+ "PrincipalAuthenticationMechanismType": PrincipalAuthenticationMechanismType_,
+ "AuthenticatorBaseType": AuthenticatorBaseType_,
+ "PublicKeyType": PublicKeyType_,
+ "AuthenticatorTransportProtocolType": AuthenticatorTransportProtocolType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/authn_context/timesync.py b/src/saml2/authn_context/timesync.py
index f2c67012..32f28354 100755
--- a/src/saml2/authn_context/timesync.py
+++ b/src/saml2/authn_context/timesync.py
@@ -8,30 +8,25 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken"
class PhysicalVerification(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- PhysicalVerification element """
+ PhysicalVerification element"""
- c_tag = 'PhysicalVerification'
+ c_tag = "PhysicalVerification"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['credentialLevel'] = ('credential_level', 'None', False)
-
- def __init__(self,
- credential_level=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["credentialLevel"] = ("credential_level", "None", False)
+
+ def __init__(self, credential_level=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.credential_level = credential_level
@@ -41,25 +36,20 @@ def physical_verification_from_string(xml_string):
class Generation(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Generation
- element """
+ element"""
- c_tag = 'Generation'
+ c_tag = "Generation"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['mechanism'] = ('mechanism', 'None', True)
-
- def __init__(self,
- mechanism=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["mechanism"] = ("mechanism", "None", True)
+
+ def __init__(self, mechanism=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.mechanism = mechanism
@@ -69,12 +59,11 @@ def generation_from_string(xml_string):
class NymType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:nymType
- element """
+ element"""
- c_tag = 'nymType'
+ c_tag = "nymType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['anonymity', 'verinymity', 'pseudonymity']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["anonymity", "verinymity", "pseudonymity"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -87,55 +76,43 @@ def nym_type__from_string(xml_string):
class GoverningAgreementRefType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- GoverningAgreementRefType element """
+ GoverningAgreementRefType element"""
- c_tag = 'GoverningAgreementRefType'
+ c_tag = "GoverningAgreementRefType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['governingAgreementRef'] = (
- 'governing_agreement_ref', 'anyURI', True)
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["governingAgreementRef"] = ("governing_agreement_ref", "anyURI", True)
+
+ def __init__(self, governing_agreement_ref=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.governing_agreement_ref = governing_agreement_ref
def governing_agreement_ref_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementRefType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementRefType_, xml_string)
class KeySharingType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeySharingType
- element """
+ element"""
- c_tag = 'KeySharingType'
+ c_tag = "KeySharingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['sharing'] = ('sharing', 'boolean', True)
-
- def __init__(self,
- sharing=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["sharing"] = ("sharing", "boolean", True)
+
+ def __init__(self, sharing=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.sharing = sharing
@@ -145,27 +122,21 @@ def key_sharing_type__from_string(xml_string):
class RestrictedLengthType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- RestrictedLengthType element """
+ RestrictedLengthType element"""
- c_tag = 'RestrictedLengthType'
+ c_tag = "RestrictedLengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'None', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["min"] = ("min", "None", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(self, min=None, max=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.min = min
self.max = max
@@ -176,30 +147,32 @@ def restricted_length_type__from_string(xml_string):
class AlphabetType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AlphabetType
- element """
+ element"""
- c_tag = 'AlphabetType'
+ c_tag = "AlphabetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['requiredChars'] = ('required_chars', 'string', True)
- c_attributes['excludedChars'] = ('excluded_chars', 'string', False)
- c_attributes['case'] = ('case', 'string', False)
-
- def __init__(self,
- required_chars=None,
- excluded_chars=None,
- case=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["requiredChars"] = ("required_chars", "string", True)
+ c_attributes["excludedChars"] = ("excluded_chars", "string", False)
+ c_attributes["case"] = ("case", "string", False)
+
+ def __init__(
+ self,
+ required_chars=None,
+ excluded_chars=None,
+ case=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.required_chars = required_chars
self.excluded_chars = excluded_chars
@@ -212,12 +185,11 @@ def alphabet_type__from_string(xml_string):
class DeviceTypeType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:DeviceTypeType
- element """
+ element"""
- c_tag = 'DeviceTypeType'
+ c_tag = "DeviceTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['hardware', 'software']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["hardware", "software"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -230,11 +202,11 @@ def device_type_type__from_string(xml_string):
class BooleanType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:booleanType
- element """
+ element"""
- c_tag = 'booleanType'
+ c_tag = "booleanType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN', 'enumeration': ['true', 'false']}
+ c_value_type = {"base": "xs:NMTOKEN", "enumeration": ["true", "false"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -247,67 +219,55 @@ def boolean_type__from_string(xml_string):
class ActivationLimitDurationType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- ActivationLimitDurationType element """
+ ActivationLimitDurationType element"""
- c_tag = 'ActivationLimitDurationType'
+ c_tag = "ActivationLimitDurationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['duration'] = ('duration', 'duration', True)
-
- def __init__(self,
- duration=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["duration"] = ("duration", "duration", True)
+
+ def __init__(self, duration=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.duration = duration
def activation_limit_duration_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDurationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDurationType_, xml_string)
class ActivationLimitUsagesType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- ActivationLimitUsagesType element """
+ ActivationLimitUsagesType element"""
- c_tag = 'ActivationLimitUsagesType'
+ c_tag = "ActivationLimitUsagesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['number'] = ('number', 'integer', True)
-
- def __init__(self,
- number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["number"] = ("number", "integer", True)
+
+ def __init__(self, number=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.number = number
def activation_limit_usages_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitUsagesType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitUsagesType_, xml_string)
class ActivationLimitSessionType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- ActivationLimitSessionType element """
+ ActivationLimitSessionType element"""
- c_tag = 'ActivationLimitSessionType'
+ c_tag = "ActivationLimitSessionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -316,33 +276,26 @@ class ActivationLimitSessionType_(SamlBase):
def activation_limit_session_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSessionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSessionType_, xml_string)
class LengthType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:LengthType
- element """
+ element"""
- c_tag = 'LengthType'
+ c_tag = "LengthType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['min'] = ('min', 'integer', True)
- c_attributes['max'] = ('max', 'integer', False)
-
- def __init__(self,
- min=None,
- max=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["min"] = ("min", "integer", True)
+ c_attributes["max"] = ("max", "integer", False)
+
+ def __init__(self, min=None, max=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.min = min
self.max = max
@@ -353,13 +306,14 @@ def length_type__from_string(xml_string):
class MediumType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:mediumType
- element """
+ element"""
- c_tag = 'mediumType'
+ c_tag = "mediumType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:NMTOKEN',
- 'enumeration': ['memory', 'smartcard', 'token',
- 'MobileDevice', 'MobileAuthCard']}
+ c_value_type = {
+ "base": "xs:NMTOKEN",
+ "enumeration": ["memory", "smartcard", "token", "MobileDevice", "MobileAuthCard"],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -372,25 +326,20 @@ def medium_type__from_string(xml_string):
class KeyStorageType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeyStorageType
- element """
+ element"""
- c_tag = 'KeyStorageType'
+ c_tag = "KeyStorageType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['medium'] = ('medium', MediumType_, True)
-
- def __init__(self,
- medium=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["medium"] = ("medium", MediumType_, True)
+
+ def __init__(self, medium=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.medium = medium
@@ -400,9 +349,9 @@ def key_storage_type__from_string(xml_string):
class ExtensionType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ExtensionType
- element """
+ element"""
- c_tag = 'ExtensionType'
+ c_tag = "ExtensionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -416,29 +365,30 @@ def extension_type__from_string(xml_string):
class TimeSyncTokenType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- TimeSyncTokenType element """
+ TimeSyncTokenType element"""
- c_tag = 'TimeSyncTokenType'
+ c_tag = "TimeSyncTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['DeviceType'] = ('device_type', 'None', True)
- c_attributes['SeedLength'] = ('seed_length', 'None', True)
- c_attributes['DeviceInHand'] = ('device_in_hand', 'None', True)
-
- def __init__(self,
- device_type=None,
- seed_length=None,
- device_in_hand=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["DeviceType"] = ("device_type", "None", True)
+ c_attributes["SeedLength"] = ("seed_length", "None", True)
+ c_attributes["DeviceInHand"] = ("device_in_hand", "None", True)
+
+ def __init__(
+ self,
+ device_type=None,
+ seed_length=None,
+ device_in_hand=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.device_type = device_type
self.seed_length = seed_length
self.device_in_hand = device_in_hand
@@ -450,9 +400,9 @@ def time_sync_token_type__from_string(xml_string):
class KeySharing(KeySharingType_):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeySharing
- element """
+ element"""
- c_tag = 'KeySharing'
+ c_tag = "KeySharing"
c_namespace = NAMESPACE
c_children = KeySharingType_.c_children.copy()
c_attributes = KeySharingType_.c_attributes.copy()
@@ -466,9 +416,9 @@ def key_sharing_from_string(xml_string):
class KeyStorage(KeyStorageType_):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeyStorage
- element """
+ element"""
- c_tag = 'KeyStorage'
+ c_tag = "KeyStorage"
c_namespace = NAMESPACE
c_children = KeyStorageType_.c_children.copy()
c_attributes = KeyStorageType_.c_attributes.copy()
@@ -482,9 +432,9 @@ def key_storage_from_string(xml_string):
class TimeSyncToken(TimeSyncTokenType_):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TimeSyncToken
- element """
+ element"""
- c_tag = 'TimeSyncToken'
+ c_tag = "TimeSyncToken"
c_namespace = NAMESPACE
c_children = TimeSyncTokenType_.c_children.copy()
c_attributes = TimeSyncTokenType_.c_attributes.copy()
@@ -497,9 +447,9 @@ def time_sync_token_from_string(xml_string):
class Length(LengthType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Length element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Length element"""
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = LengthType_.c_children.copy()
c_attributes = LengthType_.c_attributes.copy()
@@ -512,9 +462,9 @@ def length_from_string(xml_string):
class GoverningAgreementRef(GoverningAgreementRefType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:GoverningAgreementRef element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:GoverningAgreementRef element"""
- c_tag = 'GoverningAgreementRef'
+ c_tag = "GoverningAgreementRef"
c_namespace = NAMESPACE
c_children = GoverningAgreementRefType_.c_children.copy()
c_attributes = GoverningAgreementRefType_.c_attributes.copy()
@@ -528,41 +478,43 @@ def governing_agreement_ref_from_string(xml_string):
class GoverningAgreementsType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
- GoverningAgreementsType element """
+ GoverningAgreementsType element"""
- c_tag = 'GoverningAgreementsType'
+ c_tag = "GoverningAgreementsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}GoverningAgreementRef'] = (
- 'governing_agreement_ref', [GoverningAgreementRef])
- c_cardinality['governing_agreement_ref'] = {"min": 1}
- c_child_order.extend(['governing_agreement_ref'])
-
- def __init__(self,
- governing_agreement_ref=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}GoverningAgreementRef"] = (
+ "governing_agreement_ref",
+ [GoverningAgreementRef],
+ )
+ c_cardinality["governing_agreement_ref"] = {"min": 1}
+ c_child_order.extend(["governing_agreement_ref"])
+
+ def __init__(
+ self,
+ governing_agreement_ref=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.governing_agreement_ref = governing_agreement_ref or []
def governing_agreements_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(GoverningAgreementsType_,
- xml_string)
+ return saml2.create_class_from_xml_string(GoverningAgreementsType_, xml_string)
class RestrictedPasswordType_Length(RestrictedLengthType_):
- c_tag = 'Length'
+ c_tag = "Length"
c_namespace = NAMESPACE
c_children = RestrictedLengthType_.c_children.copy()
c_attributes = RestrictedLengthType_.c_attributes.copy()
@@ -571,14 +523,13 @@ class RestrictedPasswordType_Length(RestrictedLengthType_):
def restricted_password_type__length_from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_Length,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_Length, xml_string)
class Alphabet(AlphabetType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Alphabet element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Alphabet element"""
- c_tag = 'Alphabet'
+ c_tag = "Alphabet"
c_namespace = NAMESPACE
c_children = AlphabetType_.c_children.copy()
c_attributes = AlphabetType_.c_attributes.copy()
@@ -591,9 +542,9 @@ def alphabet_from_string(xml_string):
class ActivationLimitDuration(ActivationLimitDurationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitDuration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitDuration element"""
- c_tag = 'ActivationLimitDuration'
+ c_tag = "ActivationLimitDuration"
c_namespace = NAMESPACE
c_children = ActivationLimitDurationType_.c_children.copy()
c_attributes = ActivationLimitDurationType_.c_attributes.copy()
@@ -602,14 +553,13 @@ class ActivationLimitDuration(ActivationLimitDurationType_):
def activation_limit_duration_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitDuration,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitDuration, xml_string)
class ActivationLimitUsages(ActivationLimitUsagesType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitUsages element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitUsages element"""
- c_tag = 'ActivationLimitUsages'
+ c_tag = "ActivationLimitUsages"
c_namespace = NAMESPACE
c_children = ActivationLimitUsagesType_.c_children.copy()
c_attributes = ActivationLimitUsagesType_.c_attributes.copy()
@@ -622,9 +572,9 @@ def activation_limit_usages_from_string(xml_string):
class ActivationLimitSession(ActivationLimitSessionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitSession element"""
- c_tag = 'ActivationLimitSession'
+ c_tag = "ActivationLimitSession"
c_namespace = NAMESPACE
c_children = ActivationLimitSessionType_.c_children.copy()
c_attributes = ActivationLimitSessionType_.c_attributes.copy()
@@ -633,14 +583,13 @@ class ActivationLimitSession(ActivationLimitSessionType_):
def activation_limit_session_from_string(xml_string):
- return saml2.create_class_from_xml_string(ActivationLimitSession,
- xml_string)
+ return saml2.create_class_from_xml_string(ActivationLimitSession, xml_string)
class Extension(ExtensionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Extension element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Extension element"""
- c_tag = 'Extension'
+ c_tag = "Extension"
c_namespace = NAMESPACE
c_children = ExtensionType_.c_children.copy()
c_attributes = ExtensionType_.c_attributes.copy()
@@ -653,34 +602,35 @@ def extension_from_string(xml_string):
class TokenType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TokenType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TokenType element"""
- c_tag = 'TokenType'
+ c_tag = "TokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}TimeSyncToken'] = (
- 'time_sync_token', TimeSyncToken)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['time_sync_token', 'extension'])
-
- def __init__(self,
- time_sync_token=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}TimeSyncToken"] = (
+ "time_sync_token",
+ TimeSyncToken,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["time_sync_token", "extension"])
+
+ def __init__(
+ self,
+ time_sync_token=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.time_sync_token = time_sync_token
self.extension = extension or []
@@ -691,9 +641,9 @@ def token_type__from_string(xml_string):
class Token(TokenType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Token element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Token element"""
- c_tag = 'Token'
+ c_tag = "Token"
c_namespace = NAMESPACE
c_children = TokenType_.c_children.copy()
c_attributes = TokenType_.c_attributes.copy()
@@ -706,69 +656,68 @@ def token_from_string(xml_string):
class SharedSecretChallengeResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SharedSecretChallengeResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SharedSecretChallengeResponseType element"""
- c_tag = 'SharedSecretChallengeResponseType'
+ c_tag = "SharedSecretChallengeResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['method'] = ('method', 'anyURI', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- method=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["method"] = ("method", "anyURI", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ method=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.method = method
def shared_secret_challenge_response_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- SharedSecretChallengeResponseType_, xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponseType_, xml_string)
class PublicKeyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PublicKeyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PublicKeyType element"""
- c_tag = 'PublicKeyType'
+ c_tag = "PublicKeyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['keyValidation'] = ('key_validation', 'None', False)
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- key_validation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["keyValidation"] = ("key_validation", "None", False)
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ key_validation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
self.key_validation = key_validation
@@ -779,9 +728,9 @@ def public_key_type__from_string(xml_string):
class GoverningAgreements(GoverningAgreementsType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:GoverningAgreements element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:GoverningAgreements element"""
- c_tag = 'GoverningAgreements'
+ c_tag = "GoverningAgreements"
c_namespace = NAMESPACE
c_children = GoverningAgreementsType_.c_children.copy()
c_attributes = GoverningAgreementsType_.c_attributes.copy()
@@ -794,48 +743,41 @@ def governing_agreements_from_string(xml_string):
class PasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PasswordType element"""
- c_tag = 'PasswordType'
+ c_tag = "PasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'alphabet', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "alphabet", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -849,42 +791,40 @@ def password_type__from_string(xml_string):
class RestrictedPasswordType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:RestrictedPasswordType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:RestrictedPasswordType element"""
- c_tag = 'RestrictedPasswordType'
+ c_tag = "RestrictedPasswordType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Length'] = (
- 'length', RestrictedPasswordType_Length)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ExternalVerification'] = (
- 'external_verification', 'anyURI', False)
- c_child_order.extend(['length', 'generation', 'extension'])
-
- def __init__(self,
- length=None,
- generation=None,
- extension=None,
- external_verification=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Length"] = (
+ "length",
+ RestrictedPasswordType_Length,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ExternalVerification"] = ("external_verification", "anyURI", False)
+ c_child_order.extend(["length", "generation", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ generation=None,
+ extension=None,
+ external_verification=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.generation = generation
@@ -893,47 +833,49 @@ class RestrictedPasswordType_(SamlBase):
def restricted_password_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RestrictedPasswordType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RestrictedPasswordType_, xml_string)
class ActivationLimitType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimitType element"""
- c_tag = 'ActivationLimitType'
+ c_tag = "ActivationLimitType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimitDuration'] = (
- 'activation_limit_duration', ActivationLimitDuration)
- c_cardinality['activation_limit_duration'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimitUsages'] = (
- 'activation_limit_usages', ActivationLimitUsages)
- c_cardinality['activation_limit_usages'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimitSession'] = (
- 'activation_limit_session', ActivationLimitSession)
- c_cardinality['activation_limit_session'] = {"min": 0, "max": 1}
- c_child_order.extend(
- ['activation_limit_duration', 'activation_limit_usages',
- 'activation_limit_session'])
-
- def __init__(self,
- activation_limit_duration=None,
- activation_limit_usages=None,
- activation_limit_session=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimitDuration"] = (
+ "activation_limit_duration",
+ ActivationLimitDuration,
+ )
+ c_cardinality["activation_limit_duration"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimitUsages"] = (
+ "activation_limit_usages",
+ ActivationLimitUsages,
+ )
+ c_cardinality["activation_limit_usages"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimitSession"] = (
+ "activation_limit_session",
+ ActivationLimitSession,
+ )
+ c_cardinality["activation_limit_session"] = {"min": 0, "max": 1}
+ c_child_order.extend(["activation_limit_duration", "activation_limit_usages", "activation_limit_session"])
+
+ def __init__(
+ self,
+ activation_limit_duration=None,
+ activation_limit_usages=None,
+ activation_limit_session=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_limit_duration = activation_limit_duration
self.activation_limit_usages = activation_limit_usages
@@ -945,30 +887,30 @@ def activation_limit_type__from_string(xml_string):
class ExtensionOnlyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ExtensionOnlyType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ExtensionOnlyType element"""
- c_tag = 'ExtensionOnlyType'
+ c_tag = "ExtensionOnlyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['extension'])
-
- def __init__(self,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["extension"])
+
+ def __init__(
+ self,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extension = extension or []
@@ -978,42 +920,41 @@ def extension_only_type__from_string(xml_string):
class PrincipalAuthenticationMechanismType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrincipalAuthenticationMechanismType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrincipalAuthenticationMechanismType element"""
- c_tag = 'PrincipalAuthenticationMechanismType'
+ c_tag = "PrincipalAuthenticationMechanismType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Token'] = (
- 'token', Token)
- c_child_order.extend(['token'])
-
- def __init__(self,
- token=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Token"] = ("token", Token)
+ c_child_order.extend(["token"])
+
+ def __init__(
+ self,
+ token=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.token = token
def principal_authentication_mechanism_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- PrincipalAuthenticationMechanismType_, xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanismType_, xml_string)
class WrittenConsent(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:WrittenConsent element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:WrittenConsent element"""
- c_tag = 'WrittenConsent'
+ c_tag = "WrittenConsent"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1026,9 +967,9 @@ def written_consent_from_string(xml_string):
class SubscriberLineNumber(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SubscriberLineNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SubscriberLineNumber element"""
- c_tag = 'SubscriberLineNumber'
+ c_tag = "SubscriberLineNumber"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1041,9 +982,9 @@ def subscriber_line_number_from_string(xml_string):
class UserSuffix(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:UserSuffix element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:UserSuffix element"""
- c_tag = 'UserSuffix'
+ c_tag = "UserSuffix"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1056,9 +997,9 @@ def user_suffix_from_string(xml_string):
class Password(PasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Password element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Password element"""
- c_tag = 'Password'
+ c_tag = "Password"
c_namespace = NAMESPACE
c_children = PasswordType_.c_children.copy()
c_attributes = PasswordType_.c_attributes.copy()
@@ -1071,9 +1012,9 @@ def password_from_string(xml_string):
class Smartcard(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Smartcard element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Smartcard element"""
- c_tag = 'Smartcard'
+ c_tag = "Smartcard"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1086,9 +1027,9 @@ def smartcard_from_string(xml_string):
class ActivationLimit(ActivationLimitType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationLimit element"""
- c_tag = 'ActivationLimit'
+ c_tag = "ActivationLimit"
c_namespace = NAMESPACE
c_children = ActivationLimitType_.c_children.copy()
c_attributes = ActivationLimitType_.c_attributes.copy()
@@ -1101,9 +1042,9 @@ def activation_limit_from_string(xml_string):
class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrincipalAuthenticationMechanism element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrincipalAuthenticationMechanism element"""
- c_tag = 'PrincipalAuthenticationMechanism'
+ c_tag = "PrincipalAuthenticationMechanism"
c_namespace = NAMESPACE
c_children = PrincipalAuthenticationMechanismType_.c_children.copy()
c_attributes = PrincipalAuthenticationMechanismType_.c_attributes.copy()
@@ -1112,14 +1053,13 @@ class PrincipalAuthenticationMechanism(PrincipalAuthenticationMechanismType_):
def principal_authentication_mechanism_from_string(xml_string):
- return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism,
- xml_string)
+ return saml2.create_class_from_xml_string(PrincipalAuthenticationMechanism, xml_string)
class PreviousSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PreviousSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PreviousSession element"""
- c_tag = 'PreviousSession'
+ c_tag = "PreviousSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1132,9 +1072,9 @@ def previous_session_from_string(xml_string):
class ResumeSession(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ResumeSession element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ResumeSession element"""
- c_tag = 'ResumeSession'
+ c_tag = "ResumeSession"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1147,9 +1087,9 @@ def resume_session_from_string(xml_string):
class ZeroKnowledge(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ZeroKnowledge element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ZeroKnowledge element"""
- c_tag = 'ZeroKnowledge'
+ c_tag = "ZeroKnowledge"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1162,9 +1102,9 @@ def zero_knowledge_from_string(xml_string):
class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SharedSecretChallengeResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SharedSecretChallengeResponse element"""
- c_tag = 'SharedSecretChallengeResponse'
+ c_tag = "SharedSecretChallengeResponse"
c_namespace = NAMESPACE
c_children = SharedSecretChallengeResponseType_.c_children.copy()
c_attributes = SharedSecretChallengeResponseType_.c_attributes.copy()
@@ -1173,14 +1113,13 @@ class SharedSecretChallengeResponse(SharedSecretChallengeResponseType_):
def shared_secret_challenge_response_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretChallengeResponse,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretChallengeResponse, xml_string)
class DigSig(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:DigSig element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:DigSig element"""
- c_tag = 'DigSig'
+ c_tag = "DigSig"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1193,9 +1132,9 @@ def dig_sig_from_string(xml_string):
class AsymmetricDecryption(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AsymmetricDecryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AsymmetricDecryption element"""
- c_tag = 'AsymmetricDecryption'
+ c_tag = "AsymmetricDecryption"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1208,9 +1147,9 @@ def asymmetric_decryption_from_string(xml_string):
class AsymmetricKeyAgreement(PublicKeyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AsymmetricKeyAgreement element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AsymmetricKeyAgreement element"""
- c_tag = 'AsymmetricKeyAgreement'
+ c_tag = "AsymmetricKeyAgreement"
c_namespace = NAMESPACE
c_children = PublicKeyType_.c_children.copy()
c_attributes = PublicKeyType_.c_attributes.copy()
@@ -1219,14 +1158,13 @@ class AsymmetricKeyAgreement(PublicKeyType_):
def asymmetric_key_agreement_from_string(xml_string):
- return saml2.create_class_from_xml_string(AsymmetricKeyAgreement,
- xml_string)
+ return saml2.create_class_from_xml_string(AsymmetricKeyAgreement, xml_string)
class IPAddress(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:IPAddress element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:IPAddress element"""
- c_tag = 'IPAddress'
+ c_tag = "IPAddress"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1239,9 +1177,9 @@ def ip_address_from_string(xml_string):
class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SharedSecretDynamicPlaintext element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SharedSecretDynamicPlaintext element"""
- c_tag = 'SharedSecretDynamicPlaintext'
+ c_tag = "SharedSecretDynamicPlaintext"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1250,14 +1188,13 @@ class SharedSecretDynamicPlaintext(ExtensionOnlyType_):
def shared_secret_dynamic_plaintext_from_string(xml_string):
- return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext,
- xml_string)
+ return saml2.create_class_from_xml_string(SharedSecretDynamicPlaintext, xml_string)
class HTTP(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:HTTP element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:HTTP element"""
- c_tag = 'HTTP'
+ c_tag = "HTTP"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1270,9 +1207,9 @@ def http_from_string(xml_string):
class IPSec(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:IPSec element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:IPSec element"""
- c_tag = 'IPSec'
+ c_tag = "IPSec"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1285,9 +1222,9 @@ def ip_sec_from_string(xml_string):
class WTLS(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:WTLS element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:WTLS element"""
- c_tag = 'WTLS'
+ c_tag = "WTLS"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1300,9 +1237,9 @@ def wtls_from_string(xml_string):
class MobileNetworkNoEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:MobileNetworkNoEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:MobileNetworkNoEncryption element"""
- c_tag = 'MobileNetworkNoEncryption'
+ c_tag = "MobileNetworkNoEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1311,14 +1248,13 @@ class MobileNetworkNoEncryption(ExtensionOnlyType_):
def mobile_network_no_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkNoEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkNoEncryption, xml_string)
class MobileNetworkRadioEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:MobileNetworkRadioEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:MobileNetworkRadioEncryption element"""
- c_tag = 'MobileNetworkRadioEncryption'
+ c_tag = "MobileNetworkRadioEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1327,14 +1263,13 @@ class MobileNetworkRadioEncryption(ExtensionOnlyType_):
def mobile_network_radio_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkRadioEncryption, xml_string)
class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:MobileNetworkEndToEndEncryption element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:MobileNetworkEndToEndEncryption element"""
- c_tag = 'MobileNetworkEndToEndEncryption'
+ c_tag = "MobileNetworkEndToEndEncryption"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1343,14 +1278,13 @@ class MobileNetworkEndToEndEncryption(ExtensionOnlyType_):
def mobile_network_end_to_end_encryption_from_string(xml_string):
- return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption,
- xml_string)
+ return saml2.create_class_from_xml_string(MobileNetworkEndToEndEncryption, xml_string)
class SSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SSL element"""
- c_tag = 'SSL'
+ c_tag = "SSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1363,9 +1297,9 @@ def ssl_from_string(xml_string):
class PSTN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PSTN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PSTN element"""
- c_tag = 'PSTN'
+ c_tag = "PSTN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1378,9 +1312,9 @@ def pstn_from_string(xml_string):
class ISDN(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ISDN element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ISDN element"""
- c_tag = 'ISDN'
+ c_tag = "ISDN"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1393,9 +1327,9 @@ def isdn_from_string(xml_string):
class ADSL(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ADSL element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ADSL element"""
- c_tag = 'ADSL'
+ c_tag = "ADSL"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1408,9 +1342,9 @@ def adsl_from_string(xml_string):
class SwitchAudit(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SwitchAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SwitchAudit element"""
- c_tag = 'SwitchAudit'
+ c_tag = "SwitchAudit"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1423,9 +1357,9 @@ def switch_audit_from_string(xml_string):
class DeactivationCallCenter(ExtensionOnlyType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:DeactivationCallCenter element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:DeactivationCallCenter element"""
- c_tag = 'DeactivationCallCenter'
+ c_tag = "DeactivationCallCenter"
c_namespace = NAMESPACE
c_children = ExtensionOnlyType_.c_children.copy()
c_attributes = ExtensionOnlyType_.c_attributes.copy()
@@ -1434,54 +1368,54 @@ class DeactivationCallCenter(ExtensionOnlyType_):
def deactivation_call_center_from_string(xml_string):
- return saml2.create_class_from_xml_string(DeactivationCallCenter,
- xml_string)
+ return saml2.create_class_from_xml_string(DeactivationCallCenter, xml_string)
class IdentificationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:IdentificationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:IdentificationType element"""
- c_tag = 'IdentificationType'
+ c_tag = "IdentificationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PhysicalVerification'] = (
- 'physical_verification', PhysicalVerification)
- c_cardinality['physical_verification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}WrittenConsent'] = (
- 'written_consent', WrittenConsent)
- c_cardinality['written_consent'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['nym'] = ('nym', NymType_, False)
- c_child_order.extend(
- ['physical_verification', 'written_consent', 'governing_agreements',
- 'extension'])
-
- def __init__(self,
- physical_verification=None,
- written_consent=None,
- governing_agreements=None,
- extension=None,
- nym=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PhysicalVerification"] = (
+ "physical_verification",
+ PhysicalVerification,
+ )
+ c_cardinality["physical_verification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}WrittenConsent"] = (
+ "written_consent",
+ WrittenConsent,
+ )
+ c_cardinality["written_consent"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["nym"] = ("nym", NymType_, False)
+ c_child_order.extend(["physical_verification", "written_consent", "governing_agreements", "extension"])
+
+ def __init__(
+ self,
+ physical_verification=None,
+ written_consent=None,
+ governing_agreements=None,
+ extension=None,
+ nym=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.physical_verification = physical_verification
self.written_consent = written_consent
@@ -1495,77 +1429,83 @@ def identification_type__from_string(xml_string):
class AuthenticatorTransportProtocolType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticatorTransportProtocolType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticatorTransportProtocolType element"""
- c_tag = 'AuthenticatorTransportProtocolType'
+ c_tag = "AuthenticatorTransportProtocolType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}HTTP'] = (
- 'http', HTTP)
- c_cardinality['http'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SSL'] = (
- 'ssl', SSL)
- c_cardinality['ssl'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}MobileNetworkNoEncryption'] = (
- 'mobile_network_no_encryption', MobileNetworkNoEncryption)
- c_cardinality['mobile_network_no_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}MobileNetworkRadioEncryption'] = (
- 'mobile_network_radio_encryption', MobileNetworkRadioEncryption)
- c_cardinality['mobile_network_radio_encryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}MobileNetworkEndToEndEncryption'] = (
- 'mobile_network_end_to_end_encryption', MobileNetworkEndToEndEncryption)
- c_cardinality['mobile_network_end_to_end_encryption'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}WTLS'] = (
- 'wtls', WTLS)
- c_cardinality['wtls'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}IPSec'] = (
- 'ip_sec', IPSec)
- c_cardinality['ip_sec'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PSTN'] = (
- 'pstn', PSTN)
- c_cardinality['pstn'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ISDN'] = (
- 'isdn', ISDN)
- c_cardinality['isdn'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ADSL'] = (
- 'adsl', ADSL)
- c_cardinality['adsl'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['http', 'ssl', 'mobile_network_no_encryption',
- 'mobile_network_radio_encryption',
- 'mobile_network_end_to_end_encryption', 'wtls',
- 'ip_sec', 'pstn', 'isdn', 'adsl', 'extension'])
-
- def __init__(self,
- http=None,
- ssl=None,
- mobile_network_no_encryption=None,
- mobile_network_radio_encryption=None,
- mobile_network_end_to_end_encryption=None,
- wtls=None,
- ip_sec=None,
- pstn=None,
- isdn=None,
- adsl=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}HTTP"] = ("http", HTTP)
+ c_cardinality["http"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SSL"] = ("ssl", SSL)
+ c_cardinality["ssl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}MobileNetworkNoEncryption"] = (
+ "mobile_network_no_encryption",
+ MobileNetworkNoEncryption,
+ )
+ c_cardinality["mobile_network_no_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}MobileNetworkRadioEncryption"] = (
+ "mobile_network_radio_encryption",
+ MobileNetworkRadioEncryption,
+ )
+ c_cardinality["mobile_network_radio_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}MobileNetworkEndToEndEncryption"] = (
+ "mobile_network_end_to_end_encryption",
+ MobileNetworkEndToEndEncryption,
+ )
+ c_cardinality["mobile_network_end_to_end_encryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}WTLS"] = ("wtls", WTLS)
+ c_cardinality["wtls"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}IPSec"] = ("ip_sec", IPSec)
+ c_cardinality["ip_sec"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PSTN"] = ("pstn", PSTN)
+ c_cardinality["pstn"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ISDN"] = ("isdn", ISDN)
+ c_cardinality["isdn"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ADSL"] = ("adsl", ADSL)
+ c_cardinality["adsl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ [
+ "http",
+ "ssl",
+ "mobile_network_no_encryption",
+ "mobile_network_radio_encryption",
+ "mobile_network_end_to_end_encryption",
+ "wtls",
+ "ip_sec",
+ "pstn",
+ "isdn",
+ "adsl",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ http=None,
+ ssl=None,
+ mobile_network_no_encryption=None,
+ mobile_network_radio_encryption=None,
+ mobile_network_end_to_end_encryption=None,
+ wtls=None,
+ ip_sec=None,
+ pstn=None,
+ isdn=None,
+ adsl=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.http = http
self.ssl = ssl
@@ -1581,14 +1521,13 @@ class AuthenticatorTransportProtocolType_(SamlBase):
def authenticator_transport_protocol_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(
- AuthenticatorTransportProtocolType_, xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocolType_, xml_string)
class RestrictedPassword(RestrictedPasswordType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:RestrictedPassword element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:RestrictedPassword element"""
- c_tag = 'RestrictedPassword'
+ c_tag = "RestrictedPassword"
c_namespace = NAMESPACE
c_children = RestrictedPasswordType_.c_children.copy()
c_attributes = RestrictedPasswordType_.c_attributes.copy()
@@ -1601,51 +1540,45 @@ def restricted_password_from_string(xml_string):
class ActivationPinType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationPinType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationPinType element"""
- c_tag = 'ActivationPinType'
+ c_tag = "ActivationPinType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Length'] = (
- 'length', Length)
- c_cardinality['length'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Alphabet'] = (
- 'alphabet', Alphabet)
- c_cardinality['alphabet'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Generation'] = (
- 'generation', Generation)
- c_cardinality['generation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimit'] = (
- 'activation_limit', ActivationLimit)
- c_cardinality['activation_limit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['length', 'alphabet', 'generation', 'activation_limit', 'extension'])
-
- def __init__(self,
- length=None,
- alphabet=None,
- generation=None,
- activation_limit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Length"] = ("length", Length)
+ c_cardinality["length"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Alphabet"] = ("alphabet", Alphabet)
+ c_cardinality["alphabet"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Generation"] = ("generation", Generation)
+ c_cardinality["generation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationLimit"] = (
+ "activation_limit",
+ ActivationLimit,
+ )
+ c_cardinality["activation_limit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["length", "alphabet", "generation", "activation_limit", "extension"])
+
+ def __init__(
+ self,
+ length=None,
+ alphabet=None,
+ generation=None,
+ activation_limit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.length = length
self.alphabet = alphabet
@@ -1659,35 +1592,33 @@ def activation_pin_type__from_string(xml_string):
class SecurityAuditType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecurityAuditType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecurityAuditType element"""
- c_tag = 'SecurityAuditType'
+ c_tag = "SecurityAuditType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SwitchAudit'] = (
- 'switch_audit', SwitchAudit)
- c_cardinality['switch_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['switch_audit', 'extension'])
-
- def __init__(self,
- switch_audit=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SwitchAudit"] = ("switch_audit", SwitchAudit)
+ c_cardinality["switch_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["switch_audit", "extension"])
+
+ def __init__(
+ self,
+ switch_audit=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.switch_audit = switch_audit
self.extension = extension or []
@@ -1698,9 +1629,9 @@ def security_audit_type__from_string(xml_string):
class Identification(IdentificationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Identification element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Identification element"""
- c_tag = 'Identification'
+ c_tag = "Identification"
c_namespace = NAMESPACE
c_children = IdentificationType_.c_children.copy()
c_attributes = IdentificationType_.c_attributes.copy()
@@ -1713,9 +1644,9 @@ def identification_from_string(xml_string):
class ActivationPin(ActivationPinType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationPin element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ActivationPin element"""
- c_tag = 'ActivationPin'
+ c_tag = "ActivationPin"
c_namespace = NAMESPACE
c_children = ActivationPinType_.c_children.copy()
c_attributes = ActivationPinType_.c_attributes.copy()
@@ -1728,9 +1659,9 @@ def activation_pin_from_string(xml_string):
class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticatorTransportProtocol element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticatorTransportProtocol element"""
- c_tag = 'AuthenticatorTransportProtocol'
+ c_tag = "AuthenticatorTransportProtocol"
c_namespace = NAMESPACE
c_children = AuthenticatorTransportProtocolType_.c_children.copy()
c_attributes = AuthenticatorTransportProtocolType_.c_attributes.copy()
@@ -1739,14 +1670,13 @@ class AuthenticatorTransportProtocol(AuthenticatorTransportProtocolType_):
def authenticator_transport_protocol_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorTransportProtocol, xml_string)
class SecurityAudit(SecurityAuditType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecurityAudit element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecurityAudit element"""
- c_tag = 'SecurityAudit'
+ c_tag = "SecurityAudit"
c_namespace = NAMESPACE
c_children = SecurityAuditType_.c_children.copy()
c_attributes = SecurityAuditType_.c_attributes.copy()
@@ -1759,41 +1689,42 @@ def security_audit_from_string(xml_string):
class OperationalProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:OperationalProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:OperationalProtectionType element"""
- c_tag = 'OperationalProtectionType'
+ c_tag = "OperationalProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SecurityAudit'] = (
- 'security_audit', SecurityAudit)
- c_cardinality['security_audit'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}DeactivationCallCenter'] = (
- 'deactivation_call_center', DeactivationCallCenter)
- c_cardinality['deactivation_call_center'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['security_audit', 'deactivation_call_center', 'extension'])
-
- def __init__(self,
- security_audit=None,
- deactivation_call_center=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SecurityAudit"] = (
+ "security_audit",
+ SecurityAudit,
+ )
+ c_cardinality["security_audit"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}DeactivationCallCenter"] = (
+ "deactivation_call_center",
+ DeactivationCallCenter,
+ )
+ c_cardinality["deactivation_call_center"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["security_audit", "deactivation_call_center", "extension"])
+
+ def __init__(
+ self,
+ security_audit=None,
+ deactivation_call_center=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.security_audit = security_audit
self.deactivation_call_center = deactivation_call_center
@@ -1801,40 +1732,40 @@ class OperationalProtectionType_(SamlBase):
def operational_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(OperationalProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(OperationalProtectionType_, xml_string)
class KeyActivationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeyActivationType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeyActivationType element"""
- c_tag = 'KeyActivationType'
+ c_tag = "KeyActivationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationPin'] = (
- 'activation_pin', ActivationPin)
- c_cardinality['activation_pin'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['activation_pin', 'extension'])
-
- def __init__(self,
- activation_pin=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ActivationPin"] = (
+ "activation_pin",
+ ActivationPin,
+ )
+ c_cardinality["activation_pin"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["activation_pin", "extension"])
+
+ def __init__(
+ self,
+ activation_pin=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.activation_pin = activation_pin
self.extension = extension or []
@@ -1845,9 +1776,9 @@ def key_activation_type__from_string(xml_string):
class KeyActivation(KeyActivationType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeyActivation element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:KeyActivation element"""
- c_tag = 'KeyActivation'
+ c_tag = "KeyActivation"
c_namespace = NAMESPACE
c_children = KeyActivationType_.c_children.copy()
c_attributes = KeyActivationType_.c_attributes.copy()
@@ -1860,9 +1791,9 @@ def key_activation_from_string(xml_string):
class OperationalProtection(OperationalProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:OperationalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:OperationalProtection element"""
- c_tag = 'OperationalProtection'
+ c_tag = "OperationalProtection"
c_namespace = NAMESPACE
c_children = OperationalProtectionType_.c_children.copy()
c_attributes = OperationalProtectionType_.c_attributes.copy()
@@ -1875,46 +1806,42 @@ def operational_protection_from_string(xml_string):
class PrivateKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrivateKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrivateKeyProtectionType element"""
- c_tag = 'PrivateKeyProtectionType'
+ c_tag = "PrivateKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeySharing'] = (
- 'key_sharing', KeySharing)
- c_cardinality['key_sharing'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['key_activation', 'key_storage', 'key_sharing', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- key_sharing=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyStorage"] = ("key_storage", KeyStorage)
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeySharing"] = ("key_sharing", KeySharing)
+ c_cardinality["key_sharing"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "key_sharing", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ key_sharing=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -1923,45 +1850,43 @@ class PrivateKeyProtectionType_(SamlBase):
def private_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(PrivateKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(PrivateKeyProtectionType_, xml_string)
class SecretKeyProtectionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecretKeyProtectionType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecretKeyProtectionType element"""
- c_tag = 'SecretKeyProtectionType'
+ c_tag = "SecretKeyProtectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyActivation'] = (
- 'key_activation', KeyActivation)
- c_cardinality['key_activation'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyStorage'] = (
- 'key_storage', KeyStorage)
- c_cardinality['key_storage'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['key_activation', 'key_storage', 'extension'])
-
- def __init__(self,
- key_activation=None,
- key_storage=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyActivation"] = (
+ "key_activation",
+ KeyActivation,
+ )
+ c_cardinality["key_activation"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}KeyStorage"] = ("key_storage", KeyStorage)
+ c_cardinality["key_storage"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["key_activation", "key_storage", "extension"])
+
+ def __init__(
+ self,
+ key_activation=None,
+ key_storage=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.key_activation = key_activation
self.key_storage = key_storage
@@ -1969,14 +1894,13 @@ class SecretKeyProtectionType_(SamlBase):
def secret_key_protection_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SecretKeyProtectionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SecretKeyProtectionType_, xml_string)
class SecretKeyProtection(SecretKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecretKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:SecretKeyProtection element"""
- c_tag = 'SecretKeyProtection'
+ c_tag = "SecretKeyProtection"
c_namespace = NAMESPACE
c_children = SecretKeyProtectionType_.c_children.copy()
c_attributes = SecretKeyProtectionType_.c_attributes.copy()
@@ -1989,9 +1913,9 @@ def secret_key_protection_from_string(xml_string):
class PrivateKeyProtection(PrivateKeyProtectionType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrivateKeyProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:PrivateKeyProtection element"""
- c_tag = 'PrivateKeyProtection'
+ c_tag = "PrivateKeyProtection"
c_namespace = NAMESPACE
c_children = PrivateKeyProtectionType_.c_children.copy()
c_attributes = PrivateKeyProtectionType_.c_attributes.copy()
@@ -2004,41 +1928,42 @@ def private_key_protection_from_string(xml_string):
class TechnicalProtectionBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TechnicalProtectionBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TechnicalProtectionBaseType element"""
- c_tag = 'TechnicalProtectionBaseType'
+ c_tag = "TechnicalProtectionBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PrivateKeyProtection'] = (
- 'private_key_protection', PrivateKeyProtection)
- c_cardinality['private_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SecretKeyProtection'] = (
- 'secret_key_protection', SecretKeyProtection)
- c_cardinality['secret_key_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(
- ['private_key_protection', 'secret_key_protection', 'extension'])
-
- def __init__(self,
- private_key_protection=None,
- secret_key_protection=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PrivateKeyProtection"] = (
+ "private_key_protection",
+ PrivateKeyProtection,
+ )
+ c_cardinality["private_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SecretKeyProtection"] = (
+ "secret_key_protection",
+ SecretKeyProtection,
+ )
+ c_cardinality["secret_key_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(["private_key_protection", "secret_key_protection", "extension"])
+
+ def __init__(
+ self,
+ private_key_protection=None,
+ secret_key_protection=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.private_key_protection = private_key_protection
self.secret_key_protection = secret_key_protection
@@ -2046,14 +1971,13 @@ class TechnicalProtectionBaseType_(SamlBase):
def technical_protection_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(TechnicalProtectionBaseType_, xml_string)
class TechnicalProtection(TechnicalProtectionBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TechnicalProtection element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TechnicalProtection element"""
- c_tag = 'TechnicalProtection'
+ c_tag = "TechnicalProtection"
c_namespace = NAMESPACE
c_children = TechnicalProtectionBaseType_.c_children.copy()
c_attributes = TechnicalProtectionBaseType_.c_attributes.copy()
@@ -2065,106 +1989,119 @@ def technical_protection_from_string(xml_string):
return saml2.create_class_from_xml_string(TechnicalProtection, xml_string)
-#..................
+# ..................
# ['ComplexAuthenticator', 'Authenticator', 'AuthnMethod', 'ComplexAuthenticatorType', 'AuthenticatorBaseType', 'AuthnContextDeclarationBaseType', 'AuthnMethodBaseType', 'AuthenticationContextDeclaration']
class ComplexAuthenticatorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ComplexAuthenticatorType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ComplexAuthenticatorType element"""
- c_tag = 'ComplexAuthenticatorType'
+ c_tag = "ComplexAuthenticatorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PreviousSession'] = (
- 'previous_session', PreviousSession)
- c_cardinality['previous_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ResumeSession'] = (
- 'resume_session', ResumeSession)
- c_cardinality['resume_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}DigSig'] = (
- 'dig_sig', DigSig)
- c_cardinality['dig_sig'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ZeroKnowledge'] = (
- 'zero_knowledge', ZeroKnowledge)
- c_cardinality['zero_knowledge'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}IPAddress'] = (
- 'ip_address', IPAddress)
- c_cardinality['ip_address'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricDecryption'] = (
- 'asymmetric_decryption', AsymmetricDecryption)
- c_cardinality['asymmetric_decryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricKeyAgreement'] = (
- 'asymmetric_key_agreement', AsymmetricKeyAgreement)
- c_cardinality['asymmetric_key_agreement'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SubscriberLineNumber'] = (
- 'subscriber_line_number', SubscriberLineNumber)
- c_cardinality['subscriber_line_number'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}UserSuffix'] = (
- 'user_suffix', UserSuffix)
- c_cardinality['user_suffix'] = {"min": 0, "max": 1}
- c_cardinality['complex_authenticator'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PreviousSession"] = (
+ "previous_session",
+ PreviousSession,
+ )
+ c_cardinality["previous_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ResumeSession"] = (
+ "resume_session",
+ ResumeSession,
+ )
+ c_cardinality["resume_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}DigSig"] = ("dig_sig", DigSig)
+ c_cardinality["dig_sig"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ZeroKnowledge"] = (
+ "zero_knowledge",
+ ZeroKnowledge,
+ )
+ c_cardinality["zero_knowledge"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}IPAddress"] = ("ip_address", IPAddress)
+ c_cardinality["ip_address"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricDecryption"] = (
+ "asymmetric_decryption",
+ AsymmetricDecryption,
+ )
+ c_cardinality["asymmetric_decryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricKeyAgreement"] = (
+ "asymmetric_key_agreement",
+ AsymmetricKeyAgreement,
+ )
+ c_cardinality["asymmetric_key_agreement"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SubscriberLineNumber"] = (
+ "subscriber_line_number",
+ SubscriberLineNumber,
+ )
+ c_cardinality["subscriber_line_number"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}UserSuffix"] = ("user_suffix", UserSuffix)
+ c_cardinality["user_suffix"] = {"min": 0, "max": 1}
+ c_cardinality["complex_authenticator"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
c_child_order.extend(
- ['previous_session', 'resume_session', 'dig_sig', 'password',
- 'restricted_password', 'zero_knowledge',
- 'shared_secret_challenge_response', 'shared_secret_dynamic_plaintext',
- 'ip_address', 'asymmetric_decryption', 'asymmetric_key_agreement',
- 'subscriber_line_number', 'user_suffix', 'complex_authenticator',
- 'extension'])
-
- def __init__(self,
- previous_session=None,
- resume_session=None,
- dig_sig=None,
- password=None,
- restricted_password=None,
- zero_knowledge=None,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- ip_address=None,
- asymmetric_decryption=None,
- asymmetric_key_agreement=None,
- subscriber_line_number=None,
- user_suffix=None,
- complex_authenticator=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "previous_session",
+ "resume_session",
+ "dig_sig",
+ "password",
+ "restricted_password",
+ "zero_knowledge",
+ "shared_secret_challenge_response",
+ "shared_secret_dynamic_plaintext",
+ "ip_address",
+ "asymmetric_decryption",
+ "asymmetric_key_agreement",
+ "subscriber_line_number",
+ "user_suffix",
+ "complex_authenticator",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ previous_session=None,
+ resume_session=None,
+ dig_sig=None,
+ password=None,
+ restricted_password=None,
+ zero_knowledge=None,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ ip_address=None,
+ asymmetric_decryption=None,
+ asymmetric_key_agreement=None,
+ subscriber_line_number=None,
+ user_suffix=None,
+ complex_authenticator=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.previous_session = previous_session
self.resume_session = resume_session
@@ -2184,14 +2121,13 @@ class ComplexAuthenticatorType_(SamlBase):
def complex_authenticator_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ComplexAuthenticatorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ComplexAuthenticatorType_, xml_string)
class ComplexAuthenticator(ComplexAuthenticatorType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ComplexAuthenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:ComplexAuthenticator element"""
- c_tag = 'ComplexAuthenticator'
+ c_tag = "ComplexAuthenticator"
c_namespace = NAMESPACE
c_children = ComplexAuthenticatorType_.c_children.copy()
c_attributes = ComplexAuthenticatorType_.c_attributes.copy()
@@ -2204,106 +2140,120 @@ def complex_authenticator_from_string(xml_string):
class AuthenticatorBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticatorBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticatorBaseType element"""
- c_tag = 'AuthenticatorBaseType'
+ c_tag = "AuthenticatorBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PreviousSession'] = (
- 'previous_session', PreviousSession)
- c_cardinality['previous_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ResumeSession'] = (
- 'resume_session', ResumeSession)
- c_cardinality['resume_session'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}DigSig'] = (
- 'dig_sig', DigSig)
- c_cardinality['dig_sig'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Password'] = (
- 'password', Password)
- c_cardinality['password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}RestrictedPassword'] = (
- 'restricted_password', RestrictedPassword)
- c_cardinality['restricted_password'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ZeroKnowledge'] = (
- 'zero_knowledge', ZeroKnowledge)
- c_cardinality['zero_knowledge'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretChallengeResponse'] = (
- 'shared_secret_challenge_response', SharedSecretChallengeResponse)
- c_cardinality['shared_secret_challenge_response'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretDynamicPlaintext'] = (
- 'shared_secret_dynamic_plaintext', SharedSecretDynamicPlaintext)
- c_cardinality['shared_secret_dynamic_plaintext'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}IPAddress'] = (
- 'ip_address', IPAddress)
- c_cardinality['ip_address'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricDecryption'] = (
- 'asymmetric_decryption', AsymmetricDecryption)
- c_cardinality['asymmetric_decryption'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricKeyAgreement'] = (
- 'asymmetric_key_agreement', AsymmetricKeyAgreement)
- c_cardinality['asymmetric_key_agreement'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SubscriberLineNumber'] = (
- 'subscriber_line_number', SubscriberLineNumber)
- c_cardinality['subscriber_line_number'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}UserSuffix'] = (
- 'user_suffix', UserSuffix)
- c_cardinality['user_suffix'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
- c_cardinality['complex_authenticator'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PreviousSession"] = (
+ "previous_session",
+ PreviousSession,
+ )
+ c_cardinality["previous_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ResumeSession"] = (
+ "resume_session",
+ ResumeSession,
+ )
+ c_cardinality["resume_session"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}DigSig"] = ("dig_sig", DigSig)
+ c_cardinality["dig_sig"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Password"] = ("password", Password)
+ c_cardinality["password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}RestrictedPassword"] = (
+ "restricted_password",
+ RestrictedPassword,
+ )
+ c_cardinality["restricted_password"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ZeroKnowledge"] = (
+ "zero_knowledge",
+ ZeroKnowledge,
+ )
+ c_cardinality["zero_knowledge"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretChallengeResponse"] = (
+ "shared_secret_challenge_response",
+ SharedSecretChallengeResponse,
+ )
+ c_cardinality["shared_secret_challenge_response"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SharedSecretDynamicPlaintext"] = (
+ "shared_secret_dynamic_plaintext",
+ SharedSecretDynamicPlaintext,
+ )
+ c_cardinality["shared_secret_dynamic_plaintext"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}IPAddress"] = ("ip_address", IPAddress)
+ c_cardinality["ip_address"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricDecryption"] = (
+ "asymmetric_decryption",
+ AsymmetricDecryption,
+ )
+ c_cardinality["asymmetric_decryption"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AsymmetricKeyAgreement"] = (
+ "asymmetric_key_agreement",
+ AsymmetricKeyAgreement,
+ )
+ c_cardinality["asymmetric_key_agreement"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}SubscriberLineNumber"] = (
+ "subscriber_line_number",
+ SubscriberLineNumber,
+ )
+ c_cardinality["subscriber_line_number"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}UserSuffix"] = ("user_suffix", UserSuffix)
+ c_cardinality["user_suffix"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+ )
+ c_cardinality["complex_authenticator"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
c_child_order.extend(
- ['previous_session', 'resume_session', 'dig_sig', 'password',
- 'restricted_password', 'zero_knowledge',
- 'shared_secret_challenge_response', 'shared_secret_dynamic_plaintext',
- 'ip_address', 'asymmetric_decryption', 'asymmetric_key_agreement',
- 'subscriber_line_number', 'user_suffix', 'complex_authenticator',
- 'extension'])
-
- def __init__(self,
- previous_session=None,
- resume_session=None,
- dig_sig=None,
- password=None,
- restricted_password=None,
- zero_knowledge=None,
- shared_secret_challenge_response=None,
- shared_secret_dynamic_plaintext=None,
- ip_address=None,
- asymmetric_decryption=None,
- asymmetric_key_agreement=None,
- subscriber_line_number=None,
- user_suffix=None,
- complex_authenticator=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "previous_session",
+ "resume_session",
+ "dig_sig",
+ "password",
+ "restricted_password",
+ "zero_knowledge",
+ "shared_secret_challenge_response",
+ "shared_secret_dynamic_plaintext",
+ "ip_address",
+ "asymmetric_decryption",
+ "asymmetric_key_agreement",
+ "subscriber_line_number",
+ "user_suffix",
+ "complex_authenticator",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ previous_session=None,
+ resume_session=None,
+ dig_sig=None,
+ password=None,
+ restricted_password=None,
+ zero_knowledge=None,
+ shared_secret_challenge_response=None,
+ shared_secret_dynamic_plaintext=None,
+ ip_address=None,
+ asymmetric_decryption=None,
+ asymmetric_key_agreement=None,
+ subscriber_line_number=None,
+ user_suffix=None,
+ complex_authenticator=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.previous_session = previous_session
self.resume_session = resume_session
@@ -2323,14 +2273,13 @@ class AuthenticatorBaseType_(SamlBase):
def authenticator_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatorBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatorBaseType_, xml_string)
class Authenticator(AuthenticatorBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Authenticator element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:Authenticator element"""
- c_tag = 'Authenticator'
+ c_tag = "Authenticator"
c_namespace = NAMESPACE
c_children = AuthenticatorBaseType_.c_children.copy()
c_attributes = AuthenticatorBaseType_.c_attributes.copy()
@@ -2343,45 +2292,46 @@ def authenticator_from_string(xml_string):
class AuthnMethodBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthnMethodBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthnMethodBaseType element"""
- c_tag = 'AuthnMethodBaseType'
+ c_tag = "AuthnMethodBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PrincipalAuthenticationMechanism'] = (
- 'principal_authentication_mechanism', PrincipalAuthenticationMechanism)
- c_cardinality['principal_authentication_mechanism'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Authenticator'] = (
- 'authenticator', Authenticator)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AuthenticatorTransportProtocol'] = (
- 'authenticator_transport_protocol', AuthenticatorTransportProtocol)
- c_cardinality['authenticator_transport_protocol'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_child_order.extend(['principal_authentication_mechanism', 'authenticator',
- 'authenticator_transport_protocol', 'extension'])
-
- def __init__(self,
- principal_authentication_mechanism=None,
- authenticator=None,
- authenticator_transport_protocol=None,
- extension=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}PrincipalAuthenticationMechanism"] = (
+ "principal_authentication_mechanism",
+ PrincipalAuthenticationMechanism,
+ )
+ c_cardinality["principal_authentication_mechanism"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Authenticator"] = ("authenticator", Authenticator)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AuthenticatorTransportProtocol"] = (
+ "authenticator_transport_protocol",
+ AuthenticatorTransportProtocol,
+ )
+ c_cardinality["authenticator_transport_protocol"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_child_order.extend(
+ ["principal_authentication_mechanism", "authenticator", "authenticator_transport_protocol", "extension"]
+ )
+
+ def __init__(
+ self,
+ principal_authentication_mechanism=None,
+ authenticator=None,
+ authenticator_transport_protocol=None,
+ extension=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.principal_authentication_mechanism = principal_authentication_mechanism
self.authenticator = authenticator
@@ -2394,9 +2344,9 @@ def authn_method_base_type__from_string(xml_string):
class AuthnMethod(AuthnMethodBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthnMethod element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthnMethod element"""
- c_tag = 'AuthnMethod'
+ c_tag = "AuthnMethod"
c_namespace = NAMESPACE
c_children = AuthnMethodBaseType_.c_children.copy()
c_attributes = AuthnMethodBaseType_.c_attributes.copy()
@@ -2409,58 +2359,67 @@ def authn_method_from_string(xml_string):
class AuthnContextDeclarationBaseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthnContextDeclarationBaseType element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthnContextDeclarationBaseType element"""
- c_tag = 'AuthnContextDeclarationBaseType'
+ c_tag = "AuthnContextDeclarationBaseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Identification'] = (
- 'identification', Identification)
- c_cardinality['identification'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}TechnicalProtection'] = (
- 'technical_protection', TechnicalProtection)
- c_cardinality['technical_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}OperationalProtection'] = (
- 'operational_protection', OperationalProtection)
- c_cardinality['operational_protection'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AuthnMethod'] = (
- 'authn_method', AuthnMethod)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}GoverningAgreements'] = (
- 'governing_agreements', GoverningAgreements)
- c_cardinality['governing_agreements'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension'] = (
- 'extension', [Extension])
- c_cardinality['extension'] = {"min": 0}
- c_attributes['ID'] = ('id', 'ID', False)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Identification"] = (
+ "identification",
+ Identification,
+ )
+ c_cardinality["identification"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}TechnicalProtection"] = (
+ "technical_protection",
+ TechnicalProtection,
+ )
+ c_cardinality["technical_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}OperationalProtection"] = (
+ "operational_protection",
+ OperationalProtection,
+ )
+ c_cardinality["operational_protection"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}AuthnMethod"] = ("authn_method", AuthnMethod)
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}GoverningAgreements"] = (
+ "governing_agreements",
+ GoverningAgreements,
+ )
+ c_cardinality["governing_agreements"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}Extension"] = ("extension", [Extension])
+ c_cardinality["extension"] = {"min": 0}
+ c_attributes["ID"] = ("id", "ID", False)
c_child_order.extend(
- ['identification', 'technical_protection', 'operational_protection',
- 'authn_method', 'governing_agreements', 'extension'])
-
- def __init__(self,
- identification=None,
- technical_protection=None,
- operational_protection=None,
- authn_method=None,
- governing_agreements=None,
- extension=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ [
+ "identification",
+ "technical_protection",
+ "operational_protection",
+ "authn_method",
+ "governing_agreements",
+ "extension",
+ ]
+ )
+
+ def __init__(
+ self,
+ identification=None,
+ technical_protection=None,
+ operational_protection=None,
+ authn_method=None,
+ governing_agreements=None,
+ extension=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.identification = identification
self.technical_protection = technical_protection
@@ -2472,14 +2431,13 @@ class AuthnContextDeclarationBaseType_(SamlBase):
def authn_context_declaration_base_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnContextDeclarationBaseType_, xml_string)
class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
- """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticationContextDeclaration element """
+ """The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:AuthenticationContextDeclaration element"""
- c_tag = 'AuthenticationContextDeclaration'
+ c_tag = "AuthenticationContextDeclaration"
c_namespace = NAMESPACE
c_children = AuthnContextDeclarationBaseType_.c_children.copy()
c_attributes = AuthnContextDeclarationBaseType_.c_attributes.copy()
@@ -2488,17 +2446,18 @@ class AuthenticationContextDeclaration(AuthnContextDeclarationBaseType_):
def authentication_context_declaration_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticationContextDeclaration,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticationContextDeclaration, xml_string)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-ComplexAuthenticatorType_.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
-ComplexAuthenticator.c_children[
- '{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ComplexAuthenticator'] = (
- 'complex_authenticator', ComplexAuthenticator)
+ComplexAuthenticatorType_.c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+)
+ComplexAuthenticator.c_children["{urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken}ComplexAuthenticator"] = (
+ "complex_authenticator",
+ ComplexAuthenticator,
+)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELEMENT_FROM_STRING = {
@@ -2598,102 +2557,101 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'AuthenticationContextDeclaration': AuthenticationContextDeclaration,
- 'Identification': Identification,
- 'PhysicalVerification': PhysicalVerification,
- 'WrittenConsent': WrittenConsent,
- 'TechnicalProtection': TechnicalProtection,
- 'SecretKeyProtection': SecretKeyProtection,
- 'PrivateKeyProtection': PrivateKeyProtection,
- 'KeyActivation': KeyActivation,
- 'KeySharing': KeySharing,
- 'KeyStorage': KeyStorage,
- 'SubscriberLineNumber': SubscriberLineNumber,
- 'UserSuffix': UserSuffix,
- 'Password': Password,
- 'ActivationPin': ActivationPin,
- 'Token': Token,
- 'TimeSyncToken': TimeSyncToken,
- 'Smartcard': Smartcard,
- 'Length': Length,
- 'ActivationLimit': ActivationLimit,
- 'Generation': Generation,
- 'AuthnMethod': AuthnMethod,
- 'PrincipalAuthenticationMechanism': PrincipalAuthenticationMechanism,
- 'Authenticator': Authenticator,
- 'ComplexAuthenticator': ComplexAuthenticator,
- 'PreviousSession': PreviousSession,
- 'ResumeSession': ResumeSession,
- 'ZeroKnowledge': ZeroKnowledge,
- 'SharedSecretChallengeResponse': SharedSecretChallengeResponse,
- 'SharedSecretChallengeResponseType': SharedSecretChallengeResponseType_,
- 'DigSig': DigSig,
- 'AsymmetricDecryption': AsymmetricDecryption,
- 'AsymmetricKeyAgreement': AsymmetricKeyAgreement,
- 'PublicKeyType': PublicKeyType_,
- 'IPAddress': IPAddress,
- 'SharedSecretDynamicPlaintext': SharedSecretDynamicPlaintext,
- 'AuthenticatorTransportProtocol': AuthenticatorTransportProtocol,
- 'HTTP': HTTP,
- 'IPSec': IPSec,
- 'WTLS': WTLS,
- 'MobileNetworkNoEncryption': MobileNetworkNoEncryption,
- 'MobileNetworkRadioEncryption': MobileNetworkRadioEncryption,
- 'MobileNetworkEndToEndEncryption': MobileNetworkEndToEndEncryption,
- 'SSL': SSL,
- 'PSTN': PSTN,
- 'ISDN': ISDN,
- 'ADSL': ADSL,
- 'OperationalProtection': OperationalProtection,
- 'SecurityAudit': SecurityAudit,
- 'SwitchAudit': SwitchAudit,
- 'DeactivationCallCenter': DeactivationCallCenter,
- 'GoverningAgreements': GoverningAgreements,
- 'GoverningAgreementRef': GoverningAgreementRef,
- 'nymType': NymType_,
- 'IdentificationType': IdentificationType_,
- 'TechnicalProtectionBaseType': TechnicalProtectionBaseType_,
- 'OperationalProtectionType': OperationalProtectionType_,
- 'GoverningAgreementsType': GoverningAgreementsType_,
- 'GoverningAgreementRefType': GoverningAgreementRefType_,
- 'AuthenticatorBaseType': AuthenticatorBaseType_,
- 'ComplexAuthenticatorType': ComplexAuthenticatorType_,
- 'AuthenticatorTransportProtocolType': AuthenticatorTransportProtocolType_,
- 'KeyActivationType': KeyActivationType_,
- 'KeySharingType': KeySharingType_,
- 'PrivateKeyProtectionType': PrivateKeyProtectionType_,
- 'PasswordType': PasswordType_,
- 'RestrictedPassword': RestrictedPassword,
- 'RestrictedPasswordType': RestrictedPasswordType_,
- 'RestrictedLengthType': RestrictedLengthType_,
- 'ActivationPinType': ActivationPinType_,
- 'Alphabet': Alphabet,
- 'AlphabetType': AlphabetType_,
- 'DeviceTypeType': DeviceTypeType_,
- 'booleanType': BooleanType_,
- 'ActivationLimitType': ActivationLimitType_,
- 'ActivationLimitDuration': ActivationLimitDuration,
- 'ActivationLimitUsages': ActivationLimitUsages,
- 'ActivationLimitSession': ActivationLimitSession,
- 'ActivationLimitDurationType': ActivationLimitDurationType_,
- 'ActivationLimitUsagesType': ActivationLimitUsagesType_,
- 'ActivationLimitSessionType': ActivationLimitSessionType_,
- 'LengthType': LengthType_,
- 'mediumType': MediumType_,
- 'KeyStorageType': KeyStorageType_,
- 'SecretKeyProtectionType': SecretKeyProtectionType_,
- 'SecurityAuditType': SecurityAuditType_,
- 'ExtensionOnlyType': ExtensionOnlyType_,
- 'Extension': Extension,
- 'ExtensionType': ExtensionType_,
- 'AuthnContextDeclarationBaseType': AuthnContextDeclarationBaseType_,
- 'AuthnMethodBaseType': AuthnMethodBaseType_,
- 'PrincipalAuthenticationMechanismType': PrincipalAuthenticationMechanismType_,
- 'TokenType': TokenType_,
- 'TimeSyncTokenType': TimeSyncTokenType_,
+ "AuthenticationContextDeclaration": AuthenticationContextDeclaration,
+ "Identification": Identification,
+ "PhysicalVerification": PhysicalVerification,
+ "WrittenConsent": WrittenConsent,
+ "TechnicalProtection": TechnicalProtection,
+ "SecretKeyProtection": SecretKeyProtection,
+ "PrivateKeyProtection": PrivateKeyProtection,
+ "KeyActivation": KeyActivation,
+ "KeySharing": KeySharing,
+ "KeyStorage": KeyStorage,
+ "SubscriberLineNumber": SubscriberLineNumber,
+ "UserSuffix": UserSuffix,
+ "Password": Password,
+ "ActivationPin": ActivationPin,
+ "Token": Token,
+ "TimeSyncToken": TimeSyncToken,
+ "Smartcard": Smartcard,
+ "Length": Length,
+ "ActivationLimit": ActivationLimit,
+ "Generation": Generation,
+ "AuthnMethod": AuthnMethod,
+ "PrincipalAuthenticationMechanism": PrincipalAuthenticationMechanism,
+ "Authenticator": Authenticator,
+ "ComplexAuthenticator": ComplexAuthenticator,
+ "PreviousSession": PreviousSession,
+ "ResumeSession": ResumeSession,
+ "ZeroKnowledge": ZeroKnowledge,
+ "SharedSecretChallengeResponse": SharedSecretChallengeResponse,
+ "SharedSecretChallengeResponseType": SharedSecretChallengeResponseType_,
+ "DigSig": DigSig,
+ "AsymmetricDecryption": AsymmetricDecryption,
+ "AsymmetricKeyAgreement": AsymmetricKeyAgreement,
+ "PublicKeyType": PublicKeyType_,
+ "IPAddress": IPAddress,
+ "SharedSecretDynamicPlaintext": SharedSecretDynamicPlaintext,
+ "AuthenticatorTransportProtocol": AuthenticatorTransportProtocol,
+ "HTTP": HTTP,
+ "IPSec": IPSec,
+ "WTLS": WTLS,
+ "MobileNetworkNoEncryption": MobileNetworkNoEncryption,
+ "MobileNetworkRadioEncryption": MobileNetworkRadioEncryption,
+ "MobileNetworkEndToEndEncryption": MobileNetworkEndToEndEncryption,
+ "SSL": SSL,
+ "PSTN": PSTN,
+ "ISDN": ISDN,
+ "ADSL": ADSL,
+ "OperationalProtection": OperationalProtection,
+ "SecurityAudit": SecurityAudit,
+ "SwitchAudit": SwitchAudit,
+ "DeactivationCallCenter": DeactivationCallCenter,
+ "GoverningAgreements": GoverningAgreements,
+ "GoverningAgreementRef": GoverningAgreementRef,
+ "nymType": NymType_,
+ "IdentificationType": IdentificationType_,
+ "TechnicalProtectionBaseType": TechnicalProtectionBaseType_,
+ "OperationalProtectionType": OperationalProtectionType_,
+ "GoverningAgreementsType": GoverningAgreementsType_,
+ "GoverningAgreementRefType": GoverningAgreementRefType_,
+ "AuthenticatorBaseType": AuthenticatorBaseType_,
+ "ComplexAuthenticatorType": ComplexAuthenticatorType_,
+ "AuthenticatorTransportProtocolType": AuthenticatorTransportProtocolType_,
+ "KeyActivationType": KeyActivationType_,
+ "KeySharingType": KeySharingType_,
+ "PrivateKeyProtectionType": PrivateKeyProtectionType_,
+ "PasswordType": PasswordType_,
+ "RestrictedPassword": RestrictedPassword,
+ "RestrictedPasswordType": RestrictedPasswordType_,
+ "RestrictedLengthType": RestrictedLengthType_,
+ "ActivationPinType": ActivationPinType_,
+ "Alphabet": Alphabet,
+ "AlphabetType": AlphabetType_,
+ "DeviceTypeType": DeviceTypeType_,
+ "booleanType": BooleanType_,
+ "ActivationLimitType": ActivationLimitType_,
+ "ActivationLimitDuration": ActivationLimitDuration,
+ "ActivationLimitUsages": ActivationLimitUsages,
+ "ActivationLimitSession": ActivationLimitSession,
+ "ActivationLimitDurationType": ActivationLimitDurationType_,
+ "ActivationLimitUsagesType": ActivationLimitUsagesType_,
+ "ActivationLimitSessionType": ActivationLimitSessionType_,
+ "LengthType": LengthType_,
+ "mediumType": MediumType_,
+ "KeyStorageType": KeyStorageType_,
+ "SecretKeyProtectionType": SecretKeyProtectionType_,
+ "SecurityAuditType": SecurityAuditType_,
+ "ExtensionOnlyType": ExtensionOnlyType_,
+ "Extension": Extension,
+ "ExtensionType": ExtensionType_,
+ "AuthnContextDeclarationBaseType": AuthnContextDeclarationBaseType_,
+ "AuthnMethodBaseType": AuthnMethodBaseType_,
+ "PrincipalAuthenticationMechanismType": PrincipalAuthenticationMechanismType_,
+ "TokenType": TokenType_,
+ "TimeSyncTokenType": TimeSyncTokenType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/cache.py b/src/saml2/cache.py
index c93a160a..dab91546 100644
--- a/src/saml2/cache.py
+++ b/src/saml2/cache.py
@@ -1,10 +1,15 @@
#!/usr/bin/env python
+import logging
import shelve
+
import six
-from saml2.ident import code, decode
-from saml2 import time_util, SAMLError
-import logging
+
+from saml2 import SAMLError
+from saml2 import time_util
+from saml2.ident import code
+from saml2.ident import decode
+
logger = logging.getLogger(__name__)
@@ -47,9 +52,8 @@ class Cache(object):
except AttributeError:
pass
- def get_identity(self, name_id, entities=None,
- check_not_on_or_after=True):
- """ Get all the identity information that has been received and
+ def get_identity(self, name_id, entities=None, check_not_on_or_after=True):
+ """Get all the identity information that has been received and
are still valid about the subject.
:param name_id: The subject identifier, a NameID instance
@@ -88,7 +92,7 @@ class Cache(object):
return res, oldees
def get(self, name_id, entity_id, check_not_on_or_after=True):
- """ Get session information about a subject gotten from a
+ """Get session information about a subject gotten from a
specified IdP/AA.
:param name_id: The subject identifier, a NameID instance
@@ -104,12 +108,12 @@ class Cache(object):
if check_not_on_or_after and time_util.after(timestamp):
raise TooOld("past %s" % str(timestamp))
- if 'name_id' in info and isinstance(info['name_id'], six.string_types):
- info['name_id'] = decode(info['name_id'])
+ if "name_id" in info and isinstance(info["name_id"], six.string_types):
+ info["name_id"] = decode(info["name_id"])
return info or None
def set(self, name_id, entity_id, info, not_on_or_after=0):
- """ Stores session information in the cache. Assumes that the name_id
+ """Stores session information in the cache. Assumes that the name_id
is unique within the context of the Service Provider.
:param name_id: The subject identifier, a NameID instance
@@ -119,9 +123,9 @@ class Cache(object):
:param not_on_or_after: A time after which the assertion is not valid.
"""
info = dict(info)
- if 'name_id' in info and not isinstance(info['name_id'], six.string_types):
+ if "name_id" in info and not isinstance(info["name_id"], six.string_types):
# make friendly to (JSON) serialization
- info['name_id'] = code(name_id)
+ info["name_id"] = code(name_id)
cni = code(name_id)
if cni not in self._db:
@@ -135,7 +139,7 @@ class Cache(object):
pass
def reset(self, name_id, entity_id):
- """ Scrap the assertions received from a IdP or an AA about a special
+ """Scrap the assertions received from a IdP or an AA about a special
subject.
:param name_id: The subject identifier, a NameID instance
@@ -145,7 +149,7 @@ class Cache(object):
self.set(name_id, entity_id, {}, 0)
def entities(self, name_id):
- """ Returns all the entities of assertions for a subject, disregarding
+ """Returns all the entities of assertions for a subject, disregarding
whether the assertion still is valid or not.
:param name_id: The subject identifier, a NameID instance
@@ -155,12 +159,12 @@ class Cache(object):
return list(self._db[cni].keys())
def receivers(self, name_id):
- """ Another name for entities() just to make it more logic in the IdP
- scenario """
+ """Another name for entities() just to make it more logic in the IdP
+ scenario"""
return self.entities(name_id)
def active(self, name_id, entity_id):
- """ Returns the status of assertions from a specific entity_id.
+ """Returns the status of assertions from a specific entity_id.
:param name_id: The ID of the subject
:param entity_id: The entity ID of the entity_id of the assertion
@@ -179,7 +183,7 @@ class Cache(object):
return time_util.not_on_or_after(timestamp)
def subjects(self):
- """ Return identifiers for all the subjects that are in the cache.
+ """Return identifiers for all the subjects that are in the cache.
:return: list of subject identifiers
"""
diff --git a/src/saml2/cert.py b/src/saml2/cert.py
index aeb5b662..395c8e06 100644
--- a/src/saml2/cert.py
+++ b/src/saml2/cert.py
@@ -1,14 +1,14 @@
-__author__ = 'haho0032'
+__author__ = "haho0032"
import base64
import datetime
-import dateutil.parser
-import pytz
-import six
from os import remove
from os.path import join
from OpenSSL import crypto
+import dateutil.parser
+import pytz
+import six
import saml2.cryptography.pki
@@ -29,10 +29,19 @@ class OpenSSLWrapper(object):
def __init__(self):
pass
- def create_certificate(self, cert_info, request=False, valid_from=0,
- valid_to=315360000, sn=1, key_length=1024,
- hash_alg="sha256", write_to_file=False, cert_dir="",
- cipher_passphrase=None):
+ def create_certificate(
+ self,
+ cert_info,
+ request=False,
+ valid_from=0,
+ valid_to=315360000,
+ sn=1,
+ key_length=1024,
+ hash_alg="sha256",
+ write_to_file=False,
+ cert_dir="",
+ cipher_passphrase=None,
+ ):
"""
Can create certificate requests, to be signed later by another
certificate with the method
@@ -122,7 +131,6 @@ class OpenSSLWrapper(object):
c_f = join(cert_dir, cert_file)
k_f = join(cert_dir, key_file)
-
# create a key pair
k = crypto.PKey()
k.generate_key(crypto.TYPE_RSA, key_length)
@@ -133,7 +141,7 @@ class OpenSSLWrapper(object):
if request:
cert = crypto.X509Req()
- if (len(cert_info["country_code"]) != 2):
+ if len(cert_info["country_code"]) != 2:
raise WrongInput("Country code must be two letters!")
cert.get_subject().C = cert_info["country_code"]
cert.get_subject().ST = cert_info["state"]
@@ -143,45 +151,41 @@ class OpenSSLWrapper(object):
cert.get_subject().CN = cn
if not request:
cert.set_serial_number(sn)
- cert.gmtime_adj_notBefore(valid_from) #Valid before present time
- cert.gmtime_adj_notAfter(valid_to) #3 650 days
+ cert.gmtime_adj_notBefore(valid_from) # Valid before present time
+ cert.gmtime_adj_notAfter(valid_to) # 3 650 days
cert.set_issuer(cert.get_subject())
cert.set_pubkey(k)
cert.sign(k, hash_alg)
try:
if request:
- tmp_cert = crypto.dump_certificate_request(crypto.FILETYPE_PEM,
- cert)
+ tmp_cert = crypto.dump_certificate_request(crypto.FILETYPE_PEM, cert)
else:
tmp_cert = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
tmp_key = None
if cipher_passphrase is not None:
passphrase = cipher_passphrase["passphrase"]
- if isinstance(cipher_passphrase["passphrase"],
- six.string_types):
- passphrase = passphrase.encode('utf-8')
- tmp_key = crypto.dump_privatekey(crypto.FILETYPE_PEM, k,
- cipher_passphrase["cipher"],
- passphrase)
+ if isinstance(cipher_passphrase["passphrase"], six.string_types):
+ passphrase = passphrase.encode("utf-8")
+ tmp_key = crypto.dump_privatekey(crypto.FILETYPE_PEM, k, cipher_passphrase["cipher"], passphrase)
else:
tmp_key = crypto.dump_privatekey(crypto.FILETYPE_PEM, k)
if write_to_file:
- with open(c_f, 'wt') as fc:
- fc.write(tmp_cert.decode('utf-8'))
- with open(k_f, 'wt') as fk:
- fk.write(tmp_key.decode('utf-8'))
+ with open(c_f, "wt") as fc:
+ fc.write(tmp_cert.decode("utf-8"))
+ with open(k_f, "wt") as fk:
+ fk.write(tmp_key.decode("utf-8"))
return c_f, k_f
return tmp_cert, tmp_key
except Exception as ex:
raise CertificateError("Certificate cannot be generated.", ex)
def write_str_to_file(self, file, str_data):
- with open(file, 'wt') as f:
+ with open(file, "wt") as f:
f.write(str_data)
def read_str_from_file(self, file, type="pem"):
- with open(file, 'rb') as f:
+ with open(file, "rb") as f:
str_data = f.read()
if type == "pem":
@@ -190,11 +194,17 @@ class OpenSSLWrapper(object):
if type in ["der", "cer", "crt"]:
return base64.b64encode(str(str_data))
-
- def create_cert_signed_certificate(self, sign_cert_str, sign_key_str,
- request_cert_str, hash_alg="sha256",
- valid_from=0, valid_to=315360000, sn=1,
- passphrase=None):
+ def create_cert_signed_certificate(
+ self,
+ sign_cert_str,
+ sign_key_str,
+ request_cert_str,
+ hash_alg="sha256",
+ valid_from=0,
+ valid_to=315360000,
+ sn=1,
+ passphrase=None,
+ ):
"""
Will sign a certificate request with a give certificate.
@@ -231,12 +241,10 @@ class OpenSSLWrapper(object):
ca_cert = crypto.load_certificate(crypto.FILETYPE_PEM, sign_cert_str)
ca_key = None
if passphrase is not None:
- ca_key = crypto.load_privatekey(crypto.FILETYPE_PEM, sign_key_str,
- passphrase)
+ ca_key = crypto.load_privatekey(crypto.FILETYPE_PEM, sign_key_str, passphrase)
else:
ca_key = crypto.load_privatekey(crypto.FILETYPE_PEM, sign_key_str)
- req_cert = crypto.load_certificate_request(crypto.FILETYPE_PEM,
- request_cert_str)
+ req_cert = crypto.load_certificate_request(crypto.FILETYPE_PEM, request_cert_str)
cert = crypto.X509()
cert.set_subject(req_cert.get_subject())
@@ -250,7 +258,7 @@ class OpenSSLWrapper(object):
cert_dump = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
if isinstance(cert_dump, six.string_types):
return cert_dump
- return cert_dump.decode('utf-8')
+ return cert_dump.decode("utf-8")
def verify_chain(self, cert_chain_str_list, cert_str):
"""
@@ -267,9 +275,7 @@ class OpenSSLWrapper(object):
return False, message
else:
cert_str = tmp_cert_str
- return (True,
- "Signed certificate is valid and correctly signed by CA "
- "certificate.")
+ return (True, "Signed certificate is valid and correctly signed by CA " "certificate.")
def certificate_not_valid_yet(self, cert):
starts_to_be_valid = dateutil.parser.parse(cert.get_notBefore())
@@ -278,7 +284,6 @@ class OpenSSLWrapper(object):
return False
return True
-
def verify(self, signing_cert_str, cert_str):
"""
Verifies if a certificate is valid and signed by a given certificate.
@@ -299,8 +304,7 @@ class OpenSSLWrapper(object):
Message = Why the validation failed.
"""
try:
- ca_cert = crypto.load_certificate(crypto.FILETYPE_PEM,
- signing_cert_str)
+ ca_cert = crypto.load_certificate(crypto.FILETYPE_PEM, signing_cert_str)
cert = crypto.load_certificate(crypto.FILETYPE_PEM, cert_str)
if self.certificate_not_valid_yet(ca_cert):
@@ -316,20 +320,17 @@ class OpenSSLWrapper(object):
return False, "The signed certificate is not valid yet."
if ca_cert.get_subject().CN == cert.get_subject().CN:
- return False, ("CN may not be equal for CA certificate and the "
- "signed certificate.")
+ return False, ("CN may not be equal for CA certificate and the " "signed certificate.")
cert_algorithm = cert.get_signature_algorithm()
if six.PY3:
- cert_algorithm = cert_algorithm.decode('ascii')
- cert_str = cert_str.encode('ascii')
+ cert_algorithm = cert_algorithm.decode("ascii")
+ cert_str = cert_str.encode("ascii")
cert_crypto = saml2.cryptography.pki.load_pem_x509_certificate(cert_str)
try:
- crypto.verify(ca_cert, cert_crypto.signature,
- cert_crypto.tbs_certificate_bytes,
- cert_algorithm)
+ crypto.verify(ca_cert, cert_crypto.signature, cert_crypto.tbs_certificate_bytes, cert_algorithm)
return True, "Signed certificate is valid and correctly signed by CA certificate."
except crypto.Error as e:
return False, "Certificate is incorrectly signed."
diff --git a/src/saml2/client.py b/src/saml2/client.py
index d4ab2eec..f4c1a314 100644
--- a/src/saml2/client.py
+++ b/src/saml2/client.py
@@ -3,38 +3,40 @@
#
import six
+
"""Contains classes and functions that a SAML2.0 Service Provider (SP) may use
to conclude its tasks.
"""
-import saml2
+import logging
-from saml2 import saml, SAMLError
-from saml2 import BINDING_HTTP_REDIRECT
+import saml2
from saml2 import BINDING_HTTP_POST
+from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_SOAP
-
-from saml2.ident import decode, code
+from saml2 import SAMLError
+from saml2 import saml
+from saml2.client_base import Base
+from saml2.client_base import LogoutError
+from saml2.client_base import NoServiceDefined
+from saml2.client_base import SignOnError
from saml2.httpbase import HTTPError
+from saml2.ident import code
+from saml2.ident import decode
+from saml2.mdstore import locations
from saml2.s_utils import sid
from saml2.s_utils import status_message_factory
from saml2.s_utils import success_status_factory
+from saml2.saml import AssertionIDRef
from saml2.samlp import STATUS_REQUEST_DENIED
from saml2.samlp import STATUS_UNKNOWN_PRINCIPAL
from saml2.time_util import not_on_or_after
-from saml2.saml import AssertionIDRef
-from saml2.client_base import Base
-from saml2.client_base import SignOnError
-from saml2.client_base import LogoutError
-from saml2.client_base import NoServiceDefined
-from saml2.mdstore import locations
-import logging
logger = logging.getLogger(__name__)
class Saml2Client(Base):
- """ The basic pySAML2 service provider class """
+ """The basic pySAML2 service provider class"""
def prepare_for_authenticate(
self,
@@ -44,14 +46,15 @@ class Saml2Client(Base):
vorg="",
nameid_format=None,
scoping=None,
- consent=None, extensions=None,
+ consent=None,
+ extensions=None,
sign=None,
sigalg=None,
digest_alg=None,
response_binding=saml2.BINDING_HTTP_POST,
**kwargs,
):
- """ Makes all necessary preparations for an authentication request.
+ """Makes all necessary preparations for an authentication request.
:param entityid: The entity ID of the IdP to send the request to
:param relay_state: To where the user should be returned after
@@ -86,9 +89,7 @@ class Saml2Client(Base):
if negotiated_binding != binding:
raise ValueError(
- "Negotiated binding '{}' does not match binding to use '{}'".format(
- negotiated_binding, binding
- )
+ "Negotiated binding '{}' does not match binding to use '{}'".format(negotiated_binding, binding)
)
return reqid, info
@@ -109,7 +110,7 @@ class Saml2Client(Base):
digest_alg=None,
**kwargs,
):
- """ Makes all necessary preparations for an authentication request
+ """Makes all necessary preparations for an authentication request
that negotiates which binding to use for authentication.
:param entityid: The entity ID of the IdP to send the request to
@@ -128,11 +129,7 @@ class Saml2Client(Base):
"""
expected_binding = binding
- bindings_to_try = (
- [BINDING_HTTP_REDIRECT, BINDING_HTTP_POST]
- if not expected_binding
- else [expected_binding]
- )
+ bindings_to_try = [BINDING_HTTP_REDIRECT, BINDING_HTTP_POST] if not expected_binding else [expected_binding]
binding_destinations = []
unsupported_bindings = []
@@ -198,7 +195,7 @@ class Saml2Client(Base):
sign_alg=None,
digest_alg=None,
):
- """ More or less a layer of indirection :-/
+ """More or less a layer of indirection :-/
Bootstrapping the whole thing by finding all the IdPs that should
be notified.
@@ -271,13 +268,9 @@ class Saml2Client(Base):
for entity_id in entity_ids:
logger.debug("Logout from '%s'", entity_id)
- bindings_slo_supported = self.metadata.single_logout_service(
- entity_id=entity_id, typ="idpsso"
- )
+ bindings_slo_supported = self.metadata.single_logout_service(entity_id=entity_id, typ="idpsso")
bindings_slo_preferred_and_supported = (
- binding
- for binding in bindings_slo_preferred
- if binding in bindings_slo_supported
+ binding for binding in bindings_slo_preferred if binding in bindings_slo_supported
)
bindings_slo_choices = filter(
lambda x: x,
@@ -285,7 +278,7 @@ class Saml2Client(Base):
expected_binding,
*bindings_slo_preferred_and_supported,
*bindings_slo_supported,
- )
+ ),
)
binding = next(bindings_slo_choices, None)
if not binding:
@@ -311,7 +304,7 @@ class Saml2Client(Base):
try:
session_info = self.users.get_info_from(name_id, entity_id, False)
- session_index = session_info.get('session_index')
+ session_index = session_info.get("session_index")
session_indexes = [session_index] if session_index else None
except KeyError:
session_indexes = None
@@ -391,7 +384,7 @@ class Saml2Client(Base):
return responses
def local_logout(self, name_id):
- """ Remove the user from the cache, equals local logout
+ """Remove the user from the cache, equals local logout
:param name_id: The identifier of the subject
"""
@@ -399,7 +392,7 @@ class Saml2Client(Base):
return True
def is_logged_in(self, name_id):
- """ Check if user is in the cache
+ """Check if user is in the cache
:param name_id: The identifier of the subject
"""
@@ -407,7 +400,7 @@ class Saml2Client(Base):
return bool(identity)
def handle_logout_response(self, response, sign_alg=None, digest_alg=None):
- """ handles a Logout response
+ """handles a Logout response
:param response: A response.Response instance
:return: 4-tuple of (session_id of the last sent logout request,
@@ -474,36 +467,45 @@ class Saml2Client(Base):
return None
# noinspection PyUnusedLocal
- def do_authz_decision_query(self, entity_id, action,
- subject_id, nameid_format,
- evidence=None, resource=None,
- sp_name_qualifier=None,
- name_qualifier=None,
- consent=None, extensions=None, sign=False):
+ def do_authz_decision_query(
+ self,
+ entity_id,
+ action,
+ subject_id,
+ nameid_format,
+ evidence=None,
+ resource=None,
+ sp_name_qualifier=None,
+ name_qualifier=None,
+ consent=None,
+ extensions=None,
+ sign=False,
+ ):
subject = saml.Subject(
- name_id=saml.NameID(text=subject_id, format=nameid_format,
- sp_name_qualifier=sp_name_qualifier,
- name_qualifier=name_qualifier))
+ name_id=saml.NameID(
+ text=subject_id,
+ format=nameid_format,
+ sp_name_qualifier=sp_name_qualifier,
+ name_qualifier=name_qualifier,
+ )
+ )
srvs = self.metadata.authz_service(entity_id, BINDING_SOAP)
for dest in locations(srvs):
- resp = self._use_soap(dest, "authz_decision_query",
- action=action, evidence=evidence,
- resource=resource, subject=subject)
+ resp = self._use_soap(
+ dest, "authz_decision_query", action=action, evidence=evidence, resource=resource, subject=subject
+ )
if resp:
return resp
return None
- def do_assertion_id_request(self, assertion_ids, entity_id,
- consent=None, extensions=None, sign=False):
+ def do_assertion_id_request(self, assertion_ids, entity_id, consent=None, extensions=None, sign=False):
- srvs = self.metadata.assertion_id_request_service(entity_id,
- BINDING_SOAP)
+ srvs = self.metadata.assertion_id_request_service(entity_id, BINDING_SOAP)
if not srvs:
- raise NoServiceDefined("%s: %s" % (entity_id,
- "assertion_id_request_service"))
+ raise NoServiceDefined("%s: %s" % (entity_id, "assertion_id_request_service"))
if isinstance(assertion_ids, six.string_types):
assertion_ids = [assertion_ids]
@@ -511,22 +513,25 @@ class Saml2Client(Base):
_id_refs = [AssertionIDRef(_id) for _id in assertion_ids]
for destination in locations(srvs):
- res = self._use_soap(destination, "assertion_id_request",
- assertion_id_refs=_id_refs, consent=consent,
- extensions=extensions, sign=sign)
+ res = self._use_soap(
+ destination,
+ "assertion_id_request",
+ assertion_id_refs=_id_refs,
+ consent=consent,
+ extensions=extensions,
+ sign=sign,
+ )
if res:
return res
return None
- def do_authn_query(self, entity_id,
- consent=None, extensions=None, sign=False):
+ def do_authn_query(self, entity_id, consent=None, extensions=None, sign=False):
srvs = self.metadata.authn_request_service(entity_id, BINDING_SOAP)
for destination in locations(srvs):
- resp = self._use_soap(destination, "authn_query", consent=consent,
- extensions=extensions, sign=sign)
+ resp = self._use_soap(destination, "authn_query", consent=consent, extensions=extensions, sign=sign)
if resp:
return resp
@@ -549,7 +554,7 @@ class Saml2Client(Base):
sign_alg=None,
digest_alg=None,
):
- """ Does a attribute request to an attribute authority, this is
+ """Does a attribute request to an attribute authority, this is
by default done over SOAP.
:param entityid: To whom the query should be sent
@@ -685,14 +690,11 @@ class Saml2Client(Base):
if self.local_logout(name_id):
status = success_status_factory()
else:
- status = status_message_factory("Server error",
- STATUS_REQUEST_DENIED)
+ status = status_message_factory("Server error", STATUS_REQUEST_DENIED)
except KeyError:
- status = status_message_factory("Server error",
- STATUS_REQUEST_DENIED)
+ status = status_message_factory("Server error", STATUS_REQUEST_DENIED)
else:
- status = status_message_factory("Wrong user",
- STATUS_UNKNOWN_PRINCIPAL)
+ status = status_message_factory("Wrong user", STATUS_UNKNOWN_PRINCIPAL)
response_bindings = {
BINDING_SOAP: [BINDING_SOAP],
diff --git a/src/saml2/client_base.py b/src/saml2/client_base.py
index cf88dee9..6719b3a8 100644
--- a/src/saml2/client_base.py
+++ b/src/saml2/client_base.py
@@ -5,60 +5,57 @@
"""Contains classes and functions that a SAML2.0 Service Provider (SP) may use
to conclude its tasks.
"""
+import logging
import threading
-import six
import time
-import logging
from typing import Mapping
from warnings import warn as _warn
-from saml2.entity import Entity
-
-from saml2.mdstore import locations
-from saml2.profile import paos, ecp
-from saml2.saml import NAMEID_FORMAT_PERSISTENT
-from saml2.saml import NAMEID_FORMAT_TRANSIENT
-from saml2.saml import AuthnContextClassRef
-from saml2.samlp import AuthnQuery
-from saml2.samlp import RequestedAuthnContext
-from saml2.samlp import NameIDMappingRequest
-from saml2.samlp import AttributeQuery
-from saml2.samlp import AuthzDecisionQuery
-from saml2.samlp import AuthnRequest
-from saml2.samlp import Extensions
-from saml2.extension import sp_type
-from saml2.extension.requested_attributes import RequestedAttribute
-from saml2.extension.requested_attributes import RequestedAttributes
-
-import saml2
-from saml2.soap import make_soap_enveloped_saml_thingy
-
+import six
from six.moves.urllib.parse import parse_qs
from six.moves.urllib.parse import urlencode
from six.moves.urllib.parse import urlparse
-from saml2.s_utils import signature
-from saml2.s_utils import UnravelError
-from saml2.s_utils import do_attributes
-
-from saml2 import samlp, BINDING_SOAP, SAMLError
+import saml2
+from saml2 import BINDING_HTTP_POST
+from saml2 import BINDING_HTTP_REDIRECT
+from saml2 import BINDING_PAOS
+from saml2 import BINDING_SOAP
+from saml2 import SAMLError
from saml2 import saml
+from saml2 import samlp
from saml2 import soap
+from saml2.entity import Entity
+from saml2.extension import sp_type
+from saml2.extension.requested_attributes import RequestedAttribute
+from saml2.extension.requested_attributes import RequestedAttributes
+from saml2.mdstore import locations
from saml2.population import Population
-
-from saml2.response import AttributeResponse, StatusError
-from saml2.response import AuthzResponse
+from saml2.profile import ecp
+from saml2.profile import paos
from saml2.response import AssertionIDResponse
+from saml2.response import AttributeResponse
from saml2.response import AuthnQueryResponse
-from saml2.response import NameIDMappingResponse
from saml2.response import AuthnResponse
-
-from saml2 import BINDING_HTTP_REDIRECT
-from saml2 import BINDING_HTTP_POST
-from saml2 import BINDING_PAOS
-
-from saml2.xmldsig import SIG_ALLOWED_ALG
+from saml2.response import AuthzResponse
+from saml2.response import NameIDMappingResponse
+from saml2.response import StatusError
+from saml2.s_utils import UnravelError
+from saml2.s_utils import do_attributes
+from saml2.s_utils import signature
+from saml2.saml import NAMEID_FORMAT_PERSISTENT
+from saml2.saml import NAMEID_FORMAT_TRANSIENT
+from saml2.saml import AuthnContextClassRef
+from saml2.samlp import AttributeQuery
+from saml2.samlp import AuthnQuery
+from saml2.samlp import AuthnRequest
+from saml2.samlp import AuthzDecisionQuery
+from saml2.samlp import Extensions
+from saml2.samlp import NameIDMappingRequest
+from saml2.samlp import RequestedAuthnContext
+from saml2.soap import make_soap_enveloped_saml_thingy
from saml2.xmldsig import DIGEST_ALLOWED_ALG
+from saml2.xmldsig import SIG_ALLOWED_ALG
logger = logging.getLogger(__name__)
@@ -101,10 +98,10 @@ class NoServiceDefined(SAMLError):
def create_requested_attribute_node(requested_attrs, attribute_converters):
items = []
for attr in requested_attrs:
- friendly_name = attr.get('friendly_name')
- name = attr.get('name')
- name_format = attr.get('name_format')
- is_required = str(attr.get('required', False)).lower()
+ friendly_name = attr.get("friendly_name")
+ name = attr.get("name")
+ name_format = attr.get("name_format")
+ is_required = str(attr.get("required", False)).lower()
if not name and not friendly_name:
raise ValueError("Missing required attribute: 'name' or 'friendly_name'")
@@ -145,10 +142,11 @@ def create_requested_attribute_node(requested_attrs, attribute_converters):
class Base(Entity):
- """ The basic pySAML2 service provider class """
+ """The basic pySAML2 service provider class"""
- def __init__(self, config=None, identity_cache=None, state_cache=None,
- virtual_organization="", config_file="", msg_cb=None):
+ def __init__(
+ self, config=None, identity_cache=None, state_cache=None, virtual_organization="", config_file="", msg_cb=None
+ ):
"""
:param config: A saml2.config.Config instance
:param identity_cache: Where the class should store identity information
@@ -156,8 +154,7 @@ class Base(Entity):
:param virtual_organization: A specific virtual organization
"""
- Entity.__init__(self, "sp", config, config_file, virtual_organization,
- msg_cb=msg_cb)
+ Entity.__init__(self, "sp", config, config_file, virtual_organization, msg_cb=msg_cb)
self.users = Population(identity_cache)
self.lock = threading.Lock()
@@ -178,12 +175,8 @@ class Base(Entity):
}
for attr, val_default in attribute_defaults.items():
val_config = self.config.getattr(attr, "sp")
- val = (
- val_config
- if val_config is not None
- else val_default
- )
- if val == 'true':
+ val = val_config if val_config is not None else val_default
+ if val == "true":
val = True
setattr(self, attr, val)
@@ -252,7 +245,7 @@ class Base(Entity):
#
def add_vo_information_about_user(self, name_id):
- """ Add information to the knowledge I have about the user. This is
+ """Add information to the knowledge I have about the user. This is
for Virtual organizations.
:param name_id: The subject identifier
@@ -275,8 +268,7 @@ class Base(Entity):
# noinspection PyUnusedLocal
@staticmethod
def is_session_valid(_session_id):
- """ Place holder. Supposed to check if the session is still valid.
- """
+ """Place holder. Supposed to check if the session is still valid."""
return True
def service_urls(self, binding=BINDING_HTTP_POST):
@@ -306,7 +298,7 @@ class Base(Entity):
requested_attributes=None,
**kwargs,
):
- """ Creates an authentication request.
+ """Creates an authentication request.
:param destination: Where the request should be sent.
:param vorg: The virtual organization the service belongs to.
@@ -338,10 +330,9 @@ class Base(Entity):
# AssertionConsumerServiceURL
# AssertionConsumerServiceIndex
- hide_assertion_consumer_service = self.config.getattr('hide_assertion_consumer_service', 'sp')
- assertion_consumer_service_url = (
- kwargs.pop("assertion_consumer_service_urls", [None])[0]
- or kwargs.pop("assertion_consumer_service_url", None)
+ hide_assertion_consumer_service = self.config.getattr("hide_assertion_consumer_service", "sp")
+ assertion_consumer_service_url = kwargs.pop("assertion_consumer_service_urls", [None])[0] or kwargs.pop(
+ "assertion_consumer_service_url", None
)
assertion_consumer_service_index = kwargs.pop("assertion_consumer_service_index", None)
service_url = (self.service_urls(service_url_binding or binding) or [None])[0]
@@ -362,33 +353,26 @@ class Base(Entity):
args["provider_name"] = provider_name
requested_authn_context = (
- kwargs.pop("requested_authn_context", None)
- or self.config.getattr("requested_authn_context", "sp")
- or {}
+ kwargs.pop("requested_authn_context", None) or self.config.getattr("requested_authn_context", "sp") or {}
)
if isinstance(requested_authn_context, RequestedAuthnContext):
args["requested_authn_context"] = requested_authn_context
elif isinstance(requested_authn_context, Mapping):
- requested_authn_context_accrs = requested_authn_context.get(
- "authn_context_class_ref", []
- )
- requested_authn_context_comparison = requested_authn_context.get(
- "comparison", "exact"
- )
+ requested_authn_context_accrs = requested_authn_context.get("authn_context_class_ref", [])
+ requested_authn_context_comparison = requested_authn_context.get("comparison", "exact")
if requested_authn_context_accrs:
args["requested_authn_context"] = RequestedAuthnContext(
- authn_context_class_ref=[
- AuthnContextClassRef(accr)
- for accr in requested_authn_context_accrs
- ],
+ authn_context_class_ref=[AuthnContextClassRef(accr) for accr in requested_authn_context_accrs],
comparison=requested_authn_context_comparison,
)
else:
- logger.warning({
- "message": "Cannot process requested_authn_context",
- "requested_authn_context": requested_authn_context,
- "type_of_requested_authn_context": type(requested_authn_context),
- })
+ logger.warning(
+ {
+ "message": "Cannot process requested_authn_context",
+ "requested_authn_context": requested_authn_context,
+ "type_of_requested_authn_context": type(requested_authn_context),
+ }
+ )
# Allow argument values either as class instances or as dictionaries
# all of these have cardinality 0..1
@@ -405,11 +389,7 @@ class Base(Entity):
# NameIDPolicy
nameid_policy_format_config = self.config.getattr("name_id_policy_format", "sp")
- nameid_policy_format = (
- nameid_format
- or nameid_policy_format_config
- or None
- )
+ nameid_policy_format = nameid_format or nameid_policy_format_config or None
allow_create_config = self.config.getattr("name_id_format_allow_create", "sp")
allow_create = (
@@ -426,9 +406,7 @@ class Base(Entity):
if "name_id_policy" in kwargs
else None
if not nameid_policy_format
- else samlp.NameIDPolicy(
- allow_create=allow_create, format=nameid_policy_format
- )
+ else samlp.NameIDPolicy(allow_create=allow_create, format=nameid_policy_format)
)
if name_id_policy and vorg:
@@ -438,8 +416,8 @@ class Base(Entity):
args["name_id_policy"] = name_id_policy
# eIDAS SPType
- conf_sp_type = self.config.getattr('sp_type', 'sp')
- conf_sp_type_in_md = self.config.getattr('sp_type_in_metadata', 'sp')
+ conf_sp_type = self.config.getattr("sp_type", "sp")
+ conf_sp_type_in_md = self.config.getattr("sp_type_in_metadata", "sp")
if conf_sp_type and conf_sp_type_in_md is False:
if not extensions:
extensions = Extensions()
@@ -447,31 +425,23 @@ class Base(Entity):
extensions.add_extension_element(item)
# eIDAS RequestedAttributes
- requested_attrs = (
- requested_attributes
- or self.config.getattr('requested_attributes', 'sp')
- or []
- )
+ requested_attrs = requested_attributes or self.config.getattr("requested_attributes", "sp") or []
if requested_attrs:
- req_attrs_node = create_requested_attribute_node(
- requested_attrs, self.config.attribute_converters
- )
+ req_attrs_node = create_requested_attribute_node(requested_attrs, self.config.attribute_converters)
if not extensions:
extensions = Extensions()
extensions.add_extension_element(req_attrs_node)
# ForceAuthn
- force_authn = str(
- kwargs.pop("force_authn", None)
- or self.config.getattr("force_authn", "sp")
- ).lower() in ["true", "1"]
+ force_authn = str(kwargs.pop("force_authn", None) or self.config.getattr("force_authn", "sp")).lower() in [
+ "true",
+ "1",
+ ]
if force_authn:
kwargs["force_authn"] = "true"
if kwargs:
- _args, extensions = self._filter_args(
- AuthnRequest(), extensions, **kwargs
- )
+ _args, extensions = self._filter_args(AuthnRequest(), extensions, **kwargs)
args.update(_args)
args.pop("id", None)
@@ -511,7 +481,7 @@ class Base(Entity):
digest_alg=None,
**kwargs,
):
- """ Constructs an AttributeQuery
+ """Constructs an AttributeQuery
:param destination: To whom the query should be sent
:param name_id: The identifier of the subject
@@ -538,8 +508,7 @@ class Base(Entity):
if name_id is None:
if "subject_id" in kwargs:
name_id = saml.NameID(text=kwargs["subject_id"])
- for key in ["sp_name_qualifier", "name_qualifier",
- "format"]:
+ for key in ["sp_name_qualifier", "name_qualifier", "format"]:
try:
setattr(name_id, key, kwargs[key])
except KeyError:
@@ -598,7 +567,7 @@ class Base(Entity):
digest_alg=None,
**kwargs,
):
- """ Creates an authz decision query.
+ """Creates an authz decision query.
:param destination: The IdP endpoint
:param action: The action you want to perform (has to be at least one)
@@ -644,7 +613,7 @@ class Base(Entity):
digest_alg=None,
nsprefix=None,
):
- """ Makes an authz decision query based on a previously received
+ """Makes an authz decision query based on a previously received
Assertion.
:param destination: The IdP endpoint to send the request to
@@ -768,22 +737,12 @@ class Base(Entity):
"""
if not name_id and not base_id and not encrypted_id:
- raise ValueError(
- "At least one of name_id, base_id or encrypted_id must be present."
- )
+ raise ValueError("At least one of name_id, base_id or encrypted_id must be present.")
id_attr = {
"name_id": name_id,
- "base_id": (
- base_id
- if not name_id
- else None
- ),
- "encrypted_id": (
- encrypted_id
- if not name_id and not base_id
- else None
- ),
+ "base_id": (base_id if not name_id else None),
+ "encrypted_id": (encrypted_id if not name_id and not base_id else None),
}
return self._message(
@@ -802,10 +761,8 @@ class Base(Entity):
# ======== response handling ===========
- def parse_authn_request_response(
- self, xmlstr, binding, outstanding=None, outstanding_certs=None, conv_info=None
- ):
- """ Deal with an AuthnResponse
+ def parse_authn_request_response(self, xmlstr, binding, outstanding=None, outstanding_certs=None, conv_info=None):
+ """Deal with an AuthnResponse
:param xmlstr: The reply as a xml string
:param binding: Which binding that was used for the transport
@@ -817,7 +774,7 @@ class Base(Entity):
:return: An response.AuthnResponse or None
"""
- if not getattr(self.config, 'entityid', None):
+ if not getattr(self.config, "entityid", None):
raise SAMLError("Missing entity_id specification")
if not xmlstr:
@@ -834,13 +791,11 @@ class Base(Entity):
"entity_id": self.config.entityid,
"attribute_converters": self.config.attribute_converters,
"allow_unknown_attributes": self.config.allow_unknown_attributes,
- 'conv_info': conv_info,
+ "conv_info": conv_info,
}
try:
- resp = self._parse_response(
- xmlstr, AuthnResponse, "assertion_consumer_service", binding, **kwargs
- )
+ resp = self._parse_response(xmlstr, AuthnResponse, "assertion_consumer_service", binding, **kwargs)
except StatusError as err:
logger.error("SAML status error: %s", err)
raise
@@ -854,11 +809,7 @@ class Base(Entity):
logger.error("Response type not supported: %s", saml2.class_name(resp))
return None
- if (
- resp.assertion
- and len(resp.response.encrypted_assertion) == 0
- and resp.assertion.subject.name_id
- ):
+ if resp.assertion and len(resp.response.encrypted_assertion) == 0 and resp.assertion.subject.name_id:
self.users.add_information_about_person(resp.session_info())
logger.info("--- ADDED person info ----")
@@ -869,8 +820,7 @@ class Base(Entity):
# AuthzDecisionQuery all get Response as response
def parse_authz_decision_query_response(self, response, binding=BINDING_SOAP):
- """ Verify that the response is OK
- """
+ """Verify that the response is OK"""
kwargs = {
"entity_id": self.config.entityid,
"attribute_converters": self.config.attribute_converters,
@@ -879,33 +829,24 @@ class Base(Entity):
return self._parse_response(response, AuthzResponse, "", binding, **kwargs)
def parse_authn_query_response(self, response, binding=BINDING_SOAP):
- """ Verify that the response is OK
- """
- kwargs = {"entity_id": self.config.entityid,
- "attribute_converters": self.config.attribute_converters}
+ """Verify that the response is OK"""
+ kwargs = {"entity_id": self.config.entityid, "attribute_converters": self.config.attribute_converters}
- return self._parse_response(response, AuthnQueryResponse, "", binding,
- **kwargs)
+ return self._parse_response(response, AuthnQueryResponse, "", binding, **kwargs)
def parse_assertion_id_request_response(self, response, binding):
- """ Verify that the response is OK
- """
- kwargs = {"entity_id": self.config.entityid,
- "attribute_converters": self.config.attribute_converters}
+ """Verify that the response is OK"""
+ kwargs = {"entity_id": self.config.entityid, "attribute_converters": self.config.attribute_converters}
- res = self._parse_response(response, AssertionIDResponse, "", binding,
- **kwargs)
+ res = self._parse_response(response, AssertionIDResponse, "", binding, **kwargs)
return res
# ------------------------------------------------------------------------
def parse_attribute_query_response(self, response, binding):
- kwargs = {"entity_id": self.config.entityid,
- "attribute_converters": self.config.attribute_converters}
+ kwargs = {"entity_id": self.config.entityid, "attribute_converters": self.config.attribute_converters}
- return self._parse_response(response, AttributeResponse,
- "attribute_consuming_service", binding,
- **kwargs)
+ return self._parse_response(response, AttributeResponse, "attribute_consuming_service", binding, **kwargs)
def parse_name_id_mapping_request_response(self, txt, binding=BINDING_SOAP):
"""
@@ -929,7 +870,7 @@ class Base(Entity):
digest_alg=None,
**kwargs,
):
- """ Makes an authentication request.
+ """Makes an authentication request.
:param entityid: The entity ID of the IdP to send the request to
:param relay_state: A token that can be used by the SP to know
@@ -983,9 +924,7 @@ class Base(Entity):
# The IDP publishes support for ECP by using the SOAP binding on
# SingleSignOnService
- _, location = self.pick_binding(
- "single_sign_on_service", [_binding], entity_id=entityid
- )
+ _, location = self.pick_binding("single_sign_on_service", [_binding], entity_id=entityid)
req_id, authn_req = self.create_authn_request(
location,
service_url_binding=BINDING_PAOS,
@@ -999,26 +938,19 @@ class Base(Entity):
# The SOAP envelope
# ----------------------------------------
- soap_envelope = make_soap_enveloped_saml_thingy(
- authn_req, [paos_request, relay_state]
- )
+ soap_envelope = make_soap_enveloped_saml_thingy(authn_req, [paos_request, relay_state])
return req_id, str(soap_envelope)
def parse_ecp_authn_response(self, txt, outstanding=None):
- rdict = soap.class_instances_from_soap_enveloped_saml_thingies(txt,
- [paos,
- ecp,
- samlp])
+ rdict = soap.class_instances_from_soap_enveloped_saml_thingies(txt, [paos, ecp, samlp])
_relay_state = None
for item in rdict["header"]:
- if item.c_tag == "RelayState" and \
- item.c_namespace == ecp.NAMESPACE:
+ if item.c_tag == "RelayState" and item.c_namespace == ecp.NAMESPACE:
_relay_state = item
- response = self.parse_authn_request_response(rdict["body"],
- BINDING_PAOS, outstanding)
+ response = self.parse_authn_request_response(rdict["body"], BINDING_PAOS, outstanding)
return response, _relay_state
@@ -1067,25 +999,18 @@ class Base(Entity):
"policy": kwargs.get("policy"),
"returnIDParam": kwargs.get("returnIDParam"),
"return": kwargs.get("return_url") or kwargs.get("return"),
- "isPassive": (
- None
- if "isPassive" not in kwargs.keys()
- else "true"
- if kwargs.get("isPassive")
- else "false"
- ),
+ "isPassive": (None if "isPassive" not in kwargs.keys() else "true" if kwargs.get("isPassive") else "false"),
}
params = urlencode({k: v for k, v in args.items() if v})
# url can already contain some parameters
- if '?' in url:
+ if "?" in url:
return "%s&%s" % (url, params)
else:
return "%s?%s" % (url, params)
@staticmethod
- def parse_discovery_service_response(url="", query="",
- returnIDParam="entityID"):
+ def parse_discovery_service_response(url="", query="", returnIDParam="entityID"):
"""
Deal with the response url from a Discovery Service
diff --git a/src/saml2/config.py b/src/saml2/config.py
index a0cc1ae4..a92642d9 100644
--- a/src/saml2/config.py
+++ b/src/saml2/config.py
@@ -1,11 +1,11 @@
import copy
import importlib
import logging
+from logging.config import dictConfig as configure_logging_by_dict
import logging.handlers
import os
import re
import sys
-from logging.config import dictConfig as configure_logging_by_dict
from warnings import warn as _warn
from saml2 import BINDING_HTTP_ARTIFACT
@@ -14,9 +14,8 @@ from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_SOAP
from saml2 import BINDING_URI
from saml2 import SAMLError
-
-from saml2.attribute_converter import ac_factory
from saml2.assertion import Policy
+from saml2.attribute_converter import ac_factory
from saml2.mdstore import MetadataStore
from saml2.saml import NAME_FORMAT_URI
from saml2.virtual_org import VirtualOrg
@@ -24,7 +23,7 @@ from saml2.virtual_org import VirtualOrg
logger = logging.getLogger(__name__)
-__author__ = 'rolandh'
+__author__ = "rolandh"
COMMON_ARGS = [
@@ -133,12 +132,12 @@ COMPLEX_ARGS = ["attribute_converters", "metadata", "policy"]
ALL = set(COMMON_ARGS + SP_ARGS + AA_IDP_ARGS + PDP_ARGS + COMPLEX_ARGS + AA_ARGS)
SPEC = {
- "": COMMON_ARGS + COMPLEX_ARGS,
- "sp": COMMON_ARGS + COMPLEX_ARGS + SP_ARGS,
+ "": COMMON_ARGS + COMPLEX_ARGS,
+ "sp": COMMON_ARGS + COMPLEX_ARGS + SP_ARGS,
"idp": COMMON_ARGS + COMPLEX_ARGS + AA_IDP_ARGS,
- "aa": COMMON_ARGS + COMPLEX_ARGS + AA_IDP_ARGS + AA_ARGS,
+ "aa": COMMON_ARGS + COMPLEX_ARGS + AA_IDP_ARGS + AA_ARGS,
"pdp": COMMON_ARGS + COMPLEX_ARGS + PDP_ARGS,
- "aq": COMMON_ARGS + COMPLEX_ARGS + AQ_ARGS,
+ "aq": COMMON_ARGS + COMPLEX_ARGS + AQ_ARGS,
}
_RPA = [BINDING_HTTP_REDIRECT, BINDING_HTTP_POST, BINDING_HTTP_ARTIFACT]
@@ -156,7 +155,7 @@ PREFERRED_BINDING = {
"authz_service": [BINDING_SOAP],
"assertion_id_request_service": [BINDING_URI],
"artifact_resolution_service": [BINDING_SOAP],
- "attribute_consuming_service": _RPA
+ "attribute_consuming_service": _RPA,
}
@@ -178,7 +177,7 @@ class Config(object):
self.cert_file = None
self.encryption_keypairs = None
self.additional_cert_files = None
- self.metadata_key_usage = 'both'
+ self.metadata_key_usage = "both"
self.secret = None
self.accepted_time_diff = None
self.name = None
@@ -210,7 +209,7 @@ class Config(object):
self.entity_attributes = []
self.entity_category = []
self.entity_category_support = []
- self.crypto_backend = 'xmlsec1'
+ self.crypto_backend = "xmlsec1"
self.scope = ""
self.allow_unknown_attributes = False
self.extension_schema = {}
@@ -278,7 +277,7 @@ class Config(object):
self.setattr(srv, "policy", Policy(policy_conf, self.metadata))
def load(self, cnf, metadata_construction=None):
- """ The base load method, loads the configuration
+ """The base load method, loads the configuration
:param cnf: The configuration as a dictionary
:return: The Configuration instance
@@ -367,7 +366,7 @@ class Config(object):
return self.load(copy.deepcopy(mod.CONFIG))
def load_metadata(self, metadata_conf):
- """ Loads metadata into an internal structure """
+ """Loads metadata into an internal structure"""
acs = self.attribute_converters
if acs is None:
@@ -393,7 +392,7 @@ class Config(object):
return mds
def endpoint(self, service, binding=None, context=None):
- """ Goes through the list of endpoint specifications for the
+ """Goes through the list of endpoint specifications for the
given type of service and returns a list of endpoint that matches
the given binding. If no binding is given all endpoints available for
that service will be returned.
@@ -513,7 +512,7 @@ def config_factory(_type, config):
elif isinstance(config, str):
conf.load_file(config)
else:
- raise ValueError('Unknown type of config')
+ raise ValueError("Unknown type of config")
conf.context = _type
return conf
diff --git a/src/saml2/cryptography/pki.py b/src/saml2/cryptography/pki.py
index 0aa6d2b8..6fe4c79d 100644
--- a/src/saml2/cryptography/pki.py
+++ b/src/saml2/cryptography/pki.py
@@ -2,8 +2,8 @@
from logging import getLogger as get_logger
-import cryptography.x509 as _x509
from cryptography.hazmat.primitives.serialization import Encoding as _cryptography_encoding
+import cryptography.x509 as _x509
logger = get_logger(__name__)
diff --git a/src/saml2/cryptography/symmetric.py b/src/saml2/cryptography/symmetric.py
index ce0e19ee..636bc340 100644
--- a/src/saml2/cryptography/symmetric.py
+++ b/src/saml2/cryptography/symmetric.py
@@ -5,8 +5,8 @@ library. Reference: https://cryptography.io/en/latest/fernet/
"""
import base64 as _base64
-import os as _os
import logging
+import os as _os
from warnings import warn as _warn
import cryptography.fernet as _fernet
@@ -36,9 +36,7 @@ class Fernet(object):
:param key: byte data representing the encyption/decryption key
"""
if key:
- fernet_key_error = SymmetricCryptographyError(
- "Fernet key must be 32 url-safe base64-encoded bytes."
- )
+ fernet_key_error = SymmetricCryptographyError("Fernet key must be 32 url-safe base64-encoded bytes.")
try:
raw_key = _base64.b64decode(key)
except Exception as e:
@@ -106,8 +104,8 @@ class AESCipher(object):
"""
POSTFIX_MODE = {
- 'cbc': _ciphers.modes.CBC,
- 'cfb': _ciphers.modes.CFB,
+ "cbc": _ciphers.modes.CBC,
+ "cfb": _ciphers.modes.CFB,
}
AES_BLOCK_SIZE = int(_ciphers.algorithms.AES.block_size / 8)
@@ -116,11 +114,11 @@ class AESCipher(object):
def _deprecation_notice(cls):
"""Warn about deprecation of this class."""
_deprecation_msg = (
- '{name} {type} is deprecated. '
- 'It will be removed in the next version. '
- 'Use saml2.cryptography.symmetric.Default '
- 'or saml2.cryptography.symmetric.Fernet '
- 'instead.'
+ "{name} {type} is deprecated. "
+ "It will be removed in the next version. "
+ "Use saml2.cryptography.symmetric.Default "
+ "or saml2.cryptography.symmetric.Fernet "
+ "instead."
).format(name=cls.__name__, type=type(cls).__name__)
logger.warning(_deprecation_msg)
_warn(_deprecation_msg, DeprecationWarning)
@@ -133,36 +131,35 @@ class AESCipher(object):
self.__class__._deprecation_notice()
self.key = key
- def build_cipher(self, alg='aes_128_cbc'):
+ def build_cipher(self, alg="aes_128_cbc"):
"""
:param alg: cipher algorithm
:return: A Cipher instance
"""
self.__class__._deprecation_notice()
- typ, bits, cmode = alg.lower().split('_')
+ typ, bits, cmode = alg.lower().split("_")
bits = int(bits)
iv = _os.urandom(self.AES_BLOCK_SIZE)
if len(iv) != self.AES_BLOCK_SIZE:
- raise Exception('Wrong iv size: {}'.format(len(iv)))
+ raise Exception("Wrong iv size: {}".format(len(iv)))
if bits not in _ciphers.algorithms.AES.key_sizes:
- raise Exception('Unsupported key length: {}'.format(bits))
+ raise Exception("Unsupported key length: {}".format(bits))
if len(self.key) != bits / 8:
- raise Exception('Wrong Key length: {}'.format(len(self.key)))
+ raise Exception("Wrong Key length: {}".format(len(self.key)))
try:
mode = self.POSTFIX_MODE[cmode]
except KeyError:
- raise Exception('Unsupported chaining mode: {}'.format(cmode))
+ raise Exception("Unsupported chaining mode: {}".format(cmode))
cipher = _ciphers.Cipher(_ciphers.algorithms.AES(self.key), mode(iv))
return cipher, iv
- def encrypt(self, msg, alg='aes_128_cbc', padding='PKCS#7', b64enc=True,
- block_size=AES_BLOCK_SIZE):
+ def encrypt(self, msg, alg="aes_128_cbc", padding="PKCS#7", b64enc=True, block_size=AES_BLOCK_SIZE):
"""
:param key: The encryption key
:param msg: Message to be encrypted
@@ -172,9 +169,9 @@ class AESCipher(object):
:return: The encrypted message
"""
self.__class__._deprecation_notice()
- if padding == 'PKCS#7':
+ if padding == "PKCS#7":
_block_size = block_size
- elif padding == 'PKCS#5':
+ elif padding == "PKCS#5":
_block_size = 8
else:
_block_size = 0
@@ -195,7 +192,7 @@ class AESCipher(object):
return enc_msg
- def decrypt(self, msg, alg='aes_128_cbc', padding='PKCS#7', b64dec=True):
+ def decrypt(self, msg, alg="aes_128_cbc", padding="PKCS#7", b64dec=True):
"""
:param key: The encryption key
:param msg: Base64 encoded message to be decrypted
@@ -206,9 +203,9 @@ class AESCipher(object):
cipher, iv = self.build_cipher(alg=alg)
decryptor = cipher.decryptor()
- res = decryptor.update(data)[self.AES_BLOCK_SIZE:]
+ res = decryptor.update(data)[self.AES_BLOCK_SIZE :]
res += decryptor.finalize()
- if padding in ['PKCS#5', 'PKCS#7']:
+ if padding in ["PKCS#5", "PKCS#7"]:
idx = bytearray(res)[-1]
res = res[:-idx]
return res
diff --git a/src/saml2/discovery.py b/src/saml2/discovery.py
index 978caed4..f7de497b 100644
--- a/src/saml2/discovery.py
+++ b/src/saml2/discovery.py
@@ -3,7 +3,8 @@ from six.moves.urllib import parse
from saml2.entity import Entity
from saml2.response import VerificationError
-__author__ = 'rolandh'
+
+__author__ = "rolandh"
IDPDISC_POLICY = "urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol:single"
@@ -24,7 +25,7 @@ class DiscoveryServer(Entity):
# verify
- for key in ["isPassive", "return", "returnIDParam", "policy", 'entityID']:
+ for key in ["isPassive", "return", "returnIDParam", "policy", "entityID"]:
try:
if len(dsr[key]) != 1:
raise Exception("Invalid DS request keys: {k}".format(k=key))
@@ -38,9 +39,7 @@ class DiscoveryServer(Entity):
qp = parse.parse_qs(part.query)
if "returnIDParam" in dsr:
if dsr["returnIDParam"] in qp.keys():
- raise Exception(
- "returnIDParam value should not be in the query params"
- )
+ raise Exception("returnIDParam value should not be in the query params")
else:
if "entityID" in qp.keys():
raise Exception("entityID should not be in the query params")
@@ -53,11 +52,7 @@ class DiscoveryServer(Entity):
is_passive = dsr.get("isPassive")
if is_passive not in ["true", "false"]:
- raise ValueError(
- "Invalid value '{v}' for attribute '{attr}'".format(
- v=is_passive, attr="isPassive"
- )
- )
+ raise ValueError("Invalid value '{v}' for attribute '{attr}'".format(v=is_passive, attr="isPassive"))
if "isPassive" in dsr and dsr["isPassive"] == "true":
dsr["isPassive"] = True
@@ -72,9 +67,7 @@ class DiscoveryServer(Entity):
# -------------------------------------------------------------------------
@staticmethod
- def create_discovery_service_response(return_url=None,
- returnIDParam="entityID",
- entity_id=None, **kwargs):
+ def create_discovery_service_response(return_url=None, returnIDParam="entityID", entity_id=None, **kwargs):
if return_url is None:
return_url = kwargs["return"]
diff --git a/src/saml2/ecp.py b/src/saml2/ecp.py
index 8db0afad..d6105321 100644
--- a/src/saml2/ecp.py
+++ b/src/saml2/ecp.py
@@ -6,25 +6,24 @@
Contains classes used in the SAML ECP profile
"""
import logging
-from saml2.client_base import ACTOR, MIME_PAOS
-from saml2.ecp_client import SERVICE
+from saml2 import BINDING_PAOS
+from saml2 import BINDING_SOAP
from saml2 import element_to_extension_element
+from saml2 import saml
from saml2 import samlp
from saml2 import soap
-from saml2 import BINDING_SOAP, BINDING_PAOS
-
-from saml2.profile import paos
+from saml2.client_base import ACTOR
+from saml2.client_base import MIME_PAOS
+from saml2.ecp_client import SERVICE
from saml2.profile import ecp
-
-#from saml2.client import Saml2Client
-from saml2.server import Server
-
+from saml2.profile import paos
+from saml2.response import authn_response
from saml2.schema import soapenv
-from saml2.response import authn_response
+# from saml2.client import Saml2Client
+from saml2.server import Server
-from saml2 import saml
logger = logging.getLogger(__name__)
@@ -32,18 +31,15 @@ logger = logging.getLogger(__name__)
def ecp_capable(headers):
if MIME_PAOS in headers["Accept"]:
if "PAOS" in headers:
- if 'ver="%s";"%s"' % (paos.NAMESPACE,
- SERVICE) in headers["PAOS"]:
+ if 'ver="%s";"%s"' % (paos.NAMESPACE, SERVICE) in headers["PAOS"]:
return True
return False
-#noinspection PyUnusedLocal
-def ecp_auth_request(
- cls, entityid=None, relay_state="", sign=None, sign_alg=None, digest_alg=None
-):
- """ Makes an authentication request.
+# noinspection PyUnusedLocal
+def ecp_auth_request(cls, entityid=None, relay_state="", sign=None, sign_alg=None, digest_alg=None):
+ """Makes an authentication request.
:param entityid: The entity ID of the IdP to send the request to
:param relay_state: To where the user should be returned after
@@ -93,13 +89,13 @@ def ecp_auth_request(
# <ecp:Request>
# ----------------------------------------
-# idp = samlp.IDPEntry(
-# provider_id = "https://idp.example.org/entity",
-# name = "Example identity provider",
-# loc = "https://idp.example.org/saml2/sso",
-# )
-#
-# idp_list = samlp.IDPList(idp_entry= [idp])
+ # idp = samlp.IDPEntry(
+ # provider_id = "https://idp.example.org/entity",
+ # name = "Example identity provider",
+ # loc = "https://idp.example.org/saml2/sso",
+ # )
+ #
+ # idp_list = samlp.IDPList(idp_entry= [idp])
idp_list = None
ecp_request = ecp.Request(
@@ -133,18 +129,14 @@ def ecp_auth_request(
def handle_ecp_authn_response(cls, soap_message, outstanding=None):
- rdict = soap.class_instances_from_soap_enveloped_saml_thingies(
- soap_message, [paos, ecp, samlp]
- )
+ rdict = soap.class_instances_from_soap_enveloped_saml_thingies(soap_message, [paos, ecp, samlp])
_relay_state = None
for item in rdict["header"]:
if item.c_tag == "RelayState" and item.c_namespace == ecp.NAMESPACE:
_relay_state = item
- response = authn_response(
- cls.config, cls.service_urls(), outstanding, allow_unsolicited=True
- )
+ response = authn_response(cls.config, cls.service_urls(), outstanding, allow_unsolicited=True)
response.loads("%s" % rdict["body"], False, soap_message)
response.verify()
@@ -176,10 +168,11 @@ def ecp_response(target_url, response):
class ECPServer(Server):
- """ This deals with what the IdP has to do
+ """This deals with what the IdP has to do
TODO: Still tentative
"""
+
def __init__(self, config_file="", config=None, cache=None):
Server.__init__(self, config_file, config, cache)
diff --git a/src/saml2/ecp_client.py b/src/saml2/ecp_client.py
index 71533393..e28f16a2 100644
--- a/src/saml2/ecp_client.py
+++ b/src/saml2/ecp_client.py
@@ -7,25 +7,26 @@ Contains a class that can do SAML ECP Authentication for other python
programs.
"""
-from six.moves import http_cookiejar as cookielib
import logging
-from saml2 import soap
+from six.moves import http_cookiejar as cookielib
+
+from saml2 import BINDING_SOAP
+from saml2 import SAMLError
from saml2 import saml
from saml2 import samlp
-from saml2 import SAMLError
-from saml2 import BINDING_SOAP
+from saml2 import soap
from saml2.client_base import MIME_PAOS
from saml2.config import Config
from saml2.entity import Entity
-from saml2.httpbase import set_list2dict, dict2set_list
-
-from saml2.profile import paos
-from saml2.profile import ecp
-
+from saml2.httpbase import dict2set_list
+from saml2.httpbase import set_list2dict
from saml2.mdstore import MetadataStore
+from saml2.profile import ecp
+from saml2.profile import paos
from saml2.s_utils import BadRequest
+
SERVICE = "urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp"
PAOS_HEADER_INFO = 'ver="%s";"%s"' % (paos.NAMESPACE, SERVICE)
@@ -39,10 +40,21 @@ class Client(Entity):
ECP-aware SP and IdP.
"""
- def __init__(self, user, passwd, sp="", idp=None, metadata_file=None,
- xmlsec_binary=None, verbose=0, ca_certs="",
- disable_ssl_certificate_validation=True, key_file=None,
- cert_file=None, config=None):
+ def __init__(
+ self,
+ user,
+ passwd,
+ sp="",
+ idp=None,
+ metadata_file=None,
+ xmlsec_binary=None,
+ verbose=0,
+ ca_certs="",
+ disable_ssl_certificate_validation=True,
+ key_file=None,
+ cert_file=None,
+ config=None,
+ ):
"""
:param user: user name
:param passwd: user password
@@ -63,8 +75,7 @@ class Client(Entity):
"""
if not config:
config = Config()
- config.disable_ssl_certificate_validation = \
- disable_ssl_certificate_validation
+ config.disable_ssl_certificate_validation = disable_ssl_certificate_validation
config.key_file = key_file
config.cert_file = cert_file
config.ca_certs = ca_certs
@@ -78,8 +89,7 @@ class Client(Entity):
self._verbose = verbose
if metadata_file:
- self._metadata = MetadataStore([saml, samlp], None, config,
- http_client_timeout=config.http_client_timeout)
+ self._metadata = MetadataStore([saml, samlp], None, config, http_client_timeout=config.http_client_timeout)
self._metadata.load("local", metadata_file)
logger.debug("Loaded metadata from '%s'", metadata_file)
else:
@@ -114,13 +124,9 @@ class Client(Entity):
:return: The response from the IdP
"""
- _, destination = self.pick_binding(
- "single_sign_on_service", [BINDING_SOAP], "idpsso", entity_id=idp_entity_id
- )
+ _, destination = self.pick_binding("single_sign_on_service", [BINDING_SOAP], "idpsso", entity_id=idp_entity_id)
- ht_args = self.apply_binding(
- BINDING_SOAP, authn_request, destination, sign=sign, sigalg=sign_alg
- )
+ ht_args = self.apply_binding(BINDING_SOAP, authn_request, destination, sign=sign, sigalg=sign_alg)
if headers:
ht_args["headers"].extend(headers)
@@ -134,9 +140,7 @@ class Client(Entity):
if response.status_code != 200:
raise SAMLError(
- "Request to IdP failed ({status}): {text}".format(
- status=response.status_code, text=response.text
- )
+ "Request to IdP failed ({status}): {text}".format(status=response.status_code, text=response.text)
)
# SAMLP response in a SOAP envelope body, ecp response in headers
@@ -166,8 +170,10 @@ class Client(Entity):
_acs_url = _ecp_response.assertion_consumer_service_url
if rc_url != _acs_url:
- error = ("response_consumer_url '%s' does not match" % rc_url,
- "assertion_consumer_service_url '%s" % _acs_url)
+ error = (
+ "response_consumer_url '%s' does not match" % rc_url,
+ "assertion_consumer_service_url '%s" % _acs_url,
+ )
# Send an error message to the SP
_ = self.send(rc_url, "POST", data=soap.soap_fault(error))
# Raise an exception so the user knows something went wrong
@@ -234,7 +240,7 @@ class Client(Entity):
# **********************************
ht_args = self.use_soap(idp_response, args["rc_url"], [args["relay_state"]])
- ht_args["headers"][0] = ('Content-Type', MIME_PAOS)
+ ht_args["headers"][0] = ("Content-Type", MIME_PAOS)
logger.debug("[P3] Post to SP: %s", ht_args["data"])
# POST the package from the IdP to the SP
@@ -267,10 +273,7 @@ class Client(Entity):
del headers["accept"]
headers = dict2set_list(headers)
else:
- headers = [
- ('Accept', 'text/html; %s' % MIME_PAOS),
- ('PAOS', PAOS_HEADER_INFO)
- ]
+ headers = [("Accept", "text/html; %s" % MIME_PAOS), ("PAOS", PAOS_HEADER_INFO)]
return headers
@@ -299,8 +302,7 @@ class Client(Entity):
print(response.text)
if response.status_code != 200:
- raise SAMLError(
- "Request to SP failed: %s" % response.text)
+ raise SAMLError("Request to SP failed: %s" % response.text)
# The response might be a AuthnRequest instance in a SOAP envelope
# body. If so it's the start of the ECP conversation
@@ -320,8 +322,7 @@ class Client(Entity):
raise
if response.status_code >= 400:
- raise SAMLError("Error performing operation: %s" % (
- response.text,))
+ raise SAMLError("Error performing operation: %s" % (response.text,))
return response
@@ -333,9 +334,7 @@ class Client(Entity):
return self.operation(url, idp_entity_id, "GET", headers=headers)
def post(self, url=None, data="", idp_entity_id=None, headers=None):
- return self.operation(url, idp_entity_id, "POST", data=data,
- headers=headers)
+ return self.operation(url, idp_entity_id, "POST", data=data, headers=headers)
def put(self, url=None, data="", idp_entity_id=None, headers=None):
- return self.operation(url, idp_entity_id, "PUT", data=data,
- headers=headers)
+ return self.operation(url, idp_entity_id, "PUT", data=data, headers=headers)
diff --git a/src/saml2/entity.py b/src/saml2/entity.py
index d7061a45..78499c47 100644
--- a/src/saml2/entity.py
+++ b/src/saml2/entity.py
@@ -1,88 +1,89 @@
import base64
+from binascii import hexlify
import copy
+from hashlib import sha1
import logging
+
import requests
import six
-from binascii import hexlify
-from hashlib import sha1
-
-from saml2.metadata import ENDPOINTS
-from saml2.profile import paos, ecp, samlec
-from saml2.soap import parse_soap_enveloped_saml_artifact_resolve
-from saml2.soap import class_instances_from_soap_enveloped_saml_thingies
-from saml2.soap import open_soap_envelope
-
-from saml2 import samlp
-from saml2 import SamlBase
-from saml2 import SAMLError
-from saml2 import saml
-from saml2 import response as saml_response
-from saml2 import BINDING_URI
from saml2 import BINDING_HTTP_ARTIFACT
+from saml2 import BINDING_HTTP_POST
+from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_PAOS
-from saml2 import request as saml_request
-from saml2 import soap
+from saml2 import BINDING_SOAP
+from saml2 import BINDING_URI
+from saml2 import VERSION
+from saml2 import SamlBase
+from saml2 import SAMLError
+from saml2 import class_name
from saml2 import element_to_extension_element
from saml2 import extension_elements_to_elements
-
-from saml2.saml import NameID
-from saml2.saml import EncryptedAssertion
-from saml2.saml import Issuer
-from saml2.saml import NAMEID_FORMAT_ENTITY
+from saml2 import request as saml_request
+from saml2 import response as saml_response
+from saml2 import saml
+from saml2 import samlp
+from saml2 import soap
+from saml2.config import config_factory
+from saml2.httpbase import HTTPBase
+from saml2.mdstore import all_locations
+from saml2.metadata import ENDPOINTS
+from saml2.pack import http_form_post_message
+from saml2.pack import http_redirect_message
+from saml2.profile import ecp
+from saml2.profile import paos
+from saml2.profile import samlec
from saml2.response import LogoutResponse
from saml2.response import UnsolicitedResponse
-from saml2.time_util import instant
-from saml2.s_utils import sid
from saml2.s_utils import UnravelError
+from saml2.s_utils import UnsupportedBinding
+from saml2.s_utils import decode_base64_and_inflate
from saml2.s_utils import error_status_factory
from saml2.s_utils import rndbytes
+from saml2.s_utils import sid
from saml2.s_utils import success_status_factory
-from saml2.s_utils import decode_base64_and_inflate
-from saml2.s_utils import UnsupportedBinding
-from saml2.samlp import AuthnRequest, SessionIndex, response_from_string
-from saml2.samlp import AuthzDecisionQuery
-from saml2.samlp import AuthnQuery
+from saml2.saml import NAMEID_FORMAT_ENTITY
+from saml2.saml import EncryptedAssertion
+from saml2.saml import Issuer
+from saml2.saml import NameID
+from saml2.samlp import Artifact
+from saml2.samlp import ArtifactResolve
+from saml2.samlp import ArtifactResponse
from saml2.samlp import AssertionIDRequest
+from saml2.samlp import AttributeQuery
+from saml2.samlp import AuthnQuery
+from saml2.samlp import AuthnRequest
+from saml2.samlp import AuthzDecisionQuery
+from saml2.samlp import LogoutRequest
from saml2.samlp import ManageNameIDRequest
from saml2.samlp import NameIDMappingRequest
+from saml2.samlp import SessionIndex
from saml2.samlp import artifact_resolve_from_string
-from saml2.samlp import ArtifactResolve
-from saml2.samlp import ArtifactResponse
-from saml2.samlp import Artifact
-from saml2.samlp import LogoutRequest
-from saml2.samlp import AttributeQuery
-from saml2.mdstore import all_locations
-from saml2 import BINDING_HTTP_POST
-from saml2 import BINDING_HTTP_REDIRECT
-from saml2 import BINDING_SOAP
-from saml2 import VERSION
-from saml2 import class_name
-from saml2.config import config_factory
-from saml2.httpbase import HTTPBase
-from saml2.sigver import security_context
-from saml2.sigver import SigverError
+from saml2.samlp import response_from_string
from saml2.sigver import SignatureError
-from saml2.sigver import make_temp
+from saml2.sigver import SigverError
from saml2.sigver import get_pem_wrapped_unwrapped
+from saml2.sigver import make_temp
+from saml2.sigver import pre_encrypt_assertion
from saml2.sigver import pre_encryption_part
from saml2.sigver import pre_signature_part
-from saml2.sigver import pre_encrypt_assertion
+from saml2.sigver import security_context
from saml2.sigver import signed_instance_factory
+from saml2.soap import class_instances_from_soap_enveloped_saml_thingies
+from saml2.soap import open_soap_envelope
+from saml2.soap import parse_soap_enveloped_saml_artifact_resolve
+from saml2.time_util import instant
from saml2.virtual_org import VirtualOrg
-from saml2.pack import http_redirect_message
-from saml2.pack import http_form_post_message
-
-from saml2.xmldsig import DefaultSignature
-from saml2.xmldsig import SIG_ALLOWED_ALG
from saml2.xmldsig import DIGEST_ALLOWED_ALG
+from saml2.xmldsig import SIG_ALLOWED_ALG
+from saml2.xmldsig import DefaultSignature
logger = logging.getLogger(__name__)
-__author__ = 'rolandh'
+__author__ = "rolandh"
-ARTIFACT_TYPECODE = b'\x00\x04'
+ARTIFACT_TYPECODE = b"\x00\x04"
SERVICE2MESSAGE = {
"single_sign_on_service": AuthnRequest,
@@ -93,7 +94,7 @@ SERVICE2MESSAGE = {
"manage_name_id_service": ManageNameIDRequest,
"name_id_mapping_service": NameIDMappingRequest,
"artifact_resolve_service": ArtifactResolve,
- "single_logout_service": LogoutRequest
+ "single_logout_service": LogoutRequest,
}
@@ -117,21 +118,17 @@ def create_artifact(entity_id, message_handle, endpoint_index=0):
:return:
"""
if not isinstance(entity_id, six.binary_type):
- entity_id = entity_id.encode('utf-8')
+ entity_id = entity_id.encode("utf-8")
sourceid = sha1(entity_id)
if not isinstance(message_handle, six.binary_type):
- message_handle = message_handle.encode('utf-8')
- ter = b"".join((ARTIFACT_TYPECODE,
- ("%.2x" % endpoint_index).encode('ascii'),
- sourceid.digest(),
- message_handle))
- return base64.b64encode(ter).decode('ascii')
+ message_handle = message_handle.encode("utf-8")
+ ter = b"".join((ARTIFACT_TYPECODE, ("%.2x" % endpoint_index).encode("ascii"), sourceid.digest(), message_handle))
+ return base64.b64encode(ter).decode("ascii")
class Entity(HTTPBase):
- def __init__(self, entity_type, config=None, config_file="",
- virtual_organization="", msg_cb=None):
+ def __init__(self, entity_type, config=None, config_file="", virtual_organization="", msg_cb=None):
self.entity_type = entity_type
self.users = None
@@ -143,18 +140,12 @@ class Entity(HTTPBase):
raise SAMLError("Missing configuration")
def_sig = DefaultSignature()
- self.signing_algorithm = (
- self.config.getattr('signing_algorithm')
- or def_sig.get_sign_alg()
- )
- self.digest_algorithm = (
- self.config.getattr('digest_algorithm')
- or def_sig.get_digest_alg()
- )
+ self.signing_algorithm = self.config.getattr("signing_algorithm") or def_sig.get_sign_alg()
+ self.digest_algorithm = self.config.getattr("digest_algorithm") or def_sig.get_digest_alg()
sign_config_per_entity_type = {
- 'sp': self.config.getattr("authn_requests_signed", "sp"),
- 'idp': self.config.getattr("sign_response", "idp"),
+ "sp": self.config.getattr("authn_requests_signed", "sp"),
+ "idp": self.config.getattr("sign_response", "idp"),
}
sign_config = sign_config_per_entity_type.get(self.entity_type, False)
self.should_sign = sign_config
@@ -170,12 +161,16 @@ class Entity(HTTPBase):
tmp = make_temp(r.text, ".pem", False, self.config.delete_tmpfiles)
setattr(self.config, item, tmp.name)
else:
- raise Exception(
- "Could not fetch certificate from %s" % _val)
-
- HTTPBase.__init__(self, self.config.verify_ssl_cert,
- self.config.ca_certs, self.config.key_file,
- self.config.cert_file, self.config.http_client_timeout)
+ raise Exception("Could not fetch certificate from %s" % _val)
+
+ HTTPBase.__init__(
+ self,
+ self.config.verify_ssl_cert,
+ self.config.ca_certs,
+ self.config.key_file,
+ self.config.cert_file,
+ self.config.http_client_timeout,
+ )
if self.config.vorg:
for vo in self.config.vorg.values():
@@ -228,15 +223,14 @@ class Entity(HTTPBase):
return True
def _issuer(self, entityid=None):
- """ Return an Issuer instance """
+ """Return an Issuer instance"""
if entityid:
if isinstance(entityid, Issuer):
return entityid
else:
return Issuer(text=entityid, format=NAMEID_FORMAT_ENTITY)
else:
- return Issuer(text=self.config.entityid,
- format=NAMEID_FORMAT_ENTITY)
+ return Issuer(text=self.config.entityid, format=NAMEID_FORMAT_ENTITY)
# XXX DONE will actually use sign_alg and digest_alg for the Redirect-Binding
# XXX DONE deepest level - needs to decide the sign_alg (no digest_alg here)
@@ -274,9 +268,7 @@ class Entity(HTTPBase):
sign = sign if sign is not None else self.should_sign
sign_alg = sigalg or self.signing_algorithm
if sign_alg not in [long_name for short_name, long_name in SIG_ALLOWED_ALG]:
- raise Exception(
- "Signature algo not in allowed list: {algo}".format(algo=sign_alg)
- )
+ raise Exception("Signature algo not in allowed list: {algo}".format(algo=sign_alg))
# unless if BINDING_HTTP_ARTIFACT
if response:
@@ -303,9 +295,7 @@ class Entity(HTTPBase):
info["url"] = str(destination)
info["method"] = "GET"
elif binding == BINDING_SOAP or binding == BINDING_PAOS:
- info = self.use_soap(
- msg_str, destination, sign=sign, sigalg=sign_alg, **kwargs
- )
+ info = self.use_soap(msg_str, destination, sign=sign, sigalg=sign_alg, **kwargs)
elif binding == BINDING_URI:
info = self.use_http_uri(msg_str, typ, destination)
elif binding == BINDING_HTTP_ARTIFACT:
@@ -320,9 +310,7 @@ class Entity(HTTPBase):
return info
- def pick_binding(
- self, service, bindings=None, descr_type="", request=None, entity_id=""
- ):
+ def pick_binding(self, service, bindings=None, descr_type="", request=None, entity_id=""):
if request and not entity_id:
entity_id = request.issuer.text.strip()
@@ -361,8 +349,7 @@ class Entity(HTTPBase):
except UnsupportedBinding:
pass
- logger.error("Failed to find consumer URL: %s, %s, %s",
- entity_id, bindings, descr_type)
+ logger.error("Failed to find consumer URL: %s, %s, %s", entity_id, bindings, descr_type)
# logger.error("Bindings: %s", bindings)
# logger.error("Entities: %s", self.metadata)
@@ -427,9 +414,7 @@ class Entity(HTTPBase):
else:
descr_type = "spsso"
- binding, destination = self.pick_binding(
- rsrv, bindings, descr_type=descr_type, request=message
- )
+ binding, destination = self.pick_binding(rsrv, bindings, descr_type=descr_type, request=message)
info["binding"] = binding
info["destination"] = destination
@@ -446,9 +431,14 @@ class Entity(HTTPBase):
:return:
"""
# logger.debug("unravel '%s'", txt)
- if binding not in [BINDING_HTTP_REDIRECT, BINDING_HTTP_POST,
- BINDING_SOAP, BINDING_URI, BINDING_HTTP_ARTIFACT,
- None]:
+ if binding not in [
+ BINDING_HTTP_REDIRECT,
+ BINDING_HTTP_POST,
+ BINDING_SOAP,
+ BINDING_URI,
+ BINDING_HTTP_ARTIFACT,
+ None,
+ ]:
raise UnknownBinding("Don't know how to handle '%s'" % binding)
else:
try:
@@ -457,8 +447,7 @@ class Entity(HTTPBase):
elif binding == BINDING_HTTP_POST:
xmlstr = base64.b64decode(txt)
elif binding == BINDING_SOAP:
- func = getattr(soap,
- "parse_soap_enveloped_saml_%s" % msgtype)
+ func = getattr(soap, "parse_soap_enveloped_saml_%s" % msgtype)
xmlstr = func(txt)
elif binding == BINDING_HTTP_ARTIFACT:
xmlstr = base64.b64decode(txt)
@@ -476,10 +465,7 @@ class Entity(HTTPBase):
:param text: The SOAP message
:return: A dictionary with two keys "body" and "header"
"""
- return class_instances_from_soap_enveloped_saml_thingies(text, [paos,
- ecp,
- samlp,
- samlec])
+ return class_instances_from_soap_enveloped_saml_thingies(text, [paos, ecp, samlp, samlec])
@staticmethod
def unpack_soap_message(text):
@@ -513,18 +499,12 @@ class Entity(HTTPBase):
sign_alg = sign_alg or self.signing_algorithm
digest_alg = digest_alg or self.digest_algorithm
if sign_alg not in [long_name for short_name, long_name in SIG_ALLOWED_ALG]:
- raise Exception(
- "Signature algo not in allowed list: {algo}".format(algo=sign_alg)
- )
+ raise Exception("Signature algo not in allowed list: {algo}".format(algo=sign_alg))
if digest_alg not in [long_name for short_name, long_name in DIGEST_ALLOWED_ALG]:
- raise Exception(
- "Digest algo not in allowed list: {algo}".format(algo=digest_alg)
- )
+ raise Exception("Digest algo not in allowed list: {algo}".format(algo=digest_alg))
if msg.signature is None:
- msg.signature = pre_signature_part(
- msg.id, self.sec.my_cert, 1, sign_alg=sign_alg, digest_alg=digest_alg
- )
+ msg.signature = pre_signature_part(msg.id, self.sec.my_cert, 1, sign_alg=sign_alg, digest_alg=digest_alg)
if sign_prepare:
return msg
@@ -650,7 +630,7 @@ class Entity(HTTPBase):
msg.extension_elements = extensions
def has_encrypt_cert_in_metadata(self, sp_entity_id):
- """ Verifies if the metadata contains encryption certificates.
+ """Verifies if the metadata contains encryption certificates.
:param sp_entity_id: Entity ID for the calling service provider.
:return: True if encrypt cert exists in metadata, otherwise False.
@@ -662,7 +642,7 @@ class Entity(HTTPBase):
return False
def _encrypt_assertion(self, encrypt_cert, sp_entity_id, response, node_xpath=None):
- """ Encryption of assertions.
+ """Encryption of assertions.
:param encrypt_cert: Certificate to be used for encryption.
:param sp_entity_id: Entity ID for the calling service provider.
@@ -681,16 +661,14 @@ class Entity(HTTPBase):
wrapped_cert, unwrapped_cert = get_pem_wrapped_unwrapped(_cert)
try:
tmp = make_temp(
- wrapped_cert.encode('ascii'),
+ wrapped_cert.encode("ascii"),
decode=False,
delete_tmpfiles=self.config.delete_tmpfiles,
)
response = self.sec.encrypt_assertion(
response,
tmp.name,
- pre_encryption_part(
- key_name=_cert_name, encrypt_cert=unwrapped_cert
- ),
+ pre_encryption_part(key_name=_cert_name, encrypt_cert=unwrapped_cert),
node_xpath=node_xpath,
)
return response
@@ -724,7 +702,7 @@ class Entity(HTTPBase):
digest_alg=None,
**kwargs,
):
- """ Create a Response.
+ """Create a Response.
Encryption:
encrypt_assertion must be true for encryption to be
performed. If encrypted_advice_attributes also is
@@ -776,11 +754,7 @@ class Entity(HTTPBase):
self._add_info(response, **kwargs)
sign = sign if sign is not None else self.should_sign
- if (
- to_sign
- and not sign
- and not encrypt_assertion
- ):
+ if to_sign and not sign and not encrypt_assertion:
return signed_instance_factory(response, self.sec, to_sign)
has_encrypt_cert = self.has_encrypt_cert_in_metadata(sp_entity_id)
@@ -854,33 +828,25 @@ class Entity(HTTPBase):
# XXX prepare encrypt assertion
# tmp_assertion = response.assertion.advice.assertion[0]
- _assertion.advice.encrypted_assertion[0].add_extension_element(
- tmp_assertion
- )
+ _assertion.advice.encrypted_assertion[0].add_extension_element(tmp_assertion)
if encrypt_assertion_self_contained:
advice_tag = response.assertion.advice._to_element_tree().tag
assertion_tag = tmp_assertion._to_element_tree().tag
- response = response.get_xml_string_with_self_contained_assertion_within_advice_encrypted_assertion(
- assertion_tag, advice_tag
+ response = (
+ response.get_xml_string_with_self_contained_assertion_within_advice_encrypted_assertion(
+ assertion_tag, advice_tag
+ )
)
- node_xpath = ''.join(
+ node_xpath = "".join(
[
- "/*[local-name()=\"%s\"]" % v
- for v in [
- "Response",
- "Assertion",
- "Advice",
- "EncryptedAssertion",
- "Assertion"
- ]
+ '/*[local-name()="%s"]' % v
+ for v in ["Response", "Assertion", "Advice", "EncryptedAssertion", "Assertion"]
]
)
# XXX sign assertion
if to_sign_advice:
- response = signed_instance_factory(
- response, self.sec, to_sign_advice
- )
+ response = signed_instance_factory(response, self.sec, to_sign_advice)
# XXX encrypt assertion
response = self._encrypt_assertion(
@@ -929,14 +895,10 @@ class Entity(HTTPBase):
# XXX sign assertion
if to_sign_assertion:
- response = signed_instance_factory(
- response, self.sec, to_sign_assertion
- )
+ response = signed_instance_factory(response, self.sec, to_sign_assertion)
# XXX encrypt assertion
- response = self._encrypt_assertion(
- encrypt_cert_assertion, sp_entity_id, response
- )
+ response = self._encrypt_assertion(encrypt_cert_assertion, sp_entity_id, response)
else:
# XXX sign other parts! (defiend by to_sign)
if to_sign:
@@ -951,9 +913,7 @@ class Entity(HTTPBase):
# XXX sign response
if sign:
- return self.sign(
- response, to_sign=to_sign, sign_alg=sign_alg, digest_alg=digest_alg
- )
+ return self.sign(response, to_sign=to_sign, sign_alg=sign_alg, digest_alg=digest_alg)
return response
@@ -968,7 +928,7 @@ class Entity(HTTPBase):
digest_alg=None,
**kwargs,
):
- """ Create a StatusResponse.
+ """Create a StatusResponse.
:param response_class: Which subclass of StatusResponse that should be
used
@@ -1056,22 +1016,25 @@ class Entity(HTTPBase):
except AttributeError:
timeslack = 0
- _request = request_cls(self.sec, receiver_addresses,
- self.config.attribute_converters,
- timeslack=timeslack)
+ _request = request_cls(self.sec, receiver_addresses, self.config.attribute_converters, timeslack=timeslack)
xmlstr = self.unravel(enc_request, binding, request_cls.msgtype)
must = self.config.getattr("want_authn_requests_signed", "idp")
- only_valid_cert = self.config.getattr(
- "want_authn_requests_only_with_valid_cert", "idp")
+ only_valid_cert = self.config.getattr("want_authn_requests_only_with_valid_cert", "idp")
if only_valid_cert is None:
only_valid_cert = False
if only_valid_cert:
must = True
- _request = _request.loads(xmlstr, binding, origdoc=enc_request,
- must=must, only_valid_cert=only_valid_cert,
- relay_state=relay_state, sigalg=sigalg,
- signature=signature)
+ _request = _request.loads(
+ xmlstr,
+ binding,
+ origdoc=enc_request,
+ must=must,
+ only_valid_cert=only_valid_cert,
+ relay_state=relay_state,
+ sigalg=sigalg,
+ signature=signature,
+ )
_log_debug("Loaded request")
@@ -1098,7 +1061,7 @@ class Entity(HTTPBase):
digest_alg=None,
**kwargs,
):
- """ Create a error response.
+ """Create a error response.
:param in_response_to: The identifier of the message this is a response
to.
@@ -1141,7 +1104,7 @@ class Entity(HTTPBase):
sign_alg=None,
digest_alg=None,
):
- """ Constructs a LogoutRequest
+ """Constructs a LogoutRequest
:param destination: Destination of the request
:param issuer_entity_id: The entity ID of the IdP the request is
@@ -1162,9 +1125,7 @@ class Entity(HTTPBase):
if subject_id:
if self.entity_type == "idp":
- name_id = NameID(
- text=self.users.get_entityid(subject_id, issuer_entity_id, False)
- )
+ name_id = NameID(text=self.users.get_entityid(subject_id, issuer_entity_id, False))
else:
name_id = NameID(text=subject_id)
@@ -1208,7 +1169,7 @@ class Entity(HTTPBase):
sign_alg=None,
digest_alg=None,
):
- """ Create a LogoutResponse.
+ """Create a LogoutResponse.
:param request: The request this is a response to
:param bindings: Which bindings that can be used for the response
@@ -1348,8 +1309,7 @@ class Entity(HTTPBase):
elif encrypted_id:
kwargs["encrypted_id"] = encrypted_id
else:
- raise AttributeError(
- "One of NameID or EncryptedNameID has to be provided")
+ raise AttributeError("One of NameID or EncryptedNameID has to be provided")
if new_id:
kwargs["new_id"] = new_id
@@ -1358,9 +1318,7 @@ class Entity(HTTPBase):
elif terminate:
kwargs["terminate"] = terminate
else:
- raise AttributeError(
- "One of NewID, NewEncryptedNameID or Terminate has to be "
- "provided")
+ raise AttributeError("One of NewID, NewEncryptedNameID or Terminate has to be " "provided")
return self._message(
ManageNameIDRequest,
@@ -1374,7 +1332,7 @@ class Entity(HTTPBase):
)
def parse_manage_name_id_request(self, xmlstr, binding=BINDING_SOAP):
- """ Deal with a LogoutRequest
+ """Deal with a LogoutRequest
:param xmlstr: The response as a xml string
:param binding: What type of binding this message came through.
@@ -1383,8 +1341,7 @@ class Entity(HTTPBase):
was not.
"""
- return self._parse_request(xmlstr, saml_request.ManageNameIDRequest,
- "manage_name_id_service", binding)
+ return self._parse_request(xmlstr, saml_request.ManageNameIDRequest, "manage_name_id_service", binding)
# XXX DONE ent create > _status_response
def create_manage_name_id_response(
@@ -1435,7 +1392,7 @@ class Entity(HTTPBase):
outstanding_certs=None,
**kwargs,
):
- """ Deal with a Response
+ """Deal with a Response
:param xmlstr: The response as a xml string
:param response_cls: What type of response it is
@@ -1468,10 +1425,7 @@ class Entity(HTTPBase):
}
if binding in bindings:
# expected return address
- kwargs["return_addrs"] = self.config.endpoint(
- service,
- binding=binding,
- context=self.entity_type)
+ kwargs["return_addrs"] = self.config.endpoint(service, binding=binding, context=self.entity_type)
try:
response = response_cls(self.sec, **kwargs)
@@ -1570,8 +1524,7 @@ class Entity(HTTPBase):
# ------------------------------------------------------------------------
def parse_logout_request_response(self, xmlstr, binding=BINDING_SOAP):
- return self._parse_response(xmlstr, LogoutResponse,
- "single_logout_service", binding)
+ return self._parse_response(xmlstr, LogoutResponse, "single_logout_service", binding)
# ------------------------------------------------------------------------
@@ -1583,7 +1536,7 @@ class Entity(HTTPBase):
sigalg=None,
signature=None,
):
- """ Deal with a LogoutRequest
+ """Deal with a LogoutRequest
:param xmlstr: The response as a xml string
:param binding: What type of binding this message came through.
@@ -1609,7 +1562,7 @@ class Entity(HTTPBase):
:param endpoint_index:
:return:
"""
- message_handle = sha1(str(message).encode('utf-8'))
+ message_handle = sha1(str(message).encode("utf-8"))
message_handle.update(rndbytes())
mhd = message_handle.digest()
saml_art = create_artifact(self.config.entityid, mhd, endpoint_index)
@@ -1695,13 +1648,9 @@ class Entity(HTTPBase):
return artifact_resolve_from_string(_resp)
def parse_artifact_resolve_response(self, xmlstr):
- kwargs = {"entity_id": self.config.entityid,
- "attribute_converters": self.config.attribute_converters}
+ kwargs = {"entity_id": self.config.entityid, "attribute_converters": self.config.attribute_converters}
- resp = self._parse_response(xmlstr, saml_response.ArtifactResponse,
- "artifact_resolve", BINDING_SOAP,
- **kwargs)
+ resp = self._parse_response(xmlstr, saml_response.ArtifactResponse, "artifact_resolve", BINDING_SOAP, **kwargs)
# should just be one
- elems = extension_elements_to_elements(resp.response.extension_elements,
- [samlp, saml])
+ elems = extension_elements_to_elements(resp.response.extension_elements, [samlp, saml])
return elems[0]
diff --git a/src/saml2/entity_category/__init__.py b/src/saml2/entity_category/__init__.py
index d78e3b99..38e10a5c 100644
--- a/src/saml2/entity_category/__init__.py
+++ b/src/saml2/entity_category/__init__.py
@@ -1,4 +1,4 @@
-__author__ = 'rolandh'
+__author__ = "rolandh"
ENTITYATTRIBUTES = "urn:oasis:names:tc:SAML:metadata:attribute&EntityAttributes"
@@ -11,4 +11,4 @@ def entity_categories(md):
for attr in elem["attribute"]:
res.append(attr["text"])
- return res \ No newline at end of file
+ return res
diff --git a/src/saml2/entity_category/at_egov_pvp2.py b/src/saml2/entity_category/at_egov_pvp2.py
index 4a041c2f..723b3d50 100644
--- a/src/saml2/entity_category/at_egov_pvp2.py
+++ b/src/saml2/entity_category/at_egov_pvp2.py
@@ -1,29 +1,31 @@
-__author__ = 'rhoerbe' #2013-09-05
+__author__ = "rhoerbe" # 2013-09-05
# Entity Categories specifying the PVP eGov Token as of "PVP2-Allgemein V2.1.0", http://www.ref.gv.at/
-EGOVTOKEN = ["PVP-VERSION",
- "PVP-PRINCIPAL-NAME",
- "PVP-GIVENNAME",
- "PVP-BIRTHDATE",
- "PVP-USERID",
- "PVP-GID",
- "PVP-BPK",
- "PVP-MAIL",
- "PVP-TEL",
- "PVP-PARTICIPANT-ID",
- "PVP-PARTICIPANT-OKZ",
- "PVP-OU-OKZ",
- "PVP-OU",
- "PVP-OU-GV-OU-ID",
- "PVP-FUNCTION",
- "PVP-ROLES",
+EGOVTOKEN = [
+ "PVP-VERSION",
+ "PVP-PRINCIPAL-NAME",
+ "PVP-GIVENNAME",
+ "PVP-BIRTHDATE",
+ "PVP-USERID",
+ "PVP-GID",
+ "PVP-BPK",
+ "PVP-MAIL",
+ "PVP-TEL",
+ "PVP-PARTICIPANT-ID",
+ "PVP-PARTICIPANT-OKZ",
+ "PVP-OU-OKZ",
+ "PVP-OU",
+ "PVP-OU-GV-OU-ID",
+ "PVP-FUNCTION",
+ "PVP-ROLES",
]
-CHARGEATTR = ["PVP-INVOICE-RECPT-ID",
- "PVP-COST-CENTER-ID",
- "PVP-CHARGE-CODE",
+CHARGEATTR = [
+ "PVP-INVOICE-RECPT-ID",
+ "PVP-COST-CENTER-ID",
+ "PVP-CHARGE-CODE",
]
# all eGov Token attributes except (1) transaction charging and (2) chaining
diff --git a/src/saml2/entity_category/edugain.py b/src/saml2/entity_category/edugain.py
index 533af426..9d388dd5 100644
--- a/src/saml2/entity_category/edugain.py
+++ b/src/saml2/entity_category/edugain.py
@@ -1,4 +1,4 @@
-__author__ = 'rolandh'
+__author__ = "rolandh"
COC = "http://www.geant.net/uri/dataprotection-code-of-conduct/v1"
COCO = COC
@@ -7,9 +7,15 @@ RELEASE = {
"": ["eduPersonTargetedID"],
# COC: ["eduPersonPrincipalName", "eduPersonScopedAffiliation", "mail",
# "displayName", "schacHomeOrganization"],
- COCO: ["eduPersonPrincipalName", "eduPersonScopedAffiliation",
- 'eduPersonAffiliation', "mail", "displayName", 'cn',
- "schacHomeOrganization"]
+ COCO: [
+ "eduPersonPrincipalName",
+ "eduPersonScopedAffiliation",
+ "eduPersonAffiliation",
+ "mail",
+ "displayName",
+ "cn",
+ "schacHomeOrganization",
+ ],
}
ONLY_REQUIRED = {COCO: True}
diff --git a/src/saml2/entity_category/incommon.py b/src/saml2/entity_category/incommon.py
index 9df7730b..82c9dab4 100644
--- a/src/saml2/entity_category/incommon.py
+++ b/src/saml2/entity_category/incommon.py
@@ -1,10 +1,15 @@
-__author__ = 'rolandh'
+__author__ = "rolandh"
RESEARCH_AND_SCHOLARSHIP = "http://id.incommon.org/category/research-and-scholarship"
RELEASE = {
"": ["eduPersonTargetedID"],
- RESEARCH_AND_SCHOLARSHIP: ["eduPersonPrincipalName",
- "eduPersonScopedAffiliation", "mail",
- "givenName", "sn", "displayName"]
+ RESEARCH_AND_SCHOLARSHIP: [
+ "eduPersonPrincipalName",
+ "eduPersonScopedAffiliation",
+ "mail",
+ "givenName",
+ "sn",
+ "displayName",
+ ],
}
diff --git a/src/saml2/entity_category/refeds.py b/src/saml2/entity_category/refeds.py
index c6fe882a..fa68aea2 100644
--- a/src/saml2/entity_category/refeds.py
+++ b/src/saml2/entity_category/refeds.py
@@ -1,11 +1,15 @@
-__author__ = 'rolandh'
+__author__ = "rolandh"
RESEARCH_AND_SCHOLARSHIP = "http://refeds.org/category/research-and-scholarship"
RELEASE = {
"": ["eduPersonTargetedID"],
- RESEARCH_AND_SCHOLARSHIP: ["eduPersonPrincipalName",
- "eduPersonScopedAffiliation", "mail",
- "givenName", "sn", "displayName"]
+ RESEARCH_AND_SCHOLARSHIP: [
+ "eduPersonPrincipalName",
+ "eduPersonScopedAffiliation",
+ "mail",
+ "givenName",
+ "sn",
+ "displayName",
+ ],
}
-
diff --git a/src/saml2/entity_category/swamid.py b/src/saml2/entity_category/swamid.py
index ed0ac618..6fc1a007 100644
--- a/src/saml2/entity_category/swamid.py
+++ b/src/saml2/entity_category/swamid.py
@@ -1,80 +1,75 @@
-__author__ = 'rolandh'
+__author__ = "rolandh"
NAME = [
- 'givenName',
- 'displayName',
- 'sn',
- 'cn',
+ "givenName",
+ "displayName",
+ "sn",
+ "cn",
]
STATIC_ORG_INFO = [
- 'c',
- 'o',
- 'co',
- 'norEduOrgAcronym',
- 'schacHomeOrganization',
- 'schacHomeOrganizationType',
+ "c",
+ "o",
+ "co",
+ "norEduOrgAcronym",
+ "schacHomeOrganization",
+ "schacHomeOrganizationType",
]
-OTHER = [
- 'eduPersonPrincipalName',
- 'eduPersonScopedAffiliation',
- 'mail',
- 'eduPersonAssurance'
-]
+OTHER = ["eduPersonPrincipalName", "eduPersonScopedAffiliation", "mail", "eduPersonAssurance"]
R_AND_S = [
- 'eduPersonPrincipalName',
- 'eduPersonUniqueID',
- 'mail',
- 'displayName',
- 'givenName',
- 'sn',
- 'eduPersonAssurance',
- 'eduPersonScopedAffiliation'
+ "eduPersonPrincipalName",
+ "eduPersonUniqueID",
+ "mail",
+ "displayName",
+ "givenName",
+ "sn",
+ "eduPersonAssurance",
+ "eduPersonScopedAffiliation",
]
GEANT_COCO = [
- 'eduPersonTargetedID',
- 'eduPersonPrincipalName',
- 'eduPersonUniqueID',
- 'eduPersonOrcid',
- 'norEduPersonNIN',
- 'personalIdentityNumber',
- 'schacDateOfBirth',
- 'mail',
- 'displayName',
- 'cn',
- 'givenName',
- 'sn',
- 'eduPersonAssurance',
- 'eduPersonScopedAffiliation',
- 'eduPersonAffiliation',
- 'o',
- 'norEduOrgAcronym',
- 'c',
- 'co',
- 'schacHomeOrganization',
- 'schacHomeOrganizationType',
+ "eduPersonTargetedID",
+ "eduPersonPrincipalName",
+ "eduPersonUniqueID",
+ "eduPersonOrcid",
+ "norEduPersonNIN",
+ "personalIdentityNumber",
+ "schacDateOfBirth",
+ "mail",
+ "displayName",
+ "cn",
+ "givenName",
+ "sn",
+ "eduPersonAssurance",
+ "eduPersonScopedAffiliation",
+ "eduPersonAffiliation",
+ "o",
+ "norEduOrgAcronym",
+ "c",
+ "co",
+ "schacHomeOrganization",
+ "schacHomeOrganizationType",
]
-MYACADEMICID_ESI = ['schacPersonalUniqueCode']
+MYACADEMICID_ESI = ["schacPersonalUniqueCode"]
# These give you access to information
-RESEARCH_AND_EDUCATION = 'http://www.swamid.se/category/research-and-education' # Deprecated from 2021-03-31
-SFS_1993_1153 = 'http://www.swamid.se/category/sfs-1993-1153' # Deprecated from 2021-03-31
-RESEARCH_AND_SCHOLARSHIP = 'http://refeds.org/category/research-and-scholarship'
-COCO = 'http://www.geant.net/uri/dataprotection-code-of-conduct/v1'
-ESI = 'https://myacademicid.org/entity-categories/esi'
+RESEARCH_AND_EDUCATION = "http://www.swamid.se/category/research-and-education" # Deprecated from 2021-03-31
+SFS_1993_1153 = "http://www.swamid.se/category/sfs-1993-1153" # Deprecated from 2021-03-31
+RESEARCH_AND_SCHOLARSHIP = "http://refeds.org/category/research-and-scholarship"
+COCO = "http://www.geant.net/uri/dataprotection-code-of-conduct/v1"
+ESI = "https://myacademicid.org/entity-categories/esi"
# presently these don't by themself
-EU = 'http://www.swamid.se/category/eu-adequate-protection' # Deprecated from 2021-03-31
-NREN = 'http://www.swamid.se/category/nren-service' # Deprecated from 2021-03-31
-HEI = 'http://www.swamid.se/category/hei-service' # Deprecated from 2021-03-31
+EU = "http://www.swamid.se/category/eu-adequate-protection" # Deprecated from 2021-03-31
+NREN = "http://www.swamid.se/category/nren-service" # Deprecated from 2021-03-31
+HEI = "http://www.swamid.se/category/hei-service" # Deprecated from 2021-03-31
RELEASE = {
- '': [],
- SFS_1993_1153: ['norEduPersonNIN', 'eduPersonAssurance'],
+ "": [],
+ SFS_1993_1153: ["norEduPersonNIN", "eduPersonAssurance"],
(RESEARCH_AND_EDUCATION, EU): NAME + STATIC_ORG_INFO + OTHER,
(RESEARCH_AND_EDUCATION, NREN): NAME + STATIC_ORG_INFO + OTHER,
(RESEARCH_AND_EDUCATION, HEI): NAME + STATIC_ORG_INFO + OTHER,
diff --git a/src/saml2/eptid.py b/src/saml2/eptid.py
index c4fd05cc..de32015e 100644
--- a/src/saml2/eptid.py
+++ b/src/saml2/eptid.py
@@ -5,11 +5,12 @@
# Internet2 and may overtake the other form in due course.
import hashlib
+import logging
import shelve
-import logging
import six
+
logger = logging.getLogger(__name__)
@@ -25,25 +26,25 @@ class Eptid(object):
if isinstance(sp, six.binary_type):
md5.update(sp)
else:
- md5.update(sp.encode('utf-8'))
+ md5.update(sp.encode("utf-8"))
if isinstance(self.secret, six.binary_type):
md5.update(self.secret)
else:
- md5.update(self.secret.encode('utf-8'))
+ md5.update(self.secret.encode("utf-8"))
md5.digest()
hashval = md5.hexdigest()
if isinstance(hashval, six.binary_type):
- hashval = hashval.decode('ascii')
+ hashval = hashval.decode("ascii")
return "!".join([idp, sp, hashval])
def __getitem__(self, key):
if six.PY3 and isinstance(key, six.binary_type):
- key = key.decode('utf-8')
+ key = key.decode("utf-8")
return self._db[key]
def __setitem__(self, key, value):
if six.PY3 and isinstance(key, six.binary_type):
- key = key.decode('utf-8')
+ key = key.decode("utf-8")
self._db[key] = value
def get(self, idp, sp, *args):
@@ -64,8 +65,8 @@ class EptidShelve(Eptid):
def __init__(self, secret, filename):
Eptid.__init__(self, secret)
if six.PY3:
- if filename.endswith('.db'):
- filename = filename.rsplit('.db', 1)[0]
+ if filename.endswith(".db"):
+ filename = filename.rsplit(".db", 1)[0]
self._db = shelve.open(filename, writeback=True, protocol=2)
def close(self):
diff --git a/src/saml2/extension/algsupport.py b/src/saml2/extension/algsupport.py
index 753d4dfe..1db825f0 100644
--- a/src/saml2/extension/algsupport.py
+++ b/src/saml2/extension/algsupport.py
@@ -8,30 +8,25 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:algsupport'
+NAMESPACE = "urn:oasis:names:tc:SAML:metadata:algsupport"
class DigestMethodType_(SamlBase):
"""The urn:oasis:names:tc:SAML:metadata:algsupport:DigestMethodType
- element """
+ element"""
- c_tag = 'DigestMethodType'
+ c_tag = "DigestMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
-
- def __init__(self,
- algorithm=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+
+ def __init__(self, algorithm=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.algorithm = algorithm
@@ -41,29 +36,30 @@ def digest_method_type__from_string(xml_string):
class SigningMethodType_(SamlBase):
"""The urn:oasis:names:tc:SAML:metadata:algsupport:SigningMethodType
- element """
+ element"""
- c_tag = 'SigningMethodType'
+ c_tag = "SigningMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
- c_attributes['MinKeySize'] = ('min_key_size', 'positiveInteger', False)
- c_attributes['MaxKeySize'] = ('max_key_size', 'positiveInteger', False)
-
- def __init__(self,
- algorithm=None,
- min_key_size=None,
- max_key_size=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+ c_attributes["MinKeySize"] = ("min_key_size", "positiveInteger", False)
+ c_attributes["MaxKeySize"] = ("max_key_size", "positiveInteger", False)
+
+ def __init__(
+ self,
+ algorithm=None,
+ min_key_size=None,
+ max_key_size=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.algorithm = algorithm
self.min_key_size = min_key_size
self.max_key_size = max_key_size
@@ -74,9 +70,9 @@ def signing_method_type__from_string(xml_string):
class DigestMethod(DigestMethodType_):
- """The urn:oasis:names:tc:SAML:metadata:algsupport:DigestMethod element """
+ """The urn:oasis:names:tc:SAML:metadata:algsupport:DigestMethod element"""
- c_tag = 'DigestMethod'
+ c_tag = "DigestMethod"
c_namespace = NAMESPACE
c_children = DigestMethodType_.c_children.copy()
c_attributes = DigestMethodType_.c_attributes.copy()
@@ -89,9 +85,9 @@ def digest_method_from_string(xml_string):
class SigningMethod(SigningMethodType_):
- """The urn:oasis:names:tc:SAML:metadata:algsupport:SigningMethod element """
+ """The urn:oasis:names:tc:SAML:metadata:algsupport:SigningMethod element"""
- c_tag = 'SigningMethod'
+ c_tag = "SigningMethod"
c_namespace = NAMESPACE
c_children = SigningMethodType_.c_children.copy()
c_attributes = SigningMethodType_.c_attributes.copy()
@@ -111,13 +107,12 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'DigestMethod': DigestMethod,
- 'DigestMethodType': DigestMethodType_,
- 'SigningMethod': SigningMethod,
- 'SigningMethodType': SigningMethodType_,
+ "DigestMethod": DigestMethod,
+ "DigestMethodType": DigestMethodType_,
+ "SigningMethod": SigningMethod,
+ "SigningMethodType": SigningMethodType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/extension/dri.py b/src/saml2/extension/dri.py
index ba6002dd..4f9fa8e5 100644
--- a/src/saml2/extension/dri.py
+++ b/src/saml2/extension/dri.py
@@ -6,18 +6,18 @@
import saml2
from saml2 import SamlBase
-
from saml2 import md
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:metadata:dri'
+
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:metadata:dri"
class CreationInstant(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:CreationInstant element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:CreationInstant element"""
- c_tag = 'CreationInstant'
+ c_tag = "CreationInstant"
c_namespace = NAMESPACE
- c_value_type = {'base': 'datetime'}
+ c_value_type = {"base": "datetime"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -29,11 +29,11 @@ def creation_instant_from_string(xml_string):
class SerialNumber(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:SerialNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:SerialNumber element"""
- c_tag = 'SerialNumber'
+ c_tag = "SerialNumber"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -45,11 +45,11 @@ def serial_number_from_string(xml_string):
class UsagePolicy(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:UsagePolicy element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:UsagePolicy element"""
- c_tag = 'UsagePolicy'
+ c_tag = "UsagePolicy"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -61,30 +61,32 @@ def usage_policy_from_string(xml_string):
class PublisherType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:PublisherType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:PublisherType element"""
- c_tag = 'PublisherType'
+ c_tag = "PublisherType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['PublisherID'] = ('publisher_id', 'md:entityIDType', True)
- c_attributes['CreationInstant'] = ('creation_instant', 'datetime', False)
- c_attributes['SerialNumber'] = ('serial_number', 'string', False)
-
- def __init__(self,
- publisher_id=None,
- creation_instant=None,
- serial_number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_attributes["PublisherID"] = ("publisher_id", "md:entityIDType", True)
+ c_attributes["CreationInstant"] = ("creation_instant", "datetime", False)
+ c_attributes["SerialNumber"] = ("serial_number", "string", False)
+
+ def __init__(
+ self,
+ publisher_id=None,
+ creation_instant=None,
+ serial_number=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.publisher_id = publisher_id
self.creation_instant = creation_instant
@@ -97,9 +99,9 @@ def publisher_type__from_string(xml_string):
class RegistrationAuthority(md.EntityIDType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationAuthority
- element """
+ element"""
- c_tag = 'RegistrationAuthority'
+ c_tag = "RegistrationAuthority"
c_namespace = NAMESPACE
c_children = md.EntityIDType_.c_children.copy()
c_attributes = md.EntityIDType_.c_attributes.copy()
@@ -113,11 +115,11 @@ def registration_authority_from_string(xml_string):
class RegistrationInstant(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationInstant
- element """
+ element"""
- c_tag = 'RegistrationInstant'
+ c_tag = "RegistrationInstant"
c_namespace = NAMESPACE
- c_value_type = {'base': 'datetime'}
+ c_value_type = {"base": "datetime"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -130,11 +132,11 @@ def registration_instant_from_string(xml_string):
class RegistrationPolicy(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationPolicy
- element """
+ element"""
- c_tag = 'RegistrationPolicy'
+ c_tag = "RegistrationPolicy"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -146,9 +148,9 @@ def registration_policy_from_string(xml_string):
class Publisher(PublisherType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:Publisher element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:Publisher element"""
- c_tag = 'Publisher'
+ c_tag = "Publisher"
c_namespace = NAMESPACE
c_children = PublisherType_.c_children.copy()
c_attributes = PublisherType_.c_attributes.copy()
@@ -162,39 +164,43 @@ def publisher_from_string(xml_string):
class RegistrationInfoType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationInfoType
- element """
+ element"""
- c_tag = 'RegistrationInfoType'
+ c_tag = "RegistrationInfoType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata:dri}RegistrationAuthority'] = (
- 'registration_authority', RegistrationAuthority)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata:dri}RegistrationInstant'] = (
- 'registration_instant', RegistrationInstant)
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata:dri}RegistrationPolicy'] = (
- 'registration_policy', RegistrationPolicy)
- c_cardinality['registration_policy'] = {"min": 0, "max": 1}
- c_child_order.extend(['registration_authority', 'registration_instant',
- 'registration_policy'])
-
- def __init__(self,
- registration_authority=None,
- registration_instant=None,
- registration_policy=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}RegistrationAuthority"] = (
+ "registration_authority",
+ RegistrationAuthority,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}RegistrationInstant"] = (
+ "registration_instant",
+ RegistrationInstant,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}RegistrationPolicy"] = (
+ "registration_policy",
+ RegistrationPolicy,
+ )
+ c_cardinality["registration_policy"] = {"min": 0, "max": 1}
+ c_child_order.extend(["registration_authority", "registration_instant", "registration_policy"])
+
+ def __init__(
+ self,
+ registration_authority=None,
+ registration_instant=None,
+ registration_policy=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.registration_authority = registration_authority
self.registration_instant = registration_instant
@@ -206,29 +212,30 @@ def registration_info_type__from_string(xml_string):
class PublishersType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:PublishersType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:PublishersType element"""
- c_tag = 'PublishersType'
+ c_tag = "PublishersType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata:dri}Publisher'] = (
- 'publisher', [Publisher])
- c_cardinality['publisher'] = {"min": 0}
- c_child_order.extend(['publisher'])
-
- def __init__(self,
- publisher=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}Publisher"] = ("publisher", [Publisher])
+ c_cardinality["publisher"] = {"min": 0}
+ c_child_order.extend(["publisher"])
+
+ def __init__(
+ self,
+ publisher=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.publisher = publisher or []
@@ -238,9 +245,9 @@ def publishers_type__from_string(xml_string):
class RegistrationInfo(RegistrationInfoType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationInfo element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationInfo element"""
- c_tag = 'RegistrationInfo'
+ c_tag = "RegistrationInfo"
c_namespace = NAMESPACE
c_children = RegistrationInfoType_.c_children.copy()
c_attributes = RegistrationInfoType_.c_attributes.copy()
@@ -253,9 +260,9 @@ def registration_info_from_string(xml_string):
class Publishers(PublishersType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:Publishers element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:Publishers element"""
- c_tag = 'Publishers'
+ c_tag = "Publishers"
c_namespace = NAMESPACE
c_children = PublishersType_.c_children.copy()
c_attributes = PublishersType_.c_attributes.copy()
@@ -268,42 +275,39 @@ def publishers_from_string(xml_string):
class DocumentInfoType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:DocumentInfoType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:DocumentInfoType element"""
- c_tag = 'DocumentInfoType'
+ c_tag = "DocumentInfoType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata:dri}CreationInstant'] = (
- 'creation_instant', CreationInstant)
- c_cardinality['creation_instant'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata:dri}SerialNumber'] = (
- 'serial_number', SerialNumber)
- c_cardinality['serial_number'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata:dri}UsagePolicy'] = (
- 'usage_policy', UsagePolicy)
- c_cardinality['usage_policy'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata:dri}Publishers'] = (
- 'publishers', Publishers)
- c_cardinality['publishers'] = {"min": 0, "max": 1}
- c_child_order.extend(
- ['creation_instant', 'serial_number', 'usage_policy', 'publishers'])
-
- def __init__(self,
- creation_instant=None,
- serial_number=None,
- usage_policy=None,
- publishers=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}CreationInstant"] = ("creation_instant", CreationInstant)
+ c_cardinality["creation_instant"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}SerialNumber"] = ("serial_number", SerialNumber)
+ c_cardinality["serial_number"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}UsagePolicy"] = ("usage_policy", UsagePolicy)
+ c_cardinality["usage_policy"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata:dri}Publishers"] = ("publishers", Publishers)
+ c_cardinality["publishers"] = {"min": 0, "max": 1}
+ c_child_order.extend(["creation_instant", "serial_number", "usage_policy", "publishers"])
+
+ def __init__(
+ self,
+ creation_instant=None,
+ serial_number=None,
+ usage_policy=None,
+ publishers=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.creation_instant = creation_instant
self.serial_number = serial_number
@@ -316,9 +320,9 @@ def document_info_type__from_string(xml_string):
class DocumentInfo(DocumentInfoType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:dri:DocumentInfo element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:dri:DocumentInfo element"""
- c_tag = 'DocumentInfo'
+ c_tag = "DocumentInfo"
c_namespace = NAMESPACE
c_children = DocumentInfoType_.c_children.copy()
c_attributes = DocumentInfoType_.c_attributes.copy()
@@ -348,23 +352,22 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'DocumentInfo': DocumentInfo,
- 'DocumentInfoType': DocumentInfoType_,
- 'CreationInstant': CreationInstant,
- 'SerialNumber': SerialNumber,
- 'UsagePolicy': UsagePolicy,
- 'Publishers': Publishers,
- 'PublishersType': PublishersType_,
- 'Publisher': Publisher,
- 'PublisherType': PublisherType_,
- 'RegistrationInfo': RegistrationInfo,
- 'RegistrationInfoType': RegistrationInfoType_,
- 'RegistrationAuthority': RegistrationAuthority,
- 'RegistrationInstant': RegistrationInstant,
- 'RegistrationPolicy': RegistrationPolicy,
+ "DocumentInfo": DocumentInfo,
+ "DocumentInfoType": DocumentInfoType_,
+ "CreationInstant": CreationInstant,
+ "SerialNumber": SerialNumber,
+ "UsagePolicy": UsagePolicy,
+ "Publishers": Publishers,
+ "PublishersType": PublishersType_,
+ "Publisher": Publisher,
+ "PublisherType": PublisherType_,
+ "RegistrationInfo": RegistrationInfo,
+ "RegistrationInfoType": RegistrationInfoType_,
+ "RegistrationAuthority": RegistrationAuthority,
+ "RegistrationInstant": RegistrationInstant,
+ "RegistrationPolicy": RegistrationPolicy,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/extension/idpdisc.py b/src/saml2/extension/idpdisc.py
index dc515584..216a54d7 100644
--- a/src/saml2/extension/idpdisc.py
+++ b/src/saml2/extension/idpdisc.py
@@ -7,15 +7,16 @@
import saml2
from saml2 import md
-NAMESPACE = 'urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol'
+
+NAMESPACE = "urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
BINDING_DISCO = "urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
class DiscoveryResponse(md.IndexedEndpointType_):
"""The urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol:
- DiscoveryResponse element """
+ DiscoveryResponse element"""
- c_tag = 'DiscoveryResponse'
+ c_tag = "DiscoveryResponse"
c_namespace = NAMESPACE
c_children = md.IndexedEndpointType_.c_children.copy()
c_attributes = md.IndexedEndpointType_.c_attributes.copy()
@@ -32,10 +33,9 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'DiscoveryResponse': DiscoveryResponse,
+ "DiscoveryResponse": DiscoveryResponse,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/extension/mdattr.py b/src/saml2/extension/mdattr.py
index 9587c449..faf53258 100644
--- a/src/saml2/extension/mdattr.py
+++ b/src/saml2/extension/mdattr.py
@@ -6,55 +6,60 @@
import saml2
from saml2 import SamlBase
-
from saml2 import saml
-NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:attribute'
+
+NAMESPACE = "urn:oasis:names:tc:SAML:metadata:attribute"
+
class EntityAttributesType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:attribute:EntityAttributesType element """
+ """The urn:oasis:names:tc:SAML:metadata:attribute:EntityAttributesType element"""
- c_tag = 'EntityAttributesType'
+ c_tag = "EntityAttributesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Attribute'] = ('attribute', [saml.Attribute])
- c_cardinality['attribute'] = {"min":0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Assertion'] = ('assertion', [saml.Assertion])
- c_cardinality['assertion'] = {"min":0}
- c_child_order.extend(['attribute', 'assertion'])
-
- def __init__(self,
- attribute=None,
- assertion=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.attribute=attribute or []
- self.assertion=assertion or []
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Attribute"] = ("attribute", [saml.Attribute])
+ c_cardinality["attribute"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Assertion"] = ("assertion", [saml.Assertion])
+ c_cardinality["assertion"] = {"min": 0}
+ c_child_order.extend(["attribute", "assertion"])
+
+ def __init__(
+ self,
+ attribute=None,
+ assertion=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.attribute = attribute or []
+ self.assertion = assertion or []
+
def entity_attributes_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EntityAttributesType_, xml_string)
class EntityAttributes(EntityAttributesType_):
- """The urn:oasis:names:tc:SAML:metadata:attribute:EntityAttributes element """
+ """The urn:oasis:names:tc:SAML:metadata:attribute:EntityAttributes element"""
- c_tag = 'EntityAttributes'
+ c_tag = "EntityAttributes"
c_namespace = NAMESPACE
c_children = EntityAttributesType_.c_children.copy()
c_attributes = EntityAttributesType_.c_attributes.copy()
c_child_order = EntityAttributesType_.c_child_order[:]
c_cardinality = EntityAttributesType_.c_cardinality.copy()
+
def entity_attributes_from_string(xml_string):
return saml2.create_class_from_xml_string(EntityAttributes, xml_string)
@@ -65,11 +70,10 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'EntityAttributes': EntityAttributes,
- 'EntityAttributesType': EntityAttributesType_,
+ "EntityAttributes": EntityAttributes,
+ "EntityAttributesType": EntityAttributesType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/extension/mdrpi.py b/src/saml2/extension/mdrpi.py
index 5951ed61..77aba50e 100644
--- a/src/saml2/extension/mdrpi.py
+++ b/src/saml2/extension/mdrpi.py
@@ -6,16 +6,16 @@
import saml2
from saml2 import SamlBase
-
from saml2 import md
-NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:rpi'
+
+NAMESPACE = "urn:oasis:names:tc:SAML:metadata:rpi"
class RegistrationPolicy(md.LocalizedURIType_):
- """The urn:oasis:names:tc:SAML:metadata:rpi:RegistrationPolicy element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:RegistrationPolicy element"""
- c_tag = 'RegistrationPolicy'
+ c_tag = "RegistrationPolicy"
c_namespace = NAMESPACE
c_children = md.LocalizedURIType_.c_children.copy()
c_attributes = md.LocalizedURIType_.c_attributes.copy()
@@ -28,9 +28,9 @@ def registration_policy_from_string(xml_string):
class UsagePolicy(md.LocalizedURIType_):
- """The urn:oasis:names:tc:SAML:metadata:rpi:UsagePolicy element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:UsagePolicy element"""
- c_tag = 'UsagePolicy'
+ c_tag = "UsagePolicy"
c_namespace = NAMESPACE
c_children = md.LocalizedURIType_.c_children.copy()
c_attributes = md.LocalizedURIType_.c_attributes.copy()
@@ -43,29 +43,30 @@ def usage_policy_from_string(xml_string):
class PublicationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationType element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationType element"""
- c_tag = 'PublicationType'
+ c_tag = "PublicationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['publisher'] = ('publisher', 'string', True)
- c_attributes['creationInstant'] = ('creation_instant', 'dateTime', False)
- c_attributes['publicationId'] = ('publication_id', 'string', False)
-
- def __init__(self,
- publisher=None,
- creation_instant=None,
- publication_id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["publisher"] = ("publisher", "string", True)
+ c_attributes["creationInstant"] = ("creation_instant", "dateTime", False)
+ c_attributes["publicationId"] = ("publication_id", "string", False)
+
+ def __init__(
+ self,
+ publisher=None,
+ creation_instant=None,
+ publication_id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.publisher = publisher
self.creation_instant = creation_instant
self.publication_id = publication_id
@@ -76,34 +77,35 @@ def publication_type__from_string(xml_string):
class RegistrationInfoType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:rpi:RegistrationInfoType element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:RegistrationInfoType element"""
- c_tag = 'RegistrationInfoType'
+ c_tag = "RegistrationInfoType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:metadata:rpi}RegistrationPolicy'] = (
- 'registration_policy', [RegistrationPolicy])
- c_cardinality['registration_policy'] = {"min": 0}
- c_attributes['registrationAuthority'] = (
- 'registration_authority', 'string', True)
- c_attributes['registrationInstant'] = (
- 'registration_instant', 'dateTime', False)
- c_child_order.extend(['registration_policy'])
-
- def __init__(self,
- registration_policy=None,
- registration_authority=None,
- registration_instant=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:metadata:rpi}RegistrationPolicy"] = (
+ "registration_policy",
+ [RegistrationPolicy],
+ )
+ c_cardinality["registration_policy"] = {"min": 0}
+ c_attributes["registrationAuthority"] = ("registration_authority", "string", True)
+ c_attributes["registrationInstant"] = ("registration_instant", "dateTime", False)
+ c_child_order.extend(["registration_policy"])
+
+ def __init__(
+ self,
+ registration_policy=None,
+ registration_authority=None,
+ registration_instant=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.registration_policy = registration_policy or []
self.registration_authority = registration_authority
self.registration_instant = registration_instant
@@ -114,34 +116,34 @@ def registration_info_type__from_string(xml_string):
class PublicationInfoType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationInfoType element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationInfoType element"""
- c_tag = 'PublicationInfoType'
+ c_tag = "PublicationInfoType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:metadata:rpi}UsagePolicy'] = (
- 'usage_policy', [UsagePolicy])
- c_cardinality['usage_policy'] = {"min": 0}
- c_attributes['publisher'] = ('publisher', 'string', True)
- c_attributes['creationInstant'] = ('creation_instant', 'dateTime', False)
- c_attributes['publicationId'] = ('publication_id', 'string', False)
- c_child_order.extend(['usage_policy'])
-
- def __init__(self,
- usage_policy=None,
- publisher=None,
- creation_instant=None,
- publication_id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:metadata:rpi}UsagePolicy"] = ("usage_policy", [UsagePolicy])
+ c_cardinality["usage_policy"] = {"min": 0}
+ c_attributes["publisher"] = ("publisher", "string", True)
+ c_attributes["creationInstant"] = ("creation_instant", "dateTime", False)
+ c_attributes["publicationId"] = ("publication_id", "string", False)
+ c_child_order.extend(["usage_policy"])
+
+ def __init__(
+ self,
+ usage_policy=None,
+ publisher=None,
+ creation_instant=None,
+ publication_id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.usage_policy = usage_policy or []
self.publisher = publisher
self.creation_instant = creation_instant
@@ -153,9 +155,9 @@ def publication_info_type__from_string(xml_string):
class Publication(PublicationType_):
- """The urn:oasis:names:tc:SAML:metadata:rpi:Publication element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:Publication element"""
- c_tag = 'Publication'
+ c_tag = "Publication"
c_namespace = NAMESPACE
c_children = PublicationType_.c_children.copy()
c_attributes = PublicationType_.c_attributes.copy()
@@ -168,9 +170,9 @@ def publication_from_string(xml_string):
class RegistrationInfo(RegistrationInfoType_):
- """The urn:oasis:names:tc:SAML:metadata:rpi:RegistrationInfo element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:RegistrationInfo element"""
- c_tag = 'RegistrationInfo'
+ c_tag = "RegistrationInfo"
c_namespace = NAMESPACE
c_children = RegistrationInfoType_.c_children.copy()
c_attributes = RegistrationInfoType_.c_attributes.copy()
@@ -183,9 +185,9 @@ def registration_info_from_string(xml_string):
class PublicationInfo(PublicationInfoType_):
- """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationInfo element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationInfo element"""
- c_tag = 'PublicationInfo'
+ c_tag = "PublicationInfo"
c_namespace = NAMESPACE
c_children = PublicationInfoType_.c_children.copy()
c_attributes = PublicationInfoType_.c_attributes.copy()
@@ -198,28 +200,22 @@ def publication_info_from_string(xml_string):
class PublicationPathType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationPathType element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationPathType element"""
- c_tag = 'PublicationPathType'
+ c_tag = "PublicationPathType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:metadata:rpi}Publication'] = (
- 'publication', [Publication])
- c_cardinality['publication'] = {"min": 0}
- c_child_order.extend(['publication'])
-
- def __init__(self,
- publication=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:metadata:rpi}Publication"] = ("publication", [Publication])
+ c_cardinality["publication"] = {"min": 0}
+ c_child_order.extend(["publication"])
+
+ def __init__(self, publication=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.publication = publication or []
@@ -228,9 +224,9 @@ def publication_path_type__from_string(xml_string):
class PublicationPath(PublicationPathType_):
- """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationPath element """
+ """The urn:oasis:names:tc:SAML:metadata:rpi:PublicationPath element"""
- c_tag = 'PublicationPath'
+ c_tag = "PublicationPath"
c_namespace = NAMESPACE
c_children = PublicationPathType_.c_children.copy()
c_attributes = PublicationPathType_.c_attributes.copy()
@@ -256,19 +252,18 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'RegistrationInfo': RegistrationInfo,
- 'RegistrationInfoType': RegistrationInfoType_,
- 'RegistrationPolicy': RegistrationPolicy,
- 'PublicationInfo': PublicationInfo,
- 'PublicationInfoType': PublicationInfoType_,
- 'UsagePolicy': UsagePolicy,
- 'PublicationPath': PublicationPath,
- 'PublicationPathType': PublicationPathType_,
- 'Publication': Publication,
- 'PublicationType': PublicationType_,
+ "RegistrationInfo": RegistrationInfo,
+ "RegistrationInfoType": RegistrationInfoType_,
+ "RegistrationPolicy": RegistrationPolicy,
+ "PublicationInfo": PublicationInfo,
+ "PublicationInfoType": PublicationInfoType_,
+ "UsagePolicy": UsagePolicy,
+ "PublicationPath": PublicationPath,
+ "PublicationPathType": PublicationPathType_,
+ "Publication": Publication,
+ "PublicationType": PublicationType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/extension/mdui.py b/src/saml2/extension/mdui.py
index b27933c9..6ed0b636 100644
--- a/src/saml2/extension/mdui.py
+++ b/src/saml2/extension/mdui.py
@@ -6,16 +6,16 @@
import saml2
from saml2 import SamlBase
-
from saml2 import md
-NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:ui'
+
+NAMESPACE = "urn:oasis:names:tc:SAML:metadata:ui"
class DisplayName(md.LocalizedNameType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:DisplayName element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:DisplayName element"""
- c_tag = 'DisplayName'
+ c_tag = "DisplayName"
c_namespace = NAMESPACE
c_children = md.LocalizedNameType_.c_children.copy()
c_attributes = md.LocalizedNameType_.c_attributes.copy()
@@ -28,9 +28,9 @@ def display_name_from_string(xml_string):
class Description(md.LocalizedNameType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:Description element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:Description element"""
- c_tag = 'Description'
+ c_tag = "Description"
c_namespace = NAMESPACE
c_children = md.LocalizedNameType_.c_children.copy()
c_attributes = md.LocalizedNameType_.c_attributes.copy()
@@ -43,9 +43,9 @@ def description_from_string(xml_string):
class InformationURL(md.LocalizedURIType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:InformationURL element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:InformationURL element"""
- c_tag = 'InformationURL'
+ c_tag = "InformationURL"
c_namespace = NAMESPACE
c_children = md.LocalizedURIType_.c_children.copy()
c_attributes = md.LocalizedURIType_.c_attributes.copy()
@@ -58,9 +58,9 @@ def information_url_from_string(xml_string):
class PrivacyStatementURL(md.LocalizedURIType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:PrivacyStatementURL element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:PrivacyStatementURL element"""
- c_tag = 'PrivacyStatementURL'
+ c_tag = "PrivacyStatementURL"
c_namespace = NAMESPACE
c_children = md.LocalizedURIType_.c_children.copy()
c_attributes = md.LocalizedURIType_.c_attributes.copy()
@@ -73,11 +73,11 @@ def privacy_statement_url_from_string(xml_string):
class ListOfStrings_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:ui:listOfStrings element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:listOfStrings element"""
- c_tag = 'listOfStrings'
+ c_tag = "listOfStrings"
c_namespace = NAMESPACE
- c_value_type = {'member': 'string', 'base': 'list'}
+ c_value_type = {"member": "string", "base": "list"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -89,26 +89,20 @@ def list_of_strings__from_string(xml_string):
class KeywordsType_(ListOfStrings_):
- """The urn:oasis:names:tc:SAML:metadata:ui:KeywordsType element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:KeywordsType element"""
- c_tag = 'KeywordsType'
+ c_tag = "KeywordsType"
c_namespace = NAMESPACE
c_children = ListOfStrings_.c_children.copy()
c_attributes = ListOfStrings_.c_attributes.copy()
c_child_order = ListOfStrings_.c_child_order[:]
c_cardinality = ListOfStrings_.c_cardinality.copy()
- c_attributes['{http://www.w3.org/XML/1998/namespace}lang'] = (
- 'lang', 'mdui:listOfStrings', True)
-
- def __init__(self,
- lang=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- ListOfStrings_.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["{http://www.w3.org/XML/1998/namespace}lang"] = ("lang", "mdui:listOfStrings", True)
+
+ def __init__(self, lang=None, text=None, extension_elements=None, extension_attributes=None):
+ ListOfStrings_.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.lang = lang
@@ -117,31 +111,25 @@ def keywords_type__from_string(xml_string):
class LogoType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:ui:LogoType element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:LogoType element"""
- c_tag = 'LogoType'
+ c_tag = "LogoType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['height'] = ('height', 'positiveInteger', True)
- c_attributes['width'] = ('width', 'positiveInteger', True)
- c_attributes['{http://www.w3.org/XML/1998/namespace}lang'] = (
- 'lang', 'anyURI', False)
-
- def __init__(self,
- height=None,
- width=None,
- lang=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["height"] = ("height", "positiveInteger", True)
+ c_attributes["width"] = ("width", "positiveInteger", True)
+ c_attributes["{http://www.w3.org/XML/1998/namespace}lang"] = ("lang", "anyURI", False)
+
+ def __init__(
+ self, height=None, width=None, lang=None, text=None, extension_elements=None, extension_attributes=None
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.height = height
self.width = width
self.lang = lang
@@ -152,11 +140,11 @@ def logo_type__from_string(xml_string):
class IPHint(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:ui:IPHint element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:IPHint element"""
- c_tag = 'IPHint'
+ c_tag = "IPHint"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -168,11 +156,11 @@ def ip_hint_from_string(xml_string):
class DomainHint(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:ui:DomainHint element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:DomainHint element"""
- c_tag = 'DomainHint'
+ c_tag = "DomainHint"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -184,11 +172,11 @@ def domain_hint_from_string(xml_string):
class GeolocationHint(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:ui:GeolocationHint element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:GeolocationHint element"""
- c_tag = 'GeolocationHint'
+ c_tag = "GeolocationHint"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -200,9 +188,9 @@ def geolocation_hint_from_string(xml_string):
class Keywords(KeywordsType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:Keywords element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:Keywords element"""
- c_tag = 'Keywords'
+ c_tag = "Keywords"
c_namespace = NAMESPACE
c_children = KeywordsType_.c_children.copy()
c_attributes = KeywordsType_.c_attributes.copy()
@@ -215,9 +203,9 @@ def keywords_from_string(xml_string):
class Logo(LogoType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:Logo element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:Logo element"""
- c_tag = 'Logo'
+ c_tag = "Logo"
c_namespace = NAMESPACE
c_children = LogoType_.c_children.copy()
c_attributes = LogoType_.c_attributes.copy()
@@ -230,36 +218,34 @@ def logo_from_string(xml_string):
class DiscoHintsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:ui:DiscoHintsType element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:DiscoHintsType element"""
- c_tag = 'DiscoHintsType'
+ c_tag = "DiscoHintsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}IPHint'] = (
- 'ip_hint', [IPHint])
- c_cardinality['ip_hint'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}DomainHint'] = (
- 'domain_hint', [DomainHint])
- c_cardinality['domain_hint'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}GeolocationHint'] = (
- 'geolocation_hint', [GeolocationHint])
- c_cardinality['geolocation_hint'] = {"min": 0}
- c_child_order.extend(['ip_hint', 'domain_hint', 'geolocation_hint'])
-
- def __init__(self,
- ip_hint=None,
- domain_hint=None,
- geolocation_hint=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}IPHint"] = ("ip_hint", [IPHint])
+ c_cardinality["ip_hint"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}DomainHint"] = ("domain_hint", [DomainHint])
+ c_cardinality["domain_hint"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}GeolocationHint"] = ("geolocation_hint", [GeolocationHint])
+ c_cardinality["geolocation_hint"] = {"min": 0}
+ c_child_order.extend(["ip_hint", "domain_hint", "geolocation_hint"])
+
+ def __init__(
+ self,
+ ip_hint=None,
+ domain_hint=None,
+ geolocation_hint=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.ip_hint = ip_hint or []
self.domain_hint = domain_hint or []
self.geolocation_hint = geolocation_hint or []
@@ -270,49 +256,48 @@ def disco_hints_type__from_string(xml_string):
class UIInfoType_(SamlBase):
- """The urn:oasis:names:tc:SAML:metadata:ui:UIInfoType element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:UIInfoType element"""
- c_tag = 'UIInfoType'
+ c_tag = "UIInfoType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}DisplayName'] = (
- 'display_name', [DisplayName])
- c_cardinality['display_name'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}Description'] = (
- 'description', [Description])
- c_cardinality['description'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}Keywords'] = (
- 'keywords', [Keywords])
- c_cardinality['keywords'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}Logo'] = ('logo', [Logo])
- c_cardinality['logo'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}InformationURL'] = (
- 'information_url', [InformationURL])
- c_cardinality['information_url'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:metadata:ui}PrivacyStatementURL'] = (
- 'privacy_statement_url', [PrivacyStatementURL])
- c_cardinality['privacy_statement_url'] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}DisplayName"] = ("display_name", [DisplayName])
+ c_cardinality["display_name"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}Description"] = ("description", [Description])
+ c_cardinality["description"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}Keywords"] = ("keywords", [Keywords])
+ c_cardinality["keywords"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}Logo"] = ("logo", [Logo])
+ c_cardinality["logo"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}InformationURL"] = ("information_url", [InformationURL])
+ c_cardinality["information_url"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:metadata:ui}PrivacyStatementURL"] = (
+ "privacy_statement_url",
+ [PrivacyStatementURL],
+ )
+ c_cardinality["privacy_statement_url"] = {"min": 0}
c_child_order.extend(
- ['display_name', 'description', 'keywords', 'logo', 'information_url',
- 'privacy_statement_url'])
-
- def __init__(self,
- display_name=None,
- description=None,
- keywords=None,
- logo=None,
- information_url=None,
- privacy_statement_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ ["display_name", "description", "keywords", "logo", "information_url", "privacy_statement_url"]
+ )
+
+ def __init__(
+ self,
+ display_name=None,
+ description=None,
+ keywords=None,
+ logo=None,
+ information_url=None,
+ privacy_statement_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.display_name = display_name or []
self.description = description or []
self.keywords = keywords or []
@@ -326,9 +311,9 @@ def ui_info_type__from_string(xml_string):
class DiscoHints(DiscoHintsType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:DiscoHints element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:DiscoHints element"""
- c_tag = 'DiscoHints'
+ c_tag = "DiscoHints"
c_namespace = NAMESPACE
c_children = DiscoHintsType_.c_children.copy()
c_attributes = DiscoHintsType_.c_attributes.copy()
@@ -341,9 +326,9 @@ def disco_hints_from_string(xml_string):
class UIInfo(UIInfoType_):
- """The urn:oasis:names:tc:SAML:metadata:ui:UIInfo element """
+ """The urn:oasis:names:tc:SAML:metadata:ui:UIInfo element"""
- c_tag = 'UIInfo'
+ c_tag = "UIInfo"
c_namespace = NAMESPACE
c_children = UIInfoType_.c_children.copy()
c_attributes = UIInfoType_.c_attributes.copy()
@@ -375,22 +360,22 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'UIInfo': UIInfo,
- 'UIInfoType': UIInfoType_,
- 'DisplayName': DisplayName,
- 'Description': Description,
- 'InformationURL': InformationURL,
- 'PrivacyStatementURL': PrivacyStatementURL,
- 'Keywords': Keywords,
- 'KeywordsType': KeywordsType_,
- 'listOfStrings': ListOfStrings_,
- 'Logo': Logo,
- 'LogoType': LogoType_,
- 'DiscoHints': DiscoHints,
- 'DiscoHintsType': DiscoHintsType_,
- 'IPHint': IPHint,
- 'DomainHint': DomainHint,
- 'GeolocationHint': GeolocationHint,
+ "UIInfo": UIInfo,
+ "UIInfoType": UIInfoType_,
+ "DisplayName": DisplayName,
+ "Description": Description,
+ "InformationURL": InformationURL,
+ "PrivacyStatementURL": PrivacyStatementURL,
+ "Keywords": Keywords,
+ "KeywordsType": KeywordsType_,
+ "listOfStrings": ListOfStrings_,
+ "Logo": Logo,
+ "LogoType": LogoType_,
+ "DiscoHints": DiscoHints,
+ "DiscoHintsType": DiscoHintsType_,
+ "IPHint": IPHint,
+ "DomainHint": DomainHint,
+ "GeolocationHint": GeolocationHint,
}
diff --git a/src/saml2/extension/pefim.py b/src/saml2/extension/pefim.py
index 4212519f..5aeeb253 100644
--- a/src/saml2/extension/pefim.py
+++ b/src/saml2/extension/pefim.py
@@ -4,35 +4,36 @@ import saml2
from saml2 import SamlBase
from saml2.xmldsig import KeyInfo
-NAMESPACE = 'urn:net:eustix:names:tc:PEFIM:0.0:assertion'
+
+NAMESPACE = "urn:net:eustix:names:tc:PEFIM:0.0:assertion"
class SPCertEncType_(SamlBase):
- """The urn:net:eustix:names:tc:PEFIM:0.0:assertion:SPCertEncType element """
+ """The urn:net:eustix:names:tc:PEFIM:0.0:assertion:SPCertEncType element"""
- c_tag = 'SPCertEncType'
+ c_tag = "SPCertEncType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyInfo'] = ('key_info',
- [KeyInfo])
- c_cardinality['key_info'] = {"min": 1}
- c_attributes['VerifyDepth'] = ('verify_depth', 'unsignedByte', False)
- c_child_order.extend(['key_info'])
-
- def __init__(self,
- key_info=None,
- x509_data=None,
- verify_depth='1',
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyInfo"] = ("key_info", [KeyInfo])
+ c_cardinality["key_info"] = {"min": 1}
+ c_attributes["VerifyDepth"] = ("verify_depth", "unsignedByte", False)
+ c_child_order.extend(["key_info"])
+
+ def __init__(
+ self,
+ key_info=None,
+ x509_data=None,
+ verify_depth="1",
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
if key_info:
self.key_info = key_info
elif x509_data:
@@ -40,7 +41,7 @@ class SPCertEncType_(SamlBase):
else:
self.key_info = []
self.verify_depth = verify_depth
- #self.x509_data = x509_data
+ # self.x509_data = x509_data
def spcertenc_type__from_string(xml_string):
@@ -48,9 +49,9 @@ def spcertenc_type__from_string(xml_string):
class SPCertEnc(SPCertEncType_):
- """The urn:net:eustix:names:tc:PEFIM:0.0:assertion:SPCertEnc element """
+ """The urn:net:eustix:names:tc:PEFIM:0.0:assertion:SPCertEnc element"""
- c_tag = 'SPCertEnc'
+ c_tag = "SPCertEnc"
c_namespace = NAMESPACE
c_children = SPCertEncType_.c_children.copy()
c_attributes = SPCertEncType_.c_attributes.copy()
@@ -68,10 +69,10 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'SPCertEnc': SPCertEnc,
- 'SPCertEncType': SPCertEncType_,
+ "SPCertEnc": SPCertEnc,
+ "SPCertEncType": SPCertEncType_,
}
def factory(tag, **kwargs):
- return ELEMENT_BY_TAG[tag](**kwargs) \ No newline at end of file
+ return ELEMENT_BY_TAG[tag](**kwargs)
diff --git a/src/saml2/extension/reqinit.py b/src/saml2/extension/reqinit.py
index 58ccc131..c6742358 100644
--- a/src/saml2/extension/reqinit.py
+++ b/src/saml2/extension/reqinit.py
@@ -5,17 +5,17 @@
#
import saml2
-
from saml2 import md
-NAMESPACE = 'urn:oasis:names:tc:SAML:profiles:SSO:request-init'
+
+NAMESPACE = "urn:oasis:names:tc:SAML:profiles:SSO:request-init"
class RequestInitiator(md.EndpointType_):
"""The urn:oasis:names:tc:SAML:profiles:SSO:request-init:RequestInitiator
- element """
+ element"""
- c_tag = 'RequestInitiator'
+ c_tag = "RequestInitiator"
c_namespace = NAMESPACE
c_children = md.EndpointType_.c_children.copy()
c_attributes = md.EndpointType_.c_attributes.copy()
@@ -32,10 +32,9 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'RequestInitiator': RequestInitiator,
+ "RequestInitiator": RequestInitiator,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/extension/requested_attributes.py b/src/saml2/extension/requested_attributes.py
index 3d574f15..e12ae864 100644
--- a/src/saml2/extension/requested_attributes.py
+++ b/src/saml2/extension/requested_attributes.py
@@ -6,108 +6,119 @@
import saml2
from saml2 import SamlBase
-
from saml2 import saml
-NAMESPACE = 'http://eidas.europa.eu/saml-extensions'
+NAMESPACE = "http://eidas.europa.eu/saml-extensions"
+
class RequestedAttributeType_(SamlBase):
- """The http://eidas.europa.eu/saml-extensions:RequestedAttributeType element """
+ """The http://eidas.europa.eu/saml-extensions:RequestedAttributeType element"""
- c_tag = 'RequestedAttributeType'
+ c_tag = "RequestedAttributeType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AttributeValue'] = ('attribute_value', [saml.AttributeValue])
- c_cardinality['attribute_value'] = {"min":0}
- c_attributes['Name'] = ('name', 'None', True)
- c_attributes['NameFormat'] = ('name_format', 'None', True)
- c_attributes['FriendlyName'] = ('friendly_name', 'None', False)
- c_attributes['isRequired'] = ('is_required', 'None', False)
- c_child_order.extend(['attribute_value'])
-
- def __init__(self,
- attribute_value=None,
- name=None,
- name_format=None,
- friendly_name=None,
- is_required=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.attribute_value=attribute_value or []
- self.name=name
- self.name_format=name_format
- self.friendly_name=friendly_name
- self.is_required=is_required
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AttributeValue"] = ("attribute_value", [saml.AttributeValue])
+ c_cardinality["attribute_value"] = {"min": 0}
+ c_attributes["Name"] = ("name", "None", True)
+ c_attributes["NameFormat"] = ("name_format", "None", True)
+ c_attributes["FriendlyName"] = ("friendly_name", "None", False)
+ c_attributes["isRequired"] = ("is_required", "None", False)
+ c_child_order.extend(["attribute_value"])
+
+ def __init__(
+ self,
+ attribute_value=None,
+ name=None,
+ name_format=None,
+ friendly_name=None,
+ is_required=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.attribute_value = attribute_value or []
+ self.name = name
+ self.name_format = name_format
+ self.friendly_name = friendly_name
+ self.is_required = is_required
+
def requested_attribute_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedAttributeType_, xml_string)
class RequestedAttribute(RequestedAttributeType_):
- """The http://eidas.europa.eu/saml-extensions:RequestedAttribute element """
+ """The http://eidas.europa.eu/saml-extensions:RequestedAttribute element"""
- c_tag = 'RequestedAttribute'
+ c_tag = "RequestedAttribute"
c_namespace = NAMESPACE
c_children = RequestedAttributeType_.c_children.copy()
c_attributes = RequestedAttributeType_.c_attributes.copy()
c_child_order = RequestedAttributeType_.c_child_order[:]
c_cardinality = RequestedAttributeType_.c_cardinality.copy()
+
def requested_attribute_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedAttribute, xml_string)
class RequestedAttributesType_(SamlBase):
- """The http://eidas.europa.eu/saml-extensions:RequestedAttributesType element """
+ """The http://eidas.europa.eu/saml-extensions:RequestedAttributesType element"""
- c_tag = 'RequestedAttributesType'
+ c_tag = "RequestedAttributesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://eidas.europa.eu/saml-extensions}RequestedAttribute'] = ('requested_attribute', [RequestedAttribute])
- c_cardinality['requested_attribute'] = {"min":0}
- c_child_order.extend(['requested_attribute'])
-
- def __init__(self,
- requested_attribute=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.requested_attribute=requested_attribute or []
+ c_children["{http://eidas.europa.eu/saml-extensions}RequestedAttribute"] = (
+ "requested_attribute",
+ [RequestedAttribute],
+ )
+ c_cardinality["requested_attribute"] = {"min": 0}
+ c_child_order.extend(["requested_attribute"])
+
+ def __init__(
+ self,
+ requested_attribute=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.requested_attribute = requested_attribute or []
+
def requested_attributes_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedAttributesType_, xml_string)
class RequestedAttributes(RequestedAttributesType_):
- """The http://eidas.europa.eu/saml-extensions:RequestedAttributes element """
+ """The http://eidas.europa.eu/saml-extensions:RequestedAttributes element"""
- c_tag = 'RequestedAttributes'
+ c_tag = "RequestedAttributes"
c_namespace = NAMESPACE
c_children = RequestedAttributesType_.c_children.copy()
c_attributes = RequestedAttributesType_.c_attributes.copy()
c_child_order = RequestedAttributesType_.c_child_order[:]
c_cardinality = RequestedAttributesType_.c_cardinality.copy()
+
def requested_attributes_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedAttributes, xml_string)
@@ -120,10 +131,10 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'RequestedAttributes': RequestedAttributes,
- 'RequestedAttributesType': RequestedAttributesType_,
- 'RequestedAttribute': RequestedAttribute,
- 'RequestedAttributeType': RequestedAttributeType_,
+ "RequestedAttributes": RequestedAttributes,
+ "RequestedAttributesType": RequestedAttributesType_,
+ "RequestedAttribute": RequestedAttribute,
+ "RequestedAttributeType": RequestedAttributeType_,
}
diff --git a/src/saml2/extension/shibmd.py b/src/saml2/extension/shibmd.py
index de6e3fb7..86a1cf54 100644
--- a/src/saml2/extension/shibmd.py
+++ b/src/saml2/extension/shibmd.py
@@ -8,30 +8,26 @@ import saml2
from saml2 import SamlBase
from saml2 import xmldsig as ds
-NAMESPACE = 'urn:mace:shibboleth:metadata:1.0'
+
+NAMESPACE = "urn:mace:shibboleth:metadata:1.0"
class Scope(SamlBase):
- """The urn:mace:shibboleth:metadata:1.0:Scope element """
+ """The urn:mace:shibboleth:metadata:1.0:Scope element"""
- c_tag = 'Scope'
+ c_tag = "Scope"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['regexp'] = ('regexp', 'boolean', False)
-
- def __init__(self,
- regexp='false',
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["regexp"] = ("regexp", "boolean", False)
+
+ def __init__(self, regexp="false", text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.regexp = regexp
@@ -40,30 +36,23 @@ def scope_from_string(xml_string):
class KeyAuthority(SamlBase):
- """The urn:mace:shibboleth:metadata:1.0:KeyAuthority element """
+ """The urn:mace:shibboleth:metadata:1.0:KeyAuthority element"""
- c_tag = 'KeyAuthority'
+ c_tag = "KeyAuthority"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyInfo'] = ('key_info',
- [ds.KeyInfo])
- c_cardinality['key_info'] = {"min": 1}
- c_attributes['VerifyDepth'] = ('verify_depth', 'unsignedByte', False)
- c_child_order.extend(['key_info'])
-
- def __init__(self,
- key_info=None,
- verify_depth='1',
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyInfo"] = ("key_info", [ds.KeyInfo])
+ c_cardinality["key_info"] = {"min": 1}
+ c_attributes["VerifyDepth"] = ("verify_depth", "unsignedByte", False)
+ c_child_order.extend(["key_info"])
+
+ def __init__(self, key_info=None, verify_depth="1", text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.key_info = key_info or []
self.verify_depth = verify_depth
@@ -78,8 +67,8 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'Scope': Scope,
- 'KeyAuthority': KeyAuthority,
+ "Scope": Scope,
+ "KeyAuthority": KeyAuthority,
}
diff --git a/src/saml2/extension/sp_type.py b/src/saml2/extension/sp_type.py
index 8ffb2cea..6ecafdc0 100644
--- a/src/saml2/extension/sp_type.py
+++ b/src/saml2/extension/sp_type.py
@@ -8,33 +8,36 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'http://eidas.europa.eu/saml-extensions'
+NAMESPACE = "http://eidas.europa.eu/saml-extensions"
+
class SPTypeType_(SamlBase):
- """The http://eidas.europa.eu/saml-extensions:SPTypeType element """
+ """The http://eidas.europa.eu/saml-extensions:SPTypeType element"""
- c_tag = 'SPTypeType'
+ c_tag = "SPTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xsd:string', 'enumeration': ['public', 'private']}
+ c_value_type = {"base": "xsd:string", "enumeration": ["public", "private"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def sp_type_type__from_string(xml_string):
return saml2.create_class_from_xml_string(SPTypeType_, xml_string)
class SPType(SPTypeType_):
- """The http://eidas.europa.eu/saml-extensions:SPType element """
+ """The http://eidas.europa.eu/saml-extensions:SPType element"""
- c_tag = 'SPType'
+ c_tag = "SPType"
c_namespace = NAMESPACE
c_children = SPTypeType_.c_children.copy()
c_attributes = SPTypeType_.c_attributes.copy()
c_child_order = SPTypeType_.c_child_order[:]
c_cardinality = SPTypeType_.c_cardinality.copy()
+
def sp_type_from_string(xml_string):
return saml2.create_class_from_xml_string(SPType, xml_string)
@@ -45,8 +48,8 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'SPType': SPType,
- 'SPTypeType': SPTypeType_,
+ "SPType": SPType,
+ "SPTypeType": SPTypeType_,
}
diff --git a/src/saml2/filter.py b/src/saml2/filter.py
index 924cc334..6aad1000 100644
--- a/src/saml2/filter.py
+++ b/src/saml2/filter.py
@@ -1,4 +1,5 @@
-__author__ = 'roland'
+__author__ = "roland"
+
class Filter(object):
def __init__(self):
@@ -32,4 +33,4 @@ class AllowDescriptor(Filter):
if not _all:
return None
else:
- return entity_descriptor
+ return entity_descriptor
diff --git a/src/saml2/httpbase.py b/src/saml2/httpbase.py
index 17c7373d..cb51a919 100644
--- a/src/saml2/httpbase.py
+++ b/src/saml2/httpbase.py
@@ -1,19 +1,22 @@
import calendar
-import six
-from six.moves import http_cookiejar
import copy
+import logging
import re
-from six.moves.urllib.parse import urlparse
-from six.moves.urllib.parse import urlencode
-import requests
import time
+
+import requests
+import six
+from six.moves import http_cookiejar
from six.moves.http_cookies import SimpleCookie
-from saml2.time_util import utc_now
-from saml2 import class_name, SAMLError
+from six.moves.urllib.parse import urlencode
+from six.moves.urllib.parse import urlparse
+
+from saml2 import SAMLError
+from saml2 import class_name
from saml2.pack import http_post_message
from saml2.pack import make_soap_enveloped_saml_thingy
+from saml2.time_util import utc_now
-import logging
logger = logging.getLogger(__name__)
@@ -22,32 +25,30 @@ if requests.__version__ < "2.0.0":
else:
DICT_HEADERS = True
-__author__ = 'rolandh'
-
-ATTRS = {"version": None,
- "name": "",
- "value": None,
- "port": None,
- "port_specified": False,
- "domain": "",
- "domain_specified": False,
- "domain_initial_dot": False,
- "path": "",
- "path_specified": False,
- "secure": False,
- "expires": None,
- "discard": True,
- "comment": None,
- "comment_url": None,
- "rest": "",
- "rfc2109": True}
-
-PAIRS = {
- "port": "port_specified",
- "domain": "domain_specified",
- "path": "path_specified"
+__author__ = "rolandh"
+
+ATTRS = {
+ "version": None,
+ "name": "",
+ "value": None,
+ "port": None,
+ "port_specified": False,
+ "domain": "",
+ "domain_specified": False,
+ "domain_initial_dot": False,
+ "path": "",
+ "path_specified": False,
+ "secure": False,
+ "expires": None,
+ "discard": True,
+ "comment": None,
+ "comment_url": None,
+ "rest": "",
+ "rfc2109": True,
}
+PAIRS = {"port": "port_specified", "domain": "domain_specified", "path": "path_specified"}
+
class ConnectionError(SAMLError):
pass
@@ -57,8 +58,7 @@ class HTTPError(SAMLError):
pass
-TIME_FORMAT = ["%d-%b-%Y %H:%M:%S %Z", "%d-%b-%y %H:%M:%S %Z",
- "%d %b %Y %H:%M:%S %Z"]
+TIME_FORMAT = ["%d-%b-%Y %H:%M:%S %Z", "%d-%b-%y %H:%M:%S %Z", "%d %b %Y %H:%M:%S %Z"]
def _since_epoch(cdate):
@@ -71,20 +71,18 @@ def _since_epoch(cdate):
if len(cdate) < 5:
return utc_now()
- cdate = cdate[5:] # assume short weekday, i.e. do not support obsolete RFC 1036 date format
+ cdate = cdate[5:] # assume short weekday, i.e. do not support obsolete RFC 1036 date format
t = -1
- for time_format in TIME_FORMAT :
+ for time_format in TIME_FORMAT:
try:
- t = time.strptime(cdate, time_format) # e.g. 18-Apr-2014 12:30:51 GMT
+ t = time.strptime(cdate, time_format) # e.g. 18-Apr-2014 12:30:51 GMT
except ValueError:
pass
else:
break
if t == -1:
- err = 'ValueError: Date "{0}" does not match any of: {1}'.format(
- cdate, TIME_FORMAT
- )
+ err = 'ValueError: Date "{0}" does not match any of: {1}'.format(cdate, TIME_FORMAT)
raise Exception(err)
return calendar.timegm(t)
@@ -99,10 +97,9 @@ def dict2set_list(dic):
class HTTPBase(object):
- def __init__(self, verify=True, ca_bundle=None, key_file=None,
- cert_file=None, http_client_timeout=None):
+ def __init__(self, verify=True, ca_bundle=None, key_file=None, cert_file=None, http_client_timeout=None):
self.request_args = {"allow_redirects": False}
- #self.cookies = {}
+ # self.cookies = {}
self.cookiejar = http_cookiejar.CookieJar()
self.request_args["verify"] = verify
@@ -126,9 +123,9 @@ class HTTPBase(object):
"""
part = urlparse(url)
- #if part.port:
+ # if part.port:
# _domain = "%s:%s" % (part.hostname, part.port)
- #else:
+ # else:
_domain = part.hostname
cookie_dict = {}
@@ -198,16 +195,12 @@ class HTTPBase(object):
if morsel["max-age"] == 0:
try:
- self.cookiejar.clear(domain=std_attr["domain"],
- path=std_attr["path"],
- name=std_attr["name"])
+ self.cookiejar.clear(domain=std_attr["domain"], path=std_attr["path"], name=std_attr["name"])
except ValueError:
pass
elif std_attr["expires"] and std_attr["expires"] < utc_now():
try:
- self.cookiejar.clear(domain=std_attr["domain"],
- path=std_attr["path"],
- name=std_attr["name"])
+ self.cookiejar.clear(domain=std_attr["domain"], path=std_attr["path"], name=std_attr["name"])
except ValueError:
pass
else:
@@ -256,14 +249,10 @@ class HTTPBase(object):
@staticmethod
def use_http_artifact(message, destination="", relay_state=""):
if relay_state:
- query = urlencode({"SAMLart": message,
- "RelayState": relay_state})
+ query = urlencode({"SAMLart": message, "RelayState": relay_state})
else:
query = urlencode({"SAMLart": message})
- info = {
- "data": "",
- "url": "%s?%s" % (destination, query)
- }
+ info = {"data": "", "url": "%s?%s" % (destination, query)}
return info
@staticmethod
@@ -278,27 +267,22 @@ class HTTPBase(object):
"headers": [
("Content-Type", "application/samlassertion+xml"),
("Cache-Control", "no-cache, no-store"),
- ("Pragma", "no-cache")
- ]
+ ("Pragma", "no-cache"),
+ ],
}
elif typ == "SAMLRequest":
# msg should be an identifier
if relay_state:
- query = urlencode({"ID": message,
- "RelayState": relay_state})
+ query = urlencode({"ID": message, "RelayState": relay_state})
else:
query = urlencode({"ID": message})
- info = {
- "data": "",
- "url": "%s?%s" % (destination, query)
- }
+ info = {"data": "", "url": "%s?%s" % (destination, query)}
else:
raise NotImplementedError
return info
- def use_soap(self, request, destination="", soap_headers=None, sign=False,
- **kwargs):
+ def use_soap(self, request, destination="", soap_headers=None, sign=False, **kwargs):
"""
Construct the necessary information for using SOAP+POST
@@ -315,13 +299,10 @@ class HTTPBase(object):
logger.debug("SOAP message: %s", soap_message)
if sign and self.sec:
- _signed = self.sec.sign_statement(soap_message,
- node_name=class_name(request),
- node_id=request.id)
+ _signed = self.sec.sign_statement(soap_message, node_name=class_name(request), node_id=request.id)
soap_message = _signed
- return {"url": destination, "method": "POST",
- "data": soap_message, "headers": headers}
+ return {"url": destination, "method": "POST", "data": soap_message, "headers": headers}
def send_using_soap(self, request, destination, headers=None, sign=False):
"""
diff --git a/src/saml2/httputil.py b/src/saml2/httputil.py
index dbba7d41..374875ba 100644
--- a/src/saml2/httputil.py
+++ b/src/saml2/httputil.py
@@ -1,50 +1,52 @@
+import cgi
import hashlib
import hmac
import logging
import time
-import cgi
-import six
-from six.moves.urllib.parse import quote, parse_qs
+import six
from six.moves.http_cookies import SimpleCookie
+from six.moves.urllib.parse import parse_qs
+from six.moves.urllib.parse import quote
from saml2 import BINDING_HTTP_ARTIFACT
-from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_HTTP_POST
-from saml2 import BINDING_URI
+from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_SOAP
+from saml2 import BINDING_URI
from saml2 import SAMLError
from saml2 import time_util
-__author__ = 'rohe0002'
+
+__author__ = "rohe0002"
logger = logging.getLogger(__name__)
class Response(object):
_template = None
- _status = '200 OK'
- _content_type = 'text/html'
+ _status = "200 OK"
+ _content_type = "text/html"
_mako_template = None
_mako_lookup = None
def __init__(self, message=None, **kwargs):
- self.status = kwargs.get('status', self._status)
- self.response = kwargs.get('response', self._response)
- self.template = kwargs.get('template', self._template)
- self.mako_template = kwargs.get('mako_template', self._mako_template)
- self.mako_lookup = kwargs.get('template_lookup', self._mako_lookup)
+ self.status = kwargs.get("status", self._status)
+ self.response = kwargs.get("response", self._response)
+ self.template = kwargs.get("template", self._template)
+ self.mako_template = kwargs.get("mako_template", self._mako_template)
+ self.mako_lookup = kwargs.get("template_lookup", self._mako_lookup)
self.message = message
- self.headers = kwargs.get('headers', [])
- _content_type = kwargs.get('content', self._content_type)
+ self.headers = kwargs.get("headers", [])
+ _content_type = kwargs.get("content", self._content_type)
addContentType = True
for header in self.headers:
- if 'content-type' == header[0].lower():
+ if "content-type" == header[0].lower():
addContentType = False
if addContentType:
- self.headers.append(('Content-type', _content_type))
+ self.headers.append(("Content-type", _content_type))
def __call__(self, environ, start_response, **kwargs):
try:
@@ -62,7 +64,7 @@ class Response(object):
message = mte.render(**argv)
if isinstance(message, six.string_types):
- return [message.encode('utf-8')]
+ return [message.encode("utf-8")]
elif isinstance(message, six.binary_type):
return [message]
else:
@@ -84,29 +86,33 @@ class Created(Response):
class Redirect(Response):
- _template = '<html>\n<head><title>Redirecting to %s</title></head>\n' \
- '<body>\nYou are being redirected to <a href="%s">%s</a>\n' \
- '</body>\n</html>'
- _status = '302 Found'
+ _template = (
+ "<html>\n<head><title>Redirecting to %s</title></head>\n"
+ '<body>\nYou are being redirected to <a href="%s">%s</a>\n'
+ "</body>\n</html>"
+ )
+ _status = "302 Found"
def __call__(self, environ, start_response, **kwargs):
location = self.message
- self.headers.append(('location', location))
+ self.headers.append(("location", location))
start_response(self.status, self.headers)
return self.response((location, location, location))
class SeeOther(Response):
- _template = '<html>\n<head><title>Redirecting to %s</title></head>\n' \
- '<body>\nYou are being redirected to <a href="%s">%s</a>\n' \
- '</body>\n</html>'
- _status = '303 See Other'
+ _template = (
+ "<html>\n<head><title>Redirecting to %s</title></head>\n"
+ '<body>\nYou are being redirected to <a href="%s">%s</a>\n'
+ "</body>\n</html>"
+ )
+ _status = "303 See Other"
def __call__(self, environ, start_response, **kwargs):
location = ""
if self.message:
location = self.message
- self.headers.append(('location', location))
+ self.headers.append(("location", location))
else:
for param, item in self.headers:
if param == "location":
@@ -117,7 +123,7 @@ class SeeOther(Response):
class Forbidden(Response):
- _status = '403 Forbidden'
+ _status = "403 Forbidden"
_template = "<html>Not allowed to mess with: '%s'</html>"
@@ -132,22 +138,21 @@ class Unauthorized(Response):
class NotFound(Response):
- _status = '404 NOT FOUND'
+ _status = "404 NOT FOUND"
class NotAcceptable(Response):
- _status = '406 Not Acceptable'
+ _status = "406 Not Acceptable"
class ServiceError(Response):
- _status = '500 Internal Service Error'
+ _status = "500 Internal Service Error"
class NotImplemented(Response):
_status = "501 Not Implemented"
# override template since we need an environment variable
- template = ('The request method %s is not implemented '
- 'for this server.\r\n%s')
+ template = "The request method %s is not implemented " "for this server.\r\n%s"
class BadGateway(Response):
@@ -158,6 +163,7 @@ class HttpParameters(object):
"""GET or POST signature parameters for Redirect or POST-SimpleSign bindings
because they are not contained in XML unlike the POST binding
"""
+
signature = None
sigalg = None
# Relaystate and SAML message are stored elsewhere
@@ -176,7 +182,7 @@ def extract(environ, empty=False, err=False):
:param empty: Stops on empty fields (default: Fault)
:param err: Stops on errors in fields (default: Fault)
"""
- formdata = cgi.parse(environ['wsgi.input'], environ, empty, err)
+ formdata = cgi.parse(environ["wsgi.input"], environ, empty, err)
# Remove single entries from lists
for key, value in iter(formdata.items()):
if len(value) == 1:
@@ -195,41 +201,40 @@ def geturl(environ, query=True, path=True, use_server_name=False):
:param use_server_name: If SERVER_NAME/_HOST should be used instead of
HTTP_HOST
"""
- url = [environ['wsgi.url_scheme'] + '://']
+ url = [environ["wsgi.url_scheme"] + "://"]
if use_server_name:
- url.append(environ['SERVER_NAME'])
- if environ['wsgi.url_scheme'] == 'https':
- if environ['SERVER_PORT'] != '443':
- url.append(':' + environ['SERVER_PORT'])
+ url.append(environ["SERVER_NAME"])
+ if environ["wsgi.url_scheme"] == "https":
+ if environ["SERVER_PORT"] != "443":
+ url.append(":" + environ["SERVER_PORT"])
else:
- if environ['SERVER_PORT'] != '80':
- url.append(':' + environ['SERVER_PORT'])
+ if environ["SERVER_PORT"] != "80":
+ url.append(":" + environ["SERVER_PORT"])
else:
- url.append(environ['HTTP_HOST'])
+ url.append(environ["HTTP_HOST"])
if path:
url.append(getpath(environ))
- if query and environ.get('QUERY_STRING'):
- url.append('?' + environ['QUERY_STRING'])
- return ''.join(url)
+ if query and environ.get("QUERY_STRING"):
+ url.append("?" + environ["QUERY_STRING"])
+ return "".join(url)
def getpath(environ):
"""Builds a path."""
- return ''.join([quote(environ.get('SCRIPT_NAME', '')),
- quote(environ.get('PATH_INFO', ''))])
+ return "".join([quote(environ.get("SCRIPT_NAME", "")), quote(environ.get("PATH_INFO", ""))])
def get_post(environ):
# the environment variable CONTENT_LENGTH may be empty or missing
try:
- request_body_size = int(environ.get('CONTENT_LENGTH', 0))
+ request_body_size = int(environ.get("CONTENT_LENGTH", 0))
except ValueError:
request_body_size = 0
# When the method is POST the query string will be sent
# in the HTTP request body which is passed by the WSGI server
# in the file like wsgi.input environment variable.
- return environ['wsgi.input'].read(request_body_size)
+ return environ["wsgi.input"].read(request_body_size)
def get_response(environ, start_response):
@@ -275,7 +280,7 @@ def unpack_artifact(environ):
def unpack_any(environ):
- if environ['REQUEST_METHOD'].upper() == 'GET':
+ if environ["REQUEST_METHOD"].upper() == "GET":
# Could be either redirect or artifact
_dict = unpack_redirect(environ)
if "ID" in _dict:
@@ -285,8 +290,8 @@ def unpack_any(environ):
else:
binding = BINDING_HTTP_REDIRECT
else:
- content_type = environ.get('CONTENT_TYPE', 'application/soap+xml')
- if content_type != 'application/soap+xml':
+ content_type = environ.get("CONTENT_TYPE", "application/soap+xml")
+ if content_type != "application/soap+xml":
# normal post
_dict = unpack_post(environ)
if "SAMLart" in _dict:
@@ -317,8 +322,7 @@ def cookie_signature(seed, *parts):
return sha1.hexdigest()
-def make_cookie(name, load, seed, expire=0, domain="", path="",
- timestamp=""):
+def make_cookie(name, load, seed, expire=0, domain="", path="", timestamp=""):
"""
Create and return a cookie
@@ -340,8 +344,7 @@ def make_cookie(name, load, seed, expire=0, domain="", path="",
if domain:
cookie[name]["domain"] = domain
if expire:
- cookie[name]["expires"] = _expiration(expire,
- "%a, %d-%b-%Y %H:%M:%S GMT")
+ cookie[name]["expires"] = _expiration(expire, "%a, %d-%b-%Y %H:%M:%S GMT")
return tuple(cookie.output().split(": ", 1))
diff --git a/src/saml2/ident.py b/src/saml2/ident.py
index c62da23f..dd0d382c 100644
--- a/src/saml2/ident.py
+++ b/src/saml2/ident.py
@@ -1,25 +1,26 @@
import copy
-import shelve
+from hashlib import sha256
import logging
-import six
+import shelve
-from hashlib import sha256
+import six
from six.moves.urllib.parse import quote
from six.moves.urllib.parse import unquote
+
from saml2 import SAMLError
-from saml2.s_utils import rndbytes
from saml2.s_utils import PolicyError
-from saml2.saml import NameID
+from saml2.s_utils import rndbytes
+from saml2.saml import NAMEID_FORMAT_EMAILADDRESS
from saml2.saml import NAMEID_FORMAT_PERSISTENT
from saml2.saml import NAMEID_FORMAT_TRANSIENT
-from saml2.saml import NAMEID_FORMAT_EMAILADDRESS
+from saml2.saml import NameID
+
-__author__ = 'rolandh'
+__author__ = "rolandh"
logger = logging.getLogger(__name__)
-ATTR = ["name_qualifier", "sp_name_qualifier", "format", "sp_provided_id",
- "text"]
+ATTR = ["name_qualifier", "sp_name_qualifier", "format", "sp_provided_id", "text"]
class Unknown(SAMLError):
@@ -52,7 +53,7 @@ def code_binary(item):
"""
code_str = code(item)
if isinstance(code_str, six.string_types):
- return code_str.encode('utf-8')
+ return code_str.encode("utf-8")
return code_str
@@ -73,9 +74,10 @@ def decode(txt):
class IdentDB(object):
- """ A class that handles identifiers of entities
- Keeps a list of all nameIDs returned per SP
+ """A class that handles identifiers of entities
+ Keeps a list of all nameIDs returned per SP
"""
+
def __init__(self, db, domain="", name_qualifier=""):
if isinstance(db, six.string_types):
self.db = shelve.open(db, protocol=2)
@@ -87,15 +89,15 @@ class IdentDB(object):
def _create_id(self, nformat, name_qualifier="", sp_name_qualifier=""):
_id = sha256(rndbytes(32))
if not isinstance(nformat, six.binary_type):
- nformat = nformat.encode('utf-8')
+ nformat = nformat.encode("utf-8")
_id.update(nformat)
if name_qualifier:
if not isinstance(name_qualifier, six.binary_type):
- name_qualifier = name_qualifier.encode('utf-8')
+ name_qualifier = name_qualifier.encode("utf-8")
_id.update(name_qualifier)
if sp_name_qualifier:
if not isinstance(sp_name_qualifier, six.binary_type):
- sp_name_qualifier = sp_name_qualifier.encode('utf-8')
+ sp_name_qualifier = sp_name_qualifier.encode("utf-8")
_id.update(sp_name_qualifier)
return _id.hexdigest()
@@ -158,11 +160,7 @@ class IdentDB(object):
if nformat == NAMEID_FORMAT_PERSISTENT:
nameid = self.match_local_id(userid, sp_name_qualifier, name_qualifier)
if nameid:
- logger.debug(
- "Found existing persistent NameId {nid} for user {uid}".format(
- nid=nameid, uid=userid
- )
- )
+ logger.debug("Found existing persistent NameId {nid} for user {uid}".format(nid=nameid, uid=userid))
return nameid
_id = self.create_id(nformat, name_qualifier, sp_name_qualifier)
@@ -211,8 +209,7 @@ class IdentDB(object):
return res
- def nim_args(self, local_policy=None, sp_name_qualifier="",
- name_id_policy=None, name_qualifier=""):
+ def nim_args(self, local_policy=None, sp_name_qualifier="", name_id_policy=None, name_qualifier=""):
"""
:param local_policy:
@@ -222,8 +219,7 @@ class IdentDB(object):
:return:
"""
- logger.debug("local_policy: %s, name_id_policy: %s", local_policy,
- name_id_policy)
+ logger.debug("local_policy: %s, name_id_policy: %s", local_policy, name_id_policy)
if name_id_policy and name_id_policy.sp_name_qualifier:
sp_name_qualifier = name_id_policy.sp_name_qualifier
@@ -240,14 +236,12 @@ class IdentDB(object):
if not name_qualifier:
name_qualifier = self.name_qualifier
- return {"nformat": nameid_format,
- "sp_name_qualifier": sp_name_qualifier,
- "name_qualifier": name_qualifier}
+ return {"nformat": nameid_format, "sp_name_qualifier": sp_name_qualifier, "name_qualifier": name_qualifier}
- def construct_nameid(self, userid, local_policy=None,
- sp_name_qualifier=None, name_id_policy=None,
- name_qualifier=""):
- """ Returns a name_id for the userid. How the name_id is
+ def construct_nameid(
+ self, userid, local_policy=None, sp_name_qualifier=None, name_id_policy=None, name_qualifier=""
+ ):
+ """Returns a name_id for the userid. How the name_id is
constructed depends on the context.
:param local_policy: The policy the server is configured to follow
@@ -268,17 +262,14 @@ class IdentDB(object):
return self.get_nameid(userid, **args)
def transient_nameid(self, userid, sp_name_qualifier="", name_qualifier=""):
- return self.get_nameid(userid, NAMEID_FORMAT_TRANSIENT,
- sp_name_qualifier, name_qualifier)
+ return self.get_nameid(userid, NAMEID_FORMAT_TRANSIENT, sp_name_qualifier, name_qualifier)
- def persistent_nameid(self, userid, sp_name_qualifier="",
- name_qualifier=""):
+ def persistent_nameid(self, userid, sp_name_qualifier="", name_qualifier=""):
nameid = self.match_local_id(userid, sp_name_qualifier, name_qualifier)
if nameid:
return nameid
else:
- return self.get_nameid(userid, NAMEID_FORMAT_PERSISTENT,
- sp_name_qualifier, name_qualifier)
+ return self.get_nameid(userid, NAMEID_FORMAT_PERSISTENT, sp_name_qualifier, name_qualifier)
def find_local_id(self, name_id):
"""
@@ -292,7 +283,7 @@ class IdentDB(object):
return self.db[name_id.text]
except KeyError:
logger.debug("name: %s", name_id.text)
- #logger.debug("id sub keys: %s", self.subkeys())
+ # logger.debug("id sub keys: %s", self.subkeys())
return None
def match_local_id(self, userid, sp_name_qualifier, name_qualifier):
@@ -346,8 +337,7 @@ class IdentDB(object):
# else create and return a new one
return self.construct_nameid(_id, name_id_policy=name_id_policy)
- def handle_manage_name_id_request(self, name_id, new_id=None,
- new_encrypted_id="", terminate=""):
+ def handle_manage_name_id_request(self, name_id, new_id=None, new_encrypted_id="", terminate=""):
"""
Requests from the SP is about the SPProvidedID attribute.
So this is about adding,replacing and removing said attribute.
@@ -370,7 +360,7 @@ class IdentDB(object):
elif terminate:
name_id.sp_provided_id = None
else:
- #NOOP
+ # NOOP
return name_id
self.remove_remote(orig_name_id)
@@ -378,9 +368,9 @@ class IdentDB(object):
return name_id
def close(self):
- if hasattr(self.db, 'close'):
+ if hasattr(self.db, "close"):
self.db.close()
def sync(self):
- if hasattr(self.db, 'sync'):
+ if hasattr(self.db, "sync"):
self.db.sync()
diff --git a/src/saml2/mcache.py b/src/saml2/mcache.py
index ceace34d..f89e616c 100644
--- a/src/saml2/mcache.py
+++ b/src/saml2/mcache.py
@@ -2,8 +2,11 @@
import logging
import memcache
+
from saml2 import time_util
-from saml2.cache import TooOld, CacheError
+from saml2.cache import CacheError
+from saml2.cache import TooOld
+
# The assumption is that any subject may consist of data
# gathered from several different sources, all with their own
@@ -11,9 +14,11 @@ from saml2.cache import TooOld, CacheError
logger = logging.getLogger(__name__)
+
def _key(prefix, name):
return "%s_%s" % (prefix, name)
+
class Cache(object):
def __init__(self, servers, debug=0):
self._cache = memcache.Client(servers, debug)
@@ -35,7 +40,7 @@ class Cache(object):
raise CacheError("Set operation failed")
def get_identity(self, subject_id, entities=None):
- """ Get all the identity information that has been received and
+ """Get all the identity information that has been received and
are still valid about the subject.
:param subject_id: The identifier of the subject
@@ -52,8 +57,7 @@ class Cache(object):
res = {}
oldees = []
- for (entity_id, item) in self._cache.get_multi(entities,
- subject_id+'_').items():
+ for (entity_id, item) in self._cache.get_multi(entities, subject_id + "_").items():
try:
info = self.get_info(item)
except TooOld:
@@ -68,7 +72,7 @@ class Cache(object):
return res, oldees
def get_info(self, item, check_not_on_or_after=True):
- """ Get session information about a subject gotten from a
+ """Get session information about a subject gotten from a
specified IdP/AA.
:param item: Information stored
@@ -92,7 +96,7 @@ class Cache(object):
return self.get_info(res)
def set(self, subject_id, entity_id, info, timestamp=0):
- """ Stores session information in the cache. Assumes that the subject_id
+ """Stores session information in the cache. Assumes that the subject_id
is unique within the context of the Service Provider.
:param subject_id: The subject identifier
@@ -122,7 +126,7 @@ class Cache(object):
raise CacheError("set failed")
def reset(self, subject_id, entity_id):
- """ Scrap the assertions received from a IdP or an AA about a special
+ """Scrap the assertions received from a IdP or an AA about a special
subject.
:param subject_id: The subjects identifier
@@ -133,7 +137,7 @@ class Cache(object):
raise CacheError("reset failed")
def entities(self, subject_id):
- """ Returns all the entities of assertions for a subject, disregarding
+ """Returns all the entities of assertions for a subject, disregarding
whether the assertion still is valid or not.
:param subject_id: The identifier of the subject
@@ -146,12 +150,12 @@ class Cache(object):
return res
def receivers(self, subject_id):
- """ Another name for entities() just to make it more logic in the IdP
- scenario """
+ """Another name for entities() just to make it more logic in the IdP
+ scenario"""
return self.entities(subject_id)
def active(self, subject_id, entity_id):
- """ Returns the status of assertions from a specific entity_id.
+ """Returns the status of assertions from a specific entity_id.
:param subject_id: The ID of the subject
:param entity_id: The entity ID of the entity_id of the assertion
@@ -174,7 +178,7 @@ class Cache(object):
return False
def subjects(self):
- """ Return identifiers for all the subjects that are in the cache.
+ """Return identifiers for all the subjects that are in the cache.
:return: list of subject identifiers
"""
diff --git a/src/saml2/md.py b/src/saml2/md.py
index b9818e26..06d5bd77 100644
--- a/src/saml2/md.py
+++ b/src/saml2/md.py
@@ -5,20 +5,21 @@
#
import saml2
-from saml2 import saml
from saml2 import SamlBase
+from saml2 import saml
from saml2 import xmldsig as ds
from saml2 import xmlenc as xenc
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:metadata'
+
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:metadata"
class EntityIDType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:entityIDType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:entityIDType element"""
- c_tag = 'entityIDType'
+ c_tag = "entityIDType"
c_namespace = NAMESPACE
- c_value_type = {'maxlen': '1024', 'base': 'anyURI'}
+ c_value_type = {"maxlen": "1024", "base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -30,28 +31,21 @@ def entity_id_type__from_string(xml_string):
class LocalizedNameType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:localizedNameType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:localizedNameType element"""
- c_tag = 'localizedNameType'
+ c_tag = "localizedNameType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['{http://www.w3.org/XML/1998/namespace}lang'] = ('lang',
- 'string',
- True)
-
- def __init__(self,
- lang=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["{http://www.w3.org/XML/1998/namespace}lang"] = ("lang", "string", True)
+
+ def __init__(self, lang=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.lang = lang
@@ -60,28 +54,21 @@ def localized_name_type__from_string(xml_string):
class LocalizedURIType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:localizedURIType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:localizedURIType element"""
- c_tag = 'localizedURIType'
+ c_tag = "localizedURIType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['{http://www.w3.org/XML/1998/namespace}lang'] = ('lang',
- 'anyURI',
- True)
-
- def __init__(self,
- lang=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["{http://www.w3.org/XML/1998/namespace}lang"] = ("lang", "anyURI", True)
+
+ def __init__(self, lang=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.lang = lang
@@ -90,9 +77,9 @@ def localized_uri_type__from_string(xml_string):
class ExtensionsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:ExtensionsType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:ExtensionsType element"""
- c_tag = 'ExtensionsType'
+ c_tag = "ExtensionsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -105,29 +92,30 @@ def extensions_type__from_string(xml_string):
class EndpointType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:EndpointType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:EndpointType element"""
- c_tag = 'EndpointType'
+ c_tag = "EndpointType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Binding'] = ('binding', 'anyURI', True)
- c_attributes['Location'] = ('location', 'anyURI', True)
- c_attributes['ResponseLocation'] = ('response_location', 'anyURI', False)
-
- def __init__(self,
- binding=None,
- location=None,
- response_location=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["Binding"] = ("binding", "anyURI", True)
+ c_attributes["Location"] = ("location", "anyURI", True)
+ c_attributes["ResponseLocation"] = ("response_location", "anyURI", False)
+
+ def __init__(
+ self,
+ binding=None,
+ location=None,
+ response_location=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.binding = binding
self.location = location
self.response_location = response_location
@@ -138,33 +126,37 @@ def endpoint_type__from_string(xml_string):
class IndexedEndpointType_(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:IndexedEndpointType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:IndexedEndpointType element"""
- c_tag = 'IndexedEndpointType'
+ c_tag = "IndexedEndpointType"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
c_child_order = EndpointType_.c_child_order[:]
c_cardinality = EndpointType_.c_cardinality.copy()
- c_attributes['index'] = ('index', 'unsignedShort', True)
- c_attributes['isDefault'] = ('is_default', 'boolean', False)
-
- def __init__(self,
- index=None,
- is_default=None,
- binding=None,
- location=None,
- response_location=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- EndpointType_.__init__(self,
- binding=binding,
- location=location,
- response_location=response_location,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["index"] = ("index", "unsignedShort", True)
+ c_attributes["isDefault"] = ("is_default", "boolean", False)
+
+ def __init__(
+ self,
+ index=None,
+ is_default=None,
+ binding=None,
+ location=None,
+ response_location=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ EndpointType_.__init__(
+ self,
+ binding=binding,
+ location=location,
+ response_location=response_location,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.index = index
self.is_default = is_default
@@ -174,9 +166,9 @@ def indexed_endpoint_type__from_string(xml_string):
class OrganizationName(LocalizedNameType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:OrganizationName element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:OrganizationName element"""
- c_tag = 'OrganizationName'
+ c_tag = "OrganizationName"
c_namespace = NAMESPACE
c_children = LocalizedNameType_.c_children.copy()
c_attributes = LocalizedNameType_.c_attributes.copy()
@@ -190,9 +182,9 @@ def organization_name_from_string(xml_string):
class OrganizationDisplayName(LocalizedNameType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:OrganizationDisplayName
- element """
+ element"""
- c_tag = 'OrganizationDisplayName'
+ c_tag = "OrganizationDisplayName"
c_namespace = NAMESPACE
c_children = LocalizedNameType_.c_children.copy()
c_attributes = LocalizedNameType_.c_attributes.copy()
@@ -201,14 +193,13 @@ class OrganizationDisplayName(LocalizedNameType_):
def organization_display_name_from_string(xml_string):
- return saml2.create_class_from_xml_string(OrganizationDisplayName,
- xml_string)
+ return saml2.create_class_from_xml_string(OrganizationDisplayName, xml_string)
class OrganizationURL(LocalizedURIType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:OrganizationURL element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:OrganizationURL element"""
- c_tag = 'OrganizationURL'
+ c_tag = "OrganizationURL"
c_namespace = NAMESPACE
c_children = LocalizedURIType_.c_children.copy()
c_attributes = LocalizedURIType_.c_attributes.copy()
@@ -221,11 +212,11 @@ def organization_url_from_string(xml_string):
class Company(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:Company element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:Company element"""
- c_tag = 'Company'
+ c_tag = "Company"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -237,11 +228,11 @@ def company_from_string(xml_string):
class GivenName(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:GivenName element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:GivenName element"""
- c_tag = 'GivenName'
+ c_tag = "GivenName"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -253,11 +244,11 @@ def given_name_from_string(xml_string):
class SurName(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:SurName element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:SurName element"""
- c_tag = 'SurName'
+ c_tag = "SurName"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -269,11 +260,11 @@ def sur_name_from_string(xml_string):
class EmailAddress(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:EmailAddress element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:EmailAddress element"""
- c_tag = 'EmailAddress'
+ c_tag = "EmailAddress"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -285,11 +276,11 @@ def email_address_from_string(xml_string):
class TelephoneNumber(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:TelephoneNumber element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:TelephoneNumber element"""
- c_tag = 'TelephoneNumber'
+ c_tag = "TelephoneNumber"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -301,13 +292,11 @@ def telephone_number_from_string(xml_string):
class ContactTypeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:ContactTypeType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:ContactTypeType element"""
- c_tag = 'ContactTypeType'
+ c_tag = "ContactTypeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string', 'enumeration': ['technical', 'support',
- 'administrative',
- 'billing', 'other']}
+ c_value_type = {"base": "string", "enumeration": ["technical", "support", "administrative", "billing", "other"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -320,36 +309,34 @@ def contact_type_type__from_string(xml_string):
class AdditionalMetadataLocationType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AdditionalMetadataLocationType
- element """
+ element"""
- c_tag = 'AdditionalMetadataLocationType'
+ c_tag = "AdditionalMetadataLocationType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['namespace'] = ('namespace', 'anyURI', True)
+ c_attributes["namespace"] = ("namespace", "anyURI", True)
- def __init__(self, namespace=None, text=None, extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self, text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ def __init__(self, namespace=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.namespace = namespace
def additional_metadata_location_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AdditionalMetadataLocationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AdditionalMetadataLocationType_, xml_string)
class AnyURIListType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:anyURIListType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:anyURIListType element"""
- c_tag = 'anyURIListType'
+ c_tag = "anyURIListType"
c_namespace = NAMESPACE
- c_value_type = {'member': 'anyURI', 'base': 'list'}
+ c_value_type = {"member": "anyURI", "base": "list"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -361,11 +348,11 @@ def any_uri_list_type__from_string(xml_string):
class KeyTypes_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:KeyTypes element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:KeyTypes element"""
- c_tag = 'KeyTypes'
+ c_tag = "KeyTypes"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string', 'enumeration': ['encryption', 'signing']}
+ c_value_type = {"base": "string", "enumeration": ["encryption", "signing"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -377,9 +364,9 @@ def key_types__from_string(xml_string):
class EncryptionMethod(xenc.EncryptionMethodType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:EncryptionMethod element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:EncryptionMethod element"""
- c_tag = 'EncryptionMethod'
+ c_tag = "EncryptionMethod"
c_namespace = NAMESPACE
c_children = xenc.EncryptionMethodType_.c_children.copy()
c_attributes = xenc.EncryptionMethodType_.c_attributes.copy()
@@ -393,9 +380,9 @@ def encryption_method_from_string(xml_string):
class ArtifactResolutionService(IndexedEndpointType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:ArtifactResolutionService
- element """
+ element"""
- c_tag = 'ArtifactResolutionService'
+ c_tag = "ArtifactResolutionService"
c_namespace = NAMESPACE
c_children = IndexedEndpointType_.c_children.copy()
c_attributes = IndexedEndpointType_.c_attributes.copy()
@@ -404,14 +391,13 @@ class ArtifactResolutionService(IndexedEndpointType_):
def artifact_resolution_service_from_string(xml_string):
- return saml2.create_class_from_xml_string(ArtifactResolutionService,
- xml_string)
+ return saml2.create_class_from_xml_string(ArtifactResolutionService, xml_string)
class SingleLogoutService(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:SingleLogoutService element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:SingleLogoutService element"""
- c_tag = 'SingleLogoutService'
+ c_tag = "SingleLogoutService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -424,9 +410,9 @@ def single_logout_service_from_string(xml_string):
class ManageNameIDService(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:ManageNameIDService element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:ManageNameIDService element"""
- c_tag = 'ManageNameIDService'
+ c_tag = "ManageNameIDService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -439,11 +425,11 @@ def manage_name_id_service_from_string(xml_string):
class NameIDFormat(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:NameIDFormat element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:NameIDFormat element"""
- c_tag = 'NameIDFormat'
+ c_tag = "NameIDFormat"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -455,9 +441,9 @@ def name_id_format_from_string(xml_string):
class SingleSignOnService(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:SingleSignOnService element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:SingleSignOnService element"""
- c_tag = 'SingleSignOnService'
+ c_tag = "SingleSignOnService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -470,9 +456,9 @@ def single_sign_on_service_from_string(xml_string):
class NameIDMappingService(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:NameIDMappingService element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:NameIDMappingService element"""
- c_tag = 'NameIDMappingService'
+ c_tag = "NameIDMappingService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -486,9 +472,9 @@ def name_id_mapping_service_from_string(xml_string):
class AssertionIDRequestService(EndpointType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AssertionIDRequestService
- element """
+ element"""
- c_tag = 'AssertionIDRequestService'
+ c_tag = "AssertionIDRequestService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -497,16 +483,15 @@ class AssertionIDRequestService(EndpointType_):
def assertion_id_request_service_from_string(xml_string):
- return saml2.create_class_from_xml_string(AssertionIDRequestService,
- xml_string)
+ return saml2.create_class_from_xml_string(AssertionIDRequestService, xml_string)
class AttributeProfile(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:AttributeProfile element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:AttributeProfile element"""
- c_tag = 'AttributeProfile'
+ c_tag = "AttributeProfile"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -519,9 +504,9 @@ def attribute_profile_from_string(xml_string):
class AssertionConsumerService(IndexedEndpointType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AssertionConsumerService
- element """
+ element"""
- c_tag = 'AssertionConsumerService'
+ c_tag = "AssertionConsumerService"
c_namespace = NAMESPACE
c_children = IndexedEndpointType_.c_children.copy()
c_attributes = IndexedEndpointType_.c_attributes.copy()
@@ -530,14 +515,13 @@ class AssertionConsumerService(IndexedEndpointType_):
def assertion_consumer_service_from_string(xml_string):
- return saml2.create_class_from_xml_string(AssertionConsumerService,
- xml_string)
+ return saml2.create_class_from_xml_string(AssertionConsumerService, xml_string)
class ServiceName(LocalizedNameType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:ServiceName element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:ServiceName element"""
- c_tag = 'ServiceName'
+ c_tag = "ServiceName"
c_namespace = NAMESPACE
c_children = LocalizedNameType_.c_children.copy()
c_attributes = LocalizedNameType_.c_attributes.copy()
@@ -550,9 +534,9 @@ def service_name_from_string(xml_string):
class ServiceDescription(LocalizedNameType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:ServiceDescription element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:ServiceDescription element"""
- c_tag = 'ServiceDescription'
+ c_tag = "ServiceDescription"
c_namespace = NAMESPACE
c_children = LocalizedNameType_.c_children.copy()
c_attributes = LocalizedNameType_.c_attributes.copy()
@@ -566,37 +550,48 @@ def service_description_from_string(xml_string):
class RequestedAttributeType_(saml.AttributeType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:RequestedAttributeType
- element """
+ element"""
- c_tag = 'RequestedAttributeType'
+ c_tag = "RequestedAttributeType"
c_namespace = NAMESPACE
c_children = saml.AttributeType_.c_children.copy()
c_attributes = saml.AttributeType_.c_attributes.copy()
c_child_order = saml.AttributeType_.c_child_order[:]
c_cardinality = saml.AttributeType_.c_cardinality.copy()
- c_attributes['isRequired'] = ('is_required', 'boolean', False)
-
- def __init__(self, is_required=None, friendly_name=None, name=None,
- name_format=None, attribute_value=None, text=None,
- extension_elements=None, extension_attributes=None):
- saml.AttributeType_.__init__(self, friendly_name=friendly_name,
- name=name, name_format=name_format,
- attribute_value=attribute_value,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["isRequired"] = ("is_required", "boolean", False)
+
+ def __init__(
+ self,
+ is_required=None,
+ friendly_name=None,
+ name=None,
+ name_format=None,
+ attribute_value=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ saml.AttributeType_.__init__(
+ self,
+ friendly_name=friendly_name,
+ name=name,
+ name_format=name_format,
+ attribute_value=attribute_value,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.is_required = is_required
def requested_attribute_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RequestedAttributeType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RequestedAttributeType_, xml_string)
class AuthnQueryService(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:AuthnQueryService element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:AuthnQueryService element"""
- c_tag = 'AuthnQueryService'
+ c_tag = "AuthnQueryService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -609,9 +604,9 @@ def authn_query_service_from_string(xml_string):
class AuthzService(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:AuthzService element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:AuthzService element"""
- c_tag = 'AuthzService'
+ c_tag = "AuthzService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -624,9 +619,9 @@ def authz_service_from_string(xml_string):
class AttributeService(EndpointType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:AttributeService element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:AttributeService element"""
- c_tag = 'AttributeService'
+ c_tag = "AttributeService"
c_namespace = NAMESPACE
c_children = EndpointType_.c_children.copy()
c_attributes = EndpointType_.c_attributes.copy()
@@ -639,9 +634,9 @@ def attribute_service_from_string(xml_string):
class AffiliateMember(EntityIDType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:AffiliateMember element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:AffiliateMember element"""
- c_tag = 'AffiliateMember'
+ c_tag = "AffiliateMember"
c_namespace = NAMESPACE
c_children = EntityIDType_.c_children.copy()
c_attributes = EntityIDType_.c_attributes.copy()
@@ -654,9 +649,9 @@ def affiliate_member_from_string(xml_string):
class Extensions(ExtensionsType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:Extensions element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:Extensions element"""
- c_tag = 'Extensions'
+ c_tag = "Extensions"
c_namespace = NAMESPACE
c_children = ExtensionsType_.c_children.copy()
c_attributes = ExtensionsType_.c_attributes.copy()
@@ -669,36 +664,40 @@ def extensions_from_string(xml_string):
class OrganizationType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:OrganizationType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:OrganizationType element"""
- c_tag = 'OrganizationType'
+ c_tag = "OrganizationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Extensions'] = (
- 'extensions', Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}OrganizationName'] = (
- 'organization_name', [OrganizationName])
- c_cardinality['organization_name'] = {"min": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}OrganizationDisplayName'] = (
- 'organization_display_name', [OrganizationDisplayName])
- c_cardinality['organization_display_name'] = {"min": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}OrganizationURL'] = (
- 'organization_url', [OrganizationURL])
- c_cardinality['organization_url'] = {"min": 1}
- c_child_order.extend(['extensions', 'organization_name',
- 'organization_display_name', 'organization_url'])
-
- def __init__(self, extensions=None, organization_name=None,
- organization_display_name=None, organization_url=None,
- text=None, extension_elements=None, extension_attributes=None):
- SamlBase.__init__(self, text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}OrganizationName"] = ("organization_name", [OrganizationName])
+ c_cardinality["organization_name"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}OrganizationDisplayName"] = (
+ "organization_display_name",
+ [OrganizationDisplayName],
+ )
+ c_cardinality["organization_display_name"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}OrganizationURL"] = ("organization_url", [OrganizationURL])
+ c_cardinality["organization_url"] = {"min": 1}
+ c_child_order.extend(["extensions", "organization_name", "organization_display_name", "organization_url"])
+
+ def __init__(
+ self,
+ extensions=None,
+ organization_name=None,
+ organization_display_name=None,
+ organization_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.extensions = extensions
self.organization_name = organization_name or []
self.organization_display_name = organization_display_name or []
@@ -710,35 +709,28 @@ def organization_type__from_string(xml_string):
class ContactType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:ContactType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:ContactType element"""
- c_tag = 'ContactType'
+ c_tag = "ContactType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Extensions'] = (
- 'extensions', Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Company'] = (
- 'company', Company)
- c_cardinality['company'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}GivenName'] = (
- 'given_name', GivenName)
- c_cardinality['given_name'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}SurName'] = (
- 'sur_name', SurName)
- c_cardinality['sur_name'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}EmailAddress'] = (
- 'email_address', [EmailAddress])
- c_cardinality['email_address'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}TelephoneNumber'] = (
- 'telephone_number', [TelephoneNumber])
- c_cardinality['telephone_number'] = {"min": 0}
- c_attributes['contactType'] = ('contact_type', ContactTypeType_, True)
- c_child_order.extend(['extensions', 'company', 'given_name', 'sur_name',
- 'email_address', 'telephone_number'])
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Company"] = ("company", Company)
+ c_cardinality["company"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}GivenName"] = ("given_name", GivenName)
+ c_cardinality["given_name"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}SurName"] = ("sur_name", SurName)
+ c_cardinality["sur_name"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}EmailAddress"] = ("email_address", [EmailAddress])
+ c_cardinality["email_address"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}TelephoneNumber"] = ("telephone_number", [TelephoneNumber])
+ c_cardinality["telephone_number"] = {"min": 0}
+ c_attributes["contactType"] = ("contact_type", ContactTypeType_, True)
+ c_child_order.extend(["extensions", "company", "given_name", "sur_name", "email_address", "telephone_number"])
def __init__(
self,
@@ -753,10 +745,11 @@ class ContactType_(SamlBase):
extension_elements=None,
extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.extensions = extensions
self.company = company
@@ -773,9 +766,9 @@ def contact_type__from_string(xml_string):
class AdditionalMetadataLocation(AdditionalMetadataLocationType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AdditionalMetadataLocation
- element """
+ element"""
- c_tag = 'AdditionalMetadataLocation'
+ c_tag = "AdditionalMetadataLocation"
c_namespace = NAMESPACE
c_children = AdditionalMetadataLocationType_.c_children.copy()
c_attributes = AdditionalMetadataLocationType_.c_attributes.copy()
@@ -784,38 +777,36 @@ class AdditionalMetadataLocation(AdditionalMetadataLocationType_):
def additional_metadata_location_from_string(xml_string):
- return saml2.create_class_from_xml_string(AdditionalMetadataLocation,
- xml_string)
+ return saml2.create_class_from_xml_string(AdditionalMetadataLocation, xml_string)
class KeyDescriptorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:KeyDescriptorType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:KeyDescriptorType element"""
- c_tag = 'KeyDescriptorType'
+ c_tag = "KeyDescriptorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyInfo'] = (
- 'key_info', ds.KeyInfo)
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}EncryptionMethod'] = (
- 'encryption_method', [EncryptionMethod])
- c_cardinality['encryption_method'] = {"min": 0}
- c_attributes['use'] = ('use', KeyTypes_, False)
- c_child_order.extend(['key_info', 'encryption_method'])
-
- def __init__(self,
- key_info=None,
- encryption_method=None,
- use=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyInfo"] = ("key_info", ds.KeyInfo)
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}EncryptionMethod"] = ("encryption_method", [EncryptionMethod])
+ c_cardinality["encryption_method"] = {"min": 0}
+ c_attributes["use"] = ("use", KeyTypes_, False)
+ c_child_order.extend(["key_info", "encryption_method"])
+
+ def __init__(
+ self,
+ key_info=None,
+ encryption_method=None,
+ use=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.key_info = key_info
self.encryption_method = encryption_method or []
self.use = use
@@ -826,9 +817,9 @@ def key_descriptor_type__from_string(xml_string):
class RequestedAttribute(RequestedAttributeType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:RequestedAttribute element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:RequestedAttribute element"""
- c_tag = 'RequestedAttribute'
+ c_tag = "RequestedAttribute"
c_namespace = NAMESPACE
c_children = RequestedAttributeType_.c_children.copy()
c_attributes = RequestedAttributeType_.c_attributes.copy()
@@ -841,9 +832,9 @@ def requested_attribute_from_string(xml_string):
class Organization(OrganizationType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:Organization element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:Organization element"""
- c_tag = 'Organization'
+ c_tag = "Organization"
c_namespace = NAMESPACE
c_children = OrganizationType_.c_children.copy()
c_attributes = OrganizationType_.c_attributes.copy()
@@ -856,9 +847,9 @@ def organization_from_string(xml_string):
class ContactPerson(ContactType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:ContactPerson element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:ContactPerson element"""
- c_tag = 'ContactPerson'
+ c_tag = "ContactPerson"
c_namespace = NAMESPACE
c_children = ContactType_.c_children.copy()
c_attributes = ContactType_.c_attributes.copy()
@@ -871,9 +862,9 @@ def contact_person_from_string(xml_string):
class KeyDescriptor(KeyDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:KeyDescriptor element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:KeyDescriptor element"""
- c_tag = 'KeyDescriptor'
+ c_tag = "KeyDescriptor"
c_namespace = NAMESPACE
c_children = KeyDescriptorType_.c_children.copy()
c_attributes = KeyDescriptorType_.c_attributes.copy()
@@ -886,56 +877,50 @@ def key_descriptor_from_string(xml_string):
class RoleDescriptorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:RoleDescriptorType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:RoleDescriptorType element"""
- c_tag = 'RoleDescriptorType'
+ c_tag = "RoleDescriptorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Signature'] = (
- 'signature', ds.Signature)
- c_cardinality['signature'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Extensions'] = (
- 'extensions', Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}KeyDescriptor'] = (
- 'key_descriptor', [KeyDescriptor])
- c_cardinality['key_descriptor'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Organization'] = (
- 'organization', Organization)
- c_cardinality['organization'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}ContactPerson'] = (
- 'contact_person', [ContactPerson])
- c_cardinality['contact_person'] = {"min": 0}
- c_attributes['ID'] = ('id', 'ID', False)
- c_attributes['validUntil'] = ('valid_until', 'dateTime', False)
- c_attributes['cacheDuration'] = ('cache_duration', 'duration', False)
- c_attributes['protocolSupportEnumeration'] = (
- 'protocol_support_enumeration', AnyURIListType_, True)
- c_attributes['errorURL'] = ('error_url', 'anyURI', False)
- c_child_order.extend(['signature', 'extensions', 'key_descriptor',
- 'organization', 'contact_person'])
-
- def __init__(self,
- signature=None,
- extensions=None,
- key_descriptor=None,
- organization=None,
- contact_person=None,
- id=None,
- valid_until=None,
- cache_duration=None,
- protocol_support_enumeration=None,
- error_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Signature"] = ("signature", ds.Signature)
+ c_cardinality["signature"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}KeyDescriptor"] = ("key_descriptor", [KeyDescriptor])
+ c_cardinality["key_descriptor"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Organization"] = ("organization", Organization)
+ c_cardinality["organization"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}ContactPerson"] = ("contact_person", [ContactPerson])
+ c_cardinality["contact_person"] = {"min": 0}
+ c_attributes["ID"] = ("id", "ID", False)
+ c_attributes["validUntil"] = ("valid_until", "dateTime", False)
+ c_attributes["cacheDuration"] = ("cache_duration", "duration", False)
+ c_attributes["protocolSupportEnumeration"] = ("protocol_support_enumeration", AnyURIListType_, True)
+ c_attributes["errorURL"] = ("error_url", "anyURI", False)
+ c_child_order.extend(["signature", "extensions", "key_descriptor", "organization", "contact_person"])
+
+ def __init__(
+ self,
+ signature=None,
+ extensions=None,
+ key_descriptor=None,
+ organization=None,
+ contact_person=None,
+ id=None,
+ valid_until=None,
+ cache_duration=None,
+ protocol_support_enumeration=None,
+ error_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.signature = signature
self.extensions = extensions
self.key_descriptor = key_descriptor or []
@@ -949,50 +934,55 @@ class RoleDescriptorType_(SamlBase):
class SSODescriptorType_(RoleDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:SSODescriptorType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:SSODescriptorType element"""
- c_tag = 'SSODescriptorType'
+ c_tag = "SSODescriptorType"
c_namespace = NAMESPACE
c_children = RoleDescriptorType_.c_children.copy()
c_attributes = RoleDescriptorType_.c_attributes.copy()
c_child_order = RoleDescriptorType_.c_child_order[:]
c_cardinality = RoleDescriptorType_.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}ArtifactResolutionService'] = (
- 'artifact_resolution_service', [ArtifactResolutionService])
- c_cardinality['artifact_resolution_service'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}SingleLogoutService'] = (
- 'single_logout_service', [SingleLogoutService])
- c_cardinality['single_logout_service'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}ManageNameIDService'] = (
- 'manage_name_id_service', [ManageNameIDService])
- c_cardinality['manage_name_id_service'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat'] = (
- 'name_id_format', [NameIDFormat])
- c_cardinality['name_id_format'] = {"min": 0}
- c_child_order.extend(['artifact_resolution_service',
- 'single_logout_service', 'manage_name_id_service',
- 'name_id_format'])
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}ArtifactResolutionService"] = (
+ "artifact_resolution_service",
+ [ArtifactResolutionService],
+ )
+ c_cardinality["artifact_resolution_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}SingleLogoutService"] = (
+ "single_logout_service",
+ [SingleLogoutService],
+ )
+ c_cardinality["single_logout_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}ManageNameIDService"] = (
+ "manage_name_id_service",
+ [ManageNameIDService],
+ )
+ c_cardinality["manage_name_id_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat"] = ("name_id_format", [NameIDFormat])
+ c_cardinality["name_id_format"] = {"min": 0}
+ c_child_order.extend(
+ ["artifact_resolution_service", "single_logout_service", "manage_name_id_service", "name_id_format"]
+ )
def __init__(
- self,
- artifact_resolution_service=None,
- single_logout_service=None,
- manage_name_id_service=None,
- name_id_format=None,
- signature=None,
- extensions=None,
- key_descriptor=None,
- organization=None,
- contact_person=None,
- id=None,
- valid_until=None,
- cache_duration=None,
- protocol_support_enumeration=None,
- error_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ self,
+ artifact_resolution_service=None,
+ single_logout_service=None,
+ manage_name_id_service=None,
+ name_id_format=None,
+ signature=None,
+ extensions=None,
+ key_descriptor=None,
+ organization=None,
+ contact_person=None,
+ id=None,
+ valid_until=None,
+ cache_duration=None,
+ protocol_support_enumeration=None,
+ error_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
RoleDescriptorType_.__init__(
self,
signature=signature,
@@ -1007,7 +997,8 @@ class SSODescriptorType_(RoleDescriptorType_):
error_url=error_url,
text=text,
extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ extension_attributes=extension_attributes,
+ )
self.artifact_resolution_service = artifact_resolution_service or []
self.single_logout_service = single_logout_service or []
self.manage_name_id_service = manage_name_id_service or []
@@ -1015,80 +1006,90 @@ class SSODescriptorType_(RoleDescriptorType_):
class IDPSSODescriptorType_(SSODescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:IDPSSODescriptorType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:IDPSSODescriptorType element"""
- c_tag = 'IDPSSODescriptorType'
+ c_tag = "IDPSSODescriptorType"
c_namespace = NAMESPACE
c_children = SSODescriptorType_.c_children.copy()
c_attributes = SSODescriptorType_.c_attributes.copy()
c_child_order = SSODescriptorType_.c_child_order[:]
c_cardinality = SSODescriptorType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}SingleSignOnService'] = (
- 'single_sign_on_service', [SingleSignOnService])
- c_cardinality['single_sign_on_service'] = {"min": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}NameIDMappingService'] = (
- 'name_id_mapping_service', [NameIDMappingService])
- c_cardinality['name_id_mapping_service'] = {"min": 0}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService'] = (
- 'assertion_id_request_service', [AssertionIDRequestService])
- c_cardinality['assertion_id_request_service'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}AttributeProfile'] = (
- 'attribute_profile', [AttributeProfile])
- c_cardinality['attribute_profile'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Attribute'] = (
- 'attribute', [saml.Attribute])
- c_cardinality['attribute'] = {"min": 0}
- c_attributes['WantAuthnRequestsSigned'] = (
- 'want_authn_requests_signed', 'boolean', False)
- c_child_order.extend(['single_sign_on_service', 'name_id_mapping_service',
- 'assertion_id_request_service', 'attribute_profile',
- 'attribute'])
-
- def __init__(self,
- single_sign_on_service=None,
- name_id_mapping_service=None,
- assertion_id_request_service=None,
- attribute_profile=None,
- attribute=None,
- want_authn_requests_signed=None,
- artifact_resolution_service=None,
- single_logout_service=None,
- manage_name_id_service=None,
- name_id_format=None,
- signature=None,
- extensions=None,
- key_descriptor=None,
- organization=None,
- contact_person=None,
- id=None,
- valid_until=None,
- cache_duration=None,
- protocol_support_enumeration=None,
- error_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- want_authn_requests_only_with_valid_cert=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}SingleSignOnService"] = (
+ "single_sign_on_service",
+ [SingleSignOnService],
+ )
+ c_cardinality["single_sign_on_service"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}NameIDMappingService"] = (
+ "name_id_mapping_service",
+ [NameIDMappingService],
+ )
+ c_cardinality["name_id_mapping_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService"] = (
+ "assertion_id_request_service",
+ [AssertionIDRequestService],
+ )
+ c_cardinality["assertion_id_request_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AttributeProfile"] = ("attribute_profile", [AttributeProfile])
+ c_cardinality["attribute_profile"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Attribute"] = ("attribute", [saml.Attribute])
+ c_cardinality["attribute"] = {"min": 0}
+ c_attributes["WantAuthnRequestsSigned"] = ("want_authn_requests_signed", "boolean", False)
+ c_child_order.extend(
+ [
+ "single_sign_on_service",
+ "name_id_mapping_service",
+ "assertion_id_request_service",
+ "attribute_profile",
+ "attribute",
+ ]
+ )
+
+ def __init__(
+ self,
+ single_sign_on_service=None,
+ name_id_mapping_service=None,
+ assertion_id_request_service=None,
+ attribute_profile=None,
+ attribute=None,
+ want_authn_requests_signed=None,
+ artifact_resolution_service=None,
+ single_logout_service=None,
+ manage_name_id_service=None,
+ name_id_format=None,
+ signature=None,
+ extensions=None,
+ key_descriptor=None,
+ organization=None,
+ contact_person=None,
+ id=None,
+ valid_until=None,
+ cache_duration=None,
+ protocol_support_enumeration=None,
+ error_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ want_authn_requests_only_with_valid_cert=None,
):
- SSODescriptorType_.__init__(self,
- artifact_resolution_service=artifact_resolution_service,
- single_logout_service=single_logout_service,
- manage_name_id_service=manage_name_id_service,
- name_id_format=name_id_format,
- signature=signature,
- extensions=extensions,
- key_descriptor=key_descriptor,
- organization=organization,
- contact_person=contact_person,
- id=id,
- valid_until=valid_until,
- cache_duration=cache_duration,
- protocol_support_enumeration=protocol_support_enumeration,
- error_url=error_url,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SSODescriptorType_.__init__(
+ self,
+ artifact_resolution_service=artifact_resolution_service,
+ single_logout_service=single_logout_service,
+ manage_name_id_service=manage_name_id_service,
+ name_id_format=name_id_format,
+ signature=signature,
+ extensions=extensions,
+ key_descriptor=key_descriptor,
+ organization=organization,
+ contact_person=contact_person,
+ id=id,
+ valid_until=valid_until,
+ cache_duration=cache_duration,
+ protocol_support_enumeration=protocol_support_enumeration,
+ error_url=error_url,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.single_sign_on_service = single_sign_on_service or []
self.name_id_mapping_service = name_id_mapping_service or []
@@ -1105,45 +1106,46 @@ def idpsso_descriptor_type__from_string(xml_string):
class AttributeConsumingServiceType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AttributeConsumingServiceType
- element """
+ element"""
- c_tag = 'AttributeConsumingServiceType'
+ c_tag = "AttributeConsumingServiceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}ServiceName'] = (
- 'service_name',
- [ServiceName])
- c_cardinality['service_name'] = {"min": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}ServiceDescription'] = (
- 'service_description',
- [ServiceDescription])
- c_cardinality['service_description'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}RequestedAttribute'] = (
- 'requested_attribute',
- [RequestedAttribute])
- c_cardinality['requested_attribute'] = {"min": 1}
- c_attributes['index'] = ('index', 'unsignedShort', True)
- c_attributes['isDefault'] = ('is_default', 'boolean', False)
- c_child_order.extend(['service_name', 'service_description',
- 'requested_attribute'])
-
- def __init__(self,
- service_name=None,
- service_description=None,
- requested_attribute=None,
- index=None,
- is_default=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}ServiceName"] = ("service_name", [ServiceName])
+ c_cardinality["service_name"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}ServiceDescription"] = (
+ "service_description",
+ [ServiceDescription],
+ )
+ c_cardinality["service_description"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}RequestedAttribute"] = (
+ "requested_attribute",
+ [RequestedAttribute],
+ )
+ c_cardinality["requested_attribute"] = {"min": 1}
+ c_attributes["index"] = ("index", "unsignedShort", True)
+ c_attributes["isDefault"] = ("is_default", "boolean", False)
+ c_child_order.extend(["service_name", "service_description", "requested_attribute"])
+
+ def __init__(
+ self,
+ service_name=None,
+ service_description=None,
+ requested_attribute=None,
+ index=None,
+ is_default=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.service_name = service_name or []
self.service_description = service_description or []
@@ -1153,68 +1155,64 @@ class AttributeConsumingServiceType_(SamlBase):
def attribute_consuming_service_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AttributeConsumingServiceType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AttributeConsumingServiceType_, xml_string)
class AuthnAuthorityDescriptorType_(RoleDescriptorType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AuthnAuthorityDescriptorType
- element """
+ element"""
- c_tag = 'AuthnAuthorityDescriptorType'
+ c_tag = "AuthnAuthorityDescriptorType"
c_namespace = NAMESPACE
c_children = RoleDescriptorType_.c_children.copy()
c_attributes = RoleDescriptorType_.c_attributes.copy()
c_child_order = RoleDescriptorType_.c_child_order[:]
c_cardinality = RoleDescriptorType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}AuthnQueryService'] = (
- 'authn_query_service',
- [AuthnQueryService])
- c_cardinality['authn_query_service'] = {"min": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService'] = (
- 'assertion_id_request_service',
- [AssertionIDRequestService])
- c_cardinality['assertion_id_request_service'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat'] = (
- 'name_id_format',
- [NameIDFormat])
- c_cardinality['name_id_format'] = {"min": 0}
- c_child_order.extend(['authn_query_service', 'assertion_id_request_service',
- 'name_id_format'])
-
- def __init__(self,
- authn_query_service=None,
- assertion_id_request_service=None,
- name_id_format=None,
- signature=None,
- extensions=None,
- key_descriptor=None,
- organization=None,
- contact_person=None,
- id=None,
- valid_until=None,
- cache_duration=None,
- protocol_support_enumeration=None,
- error_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AuthnQueryService"] = ("authn_query_service", [AuthnQueryService])
+ c_cardinality["authn_query_service"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService"] = (
+ "assertion_id_request_service",
+ [AssertionIDRequestService],
+ )
+ c_cardinality["assertion_id_request_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat"] = ("name_id_format", [NameIDFormat])
+ c_cardinality["name_id_format"] = {"min": 0}
+ c_child_order.extend(["authn_query_service", "assertion_id_request_service", "name_id_format"])
+
+ def __init__(
+ self,
+ authn_query_service=None,
+ assertion_id_request_service=None,
+ name_id_format=None,
+ signature=None,
+ extensions=None,
+ key_descriptor=None,
+ organization=None,
+ contact_person=None,
+ id=None,
+ valid_until=None,
+ cache_duration=None,
+ protocol_support_enumeration=None,
+ error_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- RoleDescriptorType_.__init__(self,
- signature=signature,
- extensions=extensions,
- key_descriptor=key_descriptor,
- organization=organization,
- contact_person=contact_person,
- id=id,
- valid_until=valid_until,
- cache_duration=cache_duration,
- protocol_support_enumeration=protocol_support_enumeration,
- error_url=error_url,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ RoleDescriptorType_.__init__(
+ self,
+ signature=signature,
+ extensions=extensions,
+ key_descriptor=key_descriptor,
+ organization=organization,
+ contact_person=contact_person,
+ id=id,
+ valid_until=valid_until,
+ cache_duration=cache_duration,
+ protocol_support_enumeration=protocol_support_enumeration,
+ error_url=error_url,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.authn_query_service = authn_query_service or []
self.assertion_id_request_service = assertion_id_request_service or []
@@ -1222,67 +1220,63 @@ class AuthnAuthorityDescriptorType_(RoleDescriptorType_):
def authn_authority_descriptor_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnAuthorityDescriptorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnAuthorityDescriptorType_, xml_string)
class PDPDescriptorType_(RoleDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:PDPDescriptorType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:PDPDescriptorType element"""
- c_tag = 'PDPDescriptorType'
+ c_tag = "PDPDescriptorType"
c_namespace = NAMESPACE
c_children = RoleDescriptorType_.c_children.copy()
c_attributes = RoleDescriptorType_.c_attributes.copy()
c_child_order = RoleDescriptorType_.c_child_order[:]
c_cardinality = RoleDescriptorType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}AuthzService'] = (
- 'authz_service',
- [AuthzService])
- c_cardinality['authz_service'] = {"min": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService'] = (
- 'assertion_id_request_service',
- [AssertionIDRequestService])
- c_cardinality['assertion_id_request_service'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat'] = (
- 'name_id_format',
- [NameIDFormat])
- c_cardinality['name_id_format'] = {"min": 0}
- c_child_order.extend(['authz_service', 'assertion_id_request_service',
- 'name_id_format'])
-
- def __init__(self,
- authz_service=None,
- assertion_id_request_service=None,
- name_id_format=None,
- signature=None,
- extensions=None,
- key_descriptor=None,
- organization=None,
- contact_person=None,
- id=None,
- valid_until=None,
- cache_duration=None,
- protocol_support_enumeration=None,
- error_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AuthzService"] = ("authz_service", [AuthzService])
+ c_cardinality["authz_service"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService"] = (
+ "assertion_id_request_service",
+ [AssertionIDRequestService],
+ )
+ c_cardinality["assertion_id_request_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat"] = ("name_id_format", [NameIDFormat])
+ c_cardinality["name_id_format"] = {"min": 0}
+ c_child_order.extend(["authz_service", "assertion_id_request_service", "name_id_format"])
+
+ def __init__(
+ self,
+ authz_service=None,
+ assertion_id_request_service=None,
+ name_id_format=None,
+ signature=None,
+ extensions=None,
+ key_descriptor=None,
+ organization=None,
+ contact_person=None,
+ id=None,
+ valid_until=None,
+ cache_duration=None,
+ protocol_support_enumeration=None,
+ error_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- RoleDescriptorType_.__init__(self,
- signature=signature,
- extensions=extensions,
- key_descriptor=key_descriptor,
- organization=organization,
- contact_person=contact_person,
- id=id,
- valid_until=valid_until,
- cache_duration=cache_duration,
- protocol_support_enumeration=protocol_support_enumeration,
- error_url=error_url,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ RoleDescriptorType_.__init__(
+ self,
+ signature=signature,
+ extensions=extensions,
+ key_descriptor=key_descriptor,
+ organization=organization,
+ contact_person=contact_person,
+ id=id,
+ valid_until=valid_until,
+ cache_duration=cache_duration,
+ protocol_support_enumeration=protocol_support_enumeration,
+ error_url=error_url,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.authz_service = authz_service or []
self.assertion_id_request_service = assertion_id_request_service or []
@@ -1295,72 +1289,67 @@ def pdp_descriptor_type__from_string(xml_string):
class AttributeAuthorityDescriptorType_(RoleDescriptorType_):
"""The urn:oasis:names:tc:SAML:2
- .0:metadata:AttributeAuthorityDescriptorType element """
+ .0:metadata:AttributeAuthorityDescriptorType element"""
- c_tag = 'AttributeAuthorityDescriptorType'
+ c_tag = "AttributeAuthorityDescriptorType"
c_namespace = NAMESPACE
c_children = RoleDescriptorType_.c_children.copy()
c_attributes = RoleDescriptorType_.c_attributes.copy()
c_child_order = RoleDescriptorType_.c_child_order[:]
c_cardinality = RoleDescriptorType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}AttributeService'] = (
- 'attribute_service',
- [AttributeService])
- c_cardinality['attribute_service'] = {"min": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService'] = (
- 'assertion_id_request_service',
- [AssertionIDRequestService])
- c_cardinality['assertion_id_request_service'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat'] = (
- 'name_id_format',
- [NameIDFormat])
- c_cardinality['name_id_format'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}AttributeProfile'] = (
- 'attribute_profile',
- [AttributeProfile])
- c_cardinality['attribute_profile'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Attribute'] = (
- 'attribute',
- [saml.Attribute])
- c_cardinality['attribute'] = {"min": 0}
- c_child_order.extend(['attribute_service', 'assertion_id_request_service',
- 'name_id_format', 'attribute_profile', 'attribute'])
-
- def __init__(self,
- attribute_service=None,
- assertion_id_request_service=None,
- name_id_format=None,
- attribute_profile=None,
- attribute=None,
- signature=None,
- extensions=None,
- key_descriptor=None,
- organization=None,
- contact_person=None,
- id=None,
- valid_until=None,
- cache_duration=None,
- protocol_support_enumeration=None,
- error_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AttributeService"] = ("attribute_service", [AttributeService])
+ c_cardinality["attribute_service"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AssertionIDRequestService"] = (
+ "assertion_id_request_service",
+ [AssertionIDRequestService],
+ )
+ c_cardinality["assertion_id_request_service"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}NameIDFormat"] = ("name_id_format", [NameIDFormat])
+ c_cardinality["name_id_format"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AttributeProfile"] = ("attribute_profile", [AttributeProfile])
+ c_cardinality["attribute_profile"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Attribute"] = ("attribute", [saml.Attribute])
+ c_cardinality["attribute"] = {"min": 0}
+ c_child_order.extend(
+ ["attribute_service", "assertion_id_request_service", "name_id_format", "attribute_profile", "attribute"]
+ )
+
+ def __init__(
+ self,
+ attribute_service=None,
+ assertion_id_request_service=None,
+ name_id_format=None,
+ attribute_profile=None,
+ attribute=None,
+ signature=None,
+ extensions=None,
+ key_descriptor=None,
+ organization=None,
+ contact_person=None,
+ id=None,
+ valid_until=None,
+ cache_duration=None,
+ protocol_support_enumeration=None,
+ error_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- RoleDescriptorType_.__init__(self,
- signature=signature,
- extensions=extensions,
- key_descriptor=key_descriptor,
- organization=organization,
- contact_person=contact_person,
- id=id,
- valid_until=valid_until,
- cache_duration=cache_duration,
- protocol_support_enumeration=protocol_support_enumeration,
- error_url=error_url,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ RoleDescriptorType_.__init__(
+ self,
+ signature=signature,
+ extensions=extensions,
+ key_descriptor=key_descriptor,
+ organization=organization,
+ contact_person=contact_person,
+ id=id,
+ valid_until=valid_until,
+ cache_duration=cache_duration,
+ protocol_support_enumeration=protocol_support_enumeration,
+ error_url=error_url,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.attribute_service = attribute_service or []
self.assertion_id_request_service = assertion_id_request_service or []
@@ -1370,60 +1359,52 @@ class AttributeAuthorityDescriptorType_(RoleDescriptorType_):
def attribute_authority_descriptor_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AttributeAuthorityDescriptorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AttributeAuthorityDescriptorType_, xml_string)
class AffiliationDescriptorType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AffiliationDescriptorType
- element """
+ element"""
- c_tag = 'AffiliationDescriptorType'
+ c_tag = "AffiliationDescriptorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Signature'] = ('signature',
- ds.Signature)
- c_cardinality['signature'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Extensions'] = (
- 'extensions',
- Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}AffiliateMember'] = (
- 'affiliate_member',
- [AffiliateMember])
- c_cardinality['affiliate_member'] = {"min": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}KeyDescriptor'] = (
- 'key_descriptor',
- [KeyDescriptor])
- c_cardinality['key_descriptor'] = {"min": 0}
- c_attributes['affiliationOwnerID'] = ('affiliation_owner_id', EntityIDType_,
- True)
- c_attributes['validUntil'] = ('valid_until', 'dateTime', False)
- c_attributes['cacheDuration'] = ('cache_duration', 'duration', False)
- c_attributes['ID'] = ('id', 'ID', False)
- c_child_order.extend(['signature', 'extensions', 'affiliate_member',
- 'key_descriptor'])
-
- def __init__(self,
- signature=None,
- extensions=None,
- affiliate_member=None,
- key_descriptor=None,
- affiliation_owner_id=None,
- valid_until=None,
- cache_duration=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Signature"] = ("signature", ds.Signature)
+ c_cardinality["signature"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AffiliateMember"] = ("affiliate_member", [AffiliateMember])
+ c_cardinality["affiliate_member"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}KeyDescriptor"] = ("key_descriptor", [KeyDescriptor])
+ c_cardinality["key_descriptor"] = {"min": 0}
+ c_attributes["affiliationOwnerID"] = ("affiliation_owner_id", EntityIDType_, True)
+ c_attributes["validUntil"] = ("valid_until", "dateTime", False)
+ c_attributes["cacheDuration"] = ("cache_duration", "duration", False)
+ c_attributes["ID"] = ("id", "ID", False)
+ c_child_order.extend(["signature", "extensions", "affiliate_member", "key_descriptor"])
+
+ def __init__(
+ self,
+ signature=None,
+ extensions=None,
+ affiliate_member=None,
+ key_descriptor=None,
+ affiliation_owner_id=None,
+ valid_until=None,
+ cache_duration=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.signature = signature
self.extensions = extensions
@@ -1436,14 +1417,13 @@ class AffiliationDescriptorType_(SamlBase):
def affiliation_descriptor_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AffiliationDescriptorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AffiliationDescriptorType_, xml_string)
class RoleDescriptor(RoleDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:RoleDescriptor element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:RoleDescriptor element"""
- c_tag = 'RoleDescriptor'
+ c_tag = "RoleDescriptor"
c_namespace = NAMESPACE
c_children = RoleDescriptorType_.c_children.copy()
c_attributes = RoleDescriptorType_.c_attributes.copy()
@@ -1456,9 +1436,9 @@ def role_descriptor_from_string(xml_string):
class IDPSSODescriptor(IDPSSODescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:IDPSSODescriptor element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:IDPSSODescriptor element"""
- c_tag = 'IDPSSODescriptor'
+ c_tag = "IDPSSODescriptor"
c_namespace = NAMESPACE
c_children = IDPSSODescriptorType_.c_children.copy()
c_attributes = IDPSSODescriptorType_.c_attributes.copy()
@@ -1472,9 +1452,9 @@ def idpsso_descriptor_from_string(xml_string):
class AttributeConsumingService(AttributeConsumingServiceType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AttributeConsumingService
- element """
+ element"""
- c_tag = 'AttributeConsumingService'
+ c_tag = "AttributeConsumingService"
c_namespace = NAMESPACE
c_children = AttributeConsumingServiceType_.c_children.copy()
c_attributes = AttributeConsumingServiceType_.c_attributes.copy()
@@ -1483,15 +1463,14 @@ class AttributeConsumingService(AttributeConsumingServiceType_):
def attribute_consuming_service_from_string(xml_string):
- return saml2.create_class_from_xml_string(AttributeConsumingService,
- xml_string)
+ return saml2.create_class_from_xml_string(AttributeConsumingService, xml_string)
class AuthnAuthorityDescriptor(AuthnAuthorityDescriptorType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AuthnAuthorityDescriptor
- element """
+ element"""
- c_tag = 'AuthnAuthorityDescriptor'
+ c_tag = "AuthnAuthorityDescriptor"
c_namespace = NAMESPACE
c_children = AuthnAuthorityDescriptorType_.c_children.copy()
c_attributes = AuthnAuthorityDescriptorType_.c_attributes.copy()
@@ -1500,14 +1479,13 @@ class AuthnAuthorityDescriptor(AuthnAuthorityDescriptorType_):
def authn_authority_descriptor_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnAuthorityDescriptor,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnAuthorityDescriptor, xml_string)
class PDPDescriptor(PDPDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:PDPDescriptor element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:PDPDescriptor element"""
- c_tag = 'PDPDescriptor'
+ c_tag = "PDPDescriptor"
c_namespace = NAMESPACE
c_children = PDPDescriptorType_.c_children.copy()
c_attributes = PDPDescriptorType_.c_attributes.copy()
@@ -1521,9 +1499,9 @@ def pdp_descriptor_from_string(xml_string):
class AttributeAuthorityDescriptor(AttributeAuthorityDescriptorType_):
"""The urn:oasis:names:tc:SAML:2.0:metadata:AttributeAuthorityDescriptor
- element """
+ element"""
- c_tag = 'AttributeAuthorityDescriptor'
+ c_tag = "AttributeAuthorityDescriptor"
c_namespace = NAMESPACE
c_children = AttributeAuthorityDescriptorType_.c_children.copy()
c_attributes = AttributeAuthorityDescriptorType_.c_attributes.copy()
@@ -1532,15 +1510,13 @@ class AttributeAuthorityDescriptor(AttributeAuthorityDescriptorType_):
def attribute_authority_descriptor_from_string(xml_string):
- return saml2.create_class_from_xml_string(AttributeAuthorityDescriptor,
- xml_string)
+ return saml2.create_class_from_xml_string(AttributeAuthorityDescriptor, xml_string)
class AffiliationDescriptor(AffiliationDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:AffiliationDescriptor element
- """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:AffiliationDescriptor element"""
- c_tag = 'AffiliationDescriptor'
+ c_tag = "AffiliationDescriptor"
c_namespace = NAMESPACE
c_children = AffiliationDescriptorType_.c_children.copy()
c_attributes = AffiliationDescriptorType_.c_attributes.copy()
@@ -1553,72 +1529,71 @@ def affiliation_descriptor_from_string(xml_string):
class SPSSODescriptorType_(SSODescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:SPSSODescriptorType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:SPSSODescriptorType element"""
- c_tag = 'SPSSODescriptorType'
+ c_tag = "SPSSODescriptorType"
c_namespace = NAMESPACE
c_children = SSODescriptorType_.c_children.copy()
c_attributes = SSODescriptorType_.c_attributes.copy()
c_child_order = SSODescriptorType_.c_child_order[:]
c_cardinality = SSODescriptorType_.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AssertionConsumerService'] = (
- 'assertion_consumer_service',
- [AssertionConsumerService])
- c_cardinality['assertion_consumer_service'] = {"min": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AttributeConsumingService'] = (
- 'attribute_consuming_service',
- [AttributeConsumingService])
- c_cardinality['attribute_consuming_service'] = {"min": 0}
- c_attributes['AuthnRequestsSigned'] = ('authn_requests_signed', 'boolean',
- False)
- c_attributes['WantAssertionsSigned'] = ('want_assertions_signed', 'boolean',
- False)
- c_child_order.extend(['assertion_consumer_service',
- 'attribute_consuming_service'])
-
- def __init__(self,
- assertion_consumer_service=None,
- attribute_consuming_service=None,
- authn_requests_signed=None,
- want_assertions_signed=None,
- artifact_resolution_service=None,
- single_logout_service=None,
- manage_name_id_service=None,
- name_id_format=None,
- signature=None,
- extensions=None,
- key_descriptor=None,
- organization=None,
- contact_person=None,
- id=None,
- valid_until=None,
- cache_duration=None,
- protocol_support_enumeration=None,
- error_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AssertionConsumerService"] = (
+ "assertion_consumer_service",
+ [AssertionConsumerService],
+ )
+ c_cardinality["assertion_consumer_service"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AttributeConsumingService"] = (
+ "attribute_consuming_service",
+ [AttributeConsumingService],
+ )
+ c_cardinality["attribute_consuming_service"] = {"min": 0}
+ c_attributes["AuthnRequestsSigned"] = ("authn_requests_signed", "boolean", False)
+ c_attributes["WantAssertionsSigned"] = ("want_assertions_signed", "boolean", False)
+ c_child_order.extend(["assertion_consumer_service", "attribute_consuming_service"])
+
+ def __init__(
+ self,
+ assertion_consumer_service=None,
+ attribute_consuming_service=None,
+ authn_requests_signed=None,
+ want_assertions_signed=None,
+ artifact_resolution_service=None,
+ single_logout_service=None,
+ manage_name_id_service=None,
+ name_id_format=None,
+ signature=None,
+ extensions=None,
+ key_descriptor=None,
+ organization=None,
+ contact_person=None,
+ id=None,
+ valid_until=None,
+ cache_duration=None,
+ protocol_support_enumeration=None,
+ error_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SSODescriptorType_.__init__(self,
- artifact_resolution_service=artifact_resolution_service,
- single_logout_service=single_logout_service,
- manage_name_id_service=manage_name_id_service,
- name_id_format=name_id_format,
- signature=signature,
- extensions=extensions,
- key_descriptor=key_descriptor,
- organization=organization,
- contact_person=contact_person,
- id=id,
- valid_until=valid_until,
- cache_duration=cache_duration,
- protocol_support_enumeration=protocol_support_enumeration,
- error_url=error_url,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SSODescriptorType_.__init__(
+ self,
+ artifact_resolution_service=artifact_resolution_service,
+ single_logout_service=single_logout_service,
+ manage_name_id_service=manage_name_id_service,
+ name_id_format=name_id_format,
+ signature=signature,
+ extensions=extensions,
+ key_descriptor=key_descriptor,
+ organization=organization,
+ contact_person=contact_person,
+ id=id,
+ valid_until=valid_until,
+ cache_duration=cache_duration,
+ protocol_support_enumeration=protocol_support_enumeration,
+ error_url=error_url,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.assertion_consumer_service = assertion_consumer_service or []
self.attribute_consuming_service = attribute_consuming_service or []
@@ -1631,9 +1606,9 @@ def spsso_descriptor_type__from_string(xml_string):
class SPSSODescriptor(SPSSODescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:SPSSODescriptor element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:SPSSODescriptor element"""
- c_tag = 'SPSSODescriptor'
+ c_tag = "SPSSODescriptor"
c_namespace = NAMESPACE
c_children = SPSSODescriptorType_.c_children.copy()
c_attributes = SPSSODescriptorType_.c_attributes.copy()
@@ -1646,102 +1621,98 @@ def spsso_descriptor_from_string(xml_string):
class EntityDescriptorType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:metadata:EntityDescriptorType element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:EntityDescriptorType element"""
- c_tag = 'EntityDescriptorType'
+ c_tag = "EntityDescriptorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Signature'] = ('signature',
- ds.Signature)
- c_cardinality['signature'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Extensions'] = (
- 'extensions',
- Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}RoleDescriptor'] = (
- 'role_descriptor',
- [RoleDescriptor])
- c_cardinality['role_descriptor'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}IDPSSODescriptor'] = (
- 'idpsso_descriptor',
- [IDPSSODescriptor])
- c_cardinality['idpsso_descriptor'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor'] = (
- 'spsso_descriptor',
- [SPSSODescriptor])
- c_cardinality['spsso_descriptor'] = {"min": 0}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AuthnAuthorityDescriptor'] = (
- 'authn_authority_descriptor',
- [AuthnAuthorityDescriptor])
- c_cardinality['authn_authority_descriptor'] = {"min": 0}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AttributeAuthorityDescriptor']\
- = (
- 'attribute_authority_descriptor',
- [AttributeAuthorityDescriptor])
- c_cardinality['attribute_authority_descriptor'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}PDPDescriptor'] = (
- 'pdp_descriptor',
- [PDPDescriptor])
- c_cardinality['pdp_descriptor'] = {"min": 0}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AffiliationDescriptor'] = (
- 'affiliation_descriptor',
- AffiliationDescriptor)
- c_cardinality['affiliation_descriptor'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Organization'] = (
- 'organization',
- Organization)
- c_cardinality['organization'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}ContactPerson'] = (
- 'contact_person',
- [ContactPerson])
- c_cardinality['contact_person'] = {"min": 0}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}AdditionalMetadataLocation'] = (
- 'additional_metadata_location',
- [AdditionalMetadataLocation])
- c_cardinality['additional_metadata_location'] = {"min": 0}
- c_attributes['entityID'] = ('entity_id', EntityIDType_, True)
- c_attributes['validUntil'] = ('valid_until', 'dateTime', False)
- c_attributes['cacheDuration'] = ('cache_duration', 'duration', False)
- c_attributes['ID'] = ('id', 'ID', False)
- c_child_order.extend(['signature', 'extensions', 'role_descriptor',
- 'idpsso_descriptor', 'spsso_descriptor',
- 'authn_authority_descriptor',
- 'attribute_authority_descriptor', 'pdp_descriptor',
- 'affiliation_descriptor', 'organization',
- 'contact_person', 'additional_metadata_location'])
-
- def __init__(self,
- signature=None,
- extensions=None,
- role_descriptor=None,
- idpsso_descriptor=None,
- spsso_descriptor=None,
- authn_authority_descriptor=None,
- attribute_authority_descriptor=None,
- pdp_descriptor=None,
- affiliation_descriptor=None,
- organization=None,
- contact_person=None,
- additional_metadata_location=None,
- entity_id=None,
- valid_until=None,
- cache_duration=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Signature"] = ("signature", ds.Signature)
+ c_cardinality["signature"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}RoleDescriptor"] = ("role_descriptor", [RoleDescriptor])
+ c_cardinality["role_descriptor"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}IDPSSODescriptor"] = ("idpsso_descriptor", [IDPSSODescriptor])
+ c_cardinality["idpsso_descriptor"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor"] = ("spsso_descriptor", [SPSSODescriptor])
+ c_cardinality["spsso_descriptor"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AuthnAuthorityDescriptor"] = (
+ "authn_authority_descriptor",
+ [AuthnAuthorityDescriptor],
+ )
+ c_cardinality["authn_authority_descriptor"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AttributeAuthorityDescriptor"] = (
+ "attribute_authority_descriptor",
+ [AttributeAuthorityDescriptor],
+ )
+ c_cardinality["attribute_authority_descriptor"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}PDPDescriptor"] = ("pdp_descriptor", [PDPDescriptor])
+ c_cardinality["pdp_descriptor"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AffiliationDescriptor"] = (
+ "affiliation_descriptor",
+ AffiliationDescriptor,
+ )
+ c_cardinality["affiliation_descriptor"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Organization"] = ("organization", Organization)
+ c_cardinality["organization"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}ContactPerson"] = ("contact_person", [ContactPerson])
+ c_cardinality["contact_person"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}AdditionalMetadataLocation"] = (
+ "additional_metadata_location",
+ [AdditionalMetadataLocation],
+ )
+ c_cardinality["additional_metadata_location"] = {"min": 0}
+ c_attributes["entityID"] = ("entity_id", EntityIDType_, True)
+ c_attributes["validUntil"] = ("valid_until", "dateTime", False)
+ c_attributes["cacheDuration"] = ("cache_duration", "duration", False)
+ c_attributes["ID"] = ("id", "ID", False)
+ c_child_order.extend(
+ [
+ "signature",
+ "extensions",
+ "role_descriptor",
+ "idpsso_descriptor",
+ "spsso_descriptor",
+ "authn_authority_descriptor",
+ "attribute_authority_descriptor",
+ "pdp_descriptor",
+ "affiliation_descriptor",
+ "organization",
+ "contact_person",
+ "additional_metadata_location",
+ ]
+ )
+
+ def __init__(
+ self,
+ signature=None,
+ extensions=None,
+ role_descriptor=None,
+ idpsso_descriptor=None,
+ spsso_descriptor=None,
+ authn_authority_descriptor=None,
+ attribute_authority_descriptor=None,
+ pdp_descriptor=None,
+ affiliation_descriptor=None,
+ organization=None,
+ contact_person=None,
+ additional_metadata_location=None,
+ entity_id=None,
+ valid_until=None,
+ cache_duration=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.signature = signature
self.extensions = extensions
@@ -1749,8 +1720,7 @@ class EntityDescriptorType_(SamlBase):
self.idpsso_descriptor = idpsso_descriptor or []
self.spsso_descriptor = spsso_descriptor or []
self.authn_authority_descriptor = authn_authority_descriptor or []
- self.attribute_authority_descriptor = attribute_authority_descriptor \
- or []
+ self.attribute_authority_descriptor = attribute_authority_descriptor or []
self.pdp_descriptor = pdp_descriptor or []
self.affiliation_descriptor = affiliation_descriptor
self.organization = organization
@@ -1767,9 +1737,9 @@ def entity_descriptor_type__from_string(xml_string):
class EntityDescriptor(EntityDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:EntityDescriptor element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:EntityDescriptor element"""
- c_tag = 'EntityDescriptor'
+ c_tag = "EntityDescriptor"
c_namespace = NAMESPACE
c_children = EntityDescriptorType_.c_children.copy()
c_attributes = EntityDescriptorType_.c_attributes.copy()
@@ -1784,50 +1754,46 @@ def entity_descriptor_from_string(xml_string):
# ['EntitiesDescriptor', 'EntitiesDescriptorType']
class EntitiesDescriptorType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:metadata:EntitiesDescriptorType
- element """
+ element"""
- c_tag = 'EntitiesDescriptorType'
+ c_tag = "EntitiesDescriptorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Signature'] = ('signature',
- ds.Signature)
- c_cardinality['signature'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}Extensions'] = (
- 'extensions',
- Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:metadata}EntityDescriptor'] = (
- 'entity_descriptor',
- [EntityDescriptor])
- c_cardinality['entity_descriptor'] = {"min": 0}
- c_cardinality['entities_descriptor'] = {"min": 0}
- c_attributes['validUntil'] = ('valid_until', 'dateTime', False)
- c_attributes['cacheDuration'] = ('cache_duration', 'duration', False)
- c_attributes['ID'] = ('id', 'ID', False)
- c_attributes['Name'] = ('name', 'string', False)
- c_child_order.extend(['signature', 'extensions', 'entity_descriptor',
- 'entities_descriptor'])
-
- def __init__(self,
- signature=None,
- extensions=None,
- entity_descriptor=None,
- entities_descriptor=None,
- valid_until=None,
- cache_duration=None,
- id=None,
- name=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Signature"] = ("signature", ds.Signature)
+ c_cardinality["signature"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:metadata}EntityDescriptor"] = ("entity_descriptor", [EntityDescriptor])
+ c_cardinality["entity_descriptor"] = {"min": 0}
+ c_cardinality["entities_descriptor"] = {"min": 0}
+ c_attributes["validUntil"] = ("valid_until", "dateTime", False)
+ c_attributes["cacheDuration"] = ("cache_duration", "duration", False)
+ c_attributes["ID"] = ("id", "ID", False)
+ c_attributes["Name"] = ("name", "string", False)
+ c_child_order.extend(["signature", "extensions", "entity_descriptor", "entities_descriptor"])
+
+ def __init__(
+ self,
+ signature=None,
+ extensions=None,
+ entity_descriptor=None,
+ entities_descriptor=None,
+ valid_until=None,
+ cache_duration=None,
+ id=None,
+ name=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
)
self.signature = signature
self.extensions = extensions
@@ -1840,14 +1806,13 @@ class EntitiesDescriptorType_(SamlBase):
def entities_descriptor_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(EntitiesDescriptorType_,
- xml_string)
+ return saml2.create_class_from_xml_string(EntitiesDescriptorType_, xml_string)
class EntitiesDescriptor(EntitiesDescriptorType_):
- """The urn:oasis:names:tc:SAML:2.0:metadata:EntitiesDescriptor element """
+ """The urn:oasis:names:tc:SAML:2.0:metadata:EntitiesDescriptor element"""
- c_tag = 'EntitiesDescriptor'
+ c_tag = "EntitiesDescriptor"
c_namespace = NAMESPACE
c_children = EntitiesDescriptorType_.c_children.copy()
c_attributes = EntitiesDescriptorType_.c_attributes.copy()
@@ -1860,14 +1825,14 @@ def entities_descriptor_from_string(xml_string):
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-EntitiesDescriptorType_.c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor'] = (
- 'entities_descriptor',
- [EntitiesDescriptor])
-EntitiesDescriptor.c_children[
- '{urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor'] = (
- 'entities_descriptor',
- [EntitiesDescriptor])
+EntitiesDescriptorType_.c_children["{urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor"] = (
+ "entities_descriptor",
+ [EntitiesDescriptor],
+)
+EntitiesDescriptor.c_children["{urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptor"] = (
+ "entities_descriptor",
+ [EntitiesDescriptor],
+)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELEMENT_FROM_STRING = {
@@ -1896,8 +1861,7 @@ ELEMENT_FROM_STRING = {
TelephoneNumber.c_tag: telephone_number_from_string,
ContactTypeType_.c_tag: contact_type_type__from_string,
AdditionalMetadataLocation.c_tag: additional_metadata_location_from_string,
- AdditionalMetadataLocationType_.c_tag:
- additional_metadata_location_type__from_string,
+ AdditionalMetadataLocationType_.c_tag: additional_metadata_location_type__from_string,
RoleDescriptor.c_tag: role_descriptor_from_string,
AnyURIListType_.c_tag: any_uri_list_type__from_string,
KeyDescriptor.c_tag: key_descriptor_from_string,
@@ -1918,23 +1882,19 @@ ELEMENT_FROM_STRING = {
SPSSODescriptorType_.c_tag: spsso_descriptor_type__from_string,
AssertionConsumerService.c_tag: assertion_consumer_service_from_string,
AttributeConsumingService.c_tag: attribute_consuming_service_from_string,
- AttributeConsumingServiceType_.c_tag:
- attribute_consuming_service_type__from_string,
+ AttributeConsumingServiceType_.c_tag: attribute_consuming_service_type__from_string,
ServiceName.c_tag: service_name_from_string,
ServiceDescription.c_tag: service_description_from_string,
RequestedAttribute.c_tag: requested_attribute_from_string,
RequestedAttributeType_.c_tag: requested_attribute_type__from_string,
AuthnAuthorityDescriptor.c_tag: authn_authority_descriptor_from_string,
- AuthnAuthorityDescriptorType_.c_tag:
- authn_authority_descriptor_type__from_string,
+ AuthnAuthorityDescriptorType_.c_tag: authn_authority_descriptor_type__from_string,
AuthnQueryService.c_tag: authn_query_service_from_string,
PDPDescriptor.c_tag: pdp_descriptor_from_string,
PDPDescriptorType_.c_tag: pdp_descriptor_type__from_string,
AuthzService.c_tag: authz_service_from_string,
- AttributeAuthorityDescriptor.c_tag:
- attribute_authority_descriptor_from_string,
- AttributeAuthorityDescriptorType_.c_tag:
- attribute_authority_descriptor_type__from_string,
+ AttributeAuthorityDescriptor.c_tag: attribute_authority_descriptor_from_string,
+ AttributeAuthorityDescriptorType_.c_tag: attribute_authority_descriptor_type__from_string,
AttributeService.c_tag: attribute_service_from_string,
AffiliationDescriptor.c_tag: affiliation_descriptor_from_string,
AffiliationDescriptorType_.c_tag: affiliation_descriptor_type__from_string,
@@ -1942,71 +1902,71 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'entityIDType': EntityIDType_,
- 'localizedNameType': LocalizedNameType_,
- 'localizedURIType': LocalizedURIType_,
- 'Extensions': Extensions,
- 'ExtensionsType': ExtensionsType_,
- 'EndpointType': EndpointType_,
- 'IndexedEndpointType': IndexedEndpointType_,
- 'EntitiesDescriptor': EntitiesDescriptor,
- 'EntitiesDescriptorType': EntitiesDescriptorType_,
- 'EntityDescriptor': EntityDescriptor,
- 'EntityDescriptorType': EntityDescriptorType_,
- 'Organization': Organization,
- 'OrganizationType': OrganizationType_,
- 'OrganizationName': OrganizationName,
- 'OrganizationDisplayName': OrganizationDisplayName,
- 'OrganizationURL': OrganizationURL,
- 'ContactPerson': ContactPerson,
- 'ContactType': ContactType_,
- 'Company': Company,
- 'GivenName': GivenName,
- 'SurName': SurName,
- 'EmailAddress': EmailAddress,
- 'TelephoneNumber': TelephoneNumber,
- 'ContactTypeType': ContactTypeType_,
- 'AdditionalMetadataLocation': AdditionalMetadataLocation,
- 'AdditionalMetadataLocationType': AdditionalMetadataLocationType_,
- 'RoleDescriptor': RoleDescriptor,
- 'anyURIListType': AnyURIListType_,
- 'KeyDescriptor': KeyDescriptor,
- 'KeyDescriptorType': KeyDescriptorType_,
- 'KeyTypes': KeyTypes_,
- 'EncryptionMethod': EncryptionMethod,
- 'ArtifactResolutionService': ArtifactResolutionService,
- 'SingleLogoutService': SingleLogoutService,
- 'ManageNameIDService': ManageNameIDService,
- 'NameIDFormat': NameIDFormat,
- 'IDPSSODescriptor': IDPSSODescriptor,
- 'IDPSSODescriptorType': IDPSSODescriptorType_,
- 'SingleSignOnService': SingleSignOnService,
- 'NameIDMappingService': NameIDMappingService,
- 'AssertionIDRequestService': AssertionIDRequestService,
- 'AttributeProfile': AttributeProfile,
- 'SPSSODescriptor': SPSSODescriptor,
- 'SPSSODescriptorType': SPSSODescriptorType_,
- 'AssertionConsumerService': AssertionConsumerService,
- 'AttributeConsumingService': AttributeConsumingService,
- 'AttributeConsumingServiceType': AttributeConsumingServiceType_,
- 'ServiceName': ServiceName,
- 'ServiceDescription': ServiceDescription,
- 'RequestedAttribute': RequestedAttribute,
- 'RequestedAttributeType': RequestedAttributeType_,
- 'AuthnAuthorityDescriptor': AuthnAuthorityDescriptor,
- 'AuthnAuthorityDescriptorType': AuthnAuthorityDescriptorType_,
- 'AuthnQueryService': AuthnQueryService,
- 'PDPDescriptor': PDPDescriptor,
- 'PDPDescriptorType': PDPDescriptorType_,
- 'AuthzService': AuthzService,
- 'AttributeAuthorityDescriptor': AttributeAuthorityDescriptor,
- 'AttributeAuthorityDescriptorType': AttributeAuthorityDescriptorType_,
- 'AttributeService': AttributeService,
- 'AffiliationDescriptor': AffiliationDescriptor,
- 'AffiliationDescriptorType': AffiliationDescriptorType_,
- 'AffiliateMember': AffiliateMember,
- 'RoleDescriptorType': RoleDescriptorType_,
- 'SSODescriptorType': SSODescriptorType_,
+ "entityIDType": EntityIDType_,
+ "localizedNameType": LocalizedNameType_,
+ "localizedURIType": LocalizedURIType_,
+ "Extensions": Extensions,
+ "ExtensionsType": ExtensionsType_,
+ "EndpointType": EndpointType_,
+ "IndexedEndpointType": IndexedEndpointType_,
+ "EntitiesDescriptor": EntitiesDescriptor,
+ "EntitiesDescriptorType": EntitiesDescriptorType_,
+ "EntityDescriptor": EntityDescriptor,
+ "EntityDescriptorType": EntityDescriptorType_,
+ "Organization": Organization,
+ "OrganizationType": OrganizationType_,
+ "OrganizationName": OrganizationName,
+ "OrganizationDisplayName": OrganizationDisplayName,
+ "OrganizationURL": OrganizationURL,
+ "ContactPerson": ContactPerson,
+ "ContactType": ContactType_,
+ "Company": Company,
+ "GivenName": GivenName,
+ "SurName": SurName,
+ "EmailAddress": EmailAddress,
+ "TelephoneNumber": TelephoneNumber,
+ "ContactTypeType": ContactTypeType_,
+ "AdditionalMetadataLocation": AdditionalMetadataLocation,
+ "AdditionalMetadataLocationType": AdditionalMetadataLocationType_,
+ "RoleDescriptor": RoleDescriptor,
+ "anyURIListType": AnyURIListType_,
+ "KeyDescriptor": KeyDescriptor,
+ "KeyDescriptorType": KeyDescriptorType_,
+ "KeyTypes": KeyTypes_,
+ "EncryptionMethod": EncryptionMethod,
+ "ArtifactResolutionService": ArtifactResolutionService,
+ "SingleLogoutService": SingleLogoutService,
+ "ManageNameIDService": ManageNameIDService,
+ "NameIDFormat": NameIDFormat,
+ "IDPSSODescriptor": IDPSSODescriptor,
+ "IDPSSODescriptorType": IDPSSODescriptorType_,
+ "SingleSignOnService": SingleSignOnService,
+ "NameIDMappingService": NameIDMappingService,
+ "AssertionIDRequestService": AssertionIDRequestService,
+ "AttributeProfile": AttributeProfile,
+ "SPSSODescriptor": SPSSODescriptor,
+ "SPSSODescriptorType": SPSSODescriptorType_,
+ "AssertionConsumerService": AssertionConsumerService,
+ "AttributeConsumingService": AttributeConsumingService,
+ "AttributeConsumingServiceType": AttributeConsumingServiceType_,
+ "ServiceName": ServiceName,
+ "ServiceDescription": ServiceDescription,
+ "RequestedAttribute": RequestedAttribute,
+ "RequestedAttributeType": RequestedAttributeType_,
+ "AuthnAuthorityDescriptor": AuthnAuthorityDescriptor,
+ "AuthnAuthorityDescriptorType": AuthnAuthorityDescriptorType_,
+ "AuthnQueryService": AuthnQueryService,
+ "PDPDescriptor": PDPDescriptor,
+ "PDPDescriptorType": PDPDescriptorType_,
+ "AuthzService": AuthzService,
+ "AttributeAuthorityDescriptor": AttributeAuthorityDescriptor,
+ "AttributeAuthorityDescriptorType": AttributeAuthorityDescriptorType_,
+ "AttributeService": AttributeService,
+ "AffiliationDescriptor": AffiliationDescriptor,
+ "AffiliationDescriptorType": AffiliationDescriptorType_,
+ "AffiliateMember": AffiliateMember,
+ "RoleDescriptorType": RoleDescriptorType_,
+ "SSODescriptorType": SSODescriptorType_,
}
diff --git a/src/saml2/mdbcache.py b/src/saml2/mdbcache.py
index 6da1b498..01b50e13 100644
--- a/src/saml2/mdbcache.py
+++ b/src/saml2/mdbcache.py
@@ -1,16 +1,19 @@
#!/usr/bin/env python
import logging
+
from pymongo.mongo_client import MongoClient
-__author__ = 'rolandh'
-import time
+__author__ = "rolandh"
+
from datetime import datetime
+import time
from saml2 import time_util
from saml2.cache import TooOld
from saml2.time_util import TIME_FORMAT
+
logger = logging.getLogger(__name__)
@@ -30,11 +33,10 @@ class Cache(object):
self.debug = debug
def delete(self, subject_id):
- self._cache.delete_many({'subject_id': subject_id})
+ self._cache.delete_many({"subject_id": subject_id})
- def get_identity(self, subject_id, entities=None,
- check_not_on_or_after=True):
- """ Get all the identity information that has been received and
+ def get_identity(self, subject_id, entities=None, check_not_on_or_after=True):
+ """Get all the identity information that has been received and
are still valid about the subject.
:param subject_id: The identifier of the subject
@@ -63,8 +65,7 @@ class Cache(object):
else:
for entity_id in entities:
try:
- info = self.get(subject_id, entity_id,
- check_not_on_or_after)
+ info = self.get(subject_id, entity_id, check_not_on_or_after)
except TooOld:
oldees.append(entity_id)
continue
@@ -79,7 +80,7 @@ class Cache(object):
return res, oldees
def _get_info(self, item, check_not_on_or_after=True):
- """ Get session information about a subject gotten from a
+ """Get session information about a subject gotten from a
specified IdP/AA.
:param item: Information stored
@@ -96,15 +97,14 @@ class Cache(object):
return None
def get(self, subject_id, entity_id, check_not_on_or_after=True):
- res = self._cache.find_one({"subject_id": subject_id,
- "entity_id": entity_id})
+ res = self._cache.find_one({"subject_id": subject_id, "entity_id": entity_id})
if not res:
return {}
else:
return self._get_info(res, check_not_on_or_after)
def set(self, subject_id, entity_id, info, timestamp=0):
- """ Stores session information in the cache. Assumes that the subject_id
+ """Stores session information in the cache. Assumes that the subject_id
is unique within the context of the Service Provider.
:param subject_id: The subject identifier
@@ -114,8 +114,7 @@ class Cache(object):
:param timestamp: A time after which the assertion is not valid.
"""
- if isinstance(timestamp, datetime) or isinstance(timestamp,
- time.struct_time):
+ if isinstance(timestamp, datetime) or isinstance(timestamp, time.struct_time):
timestamp = time.strftime(TIME_FORMAT, timestamp)
doc = {
@@ -128,36 +127,34 @@ class Cache(object):
_ = self._cache.insert_one(doc)
def reset(self, subject_id, entity_id):
- """ Scrap the assertions received from a IdP or an AA about a special
+ """Scrap the assertions received from a IdP or an AA about a special
subject.
:param subject_id: The subjects identifier
:param entity_id: The identifier of the entity_id of the assertion
:return:
"""
- self._cache.update({"subject_id": subject_id, "entity_id": entity_id},
- {"$set": {"info": {}, "timestamp": 0}})
+ self._cache.update({"subject_id": subject_id, "entity_id": entity_id}, {"$set": {"info": {}, "timestamp": 0}})
def entities(self, subject_id):
- """ Returns all the entities of assertions for a subject, disregarding
+ """Returns all the entities of assertions for a subject, disregarding
whether the assertion still is valid or not.
:param subject_id: The identifier of the subject
:return: A possibly empty list of entity identifiers
"""
try:
- return [i["entity_id"] for i in self._cache.find({"subject_id":
- subject_id})]
+ return [i["entity_id"] for i in self._cache.find({"subject_id": subject_id})]
except ValueError:
return []
def receivers(self, subject_id):
- """ Another name for entities() just to make it more logic in the IdP
- scenario """
+ """Another name for entities() just to make it more logic in the IdP
+ scenario"""
return self.entities(subject_id)
def active(self, subject_id, entity_id):
- """ Returns the status of assertions from a specific entity_id.
+ """Returns the status of assertions from a specific entity_id.
:param subject_id: The ID of the subject
:param entity_id: The entity ID of the entity_id of the assertion
@@ -165,15 +162,14 @@ class Cache(object):
valid or not.
"""
- item = self._cache.find_one({"subject_id": subject_id,
- "entity_id": entity_id})
+ item = self._cache.find_one({"subject_id": subject_id, "entity_id": entity_id})
try:
return time_util.not_on_or_after(item["timestamp"])
except TooOld:
return False
def subjects(self):
- """ Return identifiers for all the subjects that are in the cache.
+ """Return identifiers for all the subjects that are in the cache.
:return: list of subject identifiers
"""
@@ -184,17 +180,14 @@ class Cache(object):
def update(self, subject_id, entity_id, ava):
""" """
- item = self._cache.find_one({"subject_id": subject_id,
- "entity_id": entity_id})
+ item = self._cache.find_one({"subject_id": subject_id, "entity_id": entity_id})
info = item["info"]
info["ava"].update(ava)
- self._cache.update({"subject_id": subject_id, "entity_id": entity_id},
- {"$set": {"info": info}})
+ self._cache.update({"subject_id": subject_id, "entity_id": entity_id}, {"$set": {"info": info}})
def valid_to(self, subject_id, entity_id, newtime):
""" """
- self._cache.update({"subject_id": subject_id, "entity_id": entity_id},
- {"$set": {"timestamp": newtime}})
+ self._cache.update({"subject_id": subject_id, "entity_id": entity_id}, {"$set": {"timestamp": newtime}})
def clear(self):
self._cache.delete_many({})
diff --git a/src/saml2/mdie.py b/src/saml2/mdie.py
index 1bbe3e8d..9a741495 100644
--- a/src/saml2/mdie.py
+++ b/src/saml2/mdie.py
@@ -1,13 +1,14 @@
#!/usr/bin/env python
import six
-from saml2 import element_to_extension_element
-from saml2 import extension_elements_to_elements
from saml2 import ExtensionElement
from saml2 import SamlBase
+from saml2 import element_to_extension_element
+from saml2 import extension_elements_to_elements
from saml2 import md
-__author__ = 'rolandh'
+
+__author__ = "rolandh"
"""
Functions used to import metadata from and export it to a pysaml2 format
@@ -31,20 +32,12 @@ def _eval(val, onts, mdb_safe):
return None
else:
return val
- elif (
- isinstance(val, dict)
- or isinstance(val, SamlBase)
- or isinstance(val, ExtensionElement)
- ):
+ elif isinstance(val, dict) or isinstance(val, SamlBase) or isinstance(val, ExtensionElement):
return to_dict(val, onts, mdb_safe)
elif isinstance(val, list):
lv = []
for v in val:
- if (
- isinstance(v, dict)
- or isinstance(v, SamlBase)
- or isinstance(v, ExtensionElement)
- ):
+ if isinstance(v, dict) or isinstance(v, SamlBase) or isinstance(v, ExtensionElement):
lv.append(to_dict(v, onts, mdb_safe))
else:
lv.append(v)
@@ -70,15 +63,12 @@ def to_dict(_dict, onts, mdb_safe=False):
continue
val = getattr(_dict, key)
if key == "extension_elements":
- _eel = extension_elements_to_elements(
- val, onts, keep_unmatched=True
- )
+ _eel = extension_elements_to_elements(val, onts, keep_unmatched=True)
_val = [_eval(_v, onts, mdb_safe) for _v in _eel]
elif key == "extension_attributes":
if mdb_safe:
- _val = dict([(k.replace(".", "__"), v) for k, v in
- val.items()])
- #_val = {k.replace(".", "__"): v for k, v in val.items()}
+ _val = dict([(k.replace(".", "__"), v) for k, v in val.items()])
+ # _val = {k.replace(".", "__"): v for k, v in val.items()}
else:
_val = val
else:
@@ -109,6 +99,7 @@ def to_dict(_dict, onts, mdb_safe=False):
# From Python dictionary to pysaml2 SAML2 metadata format
+
def _kwa(val, onts, mdb_safe=False):
"""
Key word argument conversion
@@ -119,13 +110,11 @@ def _kwa(val, onts, mdb_safe=False):
:return: A converted dictionary
"""
if not mdb_safe:
- return dict([(k, from_dict(v, onts)) for k, v in val.items()
- if k not in EXP_SKIP])
+ return dict([(k, from_dict(v, onts)) for k, v in val.items() if k not in EXP_SKIP])
else:
_skip = ["_id"]
_skip.extend(EXP_SKIP)
- return dict([(k.replace("__", "."), from_dict(v, onts)) for k, v in
- val.items() if k not in _skip])
+ return dict([(k.replace("__", "."), from_dict(v, onts)) for k, v in val.items() if k not in _skip])
def from_dict(val, onts, mdb_safe=False):
diff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py
index 8fadadbd..44ddd8fe 100644
--- a/src/saml2/mdstore.py
+++ b/src/saml2/mdstore.py
@@ -1,94 +1,89 @@
from __future__ import print_function
+
import hashlib
+from hashlib import sha1
import importlib
+from itertools import chain
import json
import logging
import os
-import sys
-from itertools import chain
-from warnings import warn as _warn
-from hashlib import sha1
from os.path import isfile
from os.path import join
from re import compile as regex_compile
+import sys
+from warnings import warn as _warn
import requests
-
import six
+from saml2 import BINDING_HTTP_POST
+from saml2 import BINDING_HTTP_REDIRECT
+from saml2 import BINDING_SOAP
+from saml2 import SAMLError
from saml2 import md
from saml2 import saml
from saml2 import samlp
from saml2 import xmldsig
from saml2 import xmlenc
-from saml2 import SAMLError
-from saml2 import BINDING_HTTP_REDIRECT
-from saml2 import BINDING_HTTP_POST
-from saml2 import BINDING_SOAP
-from saml2.httpbase import HTTPBase
+from saml2.extension.algsupport import NAMESPACE as NS_ALGSUPPORT
+from saml2.extension.algsupport import DigestMethod
+from saml2.extension.algsupport import SigningMethod
from saml2.extension.idpdisc import BINDING_DISCO
from saml2.extension.idpdisc import DiscoveryResponse
+from saml2.extension.mdattr import NAMESPACE as NS_MDATTR
+from saml2.extension.mdattr import EntityAttributes
+from saml2.extension.mdrpi import NAMESPACE as NS_MDRPI
+from saml2.extension.mdrpi import RegistrationInfo
+from saml2.extension.mdrpi import RegistrationPolicy
+from saml2.extension.mdui import NAMESPACE as NS_MDUI
+from saml2.extension.mdui import Description
+from saml2.extension.mdui import DisplayName
+from saml2.extension.mdui import InformationURL
+from saml2.extension.mdui import Logo
+from saml2.extension.mdui import PrivacyStatementURL
+from saml2.extension.mdui import UIInfo
+from saml2.extension.shibmd import NAMESPACE as NS_SHIBMD
+from saml2.extension.shibmd import Scope
+from saml2.httpbase import HTTPBase
from saml2.md import NAMESPACE as NS_MD
+from saml2.md import ArtifactResolutionService
from saml2.md import EntitiesDescriptor
from saml2.md import EntityDescriptor
-from saml2.md import ArtifactResolutionService
from saml2.md import NameIDMappingService
from saml2.md import SingleSignOnService
from saml2.mdie import to_dict
-from saml2.s_utils import UnsupportedBinding
from saml2.s_utils import UnknownSystemEntity
+from saml2.s_utils import UnsupportedBinding
+from saml2.sigver import SignatureError
+from saml2.sigver import security_context
from saml2.sigver import split_len
-from saml2.validate import valid_instance
-from saml2.time_util import valid
-from saml2.time_util import instant
from saml2.time_util import add_duration
from saml2.time_util import before
+from saml2.time_util import instant
from saml2.time_util import str_to_time
+from saml2.time_util import valid
from saml2.validate import NotValid
-from saml2.sigver import SignatureError
-from saml2.sigver import security_context
-from saml2.extension.mdattr import NAMESPACE as NS_MDATTR
-from saml2.extension.mdattr import EntityAttributes
-from saml2.extension.algsupport import NAMESPACE as NS_ALGSUPPORT
-from saml2.extension.algsupport import SigningMethod, DigestMethod
-from saml2.extension.mdui import NAMESPACE as NS_MDUI
-from saml2.extension.mdui import UIInfo
-from saml2.extension.mdui import DisplayName
-from saml2.extension.mdui import Description
-from saml2.extension.mdui import InformationURL
-from saml2.extension.mdui import PrivacyStatementURL
-from saml2.extension.mdui import Logo
-from saml2.extension.mdrpi import NAMESPACE as NS_MDRPI
-from saml2.extension.mdrpi import RegistrationInfo
-from saml2.extension.mdrpi import RegistrationPolicy
-from saml2.extension.shibmd import NAMESPACE as NS_SHIBMD
-from saml2.extension.shibmd import Scope
+from saml2.validate import valid_instance
logger = logging.getLogger(__name__)
classnames = {
- "mdattr_entityattributes": "{ns}&{tag}".format(
- ns=NS_MDATTR, tag=EntityAttributes.c_tag
- ),
+ "mdattr_entityattributes": "{ns}&{tag}".format(ns=NS_MDATTR, tag=EntityAttributes.c_tag),
"algsupport_signing_method": "{ns}&{tag}".format(ns=NS_ALGSUPPORT, tag=SigningMethod.c_tag),
"algsupport_digest_method": "{ns}&{tag}".format(ns=NS_ALGSUPPORT, tag=DigestMethod.c_tag),
"mdui_uiinfo": "{ns}&{tag}".format(ns=NS_MDUI, tag=UIInfo.c_tag),
"mdui_uiinfo_display_name": "{ns}&{tag}".format(ns=NS_MDUI, tag=DisplayName.c_tag),
"mdui_uiinfo_description": "{ns}&{tag}".format(ns=NS_MDUI, tag=Description.c_tag),
- "mdui_uiinfo_information_url": "{ns}&{tag}".format(
- ns=NS_MDUI, tag=InformationURL.c_tag
- ),
- "mdui_uiinfo_privacy_statement_url": "{ns}&{tag}".format(
- ns=NS_MDUI, tag=PrivacyStatementURL.c_tag
- ),
+ "mdui_uiinfo_information_url": "{ns}&{tag}".format(ns=NS_MDUI, tag=InformationURL.c_tag),
+ "mdui_uiinfo_privacy_statement_url": "{ns}&{tag}".format(ns=NS_MDUI, tag=PrivacyStatementURL.c_tag),
"mdui_uiinfo_logo": "{ns}&{tag}".format(ns=NS_MDUI, tag=Logo.c_tag),
"service_artifact_resolution": "{ns}&{tag}".format(ns=NS_MD, tag=ArtifactResolutionService.c_tag),
"service_single_sign_on": "{ns}&{tag}".format(ns=NS_MD, tag=SingleSignOnService.c_tag),
"service_nameid_mapping": "{ns}&{tag}".format(ns=NS_MD, tag=NameIDMappingService.c_tag),
"mdrpi_registration_info": "{ns}&{tag}".format(ns=NS_MDRPI, tag=RegistrationInfo.c_tag),
"mdrpi_registration_policy": "{ns}&{tag}".format(ns=NS_MDRPI, tag=RegistrationPolicy.c_tag),
- "shibmd_scope": "{ns}&{tag}".format(ns=NS_SHIBMD, tag=Scope.c_tag)
+ "shibmd_scope": "{ns}&{tag}".format(ns=NS_SHIBMD, tag=Scope.c_tag),
}
ENTITY_CATEGORY = "http://macedir.org/entity-category"
@@ -117,7 +112,7 @@ REQ2SRV = {
# SP
"assertion_response": "assertion_consumer_service",
"attribute_response": "attribute_consuming_service",
- "discovery_service_request": "discovery_response"
+ "discovery_service_request": "discovery_response",
}
@@ -134,14 +129,14 @@ class SourceNotFound(Exception):
def load_extensions():
- from saml2 import extension
import pkgutil
+ from saml2 import extension
+
package = extension
prefix = package.__name__ + "."
ext_map = {}
- for importer, modname, ispkg in pkgutil.iter_modules(package.__path__,
- prefix):
+ for importer, modname, ispkg in pkgutil.iter_modules(package.__path__, prefix):
module = __import__(modname, fromlist="dummy")
ext_map[module.NAMESPACE] = module
@@ -149,12 +144,7 @@ def load_extensions():
def load_metadata_modules():
- mods = {
- saml.NAMESPACE: saml,
- md.NAMESPACE: md,
- xmldsig.NAMESPACE: xmldsig,
- xmlenc.NAMESPACE: xmlenc
- }
+ mods = {saml.NAMESPACE: saml, md.NAMESPACE: md, xmldsig.NAMESPACE: xmldsig, xmlenc.NAMESPACE: xmlenc}
mods.update(load_extensions())
return mods
@@ -179,7 +169,8 @@ def response_locations(srvs):
s["response_location"]
for s in srvs
if "response_location" in s
- if s["__class__"] not in [
+ if s["__class__"]
+ not in [
classnames["service_artifact_resolution"],
classnames["service_single_sign_on"],
classnames["service_nameid_mapping"],
@@ -189,11 +180,7 @@ def response_locations(srvs):
def locations(srvs):
- values = (
- s["location"]
- for s in srvs
- if "location" in s
- )
+ values = (s["location"] for s in srvs if "location" in s)
return values
@@ -236,9 +223,7 @@ def name(ent, langpref="en"):
except KeyError:
return None
- for info in ["organization_display_name",
- "organization_name",
- "organization_url"]:
+ for info in ["organization_display_name", "organization_name", "organization_url"]:
try:
for item in org[info]:
if item["lang"] == langpref:
@@ -258,8 +243,7 @@ def repack_cert(cert):
class MetaData(object):
- def __init__(self, attrc, metadata='', node_name=None,
- check_validity=True, security=None, **kwargs):
+ def __init__(self, attrc, metadata="", node_name=None, check_validity=True, security=None, **kwargs):
self.attrc = attrc
self.metadata = metadata
self.entity = None
@@ -270,73 +254,73 @@ class MetaData(object):
self.security = security
def items(self):
- '''
+ """
Returns list of items contained in the storage
- '''
+ """
raise NotImplementedError
def keys(self):
- '''
+ """
Returns keys (identifiers) of items in storage
- '''
+ """
raise NotImplementedError
def values(self):
- '''
+ """
Returns values of items in storage
- '''
+ """
raise NotImplementedError
def __len__(self):
- '''
+ """
Returns number of stored items
- '''
+ """
raise NotImplementedError
def __contains__(self, item):
- '''
+ """
Returns True if the storage contains item
- '''
+ """
raise NotImplementedError
def __getitem__(self, item):
- '''
+ """
Returns the item specified by the key
- '''
+ """
raise NotImplementedError
def __setitem__(self, key, value):
- '''
+ """
Sets a key to a value
- '''
+ """
raise NotImplementedError
def __delitem__(self, key):
- '''
+ """
Removes key from storage
- '''
+ """
raise NotImplementedError
def do_entity_descriptor(self, entity_descr):
- '''
+ """
#FIXME - Add description
- '''
+ """
raise NotImplementedError
def parse(self, xmlstr):
- '''
+ """
#FIXME - Add description
- '''
+ """
raise NotImplementedError
def load(self, *args, **kwargs):
- '''
+ """
Loads the metadata
- '''
+ """
self.parse(self.metadata)
def service(self, entity_id, typ, service, binding=None):
- """ Get me all services with a specified
+ """Get me all services with a specified
entity ID and type, that supports the specified version of binding.
:param entity_id: The EntityId
@@ -396,7 +380,7 @@ class MetaData(object):
for entid, item in self.items():
hit = False
try:
- descr = item['{}sso_descriptor'.format(typ)]
+ descr = item["{}sso_descriptor".format(typ)]
except KeyError:
continue
else:
@@ -407,7 +391,7 @@ class MetaData(object):
continue
else:
for srv in srvs:
- if srv['binding'] == binding:
+ if srv["binding"] == binding:
res[entid] = item
hit = True
break
@@ -426,7 +410,7 @@ class MetaData(object):
return self.service(entity_id, typ, service)
def attribute_requirement(self, entity_id, index=None):
- """ Returns what attributes the SP requires and which are optional
+ """Returns what attributes the SP requires and which are optional
if any such demands are registered in the Metadata.
:param entity_id: The entity id of the SP
@@ -441,9 +425,9 @@ class MetaData(object):
return json.dumps(list(self.items()), indent=2)
def with_descriptor(self, descriptor):
- '''
+ """
Returns any entities with the specified descriptor
- '''
+ """
res = {}
desc = "%s_descriptor" % descriptor
for eid, ent in self.items():
@@ -484,9 +468,9 @@ class MetaData(object):
return True
def certs(self, entity_id, descriptor, use="signing"):
- '''
+ """
Returns certificates for the given Entity
- '''
+ """
ent = self[entity_id]
def extract_certs(srvs):
@@ -507,8 +491,7 @@ class MetaData(object):
if descriptor == "any":
res = []
- for descr in ["spsso", "idpsso", "role", "authn_authority",
- "attribute_authority", "pdp"]:
+ for descr in ["spsso", "idpsso", "role", "authn_authority", "attribute_authority", "pdp"]:
try:
srvs = ent["%s_descriptor" % descr]
except KeyError:
@@ -523,8 +506,7 @@ class MetaData(object):
class InMemoryMetaData(MetaData):
- def __init__(self, attrc, metadata="", node_name=None,
- check_validity=True, security=None, **kwargs):
+ def __init__(self, attrc, metadata="", node_name=None, check_validity=True, security=None, **kwargs):
super(InMemoryMetaData, self).__init__(attrc, metadata=metadata)
self.entity = {}
self.security = security
@@ -565,8 +547,7 @@ class InMemoryMetaData(MetaData):
if self.check_validity:
try:
if not valid(entity_descr.valid_until):
- logger.error("Entity descriptor (entity id:%s) too old",
- entity_descr.entity_id)
+ logger.error("Entity descriptor (entity id:%s) too old", entity_descr.entity_id)
self.to_old.append(entity_descr.entity_id)
return
except AttributeError:
@@ -574,15 +555,13 @@ class InMemoryMetaData(MetaData):
# have I seen this entity_id before ? If so if log: ignore it
if entity_descr.entity_id in self.entity:
- print("Duplicated Entity descriptor (entity id: '%s')" %
- entity_descr.entity_id, file=sys.stderr)
+ print("Duplicated Entity descriptor (entity id: '%s')" % entity_descr.entity_id, file=sys.stderr)
return
_ent = to_dict(entity_descr, metadata_modules())
flag = 0
# verify support for SAML2
- for descr in ["spsso", "idpsso", "role", "authn_authority",
- "attribute_authority", "pdp", "affiliation"]:
+ for descr in ["spsso", "idpsso", "role", "authn_authority", "attribute_authority", "pdp", "affiliation"]:
_res = []
try:
_items = _ent["%s_descriptor" % descr]
@@ -617,13 +596,13 @@ class InMemoryMetaData(MetaData):
self.entities_descr = md.entities_descriptor_from_string(xmlstr)
except Exception as e:
_md_desc = (
- f'metadata file: {self.filename}'
- if isinstance(self,MetaDataFile)
- else f'remote metadata: {self.url}'
+ f"metadata file: {self.filename}"
+ if isinstance(self, MetaDataFile)
+ else f"remote metadata: {self.url}"
if isinstance(self, MetaDataExtern)
- else 'metadata'
+ else "metadata"
)
- raise SAMLError(f'Failed to parse {_md_desc}') from e
+ raise SAMLError(f"Failed to parse {_md_desc}") from e
if not self.entities_descr:
self.entity_descr = md.entity_descriptor_from_string(xmlstr)
@@ -641,8 +620,8 @@ class InMemoryMetaData(MetaData):
if not valid(self.entities_descr.valid_until):
raise TooOld(
"Metadata not valid anymore, it's only valid "
- "until %s" % (
- self.entities_descr.valid_until,))
+ "until %s" % (self.entities_descr.valid_until,)
+ )
except AttributeError:
pass
@@ -650,7 +629,7 @@ class InMemoryMetaData(MetaData):
self.do_entity_descriptor(entity_descr)
def service(self, entity_id, typ, service, binding=None):
- """ Get me all services with a specified
+ """Get me all services with a specified
entity ID and type, that supports the specified version of binding.
:param entity_id: The EntityId
@@ -689,7 +668,7 @@ class InMemoryMetaData(MetaData):
return res
def attribute_requirement(self, entity_id, index=None):
- """ Returns what attributes the SP requires and which are optional
+ """Returns what attributes the SP requires and which are optional
if any such demands are registered in the Metadata.
:param entity_id: The entity id of the SP
@@ -718,7 +697,7 @@ class InMemoryMetaData(MetaData):
for srv in ent[desc]:
if "artifact_resolution_service" in srv:
if isinstance(eid, six.string_types):
- eid = eid.encode('utf-8')
+ eid = eid.encode("utf-8")
s = sha1(eid)
res[s.digest()] = ent
except KeyError:
@@ -746,9 +725,7 @@ class InMemoryMetaData(MetaData):
if self.node_name is not None:
try:
- self.security.verify_signature(
- txt, node_name=self.node_name, cert_file=self.cert
- )
+ self.security.verify_signature(txt, node_name=self.node_name, cert_file=self.cert)
except SignatureError as e:
error_context = {
"message": "Failed to verify signature",
@@ -760,9 +737,7 @@ class InMemoryMetaData(MetaData):
def try_verify_signature(node_name):
try:
- self.security.verify_signature(
- txt, node_name=node_name, cert_file=self.cert
- )
+ self.security.verify_signature(txt, node_name=node_name, cert_file=self.cert)
except SignatureError as e:
return False
else:
@@ -776,10 +751,7 @@ class InMemoryMetaData(MetaData):
]
]
- verified_w_descriptor_name = any(
- try_verify_signature(node_name)
- for node_name in descriptor_names
- )
+ verified_w_descriptor_name = any(try_verify_signature(node_name) for node_name in descriptor_names)
if not verified_w_descriptor_name:
error_context = {
"message": "Failed to verify signature",
@@ -799,12 +771,12 @@ class MetaDataFile(InMemoryMetaData):
def __init__(self, attrc, filename=None, cert=None, **kwargs):
super(MetaDataFile, self).__init__(attrc, **kwargs)
if not filename:
- raise SAMLError('No file specified.')
+ raise SAMLError("No file specified.")
self.filename = filename
self.cert = cert
def get_metadata_content(self):
- with open(self.filename, 'rb') as fp:
+ with open(self.filename, "rb") as fp:
return fp.read()
def load(self, *args, **kwargs):
@@ -818,37 +790,31 @@ class MetaDataLoader(MetaDataFile):
The format of the file is the SAML Metadata format.
"""
- def __init__(self, attrc, loader_callable, cert=None,
- security=None, **kwargs):
+ def __init__(self, attrc, loader_callable, cert=None, security=None, **kwargs):
super(MetaDataLoader, self).__init__(attrc, **kwargs)
- self.metadata_provider_callable = self.get_metadata_loader(
- loader_callable)
+ self.metadata_provider_callable = self.get_metadata_loader(loader_callable)
self.cert = cert
self.security = security
@staticmethod
def get_metadata_loader(func):
- if hasattr(func, '__call__'):
+ if hasattr(func, "__call__"):
return func
- i = func.rfind('.')
- module, attr = func[:i], func[i + 1:]
+ i = func.rfind(".")
+ module, attr = func[:i], func[i + 1 :]
try:
mod = importlib.import_module(module)
except Exception as e:
- raise RuntimeError(
- 'Cannot find metadata provider function %s: "%s"' % (func, e))
+ raise RuntimeError('Cannot find metadata provider function %s: "%s"' % (func, e))
try:
metadata_loader = getattr(mod, attr)
except AttributeError:
- raise RuntimeError(
- 'Module "%s" does not define a "%s" metadata loader' % (
- module, attr))
+ raise RuntimeError('Module "%s" does not define a "%s" metadata loader' % (module, attr))
- if not hasattr(metadata_loader, '__call__'):
- raise RuntimeError(
- 'Metadata loader %s.%s must be callable' % (module, attr))
+ if not hasattr(metadata_loader, "__call__"):
+ raise RuntimeError("Metadata loader %s.%s must be callable" % (module, attr))
return metadata_loader
@@ -862,8 +828,7 @@ class MetaDataExtern(InMemoryMetaData):
Accessible by HTTP GET.
"""
- def __init__(self, attrc, url=None, security=None, cert=None,
- http=None, **kwargs):
+ def __init__(self, attrc, url=None, security=None, cert=None, http=None, **kwargs):
"""
:params attrc:
:params url: Location of the metadata
@@ -873,7 +838,7 @@ class MetaDataExtern(InMemoryMetaData):
"""
super(MetaDataExtern, self).__init__(attrc, **kwargs)
if not url:
- raise SAMLError('URL not specified.')
+ raise SAMLError("URL not specified.")
else:
self.url = url
@@ -884,7 +849,7 @@ class MetaDataExtern(InMemoryMetaData):
self.http = http
def load(self, *args, **kwargs):
- """ Imports metadata by the use of HTTP GET.
+ """Imports metadata by the use of HTTP GET.
If the fingerprint is known the file will be checked for
compliance before it is imported.
"""
@@ -927,9 +892,16 @@ class MetaDataMDX(InMemoryMetaData):
transform = "{{sha1}}{digest}".format(digest=entity_id_sha1)
return transform
- def __init__(self, url=None, security=None, cert=None,
- entity_transform=None, freshness_period=None,
- http_client_timeout=None, **kwargs):
+ def __init__(
+ self,
+ url=None,
+ security=None,
+ cert=None,
+ entity_transform=None,
+ freshness_period=None,
+ http_client_timeout=None,
+ **kwargs,
+ ):
"""
:params url: mdx service url
:params security: SecurityContext()
@@ -945,9 +917,9 @@ class MetaDataMDX(InMemoryMetaData):
"""
super(MetaDataMDX, self).__init__(None, **kwargs)
if not url:
- raise SAMLError('URL for MDQ server not specified.')
+ raise SAMLError("URL for MDQ server not specified.")
- self.url = url.rstrip('/')
+ self.url = url.rstrip("/")
if entity_transform:
self.entity_transform = entity_transform
@@ -966,33 +938,26 @@ class MetaDataMDX(InMemoryMetaData):
# <EntitiesDescriptor> element but we will not currently support
# that use case since it is unlikely to be leveraged for most
# flows.
- self.node_name = "{ns}:{tag}".format(
- ns=EntityDescriptor.c_namespace, tag=EntityDescriptor.c_tag
- )
+ self.node_name = "{ns}:{tag}".format(ns=EntityDescriptor.c_namespace, tag=EntityDescriptor.c_tag)
def load(self, *args, **kwargs):
# Do nothing
pass
def _fetch_metadata(self, item):
- mdx_url = "{url}/entities/{id}".format(
- url=self.url, id=self.entity_transform(item)
- )
+ mdx_url = "{url}/entities/{id}".format(url=self.url, id=self.entity_transform(item))
- response = requests.get(mdx_url, headers={"Accept": SAML_METADATA_CONTENT_TYPE},
- timeout=self.http_client_timeout)
+ response = requests.get(
+ mdx_url, headers={"Accept": SAML_METADATA_CONTENT_TYPE}, timeout=self.http_client_timeout
+ )
if response.status_code != 200:
- error_msg = "Fething {item}: Got response status {status}".format(
- item=item, status=response.status_code
- )
+ error_msg = "Fething {item}: Got response status {status}".format(item=item, status=response.status_code)
logger.info(error_msg)
raise KeyError(error_msg)
_txt = response.content
if not self.parse_and_check_signature(_txt):
- error_msg = "Fething {item}: invalid signature".format(
- item=item, status=response.status_code
- )
+ error_msg = "Fething {item}: invalid signature".format(item=item, status=response.status_code)
logger.info(error_msg)
raise KeyError(error_msg)
@@ -1018,15 +983,20 @@ class MetaDataMDX(InMemoryMetaData):
def single_sign_on_service(self, entity_id, binding=None, typ="idpsso"):
if binding is None:
binding = BINDING_HTTP_REDIRECT
- return self.service(entity_id, "idpsso_descriptor",
- "single_sign_on_service", binding)
+ return self.service(entity_id, "idpsso_descriptor", "single_sign_on_service", binding)
class MetadataStore(MetaData):
- def __init__(self, attrc, config, ca_certs=None,
- check_validity=True,
- disable_ssl_certificate_validation=False,
- filter=None, http_client_timeout=None):
+ def __init__(
+ self,
+ attrc,
+ config,
+ ca_certs=None,
+ check_validity=True,
+ disable_ssl_certificate_validation=False,
+ filter=None,
+ http_client_timeout=None,
+ ):
"""
:params attrc:
:params config: Config()
@@ -1087,9 +1057,7 @@ class MetadataStore(MetaData):
if "cert" not in kwargs:
kwargs["cert"] = ""
- _md = MetaDataExtern(self.attrc,
- kwargs["url"], self.security,
- kwargs["cert"], self.http, **_args)
+ _md = MetaDataExtern(self.attrc, kwargs["url"], self.security, kwargs["cert"], self.http, **_args)
elif typ == "mdfile":
key = args[1]
_md = MetaDataMD(self.attrc, args[1], **_args)
@@ -1097,16 +1065,21 @@ class MetadataStore(MetaData):
key = args[1]
_md = MetaDataLoader(self.attrc, args[1], **_args)
elif typ == "mdq":
- if 'url' in kwargs:
- key = kwargs['url']
- url = kwargs['url']
- cert = kwargs.get('cert')
- freshness_period = kwargs.get('freshness_period', None)
+ if "url" in kwargs:
+ key = kwargs["url"]
+ url = kwargs["url"]
+ cert = kwargs.get("cert")
+ freshness_period = kwargs.get("freshness_period", None)
security = self.security
- entity_transform = kwargs.get('entity_transform', None)
- _md = MetaDataMDX(url, security, cert, entity_transform,
- freshness_period=freshness_period,
- http_client_timeout=self.http_client_timeout)
+ entity_transform = kwargs.get("entity_transform", None)
+ _md = MetaDataMDX(
+ url,
+ security,
+ cert,
+ entity_transform,
+ freshness_period=freshness_period,
+ http_client_timeout=self.http_client_timeout,
+ )
else:
key = args[1]
url = args[1]
@@ -1143,10 +1116,10 @@ class MetadataStore(MetaData):
else:
for item in spec:
try:
- key = item['class']
+ key = item["class"]
except (KeyError, AttributeError):
raise SAMLError("Misconfiguration in metadata %s" % item)
- mod, clas = key.rsplit('.', 1)
+ mod, clas = key.rsplit(".", 1)
try:
mod = importlib.import_module(mod)
MDloader = getattr(mod, clas)
@@ -1155,21 +1128,17 @@ class MetadataStore(MetaData):
# Separately handle MDExtern
if MDloader == MetaDataExtern:
- kwargs = {
- 'http': self.http,
- 'security': self.security
- }
+ kwargs = {"http": self.http, "security": self.security}
else:
kwargs = {}
if self.filter:
kwargs["filter"] = self.filter
- for key in item['metadata']:
+ for key in item["metadata"]:
# Separately handle MetaDataFile and directory
if MDloader == MetaDataFile and os.path.isdir(key[0]):
- files = [f for f in os.listdir(key[0]) if
- isfile(join(key[0], f))]
+ files = [f for f in os.listdir(key[0]) if isfile(join(key[0], f))]
for fil in files:
_fil = join(key[0], fil)
_md = MetaDataFile(self.attrc, _fil)
@@ -1245,38 +1214,31 @@ class MetadataStore(MetaData):
if binding is None:
binding = BINDING_HTTP_REDIRECT
- return self.service(entity_id, "idpsso_descriptor",
- "single_sign_on_service", binding)
+ return self.service(entity_id, "idpsso_descriptor", "single_sign_on_service", binding)
def name_id_mapping_service(self, entity_id, binding=None, typ="idpsso"):
# IDP
if binding is None:
binding = BINDING_HTTP_REDIRECT
- return self.service(entity_id, "idpsso_descriptor",
- "name_id_mapping_service", binding)
+ return self.service(entity_id, "idpsso_descriptor", "name_id_mapping_service", binding)
- def authn_query_service(self, entity_id, binding=None,
- typ="authn_authority"):
+ def authn_query_service(self, entity_id, binding=None, typ="authn_authority"):
# AuthnAuthority
if binding is None:
binding = BINDING_SOAP
- return self.service(entity_id, "authn_authority_descriptor",
- "authn_query_service", binding)
+ return self.service(entity_id, "authn_authority_descriptor", "authn_query_service", binding)
- def attribute_service(self, entity_id, binding=None,
- typ="attribute_authority"):
+ def attribute_service(self, entity_id, binding=None, typ="attribute_authority"):
# AttributeAuthority
if binding is None:
binding = BINDING_HTTP_REDIRECT
- return self.service(entity_id, "attribute_authority_descriptor",
- "attribute_service", binding)
+ return self.service(entity_id, "attribute_authority_descriptor", "attribute_service", binding)
def authz_service(self, entity_id, binding=None, typ="pdp"):
# PDP
if binding is None:
binding = BINDING_SOAP
- return self.service(entity_id, "pdp_descriptor",
- "authz_service", binding)
+ return self.service(entity_id, "pdp_descriptor", "authz_service", binding)
def assertion_id_request_service(self, entity_id, binding=None, typ=None):
# AuthnAuthority + IDP + PDP + AttributeAuthority
@@ -1284,51 +1246,44 @@ class MetadataStore(MetaData):
raise AttributeError("Missing type specification")
if binding is None:
binding = BINDING_SOAP
- return self.service(entity_id, "%s_descriptor" % typ,
- "assertion_id_request_service", binding)
+ return self.service(entity_id, "%s_descriptor" % typ, "assertion_id_request_service", binding)
def single_logout_service(self, entity_id, binding=None, typ=None):
# IDP + SP
if typ is None:
raise AttributeError("Missing type specification")
- return self.service(entity_id, "%s_descriptor" % typ,
- "single_logout_service", binding)
+ return self.service(entity_id, "%s_descriptor" % typ, "single_logout_service", binding)
def manage_name_id_service(self, entity_id, binding=None, typ=None):
# IDP + SP
if binding is None:
binding = BINDING_HTTP_REDIRECT
- return self.service(entity_id, "%s_descriptor" % typ,
- "manage_name_id_service", binding)
+ return self.service(entity_id, "%s_descriptor" % typ, "manage_name_id_service", binding)
def artifact_resolution_service(self, entity_id, binding=None, typ=None):
# IDP + SP
if binding is None:
binding = BINDING_HTTP_REDIRECT
- return self.service(entity_id, "%s_descriptor" % typ,
- "artifact_resolution_service", binding)
+ return self.service(entity_id, "%s_descriptor" % typ, "artifact_resolution_service", binding)
def assertion_consumer_service(self, entity_id, binding=None, _="spsso"):
# SP
if binding is None:
binding = BINDING_HTTP_POST
- return self.service(entity_id, "spsso_descriptor",
- "assertion_consumer_service", binding)
+ return self.service(entity_id, "spsso_descriptor", "assertion_consumer_service", binding)
def attribute_consuming_service(self, entity_id, binding=None, _="spsso"):
# SP
if binding is None:
binding = BINDING_HTTP_REDIRECT
- return self.service(entity_id, "spsso_descriptor",
- "attribute_consuming_service", binding)
+ return self.service(entity_id, "spsso_descriptor", "attribute_consuming_service", binding)
def discovery_response(self, entity_id, binding=None, _="spsso"):
if binding is None:
binding = BINDING_DISCO
- return self.ext_service(entity_id, "spsso_descriptor",
- "%s&%s" % (DiscoveryResponse.c_namespace,
- DiscoveryResponse.c_tag),
- binding)
+ return self.ext_service(
+ entity_id, "spsso_descriptor", "%s&%s" % (DiscoveryResponse.c_namespace, DiscoveryResponse.c_tag), binding
+ )
def attribute_requirement(self, entity_id, index=None):
for _md in self.metadata.values():
@@ -1439,10 +1394,7 @@ class MetadataStore(MetaData):
if elem["__class__"] != classnames["mdattr_entityattributes"]:
continue
for attr in elem["attribute"]:
- res[attr["name"]] = [
- *res.get(attr["name"], []),
- *(v["text"] for v in attr.get("attribute_value", []))
- ]
+ res[attr["name"]] = [*res.get(attr["name"], []), *(v["text"] for v in attr.get("attribute_value", []))]
return res
def supported_algorithms(self, entity_id):
@@ -1460,19 +1412,16 @@ class MetadataStore(MetaData):
:type entity_id: string
:rtype: dict
"""
- res = {
- 'digest_methods': [],
- 'signing_methods': []
- }
+ res = {"digest_methods": [], "signing_methods": []}
try:
ext = self.__getitem__(entity_id)["extensions"]
except KeyError:
return res
for elem in ext["extension_elements"]:
if elem["__class__"] == classnames["algsupport_digest_method"]:
- res['digest_methods'].append(elem['algorithm'])
+ res["digest_methods"].append(elem["algorithm"])
elif elem["__class__"] == classnames["algsupport_signing_method"]:
- res['signing_methods'].append(elem['algorithm'])
+ res["signing_methods"].append(elem["algorithm"])
return res
def registration_info(self, entity_id):
@@ -1503,11 +1452,7 @@ class MetadataStore(MetaData):
ext_elems = ext.get("extensions", {}).get("extension_elements", [])
reg_info = next(
- (
- elem
- for elem in ext_elems
- if elem["__class__"] == classnames["mdrpi_registration_info"]
- ),
+ (elem for elem in ext_elems if elem["__class__"] == classnames["mdrpi_registration_info"]),
{},
)
res = {
@@ -1556,12 +1501,7 @@ class MetadataStore(MetaData):
return elements
def _lookup_elements_by_key(self, root, key):
- elements = (
- element
- for uiinfo in root
- for elements in [uiinfo.get(key, [])]
- for element in elements
- )
+ elements = (element for uiinfo in root for elements in [uiinfo.get(key, [])] for element in elements)
return elements
def sbibmd_scopes(self, entity_id, typ=None):
@@ -1614,11 +1554,7 @@ class MetadataStore(MetaData):
except KeyError:
data = {}
- descriptor_names = (
- item
- for item in data.keys()
- if item.endswith("_descriptor")
- )
+ descriptor_names = (item for item in data.keys() if item.endswith("_descriptor"))
descriptors = (
descriptor
for descriptor_name in descriptor_names
@@ -1629,38 +1565,22 @@ class MetadataStore(MetaData):
for descriptor in descriptors
for extension in descriptor.get("extensions", {}).get("extension_elements", [])
)
- uiinfos = (
- extension
- for extension in extensions
- if extension.get("__class__") == classnames["mdui_uiinfo"]
- )
+ uiinfos = (extension for extension in extensions if extension.get("__class__") == classnames["mdui_uiinfo"])
return uiinfos
def _mdui_uiinfo_i18n_elements_lookup(self, entity_id, langpref, element_hint, lookup):
uiinfos = self.mdui_uiinfo(entity_id)
elements = lookup(uiinfos, element_hint)
- lang_elements = (
- element
- for element in elements
- if langpref is None or element.get("lang") == langpref
- )
- values = (
- value
- for element in lang_elements
- for value in [element.get("text")]
- )
+ lang_elements = (element for element in elements if langpref is None or element.get("lang") == langpref)
+ values = (value for element in lang_elements for value in [element.get("text")])
return values
def mdui_uiinfo_i18n_element_cls(self, entity_id, langpref, element_cls):
- values = self._mdui_uiinfo_i18n_elements_lookup(
- entity_id, langpref, element_cls, self._lookup_elements_by_cls
- )
+ values = self._mdui_uiinfo_i18n_elements_lookup(entity_id, langpref, element_cls, self._lookup_elements_by_cls)
return values
def mdui_uiinfo_i18n_element_key(self, entity_id, langpref, element_key):
- values = self._mdui_uiinfo_i18n_elements_lookup(
- entity_id, langpref, element_key, self._lookup_elements_by_key
- )
+ values = self._mdui_uiinfo_i18n_elements_lookup(entity_id, langpref, element_key, self._lookup_elements_by_key)
return values
def mdui_uiinfo_display_name(self, entity_id, langpref=None):
@@ -1706,10 +1626,7 @@ class MetadataStore(MetaData):
"contact_type": _contact_type,
"given_name": contact.get("given_name", {}).get("text", ""),
"email_address": [
- address
- for email in contact.get("email_address", {})
- for address in [email.get("text")]
- if address
+ address for email in contact.get("email_address", {}) for address in [email.get("text")] if address
],
}
for contact in data.get("contact_person", [])
@@ -1778,8 +1695,7 @@ class MetadataStore(MetaData):
res = EntitiesDescriptor()
for _md in self.metadata.values():
try:
- res.entity_descriptor.extend(
- _md.entities_descr.entity_descriptor)
+ res.entity_descriptor.extend(_md.entities_descr.entity_descriptor)
except AttributeError:
res.entity_descriptor.append(_md.entity_descr)
diff --git a/src/saml2/metadata.py b/src/saml2/metadata.py
index 9610ff08..c5066ba9 100644
--- a/src/saml2/metadata.py
+++ b/src/saml2/metadata.py
@@ -1,37 +1,37 @@
#!/usr/bin/env python
+import six
+
+from saml2 import BINDING_HTTP_POST
+from saml2 import BINDING_HTTP_REDIRECT
+from saml2 import BINDING_SOAP
+from saml2 import SAMLError
+from saml2 import class_name
+from saml2 import md
+from saml2 import samlp
+from saml2 import xmldsig as ds
from saml2.algsupport import algorithm_support_in_metadata
-from saml2.md import AttributeProfile
-from saml2.sigver import security_context
+from saml2.attribute_converter import from_local_name
from saml2.cert import read_cert_from_file
from saml2.config import Config
-from saml2.validate import valid_instance
-from saml2.time_util import in_a_while
-from saml2.extension import mdui
from saml2.extension import idpdisc
-from saml2.extension import shibmd
from saml2.extension import mdattr
+from saml2.extension import mdui
+from saml2.extension import shibmd
from saml2.extension import sp_type
+from saml2.md import AttributeProfile
+from saml2.s_utils import factory
+from saml2.s_utils import rec_factory
+from saml2.s_utils import sid
from saml2.saml import NAME_FORMAT_URI
-from saml2.saml import AttributeValue
from saml2.saml import Attribute
-from saml2.attribute_converter import from_local_name
-from saml2 import md, SAMLError
-from saml2 import BINDING_HTTP_POST
-from saml2 import BINDING_HTTP_REDIRECT
-from saml2 import BINDING_SOAP
-from saml2 import samlp
-from saml2 import class_name
-
-from saml2 import xmldsig as ds
-import six
-
+from saml2.saml import AttributeValue
from saml2.sigver import pre_signature_part
+from saml2.sigver import security_context
+from saml2.time_util import in_a_while
+from saml2.validate import valid_instance
-from saml2.s_utils import factory
-from saml2.s_utils import rec_factory
-from saml2.s_utils import sid
-__author__ = 'rolandh'
+__author__ = "rolandh"
NSPAIR = {
"saml2p": "urn:oasis:names:tc:SAML:2.0:protocol",
@@ -54,13 +54,13 @@ DEFAULTS = {
ORG_ATTR_TRANSL = {
"organization_name": ("name", md.OrganizationName),
"organization_display_name": ("display_name", md.OrganizationDisplayName),
- "organization_url": ("url", md.OrganizationURL)
+ "organization_url": ("url", md.OrganizationURL),
}
MDNS = '"urn:oasis:names:tc:SAML:2.0:metadata"'
bMDNS = b'"urn:oasis:names:tc:SAML:2.0:metadata"'
-XMLNSXS = " xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
-bXMLNSXS = b" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
+XMLNSXS = ' xmlns:xs="http://www.w3.org/2001/XMLSchema"'
+bXMLNSXS = b' xmlns:xs="http://www.w3.org/2001/XMLSchema"'
def metadata_tostring_fix(desc, nspair, xmlstring=""):
@@ -68,10 +68,10 @@ def metadata_tostring_fix(desc, nspair, xmlstring=""):
xmlstring = desc.to_string(nspair)
try:
- if "\"xs:string\"" in xmlstring and XMLNSXS not in xmlstring:
+ if '"xs:string"' in xmlstring and XMLNSXS not in xmlstring:
xmlstring = xmlstring.replace(MDNS, MDNS + XMLNSXS)
except TypeError:
- if b"\"xs:string\"" in xmlstring and bXMLNSXS not in xmlstring:
+ if b'"xs:string"' in xmlstring and bXMLNSXS not in xmlstring:
xmlstring = xmlstring.replace(bMDNS, bMDNS + bXMLNSXS)
return xmlstring
@@ -112,9 +112,7 @@ def create_metadata_string(
sign_alg = sign_alg or config.signing_algorithm
digest_alg = digest_alg or config.digest_algorithm
if mid:
- eid, xmldoc = entities_descriptor(
- eds, valid_for, name, mid, sign, secc, sign_alg, digest_alg
- )
+ eid, xmldoc = entities_descriptor(eds, valid_for, name, mid, sign, secc, sign_alg, digest_alg)
else:
eid = eds[0]
if sign:
@@ -158,8 +156,7 @@ def do_organization_info(ava):
if isinstance(ava[ckey], six.string_types):
setattr(org, dkey, [_localized_name(ava[ckey], klass)])
elif isinstance(ava[ckey], list):
- setattr(org, dkey,
- [_localized_name(n, klass) for n in ava[ckey]])
+ setattr(org, dkey, [_localized_name(n, klass) for n in ava[ckey]])
else:
setattr(org, dkey, [_localized_name(ava[ckey], klass)])
return org
@@ -187,12 +184,8 @@ def do_key_descriptor(cert=None, enc_cert=None, use="both"):
for _cert in cert:
kd_list.append(
md.KeyDescriptor(
- key_info=ds.KeyInfo(
- x509_data=ds.X509Data(
- x509_certificate=ds.X509Certificate(text=_cert)
- )
- ),
- use="signing"
+ key_info=ds.KeyInfo(x509_data=ds.X509Data(x509_certificate=ds.X509Certificate(text=_cert))),
+ use="signing",
)
)
if use in ["both", "encryption"] and enc_cert is not None:
@@ -201,27 +194,18 @@ def do_key_descriptor(cert=None, enc_cert=None, use="both"):
for _enc_cert in enc_cert:
kd_list.append(
md.KeyDescriptor(
- key_info=ds.KeyInfo(
- x509_data=ds.X509Data(
- x509_certificate=ds.X509Certificate(text=_enc_cert)
- )
- ),
- use="encryption"
+ key_info=ds.KeyInfo(x509_data=ds.X509Data(x509_certificate=ds.X509Certificate(text=_enc_cert))),
+ use="encryption",
)
)
if len(kd_list) == 0 and cert is not None:
return md.KeyDescriptor(
- key_info=ds.KeyInfo(
- x509_data=ds.X509Data(
- x509_certificate=ds.X509Certificate(text=cert)
- )
- )
+ key_info=ds.KeyInfo(x509_data=ds.X509Data(x509_certificate=ds.X509Certificate(text=cert)))
)
return kd_list
-def do_requested_attribute(attributes, acs, is_required="false",
- name_format=NAME_FORMAT_URI):
+def do_requested_attribute(attributes, acs, is_required="false", name_format=NAME_FORMAT_URI):
lista = []
for attr in attributes:
attr = from_local_name(acs, attr, name_format)
@@ -239,8 +223,7 @@ def do_requested_attribute(attributes, acs, is_required="false",
def do_uiinfo(_uiinfo):
uii = mdui.UIInfo()
- for attr in ['display_name', 'description', "information_url",
- 'privacy_statement_url']:
+ for attr in ["display_name", "description", "information_url", "privacy_statement_url"]:
try:
val = _uiinfo[attr]
except KeyError:
@@ -326,8 +309,7 @@ def do_uiinfo(_uiinfo):
def do_idpdisc(discovery_response):
- return idpdisc.DiscoveryResponse(index="0", location=discovery_response,
- binding=idpdisc.NAMESPACE)
+ return idpdisc.DiscoveryResponse(index="0", location=discovery_response, binding=idpdisc.NAMESPACE)
ENDPOINTS = {
@@ -350,21 +332,13 @@ ENDPOINTS = {
"single_logout_service": (md.SingleLogoutService, False),
"manage_name_id_service": (md.ManageNameIDService, False),
"assertion_id_request_service": (md.AssertionIDRequestService, False),
- "attribute_service": (md.AttributeService, False)
- },
- "pdp": {
- "authz_service": (md.AuthzService, True)
+ "attribute_service": (md.AttributeService, False),
},
- "aq": {
- "authn_query_service": (md.AuthnQueryService, True)
- }
+ "pdp": {"authz_service": (md.AuthzService, True)},
+ "aq": {"authn_query_service": (md.AuthnQueryService, True)},
}
-ENDPOINT_EXT = {
- "sp": {
- "discovery_response": (idpdisc.DiscoveryResponse, True)
- }
-}
+ENDPOINT_EXT = {"sp": {"discovery_response": (idpdisc.DiscoveryResponse, True)}}
DEFAULT_BINDING = {
"assertion_consumer_service": BINDING_HTTP_POST,
@@ -372,14 +346,13 @@ DEFAULT_BINDING = {
"single_logout_service": BINDING_HTTP_POST,
"attribute_service": BINDING_SOAP,
"artifact_resolution_service": BINDING_SOAP,
- "authn_query_service": BINDING_SOAP
+ "authn_query_service": BINDING_SOAP,
}
def do_extensions(mname, item):
try:
- _mod = __import__("saml2.extension.%s" % mname, globals(), locals(),
- mname)
+ _mod = __import__("saml2.extension.%s" % mname, globals(), locals(), mname)
except ImportError:
return None
else:
@@ -411,16 +384,13 @@ def do_endpoints(conf, endpoints):
servs = []
i = 1
for args in conf[endpoint]:
- if isinstance(args,
- six.string_types): # Assume it's the location
- args = {"location": args,
- "binding": DEFAULT_BINDING[endpoint]}
+ if isinstance(args, six.string_types): # Assume it's the location
+ args = {"location": args, "binding": DEFAULT_BINDING[endpoint]}
elif isinstance(args, tuple) or isinstance(args, list):
if len(args) == 2: # (location, binding)
args = {"location": args[0], "binding": args[1]}
elif len(args) == 3: # (location, binding, index)
- args = {"location": args[0], "binding": args[1],
- "index": args[2]}
+ args = {"location": args[0], "binding": args[1], "index": args[2]}
if indexed:
if "index" not in args:
@@ -461,14 +431,13 @@ def do_attribute_consuming_service(conf, spsso):
if req:
requested_attributes.extend(
- do_requested_attribute(req, acs, is_required="true",
- name_format=req_attr_name_format))
+ do_requested_attribute(req, acs, is_required="true", name_format=req_attr_name_format)
+ )
opt = conf.getattr("optional_attributes", "sp")
if opt:
- requested_attributes.extend(
- do_requested_attribute(opt, acs, name_format=req_attr_name_format))
+ requested_attributes.extend(do_requested_attribute(opt, acs, name_format=req_attr_name_format))
try:
if conf.description:
@@ -498,8 +467,8 @@ def do_attribute_consuming_service(conf, spsso):
service_name = [md.ServiceName(text="", lang="en")]
ac_serv = md.AttributeConsumingService(
- index="1", service_name=service_name,
- requested_attribute=requested_attributes)
+ index="1", service_name=service_name, requested_attribute=requested_attributes
+ )
if service_description:
ac_serv.service_description = service_description
@@ -524,8 +493,7 @@ def do_spsso_descriptor(conf, cert=None, enc_cert=None):
endps = conf.getattr("endpoints", "sp")
if endps:
- for (endpoint, instlist) in do_endpoints(endps,
- ENDPOINTS["sp"]).items():
+ for (endpoint, instlist) in do_endpoints(endps, ENDPOINTS["sp"]).items():
setattr(spsso, endpoint, instlist)
ext = do_endpoints(endps, ENDPOINT_EXT["sp"])
@@ -544,8 +512,7 @@ def do_spsso_descriptor(conf, cert=None, enc_cert=None):
if cert or enc_cert:
metadata_key_usage = conf.metadata_key_usage
- spsso.key_descriptor = do_key_descriptor(cert=cert, enc_cert=enc_cert,
- use=metadata_key_usage)
+ spsso.key_descriptor = do_key_descriptor(cert=cert, enc_cert=enc_cert, use=metadata_key_usage)
for key in ["want_assertions_signed", "authn_requests_signed"]:
try:
@@ -569,8 +536,7 @@ def do_idpsso_descriptor(conf, cert=None, enc_cert=None):
endps = conf.getattr("endpoints", "idp")
if endps:
- for (endpoint, instlist) in do_endpoints(endps,
- ENDPOINTS["idp"]).items():
+ for (endpoint, instlist) in do_endpoints(endps, ENDPOINTS["idp"]).items():
setattr(idpsso, endpoint, instlist)
_do_nameid_format(idpsso, conf, "idp")
@@ -593,8 +559,7 @@ def do_idpsso_descriptor(conf, cert=None, enc_cert=None):
idpsso.extensions.add_extension_element(do_uiinfo(ui_info))
if cert or enc_cert:
- idpsso.key_descriptor = do_key_descriptor(cert, enc_cert,
- use=conf.metadata_key_usage)
+ idpsso.key_descriptor = do_key_descriptor(cert, enc_cert, use=conf.metadata_key_usage)
for key in ["want_authn_requests_signed"]:
# "want_authn_requests_only_with_valid_cert"]:
@@ -617,15 +582,13 @@ def do_aa_descriptor(conf, cert=None, enc_cert=None):
endps = conf.getattr("endpoints", "aa")
if endps:
- for (endpoint, instlist) in do_endpoints(endps,
- ENDPOINTS["aa"]).items():
+ for (endpoint, instlist) in do_endpoints(endps, ENDPOINTS["aa"]).items():
setattr(aad, endpoint, instlist)
_do_nameid_format(aad, conf, "aa")
if cert or enc_cert:
- aad.key_descriptor = do_key_descriptor(cert, enc_cert,
- use=conf.metadata_key_usage)
+ aad.key_descriptor = do_key_descriptor(cert, enc_cert, use=conf.metadata_key_usage)
attributes = conf.getattr("attribute", "aa")
if attributes:
@@ -647,21 +610,19 @@ def do_aq_descriptor(conf, cert=None, enc_cert=None):
endps = conf.getattr("endpoints", "aq")
if endps:
- for (endpoint, instlist) in do_endpoints(endps,
- ENDPOINTS["aq"]).items():
+ for (endpoint, instlist) in do_endpoints(endps, ENDPOINTS["aq"]).items():
setattr(aqs, endpoint, instlist)
_do_nameid_format(aqs, conf, "aq")
if cert or enc_cert:
- aqs.key_descriptor = do_key_descriptor(cert, enc_cert,
- use=conf.metadata_key_usage)
+ aqs.key_descriptor = do_key_descriptor(cert, enc_cert, use=conf.metadata_key_usage)
return aqs
def do_pdp_descriptor(conf, cert=None, enc_cert=None):
- """ Create a Policy Decision Point descriptor """
+ """Create a Policy Decision Point descriptor"""
pdp = md.PDPDescriptor()
pdp.protocol_support_enumeration = samlp.NAMESPACE
@@ -669,26 +630,20 @@ def do_pdp_descriptor(conf, cert=None, enc_cert=None):
endps = conf.getattr("endpoints", "pdp")
if endps:
- for (endpoint, instlist) in do_endpoints(endps,
- ENDPOINTS["pdp"]).items():
+ for (endpoint, instlist) in do_endpoints(endps, ENDPOINTS["pdp"]).items():
setattr(pdp, endpoint, instlist)
_do_nameid_format(pdp, conf, "pdp")
if cert:
- pdp.key_descriptor = do_key_descriptor(cert, enc_cert,
- use=conf.metadata_key_usage)
+ pdp.key_descriptor = do_key_descriptor(cert, enc_cert, use=conf.metadata_key_usage)
return pdp
def _add_attr_to_entity_attributes(extensions, attribute):
try:
- entity_attributes = next(
- el
- for el in extensions.extension_elements
- if el.tag == mdattr.EntityAttributes.c_tag
- )
+ entity_attributes = next(el for el in extensions.extension_elements if el.tag == mdattr.EntityAttributes.c_tag)
except StopIteration:
entity_attributes = mdattr.EntityAttributes(attribute=attribute)
extensions.add_extension_element(entity_attributes)
@@ -729,10 +684,7 @@ def entity_descriptor(confd):
name_format=attr.get("format"),
name=attr.get("name"),
friendly_name=attr.get("friendly_name"),
- attribute_value=[
- AttributeValue(text=value)
- for value in attr.get("values", [])
- ],
+ attribute_value=[AttributeValue(text=value) for value in attr.get("values", [])],
)
for attr in confd.entity_attributes
]
@@ -753,18 +705,14 @@ def entity_descriptor(confd):
if not entd.extensions:
entd.extensions = md.Extensions()
ava = [AttributeValue(text=c) for c in confd.entity_category]
- attr = Attribute(
- attribute_value=ava, name="http://macedir.org/entity-category"
- )
+ attr = Attribute(attribute_value=ava, name="http://macedir.org/entity-category")
_add_attr_to_entity_attributes(entd.extensions, attr)
if confd.entity_category_support:
if not entd.extensions:
entd.extensions = md.Extensions()
ava = [AttributeValue(text=c) for c in confd.entity_category_support]
- attr = Attribute(
- attribute_value=ava, name="http://macedir.org/entity-category-support"
- )
+ attr = Attribute(attribute_value=ava, name="http://macedir.org/entity-category-support")
_add_attr_to_entity_attributes(entd.extensions, attr)
for item in algorithm_support_in_metadata(confd.xmlsec_binary):
@@ -772,8 +720,8 @@ def entity_descriptor(confd):
entd.extensions = md.Extensions()
entd.extensions.add_extension_element(item)
- conf_sp_type = confd.getattr('sp_type', 'sp')
- conf_sp_type_in_md = confd.getattr('sp_type_in_metadata', 'sp')
+ conf_sp_type = confd.getattr("sp_type", "sp")
+ conf_sp_type_in_md = confd.getattr("sp_type_in_metadata", "sp")
if conf_sp_type and conf_sp_type_in_md is True:
if not entd.extensions:
entd.extensions = md.Extensions()
@@ -782,8 +730,7 @@ def entity_descriptor(confd):
serves = confd.serves
if not serves:
- raise SAMLError(
- 'No service type ("sp","idp","aa") provided in the configuration')
+ raise SAMLError('No service type ("sp","idp","aa") provided in the configuration')
if "sp" in serves:
confd.context = "sp"
@@ -793,22 +740,18 @@ def entity_descriptor(confd):
entd.idpsso_descriptor = do_idpsso_descriptor(confd, mycert, enc_cert)
if "aa" in serves:
confd.context = "aa"
- entd.attribute_authority_descriptor = do_aa_descriptor(confd, mycert,
- enc_cert)
+ entd.attribute_authority_descriptor = do_aa_descriptor(confd, mycert, enc_cert)
if "pdp" in serves:
confd.context = "pdp"
entd.pdp_descriptor = do_pdp_descriptor(confd, mycert, enc_cert)
if "aq" in serves:
confd.context = "aq"
- entd.authn_authority_descriptor = do_aq_descriptor(confd, mycert,
- enc_cert)
+ entd.authn_authority_descriptor = do_aq_descriptor(confd, mycert, enc_cert)
return entd
-def entities_descriptor(
- eds, valid_for, name, ident, sign, secc, sign_alg=None, digest_alg=None
-):
+def entities_descriptor(eds, valid_for, name, ident, sign, secc, sign_alg=None, digest_alg=None):
entities = md.EntitiesDescriptor(entity_descriptor=eds)
if valid_for:
entities.valid_until = in_a_while(hours=valid_for)
@@ -822,16 +765,12 @@ def entities_descriptor(
ident = sid()
if not secc.key_file:
- raise SAMLError("If you want to do signing you should define " +
- "a key to sign with")
+ raise SAMLError("If you want to do signing you should define " + "a key to sign with")
if not secc.my_cert:
- raise SAMLError("If you want to do signing you should define " +
- "where your public key are")
+ raise SAMLError("If you want to do signing you should define " + "where your public key are")
- entities.signature = pre_signature_part(ident, secc.my_cert, 1,
- sign_alg=sign_alg,
- digest_alg=digest_alg)
+ entities.signature = pre_signature_part(ident, secc.my_cert, 1, sign_alg=sign_alg, digest_alg=digest_alg)
entities.id = ident
xmldoc = secc.sign_statement("%s" % entities, class_name(entities))
entities = md.entities_descriptor_from_string(xmldoc)
diff --git a/src/saml2/mongo_store.py b/src/saml2/mongo_store.py
index 7df1b565..143dd571 100644
--- a/src/saml2/mongo_store.py
+++ b/src/saml2/mongo_store.py
@@ -3,33 +3,32 @@ from hashlib import sha1
import logging
from pymongo import MongoClient
+import pymongo.errors
from pymongo.mongo_replica_set_client import MongoReplicaSetClient
import pymongo.uri_parser
-import pymongo.errors
-from saml2.saml import NAMEID_FORMAT_PERSISTENT
+import six
from saml2.eptid import Eptid
-from saml2.mdstore import InMemoryMetaData
-from saml2.mdstore import metadata_modules
-from saml2.mdstore import load_metadata_modules
-from saml2.s_utils import PolicyError
-
-from saml2.ident import code_binary
from saml2.ident import IdentDB
from saml2.ident import Unknown
-from saml2.mdie import to_dict
+from saml2.ident import code_binary
from saml2.mdie import from_dict
-
-import six
+from saml2.mdie import to_dict
+from saml2.mdstore import InMemoryMetaData
+from saml2.mdstore import load_metadata_modules
+from saml2.mdstore import metadata_modules
+from saml2.s_utils import PolicyError
+from saml2.saml import NAMEID_FORMAT_PERSISTENT
-__author__ = 'rolandh'
+__author__ = "rolandh"
logger = logging.getLogger(__name__)
ONTS = load_metadata_modules()
MMODS = metadata_modules()
+
class CorruptDatabase(Exception):
pass
@@ -40,7 +39,7 @@ def context_match(cfilter, cntx):
class SessionStorageMDB(object):
- """ Session information is stored in a MongoDB database"""
+ """Session information is stored in a MongoDB database"""
def __init__(self, database="", collection="assertion", **kwargs):
db = _mdb_get_database(database, **kwargs)
@@ -62,8 +61,7 @@ class SessionStorageMDB(object):
def get_assertion(self, cid):
res = []
for item in self.assertion.find({"assertion_id": cid}):
- res.append({"assertion": from_dict(item["assertion"], ONTS, True),
- "to_sign": item["to_sign"]})
+ res.append({"assertion": from_dict(item["assertion"], ONTS, True), "to_sign": item["to_sign"]})
if len(res) == 1:
return res[0]
elif res is []:
@@ -71,8 +69,7 @@ class SessionStorageMDB(object):
else:
raise SystemError("More then one assertion with the same ID")
- def get_assertions_by_subject(self, name_id=None, session_index=None,
- requested_context=None):
+ def get_assertions_by_subject(self, name_id=None, session_index=None, requested_context=None):
"""
:param name_id: One of name_id or key can be used to get the authn
@@ -93,8 +90,7 @@ class SessionStorageMDB(object):
result.append(assertion)
break
if requested_context:
- if context_match(requested_context,
- statement.authn_context):
+ if context_match(requested_context, statement.authn_context):
result.append(assertion)
break
else:
@@ -107,8 +103,7 @@ class SessionStorageMDB(object):
for item in self.assertion.find({"name_id_key": key}):
self.assertion.remove(item["_id"])
- def get_authn_statements(self, name_id, session_index=None,
- requested_context=None):
+ def get_authn_statements(self, name_id, session_index=None, requested_context=None):
"""
:param name_id:
@@ -116,13 +111,11 @@ class SessionStorageMDB(object):
:param requested_context:
:return:
"""
- return [k.authn_statement for k in self.get_assertions_by_subject(
- name_id, session_index, requested_context)]
+ return [k.authn_statement for k in self.get_assertions_by_subject(name_id, session_index, requested_context)]
class IdentMDB(IdentDB):
- def __init__(self, database="", collection="ident", domain="",
- name_qualifier=""):
+ def __init__(self, database="", collection="ident", domain="", name_qualifier=""):
IdentDB.__init__(self, None, domain, name_qualifier)
self.mdb = MDB(database=database, collection=collection)
self.mdb.primary_key = "user_id"
@@ -142,8 +135,9 @@ class IdentMDB(IdentDB):
def store(self, ident, name_id):
self.mdb.store(ident, name_id=to_dict(name_id, MMODS, True))
- def find_nameid(self, userid, nformat=None, sp_name_qualifier=None,
- name_qualifier=None, sp_provided_id=None, **kwargs):
+ def find_nameid(
+ self, userid, nformat=None, sp_name_qualifier=None, name_qualifier=None, sp_provided_id=None, **kwargs
+ ):
# reset passed for compatibility kwargs for next usage
kwargs = {}
if nformat:
@@ -296,15 +290,12 @@ def _mdb_get_database(uri, **kwargs):
_db = _conn[db_name]
if "username" in _parsed_uri:
- _db.authenticate(
- _parsed_uri.get("username", None),
- _parsed_uri.get("password", None)
- )
+ _db.authenticate(_parsed_uri.get("username", None), _parsed_uri.get("password", None))
return _db
-#------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------
class EptidMDB(Eptid):
def __init__(self, secret, database="", collection="eptid"):
Eptid.__init__(self, secret)
@@ -324,7 +315,8 @@ class EptidMDB(Eptid):
self.mdb.store(key, **{"eptid": value})
-#------------------------------------------------------------------------------
+# ------------------------------------------------------------------------------
+
def protect(dic):
res = {}
diff --git a/src/saml2/pack.py b/src/saml2/pack.py
index 36480743..ea76d7af 100644
--- a/src/saml2/pack.py
+++ b/src/saml2/pack.py
@@ -8,6 +8,8 @@ Bindings normally consists of three parts:
"""
import base64
+
+
try:
import html
except:
@@ -15,17 +17,21 @@ except:
import logging
+import six
+from six.moves.urllib.parse import urlencode
+from six.moves.urllib.parse import urlparse
+
import saml2
from saml2.s_utils import deflate_and_base64_encode
-from saml2.sigver import REQ_ORDER, RESP_ORDER
+from saml2.sigver import REQ_ORDER
+from saml2.sigver import RESP_ORDER
from saml2.xmldsig import SIG_ALLOWED_ALG
-import six
-from six.moves.urllib.parse import urlencode, urlparse
try:
from xml.etree import cElementTree as ElementTree
- if ElementTree.VERSION < '1.3.0':
+
+ if ElementTree.VERSION < "1.3.0":
# cElementTree has no support for register_namespace
# neither _namespace_map, thus we sacrify performance
# for correctness
@@ -35,6 +41,7 @@ except ImportError:
import cElementTree as ElementTree
except ImportError:
from elementtree import ElementTree
+
import defusedxml.ElementTree
@@ -72,8 +79,7 @@ def _html_escape(payload):
return html.escape(payload, quote=True)
-def http_form_post_message(message, location, relay_state="",
- typ="SAMLRequest", **kwargs):
+def http_form_post_message(message, location, relay_state="", typ="SAMLRequest", **kwargs):
"""The HTTP POST binding defines a mechanism by which SAML protocol
messages may be transmitted within the base64-encoded content of a
HTML form control.
@@ -86,30 +92,25 @@ def http_form_post_message(message, location, relay_state="",
if not isinstance(message, six.string_types):
message = str(message)
if not isinstance(message, six.binary_type):
- message = message.encode('utf-8')
+ message = message.encode("utf-8")
if typ == "SAMLRequest" or typ == "SAMLResponse":
_msg = base64.b64encode(message)
else:
_msg = message
- _msg = _msg.decode('ascii')
+ _msg = _msg.decode("ascii")
- saml_response_input = HTML_INPUT_ELEMENT_SPEC.format(
- name=_html_escape(typ),
- val=_html_escape(_msg),
- type='hidden')
+ saml_response_input = HTML_INPUT_ELEMENT_SPEC.format(name=_html_escape(typ), val=_html_escape(_msg), type="hidden")
relay_state_input = ""
if relay_state:
relay_state_input = HTML_INPUT_ELEMENT_SPEC.format(
- name='RelayState',
- val=_html_escape(relay_state),
- type='hidden')
+ name="RelayState", val=_html_escape(relay_state), type="hidden"
+ )
response = HTML_FORM_SPEC.format(
- saml_response_input=saml_response_input,
- relay_state_input=relay_state_input,
- action=location)
+ saml_response_input=saml_response_input, relay_state_input=relay_state_input, action=location
+ )
return {"headers": [("Content-type", "text/html")], "data": response, "status": 200}
@@ -124,21 +125,19 @@ def http_post_message(message, relay_state="", typ="SAMLRequest", **kwargs):
if not isinstance(message, six.string_types):
message = str(message)
if not isinstance(message, six.binary_type):
- message = message.encode('utf-8')
+ message = message.encode("utf-8")
if typ == "SAMLRequest" or typ == "SAMLResponse":
_msg = base64.b64encode(message)
else:
_msg = message
- _msg = _msg.decode('ascii')
+ _msg = _msg.decode("ascii")
part = {typ: _msg}
if relay_state:
part["RelayState"] = relay_state
- return {"headers": [("Content-type", 'application/x-www-form-urlencoded')],
- "data": urlencode(part),
- "status": 200}
+ return {"headers": [("Content-type", "application/x-www-form-urlencoded")], "data": urlencode(part), "status": 200}
def http_redirect_message(
@@ -188,22 +187,20 @@ def http_redirect_message(
if sign:
# sigalgs, should be one defined in xmldsig
if sigalg not in [long_name for short_name, long_name in SIG_ALLOWED_ALG]:
- raise Exception(
- "Signature algo not in allowed list: {algo}".format(algo=sigalg)
- )
+ raise Exception("Signature algo not in allowed list: {algo}".format(algo=sigalg))
signer = backend.get_signer(sigalg) if sign and sigalg else None
if not signer:
raise Exception("Could not init signer fro algo {algo}".format(algo=sigalg))
args["SigAlg"] = sigalg
string = "&".join(urlencode({k: args[k]}) for k in _order if k in args)
- string_enc = string.encode('ascii')
+ string_enc = string.encode("ascii")
args["Signature"] = base64.b64encode(signer.sign(string_enc))
string = urlencode(args)
glue_char = "&" if urlparse(location).query else "?"
login_url = glue_char.join([location, string])
- headers = [('Location', str(login_url))]
+ headers = [("Location", str(login_url))]
body = []
return {"headers": headers, "data": body, "status": 303}
@@ -214,50 +211,50 @@ PREFIX = '<?xml version="1.0" encoding="UTF-8"?>'
def make_soap_enveloped_saml_thingy(thingy, header_parts=None):
- """ Returns a soap envelope containing a SAML request
+ """Returns a soap envelope containing a SAML request
as a text string.
:param thingy: The SAML thingy
:return: The SOAP envelope as a string
"""
- envelope = ElementTree.Element('')
- envelope.tag = '{%s}Envelope' % NAMESPACE
+ envelope = ElementTree.Element("")
+ envelope.tag = "{%s}Envelope" % NAMESPACE
if header_parts:
- header = ElementTree.Element('')
- header.tag = '{%s}Header' % NAMESPACE
+ header = ElementTree.Element("")
+ header.tag = "{%s}Header" % NAMESPACE
envelope.append(header)
for part in header_parts:
# This doesn't work if the headers are signed
part.become_child_element_of(header)
- body = ElementTree.Element('')
- body.tag = '{%s}Body' % NAMESPACE
+ body = ElementTree.Element("")
+ body.tag = "{%s}Body" % NAMESPACE
envelope.append(body)
if isinstance(thingy, six.string_types):
# remove the first XML version/encoding line
- if thingy[0:5].lower() == '<?xml':
+ if thingy[0:5].lower() == "<?xml":
logger.debug("thingy0: %s", thingy)
_part = thingy.split("\n")
thingy = "\n".join(_part[1:])
thingy = thingy.replace(PREFIX, "")
logger.debug("thingy: %s", thingy)
- _child = ElementTree.Element('')
- _child.tag = '{%s}FuddleMuddle' % DUMMY_NAMESPACE
+ _child = ElementTree.Element("")
+ _child.tag = "{%s}FuddleMuddle" % DUMMY_NAMESPACE
body.append(_child)
_str = ElementTree.tostring(envelope, encoding="UTF-8")
if isinstance(_str, six.binary_type):
- _str = _str.decode('utf-8')
+ _str = _str.decode("utf-8")
logger.debug("SOAP precursor: %s", _str)
# find an remove the namespace definition
i = _str.find(DUMMY_NAMESPACE)
j = _str.rfind("xmlns:", 0, i)
- cut1 = _str[j:i + len(DUMMY_NAMESPACE) + 1]
+ cut1 = _str[j : i + len(DUMMY_NAMESPACE) + 1]
_str = _str.replace(cut1, "")
first = _str.find("<%s:FuddleMuddle" % (cut1[6:9],))
last = _str.find(">", first + 14)
- cut2 = _str[first:last + 1]
+ cut2 = _str[first : last + 1]
return _str.replace(cut2, thingy)
else:
thingy.become_child_element_of(body)
@@ -265,15 +262,19 @@ def make_soap_enveloped_saml_thingy(thingy, header_parts=None):
def http_soap_message(message):
- return {"headers": [("Content-type", "application/soap+xml")],
- "data": make_soap_enveloped_saml_thingy(message),
- "status": 200}
+ return {
+ "headers": [("Content-type", "application/soap+xml")],
+ "data": make_soap_enveloped_saml_thingy(message),
+ "status": 200,
+ }
def http_paos(message, extra=None):
- return {"headers": [("Content-type", "application/soap+xml")],
- "data": make_soap_enveloped_saml_thingy(message, extra),
- "status": 200}
+ return {
+ "headers": [("Content-type", "application/soap+xml")],
+ "data": make_soap_enveloped_saml_thingy(message, extra),
+ "status": 200,
+ }
def parse_soap_enveloped_saml(text, body_class, header_class=None):
@@ -287,9 +288,7 @@ def parse_soap_enveloped_saml(text, body_class, header_class=None):
envelope_tag = "{%s}Envelope" % NAMESPACE
if envelope.tag != envelope_tag:
raise ValueError(
- "Invalid envelope tag '{invalid}' should be '{valid}'".format(
- invalid=envelope.tag, valid=envelope_tag
- )
+ "Invalid envelope tag '{invalid}' should be '{valid}'".format(invalid=envelope.tag, valid=envelope_tag)
)
# print(len(envelope))
@@ -297,15 +296,13 @@ def parse_soap_enveloped_saml(text, body_class, header_class=None):
header = {}
for part in envelope:
# print(">",part.tag)
- if part.tag == '{%s}Body' % NAMESPACE:
+ if part.tag == "{%s}Body" % NAMESPACE:
for sub in part:
try:
- body = saml2.create_class_from_element_tree(
- body_class, sub)
+ body = saml2.create_class_from_element_tree(body_class, sub)
except Exception:
- raise Exception(
- "Wrong body type (%s) in SOAP envelope" % sub.tag)
- elif part.tag == '{%s}Header' % NAMESPACE:
+ raise Exception("Wrong body type (%s) in SOAP envelope" % sub.tag)
+ elif part.tag == "{%s}Header" % NAMESPACE:
if not header_class:
raise Exception("Header where I didn't expect one")
# print("--- HEADER ---")
@@ -314,8 +311,7 @@ def parse_soap_enveloped_saml(text, body_class, header_class=None):
for klass in header_class:
# print("?{%s}%s" % (klass.c_namespace,klass.c_tag))
if sub.tag == "{%s}%s" % (klass.c_namespace, klass.c_tag):
- header[sub.tag] = \
- saml2.create_class_from_element_tree(klass, sub)
+ header[sub.tag] = saml2.create_class_from_element_tree(klass, sub)
break
return body, header
@@ -336,6 +332,5 @@ def packager(identifier):
raise Exception("Unknown binding type: %s" % identifier)
-def factory(binding, message, location, relay_state="", typ="SAMLRequest",
- **kwargs):
+def factory(binding, message, location, relay_state="", typ="SAMLRequest", **kwargs):
return PACKING[binding](message, location, relay_state, typ, **kwargs)
diff --git a/src/saml2/population.py b/src/saml2/population.py
index 37b36352..72baa830 100644
--- a/src/saml2/population.py
+++ b/src/saml2/population.py
@@ -4,6 +4,7 @@ import six
from saml2.cache import Cache
+
logger = logging.getLogger(__name__)
@@ -24,8 +25,7 @@ class Population(object):
session_info = dict(session_info)
name_id = session_info["name_id"]
issuer = session_info.pop("issuer")
- self.cache.set(name_id, issuer, session_info,
- session_info["not_on_or_after"])
+ self.cache.set(name_id, issuer, session_info, session_info["not_on_or_after"])
return name_id
def stale_sources_for_person(self, name_id, sources=None):
@@ -60,8 +60,7 @@ class Population(object):
def get_entityid(self, name_id, source_id, check_not_on_or_after=True):
try:
- return self.cache.get(name_id, source_id, check_not_on_or_after)[
- "name_id"]
+ return self.cache.get(name_id, source_id, check_not_on_or_after)["name_id"]
except (KeyError, ValueError):
return ""
diff --git a/src/saml2/profile/__init__.py b/src/saml2/profile/__init__.py
index cf3ef629..4f337956 100644
--- a/src/saml2/profile/__init__.py
+++ b/src/saml2/profile/__init__.py
@@ -1,2 +1,2 @@
-#profile schema descriptions
-__author__ = 'rolandh'
+# profile schema descriptions
+__author__ = "rolandh"
diff --git a/src/saml2/profile/ecp.py b/src/saml2/profile/ecp.py
index df783994..300f7980 100644
--- a/src/saml2/profile/ecp.py
+++ b/src/saml2/profile/ecp.py
@@ -6,162 +6,176 @@
import saml2
from saml2 import SamlBase
-
from saml2 import saml
from saml2 import samlp
-#import soapenv as S
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp'
+
+# import soapenv as S
+
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp"
+
class RequestType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:RequestType element """
+ """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:RequestType element"""
- c_tag = 'RequestType'
+ c_tag = "RequestType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Issuer'] = ('issuer', saml.Issuer)
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}IDPList'] = ('idp_list', samlp.IDPList)
- c_cardinality['idp_list'] = {"min":0, "max":1}
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand'] = ('must_understand', 'None', True)
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}actor'] = ('actor', 'None', True)
- c_attributes['ProviderName'] = ('provider_name', 'string', False)
- c_attributes['IsPassive'] = ('is_passive', 'boolean', False)
- c_child_order.extend(['issuer', 'idp_list'])
-
- def __init__(self,
- issuer=None,
- idp_list=None,
- must_understand=None,
- actor=None,
- provider_name=None,
- is_passive=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.issuer=issuer
- self.idp_list=idp_list
- self.must_understand=must_understand
- self.actor=actor
- self.provider_name=provider_name
- self.is_passive=is_passive
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Issuer"] = ("issuer", saml.Issuer)
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}IDPList"] = ("idp_list", samlp.IDPList)
+ c_cardinality["idp_list"] = {"min": 0, "max": 1}
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand"] = ("must_understand", "None", True)
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}actor"] = ("actor", "None", True)
+ c_attributes["ProviderName"] = ("provider_name", "string", False)
+ c_attributes["IsPassive"] = ("is_passive", "boolean", False)
+ c_child_order.extend(["issuer", "idp_list"])
+
+ def __init__(
+ self,
+ issuer=None,
+ idp_list=None,
+ must_understand=None,
+ actor=None,
+ provider_name=None,
+ is_passive=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.issuer = issuer
+ self.idp_list = idp_list
+ self.must_understand = must_understand
+ self.actor = actor
+ self.provider_name = provider_name
+ self.is_passive = is_passive
+
def request_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestType_, xml_string)
class ResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:ResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:ResponseType element"""
- c_tag = 'ResponseType'
+ c_tag = "ResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand'] = ('must_understand', 'None', True)
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}actor'] = ('actor', 'None', True)
- c_attributes['AssertionConsumerServiceURL'] = ('assertion_consumer_service_url', 'anyURI', True)
-
- def __init__(self,
- must_understand=None,
- actor=None,
- assertion_consumer_service_url=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.must_understand=must_understand
- self.actor=actor
- self.assertion_consumer_service_url=assertion_consumer_service_url
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand"] = ("must_understand", "None", True)
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}actor"] = ("actor", "None", True)
+ c_attributes["AssertionConsumerServiceURL"] = ("assertion_consumer_service_url", "anyURI", True)
+
+ def __init__(
+ self,
+ must_understand=None,
+ actor=None,
+ assertion_consumer_service_url=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.must_understand = must_understand
+ self.actor = actor
+ self.assertion_consumer_service_url = assertion_consumer_service_url
+
def response_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ResponseType_, xml_string)
class RelayStateType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:RelayStateType element """
+ """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:RelayStateType element"""
- c_tag = 'RelayStateType'
+ c_tag = "RelayStateType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand'] = ('must_understand', 'string', True)
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}actor'] = ('actor', 'string', True)
-
- def __init__(self,
- must_understand=None,
- actor=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.must_understand=must_understand
- self.actor=actor
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand"] = ("must_understand", "string", True)
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}actor"] = ("actor", "string", True)
+
+ def __init__(
+ self,
+ must_understand=None,
+ actor=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.must_understand = must_understand
+ self.actor = actor
+
def relay_state_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RelayStateType_, xml_string)
class Request(RequestType_):
- """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:Request element """
+ """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:Request element"""
- c_tag = 'Request'
+ c_tag = "Request"
c_namespace = NAMESPACE
c_children = RequestType_.c_children.copy()
c_attributes = RequestType_.c_attributes.copy()
c_child_order = RequestType_.c_child_order[:]
c_cardinality = RequestType_.c_cardinality.copy()
+
def request_from_string(xml_string):
return saml2.create_class_from_xml_string(Request, xml_string)
class Response(ResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:Response element """
+ """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:Response element"""
- c_tag = 'Response'
+ c_tag = "Response"
c_namespace = NAMESPACE
c_children = ResponseType_.c_children.copy()
c_attributes = ResponseType_.c_attributes.copy()
c_child_order = ResponseType_.c_child_order[:]
c_cardinality = ResponseType_.c_cardinality.copy()
+
def response_from_string(xml_string):
return saml2.create_class_from_xml_string(Response, xml_string)
class RelayState(RelayStateType_):
- """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:RelayState element """
+ """The urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp:RelayState element"""
- c_tag = 'RelayState'
+ c_tag = "RelayState"
c_namespace = NAMESPACE
c_children = RelayStateType_.c_children.copy()
c_attributes = RelayStateType_.c_attributes.copy()
c_child_order = RelayStateType_.c_child_order[:]
c_cardinality = RelayStateType_.c_cardinality.copy()
+
def relay_state_from_string(xml_string):
return saml2.create_class_from_xml_string(RelayState, xml_string)
@@ -176,15 +190,14 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'Request': Request,
- 'RequestType': RequestType_,
- 'Response': Response,
- 'ResponseType': ResponseType_,
- 'RelayState': RelayState,
- 'RelayStateType': RelayStateType_,
+ "Request": Request,
+ "RequestType": RequestType_,
+ "Response": Response,
+ "ResponseType": ResponseType_,
+ "RelayState": RelayState,
+ "RelayStateType": RelayStateType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/profile/paos.py b/src/saml2/profile/paos.py
index f135d6dc..6dec83fa 100644
--- a/src/saml2/profile/paos.py
+++ b/src/saml2/profile/paos.py
@@ -7,108 +7,118 @@
import saml2
from saml2 import SamlBase
-#import soapenv as S
-NAMESPACE = 'urn:liberty:paos:2003-08'
+# import soapenv as S
+
+NAMESPACE = "urn:liberty:paos:2003-08"
+
class RequestType_(SamlBase):
- """The urn:liberty:paos:2003-08:RequestType element """
+ """The urn:liberty:paos:2003-08:RequestType element"""
- c_tag = 'RequestType'
+ c_tag = "RequestType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['responseConsumerURL'] = ('response_consumer_url', 'anyURI', True)
- c_attributes['service'] = ('service', 'anyURI', True)
- c_attributes['messageID'] = ('message_id', 'None', False)
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand'] = ('must_understand', 'None', True)
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}actor'] = ('actor', 'None', True)
-
- def __init__(self,
- response_consumer_url=None,
- service=None,
- message_id=None,
- must_understand=None,
- actor=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.response_consumer_url=response_consumer_url
- self.service=service
- self.message_id=message_id
- self.must_understand=must_understand
- self.actor=actor
+ c_attributes["responseConsumerURL"] = ("response_consumer_url", "anyURI", True)
+ c_attributes["service"] = ("service", "anyURI", True)
+ c_attributes["messageID"] = ("message_id", "None", False)
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand"] = ("must_understand", "None", True)
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}actor"] = ("actor", "None", True)
+
+ def __init__(
+ self,
+ response_consumer_url=None,
+ service=None,
+ message_id=None,
+ must_understand=None,
+ actor=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.response_consumer_url = response_consumer_url
+ self.service = service
+ self.message_id = message_id
+ self.must_understand = must_understand
+ self.actor = actor
+
def request_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestType_, xml_string)
class ResponseType_(SamlBase):
- """The urn:liberty:paos:2003-08:ResponseType element """
+ """The urn:liberty:paos:2003-08:ResponseType element"""
- c_tag = 'ResponseType'
+ c_tag = "ResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['refToMessageID'] = ('ref_to_message_id', 'None', False)
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand'] = ('must_understand', 'None', True)
- c_attributes['{http://schemas.xmlsoap.org/soap/envelope/}actor'] = ('actor', 'None', True)
-
- def __init__(self,
- ref_to_message_id=None,
- must_understand=None,
- actor=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.ref_to_message_id=ref_to_message_id
- self.must_understand=must_understand
- self.actor=actor
+ c_attributes["refToMessageID"] = ("ref_to_message_id", "None", False)
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}mustUnderstand"] = ("must_understand", "None", True)
+ c_attributes["{http://schemas.xmlsoap.org/soap/envelope/}actor"] = ("actor", "None", True)
+
+ def __init__(
+ self,
+ ref_to_message_id=None,
+ must_understand=None,
+ actor=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.ref_to_message_id = ref_to_message_id
+ self.must_understand = must_understand
+ self.actor = actor
+
def response_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ResponseType_, xml_string)
class Request(RequestType_):
- """The urn:liberty:paos:2003-08:Request element """
+ """The urn:liberty:paos:2003-08:Request element"""
- c_tag = 'Request'
+ c_tag = "Request"
c_namespace = NAMESPACE
c_children = RequestType_.c_children.copy()
c_attributes = RequestType_.c_attributes.copy()
c_child_order = RequestType_.c_child_order[:]
c_cardinality = RequestType_.c_cardinality.copy()
+
def request_from_string(xml_string):
return saml2.create_class_from_xml_string(Request, xml_string)
class Response(ResponseType_):
- """The urn:liberty:paos:2003-08:Response element """
+ """The urn:liberty:paos:2003-08:Response element"""
- c_tag = 'Response'
+ c_tag = "Response"
c_namespace = NAMESPACE
c_children = ResponseType_.c_children.copy()
c_attributes = ResponseType_.c_attributes.copy()
c_child_order = ResponseType_.c_child_order[:]
c_cardinality = ResponseType_.c_cardinality.copy()
+
def response_from_string(xml_string):
return saml2.create_class_from_xml_string(Response, xml_string)
@@ -121,13 +131,12 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'Request': Request,
- 'RequestType': RequestType_,
- 'Response': Response,
- 'ResponseType': ResponseType_,
+ "Request": Request,
+ "RequestType": RequestType_,
+ "Response": Response,
+ "ResponseType": ResponseType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/profile/samlec.py b/src/saml2/profile/samlec.py
index b90f6d3d..8d28e8c4 100644
--- a/src/saml2/profile/samlec.py
+++ b/src/saml2/profile/samlec.py
@@ -1,14 +1,14 @@
from saml2 import SamlBase
-NAMESPACE = 'urn:ietf:params:xml:ns:samlec'
+NAMESPACE = "urn:ietf:params:xml:ns:samlec"
class GeneratedKey(SamlBase):
- c_tag = 'GeneratedKey'
+ c_tag = "GeneratedKey"
c_namespace = NAMESPACE
ELEMENT_BY_TAG = {
- 'GeneratedKey': GeneratedKey,
+ "GeneratedKey": GeneratedKey,
}
diff --git a/src/saml2/request.py b/src/saml2/request.py
index de686074..2a4b8952 100644
--- a/src/saml2/request.py
+++ b/src/saml2/request.py
@@ -1,15 +1,14 @@
import logging
-from saml2 import time_util
from saml2 import BINDING_HTTP_REDIRECT
+from saml2 import time_util
from saml2.attribute_converter import to_local
-from saml2.s_utils import OtherError
-
-from saml2.validate import valid_instance
-from saml2.validate import NotValid
from saml2.response import IncorrectlySigned
-from saml2.sigver import verify_redirect_signature
+from saml2.s_utils import OtherError
from saml2.s_utils import VersionMismatch
+from saml2.sigver import verify_redirect_signature
+from saml2.validate import NotValid
+from saml2.validate import valid_instance
logger = logging.getLogger(__name__)
@@ -20,8 +19,7 @@ def _dummy(data, **_arg):
class Request(object):
- def __init__(self, sec_context, receiver_addrs, attribute_converters=None,
- timeslack=0):
+ def __init__(self, sec_context, receiver_addrs, attribute_converters=None, timeslack=0):
self.sec = sec_context
self.receiver_addrs = receiver_addrs
self.timeslack = timeslack
@@ -53,8 +51,9 @@ class Request(object):
):
# own copy
self.xmlstr = xmldata[:]
- logger.debug("xmlstr: %s, relay_state: %s, sigalg: %s, signature: %s",
- self.xmlstr, relay_state, sigalg, signature)
+ logger.debug(
+ "xmlstr: %s, relay_state: %s, sigalg: %s, signature: %s", self.xmlstr, relay_state, sigalg, signature
+ )
sign_redirect = must and binding == BINDING_HTTP_REDIRECT
sign_post = must and not sign_redirect
@@ -111,19 +110,14 @@ class Request(object):
issuer = self.sender()
certs = self.sec.metadata.certs(issuer, "any", "signing")
logger.debug("Certs to verify request sig: %s, _saml_msg: %s", certs, _saml_msg)
- verified = any(
- verify_redirect_signature(_saml_msg, self.sec.sec_backend, cert)
- for cert_name, cert in certs
- )
+ verified = any(verify_redirect_signature(_saml_msg, self.sec.sec_backend, cert) for cert_name, cert in certs)
logger.info("Redirect request signature check: %s", verified)
return verified
def issue_instant_ok(self):
- """ Check that the request was issued at a reasonable time """
- upper = time_util.shift_time(time_util.time_in_a_while(days=1),
- self.timeslack).timetuple()
- lower = time_util.shift_time(time_util.time_a_while_ago(days=1),
- - self.timeslack).timetuple()
+ """Check that the request was issued at a reasonable time"""
+ upper = time_util.shift_time(time_util.time_in_a_while(days=1), self.timeslack).timetuple()
+ lower = time_util.shift_time(time_util.time_a_while_ago(days=1), -self.timeslack).timetuple()
# print("issue_instant: %s" % self.message.issue_instant)
# print("%s < x < %s" % (lower, upper))
issued_at = time_util.str_to_time(self.message.issue_instant)
@@ -133,24 +127,37 @@ class Request(object):
valid_version = "2.0"
if self.message.version != valid_version:
raise VersionMismatch(
- "Invalid version {invalid} should be {valid}".format(
- invalid=self.message.version, valid=valid_version
- )
+ "Invalid version {invalid} should be {valid}".format(invalid=self.message.version, valid=valid_version)
)
- if self.message.destination and self.receiver_addrs and \
- self.message.destination not in self.receiver_addrs:
+ if self.message.destination and self.receiver_addrs and self.message.destination not in self.receiver_addrs:
logger.error("%s not in %s", self.message.destination, self.receiver_addrs)
raise OtherError("Not destined for me!")
valid = self.issue_instant_ok()
return valid
- def loads(self, xmldata, binding, origdoc=None, must=None,
- only_valid_cert=False, relay_state=None, sigalg=None, signature=None):
- return self._loads(xmldata, binding, origdoc, must,
- only_valid_cert=only_valid_cert, relay_state=relay_state,
- sigalg=sigalg, signature=signature)
+ def loads(
+ self,
+ xmldata,
+ binding,
+ origdoc=None,
+ must=None,
+ only_valid_cert=False,
+ relay_state=None,
+ sigalg=None,
+ signature=None,
+ ):
+ return self._loads(
+ xmldata,
+ binding,
+ origdoc,
+ must,
+ only_valid_cert=only_valid_cert,
+ relay_state=relay_state,
+ sigalg=sigalg,
+ signature=signature,
+ )
def verify(self):
try:
@@ -159,7 +166,7 @@ class Request(object):
return None
def subject_id(self):
- """ The name of the subject can be in either of
+ """The name of the subject can be in either of
BaseID, NameID or EncryptedID
:return: The identifier if there is one
@@ -186,10 +193,8 @@ class Request(object):
class LogoutRequest(Request):
msgtype = "logout_request"
- def __init__(self, sec_context, receiver_addrs, attribute_converters=None,
- timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters=None, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_logout_request
@property
@@ -200,24 +205,20 @@ class LogoutRequest(Request):
class AttributeQuery(Request):
msgtype = "attribute_query"
- def __init__(self, sec_context, receiver_addrs, attribute_converters=None,
- timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters=None, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_attribute_query
def attribute(self):
- """ Which attributes that are sought for """
+ """Which attributes that are sought for"""
return []
class AuthnRequest(Request):
msgtype = "authn_request"
- def __init__(self, sec_context, receiver_addrs, attribute_converters,
- timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_authn_request
def attributes(self):
@@ -227,10 +228,8 @@ class AuthnRequest(Request):
class AuthnQuery(Request):
msgtype = "authn_query"
- def __init__(self, sec_context, receiver_addrs, attribute_converters,
- timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_authn_query
def attributes(self):
@@ -240,10 +239,8 @@ class AuthnQuery(Request):
class AssertionIDRequest(Request):
msgtype = "assertion_id_request"
- def __init__(self, sec_context, receiver_addrs, attribute_converters,
- timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_assertion_id_request
def attributes(self):
@@ -253,44 +250,39 @@ class AssertionIDRequest(Request):
class AuthzDecisionQuery(Request):
msgtype = "authz_decision_query"
- def __init__(self, sec_context, receiver_addrs,
- attribute_converters=None, timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters=None, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_authz_decision_query
def action(self):
- """ Which action authorization is requested for """
+ """Which action authorization is requested for"""
pass
def evidence(self):
- """ The evidence on which the decision is based """
+ """The evidence on which the decision is based"""
pass
def resource(self):
- """ On which resource the action is expected to occur """
+ """On which resource the action is expected to occur"""
pass
class NameIDMappingRequest(Request):
msgtype = "name_id_mapping_request"
- def __init__(self, sec_context, receiver_addrs, attribute_converters,
- timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_name_id_mapping_request
class ManageNameIDRequest(Request):
msgtype = "manage_name_id_request"
- def __init__(self, sec_context, receiver_addrs, attribute_converters,
- timeslack=0):
- Request.__init__(self, sec_context, receiver_addrs,
- attribute_converters, timeslack)
+ def __init__(self, sec_context, receiver_addrs, attribute_converters, timeslack=0):
+ Request.__init__(self, sec_context, receiver_addrs, attribute_converters, timeslack)
self.signature_check = self.sec.correctly_signed_manage_name_id_request
+
SERVICE2REQUEST = {
"single_sign_on_service": AuthnRequest,
"attribute_service": AttributeQuery,
@@ -299,6 +291,6 @@ SERVICE2REQUEST = {
"authn_query_service": AuthnQuery,
"manage_name_id_service": ManageNameIDRequest,
"name_id_mapping_service": NameIDMappingRequest,
- #"artifact_resolve_service": ArtifactResolve,
- "single_logout_service": LogoutRequest
+ # "artifact_resolve_service": ArtifactResolve,
+ "single_logout_service": LogoutRequest,
}
diff --git a/src/saml2/response.py b/src/saml2/response.py
index 2c0ef758..8b739b56 100644
--- a/src/saml2/response.py
+++ b/src/saml2/response.py
@@ -3,9 +3,26 @@
#
import calendar
import logging
+
import six
-from saml2.samlp import STATUS_VERSION_MISMATCH
+from saml2 import SAMLError
+from saml2 import class_name
+from saml2 import extension_elements_to_elements
+from saml2 import saml
+from saml2 import samlp
+from saml2 import time_util
+from saml2 import xmldsig as ds
+from saml2 import xmlenc as xenc
+from saml2.attribute_converter import to_local
+from saml2.s_utils import RequestVersionTooHigh
+from saml2.s_utils import RequestVersionTooLow
+from saml2.saml import SCM_BEARER
+from saml2.saml import SCM_HOLDER_OF_KEY
+from saml2.saml import SCM_SENDER_VOUCHES
+from saml2.saml import XSI_TYPE
+from saml2.saml import attribute_from_string
+from saml2.saml import encrypted_attribute_from_string
from saml2.samlp import STATUS_AUTHN_FAILED
from saml2.samlp import STATUS_INVALID_ATTR_NAME_OR_VALUE
from saml2.samlp import STATUS_INVALID_NAMEID_POLICY
@@ -21,41 +38,24 @@ from saml2.samlp import STATUS_REQUEST_VERSION_DEPRECATED
from saml2.samlp import STATUS_REQUEST_VERSION_TOO_HIGH
from saml2.samlp import STATUS_REQUEST_VERSION_TOO_LOW
from saml2.samlp import STATUS_RESOURCE_NOT_RECOGNIZED
+from saml2.samlp import STATUS_RESPONDER
from saml2.samlp import STATUS_TOO_MANY_RESPONSES
from saml2.samlp import STATUS_UNKNOWN_ATTR_PROFILE
from saml2.samlp import STATUS_UNKNOWN_PRINCIPAL
from saml2.samlp import STATUS_UNSUPPORTED_BINDING
-from saml2.samlp import STATUS_RESPONDER
-
-from saml2 import xmldsig as ds
-from saml2 import xmlenc as xenc
-
-from saml2 import samlp
-from saml2 import class_name
-from saml2 import saml
-from saml2 import extension_elements_to_elements
-from saml2 import SAMLError
-from saml2 import time_util
-
-from saml2.s_utils import RequestVersionTooLow
-from saml2.s_utils import RequestVersionTooHigh
-from saml2.saml import attribute_from_string, XSI_TYPE
-from saml2.saml import SCM_BEARER
-from saml2.saml import SCM_HOLDER_OF_KEY
-from saml2.saml import SCM_SENDER_VOUCHES
-from saml2.saml import encrypted_attribute_from_string
-from saml2.sigver import security_context
+from saml2.samlp import STATUS_VERSION_MISMATCH
from saml2.sigver import DecryptError
from saml2.sigver import SignatureError
+from saml2.sigver import security_context
from saml2.sigver import signed
-from saml2.attribute_converter import to_local
-from saml2.time_util import str_to_time, later_than
-
-from saml2.validate import validate_on_or_after
-from saml2.validate import validate_before
-from saml2.validate import valid_instance
-from saml2.validate import valid_address
+from saml2.time_util import later_than
+from saml2.time_util import str_to_time
from saml2.validate import NotValid
+from saml2.validate import valid_address
+from saml2.validate import valid_instance
+from saml2.validate import validate_before
+from saml2.validate import validate_on_or_after
+
logger = logging.getLogger(__name__)
@@ -98,6 +98,7 @@ class StatusAuthnFailed(StatusError):
class StatusInvalidAttrNameOrValue(StatusError):
pass
+
class StatusInvalidAuthnResponseStatement(StatusError):
pass
@@ -207,7 +208,7 @@ def _dummy(_):
def for_me(conditions, myself):
- """ Am I among the intended audiences """
+ """Am I among the intended audiences"""
if not conditions.audience_restriction: # No audience restriction
return True
@@ -219,14 +220,23 @@ def for_me(conditions, myself):
if audience.text and audience.text.strip() == myself:
return True
else:
- logger.debug("AudienceRestriction - One condition not satisfied: {} != {}".format(audience.text, myself))
+ logger.debug(
+ "AudienceRestriction - One condition not satisfied: {} != {}".format(audience.text, myself)
+ )
logger.debug("AudienceRestrictions not satisfied!")
return False
-def authn_response(conf, return_addrs, outstanding_queries=None, timeslack=0,
- asynchop=True, allow_unsolicited=False,
- want_assertions_signed=False, conv_info=None):
+def authn_response(
+ conf,
+ return_addrs,
+ outstanding_queries=None,
+ timeslack=0,
+ asynchop=True,
+ allow_unsolicited=False,
+ want_assertions_signed=False,
+ conv_info=None,
+):
sec = security_context(conf)
if not timeslack:
try:
@@ -234,16 +244,22 @@ def authn_response(conf, return_addrs, outstanding_queries=None, timeslack=0,
except TypeError:
timeslack = 0
- return AuthnResponse(sec, conf.attribute_converters, conf.entityid,
- return_addrs, outstanding_queries, timeslack,
- asynchop=asynchop, allow_unsolicited=allow_unsolicited,
- want_assertions_signed=want_assertions_signed,
- conv_info=conv_info)
+ return AuthnResponse(
+ sec,
+ conf.attribute_converters,
+ conf.entityid,
+ return_addrs,
+ outstanding_queries,
+ timeslack,
+ asynchop=asynchop,
+ allow_unsolicited=allow_unsolicited,
+ want_assertions_signed=want_assertions_signed,
+ conv_info=conv_info,
+ )
# comes in over SOAP so synchronous
-def attribute_response(conf, return_addrs, timeslack=0, asynchop=False,
- test=False, conv_info=None):
+def attribute_response(conf, return_addrs, timeslack=0, asynchop=False, test=False, conv_info=None):
sec = security_context(conf)
if not timeslack:
try:
@@ -251,16 +267,22 @@ def attribute_response(conf, return_addrs, timeslack=0, asynchop=False,
except TypeError:
timeslack = 0
- return AttributeResponse(sec, conf.attribute_converters, conf.entityid,
- return_addrs, timeslack, asynchop=asynchop,
- test=test, conv_info=conv_info)
+ return AttributeResponse(
+ sec,
+ conf.attribute_converters,
+ conf.entityid,
+ return_addrs,
+ timeslack,
+ asynchop=asynchop,
+ test=test,
+ conv_info=conv_info,
+ )
class StatusResponse(object):
msgtype = "status_response"
- def __init__(self, sec_context, return_addrs=None, timeslack=0,
- request_id=0, asynchop=True, conv_info=None):
+ def __init__(self, sec_context, return_addrs=None, timeslack=0, request_id=0, asynchop=True, conv_info=None):
self.sec = sec_context
self.return_addrs = return_addrs or []
@@ -314,8 +336,7 @@ class StatusResponse(object):
self.response = self.sec.check_signature(instance)
except SignatureError:
# The response as a whole might be signed or not
- self.response = self.sec.check_signature(
- instance, samlp.NAMESPACE + ":Response")
+ self.response = self.sec.check_signature(instance, samlp.NAMESPACE + ":Response")
else:
self.not_signed = True
self.response = instance
@@ -326,7 +347,7 @@ class StatusResponse(object):
# own copy
if isinstance(xmldata, six.binary_type):
- self.xmlstr = xmldata[:].decode('utf-8')
+ self.xmlstr = xmldata[:].decode("utf-8")
else:
self.xmlstr = xmldata[:]
logger.debug("xmlstr: %s", self.xmlstr)
@@ -342,9 +363,12 @@ class StatusResponse(object):
try:
self.response = self.signature_check(
- xmldata, origdoc=origxml, must=self.require_signature,
+ xmldata,
+ origdoc=origxml,
+ must=self.require_signature,
require_response_signature=self.require_response_signature,
- **args)
+ **args
+ )
except TypeError:
raise
@@ -365,40 +389,26 @@ class StatusResponse(object):
if not status or status.status_code.value == samlp.STATUS_SUCCESS:
return True
- err_code = (
- status.status_code.status_code.value
- if status.status_code.status_code
- else None
- )
- err_msg = (
- status.status_message.text
- if status.status_message
- else err_code or "Unknown error"
- )
+ err_code = status.status_code.status_code.value if status.status_code.status_code else None
+ err_msg = status.status_message.text if status.status_message else err_code or "Unknown error"
err_cls = STATUSCODE2EXCEPTION.get(err_code, StatusError)
- msg = "Unsuccessful operation: {status}\n{msg} from {code}".format(
- status=status, msg=err_msg, code=err_code
- )
+ msg = "Unsuccessful operation: {status}\n{msg} from {code}".format(status=status, msg=err_msg, code=err_code)
logger.info(msg)
raise err_cls(msg)
def issue_instant_ok(self):
- """ Check that the response was issued at a reasonable time """
- upper = time_util.shift_time(time_util.time_in_a_while(days=1),
- self.timeslack).timetuple()
- lower = time_util.shift_time(time_util.time_a_while_ago(days=1),
- -self.timeslack).timetuple()
+ """Check that the response was issued at a reasonable time"""
+ upper = time_util.shift_time(time_util.time_in_a_while(days=1), self.timeslack).timetuple()
+ lower = time_util.shift_time(time_util.time_a_while_ago(days=1), -self.timeslack).timetuple()
# print("issue_instant: %s" % self.response.issue_instant)
# print("%s < x < %s" % (lower, upper))
issued_at = str_to_time(self.response.issue_instant)
return lower < issued_at < upper
def _verify(self):
- if self.request_id and self.in_response_to and \
- self.in_response_to != self.request_id:
- logger.error("Not the id I expected: %s != %s",
- self.in_response_to, self.request_id)
+ if self.request_id and self.in_response_to and self.in_response_to != self.request_id:
+ logger.error("Not the id I expected: %s != %s", self.in_response_to, self.request_id)
return None
if self.response.version != "2.0":
@@ -409,11 +419,10 @@ class StatusResponse(object):
raise RequestVersionTooHigh()
if self.asynchop:
- if (
- self.response.destination
- and self.response.destination not in self.return_addrs
- ):
- logger.error("destination '%s' not in return addresses '%s'", self.response.destination, self.return_addrs)
+ if self.response.destination and self.response.destination not in self.return_addrs:
+ logger.error(
+ "destination '%s' not in return addresses '%s'", self.response.destination, self.return_addrs
+ )
return None
valid = self.issue_instant_ok() and self.status_ok()
@@ -435,63 +444,63 @@ class StatusResponse(object):
self.response = mold.response
def issuer(self):
- issuer_value = (
- self.response.issuer.text
- if self.response.issuer is not None
- else ""
- ).strip()
+ issuer_value = (self.response.issuer.text if self.response.issuer is not None else "").strip()
return issuer_value
class LogoutResponse(StatusResponse):
msgtype = "logout_response"
- def __init__(self, sec_context, return_addrs=None, timeslack=0,
- asynchop=True, conv_info=None):
- StatusResponse.__init__(self, sec_context, return_addrs, timeslack,
- asynchop=asynchop, conv_info=conv_info)
+ def __init__(self, sec_context, return_addrs=None, timeslack=0, asynchop=True, conv_info=None):
+ StatusResponse.__init__(self, sec_context, return_addrs, timeslack, asynchop=asynchop, conv_info=conv_info)
self.signature_check = self.sec.correctly_signed_logout_response
class NameIDMappingResponse(StatusResponse):
msgtype = "name_id_mapping_response"
- def __init__(self, sec_context, return_addrs=None, timeslack=0,
- request_id=0, asynchop=True, conv_info=None):
- StatusResponse.__init__(self, sec_context, return_addrs, timeslack,
- request_id, asynchop, conv_info=conv_info)
- self.signature_check = self.sec \
- .correctly_signed_name_id_mapping_response
+ def __init__(self, sec_context, return_addrs=None, timeslack=0, request_id=0, asynchop=True, conv_info=None):
+ StatusResponse.__init__(self, sec_context, return_addrs, timeslack, request_id, asynchop, conv_info=conv_info)
+ self.signature_check = self.sec.correctly_signed_name_id_mapping_response
class ManageNameIDResponse(StatusResponse):
msgtype = "manage_name_id_response"
- def __init__(self, sec_context, return_addrs=None, timeslack=0,
- request_id=0, asynchop=True, conv_info=None):
- StatusResponse.__init__(self, sec_context, return_addrs, timeslack,
- request_id, asynchop, conv_info=conv_info)
+ def __init__(self, sec_context, return_addrs=None, timeslack=0, request_id=0, asynchop=True, conv_info=None):
+ StatusResponse.__init__(self, sec_context, return_addrs, timeslack, request_id, asynchop, conv_info=conv_info)
self.signature_check = self.sec.correctly_signed_manage_name_id_response
# ----------------------------------------------------------------------------
+
class AuthnResponse(StatusResponse):
- """ This is where all the profile compliance is checked.
- This one does saml2int compliance. """
+ """This is where all the profile compliance is checked.
+ This one does saml2int compliance."""
+
msgtype = "authn_response"
- def __init__(self, sec_context, attribute_converters, entity_id,
- return_addrs=None, outstanding_queries=None,
- timeslack=0, asynchop=True, allow_unsolicited=False,
- test=False, allow_unknown_attributes=False,
- want_assertions_signed=False,
- want_assertions_or_response_signed=False,
- want_response_signed=False,
- conv_info=None, **kwargs):
-
- StatusResponse.__init__(self, sec_context, return_addrs, timeslack,
- asynchop=asynchop, conv_info=conv_info)
+ def __init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs=None,
+ outstanding_queries=None,
+ timeslack=0,
+ asynchop=True,
+ allow_unsolicited=False,
+ test=False,
+ allow_unknown_attributes=False,
+ want_assertions_signed=False,
+ want_assertions_or_response_signed=False,
+ want_response_signed=False,
+ conv_info=None,
+ **kwargs
+ ):
+
+ StatusResponse.__init__(self, sec_context, return_addrs, timeslack, asynchop=asynchop, conv_info=conv_info)
self.entity_id = entity_id
self.attribute_converters = attribute_converters
if outstanding_queries:
@@ -532,18 +541,15 @@ class AuthnResponse(StatusResponse):
self.came_from = self.outstanding_queries[self.in_response_to]
# del self.outstanding_queries[self.in_response_to]
try:
- if not self.check_subject_confirmation_in_response_to(
- self.in_response_to):
- raise UnsolicitedResponse(
- "Unsolicited response: %s" % self.in_response_to)
+ if not self.check_subject_confirmation_in_response_to(self.in_response_to):
+ raise UnsolicitedResponse("Unsolicited response: %s" % self.in_response_to)
except AttributeError:
pass
elif self.allow_unsolicited:
# Should check that I haven't seen this before
pass
else:
- raise UnsolicitedResponse(
- "Unsolicited response: %s" % self.in_response_to)
+ raise UnsolicitedResponse("Unsolicited response: %s" % self.in_response_to)
return self
@@ -564,11 +570,10 @@ class AuthnResponse(StatusResponse):
authn_statement = self.assertion.authn_statement[0]
if authn_statement.session_not_on_or_after:
- if validate_on_or_after(authn_statement.session_not_on_or_after,
- self.timeslack):
+ if validate_on_or_after(authn_statement.session_not_on_or_after, self.timeslack):
self.session_not_on_or_after = calendar.timegm(
- time_util.str_to_time(
- authn_statement.session_not_on_or_after))
+ time_util.str_to_time(authn_statement.session_not_on_or_after)
+ )
else:
return False
return True
@@ -594,14 +599,12 @@ class AuthnResponse(StatusResponse):
# if both are present NotBefore must be earlier than NotOnOrAfter
if conditions.not_before and conditions.not_on_or_after:
- if not later_than(conditions.not_on_or_after,
- conditions.not_before):
+ if not later_than(conditions.not_on_or_after, conditions.not_before):
return False
try:
if conditions.not_on_or_after:
- self.not_on_or_after = validate_on_or_after(
- conditions.not_on_or_after, self.timeslack)
+ self.not_on_or_after = validate_on_or_after(conditions.not_on_or_after, self.timeslack)
if conditions.not_before:
validate_before(conditions.not_before, self.timeslack)
except Exception as excp:
@@ -618,8 +621,7 @@ class AuthnResponse(StatusResponse):
if conditions.condition: # extra conditions
for cond in conditions.condition:
try:
- if cond.extension_attributes[
- XSI_TYPE] in self.extension_schema:
+ if cond.extension_attributes[XSI_TYPE] in self.extension_schema:
pass
else:
raise Exception("Unknown condition")
@@ -657,13 +659,10 @@ class AuthnResponse(StatusResponse):
# logger.debug("Converts name format: %s", aconv.name_format)
self.decrypt_attributes(attr_statem)
- return to_local(self.attribute_converters, attr_statem,
- self.allow_unknown_attributes)
+ return to_local(self.attribute_converters, attr_statem, self.allow_unknown_attributes)
def get_identity(self):
- """ The assertion can contain zero or more attributeStatements
-
- """
+ """The assertion can contain zero or more attributeStatements"""
ava = {}
for _assertion in self.assertions:
if _assertion.advice:
@@ -672,12 +671,13 @@ class AuthnResponse(StatusResponse):
if tmp_assertion.attribute_statement:
n_attr_statements = len(tmp_assertion.attribute_statement)
if n_attr_statements != 1:
- msg = "Invalid number of AuthnStatement found in Response: {n}".format(n=n_attr_statements)
+ msg = "Invalid number of AuthnStatement found in Response: {n}".format(
+ n=n_attr_statements
+ )
raise ValueError(msg)
ava.update(self.read_attribute_statement(tmp_assertion.attribute_statement[0]))
if _assertion.attribute_statement:
- logger.debug("Assertion contains %s attribute statement(s)",
- (len(self.assertion.attribute_statement)))
+ logger.debug("Assertion contains %s attribute statement(s)", (len(self.assertion.attribute_statement)))
for _attr_statem in _assertion.attribute_statement:
logger.debug("Attribute Statement: %s" % (_attr_statem,))
ava.update(self.read_attribute_statement(_attr_statem))
@@ -705,8 +705,7 @@ class AuthnResponse(StatusResponse):
if self.asynchop and self.came_from is None:
if data.in_response_to:
if data.in_response_to in self.outstanding_queries:
- self.came_from = self.outstanding_queries[
- data.in_response_to]
+ self.came_from = self.outstanding_queries[data.in_response_to]
# del self.outstanding_queries[data.in_response_to]
elif self.allow_unsolicited:
pass
@@ -715,11 +714,8 @@ class AuthnResponse(StatusResponse):
# Either in_response_to == None or has a value I don't
# recognize
logger.debug("in response to: '%s'", data.in_response_to)
- logger.info("outstanding queries: %s",
- self.outstanding_queries.keys())
- raise Exception(
- "Combination of session id and requestURI I don't "
- "recall")
+ logger.info("outstanding queries: %s", self.outstanding_queries.keys())
+ raise Exception("Combination of session id and requestURI I don't " "recall")
return True
def _holder_of_key_confirmed(self, data):
@@ -727,26 +723,20 @@ class AuthnResponse(StatusResponse):
return False
has_keyinfo = False
- for element in extension_elements_to_elements(data.extension_elements,
- [samlp, saml, xenc, ds]):
+ for element in extension_elements_to_elements(data.extension_elements, [samlp, saml, xenc, ds]):
if isinstance(element, ds.KeyInfo):
has_keyinfo = True
return has_keyinfo
def get_subject(self, keys=None):
- """ The assertion must contain a Subject
- """
+ """The assertion must contain a Subject"""
if not self.assertion:
raise ValueError("Missing assertion")
if not self.assertion.subject:
- raise ValueError(
- "Invalid assertion subject: {subject}".format(
- subject=self.assertion.subject
- )
- )
+ raise ValueError("Invalid assertion subject: {subject}".format(subject=self.assertion.subject))
subject = self.assertion.subject
subjconf = []
@@ -765,8 +755,7 @@ class AuthnResponse(StatusResponse):
elif subject_confirmation.method == SCM_SENDER_VOUCHES:
pass
else:
- raise ValueError("Unknown subject confirmation method: %s" % (
- subject_confirmation.method,))
+ raise ValueError("Unknown subject confirmation method: %s" % (subject_confirmation.method,))
_recip = _data.recipient
if not _recip or not self.verify_recipient(_recip):
@@ -785,9 +774,7 @@ class AuthnResponse(StatusResponse):
self.name_id = subject.name_id
elif subject.encrypted_id:
# decrypt encrypted ID
- _name_id_str = self.sec.decrypt_keys(
- subject.encrypted_id.encrypted_data.to_string(), keys=keys
- )
+ _name_id_str = self.sec.decrypt_keys(subject.encrypted_id.encrypted_data.to_string(), keys=keys)
_name_id = saml.name_id_from_string(_name_id_str)
self.name_id = _name_id
@@ -801,7 +788,7 @@ class AuthnResponse(StatusResponse):
:return: True/False depending on if the assertion is sane or not
"""
- if not hasattr(assertion, 'signature') or not assertion.signature:
+ if not hasattr(assertion, "signature") or not assertion.signature:
logger.debug("unsigned")
if self.require_signature:
raise SignatureError("Signature missing for assertion")
@@ -809,8 +796,7 @@ class AuthnResponse(StatusResponse):
logger.debug("signed")
if not verified and self.do_not_verify is False:
try:
- self.sec.check_signature(assertion, class_name(assertion),
- self.xmlstr)
+ self.sec.check_signature(assertion, class_name(assertion), self.xmlstr)
except Exception as exc:
logger.error("correctly_signed_response: %s", exc)
raise
@@ -847,9 +833,8 @@ class AuthnResponse(StatusResponse):
logger.exception("get subject")
raise
- def decrypt_assertions(self, encrypted_assertions, decr_txt, issuer=None,
- verified=False):
- """ Moves the decrypted assertion from the encrypted assertion to a
+ def decrypt_assertions(self, encrypted_assertions, decr_txt, issuer=None, verified=False):
+ """Moves the decrypted assertion from the encrypted assertion to a
list.
:param encrypted_assertions: A list of encrypted assertions.
@@ -863,21 +848,19 @@ class AuthnResponse(StatusResponse):
res = []
for encrypted_assertion in encrypted_assertions:
if encrypted_assertion.extension_elements:
- assertions = extension_elements_to_elements(
- encrypted_assertion.extension_elements, [saml, samlp])
+ assertions = extension_elements_to_elements(encrypted_assertion.extension_elements, [saml, samlp])
for assertion in assertions:
if assertion.signature and not verified:
if not self.sec.check_signature(
- assertion, origdoc=decr_txt,
- node_name=class_name(assertion), issuer=issuer):
- logger.error("Failed to verify signature on '%s'",
- assertion)
+ assertion, origdoc=decr_txt, node_name=class_name(assertion), issuer=issuer
+ ):
+ logger.error("Failed to verify signature on '%s'", assertion)
raise SignatureError()
res.append(assertion)
return res
def find_encrypt_data_assertion(self, enc_assertions):
- """ Verifies if a list of encrypted assertions contains encrypted data.
+ """Verifies if a list of encrypted assertions contains encrypted data.
:param enc_assertions: A list of encrypted assertions.
:return: True encrypted data exists otherwise false.
@@ -887,7 +870,7 @@ class AuthnResponse(StatusResponse):
return True
def find_encrypt_data_assertion_list(self, _assertions):
- """ Verifies if a list of assertions contains encrypted data in the
+ """Verifies if a list of assertions contains encrypted data in the
advice element.
:param _assertions: A list of assertions.
@@ -896,13 +879,12 @@ class AuthnResponse(StatusResponse):
for _assertion in _assertions:
if _assertion.advice:
if _assertion.advice.encrypted_assertion:
- res = self.find_encrypt_data_assertion(
- _assertion.advice.encrypted_assertion)
+ res = self.find_encrypt_data_assertion(_assertion.advice.encrypted_assertion)
if res:
return True
def find_encrypt_data(self, resp):
- """ Verifies if a saml response contains encrypted assertions with
+ """Verifies if a saml response contains encrypted assertions with
encrypted data.
:param resp: A saml response.
@@ -916,14 +898,13 @@ class AuthnResponse(StatusResponse):
for tmp_assertion in resp.assertion:
if tmp_assertion.advice:
if tmp_assertion.advice.encrypted_assertion:
- res = self.find_encrypt_data_assertion(
- tmp_assertion.advice.encrypted_assertion)
+ res = self.find_encrypt_data_assertion(tmp_assertion.advice.encrypted_assertion)
if res:
return True
return False
def parse_assertion(self, keys=None):
- """ Parse the assertions for a saml response.
+ """Parse the assertions for a saml response.
:param keys: A string representing a RSA key or a list of strings
containing RSA keys.
@@ -938,9 +919,7 @@ class AuthnResponse(StatusResponse):
n_assertions_enc = len(self.response.encrypted_assertion)
if n_assertions != 1 and n_assertions_enc != 1 and self.assertion is None:
raise InvalidAssertion(
- "Invalid number of assertions in Response: {n}".format(
- n=n_assertions+n_assertions_enc
- )
+ "Invalid number of assertions in Response: {n}".format(n=n_assertions + n_assertions_enc)
)
if self.response.assertion:
@@ -971,14 +950,11 @@ class AuthnResponse(StatusResponse):
else:
decr_text_old = decr_text_old.encode("utf-8")
- _enc_assertions = self.decrypt_assertions(
- resp.encrypted_assertion, decr_text
- )
+ _enc_assertions = self.decrypt_assertions(resp.encrypted_assertion, decr_text)
decr_text_old = None
while (
- self.find_encrypt_data(resp)
- or self.find_encrypt_data_assertion_list(_enc_assertions)
+ self.find_encrypt_data(resp) or self.find_encrypt_data_assertion_list(_enc_assertions)
) and decr_text_old != decr_text:
decr_text_old = decr_text
try:
@@ -987,9 +963,7 @@ class AuthnResponse(StatusResponse):
continue
else:
resp = samlp.response_from_string(decr_text)
- _enc_assertions = self.decrypt_assertions(
- resp.encrypted_assertion, decr_text, verified=True
- )
+ _enc_assertions = self.decrypt_assertions(resp.encrypted_assertion, decr_text, verified=True)
# check and prepare for comparison between str and unicode
if type(decr_text_old) != type(decr_text):
if isinstance(decr_text_old, six.binary_type):
@@ -1006,9 +980,8 @@ class AuthnResponse(StatusResponse):
if tmp_ass.advice and tmp_ass.advice.encrypted_assertion:
advice_res = self.decrypt_assertions(
- tmp_ass.advice.encrypted_assertion,
- decr_text,
- tmp_ass.issuer)
+ tmp_ass.advice.encrypted_assertion, decr_text, tmp_ass.issuer
+ )
if tmp_ass.advice.assertion:
tmp_ass.advice.assertion.extend(advice_res)
else:
@@ -1041,7 +1014,7 @@ class AuthnResponse(StatusResponse):
return True
def verify(self, keys=None):
- """ Verify that the assertion is syntactically correct and the
+ """Verify that the assertion is syntactically correct and the
signature is correct if present.
:param keys: If not the default key file should be used then use one
@@ -1067,16 +1040,16 @@ class AuthnResponse(StatusResponse):
return None
def session_id(self):
- """ Returns the SessionID of the response """
+ """Returns the SessionID of the response"""
return self.response.in_response_to
def id(self):
- """ Return the ID of the response """
+ """Return the ID of the response"""
return self.response.id
def authn_info(self):
res = []
- for statement in getattr(self.assertion, 'authn_statement', []):
+ for statement in getattr(self.assertion, "authn_statement", []):
authn_instant = getattr(statement, "authn_instant", "")
context = statement.authn_context
@@ -1089,9 +1062,7 @@ class AuthnResponse(StatusResponse):
or ""
)
- authenticating_authorities = getattr(
- context, "authenticating_authority", []
- )
+ authenticating_authorities = getattr(context, "authenticating_authority", [])
authn_auth = [authority.text for authority in authenticating_authorities]
res.append((authn_class, authn_auth, authn_instant))
@@ -1105,7 +1076,7 @@ class AuthnResponse(StatusResponse):
return res
def session_info(self):
- """ Returns a predefined set of information gleened from the
+ """Returns a predefined set of information gleened from the
response.
:returns: Dictionary with information
"""
@@ -1115,19 +1086,26 @@ class AuthnResponse(StatusResponse):
nooa = self.not_on_or_after
if self.context == "AuthzQuery":
- return {"name_id": self.name_id, "came_from": self.came_from,
- "issuer": self.issuer(), "not_on_or_after": nooa,
- "authz_decision_info": self.authz_decision_info()}
- elif getattr(self.assertion, 'authn_statement', None):
+ return {
+ "name_id": self.name_id,
+ "came_from": self.came_from,
+ "issuer": self.issuer(),
+ "not_on_or_after": nooa,
+ "authz_decision_info": self.authz_decision_info(),
+ }
+ elif getattr(self.assertion, "authn_statement", None):
authn_statement = self.assertion.authn_statement[0]
- return {"ava": self.ava, "name_id": self.name_id,
- "came_from": self.came_from, "issuer": self.issuer(),
- "not_on_or_after": nooa, "authn_info": self.authn_info(),
- "session_index": authn_statement.session_index}
+ return {
+ "ava": self.ava,
+ "name_id": self.name_id,
+ "came_from": self.came_from,
+ "issuer": self.issuer(),
+ "not_on_or_after": nooa,
+ "authn_info": self.authn_info(),
+ "session_index": authn_statement.session_index,
+ }
else:
- raise StatusInvalidAuthnResponseStatement(
- "The Authn Response Statement is not valid"
- )
+ raise StatusInvalidAuthnResponseStatement("The Authn Response Statement is not valid")
def __str__(self):
return self.xmlstr
@@ -1146,7 +1124,7 @@ class AuthnResponse(StatusResponse):
_info = self.conv_info
try:
- if recipient == _info['entity_id']:
+ if recipient == _info["entity_id"]:
return True
except KeyError:
pass
@@ -1168,16 +1146,16 @@ class AuthnResponse(StatusResponse):
"""
try:
- address = self.conv_info['remote_addr']
+ address = self.conv_info["remote_addr"]
except KeyError:
- address = '0.0.0.0'
+ address = "0.0.0.0"
correct = 0
for subject_conf in subject_confirmation:
if subject_conf.subject_confirmation_data is None:
correct += 1 # In reality undefined
elif subject_conf.subject_confirmation_data.address:
- if address == '0.0.0.0': # accept anything
+ if address == "0.0.0.0": # accept anything
correct += 1
elif subject_conf.subject_confirmation_data.address == address:
correct += 1
@@ -1193,13 +1171,28 @@ class AuthnResponse(StatusResponse):
class AuthnQueryResponse(AuthnResponse):
msgtype = "authn_query_response"
- def __init__(self, sec_context, attribute_converters, entity_id,
- return_addrs=None, timeslack=0, asynchop=False, test=False,
- conv_info=None):
- AuthnResponse.__init__(self, sec_context, attribute_converters,
- entity_id, return_addrs, timeslack=timeslack,
- asynchop=asynchop, test=test,
- conv_info=conv_info)
+ def __init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs=None,
+ timeslack=0,
+ asynchop=False,
+ test=False,
+ conv_info=None,
+ ):
+ AuthnResponse.__init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs,
+ timeslack=timeslack,
+ asynchop=asynchop,
+ test=test,
+ conv_info=conv_info,
+ )
self.entity_id = entity_id
self.attribute_converters = attribute_converters
self.assertion = None
@@ -1212,13 +1205,28 @@ class AuthnQueryResponse(AuthnResponse):
class AttributeResponse(AuthnResponse):
msgtype = "attribute_response"
- def __init__(self, sec_context, attribute_converters, entity_id,
- return_addrs=None, timeslack=0, asynchop=False, test=False,
- conv_info=None):
- AuthnResponse.__init__(self, sec_context, attribute_converters,
- entity_id, return_addrs, timeslack=timeslack,
- asynchop=asynchop, test=test,
- conv_info=conv_info)
+ def __init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs=None,
+ timeslack=0,
+ asynchop=False,
+ test=False,
+ conv_info=None,
+ ):
+ AuthnResponse.__init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs,
+ timeslack=timeslack,
+ asynchop=asynchop,
+ test=test,
+ conv_info=conv_info,
+ )
self.entity_id = entity_id
self.attribute_converters = attribute_converters
self.assertion = None
@@ -1226,16 +1234,31 @@ class AttributeResponse(AuthnResponse):
class AuthzResponse(AuthnResponse):
- """ A successful response will be in the form of assertions containing
+ """A successful response will be in the form of assertions containing
authorization decision statements."""
+
msgtype = "authz_decision_response"
- def __init__(self, sec_context, attribute_converters, entity_id,
- return_addrs=None, timeslack=0, asynchop=False,
- conv_info=None):
- AuthnResponse.__init__(self, sec_context, attribute_converters,
- entity_id, return_addrs, timeslack=timeslack,
- asynchop=asynchop, conv_info=conv_info)
+ def __init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs=None,
+ timeslack=0,
+ asynchop=False,
+ conv_info=None,
+ ):
+ AuthnResponse.__init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs,
+ timeslack=timeslack,
+ asynchop=asynchop,
+ conv_info=conv_info,
+ )
self.entity_id = entity_id
self.attribute_converters = attribute_converters
self.assertion = None
@@ -1245,23 +1268,48 @@ class AuthzResponse(AuthnResponse):
class ArtifactResponse(AuthnResponse):
msgtype = "artifact_response"
- def __init__(self, sec_context, attribute_converters, entity_id,
- return_addrs=None, timeslack=0, asynchop=False, test=False,
- conv_info=None):
- AuthnResponse.__init__(self, sec_context, attribute_converters,
- entity_id, return_addrs, timeslack=timeslack,
- asynchop=asynchop, test=test,
- conv_info=conv_info)
+ def __init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs=None,
+ timeslack=0,
+ asynchop=False,
+ test=False,
+ conv_info=None,
+ ):
+ AuthnResponse.__init__(
+ self,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs,
+ timeslack=timeslack,
+ asynchop=asynchop,
+ test=test,
+ conv_info=conv_info,
+ )
self.entity_id = entity_id
self.attribute_converters = attribute_converters
self.assertion = None
self.context = "ArtifactResolve"
-def response_factory(xmlstr, conf, return_addrs=None, outstanding_queries=None,
- timeslack=0, decode=True, request_id=0, origxml=None,
- asynchop=True, allow_unsolicited=False,
- want_assertions_signed=False, conv_info=None):
+def response_factory(
+ xmlstr,
+ conf,
+ return_addrs=None,
+ outstanding_queries=None,
+ timeslack=0,
+ decode=True,
+ request_id=0,
+ origxml=None,
+ asynchop=True,
+ allow_unsolicited=False,
+ want_assertions_signed=False,
+ conv_info=None,
+):
sec_context = security_context(conf)
if not timeslack:
try:
@@ -1273,24 +1321,29 @@ def response_factory(xmlstr, conf, return_addrs=None, outstanding_queries=None,
entity_id = conf.entityid
extension_schema = conf.extension_schema
- response = StatusResponse(sec_context, return_addrs, timeslack, request_id,
- asynchop, conv_info=conv_info)
+ response = StatusResponse(sec_context, return_addrs, timeslack, request_id, asynchop, conv_info=conv_info)
try:
response.loads(xmlstr, decode, origxml)
if response.response.assertion or response.response.encrypted_assertion:
authnresp = AuthnResponse(
- sec_context, attribute_converters, entity_id, return_addrs,
- outstanding_queries, timeslack, asynchop, allow_unsolicited,
+ sec_context,
+ attribute_converters,
+ entity_id,
+ return_addrs,
+ outstanding_queries,
+ timeslack,
+ asynchop,
+ allow_unsolicited,
extension_schema=extension_schema,
want_assertions_signed=want_assertions_signed,
- conv_info=conv_info)
+ conv_info=conv_info,
+ )
authnresp.update(response)
return authnresp
except TypeError:
response.signature_check = sec_context.correctly_signed_logout_response
response.loads(xmlstr, decode, origxml)
- logoutresp = LogoutResponse(sec_context, return_addrs, timeslack,
- asynchop=asynchop, conv_info=conv_info)
+ logoutresp = LogoutResponse(sec_context, return_addrs, timeslack, asynchop=asynchop, conv_info=conv_info)
logoutresp.update(response)
return logoutresp
@@ -1304,8 +1357,7 @@ def response_factory(xmlstr, conf, return_addrs=None, outstanding_queries=None,
class AssertionIDResponse(object):
msgtype = "assertion_id_response"
- def __init__(self, sec_context, attribute_converters, timeslack=0,
- **kwargs):
+ def __init__(self, sec_context, attribute_converters, timeslack=0, **kwargs):
self.sec = sec_context
self.timeslack = timeslack
diff --git a/src/saml2/s2repoze/plugins/challenge_decider.py b/src/saml2/s2repoze/plugins/challenge_decider.py
index 70eb8959..ae56a03f 100644
--- a/src/saml2/s2repoze/plugins/challenge_decider.py
+++ b/src/saml2/s2repoze/plugins/challenge_decider.py
@@ -1,12 +1,12 @@
-from paste.request import construct_url
-import zope.interface
-from repoze.who.interfaces import IRequestClassifier
+import re
-from paste.httpheaders import REQUEST_METHOD
from paste.httpheaders import CONTENT_TYPE
+from paste.httpheaders import REQUEST_METHOD
from paste.httpheaders import USER_AGENT
+from paste.request import construct_url
+from repoze.who.interfaces import IRequestClassifier
+import zope.interface
-import re
_DAV_METHODS = (
"OPTIONS",
@@ -35,7 +35,7 @@ _DAV_USERAGENTS = (
def my_request_classifier(environ):
- """ Returns one of the classifiers 'dav', 'xmlpost', or 'browser',
+ """Returns one of the classifiers 'dav', 'xmlpost', or 'browser',
depending on the imperative logic below"""
request_method = REQUEST_METHOD(environ)
if request_method in _DAV_METHODS:
diff --git a/src/saml2/s2repoze/plugins/entitlement.py b/src/saml2/s2repoze/plugins/entitlement.py
index 12776200..bd5fae51 100644
--- a/src/saml2/s2repoze/plugins/entitlement.py
+++ b/src/saml2/s2repoze/plugins/entitlement.py
@@ -1,10 +1,9 @@
#!/usr/bin/env python
import shelve
-from zope.interface import implements
-
# from repoze.who.interfaces import IChallenger, IIdentifier, IAuthenticator
from repoze.who.interfaces import IMetadataProvider
+from zope.interface import implements
class EntitlementMetadataProvider(object):
diff --git a/src/saml2/s2repoze/plugins/formswithhidden.py b/src/saml2/s2repoze/plugins/formswithhidden.py
index 7b813211..02e2ad95 100644
--- a/src/saml2/s2repoze/plugins/formswithhidden.py
+++ b/src/saml2/s2repoze/plugins/formswithhidden.py
@@ -1,19 +1,16 @@
-from six.moves.urllib.parse import urlencode
-
+from paste.httpexceptions import HTTPFound
from paste.httpheaders import CONTENT_LENGTH
from paste.httpheaders import CONTENT_TYPE
from paste.httpheaders import LOCATION
-from paste.httpexceptions import HTTPFound
-
+from paste.request import construct_url
from paste.request import parse_dict_querystring
from paste.request import parse_formvars
-from paste.request import construct_url
-
-from zope.interface import implements
-
from repoze.who.interfaces import IChallenger
from repoze.who.interfaces import IIdentifier
from repoze.who.plugins.form import FormPlugin
+from six.moves.urllib.parse import urlencode
+from zope.interface import implements
+
_DEFAULT_FORM = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html>
@@ -115,9 +112,7 @@ class FormHiddenPlugin(FormPlugin):
def make_plugin(login_form_qs="__do_login", rememberer_name=None, form=None):
if rememberer_name is None:
- raise ValueError(
- "must include rememberer key (name of another IIdentifier plugin)"
- )
+ raise ValueError("must include rememberer key (name of another IIdentifier plugin)")
if form is not None:
with open(form, "r") as f:
form = f.read()
diff --git a/src/saml2/s2repoze/plugins/ini.py b/src/saml2/s2repoze/plugins/ini.py
index 4ef06351..74dcc111 100644
--- a/src/saml2/s2repoze/plugins/ini.py
+++ b/src/saml2/s2repoze/plugins/ini.py
@@ -1,9 +1,8 @@
import ConfigParser
-from zope.interface import implements
-
# from repoze.who.interfaces import IChallenger, IIdentifier, IAuthenticator
from repoze.who.interfaces import IMetadataProvider
+from zope.interface import implements
class INIMetadataProvider(object):
diff --git a/src/saml2/s2repoze/plugins/sp.py b/src/saml2/s2repoze/plugins/sp.py
index c230e0f6..c0d37373 100644
--- a/src/saml2/s2repoze/plugins/sp.py
+++ b/src/saml2/s2repoze/plugins/sp.py
@@ -6,39 +6,45 @@ WSGI application.
"""
import logging
-import sys
import platform
import shelve
+import sys
import traceback
-import saml2
-import six
-from saml2.samlp import Extensions
-from saml2 import xmldsig as ds
-
-from six import StringIO
-from six.moves.urllib import parse
-from paste.httpexceptions import HTTPSeeOther, HTTPRedirection
-from paste.httpexceptions import HTTPNotImplemented
from paste.httpexceptions import HTTPInternalServerError
-from paste.request import parse_dict_querystring
+from paste.httpexceptions import HTTPNotImplemented
+from paste.httpexceptions import HTTPRedirection
+from paste.httpexceptions import HTTPSeeOther
from paste.request import construct_url
-from saml2.extension.pefim import SPCertEnc
-from saml2.httputil import getpath, SeeOther
-from saml2.client_base import ECP_SERVICE, MIME_PAOS
-from zope.interface import implementer
-
-from repoze.who.interfaces import IChallenger, IIdentifier, IAuthenticator
+from paste.request import parse_dict_querystring
+from repoze.who.interfaces import IAuthenticator
+from repoze.who.interfaces import IChallenger
+from repoze.who.interfaces import IIdentifier
from repoze.who.interfaces import IMetadataProvider
+import six
+from six import StringIO
+from six.moves.urllib import parse
+from zope.interface import implementer
-from saml2 import ecp, BINDING_HTTP_REDIRECT, element_to_extension_element
+import saml2
from saml2 import BINDING_HTTP_POST
-
+from saml2 import BINDING_HTTP_REDIRECT
+from saml2 import ecp
+from saml2 import element_to_extension_element
+from saml2 import xmldsig as ds
from saml2.client import Saml2Client
-from saml2.ident import code, decode
-from saml2.s_utils import sid
+from saml2.client_base import ECP_SERVICE
+from saml2.client_base import MIME_PAOS
from saml2.config import config_factory
+from saml2.extension.pefim import SPCertEnc
+from saml2.httputil import SeeOther
+from saml2.httputil import getpath
+from saml2.ident import code
+from saml2.ident import decode
from saml2.profile import paos
+from saml2.s_utils import sid
+from saml2.samlp import Extensions
+
# from saml2.population import Population
# from saml2.attribute_resolver import AttributeResolver
@@ -49,8 +55,8 @@ PAOS_HEADER_INFO = 'ver="%s";"%s"' % (paos.NAMESPACE, ECP_SERVICE)
def construct_came_from(environ):
- """ The URL that the user used when the process where interupted
- for single-sign-on processing. """
+ """The URL that the user used when the process where interupted
+ for single-sign-on processing."""
came_from = environ.get("PATH_INFO")
qstr = environ.get("QUERY_STRING", "")
@@ -74,9 +80,7 @@ class ECP_response(object):
# noinspection PyUnusedLocal
def __call__(self, environ, start_response):
- start_response(
- "%s %s" % (self.code, self.title), [("Content-Type", "text/xml")]
- )
+ start_response("%s %s" % (self.code, self.title), [("Content-Type", "text/xml")])
return [self.content]
@@ -101,23 +105,17 @@ class SAML2Plugin(object):
self.cache = cache
self.discosrv = discovery
self.idp_query_param = idp_query_param
- self.logout_endpoints = [
- parse.urlparse(ep).path for ep in config.endpoint("single_logout_service")
- ]
+ self.logout_endpoints = [parse.urlparse(ep).path for ep in config.endpoint("single_logout_service")]
try:
self.metadata = self.conf.metadata
except KeyError:
self.metadata = None
if sid_store:
- self.outstanding_queries = shelve.open(
- sid_store, writeback=True, protocol=2
- )
+ self.outstanding_queries = shelve.open(sid_store, writeback=True, protocol=2)
else:
self.outstanding_queries = {}
if sid_store_cert:
- self.outstanding_certs = shelve.open(
- sid_store_cert, writeback=True, protocol=2
- )
+ self.outstanding_certs = shelve.open(sid_store_cert, writeback=True, protocol=2)
else:
self.outstanding_certs = {}
@@ -245,21 +243,15 @@ class SAML2Plugin(object):
return self._wayf_redirect(came_from)
elif self.discosrv:
if query:
- idp_entity_id = _cli.parse_discovery_service_response(
- query=environ.get("QUERY_STRING")
- )
+ idp_entity_id = _cli.parse_discovery_service_response(query=environ.get("QUERY_STRING"))
else:
sid_ = sid()
self.outstanding_queries[sid_] = came_from
logger.debug("Redirect to Discovery Service function")
eid = _cli.config.entityid
- ret = _cli.config.getattr("endpoints", "sp")[
- "discovery_response"
- ][0][0]
+ ret = _cli.config.getattr("endpoints", "sp")["discovery_response"][0][0]
ret += "?sid=%s" % sid_
- loc = _cli.create_discovery_service_request(
- self.discosrv, eid, **{"return": ret}
- )
+ loc = _cli.create_discovery_service_request(self.discosrv, eid, **{"return": ret})
return -1, SeeOther(loc)
else:
@@ -335,14 +327,8 @@ class SAML2Plugin(object):
if _cli.config.generate_cert_func is not None:
cert_str, req_key_str = _cli.config.generate_cert_func()
cert = {"cert": cert_str, "key": req_key_str}
- spcertenc = SPCertEnc(
- x509_data=ds.X509Data(
- x509_certificate=ds.X509Certificate(text=cert_str)
- )
- )
- extensions = Extensions(
- extension_elements=[element_to_extension_element(spcertenc)]
- )
+ spcertenc = SPCertEnc(x509_data=ds.X509Data(x509_certificate=ds.X509Certificate(text=cert_str)))
+ extensions = Extensions(extension_elements=[element_to_extension_element(spcertenc)])
if _cli.authn_requests_signed:
_sid = sid()
@@ -382,9 +368,7 @@ class SAML2Plugin(object):
try:
ret = _cli.config.getattr("endpoints", "sp")["discovery_response"][0][0]
- if (environ["PATH_INFO"]) in ret and ret.split(environ["PATH_INFO"])[
- 1
- ] == "":
+ if (environ["PATH_INFO"]) in ret and ret.split(environ["PATH_INFO"])[1] == "":
query = parse.parse_qs(environ["QUERY_STRING"])
result_sid = query["sid"][0]
came_from = self.outstanding_queries[result_sid]
@@ -526,9 +510,7 @@ class SAML2Plugin(object):
# check for SAML2 authN response
try:
if logout:
- response = self.saml_client.parse_logout_request_response(
- post["SAMLResponse"][0], binding
- )
+ response = self.saml_client.parse_logout_request_response(post["SAMLResponse"][0], binding)
if response:
action = self.saml_client.handle_logout_response(response)
@@ -540,9 +522,7 @@ class SAML2Plugin(object):
environ["samlsp.pending"] = request
return {}
else:
- session_info = self._eval_authn_response(
- environ, post, binding=binding
- )
+ session_info = self._eval_authn_response(environ, post, binding=binding)
except Exception as err:
environ["s2repoze.saml_error"] = err
return {}
@@ -572,7 +552,7 @@ class SAML2Plugin(object):
# IMetadataProvider
def add_metadata(self, environ, identity):
- """ Add information to the knowledge I have about the user """
+ """Add information to the knowledge I have about the user"""
name_id = identity["repoze.who.userid"]
if isinstance(name_id, six.string_types):
try:
@@ -610,10 +590,7 @@ class SAML2Plugin(object):
# expanded
identity["pysaml2_vo_expanded"] = 1
except KeyError:
- logger.exception(
- "Failed to do attribute aggregation, "
- "missing common attribute"
- )
+ logger.exception("Failed to do attribute aggregation, " "missing common attribute")
logger.debug("[add_metadata] returns: %s", dict(identity))
if not identity["user"]:
@@ -636,8 +613,7 @@ class SAML2Plugin(object):
if (
identity.get("user")
and environ.get("s2repoze.sessioninfo")
- and identity.get("user")
- == environ.get("s2repoze.sessioninfo").get("ava")
+ and identity.get("user") == environ.get("s2repoze.sessioninfo").get("ava")
):
return identity.get("login")
tktuser = identity.get("repoze.who.plugins.auth_tkt.userid", None)
@@ -686,7 +662,5 @@ def make_plugin(
virtual_organization=virtual_organization,
)
- plugin = SAML2Plugin(
- remember_name, conf, scl, wayf, cache, sid_store, discovery, idp_query_param
- )
+ plugin = SAML2Plugin(remember_name, conf, scl, wayf, cache, sid_store, discovery, idp_query_param)
return plugin
diff --git a/src/saml2/s_utils.py b/src/saml2/s_utils.py
index f0d983c9..6e2fd9c2 100644
--- a/src/saml2/s_utils.py
+++ b/src/saml2/s_utils.py
@@ -12,9 +12,9 @@ import zlib
import six
+from saml2 import VERSION
from saml2 import saml
from saml2 import samlp
-from saml2 import VERSION
from saml2.time_util import instant
@@ -89,9 +89,28 @@ EXCEPTION2STATUS = {
Exception: samlp.STATUS_AUTHN_FAILED,
}
-GENERIC_DOMAINS = ["aero", "asia", "biz", "cat", "com", "coop", "edu",
- "gov", "info", "int", "jobs", "mil", "mobi", "museum",
- "name", "net", "org", "pro", "tel", "travel"]
+GENERIC_DOMAINS = [
+ "aero",
+ "asia",
+ "biz",
+ "cat",
+ "com",
+ "coop",
+ "edu",
+ "gov",
+ "info",
+ "int",
+ "jobs",
+ "mil",
+ "mobi",
+ "museum",
+ "name",
+ "net",
+ "org",
+ "pro",
+ "tel",
+ "travel",
+]
def valid_email(emailaddress, domains=GENERIC_DOMAINS):
@@ -104,8 +123,8 @@ def valid_email(emailaddress, domains=GENERIC_DOMAINS):
# Split up email address into parts.
try:
- localpart, domainname = emailaddress.rsplit('@', 1)
- host, toplevel = domainname.rsplit('.', 1)
+ localpart, domainname = emailaddress.rsplit("@", 1)
+ host, toplevel = domainname.rsplit(".", 1)
except ValueError:
return False # Address does not have enough parts.
@@ -113,9 +132,9 @@ def valid_email(emailaddress, domains=GENERIC_DOMAINS):
if len(toplevel) != 2 and toplevel not in domains:
return False # Not a domain name.
- for i in '-_.%+.':
+ for i in "-_.%+.":
localpart = localpart.replace(i, "")
- for i in '-_.':
+ for i in "-_.":
host = host.replace(i, "")
if localpart.isalnum() and host.isalnum():
@@ -125,7 +144,7 @@ def valid_email(emailaddress, domains=GENERIC_DOMAINS):
def decode_base64_and_inflate(string):
- """ base64 decodes and then inflates according to RFC1951
+ """base64 decodes and then inflates according to RFC1951
:param string: a deflated and encoded string
:return: the string after decoding and inflating
@@ -142,7 +161,7 @@ def deflate_and_base64_encode(string_val):
:return: The deflated and encoded string
"""
if not isinstance(string_val, six.binary_type):
- string_val = string_val.encode('utf-8')
+ string_val = string_val.encode("utf-8")
return base64.b64encode(zlib.compress(string_val)[2:-4])
@@ -165,7 +184,7 @@ def rndbytes(size=16, alphabet=""):
"""
x = rndstr(size, alphabet)
if isinstance(x, six.string_types):
- return x.encode('utf-8')
+ return x.encode("utf-8")
return x
@@ -214,6 +233,7 @@ def identity_attribute(form, attribute, forward_map=None):
# default is name
return attribute.name
+
# ----------------------------------------------------------------------------
@@ -228,24 +248,14 @@ def error_status_factory(info):
try:
exc_context = info.args[0]
- err_ctx = (
- {"status_message_text": exc_context}
- if isinstance(exc_context, str)
- else exc_context
- )
+ err_ctx = {"status_message_text": exc_context} if isinstance(exc_context, str) else exc_context
except IndexError:
err_ctx = {"status_message_text": str(info)}
status_message_text = err_ctx.get("status_message_text")
- status_code_status_code_value = err_ctx.get(
- "status_code_status_code_value", exc_val
- )
-
- status_msg = (
- samlp.StatusMessage(text=status_message_text)
- if status_message_text
- else None
- )
+ status_code_status_code_value = err_ctx.get("status_code_status_code_value", exc_val)
+
+ status_msg = samlp.StatusMessage(text=status_message_text) if status_message_text else None
status = samlp.Status(
status_message=status_msg,
@@ -258,20 +268,18 @@ def error_status_factory(info):
def success_status_factory():
- return samlp.Status(status_code=samlp.StatusCode(
- value=samlp.STATUS_SUCCESS))
+ return samlp.Status(status_code=samlp.StatusCode(value=samlp.STATUS_SUCCESS))
def status_message_factory(message, code, fro=samlp.STATUS_RESPONDER):
return samlp.Status(
status_message=samlp.StatusMessage(text=message),
- status_code=samlp.StatusCode(value=fro,
- status_code=samlp.StatusCode(value=code)))
+ status_code=samlp.StatusCode(value=fro, status_code=samlp.StatusCode(value=code)),
+ )
def assertion_factory(**kwargs):
- assertion = saml.Assertion(version=VERSION, id=sid(),
- issue_instant=instant())
+ assertion = saml.Assertion(version=VERSION, id=sid(), issue_instant=instant())
for key, val in kwargs.items():
setattr(assertion, key, val)
return assertion
@@ -291,6 +299,7 @@ def _attrval(val, typ=""):
return attrval
+
# --- attribute profiles -----
# xmlns:xs="http://www.w3.org/2001/XMLSchema"
@@ -381,14 +390,13 @@ def factory(klass, **kwargs):
def signature(secret, parts):
- """Generates a signature. All strings are assumed to be utf-8
- """
+ """Generates a signature. All strings are assumed to be utf-8"""
if not isinstance(secret, six.binary_type):
- secret = secret.encode('utf-8')
+ secret = secret.encode("utf-8")
newparts = []
for part in parts:
if not isinstance(part, six.binary_type):
- part = part.encode('utf-8')
+ part = part.encode("utf-8")
newparts.append(part)
parts = newparts
csum = hmac.new(secret, digestmod=hashlib.sha1)
@@ -400,7 +408,7 @@ def signature(secret, parts):
def verify_signature(secret, parts):
- """ Checks that the signature is correct """
+ """Checks that the signature is correct"""
if signature(secret, parts[:-1]) == parts[-1]:
return True
else:
diff --git a/src/saml2/saml.py b/src/saml2/saml.py
index d63509fe..d8ac648b 100644
--- a/src/saml2/saml.py
+++ b/src/saml2/saml.py
@@ -18,72 +18,64 @@ import base64
from datetime import date
from datetime import datetime
-from saml2.validate import valid_ipv4, MustValueError
-from saml2.validate import valid_ipv6
-from saml2.validate import ShouldValueError
-from saml2.validate import valid_domain_name
+import six
import saml2
from saml2 import SamlBase
-
-import six
from saml2 import xmldsig as ds
from saml2 import xmlenc as xenc
+from saml2.validate import MustValueError
+from saml2.validate import ShouldValueError
+from saml2.validate import valid_domain_name
+from saml2.validate import valid_ipv4
+from saml2.validate import valid_ipv6
+
# authentication information fields
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:assertion'
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:assertion"
# xmlschema definition
XSD = "xs"
# xmlschema templates and extensions
-XS_NAMESPACE = 'http://www.w3.org/2001/XMLSchema'
+XS_NAMESPACE = "http://www.w3.org/2001/XMLSchema"
# xmlschema-instance, which contains several builtin attributes
-XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'
+XSI_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"
# xml soap namespace
NS_SOAP_ENC = "http://schemas.xmlsoap.org/soap/encoding/"
# type definitions for xmlschemas
-XSI_TYPE = '{%s}type' % XSI_NAMESPACE
+XSI_TYPE = "{%s}type" % XSI_NAMESPACE
# nil type definition for xmlschemas
-XSI_NIL = '{%s}nil' % XSI_NAMESPACE
+XSI_NIL = "{%s}nil" % XSI_NAMESPACE
# idp and sp communicate usually about a subject(NameID)
# the format determines the category the subject is in
# custom subject
-NAMEID_FORMAT_UNSPECIFIED = (
- "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified")
+NAMEID_FORMAT_UNSPECIFIED = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
# subject as email address
-NAMEID_FORMAT_EMAILADDRESS = (
- "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress")
+NAMEID_FORMAT_EMAILADDRESS = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
# subject as x509 key
-NAMEID_FORMAT_X509SUBJECTNAME = (
- "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName")
+NAMEID_FORMAT_X509SUBJECTNAME = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName"
# subject as windows domain name
-NAMEID_FORMAT_WINDOWSDOMAINQUALIFIEDNAME = (
- "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName")
+NAMEID_FORMAT_WINDOWSDOMAINQUALIFIEDNAME = "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName"
# subject from a kerberos instance
-NAMEID_FORMAT_KERBEROS = (
- "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos")
+NAMEID_FORMAT_KERBEROS = "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos"
# subject as name
-NAMEID_FORMAT_ENTITY = (
- "urn:oasis:names:tc:SAML:2.0:nameid-format:entity")
+NAMEID_FORMAT_ENTITY = "urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
# linked subject
-NAMEID_FORMAT_PERSISTENT = (
- "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent")
+NAMEID_FORMAT_PERSISTENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
# annonymous subject
-NAMEID_FORMAT_TRANSIENT = (
- "urn:oasis:names:tc:SAML:2.0:nameid-format:transient")
+NAMEID_FORMAT_TRANSIENT = "urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
# subject avaiable in encrypted format
-NAMEID_FORMAT_ENCRYPTED = (
- "urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted")
+NAMEID_FORMAT_ENCRYPTED = "urn:oasis:names:tc:SAML:2.0:nameid-format:encrypted"
# dicc for avaiable formats
NAMEID_FORMATS_SAML2 = (
- ('NAMEID_FORMAT_EMAILADDRESS', NAMEID_FORMAT_EMAILADDRESS),
- ('NAMEID_FORMAT_ENCRYPTED', NAMEID_FORMAT_ENCRYPTED),
- ('NAMEID_FORMAT_ENTITY', NAMEID_FORMAT_ENTITY),
- ('NAMEID_FORMAT_PERSISTENT', NAMEID_FORMAT_PERSISTENT),
- ('NAMEID_FORMAT_TRANSIENT', NAMEID_FORMAT_TRANSIENT),
- ('NAMEID_FORMAT_UNSPECIFIED', NAMEID_FORMAT_UNSPECIFIED),
+ ("NAMEID_FORMAT_EMAILADDRESS", NAMEID_FORMAT_EMAILADDRESS),
+ ("NAMEID_FORMAT_ENCRYPTED", NAMEID_FORMAT_ENCRYPTED),
+ ("NAMEID_FORMAT_ENTITY", NAMEID_FORMAT_ENTITY),
+ ("NAMEID_FORMAT_PERSISTENT", NAMEID_FORMAT_PERSISTENT),
+ ("NAMEID_FORMAT_TRANSIENT", NAMEID_FORMAT_TRANSIENT),
+ ("NAMEID_FORMAT_UNSPECIFIED", NAMEID_FORMAT_UNSPECIFIED),
)
# a profile outlines a set of rules describing how to embed SAML assertions.
@@ -92,30 +84,27 @@ NAMEID_FORMATS_SAML2 = (
# https://www.oasis-open.org/committees/download.php/56782/sstc-saml-profiles-errata-2.0-wd-07.pdf
# XML based values for SAML attributes
-PROFILE_ATTRIBUTE_BASIC = (
- "urn:oasis:names:tc:SAML:2.0:profiles:attribute:basic")
+PROFILE_ATTRIBUTE_BASIC = "urn:oasis:names:tc:SAML:2.0:profiles:attribute:basic"
# an AuthnRequest is made to initiate authentication
# authenticate the request with login credentials
AUTHN_PASSWORD = "urn:oasis:names:tc:SAML:2.0:ac:classes:Password"
# authenticate the request with login credentials, over tls/https
-AUTHN_PASSWORD_PROTECTED = \
- "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
+AUTHN_PASSWORD_PROTECTED = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
# attribute statements is key:value metadata shared with your app
# custom format
-NAME_FORMAT_UNSPECIFIED = (
- "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified")
+NAME_FORMAT_UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"
# uri format
NAME_FORMAT_URI = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
# XML-based format
NAME_FORMAT_BASIC = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
# dicc for avaiable formats
NAME_FORMATS_SAML2 = (
- ('NAME_FORMAT_BASIC', NAME_FORMAT_BASIC),
- ('NAME_FORMAT_URI', NAME_FORMAT_URI),
- ('NAME_FORMAT_UNSPECIFIED', NAME_FORMAT_UNSPECIFIED),
+ ("NAME_FORMAT_BASIC", NAME_FORMAT_BASIC),
+ ("NAME_FORMAT_URI", NAME_FORMAT_URI),
+ ("NAME_FORMAT_UNSPECIFIED", NAME_FORMAT_UNSPECIFIED),
)
# the SAML authority's decision can be predetermined by arbitrary context
@@ -161,23 +150,19 @@ SCM_BEARER = "urn:oasis:names:tc:SAML:2.0:cm:bearer"
class AttributeValueBase(SamlBase):
- def __init__(self,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ def __init__(self, text=None, extension_elements=None, extension_attributes=None):
self._extatt = {}
- SamlBase.__init__(self,
- text=None,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ SamlBase.__init__(
+ self, text=None, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
if self._extatt:
self.extension_attributes = self._extatt
if text:
self.set_text(text)
elif not extension_elements:
- self.extension_attributes = {XSI_NIL: 'true'}
+ self.extension_attributes = {XSI_NIL: "true"}
elif XSI_TYPE in self.extension_attributes:
del self.extension_attributes[XSI_TYPE]
@@ -190,13 +175,9 @@ class AttributeValueBase(SamlBase):
def verify(self):
if not self.text and not self.extension_elements:
if not self.extension_attributes:
- raise Exception(
- "Attribute value base should not have extension attributes"
- )
+ raise Exception("Attribute value base should not have extension attributes")
if self.extension_attributes[XSI_NIL] != "true":
- raise Exception(
- "Attribute value base should not have extension attributes"
- )
+ raise Exception("Attribute value base should not have extension attributes")
return True
else:
SamlBase.verify(self)
@@ -212,17 +193,17 @@ class AttributeValueBase(SamlBase):
except AttributeError:
self._extatt[XSI_TYPE] = typ
- if typ.startswith('xs:'):
+ if typ.startswith("xs:"):
try:
- self.extension_attributes['xmlns:xs'] = XS_NAMESPACE
+ self.extension_attributes["xmlns:xs"] = XS_NAMESPACE
except AttributeError:
- self._extatt['xmlns:xs'] = XS_NAMESPACE
+ self._extatt["xmlns:xs"] = XS_NAMESPACE
- if typ.startswith('xsd:'):
+ if typ.startswith("xsd:"):
try:
- self.extension_attributes['xmlns:xsd'] = XS_NAMESPACE
+ self.extension_attributes["xmlns:xsd"] = XS_NAMESPACE
except AttributeError:
- self._extatt['xmlns:xsd'] = XS_NAMESPACE
+ self._extatt["xmlns:xsd"] = XS_NAMESPACE
def get_type(self):
try:
@@ -245,20 +226,20 @@ class AttributeValueBase(SamlBase):
def set_text(self, value, base64encode=False):
def _wrong_type_value(xsd, value):
- msg = 'Type and value do not match: {xsd}:{type}:{value}'
+ msg = "Type and value do not match: {xsd}:{type}:{value}"
msg = msg.format(xsd=xsd, type=type(value), value=value)
raise ValueError(msg)
# only work with six.string_types
if isinstance(value, six.binary_type):
- value = value.decode('utf-8')
+ value = value.decode("utf-8")
type_to_xsd = {
- str: 'string',
- int: 'integer',
- float: 'float',
- bool: 'boolean',
- type(None): '',
+ str: "string",
+ int: "integer",
+ float: "float",
+ bool: "boolean",
+ type(None): "",
}
# entries of xsd-types each declaring:
@@ -266,95 +247,90 @@ class AttributeValueBase(SamlBase):
# - a function to turn a string into that type
# - a function to turn that type into a text-value
xsd_types_props = {
- 'string': {
- 'type': str,
- 'to_type': str,
- 'to_text': str,
+ "string": {
+ "type": str,
+ "to_type": str,
+ "to_text": str,
},
- 'integer': {
- 'type': int,
- 'to_type': int,
- 'to_text': str,
+ "integer": {
+ "type": int,
+ "to_type": int,
+ "to_text": str,
},
- 'short': {
- 'type': int,
- 'to_type': int,
- 'to_text': str,
+ "short": {
+ "type": int,
+ "to_type": int,
+ "to_text": str,
},
- 'int': {
- 'type': int,
- 'to_type': int,
- 'to_text': str,
+ "int": {
+ "type": int,
+ "to_type": int,
+ "to_text": str,
},
- 'long': {
- 'type': int,
- 'to_type': int,
- 'to_text': str,
+ "long": {
+ "type": int,
+ "to_type": int,
+ "to_text": str,
},
- 'float': {
- 'type': float,
- 'to_type': float,
- 'to_text': str,
+ "float": {
+ "type": float,
+ "to_type": float,
+ "to_text": str,
},
- 'double': {
- 'type': float,
- 'to_type': float,
- 'to_text': str,
+ "double": {
+ "type": float,
+ "to_type": float,
+ "to_text": str,
},
- 'boolean': {
- 'type': bool,
- 'to_type': lambda x: {
- 'true': True,
- 'false': False,
+ "boolean": {
+ "type": bool,
+ "to_type": lambda x: {
+ "true": True,
+ "false": False,
}[str(x).lower()],
- 'to_text': lambda x: str(x).lower(),
+ "to_text": lambda x: str(x).lower(),
},
- 'date': {
- 'type': date,
- 'to_type': lambda x: datetime.strptime(x, '%Y-%m-%d').date(),
- 'to_text': str,
+ "date": {
+ "type": date,
+ "to_type": lambda x: datetime.strptime(x, "%Y-%m-%d").date(),
+ "to_text": str,
},
- 'base64Binary': {
- 'type': str,
- 'to_type': str,
- 'to_text': (
- lambda x: base64.encodebytes(x.encode()) if base64encode else x
- ),
+ "base64Binary": {
+ "type": str,
+ "to_type": str,
+ "to_text": (lambda x: base64.encodebytes(x.encode()) if base64encode else x),
},
- 'anyType': {
- 'type': type(value),
- 'to_type': lambda x: x,
- 'to_text': lambda x: x,
+ "anyType": {
+ "type": type(value),
+ "to_type": lambda x: x,
+ "to_text": lambda x: x,
},
- '': {
- 'type': type(None),
- 'to_type': lambda x: None,
- 'to_text': lambda x: '',
+ "": {
+ "type": type(None),
+ "to_type": lambda x: None,
+ "to_text": lambda x: "",
},
}
- xsd_string = (
- 'base64Binary'
- if base64encode
- else self.get_type() or type_to_xsd.get(type(value))
- )
+ xsd_string = "base64Binary" if base64encode else self.get_type() or type_to_xsd.get(type(value))
xsd_ns, xsd_type = (
- ['', type(None)] if xsd_string is None
- else ['', ''] if xsd_string == ''
- else [
- XSD if xsd_string in xsd_types_props else '',
- xsd_string
- ] if ':' not in xsd_string
- else xsd_string.split(':', 1))
+ ["", type(None)]
+ if xsd_string is None
+ else ["", ""]
+ if xsd_string == ""
+ else [XSD if xsd_string in xsd_types_props else "", xsd_string]
+ if ":" not in xsd_string
+ else xsd_string.split(":", 1)
+ )
xsd_type_props = xsd_types_props.get(xsd_type)
if not xsd_type_props:
xsd_type_props = xsd_types_props.get("string")
- valid_type = xsd_type_props.get('type', type(None))
- to_type = xsd_type_props.get('to_type', str)
- to_text = xsd_type_props.get('to_text', str)
+ valid_type = xsd_type_props.get("type", type(None))
+ to_type = xsd_type_props.get("to_type", str)
+ to_text = xsd_type_props.get("to_text", str)
# cast to correct type before type-checking
if type(value) is str and valid_type is not str:
@@ -368,11 +344,8 @@ class AttributeValueBase(SamlBase):
_wrong_type_value(xsd=xsd_type, value=value)
text = to_text(value)
- self.set_type(
- '{ns}:{type}'.format(ns=xsd_ns, type=xsd_type) if xsd_ns
- else xsd_type if xsd_type
- else '')
- SamlBase.__setattr__(self, 'text', text)
+ self.set_type("{ns}:{type}".format(ns=xsd_ns, type=xsd_type) if xsd_ns else xsd_type if xsd_type else "")
+ SamlBase.__setattr__(self, "text", text)
return self
def harvest_element_tree(self, tree):
@@ -386,15 +359,11 @@ class AttributeValueBase(SamlBase):
# we consider whitespace insignificant
# and remove/trim/strip whitespace
# and expect to not have actual text content
- text = (
- tree.text.strip()
- if tree.text and self.extension_elements
- else tree.text
- )
+ text = tree.text.strip() if tree.text and self.extension_elements else tree.text
if text:
- #print("set_text:", tree.text)
+ # print("set_text:", tree.text)
# clear type
- #self.clear_type()
+ # self.clear_type()
self.set_text(text)
# if we have added a text node
@@ -406,58 +375,55 @@ class AttributeValueBase(SamlBase):
class BaseIDAbstractType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:BaseIDAbstractType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:BaseIDAbstractType element"""
- c_tag = 'BaseIDAbstractType'
+ c_tag = "BaseIDAbstractType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['NameQualifier'] = ('name_qualifier', 'string', False)
- c_attributes['SPNameQualifier'] = ('sp_name_qualifier', 'string', False)
-
- def __init__(self,
- name_qualifier=None,
- sp_name_qualifier=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["NameQualifier"] = ("name_qualifier", "string", False)
+ c_attributes["SPNameQualifier"] = ("sp_name_qualifier", "string", False)
+
+ def __init__(
+ self, name_qualifier=None, sp_name_qualifier=None, text=None, extension_elements=None, extension_attributes=None
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.name_qualifier = name_qualifier
self.sp_name_qualifier = sp_name_qualifier
class NameIDType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:NameIDType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:NameIDType element"""
- c_tag = 'NameIDType'
+ c_tag = "NameIDType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['NameQualifier'] = ('name_qualifier', 'string', False)
- c_attributes['SPNameQualifier'] = ('sp_name_qualifier', 'string', False)
- c_attributes['Format'] = ('format', 'anyURI', False)
- c_attributes['SPProvidedID'] = ('sp_provided_id', 'string', False)
-
- def __init__(self,
- name_qualifier=None,
- sp_name_qualifier=None,
- format=None,
- sp_provided_id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["NameQualifier"] = ("name_qualifier", "string", False)
+ c_attributes["SPNameQualifier"] = ("sp_name_qualifier", "string", False)
+ c_attributes["Format"] = ("format", "anyURI", False)
+ c_attributes["SPProvidedID"] = ("sp_provided_id", "string", False)
+
+ def __init__(
+ self,
+ name_qualifier=None,
+ sp_name_qualifier=None,
+ format=None,
+ sp_provided_id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.name_qualifier = name_qualifier
self.sp_name_qualifier = sp_name_qualifier
self.format = format
@@ -469,34 +435,25 @@ def name_id_type__from_string(xml_string):
class EncryptedElementType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedElementType element
- """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedElementType element"""
- c_tag = 'EncryptedElementType'
+ c_tag = "EncryptedElementType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}EncryptedData'] = (
- 'encrypted_data',
- xenc.EncryptedData)
- c_children['{http://www.w3.org/2001/04/xmlenc#}EncryptedKey'] = (
- 'encrypted_key',
- [xenc.EncryptedKey])
- c_cardinality['encrypted_key'] = {"min": 0}
- c_child_order.extend(['encrypted_data', 'encrypted_key'])
-
- def __init__(self,
- encrypted_data=None,
- encrypted_key=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{http://www.w3.org/2001/04/xmlenc#}EncryptedData"] = ("encrypted_data", xenc.EncryptedData)
+ c_children["{http://www.w3.org/2001/04/xmlenc#}EncryptedKey"] = ("encrypted_key", [xenc.EncryptedKey])
+ c_cardinality["encrypted_key"] = {"min": 0}
+ c_child_order.extend(["encrypted_data", "encrypted_key"])
+
+ def __init__(
+ self, encrypted_data=None, encrypted_key=None, text=None, extension_elements=None, extension_attributes=None
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.encrypted_data = encrypted_data
self.encrypted_key = encrypted_key or []
@@ -506,9 +463,9 @@ def encrypted_element_type__from_string(xml_string):
class EncryptedID(EncryptedElementType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedID element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedID element"""
- c_tag = 'EncryptedID'
+ c_tag = "EncryptedID"
c_namespace = NAMESPACE
c_children = EncryptedElementType_.c_children.copy()
c_attributes = EncryptedElementType_.c_attributes.copy()
@@ -521,9 +478,9 @@ def encrypted_id_from_string(xml_string):
class Issuer(NameIDType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Issuer element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Issuer element"""
- c_tag = 'Issuer'
+ c_tag = "Issuer"
c_namespace = NAMESPACE
c_children = NameIDType_.c_children.copy()
c_attributes = NameIDType_.c_attributes.copy()
@@ -536,11 +493,11 @@ def issuer_from_string(xml_string):
class AssertionIDRef(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AssertionIDRef element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AssertionIDRef element"""
- c_tag = 'AssertionIDRef'
+ c_tag = "AssertionIDRef"
c_namespace = NAMESPACE
- c_value_type = {'base': 'NCName'}
+ c_value_type = {"base": "NCName"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -552,11 +509,11 @@ def assertion_id_ref_from_string(xml_string):
class AssertionURIRef(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AssertionURIRef element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AssertionURIRef element"""
- c_tag = 'AssertionURIRef'
+ c_tag = "AssertionURIRef"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -569,36 +526,36 @@ def assertion_uri_ref_from_string(xml_string):
class SubjectConfirmationDataType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:assertion:SubjectConfirmationDataType
- element """
+ element"""
- c_tag = 'SubjectConfirmationDataType'
+ c_tag = "SubjectConfirmationDataType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['NotBefore'] = ('not_before', 'dateTime', False)
- c_attributes['NotOnOrAfter'] = ('not_on_or_after', 'dateTime', False)
- c_attributes['Recipient'] = ('recipient', 'anyURI', False)
- c_attributes['InResponseTo'] = ('in_response_to', 'NCName', False)
- c_attributes['Address'] = ('address', 'string', False)
- c_any = {"namespace": "##any", "processContents": "lax", "minOccurs": "0",
- "maxOccurs": "unbounded"}
+ c_attributes["NotBefore"] = ("not_before", "dateTime", False)
+ c_attributes["NotOnOrAfter"] = ("not_on_or_after", "dateTime", False)
+ c_attributes["Recipient"] = ("recipient", "anyURI", False)
+ c_attributes["InResponseTo"] = ("in_response_to", "NCName", False)
+ c_attributes["Address"] = ("address", "string", False)
+ c_any = {"namespace": "##any", "processContents": "lax", "minOccurs": "0", "maxOccurs": "unbounded"}
c_any_attribute = {"namespace": "##other", "processContents": "lax"}
- def __init__(self,
- not_before=None,
- not_on_or_after=None,
- recipient=None,
- in_response_to=None,
- address=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ def __init__(
+ self,
+ not_before=None,
+ not_on_or_after=None,
+ recipient=None,
+ in_response_to=None,
+ address=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.not_before = not_before
self.not_on_or_after = not_on_or_after
self.recipient = recipient
@@ -607,47 +564,39 @@ class SubjectConfirmationDataType_(SamlBase):
def subject_confirmation_data_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SubjectConfirmationDataType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SubjectConfirmationDataType_, xml_string)
class KeyInfoConfirmationDataType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:assertion:KeyInfoConfirmationDataType
- element """
+ element"""
- c_tag = 'KeyInfoConfirmationDataType'
+ c_tag = "KeyInfoConfirmationDataType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyInfo'] = ('key_info',
- [ds.KeyInfo])
- c_cardinality['key_info'] = {"min": 1}
- c_child_order.extend(['key_info'])
-
- def __init__(self,
- key_info=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyInfo"] = ("key_info", [ds.KeyInfo])
+ c_cardinality["key_info"] = {"min": 1}
+ c_child_order.extend(["key_info"])
+
+ def __init__(self, key_info=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.key_info = key_info or []
def key_info_confirmation_data_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(KeyInfoConfirmationDataType_,
- xml_string)
+ return saml2.create_class_from_xml_string(KeyInfoConfirmationDataType_, xml_string)
class ConditionAbstractType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:assertion:ConditionAbstractType
- element """
+ element"""
- c_tag = 'ConditionAbstractType'
+ c_tag = "ConditionAbstractType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -656,11 +605,11 @@ class ConditionAbstractType_(SamlBase):
class Audience(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Audience element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Audience element"""
- c_tag = 'Audience'
+ c_tag = "Audience"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -672,9 +621,9 @@ def audience_from_string(xml_string):
class OneTimeUseType_(ConditionAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:OneTimeUseType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:OneTimeUseType element"""
- c_tag = 'OneTimeUseType'
+ c_tag = "OneTimeUseType"
c_namespace = NAMESPACE
c_children = ConditionAbstractType_.c_children.copy()
c_attributes = ConditionAbstractType_.c_attributes.copy()
@@ -687,30 +636,23 @@ def one_time_use_type__from_string(xml_string):
class ProxyRestrictionType_(ConditionAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:ProxyRestrictionType element
- """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:ProxyRestrictionType element"""
- c_tag = 'ProxyRestrictionType'
+ c_tag = "ProxyRestrictionType"
c_namespace = NAMESPACE
c_children = ConditionAbstractType_.c_children.copy()
c_attributes = ConditionAbstractType_.c_attributes.copy()
c_child_order = ConditionAbstractType_.c_child_order[:]
c_cardinality = ConditionAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Audience'] = ('audience',
- [Audience])
- c_cardinality['audience'] = {"min": 0}
- c_attributes['Count'] = ('count', 'nonNegativeInteger', False)
- c_child_order.extend(['audience'])
-
- def __init__(self,
- audience=None,
- count=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Audience"] = ("audience", [Audience])
+ c_cardinality["audience"] = {"min": 0}
+ c_attributes["Count"] = ("count", "nonNegativeInteger", False)
+ c_child_order.extend(["audience"])
+
+ def __init__(self, audience=None, count=None, text=None, extension_elements=None, extension_attributes=None):
ConditionAbstractType_.__init__(
- self, text=text, extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.audience = audience or []
self.count = count
@@ -720,9 +662,9 @@ def proxy_restriction_type__from_string(xml_string):
class EncryptedAssertion(EncryptedElementType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedAssertion element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedAssertion element"""
- c_tag = 'EncryptedAssertion'
+ c_tag = "EncryptedAssertion"
c_namespace = NAMESPACE
c_children = EncryptedElementType_.c_children.copy()
c_attributes = EncryptedElementType_.c_attributes.copy()
@@ -735,10 +677,9 @@ def encrypted_assertion_from_string(xml_string):
class StatementAbstractType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:StatementAbstractType element
- """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:StatementAbstractType element"""
- c_tag = 'StatementAbstractType'
+ c_tag = "StatementAbstractType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -747,27 +688,21 @@ class StatementAbstractType_(SamlBase):
class SubjectLocalityType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectLocalityType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectLocalityType element"""
- c_tag = 'SubjectLocalityType'
+ c_tag = "SubjectLocalityType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Address'] = ('address', 'string', False)
- c_attributes['DNSName'] = ('dns_name', 'string', False)
-
- def __init__(self,
- address=None,
- dns_name=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["Address"] = ("address", "string", False)
+ c_attributes["DNSName"] = ("dns_name", "string", False)
+
+ def __init__(self, address=None, dns_name=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.address = address
self.dns_name = dns_name
@@ -777,12 +712,11 @@ def subject_locality_type__from_string(xml_string):
class AuthnContextClassRef(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextClassRef element
- """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextClassRef element"""
- c_tag = 'AuthnContextClassRef'
+ c_tag = "AuthnContextClassRef"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -794,11 +728,11 @@ def authn_context_class_ref_from_string(xml_string):
class AuthnContextDeclRef(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextDeclRef element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextDeclRef element"""
- c_tag = 'AuthnContextDeclRef'
+ c_tag = "AuthnContextDeclRef"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -810,11 +744,11 @@ def authn_context_decl_ref_from_string(xml_string):
class AuthnContextDecl(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextDecl element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextDecl element"""
- c_tag = 'AuthnContextDecl'
+ c_tag = "AuthnContextDecl"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyType'}
+ c_value_type = {"base": "anyType"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -827,11 +761,11 @@ def authn_context_decl_from_string(xml_string):
class AuthenticatingAuthority(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:assertion:AuthenticatingAuthority
- element """
+ element"""
- c_tag = 'AuthenticatingAuthority'
+ c_tag = "AuthenticatingAuthority"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -839,17 +773,15 @@ class AuthenticatingAuthority(SamlBase):
def authenticating_authority_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthenticatingAuthority,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthenticatingAuthority, xml_string)
class DecisionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:DecisionType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:DecisionType element"""
- c_tag = 'DecisionType'
+ c_tag = "DecisionType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string', 'enumeration': ['Permit', 'Deny',
- 'Indeterminate']}
+ c_value_type = {"base": "string", "enumeration": ["Permit", "Deny", "Indeterminate"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -861,26 +793,21 @@ def decision_type__from_string(xml_string):
class ActionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:ActionType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:ActionType element"""
- c_tag = 'ActionType'
+ c_tag = "ActionType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Namespace'] = ('namespace', 'anyURI', True)
-
- def __init__(self,
- namespace=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["Namespace"] = ("namespace", "anyURI", True)
+
+ def __init__(self, namespace=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.namespace = namespace
@@ -889,11 +816,11 @@ def action_type__from_string(xml_string):
class AttributeValue(AttributeValueBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AttributeValue element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AttributeValue element"""
- c_tag = 'AttributeValue'
+ c_tag = "AttributeValue"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyType'}
+ c_value_type = {"base": "anyType"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -905,9 +832,9 @@ def attribute_value_from_string(xml_string):
class EncryptedAttribute(EncryptedElementType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedAttribute element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:EncryptedAttribute element"""
- c_tag = 'EncryptedAttribute'
+ c_tag = "EncryptedAttribute"
c_namespace = NAMESPACE
c_children = EncryptedElementType_.c_children.copy()
c_attributes = EncryptedElementType_.c_attributes.copy()
@@ -920,9 +847,9 @@ def encrypted_attribute_from_string(xml_string):
class BaseID(BaseIDAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:BaseID element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:BaseID element"""
- c_tag = 'BaseID'
+ c_tag = "BaseID"
c_namespace = NAMESPACE
c_children = BaseIDAbstractType_.c_children.copy()
c_attributes = BaseIDAbstractType_.c_attributes.copy()
@@ -944,9 +871,9 @@ class NameID(NameIDType_):
include: Email address, X.509 subject name, Windows domain qualified name,
Kerberos principal name, Entity identifier, Persistent identifier,
Transient identifier."
- """
+ """
- c_tag = 'NameID'
+ c_tag = "NameID"
c_namespace = NAMESPACE
c_children = NameIDType_.c_children.copy()
c_attributes = NameIDType_.c_attributes.copy()
@@ -960,9 +887,9 @@ def name_id_from_string(xml_string):
class SubjectConfirmationData(SubjectConfirmationDataType_):
"""The urn:oasis:names:tc:SAML:2.0:assertion:SubjectConfirmationData
- element """
+ element"""
- c_tag = 'SubjectConfirmationData'
+ c_tag = "SubjectConfirmationData"
c_namespace = NAMESPACE
c_children = SubjectConfirmationDataType_.c_children.copy()
c_attributes = SubjectConfirmationDataType_.c_attributes.copy()
@@ -971,14 +898,13 @@ class SubjectConfirmationData(SubjectConfirmationDataType_):
def subject_confirmation_data_from_string(xml_string):
- return saml2.create_class_from_xml_string(SubjectConfirmationData,
- xml_string)
+ return saml2.create_class_from_xml_string(SubjectConfirmationData, xml_string)
class Condition(ConditionAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Condition element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Condition element"""
- c_tag = 'Condition'
+ c_tag = "Condition"
c_namespace = NAMESPACE
c_children = ConditionAbstractType_.c_children.copy()
c_attributes = ConditionAbstractType_.c_attributes.copy()
@@ -992,39 +918,33 @@ def condition_from_string(xml_string):
class AudienceRestrictionType_(ConditionAbstractType_):
"""The urn:oasis:names:tc:SAML:2.0:assertion:AudienceRestrictionType
- element """
+ element"""
- c_tag = 'AudienceRestrictionType'
+ c_tag = "AudienceRestrictionType"
c_namespace = NAMESPACE
c_children = ConditionAbstractType_.c_children.copy()
c_attributes = ConditionAbstractType_.c_attributes.copy()
c_child_order = ConditionAbstractType_.c_child_order[:]
c_cardinality = ConditionAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Audience'] = ('audience',
- [Audience])
- c_cardinality['audience'] = {"min": 1}
- c_child_order.extend(['audience'])
-
- def __init__(self,
- audience=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Audience"] = ("audience", [Audience])
+ c_cardinality["audience"] = {"min": 1}
+ c_child_order.extend(["audience"])
+
+ def __init__(self, audience=None, text=None, extension_elements=None, extension_attributes=None):
ConditionAbstractType_.__init__(
- self, text=text, extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.audience = audience or []
def audience_restriction_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AudienceRestrictionType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AudienceRestrictionType_, xml_string)
class OneTimeUse(OneTimeUseType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:OneTimeUse element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:OneTimeUse element"""
- c_tag = 'OneTimeUse'
+ c_tag = "OneTimeUse"
c_namespace = NAMESPACE
c_children = OneTimeUseType_.c_children.copy()
c_attributes = OneTimeUseType_.c_attributes.copy()
@@ -1037,9 +957,9 @@ def one_time_use_from_string(xml_string):
class ProxyRestriction(ProxyRestrictionType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:ProxyRestriction element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:ProxyRestriction element"""
- c_tag = 'ProxyRestriction'
+ c_tag = "ProxyRestriction"
c_namespace = NAMESPACE
c_children = ProxyRestrictionType_.c_children.copy()
c_attributes = ProxyRestrictionType_.c_attributes.copy()
@@ -1052,9 +972,9 @@ def proxy_restriction_from_string(xml_string):
class Statement(StatementAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Statement element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Statement element"""
- c_tag = 'Statement'
+ c_tag = "Statement"
c_namespace = NAMESPACE
c_children = StatementAbstractType_.c_children.copy()
c_attributes = StatementAbstractType_.c_attributes.copy()
@@ -1067,9 +987,9 @@ def statement_from_string(xml_string):
class SubjectLocality(SubjectLocalityType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectLocality element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectLocality element"""
- c_tag = 'SubjectLocality'
+ c_tag = "SubjectLocality"
c_namespace = NAMESPACE
c_children = SubjectLocalityType_.c_children.copy()
c_attributes = SubjectLocalityType_.c_attributes.copy()
@@ -1094,44 +1014,47 @@ def subject_locality_from_string(xml_string):
class AuthnContextType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextType element"""
- c_tag = 'AuthnContextType'
+ c_tag = "AuthnContextType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextClassRef'] = (
- 'authn_context_class_ref', AuthnContextClassRef)
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextDecl'] = (
- 'authn_context_decl',
- AuthnContextDecl)
- c_cardinality['authn_context_decl'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextDeclRef'] = (
- 'authn_context_decl_ref',
- AuthnContextDeclRef)
- c_cardinality['authn_context_decl_ref'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:assertion}AuthenticatingAuthority'] = (
- 'authenticating_authority', [AuthenticatingAuthority])
- c_cardinality['authenticating_authority'] = {"min": 0}
- c_child_order.extend(['authn_context_class_ref', 'authn_context_decl',
- 'authn_context_decl_ref', 'authenticating_authority'])
-
- def __init__(self,
- authn_context_class_ref=None,
- authn_context_decl=None,
- authn_context_decl_ref=None,
- authenticating_authority=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextClassRef"] = (
+ "authn_context_class_ref",
+ AuthnContextClassRef,
+ )
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextDecl"] = ("authn_context_decl", AuthnContextDecl)
+ c_cardinality["authn_context_decl"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextDeclRef"] = (
+ "authn_context_decl_ref",
+ AuthnContextDeclRef,
+ )
+ c_cardinality["authn_context_decl_ref"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthenticatingAuthority"] = (
+ "authenticating_authority",
+ [AuthenticatingAuthority],
+ )
+ c_cardinality["authenticating_authority"] = {"min": 0}
+ c_child_order.extend(
+ ["authn_context_class_ref", "authn_context_decl", "authn_context_decl_ref", "authenticating_authority"]
+ )
+
+ def __init__(
+ self,
+ authn_context_class_ref=None,
+ authn_context_decl=None,
+ authn_context_decl_ref=None,
+ authenticating_authority=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.authn_context_class_ref = authn_context_class_ref
self.authn_context_decl = authn_context_decl
self.authn_context_decl_ref = authn_context_decl_ref
@@ -1139,10 +1062,7 @@ class AuthnContextType_(SamlBase):
def verify(self):
if self.authn_context_decl and self.authn_context_decl_ref:
- raise Exception(
- "Invalid Response: "
- "Cannot have both <AuthnContextDecl> and <AuthnContextDeclRef>"
- )
+ raise Exception("Invalid Response: " "Cannot have both <AuthnContextDecl> and <AuthnContextDeclRef>")
return SamlBase.verify(self)
@@ -1151,9 +1071,9 @@ def authn_context_type__from_string(xml_string):
class Action(ActionType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Action element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Action element"""
- c_tag = 'Action'
+ c_tag = "Action"
c_namespace = NAMESPACE
c_children = ActionType_.c_children.copy()
c_attributes = ActionType_.c_attributes.copy()
@@ -1166,36 +1086,35 @@ def action_from_string(xml_string):
class AttributeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AttributeType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AttributeType element"""
- c_tag = 'AttributeType'
+ c_tag = "AttributeType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AttributeValue'] = (
- 'attribute_value',
- [AttributeValue])
- c_cardinality['attribute_value'] = {"min": 0}
- c_attributes['Name'] = ('name', 'string', True)
- c_attributes['NameFormat'] = ('name_format', 'anyURI', False)
- c_attributes['FriendlyName'] = ('friendly_name', 'string', False)
- c_child_order.extend(['attribute_value'])
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AttributeValue"] = ("attribute_value", [AttributeValue])
+ c_cardinality["attribute_value"] = {"min": 0}
+ c_attributes["Name"] = ("name", "string", True)
+ c_attributes["NameFormat"] = ("name_format", "anyURI", False)
+ c_attributes["FriendlyName"] = ("friendly_name", "string", False)
+ c_child_order.extend(["attribute_value"])
c_any_attribute = {"namespace": "##other", "processContents": "lax"}
- def __init__(self,
- attribute_value=None,
- name=None,
- name_format=NAME_FORMAT_URI,
- friendly_name=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ def __init__(
+ self,
+ attribute_value=None,
+ name=None,
+ name_format=NAME_FORMAT_URI,
+ friendly_name=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.attribute_value = attribute_value or []
self.name = name
self.name_format = name_format
@@ -1203,7 +1122,7 @@ class AttributeType_(SamlBase):
# when consuming such elements, default to NAME_FORMAT_UNSPECIFIED as NameFormat
def harvest_element_tree(self, tree):
- tree.attrib.setdefault('NameFormat', NAME_FORMAT_UNSPECIFIED)
+ tree.attrib.setdefault("NameFormat", NAME_FORMAT_UNSPECIFIED)
SamlBase.harvest_element_tree(self, tree)
@@ -1213,45 +1132,42 @@ def attribute_type__from_string(xml_string):
class SubjectConfirmationType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:assertion:SubjectConfirmationType
- element """
+ element"""
- c_tag = 'SubjectConfirmationType'
+ c_tag = "SubjectConfirmationType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}BaseID'] = ('base_id',
- BaseID)
- c_cardinality['base_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}NameID'] = ('name_id',
- NameID)
- c_cardinality['name_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID'] = (
- 'encrypted_id',
- EncryptedID)
- c_cardinality['encrypted_id'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:assertion}SubjectConfirmationData'] = (
- 'subject_confirmation_data', SubjectConfirmationData)
- c_cardinality['subject_confirmation_data'] = {"min": 0, "max": 1}
- c_attributes['Method'] = ('method', 'anyURI', True)
- c_child_order.extend(['base_id', 'name_id', 'encrypted_id',
- 'subject_confirmation_data'])
-
- def __init__(self,
- base_id=None,
- name_id=None,
- encrypted_id=None,
- subject_confirmation_data=None,
- method=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}BaseID"] = ("base_id", BaseID)
+ c_cardinality["base_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}NameID"] = ("name_id", NameID)
+ c_cardinality["name_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID"] = ("encrypted_id", EncryptedID)
+ c_cardinality["encrypted_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}SubjectConfirmationData"] = (
+ "subject_confirmation_data",
+ SubjectConfirmationData,
+ )
+ c_cardinality["subject_confirmation_data"] = {"min": 0, "max": 1}
+ c_attributes["Method"] = ("method", "anyURI", True)
+ c_child_order.extend(["base_id", "name_id", "encrypted_id", "subject_confirmation_data"])
+
+ def __init__(
+ self,
+ base_id=None,
+ name_id=None,
+ encrypted_id=None,
+ subject_confirmation_data=None,
+ method=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.base_id = base_id
self.name_id = name_id
self.encrypted_id = encrypted_id
@@ -1260,14 +1176,13 @@ class SubjectConfirmationType_(SamlBase):
def subject_confirmation_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SubjectConfirmationType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SubjectConfirmationType_, xml_string)
class AudienceRestriction(AudienceRestrictionType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AudienceRestriction element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AudienceRestriction element"""
- c_tag = 'AudienceRestriction'
+ c_tag = "AudienceRestriction"
c_namespace = NAMESPACE
c_children = AudienceRestrictionType_.c_children.copy()
c_attributes = AudienceRestrictionType_.c_attributes.copy()
@@ -1280,9 +1195,9 @@ def audience_restriction_from_string(xml_string):
class AuthnContext(AuthnContextType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContext element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnContext element"""
- c_tag = 'AuthnContext'
+ c_tag = "AuthnContext"
c_namespace = NAMESPACE
c_children = AuthnContextType_.c_children.copy()
c_attributes = AuthnContextType_.c_attributes.copy()
@@ -1295,9 +1210,9 @@ def authn_context_from_string(xml_string):
class Attribute(AttributeType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Attribute element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Attribute element"""
- c_tag = 'Attribute'
+ c_tag = "Attribute"
c_namespace = NAMESPACE
c_children = AttributeType_.c_children.copy()
c_attributes = AttributeType_.c_attributes.copy()
@@ -1310,9 +1225,9 @@ def attribute_from_string(xml_string):
class SubjectConfirmation(SubjectConfirmationType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectConfirmation element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectConfirmation element"""
- c_tag = 'SubjectConfirmation'
+ c_tag = "SubjectConfirmation"
c_namespace = NAMESPACE
c_children = SubjectConfirmationType_.c_children.copy()
c_attributes = SubjectConfirmationType_.c_attributes.copy()
@@ -1325,49 +1240,44 @@ def subject_confirmation_from_string(xml_string):
class ConditionsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:ConditionsType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:ConditionsType element"""
- c_tag = 'ConditionsType'
+ c_tag = "ConditionsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Condition'] = (
- 'condition',
- [Condition])
- c_cardinality['condition'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AudienceRestriction'] = (
- 'audience_restriction',
- [AudienceRestriction])
- c_cardinality['audience_restriction'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}OneTimeUse'] = (
- 'one_time_use',
- [OneTimeUse])
- c_cardinality['one_time_use'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}ProxyRestriction'] = (
- 'proxy_restriction',
- [ProxyRestriction])
- c_cardinality['proxy_restriction'] = {"min": 0}
- c_attributes['NotBefore'] = ('not_before', 'dateTime', False)
- c_attributes['NotOnOrAfter'] = ('not_on_or_after', 'dateTime', False)
- c_child_order.extend(['condition', 'audience_restriction', 'one_time_use',
- 'proxy_restriction'])
-
- def __init__(self,
- condition=None,
- audience_restriction=None,
- one_time_use=None,
- proxy_restriction=None,
- not_before=None,
- not_on_or_after=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Condition"] = ("condition", [Condition])
+ c_cardinality["condition"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AudienceRestriction"] = (
+ "audience_restriction",
+ [AudienceRestriction],
+ )
+ c_cardinality["audience_restriction"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}OneTimeUse"] = ("one_time_use", [OneTimeUse])
+ c_cardinality["one_time_use"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}ProxyRestriction"] = ("proxy_restriction", [ProxyRestriction])
+ c_cardinality["proxy_restriction"] = {"min": 0}
+ c_attributes["NotBefore"] = ("not_before", "dateTime", False)
+ c_attributes["NotOnOrAfter"] = ("not_on_or_after", "dateTime", False)
+ c_child_order.extend(["condition", "audience_restriction", "one_time_use", "proxy_restriction"])
+
+ def __init__(
+ self,
+ condition=None,
+ audience_restriction=None,
+ one_time_use=None,
+ proxy_restriction=None,
+ not_before=None,
+ not_on_or_after=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.condition = condition or []
self.audience_restriction = audience_restriction or []
self.one_time_use = one_time_use or []
@@ -1391,37 +1301,36 @@ def conditions_type__from_string(xml_string):
class AuthnStatementType_(StatementAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnStatementType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnStatementType element"""
- c_tag = 'AuthnStatementType'
+ c_tag = "AuthnStatementType"
c_namespace = NAMESPACE
c_children = StatementAbstractType_.c_children.copy()
c_attributes = StatementAbstractType_.c_attributes.copy()
c_child_order = StatementAbstractType_.c_child_order[:]
c_cardinality = StatementAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}SubjectLocality'] = (
- 'subject_locality', SubjectLocality)
- c_cardinality['subject_locality'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContext'] = (
- 'authn_context', AuthnContext)
- c_attributes['AuthnInstant'] = ('authn_instant', 'dateTime', True)
- c_attributes['SessionIndex'] = ('session_index', 'string', False)
- c_attributes['SessionNotOnOrAfter'] = ('session_not_on_or_after',
- 'dateTime', False)
- c_child_order.extend(['subject_locality', 'authn_context'])
-
- def __init__(self,
- subject_locality=None,
- authn_context=None,
- authn_instant=None,
- session_index=None,
- session_not_on_or_after=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}SubjectLocality"] = ("subject_locality", SubjectLocality)
+ c_cardinality["subject_locality"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContext"] = ("authn_context", AuthnContext)
+ c_attributes["AuthnInstant"] = ("authn_instant", "dateTime", True)
+ c_attributes["SessionIndex"] = ("session_index", "string", False)
+ c_attributes["SessionNotOnOrAfter"] = ("session_not_on_or_after", "dateTime", False)
+ c_child_order.extend(["subject_locality", "authn_context"])
+
+ def __init__(
+ self,
+ subject_locality=None,
+ authn_context=None,
+ authn_instant=None,
+ session_index=None,
+ session_not_on_or_after=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
StatementAbstractType_.__init__(
- self, text=text, extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.subject_locality = subject_locality
self.authn_context = authn_context
self.authn_instant = authn_instant
@@ -1435,78 +1344,72 @@ def authn_statement_type__from_string(xml_string):
class AttributeStatementType_(StatementAbstractType_):
"""The urn:oasis:names:tc:SAML:2.0:assertion:AttributeStatementType
- element """
+ element"""
- c_tag = 'AttributeStatementType'
+ c_tag = "AttributeStatementType"
c_namespace = NAMESPACE
c_children = StatementAbstractType_.c_children.copy()
c_attributes = StatementAbstractType_.c_attributes.copy()
c_child_order = StatementAbstractType_.c_child_order[:]
c_cardinality = StatementAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Attribute'] = (
- 'attribute',
- [Attribute])
- c_cardinality['attribute'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAttribute'] = (
- 'encrypted_attribute',
- [EncryptedAttribute])
- c_cardinality['encrypted_attribute'] = {"min": 0}
- c_child_order.extend(['attribute', 'encrypted_attribute'])
-
- def __init__(self,
- attribute=None,
- encrypted_attribute=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Attribute"] = ("attribute", [Attribute])
+ c_cardinality["attribute"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAttribute"] = (
+ "encrypted_attribute",
+ [EncryptedAttribute],
+ )
+ c_cardinality["encrypted_attribute"] = {"min": 0}
+ c_child_order.extend(["attribute", "encrypted_attribute"])
+
+ def __init__(
+ self, attribute=None, encrypted_attribute=None, text=None, extension_elements=None, extension_attributes=None
+ ):
StatementAbstractType_.__init__(
- self, text=text, extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.attribute = attribute or []
self.encrypted_attribute = encrypted_attribute or []
def attribute_statement_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AttributeStatementType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AttributeStatementType_, xml_string)
class SubjectType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:SubjectType element"""
- c_tag = 'SubjectType'
+ c_tag = "SubjectType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}BaseID'] = ('base_id',
- BaseID)
- c_cardinality['base_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}NameID'] = ('name_id',
- NameID)
- c_cardinality['name_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID'] = (
- 'encrypted_id', EncryptedID)
- c_cardinality['encrypted_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}SubjectConfirmation'] = (
- 'subject_confirmation', [SubjectConfirmation])
- c_cardinality['subject_confirmation'] = {"min": 0}
- c_child_order.extend(['base_id', 'name_id', 'encrypted_id',
- 'subject_confirmation'])
-
- def __init__(self,
- base_id=None,
- name_id=None,
- encrypted_id=None,
- subject_confirmation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}BaseID"] = ("base_id", BaseID)
+ c_cardinality["base_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}NameID"] = ("name_id", NameID)
+ c_cardinality["name_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID"] = ("encrypted_id", EncryptedID)
+ c_cardinality["encrypted_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}SubjectConfirmation"] = (
+ "subject_confirmation",
+ [SubjectConfirmation],
+ )
+ c_cardinality["subject_confirmation"] = {"min": 0}
+ c_child_order.extend(["base_id", "name_id", "encrypted_id", "subject_confirmation"])
+
+ def __init__(
+ self,
+ base_id=None,
+ name_id=None,
+ encrypted_id=None,
+ subject_confirmation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.base_id = base_id
self.name_id = name_id
self.encrypted_id = encrypted_id
@@ -1518,9 +1421,9 @@ def subject_type__from_string(xml_string):
class Conditions(ConditionsType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Conditions element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Conditions element"""
- c_tag = 'Conditions'
+ c_tag = "Conditions"
c_namespace = NAMESPACE
c_children = ConditionsType_.c_children.copy()
c_attributes = ConditionsType_.c_attributes.copy()
@@ -1533,9 +1436,9 @@ def conditions_from_string(xml_string):
class AuthnStatement(AuthnStatementType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnStatement element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AuthnStatement element"""
- c_tag = 'AuthnStatement'
+ c_tag = "AuthnStatement"
c_namespace = NAMESPACE
c_children = AuthnStatementType_.c_children.copy()
c_attributes = AuthnStatementType_.c_attributes.copy()
@@ -1548,9 +1451,9 @@ def authn_statement_from_string(xml_string):
class AttributeStatement(AttributeStatementType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AttributeStatement element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AttributeStatement element"""
- c_tag = 'AttributeStatement'
+ c_tag = "AttributeStatement"
c_namespace = NAMESPACE
c_children = AttributeStatementType_.c_children.copy()
c_attributes = AttributeStatementType_.c_attributes.copy()
@@ -1563,9 +1466,9 @@ def attribute_statement_from_string(xml_string):
class Subject(SubjectType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Subject element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Subject element"""
- c_tag = 'Subject'
+ c_tag = "Subject"
c_namespace = NAMESPACE
c_children = SubjectType_.c_children.copy()
c_attributes = SubjectType_.c_attributes.copy()
@@ -1577,43 +1480,43 @@ def subject_from_string(xml_string):
return saml2.create_class_from_xml_string(Subject, xml_string)
-#..................
+# ..................
# ['AuthzDecisionStatement', 'EvidenceType', 'AdviceType', 'Evidence',
# 'Assertion', 'AssertionType', 'AuthzDecisionStatementType', 'Advice']
class EvidenceType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:EvidenceType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:EvidenceType element"""
- c_tag = 'EvidenceType'
+ c_tag = "EvidenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AssertionIDRef'] = (
- 'assertion_id_ref', [AssertionIDRef])
- c_cardinality['assertion_id_ref'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AssertionURIRef'] = (
- 'assertion_uri_ref', [AssertionURIRef])
- c_cardinality['assertion_uri_ref'] = {"min": 0}
- c_cardinality['assertion'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAssertion'] = (
- 'encrypted_assertion', [EncryptedAssertion])
- c_cardinality['encrypted_assertion'] = {"min": 0}
- c_child_order.extend(['assertion_id_ref', 'assertion_uri_ref', 'assertion',
- 'encrypted_assertion'])
-
- def __init__(self,
- assertion_id_ref=None,
- assertion_uri_ref=None,
- assertion=None,
- encrypted_assertion=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AssertionIDRef"] = ("assertion_id_ref", [AssertionIDRef])
+ c_cardinality["assertion_id_ref"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AssertionURIRef"] = ("assertion_uri_ref", [AssertionURIRef])
+ c_cardinality["assertion_uri_ref"] = {"min": 0}
+ c_cardinality["assertion"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAssertion"] = (
+ "encrypted_assertion",
+ [EncryptedAssertion],
+ )
+ c_cardinality["encrypted_assertion"] = {"min": 0}
+ c_child_order.extend(["assertion_id_ref", "assertion_uri_ref", "assertion", "encrypted_assertion"])
+
+ def __init__(
+ self,
+ assertion_id_ref=None,
+ assertion_uri_ref=None,
+ assertion=None,
+ encrypted_assertion=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.assertion_id_ref = assertion_id_ref or []
self.assertion_uri_ref = assertion_uri_ref or []
self.assertion = assertion or []
@@ -1625,9 +1528,9 @@ def evidence_type__from_string(xml_string):
class Evidence(EvidenceType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Evidence element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Evidence element"""
- c_tag = 'Evidence'
+ c_tag = "Evidence"
c_namespace = NAMESPACE
c_children = EvidenceType_.c_children.copy()
c_attributes = EvidenceType_.c_attributes.copy()
@@ -1641,35 +1544,35 @@ def evidence_from_string(xml_string):
class AuthzDecisionStatementType_(StatementAbstractType_):
"""The urn:oasis:names:tc:SAML:2.0:assertion:AuthzDecisionStatementType
- element """
+ element"""
- c_tag = 'AuthzDecisionStatementType'
+ c_tag = "AuthzDecisionStatementType"
c_namespace = NAMESPACE
c_children = StatementAbstractType_.c_children.copy()
c_attributes = StatementAbstractType_.c_attributes.copy()
c_child_order = StatementAbstractType_.c_child_order[:]
c_cardinality = StatementAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Action'] = (
- 'action', [Action])
- c_cardinality['action'] = {"min": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Evidence'] = (
- 'evidence', Evidence)
- c_cardinality['evidence'] = {"min": 0, "max": 1}
- c_attributes['Resource'] = ('resource', 'anyURI', True)
- c_attributes['Decision'] = ('decision', DecisionType_, True)
- c_child_order.extend(['action', 'evidence'])
-
- def __init__(self,
- action=None,
- evidence=None,
- resource=None,
- decision=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Action"] = ("action", [Action])
+ c_cardinality["action"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Evidence"] = ("evidence", Evidence)
+ c_cardinality["evidence"] = {"min": 0, "max": 1}
+ c_attributes["Resource"] = ("resource", "anyURI", True)
+ c_attributes["Decision"] = ("decision", DecisionType_, True)
+ c_child_order.extend(["action", "evidence"])
+
+ def __init__(
+ self,
+ action=None,
+ evidence=None,
+ resource=None,
+ decision=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
StatementAbstractType_.__init__(
- self, text=text, extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.action = action or []
self.evidence = evidence
self.resource = resource
@@ -1677,15 +1580,14 @@ class AuthzDecisionStatementType_(StatementAbstractType_):
def authz_decision_statement_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthzDecisionStatementType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthzDecisionStatementType_, xml_string)
class AuthzDecisionStatement(AuthzDecisionStatementType_):
"""The urn:oasis:names:tc:SAML:2.0:assertion:AuthzDecisionStatement
- element """
+ element"""
- c_tag = 'AuthzDecisionStatement'
+ c_tag = "AuthzDecisionStatement"
c_namespace = NAMESPACE
c_children = AuthzDecisionStatementType_.c_children.copy()
c_attributes = AuthzDecisionStatementType_.c_attributes.copy()
@@ -1694,73 +1596,80 @@ class AuthzDecisionStatement(AuthzDecisionStatementType_):
def authz_decision_statement_from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthzDecisionStatement,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthzDecisionStatement, xml_string)
-#..................
+# ..................
# ['Assertion', 'AssertionType', 'AdviceType', 'Advice']
class AssertionType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AssertionType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AssertionType element"""
- c_tag = 'AssertionType'
+ c_tag = "AssertionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Issuer'] = ('issuer',
- Issuer)
- c_children['{http://www.w3.org/2000/09/xmldsig#}Signature'] = ('signature',
- ds.Signature)
- c_cardinality['signature'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Subject'] = ('subject',
- Subject)
- c_cardinality['subject'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Conditions'] = (
- 'conditions', Conditions)
- c_cardinality['conditions'] = {"min": 0, "max": 1}
- c_cardinality['advice'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Statement'] = (
- 'statement', [Statement])
- c_cardinality['statement'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AuthnStatement'] = (
- 'authn_statement', [AuthnStatement])
- c_cardinality['authn_statement'] = {"min": 0}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:assertion}AuthzDecisionStatement'] = (
- 'authz_decision_statement', [AuthzDecisionStatement])
- c_cardinality['authz_decision_statement'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AttributeStatement'] = (
- 'attribute_statement', [AttributeStatement])
- c_cardinality['attribute_statement'] = {"min": 0}
- c_attributes['Version'] = ('version', 'string', True)
- c_attributes['ID'] = ('id', 'ID', True)
- c_attributes['IssueInstant'] = ('issue_instant', 'dateTime', True)
- c_child_order.extend(['issuer', 'signature', 'subject', 'conditions',
- 'advice', 'statement', 'authn_statement',
- 'authz_decision_statement', 'attribute_statement'])
-
- def __init__(self,
- issuer=None,
- signature=None,
- subject=None,
- conditions=None,
- advice=None,
- statement=None,
- authn_statement=None,
- authz_decision_statement=None,
- attribute_statement=None,
- version=None,
- id=None,
- issue_instant=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Issuer"] = ("issuer", Issuer)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Signature"] = ("signature", ds.Signature)
+ c_cardinality["signature"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Subject"] = ("subject", Subject)
+ c_cardinality["subject"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Conditions"] = ("conditions", Conditions)
+ c_cardinality["conditions"] = {"min": 0, "max": 1}
+ c_cardinality["advice"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Statement"] = ("statement", [Statement])
+ c_cardinality["statement"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthnStatement"] = ("authn_statement", [AuthnStatement])
+ c_cardinality["authn_statement"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthzDecisionStatement"] = (
+ "authz_decision_statement",
+ [AuthzDecisionStatement],
+ )
+ c_cardinality["authz_decision_statement"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AttributeStatement"] = (
+ "attribute_statement",
+ [AttributeStatement],
+ )
+ c_cardinality["attribute_statement"] = {"min": 0}
+ c_attributes["Version"] = ("version", "string", True)
+ c_attributes["ID"] = ("id", "ID", True)
+ c_attributes["IssueInstant"] = ("issue_instant", "dateTime", True)
+ c_child_order.extend(
+ [
+ "issuer",
+ "signature",
+ "subject",
+ "conditions",
+ "advice",
+ "statement",
+ "authn_statement",
+ "authz_decision_statement",
+ "attribute_statement",
+ ]
+ )
+
+ def __init__(
+ self,
+ issuer=None,
+ signature=None,
+ subject=None,
+ conditions=None,
+ advice=None,
+ statement=None,
+ authn_statement=None,
+ authz_decision_statement=None,
+ attribute_statement=None,
+ version=None,
+ id=None,
+ issue_instant=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.issuer = issuer
self.signature = signature
self.subject = subject
@@ -1776,16 +1685,13 @@ class AssertionType_(SamlBase):
def verify(self):
# If no statement MUST contain a subject element
- if self.attribute_statement or self.statement or \
- self.authn_statement or self.authz_decision_statement:
+ if self.attribute_statement or self.statement or self.authn_statement or self.authz_decision_statement:
pass
elif not self.subject:
- raise MustValueError(
- "If no statement MUST contain a subject element")
+ raise MustValueError("If no statement MUST contain a subject element")
if self.authn_statement and not self.subject:
- raise MustValueError(
- "An assertion with an AuthnStatement must contain a Subject")
+ raise MustValueError("An assertion with an AuthnStatement must contain a Subject")
return SamlBase.verify(self)
@@ -1795,9 +1701,9 @@ def assertion_type__from_string(xml_string):
class Assertion(AssertionType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Assertion element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Assertion element"""
- c_tag = 'Assertion'
+ c_tag = "Assertion"
c_namespace = NAMESPACE
c_children = AssertionType_.c_children.copy()
c_attributes = AssertionType_.c_attributes.copy()
@@ -1810,42 +1716,41 @@ def assertion_from_string(xml_string):
class AdviceType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:assertion:AdviceType element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:AdviceType element"""
- c_tag = 'AdviceType'
+ c_tag = "AdviceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AssertionIDRef'] = (
- 'assertion_id_ref', [AssertionIDRef])
- c_cardinality['assertion_id_ref'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AssertionURIRef'] = (
- 'assertion_uri_ref', [AssertionURIRef])
- c_cardinality['assertion_uri_ref'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Assertion'] = (
- 'assertion', [Assertion])
- c_cardinality['assertion'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAssertion'] = (
- 'encrypted_assertion', [EncryptedAssertion])
- c_cardinality['encrypted_assertion'] = {"min": 0}
- c_child_order.extend(['assertion_id_ref', 'assertion_uri_ref', 'assertion',
- 'encrypted_assertion'])
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AssertionIDRef"] = ("assertion_id_ref", [AssertionIDRef])
+ c_cardinality["assertion_id_ref"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AssertionURIRef"] = ("assertion_uri_ref", [AssertionURIRef])
+ c_cardinality["assertion_uri_ref"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Assertion"] = ("assertion", [Assertion])
+ c_cardinality["assertion"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAssertion"] = (
+ "encrypted_assertion",
+ [EncryptedAssertion],
+ )
+ c_cardinality["encrypted_assertion"] = {"min": 0}
+ c_child_order.extend(["assertion_id_ref", "assertion_uri_ref", "assertion", "encrypted_assertion"])
c_any = {"namespace": "##other", "processContents": "lax"}
- def __init__(self,
- assertion_id_ref=None,
- assertion_uri_ref=None,
- assertion=None,
- encrypted_assertion=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ def __init__(
+ self,
+ assertion_id_ref=None,
+ assertion_uri_ref=None,
+ assertion=None,
+ encrypted_assertion=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.assertion_id_ref = assertion_id_ref or []
self.assertion_uri_ref = assertion_uri_ref or []
self.assertion = assertion or []
@@ -1857,9 +1762,9 @@ def advice_type__from_string(xml_string):
class Advice(AdviceType_):
- """The urn:oasis:names:tc:SAML:2.0:assertion:Advice element """
+ """The urn:oasis:names:tc:SAML:2.0:assertion:Advice element"""
- c_tag = 'Advice'
+ c_tag = "Advice"
c_namespace = NAMESPACE
c_children = AdviceType_.c_children.copy()
c_attributes = AdviceType_.c_attributes.copy()
@@ -1872,19 +1777,15 @@ def advice_from_string(xml_string):
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-EvidenceType_.c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Assertion'] = (
- 'assertion', [Assertion])
-Evidence.c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Assertion'] = (
- 'assertion', [Assertion])
-AssertionType_.c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Advice'] = (
- 'advice', Advice)
-Assertion.c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Advice'] = (
- 'advice', Advice)
+EvidenceType_.c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Assertion"] = ("assertion", [Assertion])
+Evidence.c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Assertion"] = ("assertion", [Assertion])
+AssertionType_.c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Advice"] = ("advice", Advice)
+Assertion.c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Advice"] = ("advice", Advice)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AG_IDNameQualifiers = [
- ('NameQualifier', 'string', False),
- ('SPNameQualifier', 'string', False),
+ ("NameQualifier", "string", False),
+ ("SPNameQualifier", "string", False),
]
ELEMENT_FROM_STRING = {
@@ -1903,10 +1804,8 @@ ELEMENT_FROM_STRING = {
SubjectConfirmation.c_tag: subject_confirmation_from_string,
SubjectConfirmationType_.c_tag: subject_confirmation_type__from_string,
SubjectConfirmationData.c_tag: subject_confirmation_data_from_string,
- SubjectConfirmationDataType_.c_tag:
- subject_confirmation_data_type__from_string,
- KeyInfoConfirmationDataType_.c_tag:
- key_info_confirmation_data_type__from_string,
+ SubjectConfirmationDataType_.c_tag: subject_confirmation_data_type__from_string,
+ KeyInfoConfirmationDataType_.c_tag: key_info_confirmation_data_type__from_string,
Conditions.c_tag: conditions_from_string,
ConditionsType_.c_tag: conditions_type__from_string,
Condition.c_tag: condition_from_string,
@@ -1932,8 +1831,7 @@ ELEMENT_FROM_STRING = {
AuthnContextDecl.c_tag: authn_context_decl_from_string,
AuthenticatingAuthority.c_tag: authenticating_authority_from_string,
AuthzDecisionStatement.c_tag: authz_decision_statement_from_string,
- AuthzDecisionStatementType_.c_tag:
- authz_decision_statement_type__from_string,
+ AuthzDecisionStatementType_.c_tag: authz_decision_statement_type__from_string,
DecisionType_.c_tag: decision_type__from_string,
Action.c_tag: action_from_string,
ActionType_.c_tag: action_type__from_string,
@@ -1948,63 +1846,63 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'BaseID': BaseID,
- 'NameID': NameID,
- 'NameIDType': NameIDType_,
- 'EncryptedElementType': EncryptedElementType_,
- 'EncryptedID': EncryptedID,
- 'Issuer': Issuer,
- 'AssertionIDRef': AssertionIDRef,
- 'AssertionURIRef': AssertionURIRef,
- 'Assertion': Assertion,
- 'AssertionType': AssertionType_,
- 'Subject': Subject,
- 'SubjectType': SubjectType_,
- 'SubjectConfirmation': SubjectConfirmation,
- 'SubjectConfirmationType': SubjectConfirmationType_,
- 'SubjectConfirmationData': SubjectConfirmationData,
- 'SubjectConfirmationDataType': SubjectConfirmationDataType_,
- 'KeyInfoConfirmationDataType': KeyInfoConfirmationDataType_,
- 'Conditions': Conditions,
- 'ConditionsType': ConditionsType_,
- 'Condition': Condition,
- 'AudienceRestriction': AudienceRestriction,
- 'AudienceRestrictionType': AudienceRestrictionType_,
- 'Audience': Audience,
- 'OneTimeUse': OneTimeUse,
- 'OneTimeUseType': OneTimeUseType_,
- 'ProxyRestriction': ProxyRestriction,
- 'ProxyRestrictionType': ProxyRestrictionType_,
- 'Advice': Advice,
- 'AdviceType': AdviceType_,
- 'EncryptedAssertion': EncryptedAssertion,
- 'Statement': Statement,
- 'AuthnStatement': AuthnStatement,
- 'AuthnStatementType': AuthnStatementType_,
- 'SubjectLocality': SubjectLocality,
- 'SubjectLocalityType': SubjectLocalityType_,
- 'AuthnContext': AuthnContext,
- 'AuthnContextType': AuthnContextType_,
- 'AuthnContextClassRef': AuthnContextClassRef,
- 'AuthnContextDeclRef': AuthnContextDeclRef,
- 'AuthnContextDecl': AuthnContextDecl,
- 'AuthenticatingAuthority': AuthenticatingAuthority,
- 'AuthzDecisionStatement': AuthzDecisionStatement,
- 'AuthzDecisionStatementType': AuthzDecisionStatementType_,
- 'DecisionType': DecisionType_,
- 'Action': Action,
- 'ActionType': ActionType_,
- 'Evidence': Evidence,
- 'EvidenceType': EvidenceType_,
- 'AttributeStatement': AttributeStatement,
- 'AttributeStatementType': AttributeStatementType_,
- 'Attribute': Attribute,
- 'AttributeType': AttributeType_,
- 'AttributeValue': AttributeValue,
- 'EncryptedAttribute': EncryptedAttribute,
- 'BaseIDAbstractType': BaseIDAbstractType_,
- 'ConditionAbstractType': ConditionAbstractType_,
- 'StatementAbstractType': StatementAbstractType_,
+ "BaseID": BaseID,
+ "NameID": NameID,
+ "NameIDType": NameIDType_,
+ "EncryptedElementType": EncryptedElementType_,
+ "EncryptedID": EncryptedID,
+ "Issuer": Issuer,
+ "AssertionIDRef": AssertionIDRef,
+ "AssertionURIRef": AssertionURIRef,
+ "Assertion": Assertion,
+ "AssertionType": AssertionType_,
+ "Subject": Subject,
+ "SubjectType": SubjectType_,
+ "SubjectConfirmation": SubjectConfirmation,
+ "SubjectConfirmationType": SubjectConfirmationType_,
+ "SubjectConfirmationData": SubjectConfirmationData,
+ "SubjectConfirmationDataType": SubjectConfirmationDataType_,
+ "KeyInfoConfirmationDataType": KeyInfoConfirmationDataType_,
+ "Conditions": Conditions,
+ "ConditionsType": ConditionsType_,
+ "Condition": Condition,
+ "AudienceRestriction": AudienceRestriction,
+ "AudienceRestrictionType": AudienceRestrictionType_,
+ "Audience": Audience,
+ "OneTimeUse": OneTimeUse,
+ "OneTimeUseType": OneTimeUseType_,
+ "ProxyRestriction": ProxyRestriction,
+ "ProxyRestrictionType": ProxyRestrictionType_,
+ "Advice": Advice,
+ "AdviceType": AdviceType_,
+ "EncryptedAssertion": EncryptedAssertion,
+ "Statement": Statement,
+ "AuthnStatement": AuthnStatement,
+ "AuthnStatementType": AuthnStatementType_,
+ "SubjectLocality": SubjectLocality,
+ "SubjectLocalityType": SubjectLocalityType_,
+ "AuthnContext": AuthnContext,
+ "AuthnContextType": AuthnContextType_,
+ "AuthnContextClassRef": AuthnContextClassRef,
+ "AuthnContextDeclRef": AuthnContextDeclRef,
+ "AuthnContextDecl": AuthnContextDecl,
+ "AuthenticatingAuthority": AuthenticatingAuthority,
+ "AuthzDecisionStatement": AuthzDecisionStatement,
+ "AuthzDecisionStatementType": AuthzDecisionStatementType_,
+ "DecisionType": DecisionType_,
+ "Action": Action,
+ "ActionType": ActionType_,
+ "Evidence": Evidence,
+ "EvidenceType": EvidenceType_,
+ "AttributeStatement": AttributeStatement,
+ "AttributeStatementType": AttributeStatementType_,
+ "Attribute": Attribute,
+ "AttributeType": AttributeType_,
+ "AttributeValue": AttributeValue,
+ "EncryptedAttribute": EncryptedAttribute,
+ "BaseIDAbstractType": BaseIDAbstractType_,
+ "ConditionAbstractType": ConditionAbstractType_,
+ "StatementAbstractType": StatementAbstractType_,
}
diff --git a/src/saml2/samlp.py b/src/saml2/samlp.py
index 36f23f49..056111da 100644
--- a/src/saml2/samlp.py
+++ b/src/saml2/samlp.py
@@ -5,54 +5,43 @@
#
import saml2
-from saml2 import saml
from saml2 import SamlBase
+from saml2 import saml
from saml2 import xmldsig as ds
-NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:protocol'
-
-STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success'
-STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester'
-STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder'
-STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch'
-
-STATUS_AUTHN_FAILED = 'urn:oasis:names:tc:SAML:2.0:status:AuthnFailed'
-STATUS_INVALID_ATTR_NAME_OR_VALUE = (
- 'urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue')
-STATUS_INVALID_NAMEID_POLICY = (
- 'urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy')
-STATUS_NO_AUTHN_CONTEXT = 'urn:oasis:names:tc:SAML:2.0:status:NoAuthnContext'
-STATUS_NO_AVAILABLE_IDP = 'urn:oasis:names:tc:SAML:2.0:status:NoAvailableIDP'
-STATUS_NO_PASSIVE = 'urn:oasis:names:tc:SAML:2.0:status:NoPassive'
-STATUS_NO_SUPPORTED_IDP = 'urn:oasis:names:tc:SAML:2.0:status:NoSupportedIDP'
-STATUS_PARTIAL_LOGOUT = 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout'
-STATUS_PROXY_COUNT_EXCEEDED = (
- 'urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded')
-STATUS_REQUEST_DENIED = 'urn:oasis:names:tc:SAML:2.0:status:RequestDenied'
-STATUS_REQUEST_UNSUPPORTED = (
- 'urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported')
-STATUS_REQUEST_VERSION_DEPRECATED = (
- 'urn:oasis:names:tc:SAML:2.0:status:RequestVersionDeprecated')
-STATUS_REQUEST_VERSION_TOO_HIGH = (
- 'urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooHigh')
-STATUS_REQUEST_VERSION_TOO_LOW = (
- 'urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooLow')
-STATUS_RESOURCE_NOT_RECOGNIZED = (
- 'urn:oasis:names:tc:SAML:2.0:status:ResourceNotRecognized')
-STATUS_TOO_MANY_RESPONSES = (
- 'urn:oasis:names:tc:SAML:2.0:status:TooManyResponses')
-STATUS_UNKNOWN_ATTR_PROFILE = (
- 'urn:oasis:names:tc:SAML:2.0:status:UnknownAttrProfile')
-STATUS_UNKNOWN_PRINCIPAL = (
- 'urn:oasis:names:tc:SAML:2.0:status:UnknownPrincipal')
-STATUS_UNSUPPORTED_BINDING = (
- 'urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding')
+
+NAMESPACE = "urn:oasis:names:tc:SAML:2.0:protocol"
+
+STATUS_SUCCESS = "urn:oasis:names:tc:SAML:2.0:status:Success"
+STATUS_REQUESTER = "urn:oasis:names:tc:SAML:2.0:status:Requester"
+STATUS_RESPONDER = "urn:oasis:names:tc:SAML:2.0:status:Responder"
+STATUS_VERSION_MISMATCH = "urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"
+
+STATUS_AUTHN_FAILED = "urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"
+STATUS_INVALID_ATTR_NAME_OR_VALUE = "urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue"
+STATUS_INVALID_NAMEID_POLICY = "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"
+STATUS_NO_AUTHN_CONTEXT = "urn:oasis:names:tc:SAML:2.0:status:NoAuthnContext"
+STATUS_NO_AVAILABLE_IDP = "urn:oasis:names:tc:SAML:2.0:status:NoAvailableIDP"
+STATUS_NO_PASSIVE = "urn:oasis:names:tc:SAML:2.0:status:NoPassive"
+STATUS_NO_SUPPORTED_IDP = "urn:oasis:names:tc:SAML:2.0:status:NoSupportedIDP"
+STATUS_PARTIAL_LOGOUT = "urn:oasis:names:tc:SAML:2.0:status:PartialLogout"
+STATUS_PROXY_COUNT_EXCEEDED = "urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded"
+STATUS_REQUEST_DENIED = "urn:oasis:names:tc:SAML:2.0:status:RequestDenied"
+STATUS_REQUEST_UNSUPPORTED = "urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported"
+STATUS_REQUEST_VERSION_DEPRECATED = "urn:oasis:names:tc:SAML:2.0:status:RequestVersionDeprecated"
+STATUS_REQUEST_VERSION_TOO_HIGH = "urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooHigh"
+STATUS_REQUEST_VERSION_TOO_LOW = "urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooLow"
+STATUS_RESOURCE_NOT_RECOGNIZED = "urn:oasis:names:tc:SAML:2.0:status:ResourceNotRecognized"
+STATUS_TOO_MANY_RESPONSES = "urn:oasis:names:tc:SAML:2.0:status:TooManyResponses"
+STATUS_UNKNOWN_ATTR_PROFILE = "urn:oasis:names:tc:SAML:2.0:status:UnknownAttrProfile"
+STATUS_UNKNOWN_PRINCIPAL = "urn:oasis:names:tc:SAML:2.0:status:UnknownPrincipal"
+STATUS_UNSUPPORTED_BINDING = "urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding"
class ExtensionsType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ExtensionsType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ExtensionsType element"""
- c_tag = 'ExtensionsType'
+ c_tag = "ExtensionsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -65,11 +54,11 @@ def extensions_type__from_string(xml_string):
class StatusMessage(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:StatusMessage element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:StatusMessage element"""
- c_tag = 'StatusMessage'
+ c_tag = "StatusMessage"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -81,16 +70,15 @@ def status_message_from_string(xml_string):
class StatusDetailType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:StatusDetailType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:StatusDetailType element"""
- c_tag = 'StatusDetailType'
+ c_tag = "StatusDetailType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_any = {"namespace": "##any", "processContents": "lax", "minOccurs": "0",
- "maxOccurs": "unbounded"}
+ c_any = {"namespace": "##any", "processContents": "lax", "minOccurs": "0", "maxOccurs": "unbounded"}
def status_detail_type__from_string(xml_string):
@@ -99,12 +87,11 @@ def status_detail_type__from_string(xml_string):
class AuthnContextComparisonType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:protocol:AuthnContextComparisonType
- element """
+ element"""
- c_tag = 'AuthnContextComparisonType'
+ c_tag = "AuthnContextComparisonType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string', 'enumeration': ['exact', 'minimum',
- 'maximum', 'better']}
+ c_value_type = {"base": "string", "enumeration": ["exact", "minimum", "maximum", "better"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -112,36 +99,37 @@ class AuthnContextComparisonType_(SamlBase):
def authn_context_comparison_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthnContextComparisonType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthnContextComparisonType_, xml_string)
class NameIDPolicyType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDPolicyType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDPolicyType element"""
- c_tag = 'NameIDPolicyType'
+ c_tag = "NameIDPolicyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Format'] = ('format', 'anyURI', False)
- c_attributes['SPNameQualifier'] = ('sp_name_qualifier', 'string', False)
- c_attributes['AllowCreate'] = ('allow_create', 'boolean', False)
-
- def __init__(self,
- format=None,
- sp_name_qualifier=None,
- allow_create=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_attributes["Format"] = ("format", "anyURI", False)
+ c_attributes["SPNameQualifier"] = ("sp_name_qualifier", "string", False)
+ c_attributes["AllowCreate"] = ("allow_create", "boolean", False)
+
+ def __init__(
+ self,
+ format=None,
+ sp_name_qualifier=None,
+ allow_create=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.format = format
self.sp_name_qualifier = sp_name_qualifier
self.allow_create = allow_create
@@ -152,11 +140,11 @@ def name_id_policy_type__from_string(xml_string):
class RequesterID(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:RequesterID element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:RequesterID element"""
- c_tag = 'RequesterID'
+ c_tag = "RequesterID"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -168,29 +156,24 @@ def requester_id_from_string(xml_string):
class IDPEntryType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:IDPEntryType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:IDPEntryType element"""
- c_tag = 'IDPEntryType'
+ c_tag = "IDPEntryType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['ProviderID'] = ('provider_id', 'anyURI', True)
- c_attributes['Name'] = ('name', 'string', False)
- c_attributes['Loc'] = ('loc', 'anyURI', False)
-
- def __init__(self,
- provider_id=None,
- name=None,
- loc=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_attributes["ProviderID"] = ("provider_id", "anyURI", True)
+ c_attributes["Name"] = ("name", "string", False)
+ c_attributes["Loc"] = ("loc", "anyURI", False)
+
+ def __init__(
+ self, provider_id=None, name=None, loc=None, text=None, extension_elements=None, extension_attributes=None
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.provider_id = provider_id
self.name = name
self.loc = loc
@@ -201,11 +184,11 @@ def idp_entry_type__from_string(xml_string):
class GetComplete(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:GetComplete element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:GetComplete element"""
- c_tag = 'GetComplete'
+ c_tag = "GetComplete"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -217,11 +200,11 @@ def get_complete_from_string(xml_string):
class Artifact(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:Artifact element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:Artifact element"""
- c_tag = 'Artifact'
+ c_tag = "Artifact"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -233,11 +216,11 @@ def artifact_from_string(xml_string):
class NewID(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:NewID element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:NewID element"""
- c_tag = 'NewID'
+ c_tag = "NewID"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -249,9 +232,9 @@ def new_id_from_string(xml_string):
class NewEncryptedID(saml.EncryptedElementType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:NewEncryptedID element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:NewEncryptedID element"""
- c_tag = 'NewEncryptedID'
+ c_tag = "NewEncryptedID"
c_namespace = NAMESPACE
c_children = saml.EncryptedElementType_.c_children.copy()
c_attributes = saml.EncryptedElementType_.c_attributes.copy()
@@ -264,9 +247,9 @@ def new_encrypted_id_from_string(xml_string):
class TerminateType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:TerminateType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:TerminateType element"""
- c_tag = 'TerminateType'
+ c_tag = "TerminateType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -279,11 +262,11 @@ def terminate_type__from_string(xml_string):
class SessionIndex(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:SessionIndex element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:SessionIndex element"""
- c_tag = 'SessionIndex'
+ c_tag = "SessionIndex"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -295,9 +278,9 @@ def session_index_from_string(xml_string):
class Extensions(ExtensionsType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:Extensions element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:Extensions element"""
- c_tag = 'Extensions'
+ c_tag = "Extensions"
c_namespace = NAMESPACE
c_children = ExtensionsType_.c_children.copy()
c_attributes = ExtensionsType_.c_attributes.copy()
@@ -310,9 +293,9 @@ def extensions_from_string(xml_string):
class StatusDetail(StatusDetailType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:StatusDetail element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:StatusDetail element"""
- c_tag = 'StatusDetail'
+ c_tag = "StatusDetail"
c_namespace = NAMESPACE
c_children = StatusDetailType_.c_children.copy()
c_attributes = StatusDetailType_.c_attributes.copy()
@@ -325,46 +308,44 @@ def status_detail_from_string(xml_string):
class RequestAbstractType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:RequestAbstractType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:RequestAbstractType element"""
- c_tag = 'RequestAbstractType'
+ c_tag = "RequestAbstractType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Issuer'] = ('issuer',
- saml.Issuer)
- c_cardinality['issuer'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}Signature'] = ('signature',
- ds.Signature)
- c_cardinality['signature'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}Extensions'] = (
- 'extensions', Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_attributes['ID'] = ('id', 'ID', True)
- c_attributes['Version'] = ('version', 'string', True)
- c_attributes['IssueInstant'] = ('issue_instant', 'dateTime', True)
- c_attributes['Destination'] = ('destination', 'anyURI', False)
- c_attributes['Consent'] = ('consent', 'anyURI', False)
- c_child_order.extend(['issuer', 'signature', 'extensions'])
-
- def __init__(self,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Issuer"] = ("issuer", saml.Issuer)
+ c_cardinality["issuer"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Signature"] = ("signature", ds.Signature)
+ c_cardinality["signature"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_attributes["ID"] = ("id", "ID", True)
+ c_attributes["Version"] = ("version", "string", True)
+ c_attributes["IssueInstant"] = ("issue_instant", "dateTime", True)
+ c_attributes["Destination"] = ("destination", "anyURI", False)
+ c_attributes["Consent"] = ("consent", "anyURI", False)
+ c_child_order.extend(["issuer", "signature", "extensions"])
+
+ def __init__(
+ self,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.issuer = issuer
self.signature = signature
self.extensions = extensions
@@ -380,48 +361,50 @@ class AssertionIDRequestType_(RequestAbstractType_):
The urn:oasis:names:tc:SAML:2.0:protocol:AssertionIDRequestType element
"""
- c_tag = 'AssertionIDRequestType'
+ c_tag = "AssertionIDRequestType"
c_namespace = NAMESPACE
c_children = RequestAbstractType_.c_children.copy()
c_attributes = RequestAbstractType_.c_attributes.copy()
c_child_order = RequestAbstractType_.c_child_order[:]
c_cardinality = RequestAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AssertionIDRef'] = (
- 'assertion_id_ref', [saml.AssertionIDRef])
- c_cardinality['assertion_id_ref'] = {"min": 1}
- c_child_order.extend(['assertion_id_ref'])
-
- def __init__(self,
- assertion_id_ref=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- RequestAbstractType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AssertionIDRef"] = ("assertion_id_ref", [saml.AssertionIDRef])
+ c_cardinality["assertion_id_ref"] = {"min": 1}
+ c_child_order.extend(["assertion_id_ref"])
+
+ def __init__(
+ self,
+ assertion_id_ref=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ RequestAbstractType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.assertion_id_ref = assertion_id_ref or []
def assertion_id_request_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AssertionIDRequestType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AssertionIDRequestType_, xml_string)
class SubjectQueryAbstractType_(RequestAbstractType_):
@@ -429,130 +412,135 @@ class SubjectQueryAbstractType_(RequestAbstractType_):
The urn:oasis:names:tc:SAML:2.0:protocol:SubjectQueryAbstractType element
"""
- c_tag = 'SubjectQueryAbstractType'
+ c_tag = "SubjectQueryAbstractType"
c_namespace = NAMESPACE
c_children = RequestAbstractType_.c_children.copy()
c_attributes = RequestAbstractType_.c_attributes.copy()
c_child_order = RequestAbstractType_.c_child_order[:]
c_cardinality = RequestAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Subject'] = (
- 'subject', saml.Subject)
- c_child_order.extend(['subject'])
-
- def __init__(self,
- subject=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- RequestAbstractType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Subject"] = ("subject", saml.Subject)
+ c_child_order.extend(["subject"])
+
+ def __init__(
+ self,
+ subject=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ RequestAbstractType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.subject = subject
class RequestedAuthnContextType_(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:protocol:RequestedAuthnContextType
- element """
+ element"""
- c_tag = 'RequestedAuthnContextType'
+ c_tag = "RequestedAuthnContextType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextClassRef'] = (
- 'authn_context_class_ref',
- [saml.AuthnContextClassRef])
- c_cardinality['authn_context_class_ref'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextDeclRef'] = (
- 'authn_context_decl_ref',
- [saml.AuthnContextDeclRef])
- c_cardinality['authn_context_decl_ref'] = {"min": 0}
- c_attributes['Comparison'] = ('comparison', AuthnContextComparisonType_,
- False)
- c_child_order.extend(['authn_context_class_ref', 'authn_context_decl_ref'])
-
- def __init__(self,
- authn_context_class_ref=None,
- authn_context_decl_ref=None,
- comparison=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextClassRef"] = (
+ "authn_context_class_ref",
+ [saml.AuthnContextClassRef],
+ )
+ c_cardinality["authn_context_class_ref"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextDeclRef"] = (
+ "authn_context_decl_ref",
+ [saml.AuthnContextDeclRef],
+ )
+ c_cardinality["authn_context_decl_ref"] = {"min": 0}
+ c_attributes["Comparison"] = ("comparison", AuthnContextComparisonType_, False)
+ c_child_order.extend(["authn_context_class_ref", "authn_context_decl_ref"])
+
+ def __init__(
+ self,
+ authn_context_class_ref=None,
+ authn_context_decl_ref=None,
+ comparison=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.authn_context_class_ref = authn_context_class_ref or []
self.authn_context_decl_ref = authn_context_decl_ref or []
self.comparison = comparison
def requested_authn_context_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(RequestedAuthnContextType_,
- xml_string)
+ return saml2.create_class_from_xml_string(RequestedAuthnContextType_, xml_string)
class AttributeQueryType_(SubjectQueryAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AttributeQueryType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AttributeQueryType element"""
- c_tag = 'AttributeQueryType'
+ c_tag = "AttributeQueryType"
c_namespace = NAMESPACE
c_children = SubjectQueryAbstractType_.c_children.copy()
c_attributes = SubjectQueryAbstractType_.c_attributes.copy()
c_child_order = SubjectQueryAbstractType_.c_child_order[:]
c_cardinality = SubjectQueryAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Attribute'] = (
- 'attribute',
- [saml.Attribute])
- c_cardinality['attribute'] = {"min": 0}
- c_child_order.extend(['attribute'])
-
- def __init__(self,
- attribute=None,
- subject=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SubjectQueryAbstractType_.__init__(self,
- subject=subject,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Attribute"] = ("attribute", [saml.Attribute])
+ c_cardinality["attribute"] = {"min": 0}
+ c_child_order.extend(["attribute"])
+
+ def __init__(
+ self,
+ attribute=None,
+ subject=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SubjectQueryAbstractType_.__init__(
+ self,
+ subject=subject,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.attribute = attribute or []
@@ -562,66 +550,67 @@ def attribute_query_type__from_string(xml_string):
class AuthzDecisionQueryType_(SubjectQueryAbstractType_):
"""The urn:oasis:names:tc:SAML:2.0:protocol:AuthzDecisionQueryType
- element """
+ element"""
- c_tag = 'AuthzDecisionQueryType'
+ c_tag = "AuthzDecisionQueryType"
c_namespace = NAMESPACE
c_children = SubjectQueryAbstractType_.c_children.copy()
c_attributes = SubjectQueryAbstractType_.c_attributes.copy()
c_child_order = SubjectQueryAbstractType_.c_child_order[:]
c_cardinality = SubjectQueryAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Action'] = (
- 'action', [saml.Action])
- c_cardinality['action'] = {"min": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Evidence'] = (
- 'evidence', saml.Evidence)
- c_cardinality['evidence'] = {"min": 0, "max": 1}
- c_attributes['Resource'] = ('resource', 'anyURI', True)
- c_child_order.extend(['action', 'evidence'])
-
- def __init__(self,
- action=None,
- evidence=None,
- resource=None,
- subject=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SubjectQueryAbstractType_.__init__(self,
- subject=subject,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Action"] = ("action", [saml.Action])
+ c_cardinality["action"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Evidence"] = ("evidence", saml.Evidence)
+ c_cardinality["evidence"] = {"min": 0, "max": 1}
+ c_attributes["Resource"] = ("resource", "anyURI", True)
+ c_child_order.extend(["action", "evidence"])
+
+ def __init__(
+ self,
+ action=None,
+ evidence=None,
+ resource=None,
+ subject=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SubjectQueryAbstractType_.__init__(
+ self,
+ subject=subject,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.action = action or []
self.evidence = evidence
self.resource = resource
def authz_decision_query_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(AuthzDecisionQueryType_,
- xml_string)
+ return saml2.create_class_from_xml_string(AuthzDecisionQueryType_, xml_string)
class NameIDPolicy(NameIDPolicyType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDPolicy element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDPolicy element"""
- c_tag = 'NameIDPolicy'
+ c_tag = "NameIDPolicy"
c_namespace = NAMESPACE
c_children = NameIDPolicyType_.c_children.copy()
c_attributes = NameIDPolicyType_.c_attributes.copy()
@@ -634,9 +623,9 @@ def name_id_policy_from_string(xml_string):
class IDPEntry(IDPEntryType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:IDPEntry element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:IDPEntry element"""
- c_tag = 'IDPEntry'
+ c_tag = "IDPEntry"
c_namespace = NAMESPACE
c_children = IDPEntryType_.c_children.copy()
c_attributes = IDPEntryType_.c_attributes.copy()
@@ -649,43 +638,46 @@ def idp_entry_from_string(xml_string):
class ArtifactResolveType_(RequestAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResolveType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResolveType element"""
- c_tag = 'ArtifactResolveType'
+ c_tag = "ArtifactResolveType"
c_namespace = NAMESPACE
c_children = RequestAbstractType_.c_children.copy()
c_attributes = RequestAbstractType_.c_attributes.copy()
c_child_order = RequestAbstractType_.c_child_order[:]
c_cardinality = RequestAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}Artifact'] = ('artifact',
- Artifact)
- c_child_order.extend(['artifact'])
-
- def __init__(self,
- artifact=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- RequestAbstractType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}Artifact"] = ("artifact", Artifact)
+ c_child_order.extend(["artifact"])
+
+ def __init__(
+ self,
+ artifact=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ RequestAbstractType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.artifact = artifact
@@ -694,9 +686,9 @@ def artifact_resolve_type__from_string(xml_string):
class Terminate(TerminateType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:Terminate element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:Terminate element"""
- c_tag = 'Terminate'
+ c_tag = "Terminate"
c_namespace = NAMESPACE
c_children = TerminateType_.c_children.copy()
c_attributes = TerminateType_.c_attributes.copy()
@@ -709,61 +701,60 @@ def terminate_from_string(xml_string):
class LogoutRequestType_(RequestAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:LogoutRequestType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:LogoutRequestType element"""
- c_tag = 'LogoutRequestType'
+ c_tag = "LogoutRequestType"
c_namespace = NAMESPACE
c_children = RequestAbstractType_.c_children.copy()
c_attributes = RequestAbstractType_.c_attributes.copy()
c_child_order = RequestAbstractType_.c_child_order[:]
c_cardinality = RequestAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}BaseID'] = (
- 'base_id', saml.BaseID)
- c_cardinality['base_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}NameID'] = (
- 'name_id', saml.NameID)
- c_cardinality['name_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID'] = (
- 'encrypted_id', saml.EncryptedID)
- c_cardinality['encrypted_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}SessionIndex'] = (
- 'session_index', [SessionIndex])
- c_cardinality['session_index'] = {"min": 0}
- c_attributes['Reason'] = ('reason', 'string', False)
- c_attributes['NotOnOrAfter'] = ('not_on_or_after', 'dateTime', False)
- c_child_order.extend(
- ['base_id', 'name_id', 'encrypted_id', 'session_index'])
-
- def __init__(self,
- base_id=None,
- name_id=None,
- encrypted_id=None,
- session_index=None,
- reason=None,
- not_on_or_after=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- RequestAbstractType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}BaseID"] = ("base_id", saml.BaseID)
+ c_cardinality["base_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}NameID"] = ("name_id", saml.NameID)
+ c_cardinality["name_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID"] = ("encrypted_id", saml.EncryptedID)
+ c_cardinality["encrypted_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}SessionIndex"] = ("session_index", [SessionIndex])
+ c_cardinality["session_index"] = {"min": 0}
+ c_attributes["Reason"] = ("reason", "string", False)
+ c_attributes["NotOnOrAfter"] = ("not_on_or_after", "dateTime", False)
+ c_child_order.extend(["base_id", "name_id", "encrypted_id", "session_index"])
+
+ def __init__(
+ self,
+ base_id=None,
+ name_id=None,
+ encrypted_id=None,
+ session_index=None,
+ reason=None,
+ not_on_or_after=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ RequestAbstractType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.base_id = base_id
self.name_id = name_id
self.encrypted_id = encrypted_id
@@ -778,56 +769,55 @@ def logout_request_type__from_string(xml_string):
class NameIDMappingRequestType_(RequestAbstractType_):
"""The urn:oasis:names:tc:SAML:2.0:protocol:NameIDMappingRequestType
- element """
+ element"""
- c_tag = 'NameIDMappingRequestType'
+ c_tag = "NameIDMappingRequestType"
c_namespace = NAMESPACE
c_children = RequestAbstractType_.c_children.copy()
c_attributes = RequestAbstractType_.c_attributes.copy()
c_child_order = RequestAbstractType_.c_child_order[:]
c_cardinality = RequestAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}BaseID'] = (
- 'base_id', saml.BaseID)
- c_cardinality['base_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}NameID'] = (
- 'name_id', saml.NameID)
- c_cardinality['name_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID'] = (
- 'encrypted_id', saml.EncryptedID)
- c_cardinality['encrypted_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}NameIDPolicy'] = (
- 'name_id_policy', NameIDPolicy)
- c_child_order.extend(
- ['base_id', 'name_id', 'encrypted_id', 'name_id_policy'])
-
- def __init__(self,
- base_id=None,
- name_id=None,
- encrypted_id=None,
- name_id_policy=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- RequestAbstractType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}BaseID"] = ("base_id", saml.BaseID)
+ c_cardinality["base_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}NameID"] = ("name_id", saml.NameID)
+ c_cardinality["name_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID"] = ("encrypted_id", saml.EncryptedID)
+ c_cardinality["encrypted_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}NameIDPolicy"] = ("name_id_policy", NameIDPolicy)
+ c_child_order.extend(["base_id", "name_id", "encrypted_id", "name_id_policy"])
+
+ def __init__(
+ self,
+ base_id=None,
+ name_id=None,
+ encrypted_id=None,
+ name_id_policy=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ RequestAbstractType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.base_id = base_id
self.name_id = name_id
self.encrypted_id = encrypted_id
@@ -835,14 +825,13 @@ class NameIDMappingRequestType_(RequestAbstractType_):
def name_id_mapping_request_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(NameIDMappingRequestType_,
- xml_string)
+ return saml2.create_class_from_xml_string(NameIDMappingRequestType_, xml_string)
class AssertionIDRequest(AssertionIDRequestType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AssertionIDRequest element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AssertionIDRequest element"""
- c_tag = 'AssertionIDRequest'
+ c_tag = "AssertionIDRequest"
c_namespace = NAMESPACE
c_children = AssertionIDRequestType_.c_children.copy()
c_attributes = AssertionIDRequestType_.c_attributes.copy()
@@ -855,9 +844,9 @@ def assertion_id_request_from_string(xml_string):
class SubjectQuery(SubjectQueryAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:SubjectQuery element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:SubjectQuery element"""
- c_tag = 'SubjectQuery'
+ c_tag = "SubjectQuery"
c_namespace = NAMESPACE
c_children = SubjectQueryAbstractType_.c_children.copy()
c_attributes = SubjectQueryAbstractType_.c_attributes.copy()
@@ -874,7 +863,7 @@ class RequestedAuthnContext(RequestedAuthnContextType_):
The urn:oasis:names:tc:SAML:2.0:protocol:RequestedAuthnContext element
"""
- c_tag = 'RequestedAuthnContext'
+ c_tag = "RequestedAuthnContext"
c_namespace = NAMESPACE
c_children = RequestedAuthnContextType_.c_children.copy()
c_attributes = RequestedAuthnContextType_.c_attributes.copy()
@@ -887,9 +876,9 @@ def requested_authn_context_from_string(xml_string):
class AttributeQuery(AttributeQueryType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AttributeQuery element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AttributeQuery element"""
- c_tag = 'AttributeQuery'
+ c_tag = "AttributeQuery"
c_namespace = NAMESPACE
c_children = AttributeQueryType_.c_children.copy()
c_attributes = AttributeQueryType_.c_attributes.copy()
@@ -902,9 +891,9 @@ def attribute_query_from_string(xml_string):
class AuthzDecisionQuery(AuthzDecisionQueryType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AuthzDecisionQuery element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AuthzDecisionQuery element"""
- c_tag = 'AuthzDecisionQuery'
+ c_tag = "AuthzDecisionQuery"
c_namespace = NAMESPACE
c_children = AuthzDecisionQueryType_.c_children.copy()
c_attributes = AuthzDecisionQueryType_.c_attributes.copy()
@@ -917,32 +906,26 @@ def authz_decision_query_from_string(xml_string):
class IDPListType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:IDPListType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:IDPListType element"""
- c_tag = 'IDPListType'
+ c_tag = "IDPListType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}IDPEntry'] = (
- 'idp_entry', [IDPEntry])
- c_cardinality['idp_entry'] = {"min": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}GetComplete'] = (
- 'get_complete', GetComplete)
- c_cardinality['get_complete'] = {"min": 0, "max": 1}
- c_child_order.extend(['idp_entry', 'get_complete'])
-
- def __init__(self,
- idp_entry=None,
- get_complete=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}IDPEntry"] = ("idp_entry", [IDPEntry])
+ c_cardinality["idp_entry"] = {"min": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}GetComplete"] = ("get_complete", GetComplete)
+ c_cardinality["get_complete"] = {"min": 0, "max": 1}
+ c_child_order.extend(["idp_entry", "get_complete"])
+
+ def __init__(
+ self, idp_entry=None, get_complete=None, text=None, extension_elements=None, extension_attributes=None
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.idp_entry = idp_entry or []
self.get_complete = get_complete
@@ -952,9 +935,9 @@ def idp_list_type__from_string(xml_string):
class ArtifactResolve(ArtifactResolveType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResolve element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResolve element"""
- c_tag = 'ArtifactResolve'
+ c_tag = "ArtifactResolve"
c_namespace = NAMESPACE
c_children = ArtifactResolveType_.c_children.copy()
c_attributes = ArtifactResolveType_.c_attributes.copy()
@@ -971,62 +954,57 @@ class ManageNameIDRequestType_(RequestAbstractType_):
The urn:oasis:names:tc:SAML:2.0:protocol:ManageNameIDRequestType element
"""
- c_tag = 'ManageNameIDRequestType'
+ c_tag = "ManageNameIDRequestType"
c_namespace = NAMESPACE
c_children = RequestAbstractType_.c_children.copy()
c_attributes = RequestAbstractType_.c_attributes.copy()
c_child_order = RequestAbstractType_.c_child_order[:]
c_cardinality = RequestAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}NameID'] = ('name_id',
- saml.NameID)
- c_cardinality['name_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID'] = (
- 'encrypted_id',
- saml.EncryptedID)
- c_cardinality['encrypted_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}NewID'] = ('new_id',
- NewID)
- c_cardinality['new_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}NewEncryptedID'] = (
- 'new_encrypted_id',
- NewEncryptedID)
- c_cardinality['new_encrypted_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}Terminate'] = (
- 'terminate',
- Terminate)
- c_cardinality['terminate'] = {"min": 0, "max": 1}
- c_child_order.extend(['name_id', 'encrypted_id', 'new_id',
- 'new_encrypted_id', 'terminate'])
-
- def __init__(self,
- name_id=None,
- encrypted_id=None,
- new_id=None,
- new_encrypted_id=None,
- terminate=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- RequestAbstractType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}NameID"] = ("name_id", saml.NameID)
+ c_cardinality["name_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID"] = ("encrypted_id", saml.EncryptedID)
+ c_cardinality["encrypted_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}NewID"] = ("new_id", NewID)
+ c_cardinality["new_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}NewEncryptedID"] = ("new_encrypted_id", NewEncryptedID)
+ c_cardinality["new_encrypted_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}Terminate"] = ("terminate", Terminate)
+ c_cardinality["terminate"] = {"min": 0, "max": 1}
+ c_child_order.extend(["name_id", "encrypted_id", "new_id", "new_encrypted_id", "terminate"])
+
+ def __init__(
+ self,
+ name_id=None,
+ encrypted_id=None,
+ new_id=None,
+ new_encrypted_id=None,
+ terminate=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ RequestAbstractType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.name_id = name_id
self.encrypted_id = encrypted_id
self.new_id = new_id
@@ -1035,14 +1013,13 @@ class ManageNameIDRequestType_(RequestAbstractType_):
def manage_name_id_request_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(ManageNameIDRequestType_,
- xml_string)
+ return saml2.create_class_from_xml_string(ManageNameIDRequestType_, xml_string)
class LogoutRequest(LogoutRequestType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:LogoutRequest element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:LogoutRequest element"""
- c_tag = 'LogoutRequest'
+ c_tag = "LogoutRequest"
c_namespace = NAMESPACE
c_children = LogoutRequestType_.c_children.copy()
c_attributes = LogoutRequestType_.c_attributes.copy()
@@ -1055,9 +1032,9 @@ def logout_request_from_string(xml_string):
class NameIDMappingRequest(NameIDMappingRequestType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDMappingRequest element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDMappingRequest element"""
- c_tag = 'NameIDMappingRequest'
+ c_tag = "NameIDMappingRequest"
c_namespace = NAMESPACE
c_children = NameIDMappingRequestType_.c_children.copy()
c_attributes = NameIDMappingRequestType_.c_attributes.copy()
@@ -1070,37 +1047,39 @@ def name_id_mapping_request_from_string(xml_string):
class AuthnQueryType_(SubjectQueryAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnQueryType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnQueryType element"""
- c_tag = 'AuthnQueryType'
+ c_tag = "AuthnQueryType"
c_namespace = NAMESPACE
c_children = SubjectQueryAbstractType_.c_children.copy()
c_attributes = SubjectQueryAbstractType_.c_attributes.copy()
c_child_order = SubjectQueryAbstractType_.c_child_order[:]
c_cardinality = SubjectQueryAbstractType_.c_cardinality.copy()
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:protocol}RequestedAuthnContext'] = (
- 'requested_authn_context',
- RequestedAuthnContext)
- c_cardinality['requested_authn_context'] = {"min": 0, "max": 1}
- c_attributes['SessionIndex'] = ('session_index', 'string', False)
- c_child_order.extend(['requested_authn_context'])
-
- def __init__(self,
- requested_authn_context=None,
- session_index=None,
- subject=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}RequestedAuthnContext"] = (
+ "requested_authn_context",
+ RequestedAuthnContext,
+ )
+ c_cardinality["requested_authn_context"] = {"min": 0, "max": 1}
+ c_attributes["SessionIndex"] = ("session_index", "string", False)
+ c_child_order.extend(["requested_authn_context"])
+
+ def __init__(
+ self,
+ requested_authn_context=None,
+ session_index=None,
+ subject=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
SubjectQueryAbstractType_.__init__(
self,
subject=subject,
@@ -1114,7 +1093,8 @@ class AuthnQueryType_(SubjectQueryAbstractType_):
consent=consent,
text=text,
extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ extension_attributes=extension_attributes,
+ )
self.requested_authn_context = requested_authn_context
self.session_index = session_index
@@ -1124,9 +1104,9 @@ def authn_query_type__from_string(xml_string):
class IDPList(IDPListType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:IDPList element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:IDPList element"""
- c_tag = 'IDPList'
+ c_tag = "IDPList"
c_namespace = NAMESPACE
c_children = IDPListType_.c_children.copy()
c_attributes = IDPListType_.c_attributes.copy()
@@ -1139,9 +1119,9 @@ def idp_list_from_string(xml_string):
class ManageNameIDRequest(ManageNameIDRequestType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ManageNameIDRequest element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ManageNameIDRequest element"""
- c_tag = 'ManageNameIDRequest'
+ c_tag = "ManageNameIDRequest"
c_namespace = NAMESPACE
c_children = ManageNameIDRequestType_.c_children.copy()
c_attributes = ManageNameIDRequestType_.c_attributes.copy()
@@ -1154,9 +1134,9 @@ def manage_name_id_request_from_string(xml_string):
class AuthnQuery(AuthnQueryType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnQuery element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnQuery element"""
- c_tag = 'AuthnQuery'
+ c_tag = "AuthnQuery"
c_namespace = NAMESPACE
c_children = AuthnQueryType_.c_children.copy()
c_attributes = AuthnQueryType_.c_attributes.copy()
@@ -1169,34 +1149,33 @@ def authn_query_from_string(xml_string):
class ScopingType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ScopingType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ScopingType element"""
- c_tag = 'ScopingType'
+ c_tag = "ScopingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}IDPList'] = (
- 'idp_list', IDPList)
- c_cardinality['idp_list'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}RequesterID'] = (
- 'requester_id', [RequesterID])
- c_cardinality['requester_id'] = {"min": 0}
- c_attributes['ProxyCount'] = ('proxy_count', 'nonNegativeInteger', False)
- c_child_order.extend(['idp_list', 'requester_id'])
-
- def __init__(self,
- idp_list=None,
- requester_id=None,
- proxy_count=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}IDPList"] = ("idp_list", IDPList)
+ c_cardinality["idp_list"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}RequesterID"] = ("requester_id", [RequesterID])
+ c_cardinality["requester_id"] = {"min": 0}
+ c_attributes["ProxyCount"] = ("proxy_count", "nonNegativeInteger", False)
+ c_child_order.extend(["idp_list", "requester_id"])
+
+ def __init__(
+ self,
+ idp_list=None,
+ requester_id=None,
+ proxy_count=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.idp_list = idp_list
self.requester_id = requester_id or []
self.proxy_count = proxy_count
@@ -1207,9 +1186,9 @@ def scoping_type__from_string(xml_string):
class Scoping(ScopingType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:Scoping element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:Scoping element"""
- c_tag = 'Scoping'
+ c_tag = "Scoping"
c_namespace = NAMESPACE
c_children = ScopingType_.c_children.copy()
c_attributes = ScopingType_.c_attributes.copy()
@@ -1222,79 +1201,76 @@ def scoping_from_string(xml_string):
class AuthnRequestType_(RequestAbstractType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnRequestType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnRequestType element"""
- c_tag = 'AuthnRequestType'
+ c_tag = "AuthnRequestType"
c_namespace = NAMESPACE
c_children = RequestAbstractType_.c_children.copy()
c_attributes = RequestAbstractType_.c_attributes.copy()
c_child_order = RequestAbstractType_.c_child_order[:]
c_cardinality = RequestAbstractType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Subject'] = (
- 'subject', saml.Subject)
- c_cardinality['subject'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}NameIDPolicy'] = (
- 'name_id_policy', NameIDPolicy)
- c_cardinality['name_id_policy'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Conditions'] = (
- 'conditions', saml.Conditions)
- c_cardinality['conditions'] = {"min": 0, "max": 1}
- c_children[
- '{urn:oasis:names:tc:SAML:2.0:protocol}RequestedAuthnContext'] = (
- 'requested_authn_context', RequestedAuthnContext)
- c_cardinality['requested_authn_context'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}Scoping'] = (
- 'scoping', Scoping)
- c_cardinality['scoping'] = {"min": 0, "max": 1}
- c_attributes['ForceAuthn'] = ('force_authn', 'boolean', False)
- c_attributes['IsPassive'] = ('is_passive', 'boolean', False)
- c_attributes['ProtocolBinding'] = ('protocol_binding', 'anyURI', False)
- c_attributes['AssertionConsumerServiceIndex'] = (
- 'assertion_consumer_service_index', 'unsignedShort', False)
- c_attributes['AssertionConsumerServiceURL'] = (
- 'assertion_consumer_service_url', 'anyURI', False)
- c_attributes['AttributeConsumingServiceIndex'] = (
- 'attribute_consuming_service_index', 'unsignedShort', False)
- c_attributes['ProviderName'] = ('provider_name', 'string', False)
- c_child_order.extend(['subject', 'name_id_policy', 'conditions',
- 'requested_authn_context', 'scoping'])
-
- def __init__(self,
- subject=None,
- name_id_policy=None,
- conditions=None,
- requested_authn_context=None,
- scoping=None,
- force_authn=None,
- is_passive=None,
- protocol_binding=None,
- assertion_consumer_service_index=None,
- assertion_consumer_service_url=None,
- attribute_consuming_service_index=None,
- provider_name=None,
- issuer=None,
- signature=None,
- extensions=None,
- id=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- RequestAbstractType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- id=id,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Subject"] = ("subject", saml.Subject)
+ c_cardinality["subject"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}NameIDPolicy"] = ("name_id_policy", NameIDPolicy)
+ c_cardinality["name_id_policy"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Conditions"] = ("conditions", saml.Conditions)
+ c_cardinality["conditions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}RequestedAuthnContext"] = (
+ "requested_authn_context",
+ RequestedAuthnContext,
+ )
+ c_cardinality["requested_authn_context"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}Scoping"] = ("scoping", Scoping)
+ c_cardinality["scoping"] = {"min": 0, "max": 1}
+ c_attributes["ForceAuthn"] = ("force_authn", "boolean", False)
+ c_attributes["IsPassive"] = ("is_passive", "boolean", False)
+ c_attributes["ProtocolBinding"] = ("protocol_binding", "anyURI", False)
+ c_attributes["AssertionConsumerServiceIndex"] = ("assertion_consumer_service_index", "unsignedShort", False)
+ c_attributes["AssertionConsumerServiceURL"] = ("assertion_consumer_service_url", "anyURI", False)
+ c_attributes["AttributeConsumingServiceIndex"] = ("attribute_consuming_service_index", "unsignedShort", False)
+ c_attributes["ProviderName"] = ("provider_name", "string", False)
+ c_child_order.extend(["subject", "name_id_policy", "conditions", "requested_authn_context", "scoping"])
+
+ def __init__(
+ self,
+ subject=None,
+ name_id_policy=None,
+ conditions=None,
+ requested_authn_context=None,
+ scoping=None,
+ force_authn=None,
+ is_passive=None,
+ protocol_binding=None,
+ assertion_consumer_service_index=None,
+ assertion_consumer_service_url=None,
+ attribute_consuming_service_index=None,
+ provider_name=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ id=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ RequestAbstractType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ id=id,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.subject = subject
self.name_id_policy = name_id_policy
self.conditions = conditions
@@ -1305,8 +1281,7 @@ class AuthnRequestType_(RequestAbstractType_):
self.protocol_binding = protocol_binding
self.assertion_consumer_service_index = assertion_consumer_service_index
self.assertion_consumer_service_url = assertion_consumer_service_url
- self.attribute_consuming_service_index = \
- attribute_consuming_service_index
+ self.attribute_consuming_service_index = attribute_consuming_service_index
self.provider_name = provider_name
@@ -1315,9 +1290,9 @@ def authn_request_type__from_string(xml_string):
class AuthnRequest(AuthnRequestType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnRequest element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:AuthnRequest element"""
- c_tag = 'AuthnRequest'
+ c_tag = "AuthnRequest"
c_namespace = NAMESPACE
c_children = AuthnRequestType_.c_children.copy()
c_attributes = AuthnRequestType_.c_attributes.copy()
@@ -1330,9 +1305,9 @@ def authn_request_from_string(xml_string):
class StatusType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:StatusType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:StatusType element"""
- c_tag = 'StatusType'
+ c_tag = "StatusType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
@@ -1341,25 +1316,24 @@ class StatusType_(SamlBase):
# Added further down to avoid undefined references
# c_children['{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode'] = (
# 'status_code', StatusCode)
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}StatusMessage'] = (
- 'status_message', StatusMessage)
- c_cardinality['status_message'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}StatusDetail'] = (
- 'status_detail', StatusDetail)
- c_cardinality['status_detail'] = {"min": 0, "max": 1}
- c_child_order.extend(['status_code', 'status_message', 'status_detail'])
-
- def __init__(self,
- status_code=None,
- status_message=None,
- status_detail=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}StatusMessage"] = ("status_message", StatusMessage)
+ c_cardinality["status_message"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}StatusDetail"] = ("status_detail", StatusDetail)
+ c_cardinality["status_detail"] = {"min": 0, "max": 1}
+ c_child_order.extend(["status_code", "status_message", "status_detail"])
+
+ def __init__(
+ self,
+ status_code=None,
+ status_message=None,
+ status_detail=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.status_code = status_code
self.status_message = status_message
self.status_detail = status_detail
@@ -1370,9 +1344,9 @@ def status_type__from_string(xml_string):
class Status(StatusType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:Status element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:Status element"""
- c_tag = 'Status'
+ c_tag = "Status"
c_namespace = NAMESPACE
c_children = StatusType_.c_children.copy()
c_attributes = StatusType_.c_attributes.copy()
@@ -1385,51 +1359,48 @@ def status_from_string(xml_string):
class StatusResponseType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:StatusResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:StatusResponseType element"""
- c_tag = 'StatusResponseType'
+ c_tag = "StatusResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Issuer'] = (
- 'issuer', saml.Issuer)
- c_cardinality['issuer'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}Signature'] = (
- 'signature', ds.Signature)
- c_cardinality['signature'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}Extensions'] = (
- 'extensions', Extensions)
- c_cardinality['extensions'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:protocol}Status'] = (
- 'status', Status)
- c_attributes['ID'] = ('id', 'ID', True)
- c_attributes['InResponseTo'] = ('in_response_to', 'NCName', False)
- c_attributes['Version'] = ('version', 'string', True)
- c_attributes['IssueInstant'] = ('issue_instant', 'dateTime', True)
- c_attributes['Destination'] = ('destination', 'anyURI', False)
- c_attributes['Consent'] = ('consent', 'anyURI', False)
- c_child_order.extend(['issuer', 'signature', 'extensions', 'status'])
-
- def __init__(self,
- issuer=None,
- signature=None,
- extensions=None,
- status=None,
- id=None,
- in_response_to=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Issuer"] = ("issuer", saml.Issuer)
+ c_cardinality["issuer"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Signature"] = ("signature", ds.Signature)
+ c_cardinality["signature"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}Extensions"] = ("extensions", Extensions)
+ c_cardinality["extensions"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:protocol}Status"] = ("status", Status)
+ c_attributes["ID"] = ("id", "ID", True)
+ c_attributes["InResponseTo"] = ("in_response_to", "NCName", False)
+ c_attributes["Version"] = ("version", "string", True)
+ c_attributes["IssueInstant"] = ("issue_instant", "dateTime", True)
+ c_attributes["Destination"] = ("destination", "anyURI", False)
+ c_attributes["Consent"] = ("consent", "anyURI", False)
+ c_child_order.extend(["issuer", "signature", "extensions", "status"])
+
+ def __init__(
+ self,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ status=None,
+ id=None,
+ in_response_to=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.issuer = issuer
self.signature = signature
self.extensions = extensions
@@ -1447,52 +1418,57 @@ def status_response_type__from_string(xml_string):
class ResponseType_(StatusResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ResponseType element"""
- c_tag = 'ResponseType'
+ c_tag = "ResponseType"
c_namespace = NAMESPACE
c_children = StatusResponseType_.c_children.copy()
c_attributes = StatusResponseType_.c_attributes.copy()
c_child_order = StatusResponseType_.c_child_order[:]
c_cardinality = StatusResponseType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Assertion'] = (
- 'assertion', [saml.Assertion])
- c_cardinality['assertion'] = {"min": 0}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAssertion'] = (
- 'encrypted_assertion', [saml.EncryptedAssertion])
- c_cardinality['encrypted_assertion'] = {"min": 0}
- c_child_order.extend(['assertion', 'encrypted_assertion'])
-
- def __init__(self,
- assertion=None,
- encrypted_assertion=None,
- issuer=None,
- signature=None,
- extensions=None,
- status=None,
- id=None,
- in_response_to=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- StatusResponseType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- status=status,
- id=id,
- in_response_to=in_response_to,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}Assertion"] = ("assertion", [saml.Assertion])
+ c_cardinality["assertion"] = {"min": 0}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedAssertion"] = (
+ "encrypted_assertion",
+ [saml.EncryptedAssertion],
+ )
+ c_cardinality["encrypted_assertion"] = {"min": 0}
+ c_child_order.extend(["assertion", "encrypted_assertion"])
+
+ def __init__(
+ self,
+ assertion=None,
+ encrypted_assertion=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ status=None,
+ id=None,
+ in_response_to=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ StatusResponseType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ status=status,
+ id=id,
+ in_response_to=in_response_to,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.assertion = assertion or []
self.encrypted_assertion = encrypted_assertion or []
@@ -1502,9 +1478,9 @@ def response_type__from_string(xml_string):
class ArtifactResponseType_(StatusResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResponseType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResponseType element"""
- c_tag = 'ArtifactResponseType'
+ c_tag = "ArtifactResponseType"
c_namespace = NAMESPACE
c_children = StatusResponseType_.c_children.copy()
c_attributes = StatusResponseType_.c_attributes.copy()
@@ -1518,9 +1494,9 @@ def artifact_response_type__from_string(xml_string):
class ManageNameIDResponse(StatusResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ManageNameIDResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ManageNameIDResponse element"""
- c_tag = 'ManageNameIDResponse'
+ c_tag = "ManageNameIDResponse"
c_namespace = NAMESPACE
c_children = StatusResponseType_.c_children.copy()
c_attributes = StatusResponseType_.c_attributes.copy()
@@ -1533,9 +1509,9 @@ def manage_name_id_response_from_string(xml_string):
class LogoutResponse(StatusResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:LogoutResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:LogoutResponse element"""
- c_tag = 'LogoutResponse'
+ c_tag = "LogoutResponse"
c_namespace = NAMESPACE
c_children = StatusResponseType_.c_children.copy()
c_attributes = StatusResponseType_.c_attributes.copy()
@@ -1552,63 +1528,64 @@ class NameIDMappingResponseType_(StatusResponseType_):
The urn:oasis:names:tc:SAML:2.0:protocol:NameIDMappingResponseType element
"""
- c_tag = 'NameIDMappingResponseType'
+ c_tag = "NameIDMappingResponseType"
c_namespace = NAMESPACE
c_children = StatusResponseType_.c_children.copy()
c_attributes = StatusResponseType_.c_attributes.copy()
c_child_order = StatusResponseType_.c_child_order[:]
c_cardinality = StatusResponseType_.c_cardinality.copy()
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}NameID'] = (
- 'name_id', saml.NameID)
- c_cardinality['name_id'] = {"min": 0, "max": 1}
- c_children['{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID'] = (
- 'encrypted_id', saml.EncryptedID)
- c_cardinality['encrypted_id'] = {"min": 0, "max": 1}
- c_child_order.extend(['name_id', 'encrypted_id'])
-
- def __init__(self,
- name_id=None,
- encrypted_id=None,
- issuer=None,
- signature=None,
- extensions=None,
- status=None,
- id=None,
- in_response_to=None,
- version=None,
- issue_instant=None,
- destination=None,
- consent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- StatusResponseType_.__init__(self,
- issuer=issuer,
- signature=signature,
- extensions=extensions,
- status=status,
- id=id,
- in_response_to=in_response_to,
- version=version,
- issue_instant=issue_instant,
- destination=destination,
- consent=consent,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}NameID"] = ("name_id", saml.NameID)
+ c_cardinality["name_id"] = {"min": 0, "max": 1}
+ c_children["{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedID"] = ("encrypted_id", saml.EncryptedID)
+ c_cardinality["encrypted_id"] = {"min": 0, "max": 1}
+ c_child_order.extend(["name_id", "encrypted_id"])
+
+ def __init__(
+ self,
+ name_id=None,
+ encrypted_id=None,
+ issuer=None,
+ signature=None,
+ extensions=None,
+ status=None,
+ id=None,
+ in_response_to=None,
+ version=None,
+ issue_instant=None,
+ destination=None,
+ consent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ StatusResponseType_.__init__(
+ self,
+ issuer=issuer,
+ signature=signature,
+ extensions=extensions,
+ status=status,
+ id=id,
+ in_response_to=in_response_to,
+ version=version,
+ issue_instant=issue_instant,
+ destination=destination,
+ consent=consent,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.name_id = name_id
self.encrypted_id = encrypted_id
def name_id_mapping_response_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(NameIDMappingResponseType_,
- xml_string)
+ return saml2.create_class_from_xml_string(NameIDMappingResponseType_, xml_string)
class Response(ResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:Response element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:Response element"""
- c_tag = 'Response'
+ c_tag = "Response"
c_namespace = NAMESPACE
c_children = ResponseType_.c_children.copy()
c_attributes = ResponseType_.c_attributes.copy()
@@ -1621,9 +1598,9 @@ def response_from_string(xml_string):
class ArtifactResponse(ArtifactResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResponse element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:ArtifactResponse element"""
- c_tag = 'ArtifactResponse'
+ c_tag = "ArtifactResponse"
c_namespace = NAMESPACE
c_children = ArtifactResponseType_.c_children.copy()
c_attributes = ArtifactResponseType_.c_attributes.copy()
@@ -1636,10 +1613,9 @@ def artifact_response_from_string(xml_string):
class NameIDMappingResponse(NameIDMappingResponseType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDMappingResponse element
- """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:NameIDMappingResponse element"""
- c_tag = 'NameIDMappingResponse'
+ c_tag = "NameIDMappingResponse"
c_namespace = NAMESPACE
c_children = NameIDMappingResponseType_.c_children.copy()
c_attributes = NameIDMappingResponseType_.c_attributes.copy()
@@ -1654,28 +1630,22 @@ def name_id_mapping_response_from_string(xml_string):
# ..................
# ['StatusCodeType', 'StatusCode']
class StatusCodeType_(SamlBase):
- """The urn:oasis:names:tc:SAML:2.0:protocol:StatusCodeType element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:StatusCodeType element"""
- c_tag = 'StatusCodeType'
+ c_tag = "StatusCodeType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_cardinality['status_code'] = {"min": 0, "max": 1}
- c_attributes['Value'] = ('value', 'anyURI', True)
- c_child_order.extend(['status_code'])
-
- def __init__(self,
- status_code=None,
- value=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes)
+ c_cardinality["status_code"] = {"min": 0, "max": 1}
+ c_attributes["Value"] = ("value", "anyURI", True)
+ c_child_order.extend(["status_code"])
+
+ def __init__(self, status_code=None, value=None, text=None, extension_elements=None, extension_attributes=None):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.status_code = status_code
self.value = value
@@ -1685,9 +1655,9 @@ def status_code_type__from_string(xml_string):
class StatusCode(StatusCodeType_):
- """The urn:oasis:names:tc:SAML:2.0:protocol:StatusCode element """
+ """The urn:oasis:names:tc:SAML:2.0:protocol:StatusCode element"""
- c_tag = 'StatusCode'
+ c_tag = "StatusCode"
c_namespace = NAMESPACE
c_children = StatusCodeType_.c_children.copy()
c_attributes = StatusCodeType_.c_attributes.copy()
@@ -1700,15 +1670,10 @@ def status_code_from_string(xml_string):
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-StatusType_.c_children['{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode'] = (
- 'status_code', StatusCode)
-Status.c_children['{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode'] = (
- 'status_code', StatusCode)
-StatusCodeType_.c_children[
- '{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode'] = (
- 'status_code', StatusCode)
-StatusCode.c_children['{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode'] = (
- 'status_code', StatusCode)
+StatusType_.c_children["{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode"] = ("status_code", StatusCode)
+Status.c_children["{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode"] = ("status_code", StatusCode)
+StatusCodeType_.c_children["{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode"] = ("status_code", StatusCode)
+StatusCode.c_children["{urn:oasis:names:tc:SAML:2.0:protocol}StatusCode"] = ("status_code", StatusCode)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ELEMENT_FROM_STRING = {
@@ -1729,8 +1694,7 @@ ELEMENT_FROM_STRING = {
AuthnQueryType_.c_tag: authn_query_type__from_string,
RequestedAuthnContext.c_tag: requested_authn_context_from_string,
RequestedAuthnContextType_.c_tag: requested_authn_context_type__from_string,
- AuthnContextComparisonType_.c_tag:
- authn_context_comparison_type__from_string,
+ AuthnContextComparisonType_.c_tag: authn_context_comparison_type__from_string,
AttributeQuery.c_tag: attribute_query_from_string,
AttributeQueryType_.c_tag: attribute_query_type__from_string,
AuthzDecisionQuery.c_tag: authz_decision_query_from_string,
@@ -1768,69 +1732,68 @@ ELEMENT_FROM_STRING = {
NameIDMappingRequest.c_tag: name_id_mapping_request_from_string,
NameIDMappingRequestType_.c_tag: name_id_mapping_request_type__from_string,
NameIDMappingResponse.c_tag: name_id_mapping_response_from_string,
- NameIDMappingResponseType_.c_tag:
- name_id_mapping_response_type__from_string,
+ NameIDMappingResponseType_.c_tag: name_id_mapping_response_type__from_string,
}
ELEMENT_BY_TAG = {
- 'Extensions': Extensions,
- 'ExtensionsType': ExtensionsType_,
- 'StatusResponseType': StatusResponseType_,
- 'Status': Status,
- 'StatusType': StatusType_,
- 'StatusCode': StatusCode,
- 'StatusCodeType': StatusCodeType_,
- 'StatusMessage': StatusMessage,
- 'StatusDetail': StatusDetail,
- 'StatusDetailType': StatusDetailType_,
- 'AssertionIDRequest': AssertionIDRequest,
- 'AssertionIDRequestType': AssertionIDRequestType_,
- 'SubjectQuery': SubjectQuery,
- 'AuthnQuery': AuthnQuery,
- 'AuthnQueryType': AuthnQueryType_,
- 'RequestedAuthnContext': RequestedAuthnContext,
- 'RequestedAuthnContextType': RequestedAuthnContextType_,
- 'AuthnContextComparisonType': AuthnContextComparisonType_,
- 'AttributeQuery': AttributeQuery,
- 'AttributeQueryType': AttributeQueryType_,
- 'AuthzDecisionQuery': AuthzDecisionQuery,
- 'AuthzDecisionQueryType': AuthzDecisionQueryType_,
- 'AuthnRequest': AuthnRequest,
- 'AuthnRequestType': AuthnRequestType_,
- 'NameIDPolicy': NameIDPolicy,
- 'NameIDPolicyType': NameIDPolicyType_,
- 'Scoping': Scoping,
- 'ScopingType': ScopingType_,
- 'RequesterID': RequesterID,
- 'IDPList': IDPList,
- 'IDPListType': IDPListType_,
- 'IDPEntry': IDPEntry,
- 'IDPEntryType': IDPEntryType_,
- 'GetComplete': GetComplete,
- 'Response': Response,
- 'ResponseType': ResponseType_,
- 'ArtifactResolve': ArtifactResolve,
- 'ArtifactResolveType': ArtifactResolveType_,
- 'Artifact': Artifact,
- 'ArtifactResponse': ArtifactResponse,
- 'ArtifactResponseType': ArtifactResponseType_,
- 'ManageNameIDRequest': ManageNameIDRequest,
- 'ManageNameIDRequestType': ManageNameIDRequestType_,
- 'NewID': NewID,
- 'NewEncryptedID': NewEncryptedID,
- 'Terminate': Terminate,
- 'TerminateType': TerminateType_,
- 'ManageNameIDResponse': ManageNameIDResponse,
- 'LogoutRequest': LogoutRequest,
- 'LogoutRequestType': LogoutRequestType_,
- 'SessionIndex': SessionIndex,
- 'LogoutResponse': LogoutResponse,
- 'NameIDMappingRequest': NameIDMappingRequest,
- 'NameIDMappingRequestType': NameIDMappingRequestType_,
- 'NameIDMappingResponse': NameIDMappingResponse,
- 'NameIDMappingResponseType': NameIDMappingResponseType_,
- 'RequestAbstractType': RequestAbstractType_,
- 'SubjectQueryAbstractType': SubjectQueryAbstractType_,
+ "Extensions": Extensions,
+ "ExtensionsType": ExtensionsType_,
+ "StatusResponseType": StatusResponseType_,
+ "Status": Status,
+ "StatusType": StatusType_,
+ "StatusCode": StatusCode,
+ "StatusCodeType": StatusCodeType_,
+ "StatusMessage": StatusMessage,
+ "StatusDetail": StatusDetail,
+ "StatusDetailType": StatusDetailType_,
+ "AssertionIDRequest": AssertionIDRequest,
+ "AssertionIDRequestType": AssertionIDRequestType_,
+ "SubjectQuery": SubjectQuery,
+ "AuthnQuery": AuthnQuery,
+ "AuthnQueryType": AuthnQueryType_,
+ "RequestedAuthnContext": RequestedAuthnContext,
+ "RequestedAuthnContextType": RequestedAuthnContextType_,
+ "AuthnContextComparisonType": AuthnContextComparisonType_,
+ "AttributeQuery": AttributeQuery,
+ "AttributeQueryType": AttributeQueryType_,
+ "AuthzDecisionQuery": AuthzDecisionQuery,
+ "AuthzDecisionQueryType": AuthzDecisionQueryType_,
+ "AuthnRequest": AuthnRequest,
+ "AuthnRequestType": AuthnRequestType_,
+ "NameIDPolicy": NameIDPolicy,
+ "NameIDPolicyType": NameIDPolicyType_,
+ "Scoping": Scoping,
+ "ScopingType": ScopingType_,
+ "RequesterID": RequesterID,
+ "IDPList": IDPList,
+ "IDPListType": IDPListType_,
+ "IDPEntry": IDPEntry,
+ "IDPEntryType": IDPEntryType_,
+ "GetComplete": GetComplete,
+ "Response": Response,
+ "ResponseType": ResponseType_,
+ "ArtifactResolve": ArtifactResolve,
+ "ArtifactResolveType": ArtifactResolveType_,
+ "Artifact": Artifact,
+ "ArtifactResponse": ArtifactResponse,
+ "ArtifactResponseType": ArtifactResponseType_,
+ "ManageNameIDRequest": ManageNameIDRequest,
+ "ManageNameIDRequestType": ManageNameIDRequestType_,
+ "NewID": NewID,
+ "NewEncryptedID": NewEncryptedID,
+ "Terminate": Terminate,
+ "TerminateType": TerminateType_,
+ "ManageNameIDResponse": ManageNameIDResponse,
+ "LogoutRequest": LogoutRequest,
+ "LogoutRequestType": LogoutRequestType_,
+ "SessionIndex": SessionIndex,
+ "LogoutResponse": LogoutResponse,
+ "NameIDMappingRequest": NameIDMappingRequest,
+ "NameIDMappingRequestType": NameIDMappingRequestType_,
+ "NameIDMappingResponse": NameIDMappingResponse,
+ "NameIDMappingResponseType": NameIDMappingResponseType_,
+ "RequestAbstractType": RequestAbstractType_,
+ "SubjectQueryAbstractType": SubjectQueryAbstractType_,
}
@@ -1840,10 +1803,14 @@ def factory(tag, **kwargs):
def any_response_from_string(xmlstr):
resp = None
- for func in [status_response_type__from_string, response_from_string,
- artifact_response_from_string, logout_response_from_string,
- name_id_mapping_response_from_string,
- manage_name_id_response_from_string]:
+ for func in [
+ status_response_type__from_string,
+ response_from_string,
+ artifact_response_from_string,
+ logout_response_from_string,
+ name_id_mapping_response_from_string,
+ manage_name_id_response_from_string,
+ ]:
resp = func(xmlstr)
if resp:
break
diff --git a/src/saml2/schema/__init__.py b/src/saml2/schema/__init__.py
index 3b031d2b..16940871 100644
--- a/src/saml2/schema/__init__.py
+++ b/src/saml2/schema/__init__.py
@@ -1 +1 @@
-__author__ = 'rolandh'
+__author__ = "rolandh"
diff --git a/src/saml2/schema/soap.py b/src/saml2/schema/soap.py
index 8d59b357..eeb10f80 100644
--- a/src/saml2/schema/soap.py
+++ b/src/saml2/schema/soap.py
@@ -6,462 +6,496 @@
import saml2
from saml2 import SamlBase
-
from saml2.schema import wsdl
-NAMESPACE = 'http://schemas.xmlsoap.org/wsdl/soap/'
+
+NAMESPACE = "http://schemas.xmlsoap.org/wsdl/soap/"
+
class EncodingStyle_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/soap/:encodingStyle element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:encodingStyle element"""
- c_tag = 'encodingStyle'
+ c_tag = "encodingStyle"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def encoding_style__from_string(xml_string):
return saml2.create_class_from_xml_string(EncodingStyle_, xml_string)
class TStyleChoice_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tStyleChoice element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tStyleChoice element"""
- c_tag = 'tStyleChoice'
+ c_tag = "tStyleChoice"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:string', 'enumeration': ['rpc', 'document']}
+ c_value_type = {"base": "xs:string", "enumeration": ["rpc", "document"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def t_style_choice__from_string(xml_string):
return saml2.create_class_from_xml_string(TStyleChoice_, xml_string)
class TOperation_(wsdl.TExtensibilityElement_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tOperation element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tOperation element"""
- c_tag = 'tOperation'
+ c_tag = "tOperation"
c_namespace = NAMESPACE
c_children = wsdl.TExtensibilityElement_.c_children.copy()
c_attributes = wsdl.TExtensibilityElement_.c_attributes.copy()
c_child_order = wsdl.TExtensibilityElement_.c_child_order[:]
c_cardinality = wsdl.TExtensibilityElement_.c_cardinality.copy()
- c_attributes['soapAction'] = ('soap_action', 'anyURI', False)
- c_attributes['style'] = ('style', TStyleChoice_, False)
-
- def __init__(self,
- soap_action=None,
- style=None,
- required=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- wsdl.TExtensibilityElement_.__init__(self,
- required=required,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.soap_action=soap_action
- self.style=style
+ c_attributes["soapAction"] = ("soap_action", "anyURI", False)
+ c_attributes["style"] = ("style", TStyleChoice_, False)
+
+ def __init__(
+ self,
+ soap_action=None,
+ style=None,
+ required=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ wsdl.TExtensibilityElement_.__init__(
+ self,
+ required=required,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.soap_action = soap_action
+ self.style = style
+
def t_operation__from_string(xml_string):
return saml2.create_class_from_xml_string(TOperation_, xml_string)
class UseChoice_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/soap/:useChoice element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:useChoice element"""
- c_tag = 'useChoice'
+ c_tag = "useChoice"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:string', 'enumeration': ['literal', 'encoded']}
+ c_value_type = {"base": "xs:string", "enumeration": ["literal", "encoded"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def use_choice__from_string(xml_string):
return saml2.create_class_from_xml_string(UseChoice_, xml_string)
class TFaultRes_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tFaultRes element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tFaultRes element"""
- c_tag = 'tFaultRes'
+ c_tag = "tFaultRes"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['{http://schemas.xmlsoap.org/wsdl/}required'] = ('required', 'None', False)
- c_attributes['parts'] = ('parts', 'NMTOKENS', False)
- c_attributes['encodingStyle'] = ('encoding_style', EncodingStyle_, False)
- c_attributes['use'] = ('use', UseChoice_, False)
- c_attributes['namespace'] = ('namespace', 'anyURI', False)
-
- def __init__(self,
- required=None,
- parts=None,
- encoding_style=None,
- use=None,
- namespace=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.required=required
- self.parts=parts
- self.encoding_style=encoding_style
- self.use=use
- self.namespace=namespace
+ c_attributes["{http://schemas.xmlsoap.org/wsdl/}required"] = ("required", "None", False)
+ c_attributes["parts"] = ("parts", "NMTOKENS", False)
+ c_attributes["encodingStyle"] = ("encoding_style", EncodingStyle_, False)
+ c_attributes["use"] = ("use", UseChoice_, False)
+ c_attributes["namespace"] = ("namespace", "anyURI", False)
+
+ def __init__(
+ self,
+ required=None,
+ parts=None,
+ encoding_style=None,
+ use=None,
+ namespace=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.required = required
+ self.parts = parts
+ self.encoding_style = encoding_style
+ self.use = use
+ self.namespace = namespace
class TFault_(TFaultRes_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tFault element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tFault element"""
- c_tag = 'tFault'
+ c_tag = "tFault"
c_namespace = NAMESPACE
c_children = TFaultRes_.c_children.copy()
c_attributes = TFaultRes_.c_attributes.copy()
c_child_order = TFaultRes_.c_child_order[:]
c_cardinality = TFaultRes_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', True)
-
- def __init__(self,
- name=None,
- required=None,
- parts=None,
- encoding_style=None,
- use=None,
- namespace=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TFaultRes_.__init__(self,
- required=required,
- parts=parts,
- encoding_style=encoding_style,
- use=use,
- namespace=namespace,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
+ c_attributes["name"] = ("name", "NCName", True)
+
+ def __init__(
+ self,
+ name=None,
+ required=None,
+ parts=None,
+ encoding_style=None,
+ use=None,
+ namespace=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TFaultRes_.__init__(
+ self,
+ required=required,
+ parts=parts,
+ encoding_style=encoding_style,
+ use=use,
+ namespace=namespace,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+
def t_fault__from_string(xml_string):
return saml2.create_class_from_xml_string(TFault_, xml_string)
class THeaderFault_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tHeaderFault element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tHeaderFault element"""
- c_tag = 'tHeaderFault'
+ c_tag = "tHeaderFault"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['message'] = ('message', 'QName', True)
- c_attributes['part'] = ('part', 'NMTOKEN', True)
- c_attributes['use'] = ('use', UseChoice_, True)
- c_attributes['encodingStyle'] = ('encoding_style', EncodingStyle_, False)
- c_attributes['namespace'] = ('namespace', 'anyURI', False)
-
- def __init__(self,
- message=None,
- part=None,
- use=None,
- encoding_style=None,
- namespace=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.message=message
- self.part=part
- self.use=use
- self.encoding_style=encoding_style
- self.namespace=namespace
+ c_attributes["message"] = ("message", "QName", True)
+ c_attributes["part"] = ("part", "NMTOKEN", True)
+ c_attributes["use"] = ("use", UseChoice_, True)
+ c_attributes["encodingStyle"] = ("encoding_style", EncodingStyle_, False)
+ c_attributes["namespace"] = ("namespace", "anyURI", False)
+
+ def __init__(
+ self,
+ message=None,
+ part=None,
+ use=None,
+ encoding_style=None,
+ namespace=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.message = message
+ self.part = part
+ self.use = use
+ self.encoding_style = encoding_style
+ self.namespace = namespace
+
def t_header_fault__from_string(xml_string):
return saml2.create_class_from_xml_string(THeaderFault_, xml_string)
class TAddress_(wsdl.TExtensibilityElement_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tAddress element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tAddress element"""
- c_tag = 'tAddress'
+ c_tag = "tAddress"
c_namespace = NAMESPACE
c_children = wsdl.TExtensibilityElement_.c_children.copy()
c_attributes = wsdl.TExtensibilityElement_.c_attributes.copy()
c_child_order = wsdl.TExtensibilityElement_.c_child_order[:]
c_cardinality = wsdl.TExtensibilityElement_.c_cardinality.copy()
- c_attributes['location'] = ('location', 'anyURI', True)
-
- def __init__(self,
- location=None,
- required=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- wsdl.TExtensibilityElement_.__init__(self,
- required=required,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.location=location
+ c_attributes["location"] = ("location", "anyURI", True)
+
+ def __init__(
+ self,
+ location=None,
+ required=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ wsdl.TExtensibilityElement_.__init__(
+ self,
+ required=required,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.location = location
+
def t_address__from_string(xml_string):
return saml2.create_class_from_xml_string(TAddress_, xml_string)
class TBinding_(wsdl.TExtensibilityElement_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tBinding element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tBinding element"""
- c_tag = 'tBinding'
+ c_tag = "tBinding"
c_namespace = NAMESPACE
c_children = wsdl.TExtensibilityElement_.c_children.copy()
c_attributes = wsdl.TExtensibilityElement_.c_attributes.copy()
c_child_order = wsdl.TExtensibilityElement_.c_child_order[:]
c_cardinality = wsdl.TExtensibilityElement_.c_cardinality.copy()
- c_attributes['transport'] = ('transport', 'anyURI', True)
- c_attributes['style'] = ('style', TStyleChoice_, False)
-
- def __init__(self,
- transport=None,
- style=None,
- required=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- wsdl.TExtensibilityElement_.__init__(self,
- required=required,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.transport=transport
- self.style=style
+ c_attributes["transport"] = ("transport", "anyURI", True)
+ c_attributes["style"] = ("style", TStyleChoice_, False)
+
+ def __init__(
+ self,
+ transport=None,
+ style=None,
+ required=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ wsdl.TExtensibilityElement_.__init__(
+ self,
+ required=required,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.transport = transport
+ self.style = style
+
def t_binding__from_string(xml_string):
return saml2.create_class_from_xml_string(TBinding_, xml_string)
class Operation(TOperation_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:operation element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:operation element"""
- c_tag = 'operation'
+ c_tag = "operation"
c_namespace = NAMESPACE
c_children = TOperation_.c_children.copy()
c_attributes = TOperation_.c_attributes.copy()
c_child_order = TOperation_.c_child_order[:]
c_cardinality = TOperation_.c_cardinality.copy()
+
def operation_from_string(xml_string):
return saml2.create_class_from_xml_string(Operation, xml_string)
class TBody_(wsdl.TExtensibilityElement_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tBody element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tBody element"""
- c_tag = 'tBody'
+ c_tag = "tBody"
c_namespace = NAMESPACE
c_children = wsdl.TExtensibilityElement_.c_children.copy()
c_attributes = wsdl.TExtensibilityElement_.c_attributes.copy()
c_child_order = wsdl.TExtensibilityElement_.c_child_order[:]
c_cardinality = wsdl.TExtensibilityElement_.c_cardinality.copy()
- c_attributes['parts'] = ('parts', 'NMTOKENS', False)
- c_attributes['encodingStyle'] = ('encoding_style', EncodingStyle_, False)
- c_attributes['use'] = ('use', UseChoice_, False)
- c_attributes['namespace'] = ('namespace', 'anyURI', False)
-
- def __init__(self,
- parts=None,
- encoding_style=None,
- use=None,
- namespace=None,
- required=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- wsdl.TExtensibilityElement_.__init__(self,
- required=required,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.parts=parts
- self.encoding_style=encoding_style
- self.use=use
- self.namespace=namespace
+ c_attributes["parts"] = ("parts", "NMTOKENS", False)
+ c_attributes["encodingStyle"] = ("encoding_style", EncodingStyle_, False)
+ c_attributes["use"] = ("use", UseChoice_, False)
+ c_attributes["namespace"] = ("namespace", "anyURI", False)
+
+ def __init__(
+ self,
+ parts=None,
+ encoding_style=None,
+ use=None,
+ namespace=None,
+ required=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ wsdl.TExtensibilityElement_.__init__(
+ self,
+ required=required,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.parts = parts
+ self.encoding_style = encoding_style
+ self.use = use
+ self.namespace = namespace
+
def t_body__from_string(xml_string):
return saml2.create_class_from_xml_string(TBody_, xml_string)
class Fault(TFault_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:fault element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:fault element"""
- c_tag = 'fault'
+ c_tag = "fault"
c_namespace = NAMESPACE
c_children = TFault_.c_children.copy()
c_attributes = TFault_.c_attributes.copy()
c_child_order = TFault_.c_child_order[:]
c_cardinality = TFault_.c_cardinality.copy()
+
def fault_from_string(xml_string):
return saml2.create_class_from_xml_string(Fault, xml_string)
class Headerfault(THeaderFault_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:headerfault element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:headerfault element"""
- c_tag = 'headerfault'
+ c_tag = "headerfault"
c_namespace = NAMESPACE
c_children = THeaderFault_.c_children.copy()
c_attributes = THeaderFault_.c_attributes.copy()
c_child_order = THeaderFault_.c_child_order[:]
c_cardinality = THeaderFault_.c_cardinality.copy()
+
def headerfault_from_string(xml_string):
return saml2.create_class_from_xml_string(Headerfault, xml_string)
class Address(TAddress_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:address element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:address element"""
- c_tag = 'address'
+ c_tag = "address"
c_namespace = NAMESPACE
c_children = TAddress_.c_children.copy()
c_attributes = TAddress_.c_attributes.copy()
c_child_order = TAddress_.c_child_order[:]
c_cardinality = TAddress_.c_cardinality.copy()
+
def address_from_string(xml_string):
return saml2.create_class_from_xml_string(Address, xml_string)
class Binding(TBinding_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:binding element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:binding element"""
- c_tag = 'binding'
+ c_tag = "binding"
c_namespace = NAMESPACE
c_children = TBinding_.c_children.copy()
c_attributes = TBinding_.c_attributes.copy()
c_child_order = TBinding_.c_child_order[:]
c_cardinality = TBinding_.c_cardinality.copy()
+
def binding_from_string(xml_string):
return saml2.create_class_from_xml_string(Binding, xml_string)
class Body(TBody_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:body element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:body element"""
- c_tag = 'body'
+ c_tag = "body"
c_namespace = NAMESPACE
c_children = TBody_.c_children.copy()
c_attributes = TBody_.c_attributes.copy()
c_child_order = TBody_.c_child_order[:]
c_cardinality = TBody_.c_cardinality.copy()
+
def body_from_string(xml_string):
return saml2.create_class_from_xml_string(Body, xml_string)
class THeader_(wsdl.TExtensibilityElement_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:tHeader element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:tHeader element"""
- c_tag = 'tHeader'
+ c_tag = "tHeader"
c_namespace = NAMESPACE
c_children = wsdl.TExtensibilityElement_.c_children.copy()
c_attributes = wsdl.TExtensibilityElement_.c_attributes.copy()
c_child_order = wsdl.TExtensibilityElement_.c_child_order[:]
c_cardinality = wsdl.TExtensibilityElement_.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/soap/}headerfault'] = ('headerfault', [Headerfault])
- c_cardinality['headerfault'] = {"min":0}
- c_attributes['message'] = ('message', 'QName', True)
- c_attributes['part'] = ('part', 'NMTOKEN', True)
- c_attributes['use'] = ('use', UseChoice_, True)
- c_attributes['encodingStyle'] = ('encoding_style', EncodingStyle_, False)
- c_attributes['namespace'] = ('namespace', 'anyURI', False)
- c_child_order.extend(['headerfault'])
-
- def __init__(self,
- headerfault=None,
- message=None,
- part=None,
- use=None,
- encoding_style=None,
- namespace=None,
- required=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- wsdl.TExtensibilityElement_.__init__(self,
- required=required,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.headerfault=headerfault or []
- self.message=message
- self.part=part
- self.use=use
- self.encoding_style=encoding_style
- self.namespace=namespace
+ c_children["{http://schemas.xmlsoap.org/wsdl/soap/}headerfault"] = ("headerfault", [Headerfault])
+ c_cardinality["headerfault"] = {"min": 0}
+ c_attributes["message"] = ("message", "QName", True)
+ c_attributes["part"] = ("part", "NMTOKEN", True)
+ c_attributes["use"] = ("use", UseChoice_, True)
+ c_attributes["encodingStyle"] = ("encoding_style", EncodingStyle_, False)
+ c_attributes["namespace"] = ("namespace", "anyURI", False)
+ c_child_order.extend(["headerfault"])
+
+ def __init__(
+ self,
+ headerfault=None,
+ message=None,
+ part=None,
+ use=None,
+ encoding_style=None,
+ namespace=None,
+ required=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ wsdl.TExtensibilityElement_.__init__(
+ self,
+ required=required,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.headerfault = headerfault or []
+ self.message = message
+ self.part = part
+ self.use = use
+ self.encoding_style = encoding_style
+ self.namespace = namespace
+
def t_header__from_string(xml_string):
return saml2.create_class_from_xml_string(THeader_, xml_string)
class Header(THeader_):
- """The http://schemas.xmlsoap.org/wsdl/soap/:header element """
+ """The http://schemas.xmlsoap.org/wsdl/soap/:header element"""
- c_tag = 'header'
+ c_tag = "header"
c_namespace = NAMESPACE
c_children = THeader_.c_children.copy()
c_attributes = THeader_.c_attributes.copy()
c_child_order = THeader_.c_child_order[:]
c_cardinality = THeader_.c_cardinality.copy()
+
def header_from_string(xml_string):
return saml2.create_class_from_xml_string(Header, xml_string)
AG_tBodyAttributes = [
- ('encodingStyle', EncodingStyle_, False),
- ('use', UseChoice_, False),
- ('namespace', 'anyURI', False),
+ ("encodingStyle", EncodingStyle_, False),
+ ("use", UseChoice_, False),
+ ("namespace", "anyURI", False),
]
AG_tHeaderAttributes = [
- ('message', 'QName', True),
- ('part', 'NMTOKEN', True),
- ('use', UseChoice_, True),
- ('encodingStyle', EncodingStyle_, False),
- ('namespace', 'anyURI', False),
+ ("message", "QName", True),
+ ("part", "NMTOKEN", True),
+ ("use", UseChoice_, True),
+ ("encodingStyle", EncodingStyle_, False),
+ ("namespace", "anyURI", False),
]
ELEMENT_FROM_STRING = {
@@ -485,27 +519,26 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'encodingStyle': EncodingStyle_,
- 'binding': Binding,
- 'tBinding': TBinding_,
- 'tStyleChoice': TStyleChoice_,
- 'operation': Operation,
- 'tOperation': TOperation_,
- 'body': Body,
- 'tBody': TBody_,
- 'useChoice': UseChoice_,
- 'fault': Fault,
- 'tFault': TFault_,
- 'header': Header,
- 'tHeader': THeader_,
- 'headerfault': Headerfault,
- 'tHeaderFault': THeaderFault_,
- 'address': Address,
- 'tAddress': TAddress_,
- 'tFaultRes': TFaultRes_,
+ "encodingStyle": EncodingStyle_,
+ "binding": Binding,
+ "tBinding": TBinding_,
+ "tStyleChoice": TStyleChoice_,
+ "operation": Operation,
+ "tOperation": TOperation_,
+ "body": Body,
+ "tBody": TBody_,
+ "useChoice": UseChoice_,
+ "fault": Fault,
+ "tFault": TFault_,
+ "header": Header,
+ "tHeader": THeader_,
+ "headerfault": Headerfault,
+ "tHeaderFault": THeaderFault_,
+ "address": Address,
+ "tAddress": TAddress_,
+ "tFaultRes": TFaultRes_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/schema/soapenv.py b/src/saml2/schema/soapenv.py
index f7aec766..a7985926 100644
--- a/src/saml2/schema/soapenv.py
+++ b/src/saml2/schema/soapenv.py
@@ -7,252 +7,272 @@
import saml2
from saml2 import SamlBase
-NAMESPACE = 'http://schemas.xmlsoap.org/soap/envelope/'
+
+NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/"
+
class Header_(SamlBase):
- """The http://schemas.xmlsoap.org/soap/envelope/:Header element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Header element"""
- c_tag = 'Header'
+ c_tag = "Header"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def header__from_string(xml_string):
return saml2.create_class_from_xml_string(Header_, xml_string)
class Body_(SamlBase):
- """The http://schemas.xmlsoap.org/soap/envelope/:Body element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Body element"""
- c_tag = 'Body'
+ c_tag = "Body"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def body__from_string(xml_string):
return saml2.create_class_from_xml_string(Body_, xml_string)
class EncodingStyle_(SamlBase):
- """The http://schemas.xmlsoap.org/soap/envelope/:encodingStyle element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:encodingStyle element"""
- c_tag = 'encodingStyle'
+ c_tag = "encodingStyle"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def encoding_style__from_string(xml_string):
return saml2.create_class_from_xml_string(EncodingStyle_, xml_string)
class Fault_faultcode(SamlBase):
- c_tag = 'faultcode'
+ c_tag = "faultcode"
c_namespace = NAMESPACE
- c_value_type = {'base': 'QName'}
+ c_value_type = {"base": "QName"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def fault_faultcode_from_string(xml_string):
return saml2.create_class_from_xml_string(Fault_faultcode, xml_string)
class Fault_faultstring(SamlBase):
- c_tag = 'faultstring'
+ c_tag = "faultstring"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def fault_faultstring_from_string(xml_string):
return saml2.create_class_from_xml_string(Fault_faultstring, xml_string)
class Fault_faultactor(SamlBase):
- c_tag = 'faultactor'
+ c_tag = "faultactor"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def fault_faultactor_from_string(xml_string):
return saml2.create_class_from_xml_string(Fault_faultactor, xml_string)
class Detail_(SamlBase):
- """The http://schemas.xmlsoap.org/soap/envelope/:detail element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:detail element"""
- c_tag = 'detail'
+ c_tag = "detail"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def detail__from_string(xml_string):
return saml2.create_class_from_xml_string(Detail_, xml_string)
class Envelope_(SamlBase):
- """The http://schemas.xmlsoap.org/soap/envelope/:Envelope element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Envelope element"""
- c_tag = 'Envelope'
+ c_tag = "Envelope"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/soap/envelope/}Header'] = ('header', Header_)
- c_cardinality['header'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/soap/envelope/}Body'] = ('body', Body_)
- c_child_order.extend(['header', 'body'])
-
- def __init__(self,
- header=None,
- body=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.header=header
- self.body=body
+ c_children["{http://schemas.xmlsoap.org/soap/envelope/}Header"] = ("header", Header_)
+ c_cardinality["header"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/soap/envelope/}Body"] = ("body", Body_)
+ c_child_order.extend(["header", "body"])
+
+ def __init__(
+ self,
+ header=None,
+ body=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.header = header
+ self.body = body
+
def envelope__from_string(xml_string):
return saml2.create_class_from_xml_string(Envelope_, xml_string)
class Header(Header_):
- """The http://schemas.xmlsoap.org/soap/envelope/:Header element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Header element"""
- c_tag = 'Header'
+ c_tag = "Header"
c_namespace = NAMESPACE
c_children = Header_.c_children.copy()
c_attributes = Header_.c_attributes.copy()
c_child_order = Header_.c_child_order[:]
c_cardinality = Header_.c_cardinality.copy()
+
def header_from_string(xml_string):
return saml2.create_class_from_xml_string(Header, xml_string)
class Body(Body_):
- """The http://schemas.xmlsoap.org/soap/envelope/:Body element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Body element"""
- c_tag = 'Body'
+ c_tag = "Body"
c_namespace = NAMESPACE
c_children = Body_.c_children.copy()
c_attributes = Body_.c_attributes.copy()
c_child_order = Body_.c_child_order[:]
c_cardinality = Body_.c_cardinality.copy()
+
def body_from_string(xml_string):
return saml2.create_class_from_xml_string(Body, xml_string)
class Fault_detail(Detail_):
- c_tag = 'detail'
+ c_tag = "detail"
c_namespace = NAMESPACE
c_children = Detail_.c_children.copy()
c_attributes = Detail_.c_attributes.copy()
c_child_order = Detail_.c_child_order[:]
c_cardinality = Detail_.c_cardinality.copy()
+
def fault_detail_from_string(xml_string):
return saml2.create_class_from_xml_string(Fault_detail, xml_string)
class Fault_(SamlBase):
- """The http://schemas.xmlsoap.org/soap/envelope/:Fault element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Fault element"""
- c_tag = 'Fault'
+ c_tag = "Fault"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/soap/envelope/}faultcode'] = ('faultcode', Fault_faultcode)
- c_children['{http://schemas.xmlsoap.org/soap/envelope/}faultstring'] = ('faultstring', Fault_faultstring)
- c_children['{http://schemas.xmlsoap.org/soap/envelope/}faultactor'] = ('faultactor', Fault_faultactor)
- c_cardinality['faultactor'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/soap/envelope/}detail'] = ('detail', Fault_detail)
- c_cardinality['detail'] = {"min":0, "max":1}
- c_child_order.extend(['faultcode', 'faultstring', 'faultactor', 'detail'])
-
- def __init__(self,
- faultcode=None,
- faultstring=None,
- faultactor=None,
- detail=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.faultcode=faultcode
- self.faultstring=faultstring
- self.faultactor=faultactor
- self.detail=detail
+ c_children["{http://schemas.xmlsoap.org/soap/envelope/}faultcode"] = ("faultcode", Fault_faultcode)
+ c_children["{http://schemas.xmlsoap.org/soap/envelope/}faultstring"] = ("faultstring", Fault_faultstring)
+ c_children["{http://schemas.xmlsoap.org/soap/envelope/}faultactor"] = ("faultactor", Fault_faultactor)
+ c_cardinality["faultactor"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/soap/envelope/}detail"] = ("detail", Fault_detail)
+ c_cardinality["detail"] = {"min": 0, "max": 1}
+ c_child_order.extend(["faultcode", "faultstring", "faultactor", "detail"])
+
+ def __init__(
+ self,
+ faultcode=None,
+ faultstring=None,
+ faultactor=None,
+ detail=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.faultcode = faultcode
+ self.faultstring = faultstring
+ self.faultactor = faultactor
+ self.detail = detail
+
def fault__from_string(xml_string):
return saml2.create_class_from_xml_string(Fault_, xml_string)
class Envelope(Envelope_):
- """The http://schemas.xmlsoap.org/soap/envelope/:Envelope element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Envelope element"""
- c_tag = 'Envelope'
+ c_tag = "Envelope"
c_namespace = NAMESPACE
c_children = Envelope_.c_children.copy()
c_attributes = Envelope_.c_attributes.copy()
c_child_order = Envelope_.c_child_order[:]
c_cardinality = Envelope_.c_cardinality.copy()
+
def envelope_from_string(xml_string):
return saml2.create_class_from_xml_string(Envelope, xml_string)
class Fault(Fault_):
- """The http://schemas.xmlsoap.org/soap/envelope/:Fault element """
+ """The http://schemas.xmlsoap.org/soap/envelope/:Fault element"""
- c_tag = 'Fault'
+ c_tag = "Fault"
c_namespace = NAMESPACE
c_children = Fault_.c_children.copy()
c_attributes = Fault_.c_attributes.copy()
c_child_order = Fault_.c_child_order[:]
c_cardinality = Fault_.c_cardinality.copy()
+
def fault_from_string(xml_string):
return saml2.create_class_from_xml_string(Fault, xml_string)
-#..................
+# ..................
# []
AG_encodingStyle = [
- ('encodingStyle', '', False),
+ ("encodingStyle", "", False),
]
ELEMENT_FROM_STRING = {
@@ -272,22 +292,21 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'Envelope': Envelope,
- 'Envelope': Envelope_,
- 'Header': Header,
- 'Header': Header_,
- 'Body': Body,
- 'Body': Body_,
- 'encodingStyle': EncodingStyle_,
- 'Fault': Fault,
- 'Fault': Fault_,
- 'detail': Detail_,
- 'faultcode': Fault_faultcode,
- 'faultstring': Fault_faultstring,
- 'faultactor': Fault_faultactor,
+ "Envelope": Envelope,
+ "Envelope": Envelope_,
+ "Header": Header,
+ "Header": Header_,
+ "Body": Body,
+ "Body": Body_,
+ "encodingStyle": EncodingStyle_,
+ "Fault": Fault,
+ "Fault": Fault_,
+ "detail": Detail_,
+ "faultcode": Fault_faultcode,
+ "faultstring": Fault_faultstring,
+ "faultactor": Fault_faultactor,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/schema/wsdl.py b/src/saml2/schema/wsdl.py
index 8cae5ceb..8b41ef1b 100644
--- a/src/saml2/schema/wsdl.py
+++ b/src/saml2/schema/wsdl.py
@@ -10,69 +10,75 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'http://schemas.xmlsoap.org/wsdl/'
+NAMESPACE = "http://schemas.xmlsoap.org/wsdl/"
+
class TDocumentation_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/:tDocumentation element """
+ """The http://schemas.xmlsoap.org/wsdl/:tDocumentation element"""
- c_tag = 'tDocumentation'
+ c_tag = "tDocumentation"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def t_documentation__from_string(xml_string):
return saml2.create_class_from_xml_string(TDocumentation_, xml_string)
class TDocumented_documentation(TDocumentation_):
- c_tag = 'documentation'
+ c_tag = "documentation"
c_namespace = NAMESPACE
c_children = TDocumentation_.c_children.copy()
c_attributes = TDocumentation_.c_attributes.copy()
c_child_order = TDocumentation_.c_child_order[:]
c_cardinality = TDocumentation_.c_cardinality.copy()
+
def t_documented_documentation_from_string(xml_string):
return saml2.create_class_from_xml_string(TDocumented_documentation, xml_string)
class TDocumented_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/:tDocumented element """
+ """The http://schemas.xmlsoap.org/wsdl/:tDocumented element"""
- c_tag = 'tDocumented'
+ c_tag = "tDocumented"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/}documentation'] = ('documentation', TDocumented_documentation)
- c_cardinality['documentation'] = {"min":0, "max":1}
- c_child_order.extend(['documentation'])
-
- def __init__(self,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.documentation=documentation
+ c_children["{http://schemas.xmlsoap.org/wsdl/}documentation"] = ("documentation", TDocumented_documentation)
+ c_cardinality["documentation"] = {"min": 0, "max": 1}
+ c_child_order.extend(["documentation"])
+
+ def __init__(
+ self,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.documentation = documentation
+
def t_documented__from_string(xml_string):
return saml2.create_class_from_xml_string(TDocumented_, xml_string)
class TExtensibleAttributesDocumented_(TDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tExtensibleAttributesDocumented element """
+ """The http://schemas.xmlsoap.org/wsdl/:tExtensibleAttributesDocumented element"""
- c_tag = 'tExtensibleAttributesDocumented'
+ c_tag = "tExtensibleAttributesDocumented"
c_namespace = NAMESPACE
c_children = TDocumented_.c_children.copy()
c_attributes = TDocumented_.c_attributes.copy()
@@ -81,9 +87,9 @@ class TExtensibleAttributesDocumented_(TDocumented_):
class TExtensibleDocumented_(TDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tExtensibleDocumented element """
+ """The http://schemas.xmlsoap.org/wsdl/:tExtensibleDocumented element"""
- c_tag = 'tExtensibleDocumented'
+ c_tag = "tExtensibleDocumented"
c_namespace = NAMESPACE
c_children = TDocumented_.c_children.copy()
c_attributes = TDocumented_.c_attributes.copy()
@@ -92,242 +98,264 @@ class TExtensibleDocumented_(TDocumented_):
class TImport_(TExtensibleAttributesDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tImport element """
+ """The http://schemas.xmlsoap.org/wsdl/:tImport element"""
- c_tag = 'tImport'
+ c_tag = "tImport"
c_namespace = NAMESPACE
c_children = TExtensibleAttributesDocumented_.c_children.copy()
c_attributes = TExtensibleAttributesDocumented_.c_attributes.copy()
c_child_order = TExtensibleAttributesDocumented_.c_child_order[:]
c_cardinality = TExtensibleAttributesDocumented_.c_cardinality.copy()
- c_attributes['namespace'] = ('namespace', 'anyURI', True)
- c_attributes['location'] = ('location', 'anyURI', True)
-
- def __init__(self,
- namespace=None,
- location=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleAttributesDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.namespace=namespace
- self.location=location
+ c_attributes["namespace"] = ("namespace", "anyURI", True)
+ c_attributes["location"] = ("location", "anyURI", True)
+
+ def __init__(
+ self,
+ namespace=None,
+ location=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleAttributesDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.namespace = namespace
+ self.location = location
+
def t_import__from_string(xml_string):
return saml2.create_class_from_xml_string(TImport_, xml_string)
class TTypes_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tTypes element """
+ """The http://schemas.xmlsoap.org/wsdl/:tTypes element"""
- c_tag = 'tTypes'
+ c_tag = "tTypes"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
+
def t_types__from_string(xml_string):
return saml2.create_class_from_xml_string(TTypes_, xml_string)
class TPart_(TExtensibleAttributesDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tPart element """
+ """The http://schemas.xmlsoap.org/wsdl/:tPart element"""
- c_tag = 'tPart'
+ c_tag = "tPart"
c_namespace = NAMESPACE
c_children = TExtensibleAttributesDocumented_.c_children.copy()
c_attributes = TExtensibleAttributesDocumented_.c_attributes.copy()
c_child_order = TExtensibleAttributesDocumented_.c_child_order[:]
c_cardinality = TExtensibleAttributesDocumented_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', True)
- c_attributes['element'] = ('element', 'QName', False)
- c_attributes['type'] = ('type', 'QName', False)
-
- def __init__(self,
- name=None,
- element=None,
- type=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleAttributesDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
- self.element=element
- self.type=type
+ c_attributes["name"] = ("name", "NCName", True)
+ c_attributes["element"] = ("element", "QName", False)
+ c_attributes["type"] = ("type", "QName", False)
+
+ def __init__(
+ self,
+ name=None,
+ element=None,
+ type=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleAttributesDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+ self.element = element
+ self.type = type
+
def t_part__from_string(xml_string):
return saml2.create_class_from_xml_string(TPart_, xml_string)
class TOperation_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tOperation element """
+ """The http://schemas.xmlsoap.org/wsdl/:tOperation element"""
- c_tag = 'tOperation'
+ c_tag = "tOperation"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', True)
- c_attributes['parameterOrder'] = ('parameter_order', 'NMTOKENS', False)
-
- def __init__(self,
- name=None,
- parameter_order=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
- self.parameter_order=parameter_order
+ c_attributes["name"] = ("name", "NCName", True)
+ c_attributes["parameterOrder"] = ("parameter_order", "NMTOKENS", False)
+
+ def __init__(
+ self,
+ name=None,
+ parameter_order=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+ self.parameter_order = parameter_order
+
def t_operation__from_string(xml_string):
return saml2.create_class_from_xml_string(TOperation_, xml_string)
class TParam_(TExtensibleAttributesDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tParam element """
+ """The http://schemas.xmlsoap.org/wsdl/:tParam element"""
- c_tag = 'tParam'
+ c_tag = "tParam"
c_namespace = NAMESPACE
c_children = TExtensibleAttributesDocumented_.c_children.copy()
c_attributes = TExtensibleAttributesDocumented_.c_attributes.copy()
c_child_order = TExtensibleAttributesDocumented_.c_child_order[:]
c_cardinality = TExtensibleAttributesDocumented_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', False)
- c_attributes['message'] = ('message', 'QName', True)
-
- def __init__(self,
- name=None,
- message=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleAttributesDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
- self.message=message
+ c_attributes["name"] = ("name", "NCName", False)
+ c_attributes["message"] = ("message", "QName", True)
+
+ def __init__(
+ self,
+ name=None,
+ message=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleAttributesDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+ self.message = message
+
def t_param__from_string(xml_string):
return saml2.create_class_from_xml_string(TParam_, xml_string)
class TFault_(TExtensibleAttributesDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tFault element """
+ """The http://schemas.xmlsoap.org/wsdl/:tFault element"""
- c_tag = 'tFault'
+ c_tag = "tFault"
c_namespace = NAMESPACE
c_children = TExtensibleAttributesDocumented_.c_children.copy()
c_attributes = TExtensibleAttributesDocumented_.c_attributes.copy()
c_child_order = TExtensibleAttributesDocumented_.c_child_order[:]
c_cardinality = TExtensibleAttributesDocumented_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', True)
- c_attributes['message'] = ('message', 'QName', True)
-
- def __init__(self,
- name=None,
- message=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleAttributesDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
- self.message=message
+ c_attributes["name"] = ("name", "NCName", True)
+ c_attributes["message"] = ("message", "QName", True)
+
+ def __init__(
+ self,
+ name=None,
+ message=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleAttributesDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+ self.message = message
+
def t_fault__from_string(xml_string):
return saml2.create_class_from_xml_string(TFault_, xml_string)
class TBindingOperationMessage_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tBindingOperationMessage element """
+ """The http://schemas.xmlsoap.org/wsdl/:tBindingOperationMessage element"""
- c_tag = 'tBindingOperationMessage'
+ c_tag = "tBindingOperationMessage"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', False)
-
- def __init__(self,
- name=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
+ c_attributes["name"] = ("name", "NCName", False)
+
+ def __init__(
+ self,
+ name=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+
def t_binding_operation_message__from_string(xml_string):
return saml2.create_class_from_xml_string(TBindingOperationMessage_, xml_string)
class TBindingOperationFault_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tBindingOperationFault element """
+ """The http://schemas.xmlsoap.org/wsdl/:tBindingOperationFault element"""
- c_tag = 'tBindingOperationFault'
+ c_tag = "tBindingOperationFault"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', True)
-
- def __init__(self,
- name=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
+ c_attributes["name"] = ("name", "NCName", True)
+
+ def __init__(
+ self,
+ name=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+
def t_binding_operation_fault__from_string(xml_string):
return saml2.create_class_from_xml_string(TBindingOperationFault_, xml_string)
@@ -335,215 +363,232 @@ def t_binding_operation_fault__from_string(xml_string):
class TBindingOperation_input(TBindingOperationMessage_):
- c_tag = 'input'
+ c_tag = "input"
c_namespace = NAMESPACE
c_children = TBindingOperationMessage_.c_children.copy()
c_attributes = TBindingOperationMessage_.c_attributes.copy()
c_child_order = TBindingOperationMessage_.c_child_order[:]
c_cardinality = TBindingOperationMessage_.c_cardinality.copy()
+
def t_binding_operation_input_from_string(xml_string):
return saml2.create_class_from_xml_string(TBindingOperation_input, xml_string)
class TBindingOperation_output(TBindingOperationMessage_):
- c_tag = 'output'
+ c_tag = "output"
c_namespace = NAMESPACE
c_children = TBindingOperationMessage_.c_children.copy()
c_attributes = TBindingOperationMessage_.c_attributes.copy()
c_child_order = TBindingOperationMessage_.c_child_order[:]
c_cardinality = TBindingOperationMessage_.c_cardinality.copy()
+
def t_binding_operation_output_from_string(xml_string):
return saml2.create_class_from_xml_string(TBindingOperation_output, xml_string)
class TBindingOperation_fault(TBindingOperationFault_):
- c_tag = 'fault'
+ c_tag = "fault"
c_namespace = NAMESPACE
c_children = TBindingOperationFault_.c_children.copy()
c_attributes = TBindingOperationFault_.c_attributes.copy()
c_child_order = TBindingOperationFault_.c_child_order[:]
c_cardinality = TBindingOperationFault_.c_cardinality.copy()
+
def t_binding_operation_fault_from_string(xml_string):
return saml2.create_class_from_xml_string(TBindingOperation_fault, xml_string)
class TBindingOperation_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tBindingOperation element """
+ """The http://schemas.xmlsoap.org/wsdl/:tBindingOperation element"""
- c_tag = 'tBindingOperation'
+ c_tag = "tBindingOperation"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/}input'] = ('input', TBindingOperation_input)
- c_cardinality['input'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/wsdl/}output'] = ('output', TBindingOperation_output)
- c_cardinality['output'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/wsdl/}fault'] = ('fault', [TBindingOperation_fault])
- c_cardinality['fault'] = {"min":0}
- c_attributes['name'] = ('name', 'NCName', True)
- c_child_order.extend(['input', 'output', 'fault'])
-
- def __init__(self,
- input=None,
- output=None,
- fault=None,
- name=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.input=input
- self.output=output
- self.fault=fault or []
- self.name=name
+ c_children["{http://schemas.xmlsoap.org/wsdl/}input"] = ("input", TBindingOperation_input)
+ c_cardinality["input"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/wsdl/}output"] = ("output", TBindingOperation_output)
+ c_cardinality["output"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/wsdl/}fault"] = ("fault", [TBindingOperation_fault])
+ c_cardinality["fault"] = {"min": 0}
+ c_attributes["name"] = ("name", "NCName", True)
+ c_child_order.extend(["input", "output", "fault"])
+
+ def __init__(
+ self,
+ input=None,
+ output=None,
+ fault=None,
+ name=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.input = input
+ self.output = output
+ self.fault = fault or []
+ self.name = name
+
def t_binding_operation__from_string(xml_string):
return saml2.create_class_from_xml_string(TBindingOperation_, xml_string)
class TPort_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tPort element """
+ """The http://schemas.xmlsoap.org/wsdl/:tPort element"""
- c_tag = 'tPort'
+ c_tag = "tPort"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_attributes['name'] = ('name', 'NCName', True)
- c_attributes['binding'] = ('binding', 'QName', True)
-
- def __init__(self,
- name=None,
- binding=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
- self.binding=binding
+ c_attributes["name"] = ("name", "NCName", True)
+ c_attributes["binding"] = ("binding", "QName", True)
+
+ def __init__(
+ self,
+ name=None,
+ binding=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+ self.binding = binding
+
def t_port__from_string(xml_string):
return saml2.create_class_from_xml_string(TPort_, xml_string)
class TExtensibilityElement_(SamlBase):
- """The http://schemas.xmlsoap.org/wsdl/:tExtensibilityElement element """
+ """The http://schemas.xmlsoap.org/wsdl/:tExtensibilityElement element"""
- c_tag = 'tExtensibilityElement'
+ c_tag = "tExtensibilityElement"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['required'] = ('required', 'None', False)
-
- def __init__(self,
- required=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.required=required
+ c_attributes["required"] = ("required", "None", False)
+
+ def __init__(
+ self,
+ required=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.required = required
class Import(TImport_):
- """The http://schemas.xmlsoap.org/wsdl/:import element """
+ """The http://schemas.xmlsoap.org/wsdl/:import element"""
- c_tag = 'import'
+ c_tag = "import"
c_namespace = NAMESPACE
c_children = TImport_.c_children.copy()
c_attributes = TImport_.c_attributes.copy()
c_child_order = TImport_.c_child_order[:]
c_cardinality = TImport_.c_cardinality.copy()
+
def import_from_string(xml_string):
return saml2.create_class_from_xml_string(Import, xml_string)
class Types(TTypes_):
- """The http://schemas.xmlsoap.org/wsdl/:types element """
+ """The http://schemas.xmlsoap.org/wsdl/:types element"""
- c_tag = 'types'
+ c_tag = "types"
c_namespace = NAMESPACE
c_children = TTypes_.c_children.copy()
c_attributes = TTypes_.c_attributes.copy()
c_child_order = TTypes_.c_child_order[:]
c_cardinality = TTypes_.c_cardinality.copy()
+
def types_from_string(xml_string):
return saml2.create_class_from_xml_string(Types, xml_string)
class TMessage_part(TPart_):
- c_tag = 'part'
+ c_tag = "part"
c_namespace = NAMESPACE
c_children = TPart_.c_children.copy()
c_attributes = TPart_.c_attributes.copy()
c_child_order = TPart_.c_child_order[:]
c_cardinality = TPart_.c_cardinality.copy()
+
def t_message_part_from_string(xml_string):
return saml2.create_class_from_xml_string(TMessage_part, xml_string)
class TMessage_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tMessage element """
+ """The http://schemas.xmlsoap.org/wsdl/:tMessage element"""
- c_tag = 'tMessage'
+ c_tag = "tMessage"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/}part'] = ('part', [TMessage_part])
- c_cardinality['part'] = {"min":0}
- c_attributes['name'] = ('name', 'NCName', True)
- c_child_order.extend(['part'])
-
- def __init__(self,
- part=None,
- name=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.part=part or []
- self.name=name
+ c_children["{http://schemas.xmlsoap.org/wsdl/}part"] = ("part", [TMessage_part])
+ c_cardinality["part"] = {"min": 0}
+ c_attributes["name"] = ("name", "NCName", True)
+ c_child_order.extend(["part"])
+
+ def __init__(
+ self,
+ part=None,
+ name=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.part = part or []
+ self.name = name
+
def t_message__from_string(xml_string):
return saml2.create_class_from_xml_string(TMessage_, xml_string)
@@ -551,47 +596,51 @@ def t_message__from_string(xml_string):
class TPortType_operation(TOperation_):
- c_tag = 'operation'
+ c_tag = "operation"
c_namespace = NAMESPACE
c_children = TOperation_.c_children.copy()
c_attributes = TOperation_.c_attributes.copy()
c_child_order = TOperation_.c_child_order[:]
c_cardinality = TOperation_.c_cardinality.copy()
+
def t_port_type_operation_from_string(xml_string):
return saml2.create_class_from_xml_string(TPortType_operation, xml_string)
class TPortType_(TExtensibleAttributesDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tPortType element """
+ """The http://schemas.xmlsoap.org/wsdl/:tPortType element"""
- c_tag = 'tPortType'
+ c_tag = "tPortType"
c_namespace = NAMESPACE
c_children = TExtensibleAttributesDocumented_.c_children.copy()
c_attributes = TExtensibleAttributesDocumented_.c_attributes.copy()
c_child_order = TExtensibleAttributesDocumented_.c_child_order[:]
c_cardinality = TExtensibleAttributesDocumented_.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/}operation'] = ('operation', [TPortType_operation])
- c_cardinality['operation'] = {"min":0}
- c_attributes['name'] = ('name', 'NCName', True)
- c_child_order.extend(['operation'])
-
- def __init__(self,
- operation=None,
- name=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleAttributesDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.operation=operation or []
- self.name=name
+ c_children["{http://schemas.xmlsoap.org/wsdl/}operation"] = ("operation", [TPortType_operation])
+ c_cardinality["operation"] = {"min": 0}
+ c_attributes["name"] = ("name", "NCName", True)
+ c_child_order.extend(["operation"])
+
+ def __init__(
+ self,
+ operation=None,
+ name=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleAttributesDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.operation = operation or []
+ self.name = name
+
def t_port_type__from_string(xml_string):
return saml2.create_class_from_xml_string(TPortType_, xml_string)
@@ -599,50 +648,54 @@ def t_port_type__from_string(xml_string):
class TBinding_operation(TBindingOperation_):
- c_tag = 'operation'
+ c_tag = "operation"
c_namespace = NAMESPACE
c_children = TBindingOperation_.c_children.copy()
c_attributes = TBindingOperation_.c_attributes.copy()
c_child_order = TBindingOperation_.c_child_order[:]
c_cardinality = TBindingOperation_.c_cardinality.copy()
+
def t_binding_operation_from_string(xml_string):
return saml2.create_class_from_xml_string(TBinding_operation, xml_string)
class TBinding_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tBinding element """
+ """The http://schemas.xmlsoap.org/wsdl/:tBinding element"""
- c_tag = 'tBinding'
+ c_tag = "tBinding"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/}operation'] = ('operation', [TBinding_operation])
- c_cardinality['operation'] = {"min":0}
- c_attributes['name'] = ('name', 'NCName', True)
- c_attributes['type'] = ('type', 'QName', True)
- c_child_order.extend(['operation'])
-
- def __init__(self,
- operation=None,
- name=None,
- type=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.operation=operation or []
- self.name=name
- self.type=type
+ c_children["{http://schemas.xmlsoap.org/wsdl/}operation"] = ("operation", [TBinding_operation])
+ c_cardinality["operation"] = {"min": 0}
+ c_attributes["name"] = ("name", "NCName", True)
+ c_attributes["type"] = ("type", "QName", True)
+ c_child_order.extend(["operation"])
+
+ def __init__(
+ self,
+ operation=None,
+ name=None,
+ type=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.operation = operation or []
+ self.name = name
+ self.type = type
+
def t_binding__from_string(xml_string):
return saml2.create_class_from_xml_string(TBinding_, xml_string)
@@ -650,181 +703,193 @@ def t_binding__from_string(xml_string):
class TService_port(TPort_):
- c_tag = 'port'
+ c_tag = "port"
c_namespace = NAMESPACE
c_children = TPort_.c_children.copy()
c_attributes = TPort_.c_attributes.copy()
c_child_order = TPort_.c_child_order[:]
c_cardinality = TPort_.c_cardinality.copy()
+
def t_service_port_from_string(xml_string):
return saml2.create_class_from_xml_string(TService_port, xml_string)
class TService_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tService element """
+ """The http://schemas.xmlsoap.org/wsdl/:tService element"""
- c_tag = 'tService'
+ c_tag = "tService"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/}port'] = ('port', [TService_port])
- c_cardinality['port'] = {"min":0}
- c_attributes['name'] = ('name', 'NCName', True)
- c_child_order.extend(['port'])
-
- def __init__(self,
- port=None,
- name=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.port=port or []
- self.name=name
+ c_children["{http://schemas.xmlsoap.org/wsdl/}port"] = ("port", [TService_port])
+ c_cardinality["port"] = {"min": 0}
+ c_attributes["name"] = ("name", "NCName", True)
+ c_child_order.extend(["port"])
+
+ def __init__(
+ self,
+ port=None,
+ name=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.port = port or []
+ self.name = name
+
def t_service__from_string(xml_string):
return saml2.create_class_from_xml_string(TService_, xml_string)
class Message(TMessage_):
- """The http://schemas.xmlsoap.org/wsdl/:message element """
+ """The http://schemas.xmlsoap.org/wsdl/:message element"""
- c_tag = 'message'
+ c_tag = "message"
c_namespace = NAMESPACE
c_children = TMessage_.c_children.copy()
c_attributes = TMessage_.c_attributes.copy()
c_child_order = TMessage_.c_child_order[:]
c_cardinality = TMessage_.c_cardinality.copy()
+
def message_from_string(xml_string):
return saml2.create_class_from_xml_string(Message, xml_string)
class PortType(TPortType_):
- """The http://schemas.xmlsoap.org/wsdl/:portType element """
+ """The http://schemas.xmlsoap.org/wsdl/:portType element"""
- c_tag = 'portType'
+ c_tag = "portType"
c_namespace = NAMESPACE
c_children = TPortType_.c_children.copy()
c_attributes = TPortType_.c_attributes.copy()
c_child_order = TPortType_.c_child_order[:]
c_cardinality = TPortType_.c_cardinality.copy()
+
def port_type_from_string(xml_string):
return saml2.create_class_from_xml_string(PortType, xml_string)
class Binding(TBinding_):
- """The http://schemas.xmlsoap.org/wsdl/:binding element """
+ """The http://schemas.xmlsoap.org/wsdl/:binding element"""
- c_tag = 'binding'
+ c_tag = "binding"
c_namespace = NAMESPACE
c_children = TBinding_.c_children.copy()
c_attributes = TBinding_.c_attributes.copy()
c_child_order = TBinding_.c_child_order[:]
c_cardinality = TBinding_.c_cardinality.copy()
+
def binding_from_string(xml_string):
return saml2.create_class_from_xml_string(Binding, xml_string)
class Service(TService_):
- """The http://schemas.xmlsoap.org/wsdl/:service element """
+ """The http://schemas.xmlsoap.org/wsdl/:service element"""
- c_tag = 'service'
+ c_tag = "service"
c_namespace = NAMESPACE
c_children = TService_.c_children.copy()
c_attributes = TService_.c_attributes.copy()
c_child_order = TService_.c_child_order[:]
c_cardinality = TService_.c_cardinality.copy()
+
def service_from_string(xml_string):
return saml2.create_class_from_xml_string(Service, xml_string)
class TDefinitions_(TExtensibleDocumented_):
- """The http://schemas.xmlsoap.org/wsdl/:tDefinitions element """
+ """The http://schemas.xmlsoap.org/wsdl/:tDefinitions element"""
- c_tag = 'tDefinitions'
+ c_tag = "tDefinitions"
c_namespace = NAMESPACE
c_children = TExtensibleDocumented_.c_children.copy()
c_attributes = TExtensibleDocumented_.c_attributes.copy()
c_child_order = TExtensibleDocumented_.c_child_order[:]
c_cardinality = TExtensibleDocumented_.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/wsdl/}import'] = ('import', Import)
- c_cardinality['import'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/wsdl/}types'] = ('types', Types)
- c_cardinality['types'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/wsdl/}message'] = ('message', Message)
- c_cardinality['message'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/wsdl/}portType'] = ('port_type', PortType)
- c_cardinality['port_type'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/wsdl/}binding'] = ('binding', Binding)
- c_cardinality['binding'] = {"min":0, "max":1}
- c_children['{http://schemas.xmlsoap.org/wsdl/}service'] = ('service', Service)
- c_cardinality['service'] = {"min":0, "max":1}
- c_attributes['targetNamespace'] = ('target_namespace', 'anyURI', False)
- c_attributes['name'] = ('name', 'NCName', False)
- c_child_order.extend(['import', 'types', 'message', 'port_type', 'binding', 'service'])
-
- def __init__(self,
- import_=None,
- types=None,
- message=None,
- port_type=None,
- binding=None,
- service=None,
- target_namespace=None,
- name=None,
- documentation=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- TExtensibleDocumented_.__init__(self,
- documentation=documentation,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.import_=import_
- self.types=types
- self.message=message
- self.port_type=port_type
- self.binding=binding
- self.service=service
- self.target_namespace=target_namespace
- self.name=name
+ c_children["{http://schemas.xmlsoap.org/wsdl/}import"] = ("import", Import)
+ c_cardinality["import"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/wsdl/}types"] = ("types", Types)
+ c_cardinality["types"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/wsdl/}message"] = ("message", Message)
+ c_cardinality["message"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/wsdl/}portType"] = ("port_type", PortType)
+ c_cardinality["port_type"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/wsdl/}binding"] = ("binding", Binding)
+ c_cardinality["binding"] = {"min": 0, "max": 1}
+ c_children["{http://schemas.xmlsoap.org/wsdl/}service"] = ("service", Service)
+ c_cardinality["service"] = {"min": 0, "max": 1}
+ c_attributes["targetNamespace"] = ("target_namespace", "anyURI", False)
+ c_attributes["name"] = ("name", "NCName", False)
+ c_child_order.extend(["import", "types", "message", "port_type", "binding", "service"])
+
+ def __init__(
+ self,
+ import_=None,
+ types=None,
+ message=None,
+ port_type=None,
+ binding=None,
+ service=None,
+ target_namespace=None,
+ name=None,
+ documentation=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ TExtensibleDocumented_.__init__(
+ self,
+ documentation=documentation,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.import_ = import_
+ self.types = types
+ self.message = message
+ self.port_type = port_type
+ self.binding = binding
+ self.service = service
+ self.target_namespace = target_namespace
+ self.name = name
+
def t_definitions__from_string(xml_string):
return saml2.create_class_from_xml_string(TDefinitions_, xml_string)
class Definitions(TDefinitions_):
- """The http://schemas.xmlsoap.org/wsdl/:definitions element """
+ """The http://schemas.xmlsoap.org/wsdl/:definitions element"""
- c_tag = 'definitions'
+ c_tag = "definitions"
c_namespace = NAMESPACE
c_children = TDefinitions_.c_children.copy()
c_attributes = TDefinitions_.c_attributes.copy()
c_child_order = TDefinitions_.c_child_order[:]
c_cardinality = TDefinitions_.c_cardinality.copy()
+
def definitions_from_string(xml_string):
return saml2.create_class_from_xml_string(Definitions, xml_string)
-#..................
+# ..................
# []
ELEMENT_FROM_STRING = {
TDocumentation_.c_tag: t_documentation__from_string,
@@ -861,43 +926,42 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'tDocumentation': TDocumentation_,
- 'tDocumented': TDocumented_,
- 'definitions': Definitions,
- 'tDefinitions': TDefinitions_,
- 'tImport': TImport_,
- 'tTypes': TTypes_,
- 'tMessage': TMessage_,
- 'tPart': TPart_,
- 'tPortType': TPortType_,
- 'tOperation': TOperation_,
- 'tParam': TParam_,
- 'tFault': TFault_,
- 'tBinding': TBinding_,
- 'tBindingOperationMessage': TBindingOperationMessage_,
- 'tBindingOperationFault': TBindingOperationFault_,
- 'tBindingOperation': TBindingOperation_,
- 'tService': TService_,
- 'tPort': TPort_,
- 'documentation': TDocumented_documentation,
- 'input': TBindingOperation_input,
- 'output': TBindingOperation_output,
- 'fault': TBindingOperation_fault,
- 'import': Import,
- 'types': Types,
- 'part': TMessage_part,
- 'operation': TPortType_operation,
- 'port': TService_port,
- 'message': Message,
- 'portType': PortType,
- 'binding': Binding,
- 'service': Service,
- 'tExtensibleAttributesDocumented': TExtensibleAttributesDocumented_,
- 'tExtensibleDocumented': TExtensibleDocumented_,
- 'tExtensibilityElement': TExtensibilityElement_,
+ "tDocumentation": TDocumentation_,
+ "tDocumented": TDocumented_,
+ "definitions": Definitions,
+ "tDefinitions": TDefinitions_,
+ "tImport": TImport_,
+ "tTypes": TTypes_,
+ "tMessage": TMessage_,
+ "tPart": TPart_,
+ "tPortType": TPortType_,
+ "tOperation": TOperation_,
+ "tParam": TParam_,
+ "tFault": TFault_,
+ "tBinding": TBinding_,
+ "tBindingOperationMessage": TBindingOperationMessage_,
+ "tBindingOperationFault": TBindingOperationFault_,
+ "tBindingOperation": TBindingOperation_,
+ "tService": TService_,
+ "tPort": TPort_,
+ "documentation": TDocumented_documentation,
+ "input": TBindingOperation_input,
+ "output": TBindingOperation_output,
+ "fault": TBindingOperation_fault,
+ "import": Import,
+ "types": Types,
+ "part": TMessage_part,
+ "operation": TPortType_operation,
+ "port": TService_port,
+ "message": Message,
+ "portType": PortType,
+ "binding": Binding,
+ "service": Service,
+ "tExtensibleAttributesDocumented": TExtensibleAttributesDocumented_,
+ "tExtensibleDocumented": TExtensibleDocumented_,
+ "tExtensibilityElement": TExtensibilityElement_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/sdb.py b/src/saml2/sdb.py
index 01c69aea..4349b310 100644
--- a/src/saml2/sdb.py
+++ b/src/saml2/sdb.py
@@ -1,6 +1,5 @@
-import logging
-
from hashlib import sha1
+import logging
from saml2.ident import code_binary
@@ -12,11 +11,12 @@ def context_match(cfilter, cntx):
# TODO
return True
+
# The key to the stored authn statement is placed encrypted in the cookie
class SessionStorage(object):
- """ In memory storage of session information """
+ """In memory storage of session information"""
def __init__(self):
self.db = {"assertion": {}, "authn": {}}
@@ -34,8 +34,7 @@ class SessionStorage(object):
def get_assertion(self, cid):
return self.assertion[cid]
- def get_authn_statements(self, name_id, session_index=None,
- requested_context=None):
+ def get_authn_statements(self, name_id, session_index=None, requested_context=None):
"""
:param name_id:
@@ -56,8 +55,7 @@ class SessionStorage(object):
if statement.session_index != session_index:
continue
if requested_context:
- if not context_match(requested_context,
- statement[0].authn_context):
+ if not context_match(requested_context, statement[0].authn_context):
continue
result.append(statement)
diff --git a/src/saml2/server.py b/src/saml2/server.py
index 3a12211a..5eff08d0 100644
--- a/src/saml2/server.py
+++ b/src/saml2/server.py
@@ -5,50 +5,47 @@
"""Contains classes and functions that a SAML2.0 Identity provider (IdP)
or attribute authority (AA) may use to conclude its tasks.
"""
-import logging
-
-import importlib
import dbm
+import importlib
+import logging
import shelve
-import six
import threading
-import saml2.cryptography.symmetric
-from saml2 import saml
-from saml2 import element_to_extension_element
-from saml2 import class_name
-from saml2 import BINDING_HTTP_REDIRECT
-from saml2.argtree import add_path, is_set
+import six
+from saml2 import BINDING_HTTP_REDIRECT
+from saml2 import class_name
+from saml2 import element_to_extension_element
+from saml2 import saml
+from saml2.argtree import add_path
+from saml2.argtree import is_set
+from saml2.assertion import Assertion
+from saml2.assertion import Policy
+from saml2.assertion import filter_attribute_value_assertions
+from saml2.assertion import restriction_from_attribute_spec
+import saml2.cryptography.symmetric
from saml2.entity import Entity
from saml2.eptid import Eptid
from saml2.eptid import EptidShelve
-from saml2.samlp import NameIDMappingResponse
-from saml2.sdb import SessionStorage
-from saml2.schema import soapenv
-
-from saml2.request import AuthnRequest
+from saml2.ident import IdentDB
+from saml2.ident import decode
+from saml2.profile import ecp
from saml2.request import AssertionIDRequest
from saml2.request import AttributeQuery
-from saml2.request import NameIDMappingRequest
-from saml2.request import AuthzDecisionQuery
from saml2.request import AuthnQuery
-
+from saml2.request import AuthnRequest
+from saml2.request import AuthzDecisionQuery
+from saml2.request import NameIDMappingRequest
from saml2.s_utils import MissingValue
-from saml2.s_utils import rndstr
from saml2.s_utils import Unknown
-
+from saml2.s_utils import rndstr
+from saml2.samlp import NameIDMappingResponse
+from saml2.schema import soapenv
+from saml2.sdb import SessionStorage
+from saml2.sigver import CertificateError
from saml2.sigver import pre_signature_part
from saml2.sigver import signed_instance_factory
-from saml2.sigver import CertificateError
-
-from saml2.assertion import Assertion
-from saml2.assertion import Policy
-from saml2.assertion import restriction_from_attribute_spec
-from saml2.assertion import filter_attribute_value_assertions
-from saml2.ident import IdentDB, decode
-from saml2.profile import ecp
logger = logging.getLogger(__name__)
@@ -57,7 +54,7 @@ AUTHN_DICT_MAP = {
"authn_auth": "authn_auth",
"class_ref": "authn_class",
"authn_instant": "authn_instant",
- "subject_locality": "subject_locality"
+ "subject_locality": "subject_locality",
}
@@ -66,15 +63,15 @@ def _shelve_compat(name, *args, **kwargs):
return shelve.open(name, *args, **kwargs)
except dbm.error[0]:
# Python 3 whichdb needs to try .db to determine type
- if name.endswith('.db'):
- name = name.rsplit('.db', 1)[0]
+ if name.endswith(".db"):
+ name = name.rsplit(".db", 1)[0]
return shelve.open(name, *args, **kwargs)
else:
raise
class Server(Entity):
- """ A class that does things that IdPs or AAs do """
+ """A class that does things that IdPs or AAs do"""
def __init__(
self,
@@ -120,12 +117,13 @@ class Server(Entity):
typ, data = _spec
if typ.lower() == "mongodb":
from saml2.mongo_store import SessionStorageMDB
+
return SessionStorageMDB(database=data, collection="session")
raise NotImplementedError("No such storage type implemented")
def init_config(self, stype="idp"):
- """ Remaining init of the server configuration
+ """Remaining init of the server configuration
:param stype: The type of Server ("idp"/"aa")
"""
@@ -148,14 +146,16 @@ class Server(Entity):
idb = _shelve_compat(addr, writeback=True, protocol=2)
elif typ == "memcached":
import memcache
+
idb = memcache.Client(addr)
elif typ == "dict": # in-memory dictionary
idb = {}
elif typ == "mongodb":
from saml2.mongo_store import IdentMDB
+
self.ident = IdentMDB(database=addr, collection="ident")
elif typ == "identdb":
- mod, clas = addr.rsplit('.', 1)
+ mod, clas = addr.rsplit(".", 1)
mod = importlib.import_module(mod)
self.ident = getattr(mod, clas)()
@@ -164,8 +164,7 @@ class Server(Entity):
elif idb is not None:
self.ident = IdentDB(idb)
elif dbspec:
- raise Exception("Couldn't open identity database: %s" %
- (dbspec,))
+ raise Exception("Couldn't open identity database: %s" % (dbspec,))
try:
_domain = self.config.getattr("domain", "idp")
@@ -185,8 +184,8 @@ class Server(Entity):
self.eptid = EptidShelve(secret, addr)
elif typ == "mongodb":
from saml2.mongo_store import EptidMDB
- self.eptid = EptidMDB(secret, database=addr,
- collection="eptid")
+
+ self.eptid = EptidMDB(secret, database=addr, collection="eptid")
else:
self.eptid = Eptid(secret)
except Exception:
@@ -194,7 +193,7 @@ class Server(Entity):
raise
def wants(self, sp_entity_id, index=None):
- """ Returns what attributes the SP requires and which are optional
+ """Returns what attributes the SP requires and which are optional
if any such demands are registered in the Metadata.
:param sp_entity_id: The entity id of the SP
@@ -225,8 +224,9 @@ class Server(Entity):
# -------------------------------------------------------------------------
- def parse_authn_request(self, enc_request, binding=BINDING_HTTP_REDIRECT,
- relay_state=None, sigalg=None, signature=None):
+ def parse_authn_request(
+ self, enc_request, binding=BINDING_HTTP_REDIRECT, relay_state=None, sigalg=None, signature=None
+ ):
"""Parse a Authentication Request
:param enc_request: The request in its transport format
@@ -238,99 +238,109 @@ class Server(Entity):
:return: A request instance
"""
- return self._parse_request(enc_request, AuthnRequest,
- "single_sign_on_service", binding,
- relay_state=relay_state, sigalg=sigalg,
- signature=signature)
+ return self._parse_request(
+ enc_request,
+ AuthnRequest,
+ "single_sign_on_service",
+ binding,
+ relay_state=relay_state,
+ sigalg=sigalg,
+ signature=signature,
+ )
def parse_attribute_query(self, xml_string, binding):
- """ Parse an attribute query
+ """Parse an attribute query
:param xml_string: The Attribute Query as an XML string
:param binding: Which binding that was used for the request
:return: A query instance
"""
- return self._parse_request(xml_string, AttributeQuery,
- "attribute_service", binding)
+ return self._parse_request(xml_string, AttributeQuery, "attribute_service", binding)
def parse_authz_decision_query(self, xml_string, binding):
- """ Parse an authorization decision query
+ """Parse an authorization decision query
:param xml_string: The Authz decision Query as an XML string
:param binding: Which binding that was used when receiving this query
:return: Query instance
"""
- return self._parse_request(xml_string, AuthzDecisionQuery,
- "authz_service", binding)
+ return self._parse_request(xml_string, AuthzDecisionQuery, "authz_service", binding)
def parse_assertion_id_request(self, xml_string, binding):
- """ Parse an assertion id query
+ """Parse an assertion id query
:param xml_string: The AssertionIDRequest as an XML string
:param binding: Which binding that was used when receiving this request
:return: Query instance
"""
- return self._parse_request(xml_string, AssertionIDRequest,
- "assertion_id_request_service", binding)
+ return self._parse_request(xml_string, AssertionIDRequest, "assertion_id_request_service", binding)
def parse_authn_query(self, xml_string, binding):
- """ Parse an authn query
+ """Parse an authn query
:param xml_string: The AuthnQuery as an XML string
:param binding: Which binding that was used when receiving this query
:return: Query instance
"""
- return self._parse_request(xml_string, AuthnQuery,
- "authn_query_service", binding)
+ return self._parse_request(xml_string, AuthnQuery, "authn_query_service", binding)
def parse_name_id_mapping_request(self, xml_string, binding):
- """ Parse a nameid mapping request
+ """Parse a nameid mapping request
:param xml_string: The NameIDMappingRequest as an XML string
:param binding: Which binding that was used when receiving this request
:return: Query instance
"""
- return self._parse_request(xml_string, NameIDMappingRequest,
- "name_id_mapping_service", binding)
+ return self._parse_request(xml_string, NameIDMappingRequest, "name_id_mapping_service", binding)
@staticmethod
def update_farg(in_response_to, consumer_url, farg=None):
if not farg:
- farg = add_path(
- {},
- ['assertion', 'subject', 'subject_confirmation', 'method',
- saml.SCM_BEARER])
+ farg = add_path({}, ["assertion", "subject", "subject_confirmation", "method", saml.SCM_BEARER])
add_path(
- farg['assertion']['subject']['subject_confirmation'],
- ['subject_confirmation_data', 'in_response_to', in_response_to])
+ farg["assertion"]["subject"]["subject_confirmation"],
+ ["subject_confirmation_data", "in_response_to", in_response_to],
+ )
add_path(
- farg['assertion']['subject']['subject_confirmation'],
- ['subject_confirmation_data', 'recipient', consumer_url])
+ farg["assertion"]["subject"]["subject_confirmation"],
+ ["subject_confirmation_data", "recipient", consumer_url],
+ )
else:
- if not is_set(farg,
- ['assertion', 'subject', 'subject_confirmation',
- 'method']):
- add_path(farg,
- ['assertion', 'subject', 'subject_confirmation',
- 'method', saml.SCM_BEARER])
- if not is_set(farg,
- ['assertion', 'subject', 'subject_confirmation',
- 'subject_confirmation_data', 'in_response_to']):
- add_path(farg,
- ['assertion', 'subject', 'subject_confirmation',
- 'subject_confirmation_data', 'in_response_to',
- in_response_to])
- if not is_set(farg, ['assertion', 'subject', 'subject_confirmation',
- 'subject_confirmation_data', 'recipient']):
- add_path(farg,
- ['assertion', 'subject', 'subject_confirmation',
- 'subject_confirmation_data', 'recipient',
- consumer_url])
+ if not is_set(farg, ["assertion", "subject", "subject_confirmation", "method"]):
+ add_path(farg, ["assertion", "subject", "subject_confirmation", "method", saml.SCM_BEARER])
+ if not is_set(
+ farg, ["assertion", "subject", "subject_confirmation", "subject_confirmation_data", "in_response_to"]
+ ):
+ add_path(
+ farg,
+ [
+ "assertion",
+ "subject",
+ "subject_confirmation",
+ "subject_confirmation_data",
+ "in_response_to",
+ in_response_to,
+ ],
+ )
+ if not is_set(
+ farg, ["assertion", "subject", "subject_confirmation", "subject_confirmation_data", "recipient"]
+ ):
+ add_path(
+ farg,
+ [
+ "assertion",
+ "subject",
+ "subject_confirmation",
+ "subject_confirmation_data",
+ "recipient",
+ consumer_url,
+ ],
+ )
return farg
def setup_assertion(
@@ -394,29 +404,42 @@ class Server(Entity):
if authn: # expected to be a dictionary
# Would like to use dict comprehension but ...
- authn_args = dict(
- [(AUTHN_DICT_MAP[k], v) for k, v in authn.items() if
- k in AUTHN_DICT_MAP])
+ authn_args = dict([(AUTHN_DICT_MAP[k], v) for k, v in authn.items() if k in AUTHN_DICT_MAP])
authn_args.update(kwargs)
assertion = ast.construct(
- sp_entity_id, self.config.attribute_converters, policy,
- issuer=_issuer, farg=farg['assertion'], name_id=name_id,
+ sp_entity_id,
+ self.config.attribute_converters,
+ policy,
+ issuer=_issuer,
+ farg=farg["assertion"],
+ name_id=name_id,
session_not_on_or_after=session_not_on_or_after,
- **authn_args)
+ **authn_args,
+ )
elif authn_statement: # Got a complete AuthnStatement
assertion = ast.construct(
- sp_entity_id, self.config.attribute_converters, policy,
- issuer=_issuer, authn_statem=authn_statement,
- farg=farg['assertion'], name_id=name_id,
- **kwargs)
+ sp_entity_id,
+ self.config.attribute_converters,
+ policy,
+ issuer=_issuer,
+ authn_statem=authn_statement,
+ farg=farg["assertion"],
+ name_id=name_id,
+ **kwargs,
+ )
else:
assertion = ast.construct(
- sp_entity_id, self.config.attribute_converters, policy,
- issuer=_issuer, farg=farg['assertion'], name_id=name_id,
+ sp_entity_id,
+ self.config.attribute_converters,
+ policy,
+ issuer=_issuer,
+ farg=farg["assertion"],
+ name_id=name_id,
session_not_on_or_after=session_not_on_or_after,
- **kwargs)
+ **kwargs,
+ )
return assertion
# XXX DONE calls pre_signature_part
@@ -447,7 +470,7 @@ class Server(Entity):
farg=None,
session_not_on_or_after=None,
):
- """ Create a response. A layer of indirection.
+ """Create a response. A layer of indirection.
:param in_response_to: The session identifier of the request
:param consumer_url: The URL which should receive the response
@@ -497,12 +520,34 @@ class Server(Entity):
encrypted_advice_attributes = True
encrypt_assertion_self_contained = True
assertion_attributes = self.setup_assertion(
- None, sp_entity_id, None, None, None, policy, None, None,
- identity, best_effort, sign_response, farg=farg)
+ None,
+ sp_entity_id,
+ None,
+ None,
+ None,
+ policy,
+ None,
+ None,
+ identity,
+ best_effort,
+ sign_response,
+ farg=farg,
+ )
assertion = self.setup_assertion(
- authn, sp_entity_id, in_response_to, consumer_url, name_id,
- policy, _issuer, authn_statement, [], True, sign_response,
- farg=farg, session_not_on_or_after=session_not_on_or_after)
+ authn,
+ sp_entity_id,
+ in_response_to,
+ consumer_url,
+ name_id,
+ policy,
+ _issuer,
+ authn_statement,
+ [],
+ True,
+ sign_response,
+ farg=farg,
+ session_not_on_or_after=session_not_on_or_after,
+ )
assertion.advice = saml.Advice()
# assertion.advice.assertion_id_ref.append(saml.AssertionIDRef())
@@ -510,10 +555,20 @@ class Server(Entity):
assertion.advice.assertion.append(assertion_attributes)
else:
assertion = self.setup_assertion(
- authn, sp_entity_id, in_response_to, consumer_url, name_id,
- policy, _issuer, authn_statement, identity, True,
- sign_response, farg=farg,
- session_not_on_or_after=session_not_on_or_after)
+ authn,
+ sp_entity_id,
+ in_response_to,
+ consumer_url,
+ name_id,
+ policy,
+ _issuer,
+ authn_statement,
+ identity,
+ True,
+ sign_response,
+ farg=farg,
+ session_not_on_or_after=session_not_on_or_after,
+ )
to_sign = []
if not encrypt_assertion:
@@ -533,7 +588,7 @@ class Server(Entity):
)
to_sign.append((class_name(assertion), assertion.id))
- if (self.support_AssertionIDRequest() or self.support_AuthnQuery()):
+ if self.support_AssertionIDRequest() or self.support_AuthnQuery():
self.session_db.store_assertion(assertion, to_sign)
return self._response(
@@ -577,7 +632,7 @@ class Server(Entity):
farg=None,
**kwargs,
):
- """ Create an attribute assertion response.
+ """Create an attribute assertion response.
:param identity: A dictionary with attributes and values that are
expected to be the bases for the assertion in the response.
@@ -621,9 +676,13 @@ class Server(Entity):
ast = filter_attribute_value_assertions(ast, restr)
assertion = ast.construct(
- sp_entity_id, self.config.attribute_converters, policy,
- issuer=_issuer, name_id=name_id,
- farg=farg['assertion'])
+ sp_entity_id,
+ self.config.attribute_converters,
+ policy,
+ issuer=_issuer,
+ name_id=name_id,
+ farg=farg["assertion"],
+ )
return self._response(
in_response_to,
@@ -640,9 +699,7 @@ class Server(Entity):
**kwargs,
)
- def gather_authn_response_args(
- self, sp_entity_id, name_id_policy, userid, **kwargs
- ):
+ def gather_authn_response_args(self, sp_entity_id, name_id_policy, userid, **kwargs):
kwargs["policy"] = kwargs.get("release_policy")
# collect args and return them
@@ -650,33 +707,26 @@ class Server(Entity):
# XXX will be passed to _authn_response
param_defaults = {
- 'policy': None,
- 'best_effort': False,
- 'sign_assertion': False,
- 'sign_response': False,
- 'encrypt_assertion': False,
- 'encrypt_assertion_self_contained': True,
- 'encrypted_advice_attributes': False,
- 'encrypt_cert_advice': None,
- 'encrypt_cert_assertion': None,
+ "policy": None,
+ "best_effort": False,
+ "sign_assertion": False,
+ "sign_response": False,
+ "encrypt_assertion": False,
+ "encrypt_assertion_self_contained": True,
+ "encrypted_advice_attributes": False,
+ "encrypt_cert_advice": None,
+ "encrypt_cert_assertion": None,
# need to be named sign_alg and digest_alg
}
for param, val_default in param_defaults.items():
val_kw = kwargs.get(param)
val_config = self.config.getattr(param, "idp")
- args[param] = (
- val_kw
- if val_kw is not None
- else val_config
- if val_config is not None
- else val_default
- )
+ args[param] = val_kw if val_kw is not None else val_config if val_config is not None else val_default
for arg, attr, eca, pefim in [
- ('encrypted_advice_attributes', 'verify_encrypt_cert_advice',
- 'encrypt_cert_advice', kwargs["pefim"]),
- ('encrypt_assertion', 'verify_encrypt_cert_assertion',
- 'encrypt_cert_assertion', False)]:
+ ("encrypted_advice_attributes", "verify_encrypt_cert_advice", "encrypt_cert_advice", kwargs["pefim"]),
+ ("encrypt_assertion", "verify_encrypt_cert_assertion", "encrypt_cert_assertion", False),
+ ]:
if args[arg] or pefim:
_enc_cert = self.config.getattr(attr, "idp")
@@ -684,19 +734,16 @@ class Server(Entity):
if _enc_cert is not None:
if kwargs[eca] is None:
raise CertificateError(
- "No SPCertEncType certificate for encryption "
- "contained in authentication "
- "request.")
+ "No SPCertEncType certificate for encryption " "contained in authentication " "request."
+ )
if not _enc_cert(kwargs[eca]):
- raise CertificateError(
- "Invalid certificate for encryption!")
+ raise CertificateError("Invalid certificate for encryption!")
- if 'name_id' not in kwargs or not kwargs['name_id']:
+ if "name_id" not in kwargs or not kwargs["name_id"]:
nid_formats = []
for _sp in self.metadata[sp_entity_id]["spsso_descriptor"]:
if "name_id_format" in _sp:
- nid_formats.extend([n["text"] for n in
- _sp["name_id_format"]])
+ nid_formats.extend([n["text"] for n in _sp["name_id_format"]])
try:
snq = name_id_policy.sp_name_qualifier
except AttributeError:
@@ -715,16 +762,14 @@ class Server(Entity):
_nids = self.ident.find_nameid(userid, **kwa)
# either none or one
if _nids:
- args['name_id'] = _nids[0]
+ args["name_id"] = _nids[0]
else:
- args['name_id'] = self.ident.construct_nameid(
- userid, args['policy'], sp_entity_id, name_id_policy)
- logger.debug("construct_nameid: %s => %s", userid,
- args['name_id'])
+ args["name_id"] = self.ident.construct_nameid(userid, args["policy"], sp_entity_id, name_id_policy)
+ logger.debug("construct_nameid: %s => %s", userid, args["name_id"])
else:
- args['name_id'] = kwargs['name_id']
+ args["name_id"] = kwargs["name_id"]
- for param in ['status', 'farg']:
+ for param in ["status", "farg"]:
try:
args[param] = kwargs[param]
except KeyError:
@@ -757,7 +802,7 @@ class Server(Entity):
session_not_on_or_after=None,
**kwargs,
):
- """ Constructs an AuthenticationResponse
+ """Constructs an AuthenticationResponse
:param identity: Information about an user
:param in_response_to: The identifier of the authentication request
@@ -879,9 +924,7 @@ class Server(Entity):
# XXX DONE calls pre_signature_part
# XXX DONE idp create > [...]
- def create_assertion_id_request_response(
- self, assertion_id, sign=None, sign_alg=None, digest_alg=None, **kwargs
- ):
+ def create_assertion_id_request_response(self, assertion_id, sign=None, sign_alg=None, digest_alg=None, **kwargs):
try:
(assertion, to_sign) = self.session_db.get_assertion(assertion_id)
except KeyError:
@@ -938,9 +981,7 @@ class Server(Entity):
ms_args = self.message_args()
- _resp = NameIDMappingResponse(
- name_id, encrypted_id, in_response_to=in_response_to, **ms_args
- )
+ _resp = NameIDMappingResponse(name_id, encrypted_id, in_response_to=in_response_to, **ms_args)
if sign_response:
return self.sign(_resp, sign_alg=sign_alg, digest_alg=digest_alg)
@@ -972,9 +1013,7 @@ class Server(Entity):
margs = self.message_args()
asserts = [
saml.Assertion(authn_statement=statement, subject=subject, **margs)
- for statement in self.session_db.get_authn_statements(
- subject.name_id, session_index, requested_context
- )
+ for statement in self.session_db.get_authn_statements(subject.name_id, session_index, requested_context)
]
if asserts:
@@ -1044,7 +1083,7 @@ class Server(Entity):
sign_response,
sign_assertion,
sign_alg=sign_alg,
- digest_alg=digest_alg
+ digest_alg=digest_alg,
)
body = soapenv.Body()
body.extension_elements = [element_to_extension_element(response)]
diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py
index a5295fa5..63e67ab3 100644
--- a/src/saml2/sigver.py
+++ b/src/saml2/sigver.py
@@ -4,20 +4,21 @@ Based on the use of xmlsec1 binaries and not the python xmlsec module.
import base64
import datetime
-import dateutil
import hashlib
import itertools
import logging
import os
import re
-import six
+from subprocess import PIPE
+from subprocess import Popen
import sys
+from tempfile import NamedTemporaryFile
+from time import mktime
from uuid import uuid4 as gen_random_key
-from time import mktime
-from tempfile import NamedTemporaryFile
-from subprocess import Popen
-from subprocess import PIPE
+import dateutil
+import six
+
# importlib.resources was introduced in python 3.7
# files API from importlib.resources introduced in python 3.9
@@ -27,57 +28,56 @@ else:
from importlib_resources import files as _resource_files
from OpenSSL import crypto
-
import pytz
-
from six.moves.urllib import parse
-import saml2.cryptography.asymmetric
-import saml2.cryptography.pki
-import saml2.xmldsig as ds
-import saml2.data.templates as _data_template
-from saml2 import samlp
+from saml2 import ExtensionElement
from saml2 import SamlBase
from saml2 import SAMLError
-from saml2 import extension_elements_to_elements
from saml2 import class_name
+from saml2 import extension_elements_to_elements
from saml2 import saml
-from saml2 import ExtensionElement
+from saml2 import samlp
+from saml2.cert import CertificateError
from saml2.cert import OpenSSLWrapper
from saml2.cert import read_cert_from_file
-from saml2.cert import CertificateError
+import saml2.cryptography.asymmetric
+import saml2.cryptography.pki
+import saml2.data.templates as _data_template
from saml2.extension import pefim
from saml2.extension.pefim import SPCertEnc
-from saml2.saml import EncryptedAssertion
from saml2.s_utils import Unsupported
+from saml2.saml import EncryptedAssertion
from saml2.time_util import str_to_time
+from saml2.xml.schema import XMLSchemaError
+from saml2.xml.schema import validate as validate_doc_with_schema
from saml2.xmldsig import ALLOWED_CANONICALIZATIONS
from saml2.xmldsig import ALLOWED_TRANSFORMS
-from saml2.xmldsig import TRANSFORM_C14N
-from saml2.xmldsig import TRANSFORM_ENVELOPED
from saml2.xmldsig import SIG_RSA_SHA1
from saml2.xmldsig import SIG_RSA_SHA224
from saml2.xmldsig import SIG_RSA_SHA256
from saml2.xmldsig import SIG_RSA_SHA384
from saml2.xmldsig import SIG_RSA_SHA512
-from saml2.xmlenc import EncryptionMethod
-from saml2.xmlenc import EncryptedKey
+from saml2.xmldsig import TRANSFORM_C14N
+from saml2.xmldsig import TRANSFORM_ENVELOPED
+import saml2.xmldsig as ds
from saml2.xmlenc import CipherData
from saml2.xmlenc import CipherValue
from saml2.xmlenc import EncryptedData
-from saml2.xml.schema import validate as validate_doc_with_schema
-from saml2.xml.schema import XMLSchemaError
+from saml2.xmlenc import EncryptedKey
+from saml2.xmlenc import EncryptionMethod
logger = logging.getLogger(__name__)
-SIG = '{{{ns}#}}{attribute}'.format(ns=ds.NAMESPACE, attribute='Signature')
+SIG = "{{{ns}#}}{attribute}".format(ns=ds.NAMESPACE, attribute="Signature")
# RSA_1_5 is considered deprecated
-RSA_1_5 = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5'
-TRIPLE_DES_CBC = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc'
+RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5"
+TRIPLE_DES_CBC = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
RSA_OAEP_MGF1P = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
+
class SigverError(SAMLError):
pass
@@ -108,14 +108,15 @@ class SignatureError(XmlsecError):
class BadSignature(SigverError):
"""The signature is invalid."""
+
pass
def get_pem_wrapped_unwrapped(cert):
begin_cert = "-----BEGIN CERTIFICATE-----\n"
end_cert = "\n-----END CERTIFICATE-----\n"
- unwrapped_cert = re.sub(f'{begin_cert}|{end_cert}', '', cert)
- wrapped_cert = f'{begin_cert}{unwrapped_cert}{end_cert}'
+ unwrapped_cert = re.sub(f"{begin_cert}|{end_cert}", "", cert)
+ wrapped_cert = f"{begin_cert}{unwrapped_cert}{end_cert}"
return wrapped_cert, unwrapped_cert
@@ -131,16 +132,16 @@ def rm_xmltag(statement):
_t = statement.startswith(XMLTAG)
if _t:
- statement = statement[len(XMLTAG):]
- if statement[0] == '\n':
+ statement = statement[len(XMLTAG) :]
+ if statement[0] == "\n":
statement = statement[1:]
elif statement.startswith(PREFIX1):
- statement = statement[len(PREFIX1):]
- if statement[0] == '\n':
+ statement = statement[len(PREFIX1) :]
+ if statement[0] == "\n":
statement = statement[1:]
elif statement.startswith(PREFIX2):
- statement = statement[len(PREFIX2):]
- if statement[0] == '\n':
+ statement = statement[len(PREFIX2) :]
+ if statement[0] == "\n":
statement = statement[1:]
return statement
@@ -177,12 +178,12 @@ def get_xmlsec_binary(paths=None):
:return: full name of the xmlsec1 binary found. If no binaries are
found then an exception is raised.
"""
- if os.name == 'posix':
- bin_name = ['xmlsec1']
- elif os.name == 'nt':
- bin_name = ['xmlsec.exe', 'xmlsec1.exe']
+ if os.name == "posix":
+ bin_name = ["xmlsec1"]
+ elif os.name == "nt":
+ bin_name = ["xmlsec.exe", "xmlsec1.exe"]
else: # Default !?
- bin_name = ['xmlsec1']
+ bin_name = ["xmlsec1"]
if paths:
for bname in bin_name:
@@ -194,7 +195,7 @@ def get_xmlsec_binary(paths=None):
except OSError:
pass
- for path in os.environ['PATH'].split(os.pathsep):
+ for path in os.environ["PATH"].split(os.pathsep):
for bname in bin_name:
fil = os.path.join(path, bname)
try:
@@ -203,7 +204,7 @@ def get_xmlsec_binary(paths=None):
except OSError:
pass
- raise SigverError('Cannot find {binary}'.format(binary=bin_name))
+ raise SigverError("Cannot find {binary}".format(binary=bin_name))
def _get_xmlsec_cryptobackend(path=None, search_paths=None, delete_tmpfiles=True):
@@ -217,13 +218,12 @@ def _get_xmlsec_cryptobackend(path=None, search_paths=None, delete_tmpfiles=True
return CryptoBackendXmlSec1(path, delete_tmpfiles=delete_tmpfiles)
-NODE_NAME = 'urn:oasis:names:tc:SAML:2.0:assertion:Assertion'
-ENC_NODE_NAME = 'urn:oasis:names:tc:SAML:2.0:assertion:EncryptedAssertion'
-ENC_KEY_CLASS = 'EncryptedKey'
+NODE_NAME = "urn:oasis:names:tc:SAML:2.0:assertion:Assertion"
+ENC_NODE_NAME = "urn:oasis:names:tc:SAML:2.0:assertion:EncryptedAssertion"
+ENC_KEY_CLASS = "EncryptedKey"
-def _make_vals(val, klass, seccont, klass_inst=None, prop=None, part=False,
- base64encode=False, elements_to_sign=None):
+def _make_vals(val, klass, seccont, klass_inst=None, prop=None, part=False, base64encode=False, elements_to_sign=None):
"""
Creates a class instance with a specified value, the specified
class instance may be a value on a property in a defined class instance.
@@ -240,23 +240,14 @@ def _make_vals(val, klass, seccont, klass_inst=None, prop=None, part=False,
cinst = None
if isinstance(val, dict):
- cinst = _instance(klass, val, seccont, base64encode=base64encode,
- elements_to_sign=elements_to_sign)
+ cinst = _instance(klass, val, seccont, base64encode=base64encode, elements_to_sign=elements_to_sign)
else:
try:
cinst = klass().set_text(val)
except ValueError:
if not part:
cis = [
- _make_vals(
- sval,
- klass,
- seccont,
- klass_inst,
- prop,
- True,
- base64encode,
- elements_to_sign)
+ _make_vals(sval, klass, seccont, klass_inst, prop, True, base64encode, elements_to_sign)
for sval in val
]
setattr(klass_inst, prop, cis)
@@ -283,31 +274,35 @@ def _instance(klass, ava, seccont, base64encode=False, elements_to_sign=None):
else:
setattr(instance, prop, ava[prop])
- if 'text' in ava:
- instance.set_text(ava['text'], base64encode)
+ if "text" in ava:
+ instance.set_text(ava["text"], base64encode)
for prop, klassdef in instance.c_children.values():
if prop in ava:
if isinstance(klassdef, list):
# means there can be a list of values
- _make_vals(ava[prop], klassdef[0], seccont, instance, prop,
- base64encode=base64encode,
- elements_to_sign=elements_to_sign)
+ _make_vals(
+ ava[prop],
+ klassdef[0],
+ seccont,
+ instance,
+ prop,
+ base64encode=base64encode,
+ elements_to_sign=elements_to_sign,
+ )
else:
- cis = _make_vals(ava[prop], klassdef, seccont, instance, prop,
- True, base64encode, elements_to_sign)
+ cis = _make_vals(ava[prop], klassdef, seccont, instance, prop, True, base64encode, elements_to_sign)
setattr(instance, prop, cis)
- if 'extension_elements' in ava:
- for item in ava['extension_elements']:
- instance.extension_elements.append(
- ExtensionElement(item['tag']).loadd(item))
+ if "extension_elements" in ava:
+ for item in ava["extension_elements"]:
+ instance.extension_elements.append(ExtensionElement(item["tag"]).loadd(item))
- if 'extension_attributes' in ava:
- for key, val in ava['extension_attributes'].items():
+ if "extension_attributes" in ava:
+ for key, val in ava["extension_attributes"].items():
instance.extension_attributes[key] = val
- if 'signature' in ava:
+ if "signature" in ava:
elements_to_sign.append((class_name(instance), instance.id))
return instance
@@ -335,9 +330,7 @@ def signed_instance_factory(instance, seccont, elements_to_sign=None):
signed_xml = instance.to_string()
for (node_name, nodeid) in elements_to_sign:
- signed_xml = seccont.sign_statement(
- signed_xml, node_name=node_name, node_id=nodeid
- )
+ signed_xml = seccont.sign_statement(signed_xml, node_name=node_name, node_id=nodeid)
return signed_xml
@@ -360,9 +353,7 @@ def make_temp(content, suffix="", decode=True, delete_tmpfiles=True):
close the file) and filename (which is for instance needed by the
xmlsec function).
"""
- content_encoded = (
- content.encode("utf-8") if not isinstance(content, six.binary_type) else content
- )
+ content_encoded = content.encode("utf-8") if not isinstance(content, six.binary_type) else content
content_raw = base64.b64decode(content_encoded) if decode else content_encoded
ntf = NamedTemporaryFile(suffix=suffix, delete=delete_tmpfiles)
ntf.write(content_raw)
@@ -371,15 +362,15 @@ def make_temp(content, suffix="", decode=True, delete_tmpfiles=True):
def split_len(seq, length):
- return [seq[i:i + length] for i in range(0, len(seq), length)]
+ return [seq[i : i + length] for i in range(0, len(seq), length)]
-M2_TIME_FORMAT = '%b %d %H:%M:%S %Y'
+M2_TIME_FORMAT = "%b %d %H:%M:%S %Y"
def to_time(_time):
- if not _time.endswith(' GMT'):
- raise ValueError('Time does not end with GMT')
+ if not _time.endswith(" GMT"):
+ raise ValueError("Time does not end with GMT")
_time = _time[:-4]
return mktime(str_to_time(_time, M2_TIME_FORMAT))
@@ -406,7 +397,7 @@ def active_cert(key):
def cert_from_key_info(key_info, ignore_age=False):
- """ Get all X509 certs from a KeyInfo instance. Care is taken to make sure
+ """Get all X509 certs from a KeyInfo instance. Care is taken to make sure
that the certs are continues sequences of bytes.
All certificates appearing in an X509Data element MUST relate to the
@@ -420,17 +411,16 @@ def cert_from_key_info(key_info, ignore_age=False):
for x509_data in key_info.x509_data:
x509_certificate = x509_data.x509_certificate
cert = x509_certificate.text.strip()
- cert = '\n'.join(split_len(''.join([s.strip() for s in
- cert.split()]), 64))
+ cert = "\n".join(split_len("".join([s.strip() for s in cert.split()]), 64))
if ignore_age or active_cert(cert):
res.append(cert)
else:
- logger.info('Inactive cert')
+ logger.info("Inactive cert")
return res
def cert_from_key_info_dict(key_info, ignore_age=False):
- """ Get all X509 certs from a KeyInfo dictionary. Care is taken to make sure
+ """Get all X509 certs from a KeyInfo dictionary. Care is taken to make sure
that the certs are continues sequences of bytes.
All certificates appearing in an X509Data element MUST relate to the
@@ -441,31 +431,29 @@ def cert_from_key_info_dict(key_info, ignore_age=False):
:return: A possibly empty list of certs in their text representation
"""
res = []
- if 'x509_data' not in key_info:
+ if "x509_data" not in key_info:
return res
- for x509_data in key_info['x509_data']:
- x509_certificate = x509_data['x509_certificate']
- cert = x509_certificate['text'].strip()
- cert = '\n'.join(split_len(''.join(
- [s.strip() for s in cert.split()]), 64))
+ for x509_data in key_info["x509_data"]:
+ x509_certificate = x509_data["x509_certificate"]
+ cert = x509_certificate["text"].strip()
+ cert = "\n".join(split_len("".join([s.strip() for s in cert.split()]), 64))
if ignore_age or active_cert(cert):
res.append(cert)
else:
- logger.info('Inactive cert')
+ logger.info("Inactive cert")
return res
def cert_from_instance(instance):
- """ Find certificates that are part of an instance
+ """Find certificates that are part of an instance
:param instance: An instance
:return: possible empty list of certificates
"""
if instance.signature:
if instance.signature.key_info:
- return cert_from_key_info(instance.signature.key_info,
- ignore_age=True)
+ return cert_from_key_info(instance.signature.key_info, ignore_age=True)
return []
@@ -475,11 +463,7 @@ def extract_rsa_key_from_x509_cert(pem):
def pem_format(key):
- return os.linesep.join([
- '-----BEGIN CERTIFICATE-----',
- key,
- '-----END CERTIFICATE-----'
- ]).encode('ascii')
+ return os.linesep.join(["-----BEGIN CERTIFICATE-----", key, "-----END CERTIFICATE-----"]).encode("ascii")
def import_rsa_key_from_file(filename):
@@ -490,16 +474,16 @@ def import_rsa_key_from_file(filename):
def parse_xmlsec_output(output):
- """ Parse the output from xmlsec to try to find out if the
+ """Parse the output from xmlsec to try to find out if the
command was successfull or not.
:param output: The output from Popen
:return: A boolean; True if the command was a success otherwise False
"""
for line in output.splitlines():
- if line == 'OK':
+ if line == "OK":
return True
- elif line == 'FAIL':
+ elif line == "FAIL":
raise XmlsecError(output)
raise XmlsecError(output)
@@ -529,12 +513,10 @@ class RSASigner(Signer):
self.digest = digest
def sign(self, msg, key=None):
- return saml2.cryptography.asymmetric.key_sign(
- key or self.key, msg, self.digest)
+ return saml2.cryptography.asymmetric.key_sign(key or self.key, msg, self.digest)
def verify(self, msg, sig, key=None):
- return saml2.cryptography.asymmetric.key_verify(
- key or self.key, sig, msg, self.digest)
+ return saml2.cryptography.asymmetric.key_verify(key or self.key, sig, msg, self.digest)
SIGNER_ALGS = {
@@ -546,15 +528,15 @@ SIGNER_ALGS = {
}
REQ_ORDER = [
- 'SAMLRequest',
- 'RelayState',
- 'SigAlg',
+ "SAMLRequest",
+ "RelayState",
+ "SigAlg",
]
RESP_ORDER = [
- 'SAMLResponse',
- 'RelayState',
- 'SigAlg',
+ "SAMLResponse",
+ "RelayState",
+ "SigAlg",
]
@@ -586,36 +568,28 @@ def verify_redirect_signature(saml_msg, crypto, cert=None, sigkey=None):
"""
try:
- signer = crypto.get_signer(saml_msg['SigAlg'], sigkey)
+ signer = crypto.get_signer(saml_msg["SigAlg"], sigkey)
except KeyError:
- raise Unsupported('Signature algorithm: {alg}'.format(alg=saml_msg['SigAlg']))
+ raise Unsupported("Signature algorithm: {alg}".format(alg=saml_msg["SigAlg"]))
else:
- if saml_msg['SigAlg'] in SIGNER_ALGS:
- if 'SAMLRequest' in saml_msg:
+ if saml_msg["SigAlg"] in SIGNER_ALGS:
+ if "SAMLRequest" in saml_msg:
_order = REQ_ORDER
- elif 'SAMLResponse' in saml_msg:
+ elif "SAMLResponse" in saml_msg:
_order = RESP_ORDER
else:
- raise Unsupported(
- 'Verifying signature on something that should not be signed'
- )
+ raise Unsupported("Verifying signature on something that should not be signed")
_args = saml_msg.copy()
- del _args['Signature'] # everything but the signature
- string = '&'.join(
- [
- parse.urlencode({k: _args[k]})
- for k in _order
- if k in _args
- ]
- ).encode('ascii')
+ del _args["Signature"] # everything but the signature
+ string = "&".join([parse.urlencode({k: _args[k]}) for k in _order if k in _args]).encode("ascii")
if cert:
_key = extract_rsa_key_from_x509_cert(pem_format(cert))
else:
_key = sigkey
- _sign = base64.b64decode(saml_msg['Signature'])
+ _sign = base64.b64decode(saml_msg["Signature"])
return bool(signer.verify(string, _sign, _key))
@@ -640,10 +614,9 @@ class CryptoBackend(object):
raise NotImplementedError()
-ASSERT_XPATH = ''.join([
- '/*[local-name()=\'{name}\']'.format(name=n)
- for n in ['Response', 'EncryptedAssertion', 'Assertion']
-])
+ASSERT_XPATH = "".join(
+ ["/*[local-name()='{name}']".format(name=n) for n in ["Response", "EncryptedAssertion", "Assertion"]]
+)
class CryptoBackendXmlSec1(CryptoBackend):
@@ -661,21 +634,21 @@ class CryptoBackendXmlSec1(CryptoBackend):
self.xmlsec = xmlsec_binary
self.delete_tmpfiles = delete_tmpfiles
try:
- self.non_xml_crypto = RSACrypto(kwargs['rsa_key'])
+ self.non_xml_crypto = RSACrypto(kwargs["rsa_key"])
except KeyError:
pass
def version(self):
- com_list = [self.xmlsec, '--version']
+ com_list = [self.xmlsec, "--version"]
pof = Popen(com_list, stderr=PIPE, stdout=PIPE)
content, _ = pof.communicate()
- content = content.decode('ascii')
+ content = content.decode("ascii")
try:
- return content.split(' ')[1]
+ return content.split(" ")[1]
except IndexError:
- return ''
+ return ""
- def encrypt(self, text, recv_key, template, session_key_type, xpath=''):
+ def encrypt(self, text, recv_key, template, session_key_type, xpath=""):
"""
:param text: The text to be compiled
@@ -686,18 +659,21 @@ class CryptoBackendXmlSec1(CryptoBackend):
:param xpath: What should be encrypted
:return:
"""
- logger.debug('Encryption input len: %d', len(text))
+ logger.debug("Encryption input len: %d", len(text))
tmp = make_temp(text, decode=False, delete_tmpfiles=self.delete_tmpfiles)
com_list = [
self.xmlsec,
- '--encrypt',
- '--pubkey-cert-pem', recv_key,
- '--session-key', session_key_type,
- '--xml-data', tmp.name,
+ "--encrypt",
+ "--pubkey-cert-pem",
+ recv_key,
+ "--session-key",
+ session_key_type,
+ "--xml-data",
+ tmp.name,
]
if xpath:
- com_list.extend(['--node-xpath', xpath])
+ com_list.extend(["--node-xpath", xpath])
try:
(_stdout, _stderr, output) = self._run_xmlsec(com_list, [template])
@@ -706,7 +682,7 @@ class CryptoBackendXmlSec1(CryptoBackend):
return output
- def encrypt_assertion(self, statement, enc_key, template, key_type='des-192', node_xpath=None, node_id=None):
+ def encrypt_assertion(self, statement, enc_key, template, key_type="des-192", node_xpath=None, node_id=None):
"""
Will encrypt an assertion
@@ -720,34 +696,34 @@ class CryptoBackendXmlSec1(CryptoBackend):
if isinstance(statement, SamlBase):
statement = pre_encrypt_assertion(statement)
- tmp = make_temp(str(statement),
- decode=False,
- delete_tmpfiles=self.delete_tmpfiles)
- tmp2 = make_temp(str(template),
- decode=False,
- delete_tmpfiles=self.delete_tmpfiles)
+ tmp = make_temp(str(statement), decode=False, delete_tmpfiles=self.delete_tmpfiles)
+ tmp2 = make_temp(str(template), decode=False, delete_tmpfiles=self.delete_tmpfiles)
if not node_xpath:
node_xpath = ASSERT_XPATH
com_list = [
self.xmlsec,
- '--encrypt',
- '--pubkey-cert-pem', enc_key,
- '--session-key', key_type,
- '--xml-data', tmp.name,
- '--node-xpath', node_xpath,
+ "--encrypt",
+ "--pubkey-cert-pem",
+ enc_key,
+ "--session-key",
+ key_type,
+ "--xml-data",
+ tmp.name,
+ "--node-xpath",
+ node_xpath,
]
if node_id:
- com_list.extend(['--node-id', node_id])
+ com_list.extend(["--node-id", node_id])
try:
(_stdout, _stderr, output) = self._run_xmlsec(com_list, [tmp2.name])
except XmlsecError as e:
six.raise_from(EncryptError(com_list), e)
- return output.decode('utf-8')
+ return output.decode("utf-8")
def decrypt(self, enctext, key_file):
"""
@@ -757,14 +733,16 @@ class CryptoBackendXmlSec1(CryptoBackend):
:return: The decrypted document
"""
- logger.debug('Decrypt input len: %d', len(enctext))
+ logger.debug("Decrypt input len: %d", len(enctext))
tmp = make_temp(enctext, decode=False, delete_tmpfiles=self.delete_tmpfiles)
com_list = [
self.xmlsec,
- '--decrypt',
- '--privkey-pem', key_file,
- '--id-attr:Id', ENC_KEY_CLASS,
+ "--decrypt",
+ "--privkey-pem",
+ key_file,
+ "--id-attr:Id",
+ ENC_KEY_CLASS,
]
try:
@@ -772,7 +750,7 @@ class CryptoBackendXmlSec1(CryptoBackend):
except XmlsecError as e:
six.raise_from(DecryptError(com_list), e)
- return output.decode('utf-8')
+ return output.decode("utf-8")
def sign_statement(self, statement, node_name, key_file, node_id):
"""
@@ -787,20 +765,19 @@ class CryptoBackendXmlSec1(CryptoBackend):
if isinstance(statement, SamlBase):
statement = str(statement)
- tmp = make_temp(statement,
- suffix=".xml",
- decode=False,
- delete_tmpfiles=self.delete_tmpfiles)
+ tmp = make_temp(statement, suffix=".xml", decode=False, delete_tmpfiles=self.delete_tmpfiles)
com_list = [
self.xmlsec,
- '--sign',
- '--privkey-pem', key_file,
- '--id-attr:ID', node_name,
+ "--sign",
+ "--privkey-pem",
+ key_file,
+ "--id-attr:ID",
+ node_name,
]
if node_id:
- com_list.extend(['--node-id', node_id])
+ com_list.extend(["--node-id", node_id])
try:
(stdout, stderr, output) = self._run_xmlsec(com_list, [tmp.name])
@@ -826,24 +803,25 @@ class CryptoBackendXmlSec1(CryptoBackend):
:return: Boolean True if the signature was correct otherwise False.
"""
if not isinstance(signedtext, six.binary_type):
- signedtext = signedtext.encode('utf-8')
+ signedtext = signedtext.encode("utf-8")
- tmp = make_temp(signedtext,
- suffix=".xml",
- decode=False,
- delete_tmpfiles=self.delete_tmpfiles)
+ tmp = make_temp(signedtext, suffix=".xml", decode=False, delete_tmpfiles=self.delete_tmpfiles)
com_list = [
self.xmlsec,
- '--verify',
- '--enabled-reference-uris', 'empty,same-doc',
- '--enabled-key-data', 'raw-x509-cert',
- '--pubkey-cert-{type}'.format(type=cert_type), cert_file,
- '--id-attr:ID', node_name,
+ "--verify",
+ "--enabled-reference-uris",
+ "empty,same-doc",
+ "--enabled-key-data",
+ "raw-x509-cert",
+ "--pubkey-cert-{type}".format(type=cert_type),
+ cert_file,
+ "--id-attr:ID",
+ node_name,
]
if node_id:
- com_list.extend(['--node-id', node_id])
+ com_list.extend(["--node-id", node_id])
try:
(_stdout, stderr, _output) = self._run_xmlsec(com_list, [tmp.name])
@@ -860,11 +838,11 @@ class CryptoBackendXmlSec1(CryptoBackend):
key-value parameters
:result: Whatever xmlsec wrote to an --output temporary file
"""
- with NamedTemporaryFile(suffix='.xml') as ntf:
- com_list.extend(['--output', ntf.name])
+ with NamedTemporaryFile(suffix=".xml") as ntf:
+ com_list.extend(["--output", ntf.name])
com_list += extra_args
- logger.debug('xmlsec command: %s', ' '.join(com_list))
+ logger.debug("xmlsec command: %s", " ".join(com_list))
pof = Popen(com_list, stderr=PIPE, stdout=PIPE)
p_out, p_err = pof.communicate()
@@ -901,7 +879,7 @@ class CryptoBackendXMLSecurity(CryptoBackend):
def version(self):
# XXX if XMLSecurity.__init__ included a __version__, that would be
# better than static 0.0 here.
- return 'XMLSecurity 0.0'
+ return "XMLSecurity 0.0"
def sign_statement(self, statement, node_name, key_file, node_id):
"""
@@ -916,8 +894,8 @@ class CryptoBackendXMLSecurity(CryptoBackend):
'pkcs11://' URI or PEM data
:returns: Signed XML as string
"""
- import xmlsec
import lxml.etree
+ import xmlsec
xml = xmlsec.parse_xml(statement)
signed = xmlsec.sign(xml, key_file)
@@ -939,10 +917,11 @@ class CryptoBackendXMLSecurity(CryptoBackend):
:param cert_type: string, must be 'pem' for now
:returns: True on successful validation, False otherwise
"""
- if cert_type != 'pem':
- raise Unsupported('Only PEM certs supported here')
+ if cert_type != "pem":
+ raise Unsupported("Only PEM certs supported here")
import xmlsec
+
xml = xmlsec.parse_xml(signedtext)
try:
@@ -952,7 +931,7 @@ class CryptoBackendXMLSecurity(CryptoBackend):
def security_context(conf):
- """ Creates a security context based on the configuration
+ """Creates a security context based on the configuration
:param conf: The configuration, this is a Config instance
:return: A SecurityContext instance
@@ -967,7 +946,7 @@ def security_context(conf):
sec_backend = None
- if conf.crypto_backend == 'xmlsec1':
+ if conf.crypto_backend == "xmlsec1":
xmlsec_binary = conf.xmlsec_binary
if not xmlsec_binary:
@@ -980,72 +959,66 @@ def security_context(conf):
# verify that xmlsec is where it's supposed to be
if not os.path.exists(xmlsec_binary):
# if not os.access(, os.F_OK):
- err_msg = 'xmlsec binary not found: {binary}'
+ err_msg = "xmlsec binary not found: {binary}"
err_msg = err_msg.format(binary=xmlsec_binary)
raise SigverError(err_msg)
- crypto = _get_xmlsec_cryptobackend(xmlsec_binary,
- delete_tmpfiles=conf.delete_tmpfiles)
+ crypto = _get_xmlsec_cryptobackend(xmlsec_binary, delete_tmpfiles=conf.delete_tmpfiles)
- _file_name = conf.getattr('key_file', '')
+ _file_name = conf.getattr("key_file", "")
if _file_name:
try:
rsa_key = import_rsa_key_from_file(_file_name)
except Exception as err:
- logger.error('Cannot import key from {file}: {err_msg}'.format(
- file=_file_name, err_msg=err))
+ logger.error("Cannot import key from {file}: {err_msg}".format(file=_file_name, err_msg=err))
raise
else:
sec_backend = RSACrypto(rsa_key)
- elif conf.crypto_backend == 'XMLSecurity':
+ elif conf.crypto_backend == "XMLSecurity":
# new and somewhat untested pyXMLSecurity crypto backend.
crypto = CryptoBackendXMLSecurity()
else:
- err_msg = 'Unknown crypto_backend {backend}'
+ err_msg = "Unknown crypto_backend {backend}"
err_msg = err_msg.format(backend=conf.crypto_backend)
raise SigverError(err_msg)
enc_key_files = []
if conf.encryption_keypairs is not None:
for _encryption_keypair in conf.encryption_keypairs:
- if 'key_file' in _encryption_keypair:
- enc_key_files.append(_encryption_keypair['key_file'])
+ if "key_file" in _encryption_keypair:
+ enc_key_files.append(_encryption_keypair["key_file"])
return SecurityContext(
- crypto,
- conf.key_file,
- cert_file=conf.cert_file,
- metadata=metadata,
- only_use_keys_in_metadata=conf.only_use_keys_in_metadata,
- cert_handler_extra_class=conf.cert_handler_extra_class,
- generate_cert_info=conf.generate_cert_info,
- tmp_cert_file=conf.tmp_cert_file,
- tmp_key_file=conf.tmp_key_file,
- validate_certificate=conf.validate_certificate,
- enc_key_files=enc_key_files,
- encryption_keypairs=conf.encryption_keypairs,
- sec_backend=sec_backend,
- delete_tmpfiles=conf.delete_tmpfiles)
+ crypto,
+ conf.key_file,
+ cert_file=conf.cert_file,
+ metadata=metadata,
+ only_use_keys_in_metadata=conf.only_use_keys_in_metadata,
+ cert_handler_extra_class=conf.cert_handler_extra_class,
+ generate_cert_info=conf.generate_cert_info,
+ tmp_cert_file=conf.tmp_cert_file,
+ tmp_key_file=conf.tmp_key_file,
+ validate_certificate=conf.validate_certificate,
+ enc_key_files=enc_key_files,
+ encryption_keypairs=conf.encryption_keypairs,
+ sec_backend=sec_backend,
+ delete_tmpfiles=conf.delete_tmpfiles,
+ )
def encrypt_cert_from_item(item):
_encrypt_cert = None
try:
try:
- _elem = extension_elements_to_elements(
- item.extensions.extension_elements, [pefim, ds])
+ _elem = extension_elements_to_elements(item.extensions.extension_elements, [pefim, ds])
except:
- _elem = extension_elements_to_elements(
- item.extension_elements[0].children,
- [pefim, ds])
+ _elem = extension_elements_to_elements(item.extension_elements[0].children, [pefim, ds])
for _tmp_elem in _elem:
if isinstance(_tmp_elem, SPCertEnc):
for _tmp_key_info in _tmp_elem.key_info:
- if _tmp_key_info.x509_data is not None and len(
- _tmp_key_info.x509_data) > 0:
- _encrypt_cert = _tmp_key_info.x509_data[
- 0].x509_certificate.text
+ if _tmp_key_info.x509_data is not None and len(_tmp_key_info.x509_data) > 0:
+ _encrypt_cert = _tmp_key_info.x509_data[0].x509_certificate.text
break
except Exception as _exception:
pass
@@ -1061,32 +1034,34 @@ class CertHandlerExtra(object):
pass
def use_generate_cert_func(self):
- raise Exception('use_generate_cert_func function must be implemented')
+ raise Exception("use_generate_cert_func function must be implemented")
- def generate_cert(self, generate_cert_info, root_cert_string,
- root_key_string):
- raise Exception('generate_cert function must be implemented')
+ def generate_cert(self, generate_cert_info, root_cert_string, root_key_string):
+ raise Exception("generate_cert function must be implemented")
# Excepts to return (cert_string, key_string)
def use_validate_cert_func(self):
- raise Exception('use_validate_cert_func function must be implemented')
+ raise Exception("use_validate_cert_func function must be implemented")
def validate_cert(self, cert_str, root_cert_string, root_key_string):
- raise Exception('validate_cert function must be implemented')
+ raise Exception("validate_cert function must be implemented")
# Excepts to return True/False
class CertHandler(object):
def __init__(
- self,
- security_context,
- cert_file=None, cert_type='pem',
- key_file=None, key_type='pem',
- generate_cert_info=None,
- cert_handler_extra_class=None,
- tmp_cert_file=None,
- tmp_key_file=None,
- verify_cert=False):
+ self,
+ security_context,
+ cert_file=None,
+ cert_type="pem",
+ key_file=None,
+ key_type="pem",
+ generate_cert_info=None,
+ cert_handler_extra_class=None,
+ tmp_cert_file=None,
+ tmp_key_file=None,
+ verify_cert=False,
+ ):
"""
Initiates the class for handling certificates. Enables the certificates
to either be a single certificate as base functionality or makes it
@@ -1110,19 +1085,18 @@ class CertHandler(object):
# validated.
self._last_cert_verified = None
self._last_validated_cert = None
- if cert_type == 'pem' and key_type == 'pem':
+ if cert_type == "pem" and key_type == "pem":
self._verify_cert = verify_cert is True
self._security_context = security_context
self._osw = OpenSSLWrapper()
if key_file and os.path.isfile(key_file):
self._key_str = self._osw.read_str_from_file(key_file, key_type)
else:
- self._key_str = ''
+ self._key_str = ""
if cert_file and os.path.isfile(cert_file):
- self._cert_str = self._osw.read_str_from_file(cert_file,
- cert_type)
+ self._cert_str = self._osw.read_str_from_file(cert_file, cert_type)
else:
- self._cert_str = ''
+ self._cert_str = ""
self._tmp_cert_str = self._cert_str
self._tmp_key_str = self._key_str
@@ -1131,11 +1105,13 @@ class CertHandler(object):
self._cert_info = None
self._generate_cert_func_active = False
- if generate_cert_info is not None \
- and len(self._cert_str) > 0 \
- and len(self._key_str) > 0 \
- and tmp_key_file is not None \
- and tmp_cert_file is not None:
+ if (
+ generate_cert_info is not None
+ and len(self._cert_str) > 0
+ and len(self._key_str) > 0
+ and tmp_key_file is not None
+ and tmp_cert_file is not None
+ ):
self._generate_cert = True
self._cert_info = generate_cert_info
self._cert_handler_extra_class = cert_handler_extra_class
@@ -1143,17 +1119,15 @@ class CertHandler(object):
def verify_cert(self, cert_file):
if self._verify_cert:
if cert_file and os.path.isfile(cert_file):
- cert_str = self._osw.read_str_from_file(cert_file, 'pem')
+ cert_str = self._osw.read_str_from_file(cert_file, "pem")
else:
return False
self._last_validated_cert = cert_str
- if self._cert_handler_extra_class is not None and \
- self._cert_handler_extra_class.use_validate_cert_func():
- self._cert_handler_extra_class.validate_cert(
- cert_str, self._cert_str, self._key_str)
+ if self._cert_handler_extra_class is not None and self._cert_handler_extra_class.use_validate_cert_func():
+ self._cert_handler_extra_class.validate_cert(cert_str, self._cert_str, self._key_str)
else:
valid, mess = self._osw.verify(self._cert_str, cert_str)
- logger.info('CertHandler.verify_cert: %s', mess)
+ logger.info("CertHandler.verify_cert: %s", mess)
return valid
return True
@@ -1165,28 +1139,26 @@ class CertHandler(object):
if client_crt is not None:
self._tmp_cert_str = client_crt
# No private key for signing
- self._tmp_key_str = ''
- elif self._cert_handler_extra_class is not None and \
- self._cert_handler_extra_class.use_generate_cert_func():
- (self._tmp_cert_str, self._tmp_key_str) = \
- self._cert_handler_extra_class.generate_cert(
- self._cert_info, self._cert_str, self._key_str)
+ self._tmp_key_str = ""
+ elif self._cert_handler_extra_class is not None and self._cert_handler_extra_class.use_generate_cert_func():
+ (self._tmp_cert_str, self._tmp_key_str) = self._cert_handler_extra_class.generate_cert(
+ self._cert_info, self._cert_str, self._key_str
+ )
else:
- self._tmp_cert_str, self._tmp_key_str = self._osw \
- .create_certificate(self._cert_info, request=True)
+ self._tmp_cert_str, self._tmp_key_str = self._osw.create_certificate(self._cert_info, request=True)
self._tmp_cert_str = self._osw.create_cert_signed_certificate(
- self._cert_str, self._key_str, self._tmp_cert_str)
- valid, mess = self._osw.verify(self._cert_str,
- self._tmp_cert_str)
+ self._cert_str, self._key_str, self._tmp_cert_str
+ )
+ valid, mess = self._osw.verify(self._cert_str, self._tmp_cert_str)
self._osw.write_str_to_file(self._tmp_cert_file, self._tmp_cert_str)
self._osw.write_str_to_file(self._tmp_key_file, self._tmp_key_str)
self._security_context.key_file = self._tmp_key_file
self._security_context.cert_file = self._tmp_cert_file
- self._security_context.key_type = 'pem'
- self._security_context.cert_type = 'pem'
+ self._security_context.key_type = "pem"
+ self._security_context.cert_type = "pem"
self._security_context.my_cert = read_cert_from_file(
- self._security_context.cert_file,
- self._security_context.cert_type)
+ self._security_context.cert_file, self._security_context.cert_type
+ )
# How to get a rsa pub key fingerprint from a certificate
@@ -1196,23 +1168,28 @@ class SecurityContext(object):
my_cert = None
def __init__(
- self,
- crypto,
- key_file='', key_type='pem',
- cert_file='', cert_type='pem',
- metadata=None,
- template='',
- encrypt_key_type='des-192',
- only_use_keys_in_metadata=False,
- cert_handler_extra_class=None,
- generate_cert_info=None,
- tmp_cert_file=None, tmp_key_file=None,
- validate_certificate=None,
- enc_key_files=None, enc_key_type='pem',
- encryption_keypairs=None,
- enc_cert_type='pem',
- sec_backend=None,
- delete_tmpfiles=True):
+ self,
+ crypto,
+ key_file="",
+ key_type="pem",
+ cert_file="",
+ cert_type="pem",
+ metadata=None,
+ template="",
+ encrypt_key_type="des-192",
+ only_use_keys_in_metadata=False,
+ cert_handler_extra_class=None,
+ generate_cert_info=None,
+ tmp_cert_file=None,
+ tmp_key_file=None,
+ validate_certificate=None,
+ enc_key_files=None,
+ enc_key_type="pem",
+ encryption_keypairs=None,
+ enc_cert_type="pem",
+ sec_backend=None,
+ delete_tmpfiles=True,
+ ):
if not isinstance(crypto, CryptoBackend):
raise ValueError("crypto should be of type CryptoBackend")
@@ -1241,14 +1218,17 @@ class SecurityContext(object):
self.my_cert = read_cert_from_file(cert_file, cert_type)
self.cert_handler = CertHandler(
- self,
- cert_file, cert_type,
- key_file, key_type,
- generate_cert_info,
- cert_handler_extra_class,
- tmp_cert_file,
- tmp_key_file,
- validate_certificate)
+ self,
+ cert_file,
+ cert_type,
+ key_file,
+ key_type,
+ generate_cert_info,
+ cert_handler_extra_class,
+ tmp_cert_file,
+ tmp_key_file,
+ validate_certificate,
+ )
self.cert_handler.update_cert(True)
@@ -1265,10 +1245,10 @@ class SecurityContext(object):
self.delete_tmpfiles = delete_tmpfiles
def correctly_signed(self, xml, must=False):
- logger.debug('verify correct signature')
+ logger.debug("verify correct signature")
return self.correctly_signed_response(xml, must)
- def encrypt(self, text, recv_key='', template='', key_type=''):
+ def encrypt(self, text, recv_key="", template="", key_type=""):
"""
xmlsec encrypt --pubkey-pem pub-userkey.pem
--session-key aes128-cbc --xml-data doc-plain.xml
@@ -1287,7 +1267,7 @@ class SecurityContext(object):
return self.crypto.encrypt(text, recv_key, template, key_type)
- def encrypt_assertion(self, statement, enc_key, template, key_type='des-192', node_xpath=None):
+ def encrypt_assertion(self, statement, enc_key, template, key_type="des-192", node_xpath=None):
"""
Will encrypt an assertion
@@ -1297,11 +1277,10 @@ class SecurityContext(object):
:param key_type: The type of session key to use.
:return: The encrypted text
"""
- return self.crypto.encrypt_assertion(
- statement, enc_key, template, key_type, node_xpath)
+ return self.crypto.encrypt_assertion(statement, enc_key, template, key_type, node_xpath)
def decrypt_keys(self, enctext, keys=None):
- """ Decrypting an encrypted text by the use of a private key.
+ """Decrypting an encrypted text by the use of a private key.
:param enctext: The encrypted text as a string
:param keys: Keys to try to decrypt enctext with
@@ -1313,14 +1292,8 @@ class SecurityContext(object):
keys = [keys]
keys_filtered = (key for key in keys if key)
- keys_encoded = (
- key.encode("ascii") if not isinstance(key, six.binary_type) else key
- for key in keys_filtered
- )
- key_files = list(
- make_temp(key, decode=False, delete_tmpfiles=self.delete_tmpfiles)
- for key in keys_encoded
- )
+ keys_encoded = (key.encode("ascii") if not isinstance(key, six.binary_type) else key for key in keys_filtered)
+ key_files = list(make_temp(key, decode=False, delete_tmpfiles=self.delete_tmpfiles) for key in keys_encoded)
key_file_names = list(tmp.name for tmp in key_files)
try:
@@ -1331,7 +1304,7 @@ class SecurityContext(object):
return dectext
def decrypt(self, enctext, key_file=None):
- """ Decrypting an encrypted text by the use of a private key.
+ """Decrypting an encrypted text by the use of a private key.
:param enctext: The encrypted text as a string
:return: The decrypted text
@@ -1339,9 +1312,7 @@ class SecurityContext(object):
if not isinstance(key_file, list):
key_file = [key_file]
- key_files = [
- key for key in itertools.chain(key_file, self.enc_key_files) if key
- ]
+ key_files = [key for key in itertools.chain(key_file, self.enc_key_files) if key]
for key_file in key_files:
try:
dectext = self.crypto.decrypt(enctext, key_file)
@@ -1355,8 +1326,8 @@ class SecurityContext(object):
errmsg = errmsg.format(keys=key_files)
raise DecryptError(errmsg)
- def verify_signature(self, signedtext, cert_file=None, cert_type='pem', node_name=NODE_NAME, node_id=None):
- """ Verifies the signature of a XML document.
+ def verify_signature(self, signedtext, cert_file=None, cert_type="pem", node_name=NODE_NAME, node_id=None):
+ """Verifies the signature of a XML document.
:param signedtext: The XML document as a string
:param cert_file: The public key that was used to sign the document
@@ -1379,7 +1350,9 @@ class SecurityContext(object):
node_id=node_id,
)
- def _check_signature(self, decoded_xml, item, node_name=NODE_NAME, origdoc=None, must=False, only_valid_cert=False, issuer=None):
+ def _check_signature(
+ self, decoded_xml, item, node_name=NODE_NAME, origdoc=None, must=False, only_valid_cert=False, issuer=None
+ ):
try:
_issuer = item.issuer.text.strip()
except AttributeError:
@@ -1394,7 +1367,7 @@ class SecurityContext(object):
# More trust in certs from metadata then certs in the XML document
if self.metadata:
try:
- _certs = self.metadata.certs(_issuer, 'any', 'signing')
+ _certs = self.metadata.certs(_issuer, "any", "signing")
except KeyError:
_certs = []
certs = []
@@ -1402,10 +1375,7 @@ class SecurityContext(object):
for cert_name, cert in _certs:
if isinstance(cert, six.string_types):
content = pem_format(cert)
- tmp = make_temp(content,
- suffix=".pem",
- decode=False,
- delete_tmpfiles=self.delete_tmpfiles)
+ tmp = make_temp(content, suffix=".pem", decode=False, delete_tmpfiles=self.delete_tmpfiles)
certs.append(tmp)
else:
certs.append(cert)
@@ -1413,16 +1383,13 @@ class SecurityContext(object):
certs = []
if not certs and not self.only_use_keys_in_metadata:
- logger.debug('==== Certs from instance ====')
+ logger.debug("==== Certs from instance ====")
certs = [
- make_temp(content=pem_format(cert),
- suffix=".pem",
- decode=False,
- delete_tmpfiles=self.delete_tmpfiles)
+ make_temp(content=pem_format(cert), suffix=".pem", decode=False, delete_tmpfiles=self.delete_tmpfiles)
for cert in cert_from_instance(item)
]
else:
- logger.debug('==== Certs from metadata ==== %s: %s ====', _issuer, certs)
+ logger.debug("==== Certs from metadata ==== %s: %s ====", _issuer, certs)
if not certs:
raise MissingKey(_issuer)
@@ -1451,25 +1418,21 @@ class SecurityContext(object):
signed_info = item.signature.signed_info
references = signed_info.reference
signatures_must_have_a_single_reference_element = len(references) == 1
- the_Reference_element_must_have_a_URI_attribute = (
- signatures_must_have_a_single_reference_element
- and hasattr(references[0], "uri")
+ the_Reference_element_must_have_a_URI_attribute = signatures_must_have_a_single_reference_element and hasattr(
+ references[0], "uri"
)
the_URI_attribute_contains_an_anchor = (
the_Reference_element_must_have_a_URI_attribute
and references[0].uri.startswith("#")
and len(references[0].uri) > 1
)
- the_anchor_points_to_the_enclosing_element_ID_attribute = (
- the_URI_attribute_contains_an_anchor
- and references[0].uri == "#{id}".format(id=item.id)
- )
+ the_anchor_points_to_the_enclosing_element_ID_attribute = the_URI_attribute_contains_an_anchor and references[
+ 0
+ ].uri == "#{id}".format(id=item.id)
# SAML implementations SHOULD use Exclusive Canonicalization,
# with or without comments
- canonicalization_method_is_c14n = (
- signed_info.canonicalization_method.algorithm in ALLOWED_CANONICALIZATIONS
- )
+ canonicalization_method_is_c14n = signed_info.canonicalization_method.algorithm in ALLOWED_CANONICALIZATIONS
# Signatures in SAML messages SHOULD NOT contain transforms other than the
# - enveloped signature transform
@@ -1477,25 +1440,19 @@ class SecurityContext(object):
# - or the exclusive canonicalization transforms
# (with the identifier http://www.w3.org/2001/10/xml-exc-c14n#
# or http://www.w3.org/2001/10/xml-exc-c14n#WithComments).
- transform_algos = [
- transform.algorithm
- for transform in references[0].transforms.transform
- ]
+ transform_algos = [transform.algorithm for transform in references[0].transforms.transform]
tranform_algos_valid = ALLOWED_TRANSFORMS.intersection(transform_algos)
transform_algos_n = len(transform_algos)
tranform_algos_valid_n = len(tranform_algos_valid)
the_number_of_transforms_is_one_or_two = (
- signatures_must_have_a_single_reference_element
- and 1 <= transform_algos_n <= 2
+ signatures_must_have_a_single_reference_element and 1 <= transform_algos_n <= 2
)
all_transform_algs_are_allowed = (
- the_number_of_transforms_is_one_or_two
- and transform_algos_n == tranform_algos_valid_n
+ the_number_of_transforms_is_one_or_two and transform_algos_n == tranform_algos_valid_n
)
the_enveloped_signature_transform_is_defined = (
- the_number_of_transforms_is_one_or_two
- and TRANSFORM_ENVELOPED in transform_algos
+ the_number_of_transforms_is_one_or_two and TRANSFORM_ENVELOPED in transform_algos
)
# The <ds:Object> element is not defined for use with SAML signatures,
@@ -1505,26 +1462,16 @@ class SecurityContext(object):
object_element_is_not_present = not item.signature.object
validators = {
- "signatures must have a single reference element": (
- signatures_must_have_a_single_reference_element
- ),
- "the Reference element must have a URI attribute": (
- the_Reference_element_must_have_a_URI_attribute
- ),
- "the URI attribute contains an anchor": (
- the_URI_attribute_contains_an_anchor
- ),
+ "signatures must have a single reference element": (signatures_must_have_a_single_reference_element),
+ "the Reference element must have a URI attribute": (the_Reference_element_must_have_a_URI_attribute),
+ "the URI attribute contains an anchor": (the_URI_attribute_contains_an_anchor),
"the anchor points to the enclosing element ID attribute": (
the_anchor_points_to_the_enclosing_element_ID_attribute
),
"canonicalization method is c14n": canonicalization_method_is_c14n,
- "the number of transforms is one or two": (
- the_number_of_transforms_is_one_or_two
- ),
+ "the number of transforms is one or two": (the_number_of_transforms_is_one_or_two),
"all transform algs are allowed": all_transform_algs_are_allowed,
- "the enveloped signature transform is defined": (
- the_enveloped_signature_transform_is_defined
- ),
+ "the enveloped signature transform is defined": (the_enveloped_signature_transform_is_defined),
"object element is not present": object_element_is_not_present,
}
if not all(validators.values()):
@@ -1554,17 +1501,17 @@ class SecurityContext(object):
verified = True
break
except XmlsecError as exc:
- logger.error('check_sig: %s', exc)
+ logger.error("check_sig: %s", exc)
pass
except Exception as exc:
- logger.error('check_sig: %s', exc)
+ logger.error("check_sig: %s", exc)
raise
if verified or only_valid_cert:
if not self.cert_handler.verify_cert(last_pem_file):
- raise CertificateError('Invalid certificate!')
+ raise CertificateError("Invalid certificate!")
else:
- raise SignatureError('Failed to verify signature')
+ raise SignatureError("Failed to verify signature")
return item
@@ -1598,77 +1545,95 @@ class SecurityContext(object):
:return:
"""
- attr = '{type}_from_string'.format(type=msgtype)
+ attr = "{type}_from_string".format(type=msgtype)
_func = getattr(saml, attr, None)
_func = getattr(samlp, attr, _func)
msg = _func(decoded_xml)
if not msg:
- raise TypeError('Not a {type}'.format(type=msgtype))
+ raise TypeError("Not a {type}".format(type=msgtype))
if not msg.signature:
if must:
- err_msg = 'Required signature missing on {type}'
+ err_msg = "Required signature missing on {type}"
err_msg = err_msg.format(type=msgtype)
raise SignatureError(err_msg)
else:
return msg
return self._check_signature(
- decoded_xml,
- msg,
- class_name(msg),
- origdoc,
- must=must,
- only_valid_cert=only_valid_cert)
+ decoded_xml, msg, class_name(msg), origdoc, must=must, only_valid_cert=only_valid_cert
+ )
def correctly_signed_authn_request(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'authn_request', must, origdoc, only_valid_cert=only_valid_cert)
+ return self.correctly_signed_message(
+ decoded_xml, "authn_request", must, origdoc, only_valid_cert=only_valid_cert
+ )
def correctly_signed_authn_query(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'authn_query', must, origdoc, only_valid_cert)
+ return self.correctly_signed_message(decoded_xml, "authn_query", must, origdoc, only_valid_cert)
def correctly_signed_logout_request(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'logout_request', must, origdoc, only_valid_cert)
+ return self.correctly_signed_message(decoded_xml, "logout_request", must, origdoc, only_valid_cert)
def correctly_signed_logout_response(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'logout_response', must, origdoc, only_valid_cert)
+ return self.correctly_signed_message(decoded_xml, "logout_response", must, origdoc, only_valid_cert)
def correctly_signed_attribute_query(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'attribute_query', must, origdoc, only_valid_cert)
+ return self.correctly_signed_message(decoded_xml, "attribute_query", must, origdoc, only_valid_cert)
- def correctly_signed_authz_decision_query(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'authz_decision_query', must, origdoc, only_valid_cert)
+ def correctly_signed_authz_decision_query(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "authz_decision_query", must, origdoc, only_valid_cert)
- def correctly_signed_authz_decision_response(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'authz_decision_response', must, origdoc, only_valid_cert)
+ def correctly_signed_authz_decision_response(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "authz_decision_response", must, origdoc, only_valid_cert)
- def correctly_signed_name_id_mapping_request(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'name_id_mapping_request', must, origdoc, only_valid_cert)
+ def correctly_signed_name_id_mapping_request(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "name_id_mapping_request", must, origdoc, only_valid_cert)
- def correctly_signed_name_id_mapping_response(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'name_id_mapping_response', must, origdoc, only_valid_cert)
+ def correctly_signed_name_id_mapping_response(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "name_id_mapping_response", must, origdoc, only_valid_cert)
def correctly_signed_artifact_request(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'artifact_request', must, origdoc, only_valid_cert)
-
- def correctly_signed_artifact_response(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'artifact_response', must, origdoc, only_valid_cert)
-
- def correctly_signed_manage_name_id_request(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'manage_name_id_request', must, origdoc, only_valid_cert)
-
- def correctly_signed_manage_name_id_response(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'manage_name_id_response', must, origdoc, only_valid_cert)
-
- def correctly_signed_assertion_id_request(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'assertion_id_request', must, origdoc, only_valid_cert)
-
- def correctly_signed_assertion_id_response(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs):
- return self.correctly_signed_message(decoded_xml, 'assertion', must, origdoc, only_valid_cert)
-
- def correctly_signed_response(self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, require_response_signature=False, **kwargs):
- """ Check if a instance is correctly signed, if we have metadata for
+ return self.correctly_signed_message(decoded_xml, "artifact_request", must, origdoc, only_valid_cert)
+
+ def correctly_signed_artifact_response(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "artifact_response", must, origdoc, only_valid_cert)
+
+ def correctly_signed_manage_name_id_request(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "manage_name_id_request", must, origdoc, only_valid_cert)
+
+ def correctly_signed_manage_name_id_response(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "manage_name_id_response", must, origdoc, only_valid_cert)
+
+ def correctly_signed_assertion_id_request(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "assertion_id_request", must, origdoc, only_valid_cert)
+
+ def correctly_signed_assertion_id_response(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, **kwargs
+ ):
+ return self.correctly_signed_message(decoded_xml, "assertion", must, origdoc, only_valid_cert)
+
+ def correctly_signed_response(
+ self, decoded_xml, must=False, origdoc=None, only_valid_cert=False, require_response_signature=False, **kwargs
+ ):
+ """Check if a instance is correctly signed, if we have metadata for
the IdP that sent the info use that, if not use the key that are in
the message if any.
@@ -1682,21 +1647,20 @@ class SecurityContext(object):
response = samlp.any_response_from_string(decoded_xml)
if not response:
- raise TypeError('Not a Response')
+ raise TypeError("Not a Response")
if response.signature:
- if 'do_not_verify' in kwargs:
+ if "do_not_verify" in kwargs:
pass
else:
- self._check_signature(decoded_xml, response,
- class_name(response), origdoc)
+ self._check_signature(decoded_xml, response, class_name(response), origdoc)
elif require_response_signature:
- raise SignatureError('Signature missing for response')
+ raise SignatureError("Signature missing for response")
return response
def sign_statement_using_xmlsec(self, statement, **kwargs):
- """ Deprecated function. See sign_statement(). """
+ """Deprecated function. See sign_statement()."""
return self.sign_statement(statement, **kwargs)
def sign_statement(self, statement, node_name, key=None, key_file=None, node_id=None):
@@ -1732,11 +1696,10 @@ class SecurityContext(object):
:param statement: The statement to be signed
:return: The signed statement
"""
- return self.sign_statement(
- statement, class_name(saml.Assertion()), **kwargs)
+ return self.sign_statement(statement, class_name(saml.Assertion()), **kwargs)
def sign_attribute_query_using_xmlsec(self, statement, **kwargs):
- """ Deprecated function. See sign_attribute_query(). """
+ """Deprecated function. See sign_attribute_query()."""
return self.sign_attribute_query(statement, **kwargs)
def sign_attribute_query(self, statement, **kwargs):
@@ -1747,8 +1710,7 @@ class SecurityContext(object):
:param statement: The statement to be signed
:return: The signed statement
"""
- return self.sign_statement(
- statement, class_name(samlp.AttributeQuery()), **kwargs)
+ return self.sign_statement(statement, class_name(samlp.AttributeQuery()), **kwargs)
def multiple_signatures(self, statement, to_sign, key=None, key_file=None, sign_alg=None, digest_alg=None):
"""
@@ -1820,27 +1782,21 @@ def pre_signature_part(
digest_method = ds.DigestMethod(algorithm=digest_alg)
reference = ds.Reference(
- uri='#{id}'.format(id=ident),
- digest_value=ds.DigestValue(),
- transforms=transforms,
- digest_method=digest_method)
+ uri="#{id}".format(id=ident), digest_value=ds.DigestValue(), transforms=transforms, digest_method=digest_method
+ )
signed_info = ds.SignedInfo(
- signature_method=signature_method,
- canonicalization_method=canonicalization_method,
- reference=reference)
+ signature_method=signature_method, canonicalization_method=canonicalization_method, reference=reference
+ )
- signature = ds.Signature(
- signed_info=signed_info,
- signature_value=ds.SignatureValue())
+ signature = ds.Signature(signed_info=signed_info, signature_value=ds.SignatureValue())
if identifier:
- signature.id = 'Signature{n}'.format(n=identifier)
+ signature.id = "Signature{n}".format(n=identifier)
# XXX remove - do not embed the cert
if public_key:
- x509_data = ds.X509Data(
- x509_certificate=[ds.X509Certificate(text=public_key)])
+ x509_data = ds.X509Data(x509_certificate=[ds.X509Certificate(text=public_key)])
key_info = ds.KeyInfo(x509_data=x509_data)
signature.key_info = key_info
@@ -1889,31 +1845,23 @@ def pre_encryption_part(
msg_encryption_method = EncryptionMethod(algorithm=msg_enc)
key_encryption_method = EncryptionMethod(algorithm=key_enc)
- x509_data = (
- ds.X509Data(x509_certificate=ds.X509Certificate(text=encrypt_cert))
- if encrypt_cert
- else None
- )
+ x509_data = ds.X509Data(x509_certificate=ds.X509Certificate(text=encrypt_cert)) if encrypt_cert else None
key_name = ds.KeyName(text=key_name) if key_name else None
- key_info = (
- ds.KeyInfo(key_name=key_name, x509_data=x509_data)
- if key_name or x509_data
- else None
- )
+ key_info = ds.KeyInfo(key_name=key_name, x509_data=x509_data) if key_name or x509_data else None
encrypted_key = EncryptedKey(
id=ek_id,
encryption_method=key_encryption_method,
key_info=key_info,
- cipher_data=CipherData(cipher_value=CipherValue(text='')),
+ cipher_data=CipherData(cipher_value=CipherValue(text="")),
)
key_info = ds.KeyInfo(encrypted_key=encrypted_key)
encrypted_data = EncryptedData(
id=ed_id,
- type='http://www.w3.org/2001/04/xmlenc#Element',
+ type="http://www.w3.org/2001/04/xmlenc#Element",
encryption_method=msg_encryption_method,
key_info=key_info,
- cipher_data=CipherData(cipher_value=CipherValue(text='')),
+ cipher_data=CipherData(cipher_value=CipherValue(text="")),
)
return encrypted_data
@@ -1936,14 +1884,14 @@ def pre_encrypt_assertion(response):
return response
-if __name__ == '__main__':
+if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
- parser.add_argument('-s', '--list-sigalgs', dest='listsigalgs',
- action='store_true',
- help='List implemented signature algorithms')
+ parser.add_argument(
+ "-s", "--list-sigalgs", dest="listsigalgs", action="store_true", help="List implemented signature algorithms"
+ )
args = parser.parse_args()
if args.listsigalgs:
- print('\n'.join([key for key, value in SIGNER_ALGS.items()]))
+ print("\n".join([key for key, value in SIGNER_ALGS.items()]))
diff --git a/src/saml2/soap.py b/src/saml2/soap.py
index 94af4f1f..dc2e75e5 100644
--- a/src/saml2/soap.py
+++ b/src/saml2/soap.py
@@ -12,14 +12,16 @@ from saml2 import create_class_from_element_tree
from saml2.samlp import NAMESPACE as SAMLP_NAMESPACE
from saml2.schema import soapenv
+
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
try:
import cElementTree as ElementTree
except ImportError:
- #noinspection PyUnresolvedReferences
+ # noinspection PyUnresolvedReferences
from elementtree import ElementTree
+
import defusedxml.ElementTree
@@ -35,98 +37,95 @@ class WrongMessageType(Exception):
def parse_soap_enveloped_saml_response(text):
- tags = ['{%s}Response' % SAMLP_NAMESPACE,
- '{%s}LogoutResponse' % SAMLP_NAMESPACE]
+ tags = ["{%s}Response" % SAMLP_NAMESPACE, "{%s}LogoutResponse" % SAMLP_NAMESPACE]
return parse_soap_enveloped_saml_thingy(text, tags)
def parse_soap_enveloped_saml_logout_response(text):
- tags = ['{%s}Response' % SAMLP_NAMESPACE,
- '{%s}LogoutResponse' % SAMLP_NAMESPACE]
+ tags = ["{%s}Response" % SAMLP_NAMESPACE, "{%s}LogoutResponse" % SAMLP_NAMESPACE]
return parse_soap_enveloped_saml_thingy(text, tags)
def parse_soap_enveloped_saml_attribute_query(text):
- expected_tag = '{%s}AttributeQuery' % SAMLP_NAMESPACE
+ expected_tag = "{%s}AttributeQuery" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_attribute_response(text):
- tags = ['{%s}Response' % SAMLP_NAMESPACE,
- '{%s}AttributeResponse' % SAMLP_NAMESPACE]
+ tags = ["{%s}Response" % SAMLP_NAMESPACE, "{%s}AttributeResponse" % SAMLP_NAMESPACE]
return parse_soap_enveloped_saml_thingy(text, tags)
def parse_soap_enveloped_saml_logout_request(text):
- expected_tag = '{%s}LogoutRequest' % SAMLP_NAMESPACE
+ expected_tag = "{%s}LogoutRequest" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_authn_request(text):
- expected_tag = '{%s}AuthnRequest' % SAMLP_NAMESPACE
+ expected_tag = "{%s}AuthnRequest" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_artifact_resolve(text):
- expected_tag = '{%s}ArtifactResolve' % SAMLP_NAMESPACE
+ expected_tag = "{%s}ArtifactResolve" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_artifact_response(text):
- expected_tag = '{%s}ArtifactResponse' % SAMLP_NAMESPACE
+ expected_tag = "{%s}ArtifactResponse" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_name_id_mapping_request(text):
- expected_tag = '{%s}NameIDMappingRequest' % SAMLP_NAMESPACE
+ expected_tag = "{%s}NameIDMappingRequest" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_name_id_mapping_response(text):
- expected_tag = '{%s}NameIDMappingResponse' % SAMLP_NAMESPACE
+ expected_tag = "{%s}NameIDMappingResponse" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_manage_name_id_request(text):
- expected_tag = '{%s}ManageNameIDRequest' % SAMLP_NAMESPACE
+ expected_tag = "{%s}ManageNameIDRequest" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_manage_name_id_response(text):
- expected_tag = '{%s}ManageNameIDResponse' % SAMLP_NAMESPACE
+ expected_tag = "{%s}ManageNameIDResponse" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_assertion_id_request(text):
- expected_tag = '{%s}AssertionIDRequest' % SAMLP_NAMESPACE
+ expected_tag = "{%s}AssertionIDRequest" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_assertion_id_response(text):
- tags = ['{%s}Response' % SAMLP_NAMESPACE,
- '{%s}AssertionIDResponse' % SAMLP_NAMESPACE]
+ tags = ["{%s}Response" % SAMLP_NAMESPACE, "{%s}AssertionIDResponse" % SAMLP_NAMESPACE]
return parse_soap_enveloped_saml_thingy(text, tags)
def parse_soap_enveloped_saml_authn_query(text):
- expected_tag = '{%s}AuthnQuery' % SAMLP_NAMESPACE
+ expected_tag = "{%s}AuthnQuery" % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
def parse_soap_enveloped_saml_authn_query_response(text):
- tags = ['{%s}Response' % SAMLP_NAMESPACE]
+ tags = ["{%s}Response" % SAMLP_NAMESPACE]
return parse_soap_enveloped_saml_thingy(text, tags)
def parse_soap_enveloped_saml_authn_response(text):
- tags = ['{%s}Response' % SAMLP_NAMESPACE]
+ tags = ["{%s}Response" % SAMLP_NAMESPACE]
return parse_soap_enveloped_saml_thingy(text, tags)
-#def parse_soap_enveloped_saml_logout_response(text):
+# def parse_soap_enveloped_saml_logout_response(text):
# expected_tag = '{%s}LogoutResponse' % SAMLP_NAMESPACE
# return parse_soap_enveloped_saml_thingy(text, [expected_tag])
+
def parse_soap_enveloped_saml_thingy(text, expected_tags):
"""Parses a SOAP enveloped SAML thing and returns the thing as
a string.
@@ -140,9 +139,7 @@ def parse_soap_enveloped_saml_thingy(text, expected_tags):
envelope_tag = "{%s}Envelope" % soapenv.NAMESPACE
if envelope.tag != envelope_tag:
raise ValueError(
- "Invalid envelope tag '{invalid}' should be '{valid}'".format(
- invalid=envelope.tag, valid=envelope_tag
- )
+ "Invalid envelope tag '{invalid}' should be '{valid}'".format(invalid=envelope.tag, valid=envelope_tag)
)
if len(envelope) < 1:
@@ -150,12 +147,10 @@ def parse_soap_enveloped_saml_thingy(text, expected_tags):
body = None
for part in envelope:
- if part.tag == '{%s}Body' % soapenv.NAMESPACE:
+ if part.tag == "{%s}Body" % soapenv.NAMESPACE:
n_children = len(part)
if n_children != 1:
- raise Exception(
- "Expected a single child element, found {n}".format(n=n_children)
- )
+ raise Exception("Expected a single child element, found {n}".format(n=n_children))
body = part
break
@@ -166,8 +161,7 @@ def parse_soap_enveloped_saml_thingy(text, expected_tags):
if saml_part.tag in expected_tags:
return ElementTree.tostring(saml_part, encoding="UTF-8")
else:
- raise WrongMessageType("Was '%s' expected one of %s" % (saml_part.tag,
- expected_tags))
+ raise WrongMessageType("Was '%s' expected one of %s" % (saml_part.tag, expected_tags))
NS_AND_TAG = re.compile(r"\{([^}]+)\}(.*)")
@@ -202,9 +196,7 @@ def class_instances_from_soap_enveloped_saml_thingies(text, modules):
envelope_tag = "{%s}Envelope" % soapenv.NAMESPACE
if envelope.tag != envelope_tag:
raise ValueError(
- "Invalid envelope tag '{invalid}' should be '{valid}'".format(
- invalid=envelope.tag, valid=envelope_tag
- )
+ "Invalid envelope tag '{invalid}' should be '{valid}'".format(invalid=envelope.tag, valid=envelope_tag)
)
if len(envelope) < 1:
@@ -213,7 +205,7 @@ def class_instances_from_soap_enveloped_saml_thingies(text, modules):
env = {"header": [], "body": None}
for part in envelope:
- if part.tag == '{%s}Body' % soapenv.NAMESPACE:
+ if part.tag == "{%s}Body" % soapenv.NAMESPACE:
if len(envelope) < 1:
raise Exception("No items in envelope part.")
env["body"] = instanciate_class(part[0], modules)
@@ -238,9 +230,7 @@ def open_soap_envelope(text):
envelope_tag = "{%s}Envelope" % soapenv.NAMESPACE
if envelope.tag != envelope_tag:
raise ValueError(
- "Invalid envelope tag '{invalid}' should be '{valid}'".format(
- invalid=envelope.tag, valid=envelope_tag
- )
+ "Invalid envelope tag '{invalid}' should be '{valid}'".format(invalid=envelope.tag, valid=envelope_tag)
)
if len(envelope) < 1:
@@ -249,7 +239,7 @@ def open_soap_envelope(text):
content = {"header": [], "body": None}
for part in envelope:
- if part.tag == '{%s}Body' % soapenv.NAMESPACE:
+ if part.tag == "{%s}Body" % soapenv.NAMESPACE:
if len(envelope) < 1:
raise Exception("No items in envelope part.")
content["body"] = ElementTree.tostring(part[0], encoding="UTF-8")
@@ -262,7 +252,7 @@ def open_soap_envelope(text):
def make_soap_enveloped_saml_thingy(thingy, headers=None):
- """ Returns a soap envelope containing a SAML request
+ """Returns a soap envelope containing a SAML request
as a text string.
:param thingy: The SAML thingy
@@ -282,7 +272,7 @@ def make_soap_enveloped_saml_thingy(thingy, headers=None):
def soap_fault(message=None, actor=None, code=None, detail=None):
- """ Create a SOAP Fault message
+ """Create a SOAP Fault message
:param message: Human readable error message
:param actor: Who discovered the error
diff --git a/src/saml2/time_util.py b/src/saml2/time_util.py
index 9eb4cec0..c85fdf73 100644
--- a/src/saml2/time_util.py
+++ b/src/saml2/time_util.py
@@ -8,24 +8,24 @@ different types of information.
from __future__ import print_function
import calendar
+from datetime import datetime
+from datetime import timedelta
import re
-import time
import sys
+import time
-from datetime import timedelta
-from datetime import datetime
import six
+
TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
-TIME_FORMAT_WITH_FRAGMENT = re.compile(
- r"^(\d{4,4}-\d{2,2}-\d{2,2}T\d{2,2}:\d{2,2}:\d{2,2})(\.\d*)?Z?$")
+TIME_FORMAT_WITH_FRAGMENT = re.compile(r"^(\d{4,4}-\d{2,2}-\d{2,2}T\d{2,2}:\d{2,2}:\d{2,2})(\.\d*)?Z?$")
# ---------------------------------------------------------------------------
# I'm sure this is implemented somewhere else can't find it now though, so I
# made an attempt.
-#Implemented according to
-#http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
-#adding-durations-to-dateTimes
+# Implemented according to
+# http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
+# adding-durations-to-dateTimes
def f_quotient(arg0, arg1, arg2=0):
@@ -55,28 +55,28 @@ D_FORMAT = [
("T", None),
("H", "tm_hour"),
("M", "tm_min"),
- ("S", "tm_sec")
+ ("S", "tm_sec"),
]
def parse_duration(duration):
# (-)PnYnMnDTnHnMnS
index = 0
- if duration[0] == '-':
- sign = '-'
+ if duration[0] == "-":
+ sign = "-"
index += 1
else:
- sign = '+'
+ sign = "+"
if duration[index] != "P":
- raise ValueError('Parse Duration is not valid.')
+ raise ValueError("Parse Duration is not valid.")
index += 1
dic = dict([(typ, 0) for (code, typ) in D_FORMAT if typ])
dlen = len(duration)
for code, typ in D_FORMAT:
- #print(duration[index:], code)
- if duration[index] == '-':
+ # print(duration[index:], code)
+ if duration[index] == "-":
raise ValueError("Negation not allowed on individual items")
if code == "T":
if duration[index] == "T":
@@ -90,7 +90,7 @@ def parse_duration(duration):
else:
try:
mod = duration[index:].index(code)
- _val = duration[index:index + mod]
+ _val = duration[index : index + mod]
try:
dic[typ] = int(_val)
except ValueError:
@@ -108,8 +108,7 @@ def parse_duration(duration):
else:
raise Exception("Not a float")
else:
- raise ValueError(
- "Fraction not allowed on other than smallest value")
+ raise ValueError("Fraction not allowed on other than smallest value")
index = mod + index + 1
except ValueError:
dic[typ] = 0
@@ -124,12 +123,12 @@ def add_duration(tid, duration):
(sign, dur) = parse_duration(duration)
- if sign == '+':
- #Months
+ if sign == "+":
+ # Months
temp = tid.tm_mon + dur["tm_mon"]
month = modulo(temp, 1, 13)
carry = f_quotient(temp, 1, 13)
- #Years
+ # Years
year = tid.tm_year + dur["tm_year"] + carry
# seconds
temp = tid.tm_sec + dur["tm_sec"]
@@ -164,41 +163,36 @@ def add_duration(tid, duration):
month = modulo(temp, 1, 13)
year += f_quotient(temp, 1, 13)
- return time.localtime(time.mktime((year, month, days, hour, minutes,
- secs, 0, 0, -1)))
+ return time.localtime(time.mktime((year, month, days, hour, minutes, secs, 0, 0, -1)))
else:
pass
+
# ---------------------------------------------------------------------------
-def time_in_a_while(days=0, seconds=0, microseconds=0, milliseconds=0,
- minutes=0, hours=0, weeks=0):
+def time_in_a_while(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0):
"""
format of timedelta:
timedelta([days[, seconds[, microseconds[, milliseconds[,
minutes[, hours[, weeks]]]]]]])
:return: UTC time
"""
- delta = timedelta(days, seconds, microseconds, milliseconds,
- minutes, hours, weeks)
+ delta = timedelta(days, seconds, microseconds, milliseconds, minutes, hours, weeks)
return datetime.utcnow() + delta
-def time_a_while_ago(days=0, seconds=0, microseconds=0, milliseconds=0,
- minutes=0, hours=0, weeks=0):
+def time_a_while_ago(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0):
"""
format of timedelta:
timedelta([days[, seconds[, microseconds[, milliseconds[,
minutes[, hours[, weeks]]]]]]])
"""
- delta = timedelta(days, seconds, microseconds, milliseconds,
- minutes, hours, weeks)
+ delta = timedelta(days, seconds, microseconds, milliseconds, minutes, hours, weeks)
return datetime.utcnow() - delta
-def in_a_while(days=0, seconds=0, microseconds=0, milliseconds=0,
- minutes=0, hours=0, weeks=0, format=TIME_FORMAT):
+def in_a_while(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0, format=TIME_FORMAT):
"""
format of timedelta:
timedelta([days[, seconds[, microseconds[, milliseconds[,
@@ -207,20 +201,18 @@ def in_a_while(days=0, seconds=0, microseconds=0, milliseconds=0,
if format is None:
format = TIME_FORMAT
- return time_in_a_while(days, seconds, microseconds, milliseconds,
- minutes, hours, weeks).strftime(format)
+ return time_in_a_while(days, seconds, microseconds, milliseconds, minutes, hours, weeks).strftime(format)
+
+def a_while_ago(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0, format=TIME_FORMAT):
+ return time_a_while_ago(days, seconds, microseconds, milliseconds, minutes, hours, weeks).strftime(format)
-def a_while_ago(days=0, seconds=0, microseconds=0, milliseconds=0,
- minutes=0, hours=0, weeks=0, format=TIME_FORMAT):
- return time_a_while_ago(days, seconds, microseconds, milliseconds,
- minutes, hours, weeks).strftime(format)
# ---------------------------------------------------------------------------
def shift_time(dtime, shift):
- """ Adds/deletes an integer amount of seconds from a datetime specification
+ """Adds/deletes an integer amount of seconds from a datetime specification
:param dtime: The datatime specification
:param shift: The wanted time shift (+/-)
@@ -228,6 +220,7 @@ def shift_time(dtime, shift):
"""
return dtime + timedelta(seconds=shift)
+
# ---------------------------------------------------------------------------
@@ -259,17 +252,19 @@ def instant(format=TIME_FORMAT, time_stamp=0):
else:
return time.strftime(format, time.gmtime())
+
# ---------------------------------------------------------------------------
def utc_now():
return calendar.timegm(time.gmtime())
+
# ---------------------------------------------------------------------------
def before(point):
- """ True if current time is before point datetime specification.
+ """True if current time is before point datetime specification.
NOTE: If point is specified it is supposed to be in local time.
Not UTC/GMT !! This is because that is what gmtime() expects.
@@ -286,7 +281,7 @@ def before(point):
def after(point):
- """ True if current time is after or equal to point datetime specification."""
+ """True if current time is after or equal to point datetime specification."""
if not point:
return True
else:
@@ -308,7 +303,7 @@ def utc_time_sans_frac():
def later_than(after, before):
- """ True if then is later or equal to that """
+ """True if then is later or equal to that"""
if isinstance(after, six.string_types):
after = str_to_time(after)
elif isinstance(after, int):
diff --git a/src/saml2/tools/make_metadata.py b/src/saml2/tools/make_metadata.py
index a4d9670d..40425d1a 100644
--- a/src/saml2/tools/make_metadata.py
+++ b/src/saml2/tools/make_metadata.py
@@ -2,39 +2,34 @@
import argparse
import os
import sys
-from saml2.metadata import entity_descriptor, metadata_tostring_fix
+
+from saml2.config import Config
from saml2.metadata import entities_descriptor
+from saml2.metadata import entity_descriptor
+from saml2.metadata import metadata_tostring_fix
from saml2.metadata import sign_entity_descriptor
-
from saml2.sigver import security_context
from saml2.validate import valid_instance
-from saml2.config import Config
+
# =============================================================================
# Script that creates a SAML2 metadata file from a pysaml2 entity configuration
# file
# =============================================================================
+
def main():
parser = argparse.ArgumentParser()
- parser.add_argument('-v', dest='valid',
- help="How long, in days, the metadata is valid from the time of creation")
- parser.add_argument('-c', dest='cert', help='certificate')
- parser.add_argument('-e', dest='ed', action='store_true',
- help="Wrap the whole thing in an EntitiesDescriptor")
- parser.add_argument('-i', dest='id',
- help="The ID of the entities descriptor")
- parser.add_argument('-k', dest='keyfile',
- help="A file with a key to sign the metadata with")
- parser.add_argument('-n', dest='name', default="")
- parser.add_argument('-p', dest='path',
- help="path to the configuration file")
- parser.add_argument('-s', dest='sign', action='store_true',
- help="sign the metadata")
- parser.add_argument('-x', dest='xmlsec',
- help="xmlsec binaries to be used for the signing")
- parser.add_argument('-w', dest='wellknown',
- help="Use wellknown namespace prefixes")
+ parser.add_argument("-v", dest="valid", help="How long, in days, the metadata is valid from the time of creation")
+ parser.add_argument("-c", dest="cert", help="certificate")
+ parser.add_argument("-e", dest="ed", action="store_true", help="Wrap the whole thing in an EntitiesDescriptor")
+ parser.add_argument("-i", dest="id", help="The ID of the entities descriptor")
+ parser.add_argument("-k", dest="keyfile", help="A file with a key to sign the metadata with")
+ parser.add_argument("-n", dest="name", default="")
+ parser.add_argument("-p", dest="path", help="path to the configuration file")
+ parser.add_argument("-s", dest="sign", action="store_true", help="sign the metadata")
+ parser.add_argument("-x", dest="xmlsec", help="xmlsec binaries to be used for the signing")
+ parser.add_argument("-w", dest="wellknown", help="Use wellknown namespace prefixes")
parser.add_argument(dest="config", nargs="+")
args = parser.parse_args()
@@ -66,8 +61,7 @@ def main():
secc = security_context(conf)
if args.id:
- desc, xmldoc = entities_descriptor(eds, valid_for, args.name, args.id,
- args.sign, secc)
+ desc, xmldoc = entities_descriptor(eds, valid_for, args.name, args.id, args.sign, secc)
valid_instance(desc)
xmldoc = metadata_tostring_fix(desc, nspair, xmldoc)
print(xmldoc.decode("utf-8"))
diff --git a/src/saml2/tools/mdexport.py b/src/saml2/tools/mdexport.py
index 7ecae391..80633f7d 100644
--- a/src/saml2/tools/mdexport.py
+++ b/src/saml2/tools/mdexport.py
@@ -1,37 +1,38 @@
#!/usr/bin/env python
-from saml2.sigver import _get_xmlsec_cryptobackend
-from saml2.sigver import SecurityContext
-from saml2.httpbase import HTTPBase
+import argparse
-from saml2 import saml
from saml2 import md
-from saml2.attribute_converter import ac_factory
+from saml2 import saml
from saml2 import xmldsig
from saml2 import xmlenc
+from saml2.attribute_converter import ac_factory
+from saml2.httpbase import HTTPBase
+from saml2.mdstore import MetaDataExtern
+from saml2.mdstore import MetaDataFile
+from saml2.mdstore import load_extensions
+from saml2.sigver import SecurityContext
+from saml2.sigver import _get_xmlsec_cryptobackend
-import argparse
-
-from saml2.mdstore import MetaDataFile, MetaDataExtern, load_extensions
-__author__ = 'rolandh'
+__author__ = "rolandh"
"""
A script that imports and verifies metadata and then dumps it in a basic
dictionary format.
"""
+
def main():
parser = argparse.ArgumentParser()
- parser.add_argument('-t', dest='type')
- parser.add_argument('-u', dest='url')
- parser.add_argument('-c', dest='cert')
- parser.add_argument('-a', dest='attrsmap')
- parser.add_argument('-o', dest='output')
- parser.add_argument('-x', dest='xmlsec')
+ parser.add_argument("-t", dest="type")
+ parser.add_argument("-u", dest="url")
+ parser.add_argument("-c", dest="cert")
+ parser.add_argument("-a", dest="attrsmap")
+ parser.add_argument("-o", dest="output")
+ parser.add_argument("-x", dest="xmlsec")
parser.add_argument(dest="item")
args = parser.parse_args()
-
metad = None
if args.type == "local":
@@ -54,5 +55,5 @@ def main():
print(txt)
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/src/saml2/tools/mdexport_test.py b/src/saml2/tools/mdexport_test.py
index c8b4e49f..fdee38a7 100644
--- a/src/saml2/tools/mdexport_test.py
+++ b/src/saml2/tools/mdexport_test.py
@@ -15,16 +15,10 @@ MDIMPORT = {
"swamid": {
"url": "https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2",
"cert": "kalmar2.pem",
- "type": "external"
+ "type": "external",
},
- "incommon": {
- "file": "InCommon-metadata.xml",
- "type": "local"
- },
- "test": {
- "file": "mdtest.xml",
- "type": "local"
- }
+ "incommon": {"file": "InCommon-metadata.xml", "type": "local"},
+ "test": {"file": "mdtest.xml", "type": "local"},
}
@@ -36,13 +30,12 @@ def main():
if item["type"] == "local":
metad = MetaDataFile(sys.argv[1], item["file"])
elif item["type"] == "external":
- metad = MetaDataExtern(sys.argv[1], item["url"],
- "/opt/local/bin/xmlsec1", item["cert"])
+ metad = MetaDataExtern(sys.argv[1], item["url"], "/opt/local/bin/xmlsec1", item["cert"])
if metad:
metad.load()
print(metad.dumps())
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/src/saml2/tools/mdimport.py b/src/saml2/tools/mdimport.py
index 310e61ad..ad5a3a81 100644
--- a/src/saml2/tools/mdimport.py
+++ b/src/saml2/tools/mdimport.py
@@ -1,9 +1,13 @@
#!/usr/bin/env python
import time
+
from saml2.attribute_converter import ac_factory
-from saml2.mdstore import MetaDataMD, MetaDataFile
+from saml2.mdstore import MetaDataFile
+from saml2.mdstore import MetaDataMD
+
+
+__author__ = "rolandh"
-__author__ = 'rolandh'
def main():
start = time.time()
@@ -17,13 +21,12 @@ def main():
start = time.time()
for i in range(1, 10):
- mdf = MetaDataFile(ac_factory("../tests/attributemaps"),
- "../tests/swamid-2.0.xml")
+ mdf = MetaDataFile(ac_factory("../tests/attributemaps"), "../tests/swamid-2.0.xml")
mdf.load()
_ = mdf.keys()
print(time.time() - start)
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/src/saml2/tools/merge_metadata.py b/src/saml2/tools/merge_metadata.py
index dbd93e5a..d31361a3 100644
--- a/src/saml2/tools/merge_metadata.py
+++ b/src/saml2/tools/merge_metadata.py
@@ -1,23 +1,28 @@
#!/usr/bin/env python
-from saml2.sigver import _get_xmlsec_cryptobackend, SecurityContext
-from saml2.httpbase import HTTPBase
-from saml2.attribute_converter import ac_factory
import argparse
-from saml2.mdstore import MetaDataFile, MetaDataExtern, MetadataStore
+from saml2.attribute_converter import ac_factory
+from saml2.httpbase import HTTPBase
+from saml2.mdstore import MetaDataExtern
+from saml2.mdstore import MetaDataFile
+from saml2.mdstore import MetadataStore
+from saml2.sigver import SecurityContext
+from saml2.sigver import _get_xmlsec_cryptobackend
+
-__author__ = 'rolandh'
+__author__ = "rolandh"
"""
A script that imports and verifies metadata.
"""
+
def main():
parser = argparse.ArgumentParser()
- parser.add_argument('-a', dest='attrsmap')
- parser.add_argument('-o', dest='output', default="local")
- parser.add_argument('-x', dest='xmlsec')
- parser.add_argument('-i', dest='ignore_valid', action='store_true')
+ parser.add_argument("-a", dest="attrsmap")
+ parser.add_argument("-o", dest="output", default="local")
+ parser.add_argument("-x", dest="xmlsec")
+ parser.add_argument("-i", dest="ignore_valid", action="store_true")
parser.add_argument(dest="conf")
args = parser.parse_args()
@@ -30,9 +35,9 @@ def main():
#
# for instance
#
- #local metadata_sp_1.xml
- #local InCommon-metadata.xml
- #remote https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2 kalmar2.pem
+ # local metadata_sp_1.xml
+ # local InCommon-metadata.xml
+ # remote https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2 kalmar2.pem
#
ATTRCONV = ac_factory(args.attrsmap)
@@ -59,8 +64,7 @@ def main():
httpc = HTTPBase()
crypto = _get_xmlsec_cryptobackend(args.xmlsec)
sc = SecurityContext(crypto, key_type="", cert_type="")
- metad = MetaDataExtern(ATTRCONV, spec[1], sc, cert=spec[2], http=httpc,
- **kwargs)
+ metad = MetaDataExtern(ATTRCONV, spec[1], sc, cert=spec[2], http=httpc, **kwargs)
if metad is not None:
try:
@@ -73,5 +77,5 @@ def main():
print(mds.dumps(args.output))
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/src/saml2/tools/parse_xsd2.py b/src/saml2/tools/parse_xsd2.py
index e5616da3..e08089cb 100644
--- a/src/saml2/tools/parse_xsd2.py
+++ b/src/saml2/tools/parse_xsd2.py
@@ -1,57 +1,66 @@
#!/usr/bin/env python
-import re
-import time
+import errno
import getopt
import imp
+import re
import sys
+import time
import types
-import errno
+
import six
+
__version__ = 0.5
from xml.etree import cElementTree as ElementTree
-INDENT = 4*" "
+
+INDENT = 4 * " "
DEBUG = False
XMLSCHEMA = "http://www.w3.org/2001/XMLSchema"
-XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
+XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
-CLASS_PROP = [("c_children", ".copy()"),
- ("c_attributes", ".copy()"),
- ("c_child_order", "[:]"),
- ("c_cardinality", ".copy()")]
+CLASS_PROP = [
+ ("c_children", ".copy()"),
+ ("c_attributes", ".copy()"),
+ ("c_child_order", "[:]"),
+ ("c_cardinality", ".copy()"),
+]
BASE_ELEMENT = ["text", "extension_elements", "extension_attributes"]
+
class MissingPrerequisite(Exception):
pass
+
def sd_copy(arg):
try:
return arg.copy()
except AttributeError:
return {}
+
# ------------------------------------------------------------------------
+
def class_pyify(ref):
- return ref.replace("-","_")
+ return ref.replace("-", "_")
-PROTECTED_KEYWORDS = ["import", "def", "if", "else", "return", "for",
- "while", "not", "try", "except", "in"]
+
+PROTECTED_KEYWORDS = ["import", "def", "if", "else", "return", "for", "while", "not", "try", "except", "in"]
def def_init(imports, attributes):
- indent = INDENT+INDENT
- indent3 = INDENT+INDENT+INDENT
+ indent = INDENT + INDENT
+ indent3 = INDENT + INDENT + INDENT
line = ["%sdef __init__(self," % INDENT]
for elem in attributes:
if elem[0] in PROTECTED_KEYWORDS:
- _name = elem[0] +"_"
+ _name = elem[0] + "_"
else:
_name = elem[0]
@@ -63,7 +72,7 @@ def def_init(imports, attributes):
for _, elems in imports.items():
for elem in elems:
if elem in PROTECTED_KEYWORDS:
- _name = elem +"_"
+ _name = elem + "_"
else:
_name = elem
line.append("%s%s=None," % (indent3, _name))
@@ -77,9 +86,9 @@ def def_init(imports, attributes):
def base_init(imports):
line = []
- indent4 = INDENT+INDENT+INDENT+INDENT
+ indent4 = INDENT + INDENT + INDENT + INDENT
if not imports:
- line.append("%sSamlBase.__init__(self, " % (INDENT+INDENT))
+ line.append("%sSamlBase.__init__(self, " % (INDENT + INDENT))
for attr in BASE_ELEMENT:
if attr in PROTECTED_KEYWORDS:
_name = attr + "_"
@@ -90,7 +99,7 @@ def base_init(imports):
else:
# TODO have to keep apart which properties come from which superior
for sup, elems in imports.items():
- line.append("%s%s.__init__(self, " % (INDENT+INDENT, sup))
+ line.append("%s%s.__init__(self, " % (INDENT + INDENT, sup))
lattr = elems[:]
lattr.extend(BASE_ELEMENT)
for attr in lattr:
@@ -104,16 +113,16 @@ def base_init(imports):
def initialize(attributes):
- indent = INDENT+INDENT
+ indent = INDENT + INDENT
line = []
for prop, val, _default in attributes:
if prop in PROTECTED_KEYWORDS:
- _name = prop +"_"
+ _name = prop + "_"
else:
_name = prop
if val in PROTECTED_KEYWORDS:
- _vname = val +"_"
+ _vname = val + "_"
else:
_vname = val
@@ -127,7 +136,7 @@ def _mod_typ(prop):
except ValueError:
typ = prop.type
mod = None
- except TypeError: # No type property
+ except TypeError: # No type property
try:
(mod, typ) = prop.ref
except ValueError:
@@ -159,7 +168,7 @@ def _mod_cname(prop, cdict):
def leading_uppercase(string):
try:
- return string[0].upper()+string[1:]
+ return string[0].upper() + string[1:]
except IndexError:
return string
except TypeError:
@@ -168,7 +177,7 @@ def leading_uppercase(string):
def leading_lowercase(string):
try:
- return string[0].lower()+string[1:]
+ return string[0].lower() + string[1:]
except IndexError:
return string
except TypeError:
@@ -186,6 +195,7 @@ def rm_duplicates(properties):
keys.append(prop.name)
return clist
+
# def rm_duplicates(lista):
# res = []
# for item in lista:
@@ -225,25 +235,23 @@ class PyObj(object):
def child_spec(self, target_namespace, prop, mod, typ, lista):
if mod:
namesp = external_namespace(self.root.modul[mod])
- pkey = '{%s}%s' % (namesp, prop.name)
+ pkey = "{%s}%s" % (namesp, prop.name)
typ = "%s.%s" % (mod, typ)
else:
- pkey = '{%s}%s' % (target_namespace, prop.name)
+ pkey = "{%s}%s" % (target_namespace, prop.name)
if lista:
- return "c_children['%s'] = ('%s', [%s])" % (
- pkey, prop.pyname, typ)
+ return "c_children['%s'] = ('%s', [%s])" % (pkey, prop.pyname, typ)
else:
- return "c_children['%s'] = ('%s', %s)" % (
- pkey, prop.pyname, typ)
+ return "c_children['%s'] = ('%s', %s)" % (pkey, prop.pyname, typ)
def knamn(self, sup, cdict):
cname = cdict[sup].class_name
if not cname:
- (namesp, tag) = cdict[sup].name.split('.')
+ (namesp, tag) = cdict[sup].name.split(".")
if namesp:
ctag = self.root.modul[namesp].factory(tag).__class__.__name__
- cname = '%s.%s' % (namesp, ctag)
+ cname = "%s.%s" % (namesp, ctag)
else:
cname = tag + "_"
return cname
@@ -259,8 +267,7 @@ class PyObj(object):
for prop in own:
if isinstance(prop, PyAttribute):
- line.append("%sc_attributes['%s'] = %s" % (INDENT,
- prop.name, prop.spec()))
+ line.append("%sc_attributes['%s'] = %s" % (INDENT, prop.name, prop.spec()))
if prop.fixed:
args.append((prop.pyname, prop.fixed, None))
else:
@@ -275,7 +282,7 @@ class PyObj(object):
if prop.max == "unbounded":
lista = True
- pmax = 0 # just has to be different from 1
+ pmax = 0 # just has to be different from 1
else:
pmax = int(prop.max)
lista = False
@@ -283,27 +290,20 @@ class PyObj(object):
if prop.name in ignore:
pass
else:
- line.append("%s%s" % (INDENT, self.child_spec(
- target_namespace, prop,
- mod, cname,
- lista)))
+ line.append("%s%s" % (INDENT, self.child_spec(target_namespace, prop, mod, cname, lista)))
- pmin = int(getattr(prop, 'min', 1))
+ pmin = int(getattr(prop, "min", 1))
if pmax == 1 and pmin == 1:
pass
elif prop.max == "unbounded":
- line.append( "%sc_cardinality['%s'] = {\"min\":%s}" % (
- INDENT, prop.pyname, pmin))
+ line.append("%sc_cardinality['%s'] = {\"min\":%s}" % (INDENT, prop.pyname, pmin))
else:
- line.append(
- "%sc_cardinality['%s'] = {\"min\":%s, \"max\":%d}" % (
- INDENT, prop.pyname, pmin, pmax))
+ line.append('%sc_cardinality[\'%s\'] = {"min":%s, "max":%d}' % (INDENT, prop.pyname, pmin, pmax))
child.append(prop.pyname)
if lista:
- args.append((prop.pyname, "%s or []" % (prop.pyname,),
- None))
+ args.append((prop.pyname, "%s or []" % (prop.pyname,), None))
else:
args.append((prop.pyname, prop.pyname, None))
@@ -345,23 +345,19 @@ class PyObj(object):
else:
line.append("class %s(%s):" % (c_name, ",".join(sups)))
- if hasattr(self, 'scoped'):
+ if hasattr(self, "scoped"):
pass
else:
- line.append("%s\"\"\"The %s:%s element \"\"\"" % (INDENT,
- target_namespace,
- self.name))
+ line.append('%s"""The %s:%s element """' % (INDENT, target_namespace, self.name))
line.append("")
line.append("%sc_tag = '%s'" % (INDENT, self.name))
line.append("%sc_namespace = NAMESPACE" % (INDENT,))
try:
if self.value_type:
if isinstance(self.value_type, six.string_types):
- line.append("%sc_value_type = '%s'" % (INDENT,
- self.value_type))
+ line.append("%sc_value_type = '%s'" % (INDENT, self.value_type))
else:
- line.append("%sc_value_type = %s" % (INDENT,
- self.value_type))
+ line.append("%sc_value_type = %s" % (INDENT, self.value_type))
except AttributeError:
pass
@@ -371,15 +367,12 @@ class PyObj(object):
else:
for sup in sups:
for var, cps in CLASS_PROP:
- line.append("%s%s = %s.%s%s" % (INDENT, var, sup, var,
- cps))
+ line.append("%s%s = %s.%s%s" % (INDENT, var, sup, var, cps))
- (args, child, inh) = self._do_properties(line, cdict, ignore,
- target_namespace)
+ (args, child, inh) = self._do_properties(line, cdict, ignore, target_namespace)
if child:
- line.append("%sc_child_order.extend([%s])" % (INDENT,
- "'"+"', '".join(child)+"'"))
+ line.append("%sc_child_order.extend([%s])" % (INDENT, "'" + "', '".join(child) + "'"))
if args:
if inh:
@@ -392,16 +385,14 @@ class PyObj(object):
line.append("")
if not self.abstract or not self.class_name.endswith("_"):
- line.append("def %s_from_string(xml_string):" % pyify(
- self.class_name))
- line.append(
- "%sreturn saml2.create_class_from_xml_string(%s, xml_string)" % (
- INDENT, self.class_name))
+ line.append("def %s_from_string(xml_string):" % pyify(self.class_name))
+ line.append("%sreturn saml2.create_class_from_xml_string(%s, xml_string)" % (INDENT, self.class_name))
line.append("")
self.done = True
return "\n".join(line)
+
def prepend(add, orig):
# return a list which is the lists concatenated with the second list first
res = [add]
@@ -409,6 +400,7 @@ def prepend(add, orig):
res.extend(orig)
return res
+
def pyobj_factory(name, value_type, elms=None):
pyobj = PyObj(name, pyify(name))
pyobj.value_type = value_type
@@ -417,6 +409,7 @@ def pyobj_factory(name, value_type, elms=None):
elms.append(pyobj)
return pyobj
+
def pyelement_factory(name, value_type, elms=None):
obj = PyElement(name, pyify(name))
obj.value_type = value_type
@@ -425,6 +418,7 @@ def pyelement_factory(name, value_type, elms=None):
elms.append(obj)
return obj
+
def expand_groups(properties, cdict):
res = []
for prop in properties:
@@ -437,6 +431,7 @@ def expand_groups(properties, cdict):
return res
+
class PyElement(PyObj):
def __init__(self, name=None, pyname=None, root=None, parent=""):
PyObj.__init__(self, name, pyname, root)
@@ -467,7 +462,7 @@ class PyElement(PyObj):
return [cdict[cname]], []
except ValueError:
pass
- except TypeError: # could be a ref then or a PyObj instance
+ except TypeError: # could be a ref then or a PyObj instance
if isinstance(self.type, PyType):
return self.type.undefined(cdict)
elif isinstance(self.ref, tuple):
@@ -488,12 +483,11 @@ class PyElement(PyObj):
except AttributeError:
self.orig["superior"] = []
self.superior = [typ]
- req = self.class_definition(target_namespace, cdict,
- ignore)
+ req = self.class_definition(target_namespace, cdict, ignore)
if not child:
req = [req]
- if not hasattr(self, 'scoped'):
+ if not hasattr(self, "scoped"):
cdict[self.name] = self
cdict[self.name].done = True
if child:
@@ -502,8 +496,7 @@ class PyElement(PyObj):
return req
- def _external_class(self, mod, typ, cdict, child, target_namespace,
- ignore):
+ def _external_class(self, mod, typ, cdict, child, target_namespace, ignore):
# Will raise exception if class can't be found
cname = self.root.modul[mod].factory(typ).__class__.__name__
imp_name = "%s.%s" % (mod, cname)
@@ -512,8 +505,7 @@ class PyElement(PyObj):
# create import object so I can get the properties from it
# later
impo = pyelement_factory(imp_name, None, None)
- impo.properties = [_import_attrs(self.root.modul[mod], typ,
- self.root),[]]
+ impo.properties = [_import_attrs(self.root.modul[mod], typ, self.root), []]
impo.class_name = imp_name
cdict[imp_name] = impo
impo.done = True
@@ -521,8 +513,7 @@ class PyElement(PyObj):
impo.local = True
# and now for this object
self.superior = [imp_name]
- text = self.class_definition(target_namespace, cdict,
- ignore=ignore)
+ text = self.class_definition(target_namespace, cdict, ignore=ignore)
return text
@@ -538,20 +529,17 @@ class PyElement(PyObj):
try:
(mod, typ) = self.type
if not mod:
- req = self._local_class(typ, cdict, child,
- target_namespace, ignore)
+ req = self._local_class(typ, cdict, child, target_namespace, ignore)
else:
- text = self._external_class(mod, typ, cdict, child,
- target_namespace, ignore)
- except ValueError: # Simple type element
+ text = self._external_class(mod, typ, cdict, child, target_namespace, ignore)
+ except ValueError: # Simple type element
if self.type:
- text = self.class_definition(target_namespace, cdict,
- ignore=ignore)
+ text = self.class_definition(target_namespace, cdict, ignore=ignore)
if child:
self.local = True
self.done = True
- except TypeError: # could be a ref then or a PyObj instance
+ except TypeError: # could be a ref then or a PyObj instance
if isinstance(self.type, PyObj):
pyobj = self.type
pyobj.name = self.name
@@ -562,17 +550,14 @@ class PyElement(PyObj):
elif isinstance(self.ref, tuple):
(mod, typ) = self.ref
if mod:
- #self.superior = ["%s.%s" % (mod, typ)]
+ # self.superior = ["%s.%s" % (mod, typ)]
if verify_import(self.root.modul[mod], typ):
return req, text
else:
- raise Exception(
- "Import attempted on %s from %s module failed - wasn't there" % (
- typ,mod))
+ raise Exception("Import attempted on %s from %s module failed - wasn't there" % (typ, mod))
elif not child:
self.superior = [typ]
- text = self.class_definition(target_namespace, cdict,
- ignore=ignore)
+ text = self.class_definition(target_namespace, cdict, ignore=ignore)
else:
if not cdict[class_pyify(self.ref)].done:
raise MissingPrerequisite(self.ref)
@@ -580,6 +565,7 @@ class PyElement(PyObj):
self.done = True
return req, text
+
def _do(obj, target_namespace, cdict, prep):
try:
(req, text) = obj.text(target_namespace, cdict)
@@ -588,7 +574,7 @@ def _do(obj, target_namespace, cdict, prep):
if text is None:
if req:
- #prep = prepend(req, prep)
+ # prep = prepend(req, prep)
prep.append(req)
return prep, None
else:
@@ -599,10 +585,11 @@ def _do(obj, target_namespace, cdict, prep):
else:
prep.extend(req)
if text:
- #prep = prepend(text, prep)
+ # prep = prepend(text, prep)
prep.append(text)
return prep
+
def reqursive_superior(supc, cdict):
properties = supc.properties[0]
for sup in supc.superior:
@@ -613,11 +600,11 @@ def reqursive_superior(supc, cdict):
properties.extend(reqursive_superior(rsup, cdict))
return properties
+
class PyType(PyObj):
- def __init__(self, name=None, pyname=None, root=None, superior=None,
- internal=True, namespace=None):
+ def __init__(self, name=None, pyname=None, root=None, superior=None, internal=True, namespace=None):
PyObj.__init__(self, name, pyname, root)
- self.class_name = leading_uppercase(self.name + '_')
+ self.class_name = leading_uppercase(self.name + "_")
self.properties = ([], [])
if superior:
self.superior = [superior]
@@ -627,10 +614,8 @@ class PyType(PyObj):
self.internal = internal
self.namespace = namespace
- def text(self, target_namespace, cdict, _child=True, ignore=None,
- _session=None):
- if not self.properties and not self.type \
- and not self.superior:
+ def text(self, target_namespace, cdict, _child=True, ignore=None, _session=None):
+ if not self.properties and not self.type and not self.superior:
self.done = True
return [], self.class_definition(target_namespace, cdict)
@@ -642,11 +627,10 @@ class PyType(PyObj):
try:
supc = cdict[sup]
except KeyError:
- (mod, typ) = sup.split('.')
+ (mod, typ) = sup.split(".")
supc = pyobj_factory(sup, None, None)
if mod:
- supc.properties = [_import_attrs(self.root.modul[mod],
- typ, self.root),[]]
+ supc.properties = [_import_attrs(self.root.modul[mod], typ, self.root), []]
cdict[sup] = supc
supc.done = True
@@ -659,14 +643,13 @@ class PyType(PyObj):
inherited_properties = reqursive_superior(supc, cdict)
if inherited_properties:
- self.properties = (self.properties[0],
- rm_duplicates(inherited_properties))
+ self.properties = (self.properties[0], rm_duplicates(inherited_properties))
(own, inh) = self.properties
own = rm_duplicates(expand_groups(own, cdict))
self.properties = (own, inh)
for prop in own:
- if not prop.name: # Ignore
+ if not prop.name: # Ignore
continue
if not prop.done:
if prop.name in ignore:
@@ -703,7 +686,7 @@ class PyType(PyObj):
(own, _) = self.properties
for prop in own:
- if not prop.name: # Ignore
+ if not prop.name: # Ignore
continue
if isinstance(prop, PyAttribute):
continue
@@ -711,9 +694,9 @@ class PyType(PyObj):
undef[1].append(prop)
return undef
+
class PyAttribute(PyObj):
- def __init__(self, name=None, pyname=None, root=None, external=False,
- namespace="", required=False, typ=""):
+ def __init__(self, name=None, pyname=None, root=None, external=False, namespace="", required=False, typ=""):
PyObj.__init__(self, name, pyname, root)
self.required = required
@@ -729,31 +712,31 @@ class PyAttribute(PyObj):
if not cdict[self.type.name].done:
raise MissingPrerequisite(self.type.name)
- return [], [] # Means this elements definition is empty
+ return [], [] # Means this elements definition is empty
def spec(self):
if isinstance(self.type, PyObj):
- return "('%s', %s, %s)" % (self.pyname, self.type.class_name,
- self.required)
+ return "('%s', %s, %s)" % (self.pyname, self.type.class_name, self.required)
else:
if self.type:
- return "('%s', '%s', %s)" % (self.pyname, self.type,
- self.required)
+ return "('%s', '%s', %s)" % (self.pyname, self.type, self.required)
else:
- return "('%s', '%s', %s)" % (self.pyname, self.base,
- self.required)
+ return "('%s', '%s', %s)" % (self.pyname, self.base, self.required)
+
class PyAny(PyObj):
def __init__(self, name=None, pyname=None, _external=False, _namespace=""):
PyObj.__init__(self, name, pyname)
self.done = True
+
class PyAttributeGroup(object):
def __init__(self, name, root):
self.name = name
self.root = root
self.properties = []
+
class PyGroup(object):
def __init__(self, name, root):
self.name = name
@@ -770,12 +753,13 @@ class PyGroup(object):
(own, _) = self.properties
for prop in own:
- if not prop.name: # Ignore
+ if not prop.name: # Ignore
continue
if not prop.done:
undef[1].append(prop)
return undef
+
# -----------------------------------------------------------------------------
def verify_import(modul, tag):
try:
@@ -784,13 +768,16 @@ def verify_import(modul, tag):
except Exception:
return False
+
def external_namespace(modul):
return modul.NAMESPACE
+
def _import_attrs(modul, tag, top):
obj = modul.factory(tag)
- properties = [PyAttribute(key, val[0], top, True, obj.c_namespace, val[2],
- val[1]) for key,val in obj.c_attributes.items()]
+ properties = [
+ PyAttribute(key, val[0], top, True, obj.c_namespace, val[2], val[1]) for key, val in obj.c_attributes.items()
+ ]
for child in obj.c_child_order:
for key, val in obj.c_children.items():
(pyn, mul) = val
@@ -800,14 +787,16 @@ def _import_attrs(modul, tag, top):
maximum = "unbounded"
if pyn == child:
cpy = PyElement(name=mul.c_tag, pyname=pyn, root=top)
- # internal=False, ns=obj.c_namespace)
+ # internal=False, ns=obj.c_namespace)
cpy.max = maximum
properties.append(cpy)
return properties
+
# ------------------------------------------------------------------------
+
def _spec(elem):
try:
name = elem.name
@@ -824,6 +813,7 @@ def _spec(elem):
return txt
+
# def _klass(elem, _namespace, sup, top):
# if elem.name in top.py_elements:
# return None
@@ -834,11 +824,12 @@ def _spec(elem):
# kl.superior.append(sup)
# return kl
+
def _do_from_string(name):
print
print("def %s_from_string(xml_string):" % pyify(name))
- print("%sreturn saml2.create_class_from_xml_string(%s, xml_string)" % (
- INDENT, name))
+ print("%sreturn saml2.create_class_from_xml_string(%s, xml_string)" % (INDENT, name))
+
def _namespace_and_tag(obj, param, top):
try:
@@ -852,8 +843,10 @@ def _namespace_and_tag(obj, param, top):
return namespace, tag
+
# -----------------------------------------------------------------------------
+
class Simple(object):
def __init__(self, elem):
self.default = None
@@ -885,15 +878,15 @@ class Simple(object):
class Any(Simple):
-
def repr(self, _top=None, _sup=None, _argv=None, _child=True, _parent=""):
return PyAny()
-class AnyAttribute(Simple):
+class AnyAttribute(Simple):
def repr(self, _top=None, _sup=None, _argv=None, _child=True, _parent=""):
return PyAny()
+
class Attribute(Simple):
def repr(self, top=None, sup=None, _argv=None, _child=True, _parent=""):
# default, fixed, use, type
@@ -910,7 +903,7 @@ class Attribute(Simple):
if namespace in self.xmlns_map:
if self.xmlns_map[namespace] == top.target_namespace:
name = tag
- else :
+ else:
external = True
name = "{%s}%s" % (self.xmlns_map[namespace], tag)
else:
@@ -920,12 +913,12 @@ class Attribute(Simple):
name = self.name
pyname = pyify(name)
ref = False
- except ValueError: # self.ref exists but does not split into two parts
+ except ValueError: # self.ref exists but does not split into two parts
ref = True
if "" == top.target_namespace:
name = self.ref
pyname = pyify(name)
- else: # referering to what
+ else: # referering to what
raise Exception("Strange reference: %s" % self.ref)
objekt = PyAttribute(name, pyname, external=external, root=top)
@@ -945,7 +938,7 @@ class Attribute(Simple):
objekt.type = self.type
except ValueError:
if self.xmlns_map[""] == top.target_namespace:
- ctyp = get_type_def(self.type.replace("-","_"), top.parts)
+ ctyp = get_type_def(self.type.replace("-", "_"), top.parts)
if not ctyp.py_class:
ctyp.repr(top, sup)
objekt.type = ctyp.py_class
@@ -976,48 +969,62 @@ class Attribute(Simple):
return objekt
+
class Enumeration(Simple):
pass
+
class Union(Simple):
pass
+
class Import(Simple):
pass
+
class Documentation(Simple):
pass
+
class MaxLength(Simple):
pass
+
class Length(Simple):
pass
+
class MinInclusive(Simple):
pass
+
class MaxInclusive(Simple):
pass
+
class MinExclusive(Simple):
pass
+
class MaxExclusive(Simple):
pass
+
class List(Simple):
pass
+
class Include(Simple):
pass
# -----------------------------------------------------------------------------
+
def sequence(elem):
return [evaluate(child.tag, child) for child in elem]
+
def name_or_ref(elem, top):
try:
(namespace, name) = _namespace_and_tag(elem, elem.ref, top)
@@ -1028,6 +1035,7 @@ def name_or_ref(elem, top):
except AttributeError:
return elem.name
+
class Complex(object):
def __init__(self, elem):
self.value_of = ""
@@ -1059,7 +1067,7 @@ class Complex(object):
self.do_child(elem)
try:
- self.name = self.name.replace("-","_")
+ self.name = self.name.replace("-", "_")
except AttributeError:
pass
@@ -1119,6 +1127,7 @@ class Complex(object):
return res
+
def min_max(cls, objekt, argv):
try:
objekt.max = argv["maxOccurs"]
@@ -1163,8 +1172,8 @@ class Element(Complex):
return namespace, name, ctyp, xns, ref
def collect(self, top, sup, argv=None, parent=""):
- """ means this element is part of a larger object, hence a property of
- that object """
+ """means this element is part of a larger object, hence a property of
+ that object"""
try:
argv_copy = sd_copy(argv)
@@ -1183,11 +1192,11 @@ class Element(Complex):
return []
def repr(self, top=None, sup=None, argv=None, child=True, parent=""):
- #<element ref='xenc:ReferenceList' ...
- #<element name='Transforms' type='xenc:TransformsType' ...
- #<element name='CarriedKeyName' type='string' ...
- #<element name="RecipientKeyInfo" type="ds:KeyInfoType" ...
- #<element name='ReferenceList'>
+ # <element ref='xenc:ReferenceList' ...
+ # <element name='Transforms' type='xenc:TransformsType' ...
+ # <element name='CarriedKeyName' type='string' ...
+ # <element name="RecipientKeyInfo" type="ds:KeyInfoType" ...
+ # <element name='ReferenceList'>
if self.py_class:
return self.py_class
@@ -1198,8 +1207,7 @@ class Element(Complex):
myname = ""
if DEBUG:
- print("#Element.repr '%s' (child=%s) [%s]" %
- (myname, child, self._generated))
+ print("#Element.repr '%s' (child=%s) [%s]" % (myname, child, self._generated))
self.py_class = objekt = PyElement(myname, root=top)
min_max(self, objekt, argv)
@@ -1238,22 +1246,18 @@ class Element(Complex):
# neither type nor reference, definitely local
if hasattr(self, "parts"):
if len(self.parts) == 1:
- if isinstance(self.parts[0], ComplexType) or \
- isinstance(self.parts[0], SimpleType):
+ if isinstance(self.parts[0], ComplexType) or isinstance(self.parts[0], SimpleType):
self.parts[0].name = self.name
- objekt.type = self.parts[0].repr(top, sup,
- parent=self.name)
+ objekt.type = self.parts[0].repr(top, sup, parent=self.name)
objekt.scoped = True
- elif len(self.parts) == 2:# One child might be Annotation
+ elif len(self.parts) == 2: # One child might be Annotation
if isinstance(self.parts[0], Annotation):
self.parts[1].name = self.name
- objekt.type = self.parts[1].repr(top, sup,
- parent=self.name)
+ objekt.type = self.parts[1].repr(top, sup, parent=self.name)
objekt.scoped = True
elif isinstance(self.parts[1], Annotation):
self.parts[0].name = self.name
- objekt.type = self.parts[0].repr(top, sup,
- parent=self.name)
+ objekt.type = self.parts[0].repr(top, sup, parent=self.name)
objekt.scoped = True
else:
if DEBUG:
@@ -1261,9 +1265,7 @@ class Element(Complex):
raise
if parent:
- objekt.class_name = "%s_%s" % (
- leading_uppercase(parent),
- objekt.name)
+ objekt.class_name = "%s_%s" % (leading_uppercase(parent), objekt.name)
objekt.scoped = True
return objekt
@@ -1282,19 +1284,16 @@ class SimpleType(Complex):
if part.parts:
if isinstance(part.parts[0], Enumeration):
lista = [p.value for p in part.parts]
- obj.value_type = {"base":part.base,
- "enumeration":lista}
+ obj.value_type = {"base": part.base, "enumeration": lista}
elif isinstance(part.parts[0], MaxLength):
- obj.value_type = {"base":part.base,
- "maxlen":part.parts[0].value}
+ obj.value_type = {"base": part.base, "maxlen": part.parts[0].value}
elif isinstance(part.parts[0], Length):
- obj.value_type = {"base":part.base,
- "len":part.parts[0].value}
+ obj.value_type = {"base": part.base, "len": part.parts[0].value}
else:
- obj.value_type = {"base":part.base}
+ obj.value_type = {"base": part.base}
elif isinstance(part, List):
if part.itemType:
- obj.value_type = {"base":"list", "member":part.itemType}
+ obj.value_type = {"base": "list", "member": part.itemType}
except ValueError:
pass
@@ -1306,7 +1305,7 @@ class Sequence(Complex):
def collect(self, top, sup, argv=None, parent=""):
argv_copy = sd_copy(argv)
for key, val in self.__dict__.items():
- if key not in ['xmlns_map'] and not key.startswith("_"):
+ if key not in ["xmlns_map"] and not key.startswith("_"):
argv_copy[key] = val
if DEBUG:
@@ -1346,14 +1345,14 @@ class Extension(Complex):
cti = get_type_def(tag, top.parts)
if not cti.py_class:
cti.repr(top, sup)
- #print("#EXT..",ct._collection)
+ # print("#EXT..",ct._collection)
self._inherited = cti.py_class.properties[0][:]
self._inherited.extend(cti.py_class.properties[1])
elif self.xmlns_map[namespace] == XMLSCHEMA:
base = tag
else:
iattr = _import_attrs(top.modul[namespace], tag, top)
- #print("#EXT..-", ia)
+ # print("#EXT..-", ia)
self._inherited = iattr
except (AttributeError, ValueError):
base = None
@@ -1362,11 +1361,12 @@ class Extension(Complex):
return self._own, self._inherited
+
class Choice(Complex):
def collect(self, top, sup, argv=None, parent=""):
argv_copy = sd_copy(argv)
for key, val in self.__dict__.items():
- if key not in ['xmlns_map'] and not key.startswith("_"):
+ if key not in ["xmlns_map"] and not key.startswith("_"):
argv_copy[key] = val
# A choice means each element may not be part of the choice
@@ -1376,11 +1376,13 @@ class Choice(Complex):
print("#Choice: %s" % argv)
return Complex.collect(self, top, sup, argv_copy, parent=parent)
+
class Restriction(Complex):
pass
# if isinstance(self.parts[0], Enumeration):
# values = [enum.value for enum in self.parts]
+
class ComplexType(Complex):
def repr(self, top=None, sup=None, _argv=None, _child=True, parent=""):
if self.py_class:
@@ -1390,15 +1392,13 @@ class ComplexType(Complex):
significant_parts = self.significant_parts()
value_type = ""
if len(significant_parts) == 1:
- if isinstance(significant_parts[0], ComplexContent) or \
- isinstance(significant_parts[0], SimpleContent):
+ if isinstance(significant_parts[0], ComplexContent) or isinstance(significant_parts[0], SimpleContent):
cci = significant_parts[0]
if len(cci.parts) == 1:
if isinstance(cci.parts[0], Extension):
ext = cci.parts[0]
- (namespace, name) = _namespace_and_tag(ext, ext.base,
- top)
+ (namespace, name) = _namespace_and_tag(ext, ext.base, top)
if ext.xmlns_map[namespace] == top.target_namespace:
new_sup = name
@@ -1411,19 +1411,17 @@ class ComplexType(Complex):
else:
new_sup = "%s.%s" % (namespace, name)
- #print("#Superior: %s" % new_sup)
+ # print("#Superior: %s" % new_sup)
if new_sup:
sup = new_sup
else:
- #print("#>>", self.parts[0].__class__)
+ # print("#>>", self.parts[0].__class__)
pass
try:
- self.py_class = PyType(self.name, superior=sup,
- namespace=top.target_namespace, root=top)
- except AttributeError: # No name
- self.py_class = PyType("", superior=sup,
- namespace=top.target_namespace, root=top)
+ self.py_class = PyType(self.name, superior=sup, namespace=top.target_namespace, root=top)
+ except AttributeError: # No name
+ self.py_class = PyType("", superior=sup, namespace=top.target_namespace, root=top)
try:
self.py_class.abstract = self.abstract
@@ -1446,19 +1444,22 @@ class ComplexType(Complex):
return self.py_class
+
class Annotation(Complex):
pass
+
class All(Complex):
pass
+
class Group(Complex):
def collect(self, top, sup, argv=None, parent=""):
- """ means this element is part of a larger object, hence a property of
- that object """
+ """means this element is part of a larger object, hence a property of
+ that object"""
try:
- #objekt = PyGroup("", root=top)
+ # objekt = PyGroup("", root=top)
(namespace, tag) = _namespace_and_tag(self, self.ref, top)
try:
@@ -1469,8 +1470,7 @@ class Group(Complex):
except ValueError:
return cti.collect(top, sup)
else:
- raise Exception(
- "Reference to group in other XSD file, not supported")
+ raise Exception("Reference to group in other XSD file, not supported")
except KeyError:
raise Exception("Missing namespace definition")
except AttributeError as exc:
@@ -1493,15 +1493,19 @@ class Group(Complex):
return objekt
+
class Unique(Complex):
pass
+
class Selector(Complex):
pass
+
class Field(Complex):
pass
+
class AttributeGroup(Complex):
def collect(self, top, sup, argv=None, parent=""):
try:
@@ -1534,19 +1538,18 @@ class AttributeGroup(Complex):
return self.py_class
+
def pyify_0(name):
res = ""
- match = re.match(
- r"^(([A-Z])[a-z]+)(([A-Z])[a-z]+)?(([A-Z])[a-z]+)?(([A-Z])[a-z]+)?",
- name)
+ match = re.match(r"^(([A-Z])[a-z]+)(([A-Z])[a-z]+)?(([A-Z])[a-z]+)?(([A-Z])[a-z]+)?", name)
res += match.group(1).lower()
for num in range(3, len(match.groups()), 2):
try:
- res += "_"+match.group(num+1).lower()+match.group(num)[1:]
+ res += "_" + match.group(num + 1).lower() + match.group(num)[1:]
except AttributeError:
break
- res = res.replace("-","_")
+ res = res.replace("-", "_")
if res in ["class"]:
res += "_"
return res
@@ -1566,13 +1569,13 @@ def pyify(name):
else:
if upc:
if len(upc) == 1:
- res.append(pre+upc[0].lower())
+ res.append(pre + upc[0].lower())
else:
if pre:
res.append(pre)
for uch in upc[:-1]:
res.append(uch.lower())
- res.append("_"+upc[-1].lower())
+ res.append("_" + upc[-1].lower())
upc = []
res.append(char)
@@ -1581,12 +1584,12 @@ def pyify(name):
if len(upc) == len(name):
return name.lower()
else:
- res.append("_"+("".join(upc).lower()))
+ res.append("_" + ("".join(upc).lower()))
return "".join(res)
-def get_type_def( typ, defs):
+def get_type_def(typ, defs):
for cdef in defs:
try:
if cdef.name == typ:
@@ -1610,12 +1613,12 @@ def sort_elements(els):
while diff:
diff = False
for key, val in els.items():
- pres = [v for v in val if v not in res and ':' not in v]
+ pres = [v for v in val if v not in res and ":" not in v]
els[key] = pres
if pres != val:
diff = True
- #print(els)
+ # print(els)
partres = []
for key, val in els.items():
if not val:
@@ -1662,7 +1665,8 @@ def output(elem, target_namespace, eldict, ignore=None):
def intro():
- print("""#!/usr/bin/env python
+ print(
+ """#!/usr/bin/env python
#
# Generated %s by parse_xsd.py version %s.
@@ -1670,9 +1674,12 @@ def intro():
import saml2
from saml2 import SamlBase
-""" % (time.ctime(), __version__))
+"""
+ % (time.ctime(), __version__)
+ )
+
-#NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#'
+# NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#'
def block_items(objekt, block, eldict):
@@ -1682,8 +1689,7 @@ def block_items(objekt, block, eldict):
block.append(objekt.type)
block.append(objekt)
if isinstance(objekt, PyType):
- others = [p for p in eldict.values() if isinstance(p,
- PyElement) and p.type[1] == objekt.name]
+ others = [p for p in eldict.values() if isinstance(p, PyElement) and p.type[1] == objekt.name]
for item in others:
if item not in block:
block.append(item)
@@ -1711,7 +1717,6 @@ def find_parent(elm, eldict):
class Schema(Complex):
-
def __init__(self, elem, impo, add, modul, defs):
Complex.__init__(self, elem)
self.impo = impo
@@ -1739,9 +1744,7 @@ class Schema(Complex):
else:
lista = False
- spec = objekt.child_spec(self.target_namespace,
- prop, mod, cname,
- lista)
+ spec = objekt.child_spec(self.target_namespace, prop, mod, cname, lista)
lines = ["%s.%s" % (objekt.class_name, spec)]
tup.append((prop, lines, spec))
@@ -1793,8 +1796,7 @@ class Schema(Complex):
for sup in sups:
if sup.name == ref:
for tup in tups:
- tup[1].append("%s.%s" % (objekt.class_name,
- tup[2]))
+ tup[1].append("%s.%s" % (objekt.class_name, tup[2]))
break
else:
pass
@@ -1840,8 +1842,7 @@ class Schema(Complex):
continue
if elem.abstract:
continue
- print("%s%s.c_tag: %s_from_string," % (INDENT, elem.class_name,
- pyify(elem.class_name)))
+ print("%s%s.c_tag: %s_from_string," % (INDENT, elem.class_name, pyify(elem.class_name)))
print("}")
print()
@@ -1884,7 +1885,7 @@ class Schema(Complex):
for elem in self.elems:
eldict[elem.name] = elem
- #print(eldict.keys())
+ # print(eldict.keys())
intro()
for modul in self.add:
@@ -1892,7 +1893,7 @@ class Schema(Complex):
for _namespace, (mod, namn) in self.impo.items():
if namn:
print("import %s as %s" % (mod, namn))
- print( )
+ print()
print("NAMESPACE = '%s'" % self.target_namespace)
print
@@ -1917,22 +1918,19 @@ class Schema(Complex):
block = block_items(objekt, block, eldict)
if exceptions:
- print("#", 70*'+')
+ print("#", 70 * "+")
for line in exceptions:
print(line)
- print("#", 70*'+')
+ print("#", 70 * "+")
print
for attrgrp in self.attrgrp:
print("AG_%s = [" % attrgrp.name)
for prop in attrgrp.properties[0]:
if isinstance(prop.type, PyObj):
- print("%s('%s', %s_, %s)," % (INDENT, prop.name,
- prop.type.name,
- prop.required))
+ print("%s('%s', %s_, %s)," % (INDENT, prop.name, prop.type.name, prop.required))
else:
- print("%s('%s', '%s', %s)," % (INDENT, prop.name,
- prop.type, prop.required))
+ print("%s('%s', '%s', %s)," % (INDENT, prop.name, prop.type, prop.required))
print("]")
print()
@@ -1947,8 +1945,7 @@ class Schema(Complex):
# -----------------------------------------------------------------------------
-NAMESPACE_BASE = ["http://www.w3.org/2001/XMLSchema",
- "http://www.w3.org/2000/10/XMLSchema"]
+NAMESPACE_BASE = ["http://www.w3.org/2001/XMLSchema", "http://www.w3.org/2000/10/XMLSchema"]
_MAP = {
"element": Element,
@@ -1964,8 +1961,8 @@ _MAP = {
"enumeration": Enumeration,
"import": Import,
"annotation": Annotation,
- "attributeGroup":AttributeGroup,
- "attribute":Attribute,
+ "attributeGroup": AttributeGroup,
+ "attribute": Attribute,
"choice": Choice,
"complexContent": ComplexContent,
"documentation": Documentation,
@@ -1978,8 +1975,8 @@ _MAP = {
"field": Field,
"key": Key,
"include": Include,
- "redefine": Redefine
- }
+ "redefine": Redefine,
+}
ELEMENTFUNCTION = {}
@@ -1997,6 +1994,7 @@ def evaluate(typ, elem):
NS_MAP = "xmlns_map"
+
def parse_nsmap(fil):
events = "start", "start-ns", "end-ns"
@@ -2015,15 +2013,17 @@ def parse_nsmap(fil):
return ElementTree.ElementTree(root)
+
def usage():
print("Usage: parse_xsd [-i <module:as>] xsd.file > module.py")
+
def recursive_find_module(name, path=None):
parts = name.split(".")
mod_a = None
for part in parts:
- #print("$$", part, path)
+ # print("$$", part, path)
try:
(fil, pathname, desc) = imp.find_module(part, path)
except ImportError:
@@ -2035,6 +2035,7 @@ def recursive_find_module(name, path=None):
return mod_a
+
def get_mod(name, path=None):
try:
mod_a = sys.modules[name]
@@ -2059,6 +2060,7 @@ def recursive_add_xmlns_map(_sch, base):
if isinstance(_part, Complex):
recursive_add_xmlns_map(_part, base)
+
def find_and_replace(base, mods):
base.xmlns_map = mods.xmlns_map
recursive_add_xmlns_map(base, mods)
@@ -2079,6 +2081,7 @@ def find_and_replace(base, mods):
base.parts.extend(mods.parts)
return base
+
def read_schema(doc, add, defs, impo, modul, ignore, sdir):
for path in sdir:
fil = "%s%s" % (path, doc)
@@ -2111,22 +2114,20 @@ def read_schema(doc, add, defs, impo, modul, ignore, sdir):
else:
raise Exception("Undefined namespace: %s" % namespace)
- _schema = Schema(tree._root, impo, add, modul, defs)
+ _schema = Schema(tree._root, impo, add, modul, defs)
_included_parts = []
_remove_parts = []
_replace = []
for part in _schema.parts:
if isinstance(part, Include):
- _sch = read_schema(part.schemaLocation, add, defs, impo, modul,
- ignore, sdir)
+ _sch = read_schema(part.schemaLocation, add, defs, impo, modul, ignore, sdir)
# Add namespace information
recursive_add_xmlns_map(_sch, _schema)
_included_parts.extend(_sch.parts)
_remove_parts.append(part)
elif isinstance(part, Redefine):
# This is the schema that is going to be redefined
- _redef = read_schema(part.schemaLocation, add, defs, impo, modul,
- ignore, sdir)
+ _redef = read_schema(part.schemaLocation, add, defs, impo, modul, ignore, sdir)
# so find and replace
# Use the schema to be redefined as starting point
_replacement = find_and_replace(_redef, part)
@@ -2141,14 +2142,14 @@ def read_schema(doc, add, defs, impo, modul, ignore, sdir):
_schema.parts.extend(med)
return _schema
+
def main():
argv = sys.argv[1:]
try:
- opts, args = getopt.getopt(argv, "a:d:hi:I:s:",
- ["add=", "help", "import=", "defs="])
+ opts, args = getopt.getopt(argv, "a:d:hi:I:s:", ["add=", "help", "import=", "defs="])
except getopt.GetoptError as err:
# print help information and exit:
- print(str(err)) # will print something like "option -a not recognized"
+ print(str(err)) # will print something like "option -a not recognized"
usage()
sys.exit(2)
@@ -2170,7 +2171,7 @@ def main():
elif opt in ("-s", "--schemadir"):
sdir.append(arg)
elif opt in ("-i", "--import"):
- mod = get_mod(arg, ['.'])
+ mod = get_mod(arg, ["."])
modul[mod.NAMESPACE] = mod
impo[mod.NAMESPACE] = [arg, None]
elif opt in ("-I", "--ignore"):
@@ -2184,7 +2185,7 @@ def main():
sys.exit(2)
schema = read_schema(args[0], add, defs, impo, modul, ignore, sdir)
- #print(schema.__dict__)
+ # print(schema.__dict__)
schema.out()
diff --git a/src/saml2/tools/sync_attrmaps.py b/src/saml2/tools/sync_attrmaps.py
index 4f0d3b67..718508c0 100644
--- a/src/saml2/tools/sync_attrmaps.py
+++ b/src/saml2/tools/sync_attrmaps.py
@@ -1,10 +1,11 @@
#!/usr/bin/env python
from importlib import import_module
-import sys
import os
+import sys
+
-__author__ = 'roland'
+__author__ = "roland"
def load(head, tail):
@@ -61,8 +62,7 @@ class AMap(object):
print("# Added %s=%s" % (self.mod.MAP["to"][val], key))
self.mod.MAP["to"][val] = key
except AssertionError:
- raise Exception("Mismatch key:%s '%s' != '%s'" % (
- key, val, self.mod.MAP["to"][val]))
+ raise Exception("Mismatch key:%s '%s' != '%s'" % (key, val, self.mod.MAP["to"][val]))
for val in self.mod.MAP["to"].values():
if val not in self.mod.MAP["fro"]:
@@ -74,12 +74,11 @@ class AMap(object):
_fro = self.mod.MAP["fro"]
for var in self.vars:
_v = self.variable[var]
- li = [k[len(_v):] for k in _fro.keys() if k.startswith(_v)]
+ li = [k[len(_v) :] for k in _fro.keys() if k.startswith(_v)]
li.sort(intcmp)
for item in li:
- txt.append("%s%s+'%s': '%s'," % (i2, var, item,
- _fro[_v + item]))
- txt.append('%s},' % self.indent)
+ txt.append("%s%s+'%s': '%s'," % (i2, var, item, _fro[_v + item]))
+ txt.append("%s}," % self.indent)
return txt
def do_to(self):
@@ -94,10 +93,9 @@ class AMap(object):
val = _to[key]
for _urn, _name in invmap.items():
if val.startswith(_urn):
- txt.append("%s'%s': %s+'%s'," % (i2, key, _name,
- val[len(_urn):]))
+ txt.append("%s'%s': %s+'%s'," % (i2, key, _name, val[len(_urn) :]))
- txt.append('%s}' % self.indent)
+ txt.append("%s}" % self.indent)
return txt
def __str__(self):
@@ -109,8 +107,7 @@ class AMap(object):
text.extend(["", ""])
text.append("MAP = {")
- text.append("%s'identifier': '%s'," % (self.indent,
- self.mod.MAP["identifier"]))
+ text.append("%s'identifier': '%s'," % (self.indent, self.mod.MAP["identifier"]))
text.extend(self.do_fro())
text.extend(self.do_to())
diff --git a/src/saml2/tools/verify_metadata.py b/src/saml2/tools/verify_metadata.py
index d7102548..aefffe40 100644
--- a/src/saml2/tools/verify_metadata.py
+++ b/src/saml2/tools/verify_metadata.py
@@ -4,32 +4,31 @@ import argparse
from saml2.attribute_converter import ac_factory
from saml2.httpbase import HTTPBase
-
-from saml2.sigver import _get_xmlsec_cryptobackend
+from saml2.mdstore import MetaDataExtern
+from saml2.mdstore import MetaDataFile
from saml2.sigver import SecurityContext
+from saml2.sigver import _get_xmlsec_cryptobackend
-from saml2.mdstore import MetaDataFile
-from saml2.mdstore import MetaDataExtern
-__author__ = 'rolandh'
+__author__ = "rolandh"
"""
A script that imports and verifies metadata.
"""
+
def main():
parser = argparse.ArgumentParser()
- parser.add_argument('-t', dest='type')
- parser.add_argument('-u', dest='url')
- parser.add_argument('-c', dest='cert')
- parser.add_argument('-a', dest='attrsmap')
- parser.add_argument('-o', dest='output')
- parser.add_argument('-x', dest='xmlsec')
- parser.add_argument('-i', dest='ignore_valid', action='store_true')
+ parser.add_argument("-t", dest="type")
+ parser.add_argument("-u", dest="url")
+ parser.add_argument("-c", dest="cert")
+ parser.add_argument("-a", dest="attrsmap")
+ parser.add_argument("-o", dest="output")
+ parser.add_argument("-x", dest="xmlsec")
+ parser.add_argument("-i", dest="ignore_valid", action="store_true")
parser.add_argument(dest="item")
args = parser.parse_args()
-
metad = None
if args.ignore_valid:
@@ -41,8 +40,7 @@ def main():
if args.cert and args.xmlsec:
crypto = _get_xmlsec_cryptobackend(args.xmlsec)
sc = SecurityContext(crypto)
- metad = MetaDataFile(args.item, args.item, cert=args.cert, security=sc,
- **kwargs)
+ metad = MetaDataFile(args.item, args.item, cert=args.cert, security=sc, **kwargs)
else:
metad = MetaDataFile(args.item, args.item, **kwargs)
elif args.type == "external":
@@ -50,8 +48,7 @@ def main():
httpc = HTTPBase()
crypto = _get_xmlsec_cryptobackend(args.xmlsec)
sc = SecurityContext(crypto)
- metad = MetaDataExtern(ATTRCONV, args.url, sc, cert=args.cert, http=httpc,
- **kwargs)
+ metad = MetaDataExtern(ATTRCONV, args.url, sc, cert=args.cert, http=httpc, **kwargs)
if metad:
try:
@@ -62,5 +59,5 @@ def main():
print("OK")
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/src/saml2/userinfo/__init__.py b/src/saml2/userinfo/__init__.py
index 4521e04b..9e5bccd4 100644
--- a/src/saml2/userinfo/__init__.py
+++ b/src/saml2/userinfo/__init__.py
@@ -4,7 +4,7 @@ import copy
class UserInfo(object):
- """ Read only interface to a user info store """
+ """Read only interface to a user info store"""
def __init__(self):
pass
@@ -14,7 +14,7 @@ class UserInfo(object):
class UserInfoDB(UserInfo):
- """ Read only interface to a user info store """
+ """Read only interface to a user info store"""
def __init__(self, db=None):
self.db = db
@@ -52,4 +52,3 @@ class UserInfoDB(UserInfo):
return self.filter(self.db[userid], user_info_claims)
except KeyError:
return {}
-
diff --git a/src/saml2/userinfo/ldapinfo.py b/src/saml2/userinfo/ldapinfo.py
index 17b0905a..085c9102 100644
--- a/src/saml2/userinfo/ldapinfo.py
+++ b/src/saml2/userinfo/ldapinfo.py
@@ -1,11 +1,13 @@
import ldap
from ldap import SCOPE_SUBTREE
+
from saml2.userinfo import UserInfo
class UserInfoLDAP(UserInfo):
- def __init__(self, uri, base, filter_pattern, scope=SCOPE_SUBTREE,
- tls=False, user="", passwd="", attr=None, attrsonly=False):
+ def __init__(
+ self, uri, base, filter_pattern, scope=SCOPE_SUBTREE, tls=False, user="", passwd="", attr=None, attrsonly=False
+ ):
UserInfo.__init__(self)
self.ldapuri = uri
self.base = base
@@ -18,8 +20,9 @@ class UserInfoLDAP(UserInfo):
self.ld.protocol_version = ldap.VERSION3
self.ld.simple_bind_s(user, passwd)
- def __call__(self, userid, base="", filter_pattern="", scope=SCOPE_SUBTREE,
- tls=False, attr=None, attrsonly=False, **kwargs):
+ def __call__(
+ self, userid, base="", filter_pattern="", scope=SCOPE_SUBTREE, tls=False, attr=None, attrsonly=False, **kwargs
+ ):
if filter_pattern:
_filter = filter_pattern % userid
@@ -34,4 +37,4 @@ class UserInfoLDAP(UserInfo):
res = self.ld.search_s(*arg)
# should only be one entry and the information per entry is
# the tuple (dn, ava)
- return res[0][1] \ No newline at end of file
+ return res[0][1]
diff --git a/src/saml2/validate.py b/src/saml2/validate.py
index 334b3d14..77163598 100644
--- a/src/saml2/validate.py
+++ b/src/saml2/validate.py
@@ -1,17 +1,19 @@
-import calendar
-from six.moves.urllib.parse import urlparse
-import re
-import struct
import base64
-import time
+import calendar
from ipaddress import AddressValueError
from ipaddress import IPv4Address
from ipaddress import IPv6Address
+import re
+import struct
+import time
+
+from six.moves.urllib.parse import urlparse
from saml2 import time_util
-XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'
-XSI_NIL = '{%s}nil' % XSI_NAMESPACE
+
+XSI_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"
+XSI_NIL = "{%s}nil" % XSI_NAMESPACE
# ---------------------------------------------------------
@@ -38,6 +40,7 @@ class ResponseLifetimeExceed(Exception):
class ToEarly(Exception):
pass
+
# --------------------- validators -------------------------------------
#
@@ -46,7 +49,7 @@ NCNAME = re.compile(r"(?P<NCName>[a-zA-Z_](\w|[_.-])*)")
def valid_ncname(name):
match = NCNAME.match(name)
- #if not match: # hack for invalid authnRequest/ID from meteor saml lib
+ # if not match: # hack for invalid authnRequest/ID from meteor saml lib
# raise NotValid("NCName")
return True
@@ -94,10 +97,11 @@ def validate_on_or_after(not_on_or_after, slack):
now = time_util.utc_now()
nooa = calendar.timegm(time_util.str_to_time(not_on_or_after))
if now > nooa + slack:
- now_str=time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(now))
+ now_str = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(now))
raise ResponseLifetimeExceed(
- "Can't use response, too old (now=%s + slack=%d > " \
- "not_on_or_after=%s" % (now_str, slack, not_on_or_after))
+ "Can't use response, too old (now=%s + slack=%d > "
+ "not_on_or_after=%s" % (now_str, slack, not_on_or_after)
+ )
return nooa
else:
return False
@@ -108,9 +112,10 @@ def validate_before(not_before, slack):
now = time_util.utc_now()
nbefore = calendar.timegm(time_util.str_to_time(not_before))
if nbefore > now + slack:
- now_str = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(now))
- raise ToEarly("Can't use response yet: (now=%s + slack=%d) "
- "<= notbefore=%s" % (now_str, slack, not_before))
+ now_str = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(now))
+ raise ToEarly(
+ "Can't use response yet: (now=%s + slack=%d) " "<= notbefore=%s" % (now_str, slack, not_before)
+ )
return True
@@ -158,7 +163,7 @@ def valid_duration(val):
def valid_string(val):
- """ Expects unicode
+ """Expects unicode
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF]
"""
@@ -231,9 +236,9 @@ def valid_base64(val):
def valid_qname(val):
- """ A qname is either
- NCName or
- NCName ':' NCName
+ """A qname is either
+ NCName or
+ NCName ':' NCName
"""
try:
@@ -244,7 +249,7 @@ def valid_qname(val):
def valid_anytype(val):
- """ Goes through all known type validators
+ """Goes through all known type validators
:param val: The value to validate
:return: True is value is valid otherwise an exception is raised
@@ -263,6 +268,7 @@ def valid_anytype(val):
raise NotValid("AnyType")
+
# -----------------------------------------------------------------------------
VALIDATOR = {
@@ -328,12 +334,10 @@ def _valid_instance(instance, val):
try:
val.verify()
except NotValid as exc:
- raise NotValid("Class '%s' instance: %s" % (
- instance.__class__.__name__, exc.args[0]))
+ raise NotValid("Class '%s' instance: %s" % (instance.__class__.__name__, exc.args[0]))
except OutsideCardinality as exc:
- raise NotValid(
- "Class '%s' instance cardinality error: %s" % (
- instance.__class__.__name__, exc.args[0]))
+ raise NotValid("Class '%s' instance cardinality error: %s" % (instance.__class__.__name__, exc.args[0]))
+
ERROR_TEXT = "Wrong type of value '%s' on attribute '%s' expected it to be %s"
@@ -349,14 +353,12 @@ def valid_instance(instance):
if instclass.c_value_type and instance.text:
try:
- validate_value_type(instance.text.strip(),
- instclass.c_value_type)
+ validate_value_type(instance.text.strip(), instclass.c_value_type)
except NotValid as exc:
- raise NotValid("Class '%s' instance: %s" % (class_name,
- exc.args[0]))
+ raise NotValid("Class '%s' instance: %s" % (class_name, exc.args[0]))
for (name, typ, required) in instclass.c_attributes.values():
- value = getattr(instance, name, '')
+ value = getattr(instance, name, "")
if required and not value:
txt = "Required value on property '%s' missing" % name
raise MustValueError("Class '%s' instance: %s" % (class_name, txt))
@@ -377,7 +379,7 @@ def valid_instance(instance):
raise NotValid("Class '%s' instance: %s" % (class_name, txt))
for (name, _spec) in instclass.c_children.values():
- value = getattr(instance, name, '')
+ value = getattr(instance, name, "")
try:
_card = instclass.c_cardinality[name]
@@ -393,7 +395,7 @@ def valid_instance(instance):
_cmin = _cmax = _card = None
if value:
- #_has_val = True
+ # _has_val = True
if isinstance(value, list):
_list = True
vlen = len(value)
@@ -404,14 +406,14 @@ def valid_instance(instance):
if _card:
if _cmin is not None and _cmin > vlen:
raise NotValid(
- "Class '%s' instance cardinality error: %s" % (
- class_name, "less then min (%s<%s)" % (vlen,
- _cmin)))
+ "Class '%s' instance cardinality error: %s"
+ % (class_name, "less then min (%s<%s)" % (vlen, _cmin))
+ )
if _cmax is not None and vlen > _cmax:
raise NotValid(
- "Class '%s' instance cardinality error: %s" % (
- class_name, "more then max (%s>%s)" % (vlen,
- _cmax)))
+ "Class '%s' instance cardinality error: %s"
+ % (class_name, "more then max (%s>%s)" % (vlen, _cmax))
+ )
if _list:
for val in value:
@@ -422,15 +424,13 @@ def valid_instance(instance):
else:
if _cmin:
raise NotValid(
- "Class '%s' instance cardinality error: %s" % (
- class_name, "too few values on %s" % name))
+ "Class '%s' instance cardinality error: %s" % (class_name, "too few values on %s" % name)
+ )
return True
def valid_domain_name(dns_name):
- m = re.match(
- r"^[a-z0-9]+([-.]{ 1 }[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$",
- dns_name, re.I)
+ m = re.match(r"^[a-z0-9]+([-.]{ 1 }[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$", dns_name, re.I)
if not m:
raise ValueError("Not a proper domain name")
diff --git a/src/saml2/virtual_org.py b/src/saml2/virtual_org.py
index 3f66442c..375044b4 100644
--- a/src/saml2/virtual_org.py
+++ b/src/saml2/virtual_org.py
@@ -1,7 +1,9 @@
import logging
+
from saml2.attribute_resolver import AttributeResolver
from saml2.saml import NAMEID_FORMAT_PERSISTENT
+
logger = logging.getLogger(__name__)
@@ -40,8 +42,7 @@ class VirtualOrg(object):
vo_members.append(member)
# Remove the ones I have cached data from about this subject
- vo_members = [m for m in vo_members if not self.sp.users.cache.active(
- name_id, m)]
+ vo_members = [m for m in vo_members if not self.sp.users.cache.active(name_id, m)]
logger.info("VO members (not cached): %s", vo_members)
return vo_members
@@ -59,8 +60,7 @@ class VirtualOrg(object):
def do_aggregation(self, name_id):
- logger.info("** Do VO aggregation **\nSubjectID: %s, VO:%s",
- name_id, self._name)
+ logger.info("** Do VO aggregation **\nSubjectID: %s, VO:%s", name_id, self._name)
to_ask = self.members_to_ask(name_id)
if to_ask:
@@ -68,8 +68,7 @@ class VirtualOrg(object):
resolver = AttributeResolver(self.sp)
# extends returns a list of session_infos
- for session_info in resolver.extend(
- com_identifier, self.sp.config.entityid, to_ask):
+ for session_info in resolver.extend(com_identifier, self.sp.config.entityid, to_ask):
_ = self._cache_session(session_info)
logger.info(">Issuers: %s", self.sp.users.issuers_of_info(name_id))
diff --git a/src/saml2/ws/__init__.py b/src/saml2/ws/__init__.py
index 16f3a796..c09b2213 100644
--- a/src/saml2/ws/__init__.py
+++ b/src/saml2/ws/__init__.py
@@ -1 +1 @@
-__author__ = 'roland'
+__author__ = "roland"
diff --git a/src/saml2/ws/wsaddr.py b/src/saml2/ws/wsaddr.py
index fe41e57a..2ded19b3 100644
--- a/src/saml2/ws/wsaddr.py
+++ b/src/saml2/ws/wsaddr.py
@@ -8,457 +8,511 @@ import saml2
from saml2 import SamlBase
-NAMESPACE = 'http://www.w3.org/2005/08/addressing'
+NAMESPACE = "http://www.w3.org/2005/08/addressing"
+
class ReferenceParametersType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:ReferenceParametersType element """
+ """The http://www.w3.org/2005/08/addressing:ReferenceParametersType element"""
- c_tag = 'ReferenceParametersType'
+ c_tag = "ReferenceParametersType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def reference_parameters_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ReferenceParametersType_, xml_string)
class MetadataType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:MetadataType element """
+ """The http://www.w3.org/2005/08/addressing:MetadataType element"""
- c_tag = 'MetadataType'
+ c_tag = "MetadataType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def metadata_type__from_string(xml_string):
return saml2.create_class_from_xml_string(MetadataType_, xml_string)
class RelationshipTypeOpenEnum_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:RelationshipTypeOpenEnum element """
+ """The http://www.w3.org/2005/08/addressing:RelationshipTypeOpenEnum element"""
- c_tag = 'RelationshipTypeOpenEnum'
+ c_tag = "RelationshipTypeOpenEnum"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def relationship_type_open_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(RelationshipTypeOpenEnum_, xml_string)
+
class RelationshipType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:RelationshipType element """
+ """The http://www.w3.org/2005/08/addressing:RelationshipType element"""
- c_tag = 'RelationshipType'
+ c_tag = "RelationshipType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:anyURI', 'enumeration': ['http://www.w3.org/2005/08/addressing/reply']}
+ c_value_type = {"base": "xs:anyURI", "enumeration": ["http://www.w3.org/2005/08/addressing/reply"]}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def relationship_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RelationshipType_, xml_string)
class AttributedURIType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:AttributedURIType element """
+ """The http://www.w3.org/2005/08/addressing:AttributedURIType element"""
- c_tag = 'AttributedURIType'
+ c_tag = "AttributedURIType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def attributed_uri_type__from_string(xml_string):
return saml2.create_class_from_xml_string(AttributedURIType_, xml_string)
class FaultCodesOpenEnumType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:FaultCodesOpenEnumType element """
+ """The http://www.w3.org/2005/08/addressing:FaultCodesOpenEnumType element"""
- c_tag = 'FaultCodesOpenEnumType'
+ c_tag = "FaultCodesOpenEnumType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def fault_codes_open_enum_type__from_string(xml_string):
return saml2.create_class_from_xml_string(FaultCodesOpenEnumType_, xml_string)
class FaultCodesType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:FaultCodesType element """
+ """The http://www.w3.org/2005/08/addressing:FaultCodesType element"""
- c_tag = 'FaultCodesType'
+ c_tag = "FaultCodesType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:QName', 'enumeration': ['tns:InvalidAddressingHeader', 'tns:InvalidAddress', 'tns:InvalidEPR', 'tns:InvalidCardinality', 'tns:MissingAddressInEPR', 'tns:DuplicateMessageID', 'tns:ActionMismatch', 'tns:MessageAddressingHeaderRequired', 'tns:DestinationUnreachable', 'tns:ActionNotSupported', 'tns:EndpointUnavailable']}
+ c_value_type = {
+ "base": "xs:QName",
+ "enumeration": [
+ "tns:InvalidAddressingHeader",
+ "tns:InvalidAddress",
+ "tns:InvalidEPR",
+ "tns:InvalidCardinality",
+ "tns:MissingAddressInEPR",
+ "tns:DuplicateMessageID",
+ "tns:ActionMismatch",
+ "tns:MessageAddressingHeaderRequired",
+ "tns:DestinationUnreachable",
+ "tns:ActionNotSupported",
+ "tns:EndpointUnavailable",
+ ],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def fault_codes_type__from_string(xml_string):
return saml2.create_class_from_xml_string(FaultCodesType_, xml_string)
class AttributedUnsignedLongType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:AttributedUnsignedLongType element """
+ """The http://www.w3.org/2005/08/addressing:AttributedUnsignedLongType element"""
- c_tag = 'AttributedUnsignedLongType'
+ c_tag = "AttributedUnsignedLongType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'unsignedLong'}
+ c_value_type = {"base": "unsignedLong"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def attributed_unsigned_long_type__from_string(xml_string):
return saml2.create_class_from_xml_string(AttributedUnsignedLongType_, xml_string)
class AttributedQNameType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:AttributedQNameType element """
+ """The http://www.w3.org/2005/08/addressing:AttributedQNameType element"""
- c_tag = 'AttributedQNameType'
+ c_tag = "AttributedQNameType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'QName'}
+ c_value_type = {"base": "QName"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def attributed_q_name_type__from_string(xml_string):
return saml2.create_class_from_xml_string(AttributedQNameType_, xml_string)
class ProblemIRI(AttributedURIType_):
- """The http://www.w3.org/2005/08/addressing:ProblemIRI element """
+ """The http://www.w3.org/2005/08/addressing:ProblemIRI element"""
- c_tag = 'ProblemIRI'
+ c_tag = "ProblemIRI"
c_namespace = NAMESPACE
c_children = AttributedURIType_.c_children.copy()
c_attributes = AttributedURIType_.c_attributes.copy()
c_child_order = AttributedURIType_.c_child_order[:]
c_cardinality = AttributedURIType_.c_cardinality.copy()
+
def problem_iri_from_string(xml_string):
return saml2.create_class_from_xml_string(ProblemIRI, xml_string)
class EndpointReferenceType_Address(AttributedURIType_):
- c_tag = 'Address'
+ c_tag = "Address"
c_namespace = NAMESPACE
c_children = AttributedURIType_.c_children.copy()
c_attributes = AttributedURIType_.c_attributes.copy()
c_child_order = AttributedURIType_.c_child_order[:]
c_cardinality = AttributedURIType_.c_cardinality.copy()
+
def endpoint_reference_type__address_from_string(xml_string):
return saml2.create_class_from_xml_string(EndpointReferenceType_Address, xml_string)
class ReferenceParameters(ReferenceParametersType_):
- """The http://www.w3.org/2005/08/addressing:ReferenceParameters element """
+ """The http://www.w3.org/2005/08/addressing:ReferenceParameters element"""
- c_tag = 'ReferenceParameters'
+ c_tag = "ReferenceParameters"
c_namespace = NAMESPACE
c_children = ReferenceParametersType_.c_children.copy()
c_attributes = ReferenceParametersType_.c_attributes.copy()
c_child_order = ReferenceParametersType_.c_child_order[:]
c_cardinality = ReferenceParametersType_.c_cardinality.copy()
+
def reference_parameters_from_string(xml_string):
return saml2.create_class_from_xml_string(ReferenceParameters, xml_string)
class Metadata(MetadataType_):
- """The http://www.w3.org/2005/08/addressing:Metadata element """
+ """The http://www.w3.org/2005/08/addressing:Metadata element"""
- c_tag = 'Metadata'
+ c_tag = "Metadata"
c_namespace = NAMESPACE
c_children = MetadataType_.c_children.copy()
c_attributes = MetadataType_.c_attributes.copy()
c_child_order = MetadataType_.c_child_order[:]
c_cardinality = MetadataType_.c_cardinality.copy()
+
def metadata_from_string(xml_string):
return saml2.create_class_from_xml_string(Metadata, xml_string)
class MessageID(AttributedURIType_):
- """The http://www.w3.org/2005/08/addressing:MessageID element """
+ """The http://www.w3.org/2005/08/addressing:MessageID element"""
- c_tag = 'MessageID'
+ c_tag = "MessageID"
c_namespace = NAMESPACE
c_children = AttributedURIType_.c_children.copy()
c_attributes = AttributedURIType_.c_attributes.copy()
c_child_order = AttributedURIType_.c_child_order[:]
c_cardinality = AttributedURIType_.c_cardinality.copy()
+
def message_id_from_string(xml_string):
return saml2.create_class_from_xml_string(MessageID, xml_string)
class RelatesToType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:RelatesToType element """
+ """The http://www.w3.org/2005/08/addressing:RelatesToType element"""
- c_tag = 'RelatesToType'
+ c_tag = "RelatesToType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['RelationshipType'] = ('relationship_type', RelationshipTypeOpenEnum_, False)
-
- def __init__(self,
- relationship_type='http://www.w3.org/2005/08/addressing/reply',
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.relationship_type=relationship_type
+ c_attributes["RelationshipType"] = ("relationship_type", RelationshipTypeOpenEnum_, False)
+
+ def __init__(
+ self,
+ relationship_type="http://www.w3.org/2005/08/addressing/reply",
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.relationship_type = relationship_type
+
def relates_to_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RelatesToType_, xml_string)
class To(AttributedURIType_):
- """The http://www.w3.org/2005/08/addressing:To element """
+ """The http://www.w3.org/2005/08/addressing:To element"""
- c_tag = 'To'
+ c_tag = "To"
c_namespace = NAMESPACE
c_children = AttributedURIType_.c_children.copy()
c_attributes = AttributedURIType_.c_attributes.copy()
c_child_order = AttributedURIType_.c_child_order[:]
c_cardinality = AttributedURIType_.c_cardinality.copy()
+
def to_from_string(xml_string):
return saml2.create_class_from_xml_string(To, xml_string)
class Action(AttributedURIType_):
- """The http://www.w3.org/2005/08/addressing:Action element """
+ """The http://www.w3.org/2005/08/addressing:Action element"""
- c_tag = 'Action'
+ c_tag = "Action"
c_namespace = NAMESPACE
c_children = AttributedURIType_.c_children.copy()
c_attributes = AttributedURIType_.c_attributes.copy()
c_child_order = AttributedURIType_.c_child_order[:]
c_cardinality = AttributedURIType_.c_cardinality.copy()
+
def action_from_string(xml_string):
return saml2.create_class_from_xml_string(Action, xml_string)
class RetryAfter(AttributedUnsignedLongType_):
- """The http://www.w3.org/2005/08/addressing:RetryAfter element """
+ """The http://www.w3.org/2005/08/addressing:RetryAfter element"""
- c_tag = 'RetryAfter'
+ c_tag = "RetryAfter"
c_namespace = NAMESPACE
c_children = AttributedUnsignedLongType_.c_children.copy()
c_attributes = AttributedUnsignedLongType_.c_attributes.copy()
c_child_order = AttributedUnsignedLongType_.c_child_order[:]
c_cardinality = AttributedUnsignedLongType_.c_cardinality.copy()
+
def retry_after_from_string(xml_string):
return saml2.create_class_from_xml_string(RetryAfter, xml_string)
class ProblemHeaderQName(AttributedQNameType_):
- """The http://www.w3.org/2005/08/addressing:ProblemHeaderQName element """
+ """The http://www.w3.org/2005/08/addressing:ProblemHeaderQName element"""
- c_tag = 'ProblemHeaderQName'
+ c_tag = "ProblemHeaderQName"
c_namespace = NAMESPACE
c_children = AttributedQNameType_.c_children.copy()
c_attributes = AttributedQNameType_.c_attributes.copy()
c_child_order = AttributedQNameType_.c_child_order[:]
c_cardinality = AttributedQNameType_.c_cardinality.copy()
+
def problem_header_q_name_from_string(xml_string):
return saml2.create_class_from_xml_string(ProblemHeaderQName, xml_string)
class ProblemActionType_SoapAction(SamlBase):
- c_tag = 'SoapAction'
+ c_tag = "SoapAction"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def problem_action_type__soap_action_from_string(xml_string):
return saml2.create_class_from_xml_string(ProblemActionType_SoapAction, xml_string)
class ProblemActionType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:ProblemActionType element """
+ """The http://www.w3.org/2005/08/addressing:ProblemActionType element"""
- c_tag = 'ProblemActionType'
+ c_tag = "ProblemActionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2005/08/addressing}Action'] = ('action', Action)
- c_cardinality['action'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2005/08/addressing}SoapAction'] = ('soap_action', ProblemActionType_SoapAction)
- c_cardinality['soap_action'] = {"min":0, "max":1}
- c_child_order.extend(['action', 'soap_action'])
-
- def __init__(self,
- action=None,
- soap_action=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.action=action
- self.soap_action=soap_action
+ c_children["{http://www.w3.org/2005/08/addressing}Action"] = ("action", Action)
+ c_cardinality["action"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2005/08/addressing}SoapAction"] = ("soap_action", ProblemActionType_SoapAction)
+ c_cardinality["soap_action"] = {"min": 0, "max": 1}
+ c_child_order.extend(["action", "soap_action"])
+
+ def __init__(
+ self,
+ action=None,
+ soap_action=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.action = action
+ self.soap_action = soap_action
+
def problem_action_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ProblemActionType_, xml_string)
class EndpointReferenceType_(SamlBase):
- """The http://www.w3.org/2005/08/addressing:EndpointReferenceType element """
+ """The http://www.w3.org/2005/08/addressing:EndpointReferenceType element"""
- c_tag = 'EndpointReferenceType'
+ c_tag = "EndpointReferenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2005/08/addressing}Address'] = ('address', EndpointReferenceType_Address)
- c_children['{http://www.w3.org/2005/08/addressing}ReferenceParameters'] = ('reference_parameters', ReferenceParameters)
- c_cardinality['reference_parameters'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2005/08/addressing}Metadata'] = ('metadata', Metadata)
- c_cardinality['metadata'] = {"min":0, "max":1}
- c_child_order.extend(['address', 'reference_parameters', 'metadata'])
-
- def __init__(self,
- address=None,
- reference_parameters=None,
- metadata=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.address=address
- self.reference_parameters=reference_parameters
- self.metadata=metadata
+ c_children["{http://www.w3.org/2005/08/addressing}Address"] = ("address", EndpointReferenceType_Address)
+ c_children["{http://www.w3.org/2005/08/addressing}ReferenceParameters"] = (
+ "reference_parameters",
+ ReferenceParameters,
+ )
+ c_cardinality["reference_parameters"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2005/08/addressing}Metadata"] = ("metadata", Metadata)
+ c_cardinality["metadata"] = {"min": 0, "max": 1}
+ c_child_order.extend(["address", "reference_parameters", "metadata"])
+
+ def __init__(
+ self,
+ address=None,
+ reference_parameters=None,
+ metadata=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.address = address
+ self.reference_parameters = reference_parameters
+ self.metadata = metadata
+
def endpoint_reference_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EndpointReferenceType_, xml_string)
class RelatesTo(RelatesToType_):
- """The http://www.w3.org/2005/08/addressing:RelatesTo element """
+ """The http://www.w3.org/2005/08/addressing:RelatesTo element"""
- c_tag = 'RelatesTo'
+ c_tag = "RelatesTo"
c_namespace = NAMESPACE
c_children = RelatesToType_.c_children.copy()
c_attributes = RelatesToType_.c_attributes.copy()
c_child_order = RelatesToType_.c_child_order[:]
c_cardinality = RelatesToType_.c_cardinality.copy()
+
def relates_to_from_string(xml_string):
return saml2.create_class_from_xml_string(RelatesTo, xml_string)
class ReplyTo(EndpointReferenceType_):
- """The http://www.w3.org/2005/08/addressing:ReplyTo element """
+ """The http://www.w3.org/2005/08/addressing:ReplyTo element"""
- c_tag = 'ReplyTo'
+ c_tag = "ReplyTo"
c_namespace = NAMESPACE
c_children = EndpointReferenceType_.c_children.copy()
c_attributes = EndpointReferenceType_.c_attributes.copy()
c_child_order = EndpointReferenceType_.c_child_order[:]
c_cardinality = EndpointReferenceType_.c_cardinality.copy()
+
def reply_to_from_string(xml_string):
return saml2.create_class_from_xml_string(ReplyTo, xml_string)
class From(EndpointReferenceType_):
- """The http://www.w3.org/2005/08/addressing:From element """
+ """The http://www.w3.org/2005/08/addressing:From element"""
- c_tag = 'From'
+ c_tag = "From"
c_namespace = NAMESPACE
c_children = EndpointReferenceType_.c_children.copy()
c_attributes = EndpointReferenceType_.c_attributes.copy()
c_child_order = EndpointReferenceType_.c_child_order[:]
c_cardinality = EndpointReferenceType_.c_cardinality.copy()
+
def from_from_string(xml_string):
return saml2.create_class_from_xml_string(From, xml_string)
class FaultTo(EndpointReferenceType_):
- """The http://www.w3.org/2005/08/addressing:FaultTo element """
+ """The http://www.w3.org/2005/08/addressing:FaultTo element"""
- c_tag = 'FaultTo'
+ c_tag = "FaultTo"
c_namespace = NAMESPACE
c_children = EndpointReferenceType_.c_children.copy()
c_attributes = EndpointReferenceType_.c_attributes.copy()
c_child_order = EndpointReferenceType_.c_child_order[:]
c_cardinality = EndpointReferenceType_.c_cardinality.copy()
+
def fault_to_from_string(xml_string):
return saml2.create_class_from_xml_string(FaultTo, xml_string)
class ProblemAction(ProblemActionType_):
- """The http://www.w3.org/2005/08/addressing:ProblemAction element """
+ """The http://www.w3.org/2005/08/addressing:ProblemAction element"""
- c_tag = 'ProblemAction'
+ c_tag = "ProblemAction"
c_namespace = NAMESPACE
c_children = ProblemActionType_.c_children.copy()
c_attributes = ProblemActionType_.c_attributes.copy()
c_child_order = ProblemActionType_.c_child_order[:]
c_cardinality = ProblemActionType_.c_cardinality.copy()
+
def problem_action_from_string(xml_string):
return saml2.create_class_from_xml_string(ProblemAction, xml_string)
class EndpointReference(EndpointReferenceType_):
- """The http://www.w3.org/2005/08/addressing:EndpointReference element """
+ """The http://www.w3.org/2005/08/addressing:EndpointReference element"""
- c_tag = 'EndpointReference'
+ c_tag = "EndpointReference"
c_namespace = NAMESPACE
c_children = EndpointReferenceType_.c_children.copy()
c_attributes = EndpointReferenceType_.c_attributes.copy()
c_child_order = EndpointReferenceType_.c_child_order[:]
c_cardinality = EndpointReferenceType_.c_cardinality.copy()
+
def endpoint_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(EndpointReference, xml_string)
@@ -495,37 +549,36 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'EndpointReference': EndpointReference,
- 'EndpointReferenceType': EndpointReferenceType_,
- 'ReferenceParameters': ReferenceParameters,
- 'ReferenceParametersType': ReferenceParametersType_,
- 'Metadata': Metadata,
- 'MetadataType': MetadataType_,
- 'MessageID': MessageID,
- 'RelatesTo': RelatesTo,
- 'RelatesToType': RelatesToType_,
- 'RelationshipTypeOpenEnum': RelationshipTypeOpenEnum_,
- 'RelationshipType': RelationshipType_,
- 'ReplyTo': ReplyTo,
- 'From': From,
- 'FaultTo': FaultTo,
- 'To': To,
- 'Action': Action,
- 'AttributedURIType': AttributedURIType_,
- 'FaultCodesOpenEnumType': FaultCodesOpenEnumType_,
- 'FaultCodesType': FaultCodesType_,
- 'RetryAfter': RetryAfter,
- 'AttributedUnsignedLongType': AttributedUnsignedLongType_,
- 'ProblemHeaderQName': ProblemHeaderQName,
- 'AttributedQNameType': AttributedQNameType_,
- 'ProblemIRI': ProblemIRI,
- 'ProblemAction': ProblemAction,
- 'ProblemActionType': ProblemActionType_,
- 'Address': EndpointReferenceType_Address,
- 'SoapAction': ProblemActionType_SoapAction,
+ "EndpointReference": EndpointReference,
+ "EndpointReferenceType": EndpointReferenceType_,
+ "ReferenceParameters": ReferenceParameters,
+ "ReferenceParametersType": ReferenceParametersType_,
+ "Metadata": Metadata,
+ "MetadataType": MetadataType_,
+ "MessageID": MessageID,
+ "RelatesTo": RelatesTo,
+ "RelatesToType": RelatesToType_,
+ "RelationshipTypeOpenEnum": RelationshipTypeOpenEnum_,
+ "RelationshipType": RelationshipType_,
+ "ReplyTo": ReplyTo,
+ "From": From,
+ "FaultTo": FaultTo,
+ "To": To,
+ "Action": Action,
+ "AttributedURIType": AttributedURIType_,
+ "FaultCodesOpenEnumType": FaultCodesOpenEnumType_,
+ "FaultCodesType": FaultCodesType_,
+ "RetryAfter": RetryAfter,
+ "AttributedUnsignedLongType": AttributedUnsignedLongType_,
+ "ProblemHeaderQName": ProblemHeaderQName,
+ "AttributedQNameType": AttributedQNameType_,
+ "ProblemIRI": ProblemIRI,
+ "ProblemAction": ProblemAction,
+ "ProblemActionType": ProblemActionType_,
+ "Address": EndpointReferenceType_Address,
+ "SoapAction": ProblemActionType_SoapAction,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/ws/wspol.py b/src/saml2/ws/wspol.py
index c7dbbe56..3ef49a6e 100644
--- a/src/saml2/ws/wspol.py
+++ b/src/saml2/ws/wspol.py
@@ -6,214 +6,244 @@
import saml2
from saml2 import SamlBase
-
from saml2.ws import wssec as wsse
from saml2.ws import wsutil as wsu
-NAMESPACE = 'http://schemas.xmlsoap.org/ws/2004/09/policy'
+
+NAMESPACE = "http://schemas.xmlsoap.org/ws/2004/09/policy"
+
class PolicyReference(SamlBase):
- """The http://schemas.xmlsoap.org/ws/2004/09/policy:PolicyReference element """
+ """The http://schemas.xmlsoap.org/ws/2004/09/policy:PolicyReference element"""
- c_tag = 'PolicyReference'
+ c_tag = "PolicyReference"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['URI'] = ('uri', 'anyURI', True)
- c_attributes['Digest'] = ('digest', 'base64Binary', False)
- c_attributes['DigestAlgorithm'] = ('digest_algorithm', 'anyURI', False)
-
- def __init__(self,
- uri=None,
- digest=None,
- digest_algorithm='http://schemas.xmlsoap.org/ws/2004/09/policy/Sha1Exc',
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.uri=uri
- self.digest=digest
- self.digest_algorithm=digest_algorithm
+ c_attributes["URI"] = ("uri", "anyURI", True)
+ c_attributes["Digest"] = ("digest", "base64Binary", False)
+ c_attributes["DigestAlgorithm"] = ("digest_algorithm", "anyURI", False)
+
+ def __init__(
+ self,
+ uri=None,
+ digest=None,
+ digest_algorithm="http://schemas.xmlsoap.org/ws/2004/09/policy/Sha1Exc",
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.uri = uri
+ self.digest = digest
+ self.digest_algorithm = digest_algorithm
+
def policy_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(PolicyReference, xml_string)
class AppliesTo(SamlBase):
- """The http://schemas.xmlsoap.org/ws/2004/09/policy:AppliesTo element """
+ """The http://schemas.xmlsoap.org/ws/2004/09/policy:AppliesTo element"""
- c_tag = 'AppliesTo'
+ c_tag = "AppliesTo"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def applies_to_from_string(xml_string):
return saml2.create_class_from_xml_string(AppliesTo, xml_string)
class PolicyAttachment(SamlBase):
- """The http://schemas.xmlsoap.org/ws/2004/09/policy:PolicyAttachment element """
+ """The http://schemas.xmlsoap.org/ws/2004/09/policy:PolicyAttachment element"""
- c_tag = 'PolicyAttachment'
+ c_tag = "PolicyAttachment"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}AppliesTo'] = ('applies_to', AppliesTo)
- c_cardinality['policy'] = {"min":0}
- c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}PolicyReference'] = ('policy_reference', [PolicyReference])
- c_cardinality['policy_reference'] = {"min":0}
- c_child_order.extend(['applies_to', 'policy', 'policy_reference'])
-
- def __init__(self,
- applies_to=None,
- policy=None,
- policy_reference=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.applies_to=applies_to
- self.policy=policy or []
- self.policy_reference=policy_reference or []
+ c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}AppliesTo"] = ("applies_to", AppliesTo)
+ c_cardinality["policy"] = {"min": 0}
+ c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}PolicyReference"] = (
+ "policy_reference",
+ [PolicyReference],
+ )
+ c_cardinality["policy_reference"] = {"min": 0}
+ c_child_order.extend(["applies_to", "policy", "policy_reference"])
+
+ def __init__(
+ self,
+ applies_to=None,
+ policy=None,
+ policy_reference=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.applies_to = applies_to
+ self.policy = policy or []
+ self.policy_reference = policy_reference or []
+
def policy_attachment_from_string(xml_string):
return saml2.create_class_from_xml_string(PolicyAttachment, xml_string)
class OperatorContentType_(SamlBase):
- """The http://schemas.xmlsoap.org/ws/2004/09/policy:OperatorContentType element """
+ """The http://schemas.xmlsoap.org/ws/2004/09/policy:OperatorContentType element"""
- c_tag = 'OperatorContentType'
+ c_tag = "OperatorContentType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_cardinality['policy'] = {"min":0}
- c_cardinality['all'] = {"min":0}
- c_cardinality['exactly_one'] = {"min":0}
- c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}PolicyReference'] = ('policy_reference', [PolicyReference])
- c_cardinality['policy_reference'] = {"min":0}
- c_child_order.extend(['policy', 'all', 'exactly_one', 'policy_reference'])
-
- def __init__(self,
- policy=None,
- all=None,
- exactly_one=None,
- policy_reference=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.policy=policy or []
- self.all=all or []
- self.exactly_one=exactly_one or []
- self.policy_reference=policy_reference or []
+ c_cardinality["policy"] = {"min": 0}
+ c_cardinality["all"] = {"min": 0}
+ c_cardinality["exactly_one"] = {"min": 0}
+ c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}PolicyReference"] = (
+ "policy_reference",
+ [PolicyReference],
+ )
+ c_cardinality["policy_reference"] = {"min": 0}
+ c_child_order.extend(["policy", "all", "exactly_one", "policy_reference"])
+
+ def __init__(
+ self,
+ policy=None,
+ all=None,
+ exactly_one=None,
+ policy_reference=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.policy = policy or []
+ self.all = all or []
+ self.exactly_one = exactly_one or []
+ self.policy_reference = policy_reference or []
+
def operator_content_type__from_string(xml_string):
return saml2.create_class_from_xml_string(OperatorContentType_, xml_string)
class Policy(OperatorContentType_):
- """The http://schemas.xmlsoap.org/ws/2004/09/policy:Policy element """
+ """The http://schemas.xmlsoap.org/ws/2004/09/policy:Policy element"""
- c_tag = 'Policy'
+ c_tag = "Policy"
c_namespace = NAMESPACE
c_children = OperatorContentType_.c_children.copy()
c_attributes = OperatorContentType_.c_attributes.copy()
c_child_order = OperatorContentType_.c_child_order[:]
c_cardinality = OperatorContentType_.c_cardinality.copy()
- c_attributes['Name'] = ('name', 'anyURI', False)
- c_attributes['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id'] = ('Id', 'tns:OperatorContentType', False)
-
- def __init__(self,
- name=None,
- Id=None,
- policy=None,
- all=None,
- exactly_one=None,
- policy_reference=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- OperatorContentType_.__init__(self,
- policy=policy,
- all=all,
- exactly_one=exactly_one,
- policy_reference=policy_reference,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.name=name
- self.Id=Id
+ c_attributes["Name"] = ("name", "anyURI", False)
+ c_attributes["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id"] = (
+ "Id",
+ "tns:OperatorContentType",
+ False,
+ )
+
+ def __init__(
+ self,
+ name=None,
+ Id=None,
+ policy=None,
+ all=None,
+ exactly_one=None,
+ policy_reference=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ OperatorContentType_.__init__(
+ self,
+ policy=policy,
+ all=all,
+ exactly_one=exactly_one,
+ policy_reference=policy_reference,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.name = name
+ self.Id = Id
+
def policy_from_string(xml_string):
return saml2.create_class_from_xml_string(Policy, xml_string)
class All(OperatorContentType_):
- """The http://schemas.xmlsoap.org/ws/2004/09/policy:All element """
+ """The http://schemas.xmlsoap.org/ws/2004/09/policy:All element"""
- c_tag = 'All'
+ c_tag = "All"
c_namespace = NAMESPACE
c_children = OperatorContentType_.c_children.copy()
c_attributes = OperatorContentType_.c_attributes.copy()
c_child_order = OperatorContentType_.c_child_order[:]
c_cardinality = OperatorContentType_.c_cardinality.copy()
+
def all_from_string(xml_string):
return saml2.create_class_from_xml_string(All, xml_string)
class ExactlyOne(OperatorContentType_):
- """The http://schemas.xmlsoap.org/ws/2004/09/policy:ExactlyOne element """
+ """The http://schemas.xmlsoap.org/ws/2004/09/policy:ExactlyOne element"""
- c_tag = 'ExactlyOne'
+ c_tag = "ExactlyOne"
c_namespace = NAMESPACE
c_children = OperatorContentType_.c_children.copy()
c_attributes = OperatorContentType_.c_attributes.copy()
c_child_order = OperatorContentType_.c_child_order[:]
c_cardinality = OperatorContentType_.c_cardinality.copy()
+
def exactly_one_from_string(xml_string):
return saml2.create_class_from_xml_string(ExactlyOne, xml_string)
-PolicyAttachment.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'] = ('policy', [Policy])
-OperatorContentType_.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'] = ('policy', [Policy])
-Policy.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'] = ('policy', [Policy])
-ExactlyOne.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'] = ('policy', [Policy])
-All.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'] = ('policy', [Policy])
-OperatorContentType_.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}All'] = ('all', [All])
-Policy.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}All'] = ('all', [All])
-ExactlyOne.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}All'] = ('all', [All])
-All.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}All'] = ('all', [All])
-OperatorContentType_.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne'] = ('exactly_one', [ExactlyOne])
-Policy.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne'] = ('exactly_one', [ExactlyOne])
-ExactlyOne.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne'] = ('exactly_one', [ExactlyOne])
-All.c_children['{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne'] = ('exactly_one', [ExactlyOne])
+
+PolicyAttachment.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy"] = ("policy", [Policy])
+OperatorContentType_.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy"] = ("policy", [Policy])
+Policy.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy"] = ("policy", [Policy])
+ExactlyOne.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy"] = ("policy", [Policy])
+All.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy"] = ("policy", [Policy])
+OperatorContentType_.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}All"] = ("all", [All])
+Policy.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}All"] = ("all", [All])
+ExactlyOne.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}All"] = ("all", [All])
+All.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}All"] = ("all", [All])
+OperatorContentType_.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne"] = (
+ "exactly_one",
+ [ExactlyOne],
+)
+Policy.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne"] = ("exactly_one", [ExactlyOne])
+ExactlyOne.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne"] = ("exactly_one", [ExactlyOne])
+All.c_children["{http://schemas.xmlsoap.org/ws/2004/09/policy}ExactlyOne"] = ("exactly_one", [ExactlyOne])
ELEMENT_FROM_STRING = {
Policy.c_tag: policy_from_string,
@@ -226,16 +256,15 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'Policy': Policy,
- 'All': All,
- 'ExactlyOne': ExactlyOne,
- 'OperatorContentType': OperatorContentType_,
- 'PolicyReference': PolicyReference,
- 'PolicyAttachment': PolicyAttachment,
- 'AppliesTo': AppliesTo,
+ "Policy": Policy,
+ "All": All,
+ "ExactlyOne": ExactlyOne,
+ "OperatorContentType": OperatorContentType_,
+ "PolicyReference": PolicyReference,
+ "PolicyAttachment": PolicyAttachment,
+ "AppliesTo": AppliesTo,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/ws/wssec.py b/src/saml2/ws/wssec.py
index 7a1c4728..4b057fd9 100644
--- a/src/saml2/ws/wssec.py
+++ b/src/saml2/ws/wssec.py
@@ -6,486 +6,569 @@
import saml2
from saml2 import SamlBase
-
from saml2 import xmldsig as ds
from saml2.schema import soapenv
from saml2.ws import wsutil as wsu
-NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
+
+NAMESPACE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+
class AttributedString_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:AttributedString element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:AttributedString element"""
- c_tag = 'AttributedString'
+ c_tag = "AttributedString"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id'] = ('Id', 'string', False)
-
- def __init__(self,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.Id=Id
+ c_attributes["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id"] = (
+ "Id",
+ "string",
+ False,
+ )
+
+ def __init__(
+ self,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.Id = Id
+
def attributed_string__from_string(xml_string):
return saml2.create_class_from_xml_string(AttributedString_, xml_string)
+
class PasswordString_(AttributedString_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:PasswordString element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:PasswordString element"""
- c_tag = 'PasswordString'
+ c_tag = "PasswordString"
c_namespace = NAMESPACE
c_children = AttributedString_.c_children.copy()
c_attributes = AttributedString_.c_attributes.copy()
c_child_order = AttributedString_.c_child_order[:]
c_cardinality = AttributedString_.c_cardinality.copy()
- c_attributes['Type'] = ('type', 'anyURI', False)
-
- def __init__(self,
- type=None,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- AttributedString_.__init__(self,
- Id=Id,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.type=type
+ c_attributes["Type"] = ("type", "anyURI", False)
+
+ def __init__(
+ self,
+ type=None,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ AttributedString_.__init__(
+ self,
+ Id=Id,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.type = type
+
def password_string__from_string(xml_string):
return saml2.create_class_from_xml_string(PasswordString_, xml_string)
+
class EncodedString_(AttributedString_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:EncodedString element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:EncodedString element"""
- c_tag = 'EncodedString'
+ c_tag = "EncodedString"
c_namespace = NAMESPACE
c_children = AttributedString_.c_children.copy()
c_attributes = AttributedString_.c_attributes.copy()
c_child_order = AttributedString_.c_child_order[:]
c_cardinality = AttributedString_.c_cardinality.copy()
- c_attributes['EncodingType'] = ('encoding_type', 'anyURI', False)
-
- def __init__(self,
- encoding_type=None,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- AttributedString_.__init__(self,
- Id=Id,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.encoding_type=encoding_type
+ c_attributes["EncodingType"] = ("encoding_type", "anyURI", False)
+
+ def __init__(
+ self,
+ encoding_type=None,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ AttributedString_.__init__(
+ self,
+ Id=Id,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.encoding_type = encoding_type
+
def encoded_string__from_string(xml_string):
return saml2.create_class_from_xml_string(EncodedString_, xml_string)
+
class UsernameTokenType_Username(AttributedString_):
- c_tag = 'Username'
+ c_tag = "Username"
c_namespace = NAMESPACE
c_children = AttributedString_.c_children.copy()
c_attributes = AttributedString_.c_attributes.copy()
c_child_order = AttributedString_.c_child_order[:]
c_cardinality = AttributedString_.c_cardinality.copy()
+
def username_token_type__username_from_string(xml_string):
return saml2.create_class_from_xml_string(UsernameTokenType_Username, xml_string)
+
class UsernameTokenType_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:UsernameTokenType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:UsernameTokenType element"""
- c_tag = 'UsernameTokenType'
+ c_tag = "UsernameTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Username'] = ('username', UsernameTokenType_Username)
- c_attributes['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id'] = ('Id', 'None', False)
- c_child_order.extend(['username'])
-
- def __init__(self,
- username=None,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.username=username
- self.Id=Id
+ c_children["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Username"] = (
+ "username",
+ UsernameTokenType_Username,
+ )
+ c_attributes["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id"] = (
+ "Id",
+ "None",
+ False,
+ )
+ c_child_order.extend(["username"])
+
+ def __init__(
+ self,
+ username=None,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.username = username
+ self.Id = Id
+
def username_token_type__from_string(xml_string):
return saml2.create_class_from_xml_string(UsernameTokenType_, xml_string)
+
class BinarySecurityTokenType_(EncodedString_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:BinarySecurityTokenType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:BinarySecurityTokenType element"""
- c_tag = 'BinarySecurityTokenType'
+ c_tag = "BinarySecurityTokenType"
c_namespace = NAMESPACE
c_children = EncodedString_.c_children.copy()
c_attributes = EncodedString_.c_attributes.copy()
c_child_order = EncodedString_.c_child_order[:]
c_cardinality = EncodedString_.c_cardinality.copy()
- c_attributes['ValueType'] = ('value_type', 'anyURI', False)
-
- def __init__(self,
- value_type=None,
- encoding_type=None,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- EncodedString_.__init__(self,
- encoding_type=encoding_type,
- Id=Id,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.value_type=value_type
+ c_attributes["ValueType"] = ("value_type", "anyURI", False)
+
+ def __init__(
+ self,
+ value_type=None,
+ encoding_type=None,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ EncodedString_.__init__(
+ self,
+ encoding_type=encoding_type,
+ Id=Id,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.value_type = value_type
+
def binary_security_token_type__from_string(xml_string):
return saml2.create_class_from_xml_string(BinarySecurityTokenType_, xml_string)
+
class KeyIdentifierType_(EncodedString_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:KeyIdentifierType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:KeyIdentifierType element"""
- c_tag = 'KeyIdentifierType'
+ c_tag = "KeyIdentifierType"
c_namespace = NAMESPACE
c_children = EncodedString_.c_children.copy()
c_attributes = EncodedString_.c_attributes.copy()
c_child_order = EncodedString_.c_child_order[:]
c_cardinality = EncodedString_.c_cardinality.copy()
- c_attributes['ValueType'] = ('value_type', 'anyURI', False)
-
- def __init__(self,
- value_type=None,
- encoding_type=None,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- EncodedString_.__init__(self,
- encoding_type=encoding_type,
- Id=Id,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.value_type=value_type
+ c_attributes["ValueType"] = ("value_type", "anyURI", False)
+
+ def __init__(
+ self,
+ value_type=None,
+ encoding_type=None,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ EncodedString_.__init__(
+ self,
+ encoding_type=encoding_type,
+ Id=Id,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.value_type = value_type
+
def key_identifier_type__from_string(xml_string):
return saml2.create_class_from_xml_string(KeyIdentifierType_, xml_string)
+
class TUsage_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:tUsage element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:tUsage element"""
- c_tag = 'tUsage'
+ c_tag = "tUsage"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def t_usage__from_string(xml_string):
return saml2.create_class_from_xml_string(TUsage_, xml_string)
+
class ReferenceType_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:ReferenceType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:ReferenceType element"""
- c_tag = 'ReferenceType'
+ c_tag = "ReferenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['URI'] = ('uri', 'anyURI', False)
- c_attributes['ValueType'] = ('value_type', 'anyURI', False)
-
- def __init__(self,
- uri=None,
- value_type=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.uri=uri
- self.value_type=value_type
+ c_attributes["URI"] = ("uri", "anyURI", False)
+ c_attributes["ValueType"] = ("value_type", "anyURI", False)
+
+ def __init__(
+ self,
+ uri=None,
+ value_type=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.uri = uri
+ self.value_type = value_type
+
def reference_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ReferenceType_, xml_string)
+
class EmbeddedType_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:EmbeddedType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:EmbeddedType element"""
- c_tag = 'EmbeddedType'
+ c_tag = "EmbeddedType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['ValueType'] = ('value_type', 'anyURI', False)
-
- def __init__(self,
- value_type=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.value_type=value_type
+ c_attributes["ValueType"] = ("value_type", "anyURI", False)
+
+ def __init__(
+ self,
+ value_type=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.value_type = value_type
+
def embedded_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EmbeddedType_, xml_string)
+
class SecurityTokenReferenceType_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityTokenReferenceType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityTokenReferenceType element"""
- c_tag = 'SecurityTokenReferenceType'
+ c_tag = "SecurityTokenReferenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id'] = ('Id', 'None', False)
- c_attributes['Usage'] = ('Usage', 'None', False)
-
- def __init__(self,
- Id=None,
- Usage=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.Id=Id
- self.Usage=Usage
+ c_attributes["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id"] = (
+ "Id",
+ "None",
+ False,
+ )
+ c_attributes["Usage"] = ("Usage", "None", False)
+
+ def __init__(
+ self,
+ Id=None,
+ Usage=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.Id = Id
+ self.Usage = Usage
+
def security_token_reference_type__from_string(xml_string):
return saml2.create_class_from_xml_string(SecurityTokenReferenceType_, xml_string)
+
class SecurityHeaderType_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityHeaderType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityHeaderType element"""
- c_tag = 'SecurityHeaderType'
+ c_tag = "SecurityHeaderType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def security_header_type__from_string(xml_string):
return saml2.create_class_from_xml_string(SecurityHeaderType_, xml_string)
+
class TransformationParametersType_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:TransformationParametersType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:TransformationParametersType element"""
- c_tag = 'TransformationParametersType'
+ c_tag = "TransformationParametersType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def transformation_parameters_type__from_string(xml_string):
return saml2.create_class_from_xml_string(TransformationParametersType_, xml_string)
+
class UsernameToken(UsernameTokenType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:UsernameToken element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:UsernameToken element"""
- c_tag = 'UsernameToken'
+ c_tag = "UsernameToken"
c_namespace = NAMESPACE
c_children = UsernameTokenType_.c_children.copy()
c_attributes = UsernameTokenType_.c_attributes.copy()
c_child_order = UsernameTokenType_.c_child_order[:]
c_cardinality = UsernameTokenType_.c_cardinality.copy()
+
def username_token_from_string(xml_string):
return saml2.create_class_from_xml_string(UsernameToken, xml_string)
+
class BinarySecurityToken(BinarySecurityTokenType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:BinarySecurityToken element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:BinarySecurityToken element"""
- c_tag = 'BinarySecurityToken'
+ c_tag = "BinarySecurityToken"
c_namespace = NAMESPACE
c_children = BinarySecurityTokenType_.c_children.copy()
c_attributes = BinarySecurityTokenType_.c_attributes.copy()
c_child_order = BinarySecurityTokenType_.c_child_order[:]
c_cardinality = BinarySecurityTokenType_.c_cardinality.copy()
+
def binary_security_token_from_string(xml_string):
return saml2.create_class_from_xml_string(BinarySecurityToken, xml_string)
class Reference(ReferenceType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Reference element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Reference element"""
- c_tag = 'Reference'
+ c_tag = "Reference"
c_namespace = NAMESPACE
c_children = ReferenceType_.c_children.copy()
c_attributes = ReferenceType_.c_attributes.copy()
c_child_order = ReferenceType_.c_child_order[:]
c_cardinality = ReferenceType_.c_cardinality.copy()
+
def reference_from_string(xml_string):
return saml2.create_class_from_xml_string(Reference, xml_string)
class Embedded(EmbeddedType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Embedded element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Embedded element"""
- c_tag = 'Embedded'
+ c_tag = "Embedded"
c_namespace = NAMESPACE
c_children = EmbeddedType_.c_children.copy()
c_attributes = EmbeddedType_.c_attributes.copy()
c_child_order = EmbeddedType_.c_child_order[:]
c_cardinality = EmbeddedType_.c_cardinality.copy()
+
def embedded_from_string(xml_string):
return saml2.create_class_from_xml_string(Embedded, xml_string)
class KeyIdentifier(KeyIdentifierType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:KeyIdentifier element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:KeyIdentifier element"""
- c_tag = 'KeyIdentifier'
+ c_tag = "KeyIdentifier"
c_namespace = NAMESPACE
c_children = KeyIdentifierType_.c_children.copy()
c_attributes = KeyIdentifierType_.c_attributes.copy()
c_child_order = KeyIdentifierType_.c_child_order[:]
c_cardinality = KeyIdentifierType_.c_cardinality.copy()
+
def key_identifier_from_string(xml_string):
return saml2.create_class_from_xml_string(KeyIdentifier, xml_string)
class SecurityTokenReference(SecurityTokenReferenceType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityTokenReference element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityTokenReference element"""
- c_tag = 'SecurityTokenReference'
+ c_tag = "SecurityTokenReference"
c_namespace = NAMESPACE
c_children = SecurityTokenReferenceType_.c_children.copy()
c_attributes = SecurityTokenReferenceType_.c_attributes.copy()
c_child_order = SecurityTokenReferenceType_.c_child_order[:]
c_cardinality = SecurityTokenReferenceType_.c_cardinality.copy()
+
def security_token_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(SecurityTokenReference, xml_string)
class Security(SecurityHeaderType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Security element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Security element"""
- c_tag = 'Security'
+ c_tag = "Security"
c_namespace = NAMESPACE
c_children = SecurityHeaderType_.c_children.copy()
c_attributes = SecurityHeaderType_.c_attributes.copy()
c_child_order = SecurityHeaderType_.c_child_order[:]
c_cardinality = SecurityHeaderType_.c_cardinality.copy()
+
def security_from_string(xml_string):
return saml2.create_class_from_xml_string(Security, xml_string)
class TransformationParameters(TransformationParametersType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:TransformationParameters element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:TransformationParameters element"""
- c_tag = 'TransformationParameters'
+ c_tag = "TransformationParameters"
c_namespace = NAMESPACE
c_children = TransformationParametersType_.c_children.copy()
c_attributes = TransformationParametersType_.c_attributes.copy()
c_child_order = TransformationParametersType_.c_child_order[:]
c_cardinality = TransformationParametersType_.c_cardinality.copy()
+
def transformation_parameters_from_string(xml_string):
return saml2.create_class_from_xml_string(TransformationParameters, xml_string)
class Password(PasswordString_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Password element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Password element"""
- c_tag = 'Password'
+ c_tag = "Password"
c_namespace = NAMESPACE
c_children = PasswordString_.c_children.copy()
c_attributes = PasswordString_.c_attributes.copy()
c_child_order = PasswordString_.c_child_order[:]
c_cardinality = PasswordString_.c_cardinality.copy()
+
def password_from_string(xml_string):
return saml2.create_class_from_xml_string(Password, xml_string)
class Nonce(EncodedString_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Nonce element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Nonce element"""
- c_tag = 'Nonce'
+ c_tag = "Nonce"
c_namespace = NAMESPACE
c_children = EncodedString_.c_children.copy()
c_attributes = EncodedString_.c_attributes.copy()
c_child_order = EncodedString_.c_child_order[:]
c_cardinality = EncodedString_.c_cardinality.copy()
+
def nonce_from_string(xml_string):
return saml2.create_class_from_xml_string(Nonce, xml_string)
class FaultcodeEnum_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:FaultcodeEnum element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:FaultcodeEnum element"""
- c_tag = 'FaultcodeEnum'
+ c_tag = "FaultcodeEnum"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xsd:QName', 'enumeration': ['wsse:UnsupportedSecurityToken', 'wsse:UnsupportedAlgorithm', 'wsse:InvalidSecurity', 'wsse:InvalidSecurityToken', 'wsse:FailedAuthentication', 'wsse:FailedCheck', 'wsse:SecurityTokenUnavailable']}
+ c_value_type = {
+ "base": "xsd:QName",
+ "enumeration": [
+ "wsse:UnsupportedSecurityToken",
+ "wsse:UnsupportedAlgorithm",
+ "wsse:InvalidSecurity",
+ "wsse:InvalidSecurityToken",
+ "wsse:FailedAuthentication",
+ "wsse:FailedCheck",
+ "wsse:SecurityTokenUnavailable",
+ ],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def faultcode_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(FaultcodeEnum_, xml_string)
-#..................
-('#', [])
+# ..................
+("#", [])
ELEMENT_FROM_STRING = {
AttributedString_.c_tag: attributed_string__from_string,
PasswordString_.c_tag: password_string__from_string,
@@ -514,33 +597,32 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'AttributedString': AttributedString_,
- 'PasswordString': PasswordString_,
- 'EncodedString': EncodedString_,
- 'UsernameTokenType': UsernameTokenType_,
- 'BinarySecurityTokenType': BinarySecurityTokenType_,
- 'KeyIdentifierType': KeyIdentifierType_,
- 'tUsage': TUsage_,
- 'ReferenceType': ReferenceType_,
- 'EmbeddedType': EmbeddedType_,
- 'SecurityTokenReferenceType': SecurityTokenReferenceType_,
- 'SecurityHeaderType': SecurityHeaderType_,
- 'TransformationParametersType': TransformationParametersType_,
- 'UsernameToken': UsernameToken,
- 'BinarySecurityToken': BinarySecurityToken,
- 'Reference': Reference,
- 'Embedded': Embedded,
- 'KeyIdentifier': KeyIdentifier,
- 'SecurityTokenReference': SecurityTokenReference,
- 'Security': Security,
- 'TransformationParameters': TransformationParameters,
- 'Password': Password,
- 'Nonce': Nonce,
- 'FaultcodeEnum': FaultcodeEnum_,
- 'Username': UsernameTokenType_Username,
+ "AttributedString": AttributedString_,
+ "PasswordString": PasswordString_,
+ "EncodedString": EncodedString_,
+ "UsernameTokenType": UsernameTokenType_,
+ "BinarySecurityTokenType": BinarySecurityTokenType_,
+ "KeyIdentifierType": KeyIdentifierType_,
+ "tUsage": TUsage_,
+ "ReferenceType": ReferenceType_,
+ "EmbeddedType": EmbeddedType_,
+ "SecurityTokenReferenceType": SecurityTokenReferenceType_,
+ "SecurityHeaderType": SecurityHeaderType_,
+ "TransformationParametersType": TransformationParametersType_,
+ "UsernameToken": UsernameToken,
+ "BinarySecurityToken": BinarySecurityToken,
+ "Reference": Reference,
+ "Embedded": Embedded,
+ "KeyIdentifier": KeyIdentifier,
+ "SecurityTokenReference": SecurityTokenReference,
+ "Security": Security,
+ "TransformationParameters": TransformationParameters,
+ "Password": Password,
+ "Nonce": Nonce,
+ "FaultcodeEnum": FaultcodeEnum_,
+ "Username": UsernameTokenType_Username,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/ws/wstrust.py b/src/saml2/ws/wstrust.py
index eb8c944c..81402cdf 100644
--- a/src/saml2/ws/wstrust.py
+++ b/src/saml2/ws/wstrust.py
@@ -6,228 +6,270 @@
import saml2
from saml2 import SamlBase
-
from saml2.ws import wsaddr as wsa
+from saml2.ws import wspol as wsp
from saml2.ws import wssec as wsse
from saml2.ws import wsutil as wsu
-from saml2.ws import wspol as wsp
-NAMESPACE = 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/'
+
+NAMESPACE = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+
class RequestSecurityTokenType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenType element"""
- c_tag = 'RequestSecurityTokenType'
+ c_tag = "RequestSecurityTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Context'] = ('context', 'anyURI', False)
-
- def __init__(self,
- context=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.context=context
+ c_attributes["Context"] = ("context", "anyURI", False)
+
+ def __init__(
+ self,
+ context=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.context = context
+
def request_security_token_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenType_, xml_string)
class TokenType(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:TokenType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:TokenType element"""
- c_tag = 'TokenType'
+ c_tag = "TokenType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def token_type_from_string(xml_string):
return saml2.create_class_from_xml_string(TokenType, xml_string)
class RequestTypeOpenEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestTypeOpenEnum element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestTypeOpenEnum element"""
- c_tag = 'RequestTypeOpenEnum'
+ c_tag = "RequestTypeOpenEnum"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def request_type_open_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestTypeOpenEnum_, xml_string)
class RequestTypeEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestTypeEnum element """
-
- c_tag = 'RequestTypeEnum'
- c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:anyURI', 'enumeration': ['http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/Renew', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/Cancel', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/STSCancel', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/Validate']}
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestTypeEnum element"""
+
+ c_tag = "RequestTypeEnum"
+ c_namespace = NAMESPACE
+ c_value_type = {
+ "base": "xs:anyURI",
+ "enumeration": [
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Renew",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Cancel",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/STSCancel",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Validate",
+ ],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def request_type_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestTypeEnum_, xml_string)
class RequestSecurityTokenResponseType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponseType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponseType element"""
- c_tag = 'RequestSecurityTokenResponseType'
+ c_tag = "RequestSecurityTokenResponseType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Context'] = ('context', 'anyURI', False)
-
- def __init__(self,
- context=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.context=context
+ c_attributes["Context"] = ("context", "anyURI", False)
+
+ def __init__(
+ self,
+ context=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.context = context
+
def request_security_token_response_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenResponseType_, xml_string)
class RequestedSecurityTokenType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedSecurityTokenType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedSecurityTokenType element"""
- c_tag = 'RequestedSecurityTokenType'
+ c_tag = "RequestedSecurityTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def requested_security_token_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedSecurityTokenType_, xml_string)
class BinarySecretTypeEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecretTypeEnum element """
-
- c_tag = 'BinarySecretTypeEnum'
- c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:anyURI', 'enumeration': ['http://docs.oasis-open.org/ws-sx/ws-trust/200512/AsymmetricKey', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce']}
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecretTypeEnum element"""
+
+ c_tag = "BinarySecretTypeEnum"
+ c_namespace = NAMESPACE
+ c_value_type = {
+ "base": "xs:anyURI",
+ "enumeration": [
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/AsymmetricKey",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce",
+ ],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def binary_secret_type_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(BinarySecretTypeEnum_, xml_string)
class BinarySecretTypeOpenEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecretTypeOpenEnum element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecretTypeOpenEnum element"""
- c_tag = 'BinarySecretTypeOpenEnum'
+ c_tag = "BinarySecretTypeOpenEnum"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def binary_secret_type_open_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(BinarySecretTypeOpenEnum_, xml_string)
class ClaimsType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ClaimsType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ClaimsType element"""
- c_tag = 'ClaimsType'
+ c_tag = "ClaimsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Dialect'] = ('dialect', 'anyURI', False)
-
- def __init__(self,
- dialect=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.dialect=dialect
+ c_attributes["Dialect"] = ("dialect", "anyURI", False)
+
+ def __init__(
+ self,
+ dialect=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.dialect = dialect
+
def claims_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ClaimsType_, xml_string)
class EntropyType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EntropyType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EntropyType element"""
- c_tag = 'EntropyType'
+ c_tag = "EntropyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def entropy_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EntropyType_, xml_string)
class LifetimeType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:LifetimeType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:LifetimeType element"""
- c_tag = 'LifetimeType'
+ c_tag = "LifetimeType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Created'] = ('created', wsu.Created)
- c_cardinality['created'] = {"min":0, "max":1}
- c_children['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Expires'] = ('expires', wsu.Expires)
- c_cardinality['expires'] = {"min":0, "max":1}
- c_child_order.extend(['created', 'expires'])
-
- def __init__(self,
- created=None,
- expires=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.created=created
- self.expires=expires
+ c_children["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Created"] = (
+ "created",
+ wsu.Created,
+ )
+ c_cardinality["created"] = {"min": 0, "max": 1}
+ c_children["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Expires"] = (
+ "expires",
+ wsu.Expires,
+ )
+ c_cardinality["expires"] = {"min": 0, "max": 1}
+ c_child_order.extend(["created", "expires"])
+
+ def __init__(
+ self,
+ created=None,
+ expires=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.created = created
+ self.expires = expires
+
def lifetime_type__from_string(xml_string):
return saml2.create_class_from_xml_string(LifetimeType_, xml_string)
@@ -235,1369 +277,1505 @@ def lifetime_type__from_string(xml_string):
class RequestSecurityTokenCollectionType_RequestSecurityToken(RequestSecurityTokenType_):
- c_tag = 'RequestSecurityToken'
+ c_tag = "RequestSecurityToken"
c_namespace = NAMESPACE
c_children = RequestSecurityTokenType_.c_children.copy()
c_attributes = RequestSecurityTokenType_.c_attributes.copy()
c_child_order = RequestSecurityTokenType_.c_child_order[:]
c_cardinality = RequestSecurityTokenType_.c_cardinality.copy()
+
def request_security_token_collection_type__request_security_token_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenCollectionType_RequestSecurityToken, xml_string)
class RequestSecurityTokenCollectionType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenCollectionType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenCollectionType element"""
- c_tag = 'RequestSecurityTokenCollectionType'
+ c_tag = "RequestSecurityTokenCollectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}RequestSecurityToken'] = ('request_security_token', [RequestSecurityTokenCollectionType_RequestSecurityToken])
- c_cardinality['request_security_token'] = {"min":2}
- c_child_order.extend(['request_security_token'])
-
- def __init__(self,
- request_security_token=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.request_security_token=request_security_token or []
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}RequestSecurityToken"] = (
+ "request_security_token",
+ [RequestSecurityTokenCollectionType_RequestSecurityToken],
+ )
+ c_cardinality["request_security_token"] = {"min": 2}
+ c_child_order.extend(["request_security_token"])
+
+ def __init__(
+ self,
+ request_security_token=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.request_security_token = request_security_token or []
+
def request_security_token_collection_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenCollectionType_, xml_string)
class ComputedKeyEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKeyEnum element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKeyEnum element"""
- c_tag = 'ComputedKeyEnum'
+ c_tag = "ComputedKeyEnum"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:anyURI', 'enumeration': ['http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/PSHA1', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/HASH']}
+ c_value_type = {
+ "base": "xs:anyURI",
+ "enumeration": [
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/PSHA1",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/HASH",
+ ],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def computed_key_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(ComputedKeyEnum_, xml_string)
class ComputedKeyOpenEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKeyOpenEnum element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKeyOpenEnum element"""
- c_tag = 'ComputedKeyOpenEnum'
+ c_tag = "ComputedKeyOpenEnum"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def computed_key_open_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(ComputedKeyOpenEnum_, xml_string)
class RequestedReferenceType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedReferenceType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedReferenceType element"""
- c_tag = 'RequestedReferenceType'
+ c_tag = "RequestedReferenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}SecurityTokenReference'] = ('security_token_reference', wsse.SecurityTokenReference)
- c_child_order.extend(['security_token_reference'])
-
- def __init__(self,
- security_token_reference=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.security_token_reference=security_token_reference
+ c_children[
+ "{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}SecurityTokenReference"
+ ] = ("security_token_reference", wsse.SecurityTokenReference)
+ c_child_order.extend(["security_token_reference"])
+
+ def __init__(
+ self,
+ security_token_reference=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.security_token_reference = security_token_reference
+
def requested_reference_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedReferenceType_, xml_string)
class RequestedProofTokenType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedProofTokenType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedProofTokenType element"""
- c_tag = 'RequestedProofTokenType'
+ c_tag = "RequestedProofTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def requested_proof_token_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedProofTokenType_, xml_string)
class RenewTargetType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RenewTargetType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RenewTargetType element"""
- c_tag = 'RenewTargetType'
+ c_tag = "RenewTargetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def renew_target_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RenewTargetType_, xml_string)
class AllowPostdatingType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AllowPostdatingType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AllowPostdatingType element"""
- c_tag = 'AllowPostdatingType'
+ c_tag = "AllowPostdatingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def allow_postdating_type__from_string(xml_string):
return saml2.create_class_from_xml_string(AllowPostdatingType_, xml_string)
class RenewingType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RenewingType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RenewingType element"""
- c_tag = 'RenewingType'
+ c_tag = "RenewingType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Allow'] = ('allow', 'boolean', False)
- c_attributes['OK'] = ('ok', 'boolean', False)
-
- def __init__(self,
- allow=None,
- ok=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.allow=allow
- self.ok=ok
+ c_attributes["Allow"] = ("allow", "boolean", False)
+ c_attributes["OK"] = ("ok", "boolean", False)
+
+ def __init__(
+ self,
+ allow=None,
+ ok=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.allow = allow
+ self.ok = ok
+
def renewing_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RenewingType_, xml_string)
class CancelTargetType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CancelTargetType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CancelTargetType element"""
- c_tag = 'CancelTargetType'
+ c_tag = "CancelTargetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def cancel_target_type__from_string(xml_string):
return saml2.create_class_from_xml_string(CancelTargetType_, xml_string)
class RequestedTokenCancelledType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedTokenCancelledType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedTokenCancelledType element"""
- c_tag = 'RequestedTokenCancelledType'
+ c_tag = "RequestedTokenCancelledType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def requested_token_cancelled_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedTokenCancelledType_, xml_string)
class ValidateTargetType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ValidateTargetType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ValidateTargetType element"""
- c_tag = 'ValidateTargetType'
+ c_tag = "ValidateTargetType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def validate_target_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ValidateTargetType_, xml_string)
class StatusCodeEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:StatusCodeEnum element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:StatusCodeEnum element"""
- c_tag = 'StatusCodeEnum'
+ c_tag = "StatusCodeEnum"
c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:anyURI', 'enumeration': ['http://docs.oasis-open.org/ws-sx/ws-trust/200512/status/valid', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/status/invalid']}
+ c_value_type = {
+ "base": "xs:anyURI",
+ "enumeration": [
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/status/valid",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/status/invalid",
+ ],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def status_code_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(StatusCodeEnum_, xml_string)
class StatusCodeOpenEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:StatusCodeOpenEnum element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:StatusCodeOpenEnum element"""
- c_tag = 'StatusCodeOpenEnum'
+ c_tag = "StatusCodeOpenEnum"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def status_code_open_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(StatusCodeOpenEnum_, xml_string)
class Challenge(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Challenge element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Challenge element"""
- c_tag = 'Challenge'
+ c_tag = "Challenge"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def challenge_from_string(xml_string):
return saml2.create_class_from_xml_string(Challenge, xml_string)
class BinaryExchangeType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinaryExchangeType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinaryExchangeType element"""
- c_tag = 'BinaryExchangeType'
+ c_tag = "BinaryExchangeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['ValueType'] = ('value_type', 'anyURI', True)
- c_attributes['EncodingType'] = ('encoding_type', 'anyURI', True)
-
- def __init__(self,
- value_type=None,
- encoding_type=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.value_type=value_type
- self.encoding_type=encoding_type
+ c_attributes["ValueType"] = ("value_type", "anyURI", True)
+ c_attributes["EncodingType"] = ("encoding_type", "anyURI", True)
+
+ def __init__(
+ self,
+ value_type=None,
+ encoding_type=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.value_type = value_type
+ self.encoding_type = encoding_type
+
def binary_exchange_type__from_string(xml_string):
return saml2.create_class_from_xml_string(BinaryExchangeType_, xml_string)
class RequestKETType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestKETType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestKETType element"""
- c_tag = 'RequestKETType'
+ c_tag = "RequestKETType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def request_ket_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestKETType_, xml_string)
class KeyExchangeTokenType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyExchangeTokenType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyExchangeTokenType element"""
- c_tag = 'KeyExchangeTokenType'
+ c_tag = "KeyExchangeTokenType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def key_exchange_token_type__from_string(xml_string):
return saml2.create_class_from_xml_string(KeyExchangeTokenType_, xml_string)
class CombinedHash(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CombinedHash element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CombinedHash element"""
- c_tag = 'CombinedHash'
+ c_tag = "CombinedHash"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def combined_hash_from_string(xml_string):
return saml2.create_class_from_xml_string(CombinedHash, xml_string)
class OnBehalfOfType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:OnBehalfOfType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:OnBehalfOfType element"""
- c_tag = 'OnBehalfOfType'
+ c_tag = "OnBehalfOfType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def on_behalf_of_type__from_string(xml_string):
return saml2.create_class_from_xml_string(OnBehalfOfType_, xml_string)
class Issuer(wsa.EndpointReferenceType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Issuer element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Issuer element"""
- c_tag = 'Issuer'
+ c_tag = "Issuer"
c_namespace = NAMESPACE
c_children = wsa.EndpointReferenceType_.c_children.copy()
c_attributes = wsa.EndpointReferenceType_.c_attributes.copy()
c_child_order = wsa.EndpointReferenceType_.c_child_order[:]
c_cardinality = wsa.EndpointReferenceType_.c_cardinality.copy()
+
def issuer_from_string(xml_string):
return saml2.create_class_from_xml_string(Issuer, xml_string)
class AuthenticationType(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AuthenticationType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AuthenticationType element"""
- c_tag = 'AuthenticationType'
+ c_tag = "AuthenticationType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def authentication_type_from_string(xml_string):
return saml2.create_class_from_xml_string(AuthenticationType, xml_string)
class KeyTypeEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyTypeEnum element """
-
- c_tag = 'KeyTypeEnum'
- c_namespace = NAMESPACE
- c_value_type = {'base': 'xs:anyURI', 'enumeration': ['http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey', 'http://docs.oasis-open.org/wssx/wstrust/200512/Bearer']}
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyTypeEnum element"""
+
+ c_tag = "KeyTypeEnum"
+ c_namespace = NAMESPACE
+ c_value_type = {
+ "base": "xs:anyURI",
+ "enumeration": [
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey",
+ "http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey",
+ "http://docs.oasis-open.org/wssx/wstrust/200512/Bearer",
+ ],
+ }
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def key_type_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(KeyTypeEnum_, xml_string)
class KeyTypeOpenEnum_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyTypeOpenEnum element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyTypeOpenEnum element"""
- c_tag = 'KeyTypeOpenEnum'
+ c_tag = "KeyTypeOpenEnum"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def key_type_open_enum__from_string(xml_string):
return saml2.create_class_from_xml_string(KeyTypeOpenEnum_, xml_string)
class KeySize(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeySize element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeySize element"""
- c_tag = 'KeySize'
+ c_tag = "KeySize"
c_namespace = NAMESPACE
- c_value_type = {'base': 'unsignedInt'}
+ c_value_type = {"base": "unsignedInt"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def key_size_from_string(xml_string):
return saml2.create_class_from_xml_string(KeySize, xml_string)
class SignatureAlgorithm(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignatureAlgorithm element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignatureAlgorithm element"""
- c_tag = 'SignatureAlgorithm'
+ c_tag = "SignatureAlgorithm"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def signature_algorithm_from_string(xml_string):
return saml2.create_class_from_xml_string(SignatureAlgorithm, xml_string)
class EncryptionAlgorithm(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EncryptionAlgorithm element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EncryptionAlgorithm element"""
- c_tag = 'EncryptionAlgorithm'
+ c_tag = "EncryptionAlgorithm"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def encryption_algorithm_from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionAlgorithm, xml_string)
class CanonicalizationAlgorithm(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CanonicalizationAlgorithm element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CanonicalizationAlgorithm element"""
- c_tag = 'CanonicalizationAlgorithm'
+ c_tag = "CanonicalizationAlgorithm"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def canonicalization_algorithm_from_string(xml_string):
return saml2.create_class_from_xml_string(CanonicalizationAlgorithm, xml_string)
class ComputedKeyAlgorithm(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKeyAlgorithm element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKeyAlgorithm element"""
- c_tag = 'ComputedKeyAlgorithm'
+ c_tag = "ComputedKeyAlgorithm"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def computed_key_algorithm_from_string(xml_string):
return saml2.create_class_from_xml_string(ComputedKeyAlgorithm, xml_string)
class EncryptionType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EncryptionType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EncryptionType element"""
- c_tag = 'EncryptionType'
+ c_tag = "EncryptionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def encryption_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionType_, xml_string)
class ProofEncryptionType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ProofEncryptionType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ProofEncryptionType element"""
- c_tag = 'ProofEncryptionType'
+ c_tag = "ProofEncryptionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def proof_encryption_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ProofEncryptionType_, xml_string)
class UseKeyType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:UseKeyType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:UseKeyType element"""
- c_tag = 'UseKeyType'
+ c_tag = "UseKeyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Sig'] = ('sig', 'anyURI', False)
-
- def __init__(self,
- sig=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.sig=sig
+ c_attributes["Sig"] = ("sig", "anyURI", False)
+
+ def __init__(
+ self,
+ sig=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.sig = sig
+
def use_key_type__from_string(xml_string):
return saml2.create_class_from_xml_string(UseKeyType_, xml_string)
class KeyWrapAlgorithm(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyWrapAlgorithm element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyWrapAlgorithm element"""
- c_tag = 'KeyWrapAlgorithm'
+ c_tag = "KeyWrapAlgorithm"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def key_wrap_algorithm_from_string(xml_string):
return saml2.create_class_from_xml_string(KeyWrapAlgorithm, xml_string)
class SignWith(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignWith element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignWith element"""
- c_tag = 'SignWith'
+ c_tag = "SignWith"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def sign_with_from_string(xml_string):
return saml2.create_class_from_xml_string(SignWith, xml_string)
class EncryptWith(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EncryptWith element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:EncryptWith element"""
- c_tag = 'EncryptWith'
+ c_tag = "EncryptWith"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def encrypt_with_from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptWith, xml_string)
class DelegateToType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:DelegateToType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:DelegateToType element"""
- c_tag = 'DelegateToType'
+ c_tag = "DelegateToType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def delegate_to_type__from_string(xml_string):
return saml2.create_class_from_xml_string(DelegateToType_, xml_string)
class Forwardable(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Forwardable element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Forwardable element"""
- c_tag = 'Forwardable'
+ c_tag = "Forwardable"
c_namespace = NAMESPACE
- c_value_type = {'base': 'boolean'}
+ c_value_type = {"base": "boolean"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def forwardable_from_string(xml_string):
return saml2.create_class_from_xml_string(Forwardable, xml_string)
class Delegatable(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Delegatable element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Delegatable element"""
- c_tag = 'Delegatable'
+ c_tag = "Delegatable"
c_namespace = NAMESPACE
- c_value_type = {'base': 'boolean'}
+ c_value_type = {"base": "boolean"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def delegatable_from_string(xml_string):
return saml2.create_class_from_xml_string(Delegatable, xml_string)
class ParticipantType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ParticipantType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ParticipantType element"""
- c_tag = 'ParticipantType'
+ c_tag = "ParticipantType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def participant_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ParticipantType_, xml_string)
class RequestSecurityToken(RequestSecurityTokenType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityToken element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityToken element"""
- c_tag = 'RequestSecurityToken'
+ c_tag = "RequestSecurityToken"
c_namespace = NAMESPACE
c_children = RequestSecurityTokenType_.c_children.copy()
c_attributes = RequestSecurityTokenType_.c_attributes.copy()
c_child_order = RequestSecurityTokenType_.c_child_order[:]
c_cardinality = RequestSecurityTokenType_.c_cardinality.copy()
+
def request_security_token_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityToken, xml_string)
class RequestType(RequestTypeOpenEnum_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestType element"""
- c_tag = 'RequestType'
+ c_tag = "RequestType"
c_namespace = NAMESPACE
c_children = RequestTypeOpenEnum_.c_children.copy()
c_attributes = RequestTypeOpenEnum_.c_attributes.copy()
c_child_order = RequestTypeOpenEnum_.c_child_order[:]
c_cardinality = RequestTypeOpenEnum_.c_cardinality.copy()
+
def request_type_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestType, xml_string)
class RequestSecurityTokenResponse(RequestSecurityTokenResponseType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponse element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponse element"""
- c_tag = 'RequestSecurityTokenResponse'
+ c_tag = "RequestSecurityTokenResponse"
c_namespace = NAMESPACE
c_children = RequestSecurityTokenResponseType_.c_children.copy()
c_attributes = RequestSecurityTokenResponseType_.c_attributes.copy()
c_child_order = RequestSecurityTokenResponseType_.c_child_order[:]
c_cardinality = RequestSecurityTokenResponseType_.c_cardinality.copy()
+
def request_security_token_response_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenResponse, xml_string)
class RequestedSecurityToken(RequestedSecurityTokenType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedSecurityToken element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedSecurityToken element"""
- c_tag = 'RequestedSecurityToken'
+ c_tag = "RequestedSecurityToken"
c_namespace = NAMESPACE
c_children = RequestedSecurityTokenType_.c_children.copy()
c_attributes = RequestedSecurityTokenType_.c_attributes.copy()
c_child_order = RequestedSecurityTokenType_.c_child_order[:]
c_cardinality = RequestedSecurityTokenType_.c_cardinality.copy()
+
def requested_security_token_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedSecurityToken, xml_string)
class BinarySecretType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecretType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecretType element"""
- c_tag = 'BinarySecretType'
+ c_tag = "BinarySecretType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Type'] = ('type', BinarySecretTypeOpenEnum_, False)
-
- def __init__(self,
- type=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.type=type
+ c_attributes["Type"] = ("type", BinarySecretTypeOpenEnum_, False)
+
+ def __init__(
+ self,
+ type=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.type = type
+
def binary_secret_type__from_string(xml_string):
return saml2.create_class_from_xml_string(BinarySecretType_, xml_string)
class Claims(ClaimsType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Claims element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Claims element"""
- c_tag = 'Claims'
+ c_tag = "Claims"
c_namespace = NAMESPACE
c_children = ClaimsType_.c_children.copy()
c_attributes = ClaimsType_.c_attributes.copy()
c_child_order = ClaimsType_.c_child_order[:]
c_cardinality = ClaimsType_.c_cardinality.copy()
+
def claims_from_string(xml_string):
return saml2.create_class_from_xml_string(Claims, xml_string)
class Entropy(EntropyType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Entropy element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Entropy element"""
- c_tag = 'Entropy'
+ c_tag = "Entropy"
c_namespace = NAMESPACE
c_children = EntropyType_.c_children.copy()
c_attributes = EntropyType_.c_attributes.copy()
c_child_order = EntropyType_.c_child_order[:]
c_cardinality = EntropyType_.c_cardinality.copy()
+
def entropy_from_string(xml_string):
return saml2.create_class_from_xml_string(Entropy, xml_string)
class Lifetime(LifetimeType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Lifetime element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Lifetime element"""
- c_tag = 'Lifetime'
+ c_tag = "Lifetime"
c_namespace = NAMESPACE
c_children = LifetimeType_.c_children.copy()
c_attributes = LifetimeType_.c_attributes.copy()
c_child_order = LifetimeType_.c_child_order[:]
c_cardinality = LifetimeType_.c_cardinality.copy()
+
def lifetime_from_string(xml_string):
return saml2.create_class_from_xml_string(Lifetime, xml_string)
class RequestSecurityTokenCollection(RequestSecurityTokenCollectionType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenCollection element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenCollection element"""
- c_tag = 'RequestSecurityTokenCollection'
+ c_tag = "RequestSecurityTokenCollection"
c_namespace = NAMESPACE
c_children = RequestSecurityTokenCollectionType_.c_children.copy()
c_attributes = RequestSecurityTokenCollectionType_.c_attributes.copy()
c_child_order = RequestSecurityTokenCollectionType_.c_child_order[:]
c_cardinality = RequestSecurityTokenCollectionType_.c_cardinality.copy()
+
def request_security_token_collection_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenCollection, xml_string)
class RequestSecurityTokenResponseCollectionType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponseCollectionType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponseCollectionType element"""
- c_tag = 'RequestSecurityTokenResponseCollectionType'
+ c_tag = "RequestSecurityTokenResponseCollectionType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}RequestSecurityTokenResponse'] = ('request_security_token_response', [RequestSecurityTokenResponse])
- c_cardinality['request_security_token_response'] = {"min":1}
- c_child_order.extend(['request_security_token_response'])
-
- def __init__(self,
- request_security_token_response=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.request_security_token_response=request_security_token_response or []
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}RequestSecurityTokenResponse"] = (
+ "request_security_token_response",
+ [RequestSecurityTokenResponse],
+ )
+ c_cardinality["request_security_token_response"] = {"min": 1}
+ c_child_order.extend(["request_security_token_response"])
+
+ def __init__(
+ self,
+ request_security_token_response=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.request_security_token_response = request_security_token_response or []
+
def request_security_token_response_collection_type__from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenResponseCollectionType_, xml_string)
class ComputedKey(ComputedKeyOpenEnum_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKey element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ComputedKey element"""
- c_tag = 'ComputedKey'
+ c_tag = "ComputedKey"
c_namespace = NAMESPACE
c_children = ComputedKeyOpenEnum_.c_children.copy()
c_attributes = ComputedKeyOpenEnum_.c_attributes.copy()
c_child_order = ComputedKeyOpenEnum_.c_child_order[:]
c_cardinality = ComputedKeyOpenEnum_.c_cardinality.copy()
+
def computed_key_from_string(xml_string):
return saml2.create_class_from_xml_string(ComputedKey, xml_string)
class RequestedAttachedReference(RequestedReferenceType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedAttachedReference element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedAttachedReference element"""
- c_tag = 'RequestedAttachedReference'
+ c_tag = "RequestedAttachedReference"
c_namespace = NAMESPACE
c_children = RequestedReferenceType_.c_children.copy()
c_attributes = RequestedReferenceType_.c_attributes.copy()
c_child_order = RequestedReferenceType_.c_child_order[:]
c_cardinality = RequestedReferenceType_.c_cardinality.copy()
+
def requested_attached_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedAttachedReference, xml_string)
class RequestedUnattachedReference(RequestedReferenceType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedUnattachedReference element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedUnattachedReference element"""
- c_tag = 'RequestedUnattachedReference'
+ c_tag = "RequestedUnattachedReference"
c_namespace = NAMESPACE
c_children = RequestedReferenceType_.c_children.copy()
c_attributes = RequestedReferenceType_.c_attributes.copy()
c_child_order = RequestedReferenceType_.c_child_order[:]
c_cardinality = RequestedReferenceType_.c_cardinality.copy()
+
def requested_unattached_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedUnattachedReference, xml_string)
class RequestedProofToken(RequestedProofTokenType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedProofToken element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedProofToken element"""
- c_tag = 'RequestedProofToken'
+ c_tag = "RequestedProofToken"
c_namespace = NAMESPACE
c_children = RequestedProofTokenType_.c_children.copy()
c_attributes = RequestedProofTokenType_.c_attributes.copy()
c_child_order = RequestedProofTokenType_.c_child_order[:]
c_cardinality = RequestedProofTokenType_.c_cardinality.copy()
+
def requested_proof_token_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedProofToken, xml_string)
class IssuedTokens(RequestSecurityTokenResponseCollectionType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:IssuedTokens element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:IssuedTokens element"""
- c_tag = 'IssuedTokens'
+ c_tag = "IssuedTokens"
c_namespace = NAMESPACE
c_children = RequestSecurityTokenResponseCollectionType_.c_children.copy()
c_attributes = RequestSecurityTokenResponseCollectionType_.c_attributes.copy()
c_child_order = RequestSecurityTokenResponseCollectionType_.c_child_order[:]
c_cardinality = RequestSecurityTokenResponseCollectionType_.c_cardinality.copy()
+
def issued_tokens_from_string(xml_string):
return saml2.create_class_from_xml_string(IssuedTokens, xml_string)
class RenewTarget(RenewTargetType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RenewTarget element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RenewTarget element"""
- c_tag = 'RenewTarget'
+ c_tag = "RenewTarget"
c_namespace = NAMESPACE
c_children = RenewTargetType_.c_children.copy()
c_attributes = RenewTargetType_.c_attributes.copy()
c_child_order = RenewTargetType_.c_child_order[:]
c_cardinality = RenewTargetType_.c_cardinality.copy()
+
def renew_target_from_string(xml_string):
return saml2.create_class_from_xml_string(RenewTarget, xml_string)
class AllowPostdating(AllowPostdatingType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AllowPostdating element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AllowPostdating element"""
- c_tag = 'AllowPostdating'
+ c_tag = "AllowPostdating"
c_namespace = NAMESPACE
c_children = AllowPostdatingType_.c_children.copy()
c_attributes = AllowPostdatingType_.c_attributes.copy()
c_child_order = AllowPostdatingType_.c_child_order[:]
c_cardinality = AllowPostdatingType_.c_cardinality.copy()
+
def allow_postdating_from_string(xml_string):
return saml2.create_class_from_xml_string(AllowPostdating, xml_string)
class Renewing(RenewingType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Renewing element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Renewing element"""
- c_tag = 'Renewing'
+ c_tag = "Renewing"
c_namespace = NAMESPACE
c_children = RenewingType_.c_children.copy()
c_attributes = RenewingType_.c_attributes.copy()
c_child_order = RenewingType_.c_child_order[:]
c_cardinality = RenewingType_.c_cardinality.copy()
+
def renewing_from_string(xml_string):
return saml2.create_class_from_xml_string(Renewing, xml_string)
class CancelTarget(CancelTargetType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CancelTarget element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:CancelTarget element"""
- c_tag = 'CancelTarget'
+ c_tag = "CancelTarget"
c_namespace = NAMESPACE
c_children = CancelTargetType_.c_children.copy()
c_attributes = CancelTargetType_.c_attributes.copy()
c_child_order = CancelTargetType_.c_child_order[:]
c_cardinality = CancelTargetType_.c_cardinality.copy()
+
def cancel_target_from_string(xml_string):
return saml2.create_class_from_xml_string(CancelTarget, xml_string)
class RequestedTokenCancelled(RequestedTokenCancelledType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedTokenCancelled element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedTokenCancelled element"""
- c_tag = 'RequestedTokenCancelled'
+ c_tag = "RequestedTokenCancelled"
c_namespace = NAMESPACE
c_children = RequestedTokenCancelledType_.c_children.copy()
c_attributes = RequestedTokenCancelledType_.c_attributes.copy()
c_child_order = RequestedTokenCancelledType_.c_child_order[:]
c_cardinality = RequestedTokenCancelledType_.c_cardinality.copy()
+
def requested_token_cancelled_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestedTokenCancelled, xml_string)
class ValidateTarget(ValidateTargetType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ValidateTarget element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ValidateTarget element"""
- c_tag = 'ValidateTarget'
+ c_tag = "ValidateTarget"
c_namespace = NAMESPACE
c_children = ValidateTargetType_.c_children.copy()
c_attributes = ValidateTargetType_.c_attributes.copy()
c_child_order = ValidateTargetType_.c_child_order[:]
c_cardinality = ValidateTargetType_.c_cardinality.copy()
+
def validate_target_from_string(xml_string):
return saml2.create_class_from_xml_string(ValidateTarget, xml_string)
class StatusType_Code(StatusCodeOpenEnum_):
- c_tag = 'Code'
+ c_tag = "Code"
c_namespace = NAMESPACE
c_children = StatusCodeOpenEnum_.c_children.copy()
c_attributes = StatusCodeOpenEnum_.c_attributes.copy()
c_child_order = StatusCodeOpenEnum_.c_child_order[:]
c_cardinality = StatusCodeOpenEnum_.c_cardinality.copy()
+
def status_type__code_from_string(xml_string):
return saml2.create_class_from_xml_string(StatusType_Code, xml_string)
class StatusType_Reason(SamlBase):
- c_tag = 'Reason'
+ c_tag = "Reason"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def status_type__reason_from_string(xml_string):
return saml2.create_class_from_xml_string(StatusType_Reason, xml_string)
class StatusType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:StatusType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:StatusType element"""
- c_tag = 'StatusType'
+ c_tag = "StatusType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Code'] = ('code', StatusType_Code)
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Reason'] = ('reason', StatusType_Reason)
- c_cardinality['reason'] = {"min":0, "max":1}
- c_child_order.extend(['code', 'reason'])
-
- def __init__(self,
- code=None,
- reason=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.code=code
- self.reason=reason
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Code"] = ("code", StatusType_Code)
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Reason"] = ("reason", StatusType_Reason)
+ c_cardinality["reason"] = {"min": 0, "max": 1}
+ c_child_order.extend(["code", "reason"])
+
+ def __init__(
+ self,
+ code=None,
+ reason=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.code = code
+ self.reason = reason
+
def status_type__from_string(xml_string):
return saml2.create_class_from_xml_string(StatusType_, xml_string)
class SignChallengeType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignChallengeType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignChallengeType element"""
- c_tag = 'SignChallengeType'
+ c_tag = "SignChallengeType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Challenge'] = ('challenge', Challenge)
- c_child_order.extend(['challenge'])
-
- def __init__(self,
- challenge=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.challenge=challenge
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Challenge"] = ("challenge", Challenge)
+ c_child_order.extend(["challenge"])
+
+ def __init__(
+ self,
+ challenge=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.challenge = challenge
+
def sign_challenge_type__from_string(xml_string):
return saml2.create_class_from_xml_string(SignChallengeType_, xml_string)
class BinaryExchange(BinaryExchangeType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinaryExchange element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinaryExchange element"""
- c_tag = 'BinaryExchange'
+ c_tag = "BinaryExchange"
c_namespace = NAMESPACE
c_children = BinaryExchangeType_.c_children.copy()
c_attributes = BinaryExchangeType_.c_attributes.copy()
c_child_order = BinaryExchangeType_.c_child_order[:]
c_cardinality = BinaryExchangeType_.c_cardinality.copy()
+
def binary_exchange_from_string(xml_string):
return saml2.create_class_from_xml_string(BinaryExchange, xml_string)
class RequestKET(RequestKETType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestKET element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestKET element"""
- c_tag = 'RequestKET'
+ c_tag = "RequestKET"
c_namespace = NAMESPACE
c_children = RequestKETType_.c_children.copy()
c_attributes = RequestKETType_.c_attributes.copy()
c_child_order = RequestKETType_.c_child_order[:]
c_cardinality = RequestKETType_.c_cardinality.copy()
+
def request_ket_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestKET, xml_string)
class KeyExchangeToken(KeyExchangeTokenType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyExchangeToken element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyExchangeToken element"""
- c_tag = 'KeyExchangeToken'
+ c_tag = "KeyExchangeToken"
c_namespace = NAMESPACE
c_children = KeyExchangeTokenType_.c_children.copy()
c_attributes = KeyExchangeTokenType_.c_attributes.copy()
c_child_order = KeyExchangeTokenType_.c_child_order[:]
c_cardinality = KeyExchangeTokenType_.c_cardinality.copy()
+
def key_exchange_token_from_string(xml_string):
return saml2.create_class_from_xml_string(KeyExchangeToken, xml_string)
class AuthenticatorType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AuthenticatorType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:AuthenticatorType element"""
- c_tag = 'AuthenticatorType'
+ c_tag = "AuthenticatorType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}CombinedHash'] = ('combined_hash', CombinedHash)
- c_cardinality['combined_hash'] = {"min":0, "max":1}
- c_child_order.extend(['combined_hash'])
-
- def __init__(self,
- combined_hash=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.combined_hash=combined_hash
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}CombinedHash"] = ("combined_hash", CombinedHash)
+ c_cardinality["combined_hash"] = {"min": 0, "max": 1}
+ c_child_order.extend(["combined_hash"])
+
+ def __init__(
+ self,
+ combined_hash=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.combined_hash = combined_hash
+
def authenticator_type__from_string(xml_string):
return saml2.create_class_from_xml_string(AuthenticatorType_, xml_string)
class OnBehalfOf(OnBehalfOfType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:OnBehalfOf element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:OnBehalfOf element"""
- c_tag = 'OnBehalfOf'
+ c_tag = "OnBehalfOf"
c_namespace = NAMESPACE
c_children = OnBehalfOfType_.c_children.copy()
c_attributes = OnBehalfOfType_.c_attributes.copy()
c_child_order = OnBehalfOfType_.c_child_order[:]
c_cardinality = OnBehalfOfType_.c_cardinality.copy()
+
def on_behalf_of_from_string(xml_string):
return saml2.create_class_from_xml_string(OnBehalfOf, xml_string)
class KeyType(KeyTypeOpenEnum_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:KeyType element"""
- c_tag = 'KeyType'
+ c_tag = "KeyType"
c_namespace = NAMESPACE
c_children = KeyTypeOpenEnum_.c_children.copy()
c_attributes = KeyTypeOpenEnum_.c_attributes.copy()
c_child_order = KeyTypeOpenEnum_.c_child_order[:]
c_cardinality = KeyTypeOpenEnum_.c_cardinality.copy()
+
def key_type_from_string(xml_string):
return saml2.create_class_from_xml_string(KeyType, xml_string)
class Encryption(EncryptionType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Encryption element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Encryption element"""
- c_tag = 'Encryption'
+ c_tag = "Encryption"
c_namespace = NAMESPACE
c_children = EncryptionType_.c_children.copy()
c_attributes = EncryptionType_.c_attributes.copy()
c_child_order = EncryptionType_.c_child_order[:]
c_cardinality = EncryptionType_.c_cardinality.copy()
+
def encryption_from_string(xml_string):
return saml2.create_class_from_xml_string(Encryption, xml_string)
class ProofEncryption(ProofEncryptionType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ProofEncryption element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ProofEncryption element"""
- c_tag = 'ProofEncryption'
+ c_tag = "ProofEncryption"
c_namespace = NAMESPACE
c_children = ProofEncryptionType_.c_children.copy()
c_attributes = ProofEncryptionType_.c_attributes.copy()
c_child_order = ProofEncryptionType_.c_child_order[:]
c_cardinality = ProofEncryptionType_.c_cardinality.copy()
+
def proof_encryption_from_string(xml_string):
return saml2.create_class_from_xml_string(ProofEncryption, xml_string)
class UseKey(UseKeyType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:UseKey element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:UseKey element"""
- c_tag = 'UseKey'
+ c_tag = "UseKey"
c_namespace = NAMESPACE
c_children = UseKeyType_.c_children.copy()
c_attributes = UseKeyType_.c_attributes.copy()
c_child_order = UseKeyType_.c_child_order[:]
c_cardinality = UseKeyType_.c_cardinality.copy()
+
def use_key_from_string(xml_string):
return saml2.create_class_from_xml_string(UseKey, xml_string)
class DelegateTo(DelegateToType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:DelegateTo element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:DelegateTo element"""
- c_tag = 'DelegateTo'
+ c_tag = "DelegateTo"
c_namespace = NAMESPACE
c_children = DelegateToType_.c_children.copy()
c_attributes = DelegateToType_.c_attributes.copy()
c_child_order = DelegateToType_.c_child_order[:]
c_cardinality = DelegateToType_.c_cardinality.copy()
+
def delegate_to_from_string(xml_string):
return saml2.create_class_from_xml_string(DelegateTo, xml_string)
class ParticipantsType_Primary(ParticipantType_):
- c_tag = 'Primary'
+ c_tag = "Primary"
c_namespace = NAMESPACE
c_children = ParticipantType_.c_children.copy()
c_attributes = ParticipantType_.c_attributes.copy()
c_child_order = ParticipantType_.c_child_order[:]
c_cardinality = ParticipantType_.c_cardinality.copy()
+
def participants_type__primary_from_string(xml_string):
return saml2.create_class_from_xml_string(ParticipantsType_Primary, xml_string)
class ParticipantsType_Participant(ParticipantType_):
- c_tag = 'Participant'
+ c_tag = "Participant"
c_namespace = NAMESPACE
c_children = ParticipantType_.c_children.copy()
c_attributes = ParticipantType_.c_attributes.copy()
c_child_order = ParticipantType_.c_child_order[:]
c_cardinality = ParticipantType_.c_cardinality.copy()
+
def participants_type__participant_from_string(xml_string):
return saml2.create_class_from_xml_string(ParticipantsType_Participant, xml_string)
class ParticipantsType_(SamlBase):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ParticipantsType element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:ParticipantsType element"""
- c_tag = 'ParticipantsType'
+ c_tag = "ParticipantsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Primary'] = ('primary', ParticipantsType_Primary)
- c_cardinality['primary'] = {"min":0, "max":1}
- c_children['{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Participant'] = ('participant', [ParticipantsType_Participant])
- c_cardinality['participant'] = {"min":0}
- c_child_order.extend(['primary', 'participant'])
-
- def __init__(self,
- primary=None,
- participant=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.primary=primary
- self.participant=participant or []
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Primary"] = ("primary", ParticipantsType_Primary)
+ c_cardinality["primary"] = {"min": 0, "max": 1}
+ c_children["{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Participant"] = (
+ "participant",
+ [ParticipantsType_Participant],
+ )
+ c_cardinality["participant"] = {"min": 0}
+ c_child_order.extend(["primary", "participant"])
+
+ def __init__(
+ self,
+ primary=None,
+ participant=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.primary = primary
+ self.participant = participant or []
+
def participants_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ParticipantsType_, xml_string)
class BinarySecret(BinarySecretType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecret element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinarySecret element"""
- c_tag = 'BinarySecret'
+ c_tag = "BinarySecret"
c_namespace = NAMESPACE
c_children = BinarySecretType_.c_children.copy()
c_attributes = BinarySecretType_.c_attributes.copy()
c_child_order = BinarySecretType_.c_child_order[:]
c_cardinality = BinarySecretType_.c_cardinality.copy()
+
def binary_secret_from_string(xml_string):
return saml2.create_class_from_xml_string(BinarySecret, xml_string)
class RequestSecurityTokenResponseCollection(RequestSecurityTokenResponseCollectionType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponseCollection element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestSecurityTokenResponseCollection element"""
- c_tag = 'RequestSecurityTokenResponseCollection'
+ c_tag = "RequestSecurityTokenResponseCollection"
c_namespace = NAMESPACE
c_children = RequestSecurityTokenResponseCollectionType_.c_children.copy()
c_attributes = RequestSecurityTokenResponseCollectionType_.c_attributes.copy()
c_child_order = RequestSecurityTokenResponseCollectionType_.c_child_order[:]
c_cardinality = RequestSecurityTokenResponseCollectionType_.c_cardinality.copy()
+
def request_security_token_response_collection_from_string(xml_string):
return saml2.create_class_from_xml_string(RequestSecurityTokenResponseCollection, xml_string)
class Status(StatusType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Status element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Status element"""
- c_tag = 'Status'
+ c_tag = "Status"
c_namespace = NAMESPACE
c_children = StatusType_.c_children.copy()
c_attributes = StatusType_.c_attributes.copy()
c_child_order = StatusType_.c_child_order[:]
c_cardinality = StatusType_.c_cardinality.copy()
+
def status_from_string(xml_string):
return saml2.create_class_from_xml_string(Status, xml_string)
class SignChallenge(SignChallengeType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignChallenge element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignChallenge element"""
- c_tag = 'SignChallenge'
+ c_tag = "SignChallenge"
c_namespace = NAMESPACE
c_children = SignChallengeType_.c_children.copy()
c_attributes = SignChallengeType_.c_attributes.copy()
c_child_order = SignChallengeType_.c_child_order[:]
c_cardinality = SignChallengeType_.c_cardinality.copy()
+
def sign_challenge_from_string(xml_string):
return saml2.create_class_from_xml_string(SignChallenge, xml_string)
class SignChallengeResponse(SignChallengeType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignChallengeResponse element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:SignChallengeResponse element"""
- c_tag = 'SignChallengeResponse'
+ c_tag = "SignChallengeResponse"
c_namespace = NAMESPACE
c_children = SignChallengeType_.c_children.copy()
c_attributes = SignChallengeType_.c_attributes.copy()
c_child_order = SignChallengeType_.c_child_order[:]
c_cardinality = SignChallengeType_.c_cardinality.copy()
+
def sign_challenge_response_from_string(xml_string):
return saml2.create_class_from_xml_string(SignChallengeResponse, xml_string)
class Authenticator(AuthenticatorType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Authenticator element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Authenticator element"""
- c_tag = 'Authenticator'
+ c_tag = "Authenticator"
c_namespace = NAMESPACE
c_children = AuthenticatorType_.c_children.copy()
c_attributes = AuthenticatorType_.c_attributes.copy()
c_child_order = AuthenticatorType_.c_child_order[:]
c_cardinality = AuthenticatorType_.c_cardinality.copy()
+
def authenticator_from_string(xml_string):
return saml2.create_class_from_xml_string(Authenticator, xml_string)
class Participants(ParticipantsType_):
- """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Participants element """
+ """The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:Participants element"""
- c_tag = 'Participants'
+ c_tag = "Participants"
c_namespace = NAMESPACE
c_children = ParticipantsType_.c_children.copy()
c_attributes = ParticipantsType_.c_attributes.copy()
c_child_order = ParticipantsType_.c_child_order[:]
c_cardinality = ParticipantsType_.c_cardinality.copy()
+
def participants_from_string(xml_string):
return saml2.create_class_from_xml_string(Participants, xml_string)
@@ -1700,103 +1878,102 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'RequestSecurityToken': RequestSecurityToken,
- 'RequestSecurityTokenType': RequestSecurityTokenType_,
- 'TokenType': TokenType,
- 'RequestType': RequestType,
- 'RequestTypeOpenEnum': RequestTypeOpenEnum_,
- 'RequestTypeEnum': RequestTypeEnum_,
- 'RequestSecurityTokenResponse': RequestSecurityTokenResponse,
- 'RequestSecurityTokenResponseType': RequestSecurityTokenResponseType_,
- 'RequestedSecurityToken': RequestedSecurityToken,
- 'RequestedSecurityTokenType': RequestedSecurityTokenType_,
- 'BinarySecret': BinarySecret,
- 'BinarySecretType': BinarySecretType_,
- 'BinarySecretTypeEnum': BinarySecretTypeEnum_,
- 'BinarySecretTypeOpenEnum': BinarySecretTypeOpenEnum_,
- 'Claims': Claims,
- 'ClaimsType': ClaimsType_,
- 'Entropy': Entropy,
- 'EntropyType': EntropyType_,
- 'Lifetime': Lifetime,
- 'LifetimeType': LifetimeType_,
- 'RequestSecurityTokenCollection': RequestSecurityTokenCollection,
- 'RequestSecurityTokenCollectionType': RequestSecurityTokenCollectionType_,
- 'RequestSecurityTokenResponseCollection': RequestSecurityTokenResponseCollection,
- 'RequestSecurityTokenResponseCollectionType': RequestSecurityTokenResponseCollectionType_,
- 'ComputedKey': ComputedKey,
- 'ComputedKeyEnum': ComputedKeyEnum_,
- 'ComputedKeyOpenEnum': ComputedKeyOpenEnum_,
- 'RequestedAttachedReference': RequestedAttachedReference,
- 'RequestedUnattachedReference': RequestedUnattachedReference,
- 'RequestedReferenceType': RequestedReferenceType_,
- 'RequestedProofToken': RequestedProofToken,
- 'RequestedProofTokenType': RequestedProofTokenType_,
- 'IssuedTokens': IssuedTokens,
- 'RenewTarget': RenewTarget,
- 'RenewTargetType': RenewTargetType_,
- 'AllowPostdating': AllowPostdating,
- 'AllowPostdatingType': AllowPostdatingType_,
- 'Renewing': Renewing,
- 'RenewingType': RenewingType_,
- 'CancelTarget': CancelTarget,
- 'CancelTargetType': CancelTargetType_,
- 'RequestedTokenCancelled': RequestedTokenCancelled,
- 'RequestedTokenCancelledType': RequestedTokenCancelledType_,
- 'ValidateTarget': ValidateTarget,
- 'ValidateTargetType': ValidateTargetType_,
- 'Status': Status,
- 'StatusType': StatusType_,
- 'StatusCodeEnum': StatusCodeEnum_,
- 'StatusCodeOpenEnum': StatusCodeOpenEnum_,
- 'SignChallenge': SignChallenge,
- 'SignChallengeResponse': SignChallengeResponse,
- 'SignChallengeType': SignChallengeType_,
- 'Challenge': Challenge,
- 'BinaryExchange': BinaryExchange,
- 'BinaryExchangeType': BinaryExchangeType_,
- 'RequestKET': RequestKET,
- 'RequestKETType': RequestKETType_,
- 'KeyExchangeToken': KeyExchangeToken,
- 'KeyExchangeTokenType': KeyExchangeTokenType_,
- 'Authenticator': Authenticator,
- 'AuthenticatorType': AuthenticatorType_,
- 'CombinedHash': CombinedHash,
- 'OnBehalfOf': OnBehalfOf,
- 'OnBehalfOfType': OnBehalfOfType_,
- 'Issuer': Issuer,
- 'AuthenticationType': AuthenticationType,
- 'KeyType': KeyType,
- 'KeyTypeEnum': KeyTypeEnum_,
- 'KeyTypeOpenEnum': KeyTypeOpenEnum_,
- 'KeySize': KeySize,
- 'SignatureAlgorithm': SignatureAlgorithm,
- 'EncryptionAlgorithm': EncryptionAlgorithm,
- 'CanonicalizationAlgorithm': CanonicalizationAlgorithm,
- 'ComputedKeyAlgorithm': ComputedKeyAlgorithm,
- 'Encryption': Encryption,
- 'EncryptionType': EncryptionType_,
- 'ProofEncryption': ProofEncryption,
- 'ProofEncryptionType': ProofEncryptionType_,
- 'UseKey': UseKey,
- 'UseKeyType': UseKeyType_,
- 'KeyWrapAlgorithm': KeyWrapAlgorithm,
- 'SignWith': SignWith,
- 'EncryptWith': EncryptWith,
- 'DelegateTo': DelegateTo,
- 'DelegateToType': DelegateToType_,
- 'Forwardable': Forwardable,
- 'Delegatable': Delegatable,
- 'Participants': Participants,
- 'ParticipantsType': ParticipantsType_,
- 'ParticipantType': ParticipantType_,
- 'Code': StatusType_Code,
- 'Reason': StatusType_Reason,
- 'Primary': ParticipantsType_Primary,
- 'Participant': ParticipantsType_Participant,
+ "RequestSecurityToken": RequestSecurityToken,
+ "RequestSecurityTokenType": RequestSecurityTokenType_,
+ "TokenType": TokenType,
+ "RequestType": RequestType,
+ "RequestTypeOpenEnum": RequestTypeOpenEnum_,
+ "RequestTypeEnum": RequestTypeEnum_,
+ "RequestSecurityTokenResponse": RequestSecurityTokenResponse,
+ "RequestSecurityTokenResponseType": RequestSecurityTokenResponseType_,
+ "RequestedSecurityToken": RequestedSecurityToken,
+ "RequestedSecurityTokenType": RequestedSecurityTokenType_,
+ "BinarySecret": BinarySecret,
+ "BinarySecretType": BinarySecretType_,
+ "BinarySecretTypeEnum": BinarySecretTypeEnum_,
+ "BinarySecretTypeOpenEnum": BinarySecretTypeOpenEnum_,
+ "Claims": Claims,
+ "ClaimsType": ClaimsType_,
+ "Entropy": Entropy,
+ "EntropyType": EntropyType_,
+ "Lifetime": Lifetime,
+ "LifetimeType": LifetimeType_,
+ "RequestSecurityTokenCollection": RequestSecurityTokenCollection,
+ "RequestSecurityTokenCollectionType": RequestSecurityTokenCollectionType_,
+ "RequestSecurityTokenResponseCollection": RequestSecurityTokenResponseCollection,
+ "RequestSecurityTokenResponseCollectionType": RequestSecurityTokenResponseCollectionType_,
+ "ComputedKey": ComputedKey,
+ "ComputedKeyEnum": ComputedKeyEnum_,
+ "ComputedKeyOpenEnum": ComputedKeyOpenEnum_,
+ "RequestedAttachedReference": RequestedAttachedReference,
+ "RequestedUnattachedReference": RequestedUnattachedReference,
+ "RequestedReferenceType": RequestedReferenceType_,
+ "RequestedProofToken": RequestedProofToken,
+ "RequestedProofTokenType": RequestedProofTokenType_,
+ "IssuedTokens": IssuedTokens,
+ "RenewTarget": RenewTarget,
+ "RenewTargetType": RenewTargetType_,
+ "AllowPostdating": AllowPostdating,
+ "AllowPostdatingType": AllowPostdatingType_,
+ "Renewing": Renewing,
+ "RenewingType": RenewingType_,
+ "CancelTarget": CancelTarget,
+ "CancelTargetType": CancelTargetType_,
+ "RequestedTokenCancelled": RequestedTokenCancelled,
+ "RequestedTokenCancelledType": RequestedTokenCancelledType_,
+ "ValidateTarget": ValidateTarget,
+ "ValidateTargetType": ValidateTargetType_,
+ "Status": Status,
+ "StatusType": StatusType_,
+ "StatusCodeEnum": StatusCodeEnum_,
+ "StatusCodeOpenEnum": StatusCodeOpenEnum_,
+ "SignChallenge": SignChallenge,
+ "SignChallengeResponse": SignChallengeResponse,
+ "SignChallengeType": SignChallengeType_,
+ "Challenge": Challenge,
+ "BinaryExchange": BinaryExchange,
+ "BinaryExchangeType": BinaryExchangeType_,
+ "RequestKET": RequestKET,
+ "RequestKETType": RequestKETType_,
+ "KeyExchangeToken": KeyExchangeToken,
+ "KeyExchangeTokenType": KeyExchangeTokenType_,
+ "Authenticator": Authenticator,
+ "AuthenticatorType": AuthenticatorType_,
+ "CombinedHash": CombinedHash,
+ "OnBehalfOf": OnBehalfOf,
+ "OnBehalfOfType": OnBehalfOfType_,
+ "Issuer": Issuer,
+ "AuthenticationType": AuthenticationType,
+ "KeyType": KeyType,
+ "KeyTypeEnum": KeyTypeEnum_,
+ "KeyTypeOpenEnum": KeyTypeOpenEnum_,
+ "KeySize": KeySize,
+ "SignatureAlgorithm": SignatureAlgorithm,
+ "EncryptionAlgorithm": EncryptionAlgorithm,
+ "CanonicalizationAlgorithm": CanonicalizationAlgorithm,
+ "ComputedKeyAlgorithm": ComputedKeyAlgorithm,
+ "Encryption": Encryption,
+ "EncryptionType": EncryptionType_,
+ "ProofEncryption": ProofEncryption,
+ "ProofEncryptionType": ProofEncryptionType_,
+ "UseKey": UseKey,
+ "UseKeyType": UseKeyType_,
+ "KeyWrapAlgorithm": KeyWrapAlgorithm,
+ "SignWith": SignWith,
+ "EncryptWith": EncryptWith,
+ "DelegateTo": DelegateTo,
+ "DelegateToType": DelegateToType_,
+ "Forwardable": Forwardable,
+ "Delegatable": Delegatable,
+ "Participants": Participants,
+ "ParticipantsType": ParticipantsType_,
+ "ParticipantType": ParticipantType_,
+ "Code": StatusType_Code,
+ "Reason": StatusType_Reason,
+ "Primary": ParticipantsType_Primary,
+ "Participant": ParticipantsType_Participant,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/ws/wsutil.py b/src/saml2/ws/wsutil.py
index 3f93565b..1af160c0 100644
--- a/src/saml2/ws/wsutil.py
+++ b/src/saml2/ws/wsutil.py
@@ -7,155 +7,183 @@
import saml2
from saml2 import SamlBase
-NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'
+
+NAMESPACE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+
class TTimestampFault_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:tTimestampFault element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:tTimestampFault element"""
- c_tag = 'tTimestampFault'
+ c_tag = "tTimestampFault"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def t_timestamp_fault__from_string(xml_string):
return saml2.create_class_from_xml_string(TTimestampFault_, xml_string)
+
class AttributedDateTime_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:AttributedDateTime element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:AttributedDateTime element"""
- c_tag = 'AttributedDateTime'
+ c_tag = "AttributedDateTime"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Id'] = ('Id', 'anyURI', False)
-
- def __init__(self,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.Id=Id
+ c_attributes["Id"] = ("Id", "anyURI", False)
+
+ def __init__(
+ self,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.Id = Id
+
def attributed_date_time__from_string(xml_string):
return saml2.create_class_from_xml_string(AttributedDateTime_, xml_string)
+
class AttributedURI_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:AttributedURI element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:AttributedURI element"""
- c_tag = 'AttributedURI'
+ c_tag = "AttributedURI"
c_namespace = NAMESPACE
- c_value_type = {'base': 'anyURI'}
+ c_value_type = {"base": "anyURI"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Id'] = ('Id', 'anyURI', False)
-
- def __init__(self,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.Id=Id
+ c_attributes["Id"] = ("Id", "anyURI", False)
+
+ def __init__(
+ self,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.Id = Id
+
def attributed_ur_i__from_string(xml_string):
return saml2.create_class_from_xml_string(AttributedURI_, xml_string)
+
class Expires(AttributedDateTime_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Expires element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Expires element"""
- c_tag = 'Expires'
+ c_tag = "Expires"
c_namespace = NAMESPACE
c_children = AttributedDateTime_.c_children.copy()
c_attributes = AttributedDateTime_.c_attributes.copy()
c_child_order = AttributedDateTime_.c_child_order[:]
c_cardinality = AttributedDateTime_.c_cardinality.copy()
+
def expires_from_string(xml_string):
return saml2.create_class_from_xml_string(Expires, xml_string)
+
class Created(AttributedDateTime_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Created element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Created element"""
- c_tag = 'Created'
+ c_tag = "Created"
c_namespace = NAMESPACE
c_children = AttributedDateTime_.c_children.copy()
c_attributes = AttributedDateTime_.c_attributes.copy()
c_child_order = AttributedDateTime_.c_child_order[:]
c_cardinality = AttributedDateTime_.c_cardinality.copy()
+
def created_from_string(xml_string):
return saml2.create_class_from_xml_string(Created, xml_string)
+
class TimestampType_(SamlBase):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:TimestampType element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:TimestampType element"""
- c_tag = 'TimestampType'
+ c_tag = "TimestampType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Created'] = ('created', Created)
- c_cardinality['created'] = {"min":0, "max":1}
- c_children['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Expires'] = ('expires', Expires)
- c_cardinality['expires'] = {"min":0, "max":1}
- c_attributes['Id'] = ('Id', 'anyURI', False)
- c_child_order.extend(['created', 'expires'])
-
- def __init__(self,
- created=None,
- expires=None,
- Id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.created=created
- self.expires=expires
- self.Id=Id
+ c_children["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Created"] = (
+ "created",
+ Created,
+ )
+ c_cardinality["created"] = {"min": 0, "max": 1}
+ c_children["{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Expires"] = (
+ "expires",
+ Expires,
+ )
+ c_cardinality["expires"] = {"min": 0, "max": 1}
+ c_attributes["Id"] = ("Id", "anyURI", False)
+ c_child_order.extend(["created", "expires"])
+
+ def __init__(
+ self,
+ created=None,
+ expires=None,
+ Id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.created = created
+ self.expires = expires
+ self.Id = Id
+
def timestamp_type__from_string(xml_string):
return saml2.create_class_from_xml_string(TimestampType_, xml_string)
+
class Timestamp(TimestampType_):
- """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Timestamp element """
+ """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd:Timestamp element"""
- c_tag = 'Timestamp'
+ c_tag = "Timestamp"
c_namespace = NAMESPACE
c_children = TimestampType_.c_children.copy()
c_attributes = TimestampType_.c_attributes.copy()
c_child_order = TimestampType_.c_child_order[:]
c_cardinality = TimestampType_.c_cardinality.copy()
+
def timestamp_from_string(xml_string):
return saml2.create_class_from_xml_string(Timestamp, xml_string)
-#..................
+
+# ..................
AG_commonAtts = [
- ('Id', '', False),
+ ("Id", "", False),
]
ELEMENT_FROM_STRING = {
@@ -169,16 +197,15 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'tTimestampFault': TTimestampFault_,
- 'AttributedDateTime': AttributedDateTime_,
- 'AttributedURI': AttributedURI_,
- 'TimestampType': TimestampType_,
- 'Timestamp': Timestamp,
- 'Expires': Expires,
- 'Created': Created,
+ "tTimestampFault": TTimestampFault_,
+ "AttributedDateTime": AttributedDateTime_,
+ "AttributedURI": AttributedURI_,
+ "TimestampType": TimestampType_,
+ "Timestamp": Timestamp,
+ "Expires": Expires,
+ "Created": Created,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2/xml/schema/__init__.py b/src/saml2/xml/schema/__init__.py
index 6bbac2ef..7a946442 100644
--- a/src/saml2/xml/schema/__init__.py
+++ b/src/saml2/xml/schema/__init__.py
@@ -1,5 +1,6 @@
import sys
+
# importlib.resources was introduced in python 3.7
# files API from importlib.resources introduced in python 3.9
if sys.version_info[:2] >= (3, 9):
@@ -23,27 +24,15 @@ def _create_xml_schema_validator(source=None, **kwargs):
path_schema_envelope = str(schema_resources.joinpath("envelope.xsd"))
path_schema_xenc = str(schema_resources.joinpath("xenc-schema.xsd"))
path_schema_xmldsig_core = str(schema_resources.joinpath("xmldsig-core-schema.xsd"))
- path_schema_saml_assertion = str(
- schema_resources.joinpath("saml-schema-assertion-2.0.xsd")
- )
- path_schema_saml_metadata = str(
- schema_resources.joinpath("saml-schema-metadata-2.0.xsd")
- )
- path_schema_saml_protocol = str(
- schema_resources.joinpath("saml-schema-protocol-2.0.xsd")
- )
- path_schema_eidas_metadata_servicelist= str(
- schema_resources.joinpath("eidas-schema-metadata-servicelist.xsd")
- )
- path_schema_eidas_saml_extensions = str(
- schema_resources.joinpath("eidas-schema-saml-extensions.xsd")
- )
+ path_schema_saml_assertion = str(schema_resources.joinpath("saml-schema-assertion-2.0.xsd"))
+ path_schema_saml_metadata = str(schema_resources.joinpath("saml-schema-metadata-2.0.xsd"))
+ path_schema_saml_protocol = str(schema_resources.joinpath("saml-schema-protocol-2.0.xsd"))
+ path_schema_eidas_metadata_servicelist = str(schema_resources.joinpath("eidas-schema-metadata-servicelist.xsd"))
+ path_schema_eidas_saml_extensions = str(schema_resources.joinpath("eidas-schema-saml-extensions.xsd"))
path_schema_eidas_attribute_naturalperson = str(
schema_resources.joinpath("eidas-schema-attribute-naturalperson.xsd")
)
- path_schema_eidas_attribute_legalperson = str(
- schema_resources.joinpath("eidas-schema-attribute-legalperson.xsd")
- )
+ path_schema_eidas_attribute_legalperson = str(schema_resources.joinpath("eidas-schema-attribute-legalperson.xsd"))
source = source if source else path_schema_saml_protocol
locations = {
diff --git a/src/saml2/xmldsig/__init__.py b/src/saml2/xmldsig/__init__.py
index 4177601f..18c9eed4 100644
--- a/src/saml2/xmldsig/__init__.py
+++ b/src/saml2/xmldsig/__init__.py
@@ -7,57 +7,62 @@
import saml2
from saml2 import SamlBase
-NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#'
-ENCODING_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64'
+NAMESPACE = "http://www.w3.org/2000/09/xmldsig#"
+
+ENCODING_BASE64 = "http://www.w3.org/2000/09/xmldsig#base64"
# digest and signature algorithms (not implemented = commented out)
-DIGEST_MD5 = 'http://www.w3.org/2001/04/xmldsig-more#md5' # test framework
+DIGEST_MD5 = "http://www.w3.org/2001/04/xmldsig-more#md5" # test framework
# only!
-DIGEST_SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1'
-DIGEST_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#sha224'
-DIGEST_SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256'
-DIGEST_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#sha384'
-DIGEST_SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512'
-DIGEST_RIPEMD160 = 'http://www.w3.org/2001/04/xmlenc#ripemd160'
+DIGEST_SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1"
+DIGEST_SHA224 = "http://www.w3.org/2001/04/xmldsig-more#sha224"
+DIGEST_SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256"
+DIGEST_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#sha384"
+DIGEST_SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512"
+DIGEST_RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160"
digest_default = DIGEST_SHA1
-DIGEST_ALLOWED_ALG = (('DIGEST_SHA1', DIGEST_SHA1),
- ('DIGEST_SHA224', DIGEST_SHA224),
- ('DIGEST_SHA256', DIGEST_SHA256),
- ('DIGEST_SHA384', DIGEST_SHA384),
- ('DIGEST_SHA512', DIGEST_SHA512),
- ('DIGEST_RIPEMD160', DIGEST_RIPEMD160))
-DIGEST_AVAIL_ALG = DIGEST_ALLOWED_ALG + (('DIGEST_MD5', DIGEST_MD5),)
-
-SIG_DSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
-SIG_DSA_SHA256 = 'http://www.w3.org/2009/xmldsig11#dsa-sha256'
-SIG_ECDSA_SHA1 = 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1'
-SIG_ECDSA_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224'
-SIG_ECDSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256'
-SIG_ECDSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384'
-SIG_ECDSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512'
-SIG_RSA_MD5 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-md5' # test framework
-SIG_RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
-SIG_RSA_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224'
-SIG_RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
-SIG_RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
-SIG_RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
-SIG_RSA_RIPEMD160 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160'
+DIGEST_ALLOWED_ALG = (
+ ("DIGEST_SHA1", DIGEST_SHA1),
+ ("DIGEST_SHA224", DIGEST_SHA224),
+ ("DIGEST_SHA256", DIGEST_SHA256),
+ ("DIGEST_SHA384", DIGEST_SHA384),
+ ("DIGEST_SHA512", DIGEST_SHA512),
+ ("DIGEST_RIPEMD160", DIGEST_RIPEMD160),
+)
+DIGEST_AVAIL_ALG = DIGEST_ALLOWED_ALG + (("DIGEST_MD5", DIGEST_MD5),)
+
+SIG_DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
+SIG_DSA_SHA256 = "http://www.w3.org/2009/xmldsig11#dsa-sha256"
+SIG_ECDSA_SHA1 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"
+SIG_ECDSA_SHA224 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224"
+SIG_ECDSA_SHA256 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"
+SIG_ECDSA_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"
+SIG_ECDSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"
+SIG_RSA_MD5 = "http://www.w3.org/2001/04/xmldsig-more#rsa-md5" # test framework
+SIG_RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
+SIG_RSA_SHA224 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha224"
+SIG_RSA_SHA256 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
+SIG_RSA_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"
+SIG_RSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"
+SIG_RSA_RIPEMD160 = "http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160"
sig_default = SIG_RSA_SHA1
-SIG_ALLOWED_ALG = (('SIG_RSA_SHA1', SIG_RSA_SHA1),
- ('SIG_RSA_SHA224', SIG_RSA_SHA224),
- ('SIG_RSA_SHA256', SIG_RSA_SHA256),
- ('SIG_RSA_SHA384', SIG_RSA_SHA384),
- ('SIG_RSA_SHA512', SIG_RSA_SHA512))
-SIG_AVAIL_ALG = SIG_ALLOWED_ALG + (('SIG_RSA_MD5', SIG_RSA_MD5),)
-
-MAC_SHA1 = 'http://www.w3.org/2000/09/xmldsig#hmac-sha1'
-
-TRANSFORM_XSLT = 'http://www.w3.org/TR/1999/REC-xslt-19991116'
-TRANSFORM_XPATH = 'http://www.w3.org/TR/1999/REC-xpath-19991116'
-TRANSFORM_ENVELOPED = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'
-TRANSFORM_C14N = 'http://www.w3.org/2001/10/xml-exc-c14n#'
-TRANSFORM_C14N_WITH_COMMENTS = 'http://www.w3.org/2001/10/xml-exc-c14n#WithComments'
+SIG_ALLOWED_ALG = (
+ ("SIG_RSA_SHA1", SIG_RSA_SHA1),
+ ("SIG_RSA_SHA224", SIG_RSA_SHA224),
+ ("SIG_RSA_SHA256", SIG_RSA_SHA256),
+ ("SIG_RSA_SHA384", SIG_RSA_SHA384),
+ ("SIG_RSA_SHA512", SIG_RSA_SHA512),
+)
+SIG_AVAIL_ALG = SIG_ALLOWED_ALG + (("SIG_RSA_MD5", SIG_RSA_MD5),)
+
+MAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
+
+TRANSFORM_XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116"
+TRANSFORM_XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116"
+TRANSFORM_ENVELOPED = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
+TRANSFORM_C14N = "http://www.w3.org/2001/10/xml-exc-c14n#"
+TRANSFORM_C14N_WITH_COMMENTS = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
ALLOWED_CANONICALIZATIONS = {
TRANSFORM_C14N,
@@ -69,6 +74,7 @@ ALLOWED_TRANSFORMS = {
TRANSFORM_C14N_WITH_COMMENTS,
}
+
class DefaultSignature(object):
class _DefaultSignature(object):
def __init__(self, sign_alg=None, digest_alg=None):
@@ -83,6 +89,7 @@ class DefaultSignature(object):
def __str__(self):
return repr(self) + self.sign_alg
+
instance = None
def __init__(self, sign_alg=None, digest_alg=None):
@@ -100,11 +107,11 @@ class DefaultSignature(object):
class CryptoBinary_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:CryptoBinary element """
+ """The http://www.w3.org/2000/09/xmldsig#:CryptoBinary element"""
- c_tag = 'CryptoBinary'
+ c_tag = "CryptoBinary"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -116,28 +123,30 @@ def crypto_binary__from_string(xml_string):
class SignatureValueType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:SignatureValueType element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignatureValueType element"""
- c_tag = 'SignatureValueType'
+ c_tag = "SignatureValueType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Id'] = ('id', 'ID', False)
-
- def __init__(self,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_attributes["Id"] = ("id", "ID", False)
+
+ def __init__(
+ self,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.id = id
@@ -147,39 +156,40 @@ def signature_value_type__from_string(xml_string):
class CanonicalizationMethodType_(SamlBase):
"""The http://www.w3.org/2000/09/xmldsig#:CanonicalizationMethodType
- element """
+ element"""
- c_tag = 'CanonicalizationMethodType'
+ c_tag = "CanonicalizationMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
-
- def __init__(self,
- algorithm=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+
+ def __init__(
+ self,
+ algorithm=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.algorithm = algorithm
def canonicalization_method_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(CanonicalizationMethodType_,
- xml_string)
+ return saml2.create_class_from_xml_string(CanonicalizationMethodType_, xml_string)
class TransformType_XPath(SamlBase):
- c_tag = 'XPath'
+ c_tag = "XPath"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -191,32 +201,33 @@ def transform_type__x_path_from_string(xml_string):
class TransformType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:TransformType element """
+ """The http://www.w3.org/2000/09/xmldsig#:TransformType element"""
- c_tag = 'TransformType'
+ c_tag = "TransformType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}XPath'] = (
- 'x_path', [TransformType_XPath])
- c_cardinality['x_path'] = {"min": 0}
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
- c_child_order.extend(['x_path'])
-
- def __init__(self,
- x_path=None,
- algorithm=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}XPath"] = ("x_path", [TransformType_XPath])
+ c_cardinality["x_path"] = {"min": 0}
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+ c_child_order.extend(["x_path"])
+
+ def __init__(
+ self,
+ x_path=None,
+ algorithm=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.x_path = x_path or []
self.algorithm = algorithm
@@ -226,27 +237,29 @@ def transform_type__from_string(xml_string):
class DigestMethodType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:DigestMethodType element """
+ """The http://www.w3.org/2000/09/xmldsig#:DigestMethodType element"""
- c_tag = 'DigestMethodType'
+ c_tag = "DigestMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
-
- def __init__(self,
- algorithm=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+
+ def __init__(
+ self,
+ algorithm=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.algorithm = algorithm
@@ -255,11 +268,11 @@ def digest_method_type__from_string(xml_string):
class DigestValueType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:DigestValueType element """
+ """The http://www.w3.org/2000/09/xmldsig#:DigestValueType element"""
- c_tag = 'DigestValueType'
+ c_tag = "DigestValueType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -271,11 +284,11 @@ def digest_value_type__from_string(xml_string):
class KeyName(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:KeyName element """
+ """The http://www.w3.org/2000/09/xmldsig#:KeyName element"""
- c_tag = 'KeyName'
+ c_tag = "KeyName"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -287,11 +300,11 @@ def key_name_from_string(xml_string):
class MgmtData(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:MgmtData element """
+ """The http://www.w3.org/2000/09/xmldsig#:MgmtData element"""
- c_tag = 'MgmtData'
+ c_tag = "MgmtData"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -303,9 +316,9 @@ def mgmt_data_from_string(xml_string):
class X509IssuerName(SamlBase):
- c_tag = 'X509IssuerName'
+ c_tag = "X509IssuerName"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -317,9 +330,9 @@ def x509_issuer_name_from_string(xml_string):
class X509SerialNumber(SamlBase):
- c_tag = 'X509SerialNumber'
+ c_tag = "X509SerialNumber"
c_namespace = NAMESPACE
- c_value_type = {'base': 'integer'}
+ c_value_type = {"base": "integer"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -331,32 +344,32 @@ def x509_serial_number_from_string(xml_string):
class X509IssuerSerialType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:X509IssuerSerialType element """
+ """The http://www.w3.org/2000/09/xmldsig#:X509IssuerSerialType element"""
- c_tag = 'X509IssuerSerialType'
+ c_tag = "X509IssuerSerialType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509IssuerName'] = (
- 'x509_issuer_name', X509IssuerName)
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509SerialNumber'] = (
- 'x509_serial_number', X509SerialNumber)
- c_child_order.extend(['x509_issuer_name', 'x509_serial_number'])
-
- def __init__(self,
- x509_issuer_name=None,
- x509_serial_number=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509IssuerName"] = ("x509_issuer_name", X509IssuerName)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509SerialNumber"] = ("x509_serial_number", X509SerialNumber)
+ c_child_order.extend(["x509_issuer_name", "x509_serial_number"])
+
+ def __init__(
+ self,
+ x509_issuer_name=None,
+ x509_serial_number=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.x509_issuer_name = x509_issuer_name
self.x509_serial_number = x509_serial_number
@@ -366,9 +379,9 @@ def x509_issuer_serial_type__from_string(xml_string):
class PGPKeyID(SamlBase):
- c_tag = 'PGPKeyID'
+ c_tag = "PGPKeyID"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -380,9 +393,9 @@ def pgp_key_id_from_string(xml_string):
class PGPKeyPacket(SamlBase):
- c_tag = 'PGPKeyPacket'
+ c_tag = "PGPKeyPacket"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -394,33 +407,33 @@ def pgp_key_packet_from_string(xml_string):
class PGPDataType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:PGPDataType element """
+ """The http://www.w3.org/2000/09/xmldsig#:PGPDataType element"""
- c_tag = 'PGPDataType'
+ c_tag = "PGPDataType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}PGPKeyID'] = (
- 'pgp_key_id', PGPKeyID)
- c_children['{http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket'] = (
- 'pgp_key_packet', PGPKeyPacket)
- c_cardinality['pgp_key_packet'] = {"min": 0, "max": 1}
- c_child_order.extend(['pgp_key_id', 'pgp_key_packet'])
-
- def __init__(self,
- pgp_key_id=None,
- pgp_key_packet=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}PGPKeyID"] = ("pgp_key_id", PGPKeyID)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket"] = ("pgp_key_packet", PGPKeyPacket)
+ c_cardinality["pgp_key_packet"] = {"min": 0, "max": 1}
+ c_child_order.extend(["pgp_key_id", "pgp_key_packet"])
+
+ def __init__(
+ self,
+ pgp_key_id=None,
+ pgp_key_packet=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.pgp_key_id = pgp_key_id
self.pgp_key_packet = pgp_key_packet
@@ -430,9 +443,9 @@ def pgp_data_type__from_string(xml_string):
class SPKISexp(SamlBase):
- c_tag = 'SPKISexp'
+ c_tag = "SPKISexp"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -444,30 +457,31 @@ def spki_sexp_from_string(xml_string):
class SPKIDataType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:SPKIDataType element """
+ """The http://www.w3.org/2000/09/xmldsig#:SPKIDataType element"""
- c_tag = 'SPKIDataType'
+ c_tag = "SPKIDataType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}SPKISexp'] = ('spki_sexp',
- [SPKISexp])
- c_cardinality['spki_sexp'] = {"min": 1}
- c_child_order.extend(['spki_sexp'])
-
- def __init__(self,
- spki_sexp=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}SPKISexp"] = ("spki_sexp", [SPKISexp])
+ c_cardinality["spki_sexp"] = {"min": 1}
+ c_child_order.extend(["spki_sexp"])
+
+ def __init__(
+ self,
+ spki_sexp=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.spki_sexp = spki_sexp or []
@@ -476,31 +490,33 @@ def spki_data_type__from_string(xml_string):
class ObjectType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:ObjectType element """
+ """The http://www.w3.org/2000/09/xmldsig#:ObjectType element"""
- c_tag = 'ObjectType'
+ c_tag = "ObjectType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Id'] = ('id', 'ID', False)
- c_attributes['MimeType'] = ('mime_type', 'string', False)
- c_attributes['Encoding'] = ('encoding', 'anyURI', False)
-
- def __init__(self,
- id=None,
- mime_type=None,
- encoding=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_attributes["Id"] = ("id", "ID", False)
+ c_attributes["MimeType"] = ("mime_type", "string", False)
+ c_attributes["Encoding"] = ("encoding", "anyURI", False)
+
+ def __init__(
+ self,
+ id=None,
+ mime_type=None,
+ encoding=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.id = id
self.mime_type = mime_type
self.encoding = encoding
@@ -511,44 +527,45 @@ def object_type__from_string(xml_string):
class SignaturePropertyType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:SignaturePropertyType element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignaturePropertyType element"""
- c_tag = 'SignaturePropertyType'
+ c_tag = "SignaturePropertyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Target'] = ('target', 'anyURI', True)
- c_attributes['Id'] = ('id', 'ID', False)
-
- def __init__(self,
- target=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_attributes["Target"] = ("target", "anyURI", True)
+ c_attributes["Id"] = ("id", "ID", False)
+
+ def __init__(
+ self,
+ target=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.target = target
self.id = id
def signature_property_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SignaturePropertyType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SignaturePropertyType_, xml_string)
class HMACOutputLengthType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:HMACOutputLengthType element """
+ """The http://www.w3.org/2000/09/xmldsig#:HMACOutputLengthType element"""
- c_tag = 'HMACOutputLengthType'
+ c_tag = "HMACOutputLengthType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'integer'}
+ c_value_type = {"base": "integer"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -560,7 +577,7 @@ def hmac_output_length_type__from_string(xml_string):
class P(CryptoBinary_):
- c_tag = 'P'
+ c_tag = "P"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -573,7 +590,7 @@ def p_from_string(xml_string):
class Q(CryptoBinary_):
- c_tag = 'Q'
+ c_tag = "Q"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -586,7 +603,7 @@ def q_from_string(xml_string):
class G(CryptoBinary_):
- c_tag = 'G'
+ c_tag = "G"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -599,7 +616,7 @@ def g_from_string(xml_string):
class Y(CryptoBinary_):
- c_tag = 'Y'
+ c_tag = "Y"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -612,7 +629,7 @@ def y_from_string(xml_string):
class J(CryptoBinary_):
- c_tag = 'J'
+ c_tag = "J"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -625,7 +642,7 @@ def j_from_string(xml_string):
class Seed(CryptoBinary_):
- c_tag = 'Seed'
+ c_tag = "Seed"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -638,7 +655,7 @@ def seed_from_string(xml_string):
class PgenCounter(CryptoBinary_):
- c_tag = 'PgenCounter'
+ c_tag = "PgenCounter"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -651,47 +668,48 @@ def pgen_counter_from_string(xml_string):
class DSAKeyValueType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:DSAKeyValueType element """
+ """The http://www.w3.org/2000/09/xmldsig#:DSAKeyValueType element"""
- c_tag = 'DSAKeyValueType'
+ c_tag = "DSAKeyValueType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}P'] = ('p', P)
- c_cardinality['p'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}Q'] = ('q', Q)
- c_cardinality['q'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}G'] = ('g', G)
- c_cardinality['g'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}Y'] = ('y', Y)
- c_children['{http://www.w3.org/2000/09/xmldsig#}J'] = ('j', J)
- c_cardinality['j'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}Seed'] = ('seed', Seed)
- c_cardinality['seed'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}PgenCounter'] = (
- 'pgen_counter', PgenCounter)
- c_cardinality['pgen_counter'] = {"min": 0, "max": 1}
- c_child_order.extend(['p', 'q', 'g', 'y', 'j', 'seed', 'pgen_counter'])
-
- def __init__(self,
- p=None,
- q=None,
- g=None,
- y=None,
- j=None,
- seed=None,
- pgen_counter=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}P"] = ("p", P)
+ c_cardinality["p"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Q"] = ("q", Q)
+ c_cardinality["q"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}G"] = ("g", G)
+ c_cardinality["g"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Y"] = ("y", Y)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}J"] = ("j", J)
+ c_cardinality["j"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Seed"] = ("seed", Seed)
+ c_cardinality["seed"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}PgenCounter"] = ("pgen_counter", PgenCounter)
+ c_cardinality["pgen_counter"] = {"min": 0, "max": 1}
+ c_child_order.extend(["p", "q", "g", "y", "j", "seed", "pgen_counter"])
+
+ def __init__(
+ self,
+ p=None,
+ q=None,
+ g=None,
+ y=None,
+ j=None,
+ seed=None,
+ pgen_counter=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.p = p
self.q = q
self.g = g
@@ -706,7 +724,7 @@ def dsa_key_value_type__from_string(xml_string):
class Modulus(CryptoBinary_):
- c_tag = 'Modulus'
+ c_tag = "Modulus"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -719,7 +737,7 @@ def modulus_from_string(xml_string):
class Exponent(CryptoBinary_):
- c_tag = 'Exponent'
+ c_tag = "Exponent"
c_namespace = NAMESPACE
c_children = CryptoBinary_.c_children.copy()
c_attributes = CryptoBinary_.c_attributes.copy()
@@ -732,32 +750,32 @@ def exponent_from_string(xml_string):
class RSAKeyValueType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:RSAKeyValueType element """
+ """The http://www.w3.org/2000/09/xmldsig#:RSAKeyValueType element"""
- c_tag = 'RSAKeyValueType'
+ c_tag = "RSAKeyValueType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Modulus'] = ('modulus',
- Modulus)
- c_children['{http://www.w3.org/2000/09/xmldsig#}Exponent'] = ('exponent',
- Exponent)
- c_child_order.extend(['modulus', 'exponent'])
-
- def __init__(self,
- modulus=None,
- exponent=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Modulus"] = ("modulus", Modulus)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Exponent"] = ("exponent", Exponent)
+ c_child_order.extend(["modulus", "exponent"])
+
+ def __init__(
+ self,
+ modulus=None,
+ exponent=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.modulus = modulus
self.exponent = exponent
@@ -767,9 +785,9 @@ def rsa_key_value_type__from_string(xml_string):
class SignatureValue(SignatureValueType_):
- """The http://www.w3.org/2000/09/xmldsig#:SignatureValue element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignatureValue element"""
- c_tag = 'SignatureValue'
+ c_tag = "SignatureValue"
c_namespace = NAMESPACE
c_children = SignatureValueType_.c_children.copy()
c_attributes = SignatureValueType_.c_attributes.copy()
@@ -782,9 +800,9 @@ def signature_value_from_string(xml_string):
class CanonicalizationMethod(CanonicalizationMethodType_):
- """The http://www.w3.org/2000/09/xmldsig#:CanonicalizationMethod element """
+ """The http://www.w3.org/2000/09/xmldsig#:CanonicalizationMethod element"""
- c_tag = 'CanonicalizationMethod'
+ c_tag = "CanonicalizationMethod"
c_namespace = NAMESPACE
c_children = CanonicalizationMethodType_.c_children.copy()
c_attributes = CanonicalizationMethodType_.c_attributes.copy()
@@ -793,12 +811,11 @@ class CanonicalizationMethod(CanonicalizationMethodType_):
def canonicalization_method_from_string(xml_string):
- return saml2.create_class_from_xml_string(CanonicalizationMethod,
- xml_string)
+ return saml2.create_class_from_xml_string(CanonicalizationMethod, xml_string)
class HMACOutputLength(HMACOutputLengthType_):
- c_tag = 'HMACOutputLength'
+ c_tag = "HMACOutputLength"
c_namespace = NAMESPACE
c_children = HMACOutputLengthType_.c_children.copy()
c_attributes = HMACOutputLengthType_.c_attributes.copy()
@@ -811,32 +828,33 @@ def hmac_output_length_from_string(xml_string):
class SignatureMethodType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:SignatureMethodType element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignatureMethodType element"""
- c_tag = 'SignatureMethodType'
+ c_tag = "SignatureMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}HMACOutputLength'] = (
- 'hmac_output_length', HMACOutputLength)
- c_cardinality['hmac_output_length'] = {"min": 0, "max": 1}
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
- c_child_order.extend(['hmac_output_length'])
-
- def __init__(self,
- hmac_output_length=None,
- algorithm=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}HMACOutputLength"] = ("hmac_output_length", HMACOutputLength)
+ c_cardinality["hmac_output_length"] = {"min": 0, "max": 1}
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+ c_child_order.extend(["hmac_output_length"])
+
+ def __init__(
+ self,
+ hmac_output_length=None,
+ algorithm=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.hmac_output_length = hmac_output_length
self.algorithm = algorithm
@@ -846,9 +864,9 @@ def signature_method_type__from_string(xml_string):
class Transform(TransformType_):
- """The http://www.w3.org/2000/09/xmldsig#:Transform element """
+ """The http://www.w3.org/2000/09/xmldsig#:Transform element"""
- c_tag = 'Transform'
+ c_tag = "Transform"
c_namespace = NAMESPACE
c_children = TransformType_.c_children.copy()
c_attributes = TransformType_.c_attributes.copy()
@@ -861,9 +879,9 @@ def transform_from_string(xml_string):
class DigestMethod(DigestMethodType_):
- """The http://www.w3.org/2000/09/xmldsig#:DigestMethod element """
+ """The http://www.w3.org/2000/09/xmldsig#:DigestMethod element"""
- c_tag = 'DigestMethod'
+ c_tag = "DigestMethod"
c_namespace = NAMESPACE
c_children = DigestMethodType_.c_children.copy()
c_attributes = DigestMethodType_.c_attributes.copy()
@@ -876,9 +894,9 @@ def digest_method_from_string(xml_string):
class DigestValue(DigestValueType_):
- """The http://www.w3.org/2000/09/xmldsig#:DigestValue element """
+ """The http://www.w3.org/2000/09/xmldsig#:DigestValue element"""
- c_tag = 'DigestValue'
+ c_tag = "DigestValue"
c_namespace = NAMESPACE
c_children = DigestValueType_.c_children.copy()
c_attributes = DigestValueType_.c_attributes.copy()
@@ -891,7 +909,7 @@ def digest_value_from_string(xml_string):
class X509IssuerSerial(X509IssuerSerialType_):
- c_tag = 'X509IssuerSerial'
+ c_tag = "X509IssuerSerial"
c_namespace = NAMESPACE
c_children = X509IssuerSerialType_.c_children.copy()
c_attributes = X509IssuerSerialType_.c_attributes.copy()
@@ -904,9 +922,9 @@ def x509_issuer_serial_from_string(xml_string):
class X509SKI(SamlBase):
- c_tag = 'X509SKI'
+ c_tag = "X509SKI"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -918,9 +936,9 @@ def x509_ski_from_string(xml_string):
class X509SubjectName(SamlBase):
- c_tag = 'X509SubjectName'
+ c_tag = "X509SubjectName"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -932,9 +950,9 @@ def x509_subject_name_from_string(xml_string):
class X509Certificate(SamlBase):
- c_tag = 'X509Certificate'
+ c_tag = "X509Certificate"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -946,9 +964,9 @@ def x509_certificate_from_string(xml_string):
class X509CRL(SamlBase):
- c_tag = 'X509CRL'
+ c_tag = "X509CRL"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
@@ -960,50 +978,43 @@ def x509_crl_from_string(xml_string):
class X509DataType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:X509DataType element """
+ """The http://www.w3.org/2000/09/xmldsig#:X509DataType element"""
- c_tag = 'X509DataType'
+ c_tag = "X509DataType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial'] = (
- 'x509_issuer_serial',
- X509IssuerSerial)
- c_cardinality['x509_issuer_serial'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509SKI'] = ('x509_ski',
- X509SKI)
- c_cardinality['x509_ski'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509SubjectName'] = (
- 'x509_subject_name',
- X509SubjectName)
- c_cardinality['x509_subject_name'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509Certificate'] = (
- 'x509_certificate',
- X509Certificate)
- c_cardinality['x509_certificate'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509CRL'] = ('x509_crl',
- X509CRL)
- c_cardinality['x509_crl'] = {"min": 0, "max": 1}
- c_child_order.extend(['x509_issuer_serial', 'x509_ski', 'x509_subject_name',
- 'x509_certificate', 'x509_crl'])
-
- def __init__(self,
- x509_issuer_serial=None,
- x509_ski=None,
- x509_subject_name=None,
- x509_certificate=None,
- x509_crl=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial"] = ("x509_issuer_serial", X509IssuerSerial)
+ c_cardinality["x509_issuer_serial"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509SKI"] = ("x509_ski", X509SKI)
+ c_cardinality["x509_ski"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509SubjectName"] = ("x509_subject_name", X509SubjectName)
+ c_cardinality["x509_subject_name"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509Certificate"] = ("x509_certificate", X509Certificate)
+ c_cardinality["x509_certificate"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509CRL"] = ("x509_crl", X509CRL)
+ c_cardinality["x509_crl"] = {"min": 0, "max": 1}
+ c_child_order.extend(["x509_issuer_serial", "x509_ski", "x509_subject_name", "x509_certificate", "x509_crl"])
+
+ def __init__(
+ self,
+ x509_issuer_serial=None,
+ x509_ski=None,
+ x509_subject_name=None,
+ x509_certificate=None,
+ x509_crl=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.x509_issuer_serial = x509_issuer_serial
self.x509_ski = x509_ski
self.x509_subject_name = x509_subject_name
@@ -1016,9 +1027,9 @@ def x509_data_type__from_string(xml_string):
class PGPData(PGPDataType_):
- """The http://www.w3.org/2000/09/xmldsig#:PGPData element """
+ """The http://www.w3.org/2000/09/xmldsig#:PGPData element"""
- c_tag = 'PGPData'
+ c_tag = "PGPData"
c_namespace = NAMESPACE
c_children = PGPDataType_.c_children.copy()
c_attributes = PGPDataType_.c_attributes.copy()
@@ -1031,9 +1042,9 @@ def pgp_data_from_string(xml_string):
class SPKIData(SPKIDataType_):
- """The http://www.w3.org/2000/09/xmldsig#:SPKIData element """
+ """The http://www.w3.org/2000/09/xmldsig#:SPKIData element"""
- c_tag = 'SPKIData'
+ c_tag = "SPKIData"
c_namespace = NAMESPACE
c_children = SPKIDataType_.c_children.copy()
c_attributes = SPKIDataType_.c_attributes.copy()
@@ -1046,9 +1057,9 @@ def spki_data_from_string(xml_string):
class Object(ObjectType_):
- """The http://www.w3.org/2000/09/xmldsig#:Object element """
+ """The http://www.w3.org/2000/09/xmldsig#:Object element"""
- c_tag = 'Object'
+ c_tag = "Object"
c_namespace = NAMESPACE
c_children = ObjectType_.c_children.copy()
c_attributes = ObjectType_.c_attributes.copy()
@@ -1061,9 +1072,9 @@ def object_from_string(xml_string):
class SignatureProperty(SignaturePropertyType_):
- """The http://www.w3.org/2000/09/xmldsig#:SignatureProperty element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignatureProperty element"""
- c_tag = 'SignatureProperty'
+ c_tag = "SignatureProperty"
c_namespace = NAMESPACE
c_children = SignaturePropertyType_.c_children.copy()
c_attributes = SignaturePropertyType_.c_attributes.copy()
@@ -1076,9 +1087,9 @@ def signature_property_from_string(xml_string):
class DSAKeyValue(DSAKeyValueType_):
- """The http://www.w3.org/2000/09/xmldsig#:DSAKeyValue element """
+ """The http://www.w3.org/2000/09/xmldsig#:DSAKeyValue element"""
- c_tag = 'DSAKeyValue'
+ c_tag = "DSAKeyValue"
c_namespace = NAMESPACE
c_children = DSAKeyValueType_.c_children.copy()
c_attributes = DSAKeyValueType_.c_attributes.copy()
@@ -1091,9 +1102,9 @@ def dsa_key_value_from_string(xml_string):
class RSAKeyValue(RSAKeyValueType_):
- """The http://www.w3.org/2000/09/xmldsig#:RSAKeyValue element """
+ """The http://www.w3.org/2000/09/xmldsig#:RSAKeyValue element"""
- c_tag = 'RSAKeyValue'
+ c_tag = "RSAKeyValue"
c_namespace = NAMESPACE
c_children = RSAKeyValueType_.c_children.copy()
c_attributes = RSAKeyValueType_.c_attributes.copy()
@@ -1106,9 +1117,9 @@ def rsa_key_value_from_string(xml_string):
class SignatureMethod(SignatureMethodType_):
- """The http://www.w3.org/2000/09/xmldsig#:SignatureMethod element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignatureMethod element"""
- c_tag = 'SignatureMethod'
+ c_tag = "SignatureMethod"
c_namespace = NAMESPACE
c_children = SignatureMethodType_.c_children.copy()
c_attributes = SignatureMethodType_.c_attributes.copy()
@@ -1121,30 +1132,31 @@ def signature_method_from_string(xml_string):
class TransformsType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:TransformsType element """
+ """The http://www.w3.org/2000/09/xmldsig#:TransformsType element"""
- c_tag = 'TransformsType'
+ c_tag = "TransformsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Transform'] = ('transform',
- [Transform])
- c_cardinality['transform'] = {"min": 1}
- c_child_order.extend(['transform'])
-
- def __init__(self,
- transform=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Transform"] = ("transform", [Transform])
+ c_cardinality["transform"] = {"min": 1}
+ c_child_order.extend(["transform"])
+
+ def __init__(
+ self,
+ transform=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.transform = transform or []
@@ -1153,34 +1165,34 @@ def transforms_type__from_string(xml_string):
class KeyValueType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:KeyValueType element """
+ """The http://www.w3.org/2000/09/xmldsig#:KeyValueType element"""
- c_tag = 'KeyValueType'
+ c_tag = "KeyValueType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}DSAKeyValue'] = (
- 'dsa_key_value', DSAKeyValue)
- c_cardinality['dsa_key_value'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}RSAKeyValue'] = (
- 'rsa_key_value', RSAKeyValue)
- c_cardinality['rsa_key_value'] = {"min": 0, "max": 1}
- c_child_order.extend(['dsa_key_value', 'rsa_key_value'])
-
- def __init__(self,
- dsa_key_value=None,
- rsa_key_value=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}DSAKeyValue"] = ("dsa_key_value", DSAKeyValue)
+ c_cardinality["dsa_key_value"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}RSAKeyValue"] = ("rsa_key_value", RSAKeyValue)
+ c_cardinality["rsa_key_value"] = {"min": 0, "max": 1}
+ c_child_order.extend(["dsa_key_value", "rsa_key_value"])
+
+ def __init__(
+ self,
+ dsa_key_value=None,
+ rsa_key_value=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.dsa_key_value = dsa_key_value
self.rsa_key_value = rsa_key_value
@@ -1190,9 +1202,9 @@ def key_value_type__from_string(xml_string):
class X509Data(X509DataType_):
- """The http://www.w3.org/2000/09/xmldsig#:X509Data element """
+ """The http://www.w3.org/2000/09/xmldsig#:X509Data element"""
- c_tag = 'X509Data'
+ c_tag = "X509Data"
c_namespace = NAMESPACE
c_children = X509DataType_.c_children.copy()
c_attributes = X509DataType_.c_attributes.copy()
@@ -1205,46 +1217,45 @@ def x509_data_from_string(xml_string):
class SignaturePropertiesType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:SignaturePropertiesType element
- """
+ """The http://www.w3.org/2000/09/xmldsig#:SignaturePropertiesType element"""
- c_tag = 'SignaturePropertiesType'
+ c_tag = "SignaturePropertiesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}SignatureProperty'] = (
- 'signature_property', [SignatureProperty])
- c_cardinality['signature_property'] = {"min": 1}
- c_attributes['Id'] = ('id', 'ID', False)
- c_child_order.extend(['signature_property'])
-
- def __init__(self,
- signature_property=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}SignatureProperty"] = ("signature_property", [SignatureProperty])
+ c_cardinality["signature_property"] = {"min": 1}
+ c_attributes["Id"] = ("id", "ID", False)
+ c_child_order.extend(["signature_property"])
+
+ def __init__(
+ self,
+ signature_property=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.signature_property = signature_property or []
self.id = id
def signature_properties_type__from_string(xml_string):
- return saml2.create_class_from_xml_string(SignaturePropertiesType_,
- xml_string)
+ return saml2.create_class_from_xml_string(SignaturePropertiesType_, xml_string)
class Transforms(TransformsType_):
- """The http://www.w3.org/2000/09/xmldsig#:Transforms element """
+ """The http://www.w3.org/2000/09/xmldsig#:Transforms element"""
- c_tag = 'Transforms'
+ c_tag = "Transforms"
c_namespace = NAMESPACE
c_children = TransformsType_.c_children.copy()
c_attributes = TransformsType_.c_attributes.copy()
@@ -1257,9 +1268,9 @@ def transforms_from_string(xml_string):
class KeyValue(KeyValueType_):
- """The http://www.w3.org/2000/09/xmldsig#:KeyValue element """
+ """The http://www.w3.org/2000/09/xmldsig#:KeyValue element"""
- c_tag = 'KeyValue'
+ c_tag = "KeyValue"
c_namespace = NAMESPACE
c_children = KeyValueType_.c_children.copy()
c_attributes = KeyValueType_.c_attributes.copy()
@@ -1272,34 +1283,35 @@ def key_value_from_string(xml_string):
class RetrievalMethodType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:RetrievalMethodType element """
+ """The http://www.w3.org/2000/09/xmldsig#:RetrievalMethodType element"""
- c_tag = 'RetrievalMethodType'
+ c_tag = "RetrievalMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Transforms'] = (
- 'transforms', Transforms)
- c_cardinality['transforms'] = {"min": 0, "max": 1}
- c_attributes['URI'] = ('uri', 'anyURI', False)
- c_attributes['Type'] = ('type', 'anyURI', False)
- c_child_order.extend(['transforms'])
-
- def __init__(self,
- transforms=None,
- uri=None,
- type=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Transforms"] = ("transforms", Transforms)
+ c_cardinality["transforms"] = {"min": 0, "max": 1}
+ c_attributes["URI"] = ("uri", "anyURI", False)
+ c_attributes["Type"] = ("type", "anyURI", False)
+ c_child_order.extend(["transforms"])
+
+ def __init__(
+ self,
+ transforms=None,
+ uri=None,
+ type=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.transforms = transforms
self.uri = uri
self.type = type
@@ -1310,9 +1322,9 @@ def retrieval_method_type__from_string(xml_string):
class SignatureProperties(SignaturePropertiesType_):
- """The http://www.w3.org/2000/09/xmldsig#:SignatureProperties element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignatureProperties element"""
- c_tag = 'SignatureProperties'
+ c_tag = "SignatureProperties"
c_namespace = NAMESPACE
c_children = SignaturePropertiesType_.c_children.copy()
c_attributes = SignaturePropertiesType_.c_attributes.copy()
@@ -1325,42 +1337,41 @@ def signature_properties_from_string(xml_string):
class ReferenceType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:ReferenceType element """
+ """The http://www.w3.org/2000/09/xmldsig#:ReferenceType element"""
- c_tag = 'ReferenceType'
+ c_tag = "ReferenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Transforms'] = (
- 'transforms', Transforms)
- c_cardinality['transforms'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}DigestMethod'] = (
- 'digest_method', DigestMethod)
- c_children['{http://www.w3.org/2000/09/xmldsig#}DigestValue'] = (
- 'digest_value', DigestValue)
- c_attributes['Id'] = ('id', 'ID', False)
- c_attributes['URI'] = ('uri', 'anyURI', False)
- c_attributes['Type'] = ('type', 'anyURI', False)
- c_child_order.extend(['transforms', 'digest_method', 'digest_value'])
-
- def __init__(self,
- transforms=None,
- digest_method=None,
- digest_value=None,
- id=None,
- uri=None,
- type=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Transforms"] = ("transforms", Transforms)
+ c_cardinality["transforms"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}DigestMethod"] = ("digest_method", DigestMethod)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}DigestValue"] = ("digest_value", DigestValue)
+ c_attributes["Id"] = ("id", "ID", False)
+ c_attributes["URI"] = ("uri", "anyURI", False)
+ c_attributes["Type"] = ("type", "anyURI", False)
+ c_child_order.extend(["transforms", "digest_method", "digest_value"])
+
+ def __init__(
+ self,
+ transforms=None,
+ digest_method=None,
+ digest_value=None,
+ id=None,
+ uri=None,
+ type=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.transforms = transforms
self.digest_method = digest_method
self.digest_value = digest_value
@@ -1374,9 +1385,9 @@ def reference_type__from_string(xml_string):
class RetrievalMethod(RetrievalMethodType_):
- """The http://www.w3.org/2000/09/xmldsig#:RetrievalMethod element """
+ """The http://www.w3.org/2000/09/xmldsig#:RetrievalMethod element"""
- c_tag = 'RetrievalMethod'
+ c_tag = "RetrievalMethod"
c_namespace = NAMESPACE
c_children = RetrievalMethodType_.c_children.copy()
c_attributes = RetrievalMethodType_.c_attributes.copy()
@@ -1389,9 +1400,9 @@ def retrieval_method_from_string(xml_string):
class Reference(ReferenceType_):
- """The http://www.w3.org/2000/09/xmldsig#:Reference element """
+ """The http://www.w3.org/2000/09/xmldsig#:Reference element"""
- c_tag = 'Reference'
+ c_tag = "Reference"
c_namespace = NAMESPACE
c_children = ReferenceType_.c_children.copy()
c_attributes = ReferenceType_.c_attributes.copy()
@@ -1407,62 +1418,63 @@ def reference_from_string(xml_string):
class KeyInfoType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:KeyInfoType element """
+ """The http://www.w3.org/2000/09/xmldsig#:KeyInfoType element"""
- c_tag = 'KeyInfoType'
+ c_tag = "KeyInfoType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyName'] = ('key_name',
- [KeyName])
- c_cardinality['key_name'] = {"min": 0}
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyValue'] = ('key_value',
- [KeyValue])
- c_cardinality['key_value'] = {"min": 0}
- c_children['{http://www.w3.org/2000/09/xmldsig#}RetrievalMethod'] = (
- 'retrieval_method', [RetrievalMethod])
- c_cardinality['retrieval_method'] = {"min": 0}
- c_children['{http://www.w3.org/2000/09/xmldsig#}X509Data'] = ('x509_data',
- [X509Data])
- c_cardinality['x509_data'] = {"min": 0}
- c_children['{http://www.w3.org/2000/09/xmldsig#}PGPData'] = ('pgp_data',
- [PGPData])
- c_cardinality['pgp_data'] = {"min": 0}
- c_children['{http://www.w3.org/2000/09/xmldsig#}SPKIData'] = ('spki_data',
- [SPKIData])
- c_cardinality['spki_data'] = {"min": 0}
- c_children['{http://www.w3.org/2000/09/xmldsig#}MgmtData'] = ('mgmt_data',
- [MgmtData])
- c_cardinality['mgmt_data'] = {"min": 0}
- c_children['{http://www.w3.org/2000/09/xmlenc#}EncryptedKey'] = (
- 'encrypted_key', None)
- c_cardinality['key_info'] = {"min": 0, "max": 1}
-
- c_attributes['Id'] = ('id', 'ID', False)
- c_child_order.extend(['key_name', 'key_value', 'retrieval_method',
- 'x509_data', 'pgp_data', 'spki_data', 'mgmt_data',
- 'encrypted_key'])
-
- def __init__(self,
- key_name=None,
- key_value=None,
- retrieval_method=None,
- x509_data=None,
- pgp_data=None,
- spki_data=None,
- mgmt_data=None,
- encrypted_key=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyName"] = ("key_name", [KeyName])
+ c_cardinality["key_name"] = {"min": 0}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyValue"] = ("key_value", [KeyValue])
+ c_cardinality["key_value"] = {"min": 0}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}RetrievalMethod"] = ("retrieval_method", [RetrievalMethod])
+ c_cardinality["retrieval_method"] = {"min": 0}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}X509Data"] = ("x509_data", [X509Data])
+ c_cardinality["x509_data"] = {"min": 0}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}PGPData"] = ("pgp_data", [PGPData])
+ c_cardinality["pgp_data"] = {"min": 0}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}SPKIData"] = ("spki_data", [SPKIData])
+ c_cardinality["spki_data"] = {"min": 0}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}MgmtData"] = ("mgmt_data", [MgmtData])
+ c_cardinality["mgmt_data"] = {"min": 0}
+ c_children["{http://www.w3.org/2000/09/xmlenc#}EncryptedKey"] = ("encrypted_key", None)
+ c_cardinality["key_info"] = {"min": 0, "max": 1}
+
+ c_attributes["Id"] = ("id", "ID", False)
+ c_child_order.extend(
+ [
+ "key_name",
+ "key_value",
+ "retrieval_method",
+ "x509_data",
+ "pgp_data",
+ "spki_data",
+ "mgmt_data",
+ "encrypted_key",
+ ]
+ )
+
+ def __init__(
+ self,
+ key_name=None,
+ key_value=None,
+ retrieval_method=None,
+ x509_data=None,
+ pgp_data=None,
+ spki_data=None,
+ mgmt_data=None,
+ encrypted_key=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self, text=text, extension_elements=extension_elements, extension_attributes=extension_attributes
+ )
self.key_name = key_name or []
self.key_value = key_value or []
self.retrieval_method = retrieval_method or []
@@ -1479,32 +1491,33 @@ def key_info_type__from_string(xml_string):
class ManifestType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:ManifestType element """
+ """The http://www.w3.org/2000/09/xmldsig#:ManifestType element"""
- c_tag = 'ManifestType'
+ c_tag = "ManifestType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Reference'] = ('reference',
- [Reference])
- c_cardinality['reference'] = {"min": 1}
- c_attributes['Id'] = ('id', 'ID', False)
- c_child_order.extend(['reference'])
-
- def __init__(self,
- reference=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Reference"] = ("reference", [Reference])
+ c_cardinality["reference"] = {"min": 1}
+ c_attributes["Id"] = ("id", "ID", False)
+ c_child_order.extend(["reference"])
+
+ def __init__(
+ self,
+ reference=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.reference = reference or []
self.id = id
@@ -1514,39 +1527,40 @@ def manifest_type__from_string(xml_string):
class SignedInfoType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:SignedInfoType element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignedInfoType element"""
- c_tag = 'SignedInfoType'
+ c_tag = "SignedInfoType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod'] = (
- 'canonicalization_method', CanonicalizationMethod)
- c_children['{http://www.w3.org/2000/09/xmldsig#}SignatureMethod'] = (
- 'signature_method', SignatureMethod)
- c_children['{http://www.w3.org/2000/09/xmldsig#}Reference'] = ('reference',
- [Reference])
- c_cardinality['reference'] = {"min": 1}
- c_attributes['Id'] = ('id', 'ID', False)
- c_child_order.extend(['canonicalization_method', 'signature_method',
- 'reference'])
-
- def __init__(self,
- canonicalization_method=None,
- signature_method=None,
- reference=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod"] = (
+ "canonicalization_method",
+ CanonicalizationMethod,
+ )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}SignatureMethod"] = ("signature_method", SignatureMethod)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Reference"] = ("reference", [Reference])
+ c_cardinality["reference"] = {"min": 1}
+ c_attributes["Id"] = ("id", "ID", False)
+ c_child_order.extend(["canonicalization_method", "signature_method", "reference"])
+
+ def __init__(
+ self,
+ canonicalization_method=None,
+ signature_method=None,
+ reference=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.canonicalization_method = canonicalization_method
self.signature_method = signature_method
self.reference = reference or []
@@ -1558,9 +1572,9 @@ def signed_info_type__from_string(xml_string):
class KeyInfo(KeyInfoType_):
- """The http://www.w3.org/2000/09/xmldsig#:KeyInfo element """
+ """The http://www.w3.org/2000/09/xmldsig#:KeyInfo element"""
- c_tag = 'KeyInfo'
+ c_tag = "KeyInfo"
c_namespace = NAMESPACE
c_children = KeyInfoType_.c_children.copy()
c_attributes = KeyInfoType_.c_attributes.copy()
@@ -1573,9 +1587,9 @@ def key_info_from_string(xml_string):
class Manifest(ManifestType_):
- """The http://www.w3.org/2000/09/xmldsig#:Manifest element """
+ """The http://www.w3.org/2000/09/xmldsig#:Manifest element"""
- c_tag = 'Manifest'
+ c_tag = "Manifest"
c_namespace = NAMESPACE
c_children = ManifestType_.c_children.copy()
c_attributes = ManifestType_.c_attributes.copy()
@@ -1588,9 +1602,9 @@ def manifest_from_string(xml_string):
class SignedInfo(SignedInfoType_):
- """The http://www.w3.org/2000/09/xmldsig#:SignedInfo element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignedInfo element"""
- c_tag = 'SignedInfo'
+ c_tag = "SignedInfo"
c_namespace = NAMESPACE
c_children = SignedInfoType_.c_children.copy()
c_attributes = SignedInfoType_.c_attributes.copy()
@@ -1603,43 +1617,40 @@ def signed_info_from_string(xml_string):
class SignatureType_(SamlBase):
- """The http://www.w3.org/2000/09/xmldsig#:SignatureType element """
+ """The http://www.w3.org/2000/09/xmldsig#:SignatureType element"""
- c_tag = 'SignatureType'
+ c_tag = "SignatureType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}SignedInfo'] = (
- 'signed_info', SignedInfo)
- c_children['{http://www.w3.org/2000/09/xmldsig#}SignatureValue'] = (
- 'signature_value', SignatureValue)
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyInfo'] = ('key_info',
- KeyInfo)
- c_cardinality['key_info'] = {"min": 0, "max": 1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}Object'] = ('object',
- [Object])
- c_cardinality['object'] = {"min": 0}
- c_attributes['Id'] = ('id', 'ID', False)
- c_child_order.extend(['signed_info', 'signature_value', 'key_info',
- 'object'])
-
- def __init__(self,
- signed_info=None,
- signature_value=None,
- key_info=None,
- object=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
+ c_children["{http://www.w3.org/2000/09/xmldsig#}SignedInfo"] = ("signed_info", SignedInfo)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}SignatureValue"] = ("signature_value", SignatureValue)
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyInfo"] = ("key_info", KeyInfo)
+ c_cardinality["key_info"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Object"] = ("object", [Object])
+ c_cardinality["object"] = {"min": 0}
+ c_attributes["Id"] = ("id", "ID", False)
+ c_child_order.extend(["signed_info", "signature_value", "key_info", "object"])
+
+ def __init__(
+ self,
+ signed_info=None,
+ signature_value=None,
+ key_info=None,
+ object=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
self.signed_info = signed_info
self.signature_value = signature_value
self.key_info = key_info
@@ -1652,9 +1663,9 @@ def signature_type__from_string(xml_string):
class Signature(SignatureType_):
- """The http://www.w3.org/2000/09/xmldsig#:Signature element """
+ """The http://www.w3.org/2000/09/xmldsig#:Signature element"""
- c_tag = 'Signature'
+ c_tag = "Signature"
c_namespace = NAMESPACE
c_children = SignatureType_.c_children.copy()
c_attributes = SignatureType_.c_attributes.copy()
@@ -1675,8 +1686,7 @@ ELEMENT_FROM_STRING = {
SignedInfo.c_tag: signed_info_from_string,
SignedInfoType_.c_tag: signed_info_type__from_string,
CanonicalizationMethod.c_tag: canonicalization_method_from_string,
- CanonicalizationMethodType_.c_tag:
- canonicalization_method_type__from_string,
+ CanonicalizationMethodType_.c_tag: canonicalization_method_type__from_string,
SignatureMethod.c_tag: signature_method_from_string,
SignatureMethodType_.c_tag: signature_method_type__from_string,
Reference.c_tag: reference_from_string,
@@ -1741,76 +1751,76 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'CryptoBinary': CryptoBinary_,
- 'Signature': Signature,
- 'SignatureType': SignatureType_,
- 'SignatureValue': SignatureValue,
- 'SignatureValueType': SignatureValueType_,
- 'SignedInfo': SignedInfo,
- 'SignedInfoType': SignedInfoType_,
- 'CanonicalizationMethod': CanonicalizationMethod,
- 'CanonicalizationMethodType': CanonicalizationMethodType_,
- 'SignatureMethod': SignatureMethod,
- 'SignatureMethodType': SignatureMethodType_,
- 'Reference': Reference,
- 'ReferenceType': ReferenceType_,
- 'Transforms': Transforms,
- 'TransformsType': TransformsType_,
- 'Transform': Transform,
- 'TransformType': TransformType_,
- 'DigestMethod': DigestMethod,
- 'DigestMethodType': DigestMethodType_,
- 'DigestValue': DigestValue,
- 'DigestValueType': DigestValueType_,
- 'KeyInfo': KeyInfo,
- 'KeyInfoType': KeyInfoType_,
- 'KeyName': KeyName,
- 'MgmtData': MgmtData,
- 'KeyValue': KeyValue,
- 'KeyValueType': KeyValueType_,
- 'RetrievalMethod': RetrievalMethod,
- 'RetrievalMethodType': RetrievalMethodType_,
- 'X509Data': X509Data,
- 'X509DataType': X509DataType_,
- 'X509IssuerSerialType': X509IssuerSerialType_,
- 'PGPData': PGPData,
- 'PGPDataType': PGPDataType_,
- 'SPKIData': SPKIData,
- 'SPKIDataType': SPKIDataType_,
- 'Object': Object,
- 'ObjectType': ObjectType_,
- 'Manifest': Manifest,
- 'ManifestType': ManifestType_,
- 'SignatureProperties': SignatureProperties,
- 'SignaturePropertiesType': SignaturePropertiesType_,
- 'SignatureProperty': SignatureProperty,
- 'SignaturePropertyType': SignaturePropertyType_,
- 'HMACOutputLengthType': HMACOutputLengthType_,
- 'DSAKeyValue': DSAKeyValue,
- 'DSAKeyValueType': DSAKeyValueType_,
- 'RSAKeyValue': RSAKeyValue,
- 'RSAKeyValueType': RSAKeyValueType_,
- 'XPath': TransformType_XPath,
- 'X509IssuerName': X509IssuerName,
- 'X509SerialNumber': X509SerialNumber,
- 'PGPKeyID': PGPKeyID,
- 'PGPKeyPacket': PGPKeyPacket,
- 'SPKISexp': SPKISexp,
- 'P': P,
- 'Q': Q,
- 'G': G,
- 'Y': Y,
- 'J': J,
- 'Seed': Seed,
- 'PgenCounter': PgenCounter,
- 'Modulus': Modulus,
- 'Exponent': Exponent,
- 'HMACOutputLength': HMACOutputLength,
- 'X509IssuerSerial': X509IssuerSerial,
- 'X509SKI': X509SKI,
- 'X509SubjectName': X509SubjectName,
- 'X509Certificate': X509Certificate,
- 'X509CRL': X509CRL,
+ "CryptoBinary": CryptoBinary_,
+ "Signature": Signature,
+ "SignatureType": SignatureType_,
+ "SignatureValue": SignatureValue,
+ "SignatureValueType": SignatureValueType_,
+ "SignedInfo": SignedInfo,
+ "SignedInfoType": SignedInfoType_,
+ "CanonicalizationMethod": CanonicalizationMethod,
+ "CanonicalizationMethodType": CanonicalizationMethodType_,
+ "SignatureMethod": SignatureMethod,
+ "SignatureMethodType": SignatureMethodType_,
+ "Reference": Reference,
+ "ReferenceType": ReferenceType_,
+ "Transforms": Transforms,
+ "TransformsType": TransformsType_,
+ "Transform": Transform,
+ "TransformType": TransformType_,
+ "DigestMethod": DigestMethod,
+ "DigestMethodType": DigestMethodType_,
+ "DigestValue": DigestValue,
+ "DigestValueType": DigestValueType_,
+ "KeyInfo": KeyInfo,
+ "KeyInfoType": KeyInfoType_,
+ "KeyName": KeyName,
+ "MgmtData": MgmtData,
+ "KeyValue": KeyValue,
+ "KeyValueType": KeyValueType_,
+ "RetrievalMethod": RetrievalMethod,
+ "RetrievalMethodType": RetrievalMethodType_,
+ "X509Data": X509Data,
+ "X509DataType": X509DataType_,
+ "X509IssuerSerialType": X509IssuerSerialType_,
+ "PGPData": PGPData,
+ "PGPDataType": PGPDataType_,
+ "SPKIData": SPKIData,
+ "SPKIDataType": SPKIDataType_,
+ "Object": Object,
+ "ObjectType": ObjectType_,
+ "Manifest": Manifest,
+ "ManifestType": ManifestType_,
+ "SignatureProperties": SignatureProperties,
+ "SignaturePropertiesType": SignaturePropertiesType_,
+ "SignatureProperty": SignatureProperty,
+ "SignaturePropertyType": SignaturePropertyType_,
+ "HMACOutputLengthType": HMACOutputLengthType_,
+ "DSAKeyValue": DSAKeyValue,
+ "DSAKeyValueType": DSAKeyValueType_,
+ "RSAKeyValue": RSAKeyValue,
+ "RSAKeyValueType": RSAKeyValueType_,
+ "XPath": TransformType_XPath,
+ "X509IssuerName": X509IssuerName,
+ "X509SerialNumber": X509SerialNumber,
+ "PGPKeyID": PGPKeyID,
+ "PGPKeyPacket": PGPKeyPacket,
+ "SPKISexp": SPKISexp,
+ "P": P,
+ "Q": Q,
+ "G": G,
+ "Y": Y,
+ "J": J,
+ "Seed": Seed,
+ "PgenCounter": PgenCounter,
+ "Modulus": Modulus,
+ "Exponent": Exponent,
+ "HMACOutputLength": HMACOutputLength,
+ "X509IssuerSerial": X509IssuerSerial,
+ "X509SKI": X509SKI,
+ "X509SubjectName": X509SubjectName,
+ "X509Certificate": X509Certificate,
+ "X509CRL": X509CRL,
}
diff --git a/src/saml2/xmlenc/__init__.py b/src/saml2/xmlenc/__init__.py
index 2fd0756a..3f06bc94 100644
--- a/src/saml2/xmlenc/__init__.py
+++ b/src/saml2/xmlenc/__init__.py
@@ -8,62 +8,69 @@ import saml2
from saml2 import SamlBase
from saml2 import xmldsig as ds
-NAMESPACE = 'http://www.w3.org/2001/04/xmlenc#'
+
+NAMESPACE = "http://www.w3.org/2001/04/xmlenc#"
+
class KeySizeType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:KeySizeType element """
+ """The http://www.w3.org/2001/04/xmlenc#:KeySizeType element"""
- c_tag = 'KeySizeType'
+ c_tag = "KeySizeType"
c_namespace = NAMESPACE
- c_value_type = {'base': 'integer'}
+ c_value_type = {"base": "integer"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def key_size_type__from_string(xml_string):
return saml2.create_class_from_xml_string(KeySizeType_, xml_string)
class CipherValue(SamlBase):
- c_tag = 'CipherValue'
+ c_tag = "CipherValue"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def cipher_value_from_string(xml_string):
return saml2.create_class_from_xml_string(CipherValue, xml_string)
class TransformsType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:TransformsType element """
+ """The http://www.w3.org/2001/04/xmlenc#:TransformsType element"""
- c_tag = 'TransformsType'
+ c_tag = "TransformsType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2000/09/xmldsig#}Transform'] = ('transform', [ds.Transform])
- c_cardinality['transform'] = {"min":1}
- c_child_order.extend(['transform'])
-
- def __init__(self,
- transform=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.transform=transform or []
+ c_children["{http://www.w3.org/2000/09/xmldsig#}Transform"] = ("transform", [ds.Transform])
+ c_cardinality["transform"] = {"min": 1}
+ c_child_order.extend(["transform"])
+
+ def __init__(
+ self,
+ transform=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.transform = transform or []
+
def transforms_type__from_string(xml_string):
return saml2.create_class_from_xml_string(TransformsType_, xml_string)
@@ -71,139 +78,151 @@ def transforms_type__from_string(xml_string):
class KA_Nonce(SamlBase):
- c_tag = 'KA_Nonce'
+ c_tag = "KA_Nonce"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def k_a__nonce_from_string(xml_string):
return saml2.create_class_from_xml_string(KA_Nonce, xml_string)
class OriginatorKeyInfo(ds.KeyInfo):
- c_tag = 'OriginatorKeyInfo'
+ c_tag = "OriginatorKeyInfo"
c_namespace = NAMESPACE
c_children = ds.KeyInfo.c_children.copy()
c_attributes = ds.KeyInfo.c_attributes.copy()
c_child_order = ds.KeyInfo.c_child_order[:]
c_cardinality = ds.KeyInfo.c_cardinality.copy()
+
def originator_key_info_from_string(xml_string):
return saml2.create_class_from_xml_string(OriginatorKeyInfo, xml_string)
class RecipientKeyInfo(ds.KeyInfo):
- c_tag = 'RecipientKeyInfo'
+ c_tag = "RecipientKeyInfo"
c_namespace = NAMESPACE
c_children = ds.KeyInfo.c_children.copy()
c_attributes = ds.KeyInfo.c_attributes.copy()
c_child_order = ds.KeyInfo.c_child_order[:]
c_cardinality = ds.KeyInfo.c_cardinality.copy()
+
def recipient_key_info_from_string(xml_string):
return saml2.create_class_from_xml_string(RecipientKeyInfo, xml_string)
class AgreementMethodType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:AgreementMethodType element """
+ """The http://www.w3.org/2001/04/xmlenc#:AgreementMethodType element"""
- c_tag = 'AgreementMethodType'
+ c_tag = "AgreementMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}KA_Nonce'] = ('k_a__nonce', KA_Nonce)
- c_cardinality['k_a__nonce'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2001/04/xmlenc#}OriginatorKeyInfo'] = ('originator_key_info', OriginatorKeyInfo)
- c_cardinality['originator_key_info'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2001/04/xmlenc#}RecipientKeyInfo'] = ('recipient_key_info', RecipientKeyInfo)
- c_cardinality['recipient_key_info'] = {"min":0, "max":1}
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
- c_child_order.extend(['k_a__nonce', 'originator_key_info', 'recipient_key_info'])
-
- def __init__(self,
- k_a__nonce=None,
- originator_key_info=None,
- recipient_key_info=None,
- algorithm=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.k_a__nonce=k_a__nonce
- self.originator_key_info=originator_key_info
- self.recipient_key_info=recipient_key_info
- self.algorithm=algorithm
+ c_children["{http://www.w3.org/2001/04/xmlenc#}KA_Nonce"] = ("k_a__nonce", KA_Nonce)
+ c_cardinality["k_a__nonce"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2001/04/xmlenc#}OriginatorKeyInfo"] = ("originator_key_info", OriginatorKeyInfo)
+ c_cardinality["originator_key_info"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2001/04/xmlenc#}RecipientKeyInfo"] = ("recipient_key_info", RecipientKeyInfo)
+ c_cardinality["recipient_key_info"] = {"min": 0, "max": 1}
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+ c_child_order.extend(["k_a__nonce", "originator_key_info", "recipient_key_info"])
+
+ def __init__(
+ self,
+ k_a__nonce=None,
+ originator_key_info=None,
+ recipient_key_info=None,
+ algorithm=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.k_a__nonce = k_a__nonce
+ self.originator_key_info = originator_key_info
+ self.recipient_key_info = recipient_key_info
+ self.algorithm = algorithm
+
def agreement_method_type__from_string(xml_string):
return saml2.create_class_from_xml_string(AgreementMethodType_, xml_string)
class ReferenceType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:ReferenceType element """
+ """The http://www.w3.org/2001/04/xmlenc#:ReferenceType element"""
- c_tag = 'ReferenceType'
+ c_tag = "ReferenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['URI'] = ('uri', 'anyURI', True)
-
- def __init__(self,
- uri=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.uri=uri
+ c_attributes["URI"] = ("uri", "anyURI", True)
+
+ def __init__(
+ self,
+ uri=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.uri = uri
+
def reference_type__from_string(xml_string):
return saml2.create_class_from_xml_string(ReferenceType_, xml_string)
class EncryptionPropertyType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptionPropertyType element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptionPropertyType element"""
- c_tag = 'EncryptionPropertyType'
+ c_tag = "EncryptionPropertyType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_attributes['Target'] = ('target', 'anyURI', False)
- c_attributes['Id'] = ('id', 'ID', False)
-
- def __init__(self,
- target=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.target=target
- self.id=id
+ c_attributes["Target"] = ("target", "anyURI", False)
+ c_attributes["Id"] = ("id", "ID", False)
+
+ def __init__(
+ self,
+ target=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.target = target
+ self.id = id
+
def encryption_property_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionPropertyType_, xml_string)
@@ -211,63 +230,68 @@ def encryption_property_type__from_string(xml_string):
class KeySize(KeySizeType_):
- c_tag = 'KeySize'
+ c_tag = "KeySize"
c_namespace = NAMESPACE
c_children = KeySizeType_.c_children.copy()
c_attributes = KeySizeType_.c_attributes.copy()
c_child_order = KeySizeType_.c_child_order[:]
c_cardinality = KeySizeType_.c_cardinality.copy()
+
def key_size_from_string(xml_string):
return saml2.create_class_from_xml_string(KeySize, xml_string)
class OAEPparams(SamlBase):
- c_tag = 'OAEPparams'
+ c_tag = "OAEPparams"
c_namespace = NAMESPACE
- c_value_type = {'base': 'base64Binary'}
+ c_value_type = {"base": "base64Binary"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def oae_pparams_from_string(xml_string):
return saml2.create_class_from_xml_string(OAEPparams, xml_string)
class EncryptionMethodType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptionMethodType element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptionMethodType element"""
- c_tag = 'EncryptionMethodType'
+ c_tag = "EncryptionMethodType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}KeySize'] = ('key_size', KeySize)
- c_cardinality['key_size'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2001/04/xmlenc#}OAEPparams'] = ('oae_pparams', OAEPparams)
- c_cardinality['oae_pparams'] = {"min":0, "max":1}
- c_attributes['Algorithm'] = ('algorithm', 'anyURI', True)
- c_child_order.extend(['key_size', 'oae_pparams'])
-
- def __init__(self,
- key_size=None,
- oae_pparams=None,
- algorithm=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.key_size=key_size
- self.oae_pparams=oae_pparams
- self.algorithm=algorithm
+ c_children["{http://www.w3.org/2001/04/xmlenc#}KeySize"] = ("key_size", KeySize)
+ c_cardinality["key_size"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2001/04/xmlenc#}OAEPparams"] = ("oae_pparams", OAEPparams)
+ c_cardinality["oae_pparams"] = {"min": 0, "max": 1}
+ c_attributes["Algorithm"] = ("algorithm", "anyURI", True)
+ c_child_order.extend(["key_size", "oae_pparams"])
+
+ def __init__(
+ self,
+ key_size=None,
+ oae_pparams=None,
+ algorithm=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.key_size = key_size
+ self.oae_pparams = oae_pparams
+ self.algorithm = algorithm
+
def encryption_method_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionMethodType_, xml_string)
@@ -275,45 +299,49 @@ def encryption_method_type__from_string(xml_string):
class Transforms(TransformsType_):
- c_tag = 'Transforms'
+ c_tag = "Transforms"
c_namespace = NAMESPACE
c_children = TransformsType_.c_children.copy()
c_attributes = TransformsType_.c_attributes.copy()
c_child_order = TransformsType_.c_child_order[:]
c_cardinality = TransformsType_.c_cardinality.copy()
+
def transforms_from_string(xml_string):
return saml2.create_class_from_xml_string(Transforms, xml_string)
class CipherReferenceType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:CipherReferenceType element """
+ """The http://www.w3.org/2001/04/xmlenc#:CipherReferenceType element"""
- c_tag = 'CipherReferenceType'
+ c_tag = "CipherReferenceType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}Transforms'] = ('transforms', Transforms)
- c_cardinality['transforms'] = {"min":0, "max":1}
- c_attributes['URI'] = ('uri', 'anyURI', True)
- c_child_order.extend(['transforms'])
-
- def __init__(self,
- transforms=None,
- uri=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.transforms=transforms
- self.uri=uri
+ c_children["{http://www.w3.org/2001/04/xmlenc#}Transforms"] = ("transforms", Transforms)
+ c_cardinality["transforms"] = {"min": 0, "max": 1}
+ c_attributes["URI"] = ("uri", "anyURI", True)
+ c_child_order.extend(["transforms"])
+
+ def __init__(
+ self,
+ transforms=None,
+ uri=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.transforms = transforms
+ self.uri = uri
+
def cipher_reference_type__from_string(xml_string):
return saml2.create_class_from_xml_string(CipherReferenceType_, xml_string)
@@ -321,376 +349,403 @@ def cipher_reference_type__from_string(xml_string):
class EncryptionMethod(EncryptionMethodType_):
- c_tag = 'EncryptionMethod'
+ c_tag = "EncryptionMethod"
c_namespace = NAMESPACE
c_children = EncryptionMethodType_.c_children.copy()
c_attributes = EncryptionMethodType_.c_attributes.copy()
c_child_order = EncryptionMethodType_.c_child_order[:]
c_cardinality = EncryptionMethodType_.c_cardinality.copy()
+
def encryption_method_from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionMethod, xml_string)
-
class AgreementMethod(AgreementMethodType_):
- """The http://www.w3.org/2001/04/xmlenc#:AgreementMethod element """
+ """The http://www.w3.org/2001/04/xmlenc#:AgreementMethod element"""
- c_tag = 'AgreementMethod'
+ c_tag = "AgreementMethod"
c_namespace = NAMESPACE
c_children = AgreementMethodType_.c_children.copy()
c_attributes = AgreementMethodType_.c_attributes.copy()
c_child_order = AgreementMethodType_.c_child_order[:]
c_cardinality = AgreementMethodType_.c_cardinality.copy()
+
def agreement_method_from_string(xml_string):
return saml2.create_class_from_xml_string(AgreementMethod, xml_string)
class DataReference(ReferenceType_):
- c_tag = 'DataReference'
+ c_tag = "DataReference"
c_namespace = NAMESPACE
c_children = ReferenceType_.c_children.copy()
c_attributes = ReferenceType_.c_attributes.copy()
c_child_order = ReferenceType_.c_child_order[:]
c_cardinality = ReferenceType_.c_cardinality.copy()
+
def data_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(DataReference, xml_string)
class KeyReference(ReferenceType_):
- c_tag = 'KeyReference'
+ c_tag = "KeyReference"
c_namespace = NAMESPACE
c_children = ReferenceType_.c_children.copy()
c_attributes = ReferenceType_.c_attributes.copy()
c_child_order = ReferenceType_.c_child_order[:]
c_cardinality = ReferenceType_.c_cardinality.copy()
+
def key_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(KeyReference, xml_string)
class ReferenceList(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:ReferenceList element """
+ """The http://www.w3.org/2001/04/xmlenc#:ReferenceList element"""
- c_tag = 'ReferenceList'
+ c_tag = "ReferenceList"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}DataReference'] = ('data_reference', [DataReference])
- c_cardinality['data_reference'] = {"min":0}
- c_children['{http://www.w3.org/2001/04/xmlenc#}KeyReference'] = ('key_reference', [KeyReference])
- c_cardinality['key_reference'] = {"min":0}
- c_child_order.extend(['data_reference', 'key_reference'])
-
- def __init__(self,
- data_reference=None,
- key_reference=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.data_reference=data_reference or []
- self.key_reference=key_reference or []
+ c_children["{http://www.w3.org/2001/04/xmlenc#}DataReference"] = ("data_reference", [DataReference])
+ c_cardinality["data_reference"] = {"min": 0}
+ c_children["{http://www.w3.org/2001/04/xmlenc#}KeyReference"] = ("key_reference", [KeyReference])
+ c_cardinality["key_reference"] = {"min": 0}
+ c_child_order.extend(["data_reference", "key_reference"])
+
+ def __init__(
+ self,
+ data_reference=None,
+ key_reference=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.data_reference = data_reference or []
+ self.key_reference = key_reference or []
+
def reference_list_from_string(xml_string):
return saml2.create_class_from_xml_string(ReferenceList, xml_string)
class EncryptionProperty(EncryptionPropertyType_):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptionProperty element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptionProperty element"""
- c_tag = 'EncryptionProperty'
+ c_tag = "EncryptionProperty"
c_namespace = NAMESPACE
c_children = EncryptionPropertyType_.c_children.copy()
c_attributes = EncryptionPropertyType_.c_attributes.copy()
c_child_order = EncryptionPropertyType_.c_child_order[:]
c_cardinality = EncryptionPropertyType_.c_cardinality.copy()
+
def encryption_property_from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionProperty, xml_string)
class CipherReference(CipherReferenceType_):
- """The http://www.w3.org/2001/04/xmlenc#:CipherReference element """
+ """The http://www.w3.org/2001/04/xmlenc#:CipherReference element"""
- c_tag = 'CipherReference'
+ c_tag = "CipherReference"
c_namespace = NAMESPACE
c_children = CipherReferenceType_.c_children.copy()
c_attributes = CipherReferenceType_.c_attributes.copy()
c_child_order = CipherReferenceType_.c_child_order[:]
c_cardinality = CipherReferenceType_.c_cardinality.copy()
+
def cipher_reference_from_string(xml_string):
return saml2.create_class_from_xml_string(CipherReference, xml_string)
class EncryptionPropertiesType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptionPropertiesType element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptionPropertiesType element"""
- c_tag = 'EncryptionPropertiesType'
+ c_tag = "EncryptionPropertiesType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}EncryptionProperty'] = ('encryption_property', [EncryptionProperty])
- c_cardinality['encryption_property'] = {"min":1}
- c_attributes['Id'] = ('id', 'ID', False)
- c_child_order.extend(['encryption_property'])
-
- def __init__(self,
- encryption_property=None,
- id=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.encryption_property=encryption_property or []
- self.id=id
+ c_children["{http://www.w3.org/2001/04/xmlenc#}EncryptionProperty"] = ("encryption_property", [EncryptionProperty])
+ c_cardinality["encryption_property"] = {"min": 1}
+ c_attributes["Id"] = ("id", "ID", False)
+ c_child_order.extend(["encryption_property"])
+
+ def __init__(
+ self,
+ encryption_property=None,
+ id=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.encryption_property = encryption_property or []
+ self.id = id
+
def encryption_properties_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionPropertiesType_, xml_string)
class CipherDataType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:CipherDataType element """
+ """The http://www.w3.org/2001/04/xmlenc#:CipherDataType element"""
- c_tag = 'CipherDataType'
+ c_tag = "CipherDataType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}CipherValue'] = ('cipher_value', CipherValue)
- c_cardinality['cipher_value'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2001/04/xmlenc#}CipherReference'] = ('cipher_reference', CipherReference)
- c_cardinality['cipher_reference'] = {"min":0, "max":1}
- c_child_order.extend(['cipher_value', 'cipher_reference'])
-
- def __init__(self,
- cipher_value=None,
- cipher_reference=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.cipher_value=cipher_value
- self.cipher_reference=cipher_reference
+ c_children["{http://www.w3.org/2001/04/xmlenc#}CipherValue"] = ("cipher_value", CipherValue)
+ c_cardinality["cipher_value"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2001/04/xmlenc#}CipherReference"] = ("cipher_reference", CipherReference)
+ c_cardinality["cipher_reference"] = {"min": 0, "max": 1}
+ c_child_order.extend(["cipher_value", "cipher_reference"])
+
+ def __init__(
+ self,
+ cipher_value=None,
+ cipher_reference=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.cipher_value = cipher_value
+ self.cipher_reference = cipher_reference
+
def cipher_data_type__from_string(xml_string):
return saml2.create_class_from_xml_string(CipherDataType_, xml_string)
class EncryptionProperties(EncryptionPropertiesType_):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptionProperties element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptionProperties element"""
- c_tag = 'EncryptionProperties'
+ c_tag = "EncryptionProperties"
c_namespace = NAMESPACE
c_children = EncryptionPropertiesType_.c_children.copy()
c_attributes = EncryptionPropertiesType_.c_attributes.copy()
c_child_order = EncryptionPropertiesType_.c_child_order[:]
c_cardinality = EncryptionPropertiesType_.c_cardinality.copy()
+
def encryption_properties_from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptionProperties, xml_string)
class CipherData(CipherDataType_):
- """The http://www.w3.org/2001/04/xmlenc#:CipherData element """
+ """The http://www.w3.org/2001/04/xmlenc#:CipherData element"""
- c_tag = 'CipherData'
+ c_tag = "CipherData"
c_namespace = NAMESPACE
c_children = CipherDataType_.c_children.copy()
c_attributes = CipherDataType_.c_attributes.copy()
c_child_order = CipherDataType_.c_child_order[:]
c_cardinality = CipherDataType_.c_cardinality.copy()
+
def cipher_data_from_string(xml_string):
return saml2.create_class_from_xml_string(CipherData, xml_string)
class EncryptedType_(SamlBase):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptedType element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptedType element"""
- c_tag = 'EncryptedType'
+ c_tag = "EncryptedType"
c_namespace = NAMESPACE
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}EncryptionMethod'] = ('encryption_method', EncryptionMethod)
- c_cardinality['encryption_method'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2000/09/xmldsig#}KeyInfo'] = ('key_info', ds.KeyInfo)
- c_cardinality['key_info'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2001/04/xmlenc#}CipherData'] = ('cipher_data', CipherData)
- c_children['{http://www.w3.org/2001/04/xmlenc#}EncryptionProperties'] = ('encryption_properties', EncryptionProperties)
- c_cardinality['encryption_properties'] = {"min":0, "max":1}
- c_attributes['Id'] = ('id', 'ID', False)
- c_attributes['Type'] = ('type', 'anyURI', False)
- c_attributes['MimeType'] = ('mime_type', 'string', False)
- c_attributes['Encoding'] = ('encoding', 'anyURI', False)
- c_child_order.extend(['encryption_method', 'key_info', 'cipher_data', 'encryption_properties'])
-
- def __init__(self,
- encryption_method=None,
- key_info=None,
- cipher_data=None,
- encryption_properties=None,
- id=None,
- type=None,
- mime_type=None,
- encoding=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- SamlBase.__init__(self,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.encryption_method=encryption_method
- self.key_info=key_info
- self.cipher_data=cipher_data
- self.encryption_properties=encryption_properties
- self.id=id
- self.type=type
- self.mime_type=mime_type
- self.encoding=encoding
+ c_children["{http://www.w3.org/2001/04/xmlenc#}EncryptionMethod"] = ("encryption_method", EncryptionMethod)
+ c_cardinality["encryption_method"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2000/09/xmldsig#}KeyInfo"] = ("key_info", ds.KeyInfo)
+ c_cardinality["key_info"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2001/04/xmlenc#}CipherData"] = ("cipher_data", CipherData)
+ c_children["{http://www.w3.org/2001/04/xmlenc#}EncryptionProperties"] = (
+ "encryption_properties",
+ EncryptionProperties,
+ )
+ c_cardinality["encryption_properties"] = {"min": 0, "max": 1}
+ c_attributes["Id"] = ("id", "ID", False)
+ c_attributes["Type"] = ("type", "anyURI", False)
+ c_attributes["MimeType"] = ("mime_type", "string", False)
+ c_attributes["Encoding"] = ("encoding", "anyURI", False)
+ c_child_order.extend(["encryption_method", "key_info", "cipher_data", "encryption_properties"])
+
+ def __init__(
+ self,
+ encryption_method=None,
+ key_info=None,
+ cipher_data=None,
+ encryption_properties=None,
+ id=None,
+ type=None,
+ mime_type=None,
+ encoding=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ SamlBase.__init__(
+ self,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.encryption_method = encryption_method
+ self.key_info = key_info
+ self.cipher_data = cipher_data
+ self.encryption_properties = encryption_properties
+ self.id = id
+ self.type = type
+ self.mime_type = mime_type
+ self.encoding = encoding
class EncryptedDataType_(EncryptedType_):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptedDataType element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptedDataType element"""
- c_tag = 'EncryptedDataType'
+ c_tag = "EncryptedDataType"
c_namespace = NAMESPACE
c_children = EncryptedType_.c_children.copy()
c_attributes = EncryptedType_.c_attributes.copy()
c_child_order = EncryptedType_.c_child_order[:]
c_cardinality = EncryptedType_.c_cardinality.copy()
+
def encrypted_data_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptedDataType_, xml_string)
class CarriedKeyName(SamlBase):
- c_tag = 'CarriedKeyName'
+ c_tag = "CarriedKeyName"
c_namespace = NAMESPACE
- c_value_type = {'base': 'string'}
+ c_value_type = {"base": "string"}
c_children = SamlBase.c_children.copy()
c_attributes = SamlBase.c_attributes.copy()
c_child_order = SamlBase.c_child_order[:]
c_cardinality = SamlBase.c_cardinality.copy()
+
def carried_key_name_from_string(xml_string):
return saml2.create_class_from_xml_string(CarriedKeyName, xml_string)
class EncryptedKeyType_(EncryptedType_):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptedKeyType element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptedKeyType element"""
- c_tag = 'EncryptedKeyType'
+ c_tag = "EncryptedKeyType"
c_namespace = NAMESPACE
c_children = EncryptedType_.c_children.copy()
c_attributes = EncryptedType_.c_attributes.copy()
c_child_order = EncryptedType_.c_child_order[:]
c_cardinality = EncryptedType_.c_cardinality.copy()
- c_children['{http://www.w3.org/2001/04/xmlenc#}ReferenceList'] = ('reference_list', ReferenceList)
- c_cardinality['reference_list'] = {"min":0, "max":1}
- c_children['{http://www.w3.org/2001/04/xmlenc#}CarriedKeyName'] = ('carried_key_name', CarriedKeyName)
- c_cardinality['carried_key_name'] = {"min":0, "max":1}
- c_attributes['Recipient'] = ('recipient', 'string', False)
- c_child_order.extend(['reference_list', 'carried_key_name'])
-
- def __init__(self,
- reference_list=None,
- carried_key_name=None,
- recipient=None,
- encryption_method=None,
- key_info=None,
- cipher_data=None,
- encryption_properties=None,
- id=None,
- type=None,
- mime_type=None,
- encoding=None,
- text=None,
- extension_elements=None,
- extension_attributes=None,
- ):
- EncryptedType_.__init__(self,
- encryption_method=encryption_method,
- key_info=key_info,
- cipher_data=cipher_data,
- encryption_properties=encryption_properties,
- id=id,
- type=type,
- mime_type=mime_type,
- encoding=encoding,
- text=text,
- extension_elements=extension_elements,
- extension_attributes=extension_attributes,
- )
- self.reference_list=reference_list
- self.carried_key_name=carried_key_name
- self.recipient=recipient
+ c_children["{http://www.w3.org/2001/04/xmlenc#}ReferenceList"] = ("reference_list", ReferenceList)
+ c_cardinality["reference_list"] = {"min": 0, "max": 1}
+ c_children["{http://www.w3.org/2001/04/xmlenc#}CarriedKeyName"] = ("carried_key_name", CarriedKeyName)
+ c_cardinality["carried_key_name"] = {"min": 0, "max": 1}
+ c_attributes["Recipient"] = ("recipient", "string", False)
+ c_child_order.extend(["reference_list", "carried_key_name"])
+
+ def __init__(
+ self,
+ reference_list=None,
+ carried_key_name=None,
+ recipient=None,
+ encryption_method=None,
+ key_info=None,
+ cipher_data=None,
+ encryption_properties=None,
+ id=None,
+ type=None,
+ mime_type=None,
+ encoding=None,
+ text=None,
+ extension_elements=None,
+ extension_attributes=None,
+ ):
+ EncryptedType_.__init__(
+ self,
+ encryption_method=encryption_method,
+ key_info=key_info,
+ cipher_data=cipher_data,
+ encryption_properties=encryption_properties,
+ id=id,
+ type=type,
+ mime_type=mime_type,
+ encoding=encoding,
+ text=text,
+ extension_elements=extension_elements,
+ extension_attributes=extension_attributes,
+ )
+ self.reference_list = reference_list
+ self.carried_key_name = carried_key_name
+ self.recipient = recipient
+
def encrypted_key_type__from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptedKeyType_, xml_string)
class EncryptedData(EncryptedDataType_):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptedData element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptedData element"""
- c_tag = 'EncryptedData'
+ c_tag = "EncryptedData"
c_namespace = NAMESPACE
c_children = EncryptedDataType_.c_children.copy()
c_attributes = EncryptedDataType_.c_attributes.copy()
c_child_order = EncryptedDataType_.c_child_order[:]
c_cardinality = EncryptedDataType_.c_cardinality.copy()
+
def encrypted_data_from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptedData, xml_string)
class EncryptedKey(EncryptedKeyType_):
- """The http://www.w3.org/2001/04/xmlenc#:EncryptedKey element """
+ """The http://www.w3.org/2001/04/xmlenc#:EncryptedKey element"""
- c_tag = 'EncryptedKey'
+ c_tag = "EncryptedKey"
c_namespace = NAMESPACE
c_children = EncryptedKeyType_.c_children.copy()
c_attributes = EncryptedKeyType_.c_attributes.copy()
c_child_order = EncryptedKeyType_.c_child_order[:]
c_cardinality = EncryptedKeyType_.c_cardinality.copy()
+
def encrypted_key_from_string(xml_string):
return saml2.create_class_from_xml_string(EncryptedKey, xml_string)
-ds.KeyInfo.c_children['{http://www.w3.org/2000/09/xmlenc#}EncryptedKey'] = (
- 'encrypted_key',
- EncryptedKey)
+
+ds.KeyInfo.c_children["{http://www.w3.org/2000/09/xmlenc#}EncryptedKey"] = ("encrypted_key", EncryptedKey)
ELEMENT_FROM_STRING = {
@@ -727,40 +782,39 @@ ELEMENT_FROM_STRING = {
}
ELEMENT_BY_TAG = {
- 'EncryptionMethodType': EncryptionMethodType_,
- 'KeySizeType': KeySizeType_,
- 'CipherData': CipherData,
- 'CipherDataType': CipherDataType_,
- 'CipherReference': CipherReference,
- 'CipherReferenceType': CipherReferenceType_,
- 'TransformsType': TransformsType_,
- 'EncryptedData': EncryptedData,
- 'EncryptedDataType': EncryptedDataType_,
- 'EncryptedKey': EncryptedKey,
- 'EncryptedKeyType': EncryptedKeyType_,
- 'AgreementMethod': AgreementMethod,
- 'AgreementMethodType': AgreementMethodType_,
- 'ReferenceList': ReferenceList,
- 'ReferenceType': ReferenceType_,
- 'EncryptionProperties': EncryptionProperties,
- 'EncryptionPropertiesType': EncryptionPropertiesType_,
- 'EncryptionProperty': EncryptionProperty,
- 'EncryptionPropertyType': EncryptionPropertyType_,
- 'CipherValue': CipherValue,
- 'KA_Nonce': KA_Nonce,
- 'OriginatorKeyInfo': OriginatorKeyInfo,
- 'RecipientKeyInfo': RecipientKeyInfo,
- 'KeySize': KeySize,
- 'OAEPparams': OAEPparams,
- 'Transforms': Transforms,
- 'EncryptionMethod': EncryptionMethod,
- 'DataReference': DataReference,
- 'KeyReference': KeyReference,
- 'CarriedKeyName': CarriedKeyName,
- 'EncryptedType': EncryptedType_,
+ "EncryptionMethodType": EncryptionMethodType_,
+ "KeySizeType": KeySizeType_,
+ "CipherData": CipherData,
+ "CipherDataType": CipherDataType_,
+ "CipherReference": CipherReference,
+ "CipherReferenceType": CipherReferenceType_,
+ "TransformsType": TransformsType_,
+ "EncryptedData": EncryptedData,
+ "EncryptedDataType": EncryptedDataType_,
+ "EncryptedKey": EncryptedKey,
+ "EncryptedKeyType": EncryptedKeyType_,
+ "AgreementMethod": AgreementMethod,
+ "AgreementMethodType": AgreementMethodType_,
+ "ReferenceList": ReferenceList,
+ "ReferenceType": ReferenceType_,
+ "EncryptionProperties": EncryptionProperties,
+ "EncryptionPropertiesType": EncryptionPropertiesType_,
+ "EncryptionProperty": EncryptionProperty,
+ "EncryptionPropertyType": EncryptionPropertyType_,
+ "CipherValue": CipherValue,
+ "KA_Nonce": KA_Nonce,
+ "OriginatorKeyInfo": OriginatorKeyInfo,
+ "RecipientKeyInfo": RecipientKeyInfo,
+ "KeySize": KeySize,
+ "OAEPparams": OAEPparams,
+ "Transforms": Transforms,
+ "EncryptionMethod": EncryptionMethod,
+ "DataReference": DataReference,
+ "KeyReference": KeyReference,
+ "CarriedKeyName": CarriedKeyName,
+ "EncryptedType": EncryptedType_,
}
def factory(tag, **kwargs):
return ELEMENT_BY_TAG[tag](**kwargs)
-
diff --git a/src/saml2test/__init__.py b/src/saml2test/__init__.py
index a4812f96..81eace7f 100644
--- a/src/saml2test/__init__.py
+++ b/src/saml2test/__init__.py
@@ -1,16 +1,19 @@
import logging
+import socket
+from subprocess import PIPE
+from subprocess import Popen
+import sys
import time
import traceback
+
import requests
-import sys
-import socket
-from subprocess import Popen, PIPE
from saml2test.check import CRITICAL
+
logger = logging.getLogger(__name__)
-__author__ = 'rolandh'
+__author__ = "rolandh"
class FatalError(Exception):
@@ -53,11 +56,11 @@ def start_script(path, *args):
def stop_script_by_name(name):
- import subprocess
- import signal
import os
+ import signal
+ import subprocess
- p = subprocess.Popen(['ps', '-A'], stdout=subprocess.PIPE)
+ p = subprocess.Popen(["ps", "-A"], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
@@ -67,8 +70,8 @@ def stop_script_by_name(name):
def stop_script_by_pid(pid):
- import signal
import os
+ import signal
os.kill(pid, signal.SIGKILL)
@@ -93,5 +96,4 @@ def exception_trace(tag, exc, log=None):
def ip_addresses():
- return [ip for ip in socket.gethostbyname_ex(socket.gethostname())[2]
- if not ip.startswith("127.")] \ No newline at end of file
+ return [ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")]
diff --git a/src/saml2test/check.py b/src/saml2test/check.py
index 71093714..c797f11c 100644
--- a/src/saml2test/check.py
+++ b/src/saml2test/check.py
@@ -1,29 +1,30 @@
import inspect
import json
+
import six
-__author__ = 'rolandh'
-import traceback
+__author__ = "rolandh"
+
import sys
+import traceback
+
INFORMATION = 0
OK = 1
WARNING = 2
-ERROR = 3 # an error condition in the test target
-CRITICAL = 4 # an error condition in the test driver
+ERROR = 3 # an error condition in the test target
+CRITICAL = 4 # an error condition in the test driver
INTERACTION = 5
-STATUSCODE = ["INFORMATION", "OK", "WARNING", "ERROR", "CRITICAL",
- "INTERACTION"]
+STATUSCODE = ["INFORMATION", "OK", "WARNING", "ERROR", "CRITICAL", "INTERACTION"]
CONT_JSON = "application/json"
CONT_JWT = "application/jwt"
class Check(object):
- """ General test
- """
+ """General test"""
cid = "check"
msg = "OK"
@@ -46,16 +47,11 @@ class Check(object):
def response(self, **kwargs):
try:
- name = " ".join(
- [s.strip() for s in self.__doc__.strip().split("\n")])
+ name = " ".join([s.strip() for s in self.__doc__.strip().split("\n")])
except AttributeError:
name = ""
- res = {
- "id": self.cid,
- "status": self._status,
- "name": name
- }
+ res = {"id": self.cid, "status": self._status, "name": name}
if self._message:
res["message"] = self._message
@@ -105,6 +101,7 @@ class CheckErrorResponse(ExpectedError):
Checks that the HTTP response status is outside the 200 or 300 range
or that an JSON encoded error message has been received
"""
+
cid = "check-error-response"
msg = "OP error"
@@ -128,6 +125,7 @@ class VerifyBadRequestResponse(ExpectedError):
Verifies that the test target returned a 400 Bad Request response
containing a an error message.
"""
+
cid = "verify-bad-request-response"
msg = "OP error"
@@ -178,6 +176,7 @@ class WrapException(CriticalError):
"""
A runtime exception
"""
+
cid = "exception"
msg = "Test tool exception"
@@ -188,7 +187,8 @@ class WrapException(CriticalError):
class Other(CriticalError):
- """ Other error """
+ """Other error"""
+
msg = "Other error"
@@ -196,6 +196,7 @@ class CheckSpHttpResponseOK(Error):
"""
Checks that the SP's HTTP response status is within the 200 or 300 range
"""
+
cid = "check-sp-http-response-ok"
msg = "SP error OK"
@@ -207,7 +208,7 @@ class CheckSpHttpResponseOK(Error):
if _response.status_code >= 400:
self._status = self.status
self._message = self.msg
- #res["content"] = _content #too big + charset converstion needed
+ # res["content"] = _content #too big + charset converstion needed
res["url"] = conv.position
res["http_status"] = _response.status_code
@@ -215,9 +216,10 @@ class CheckSpHttpResponseOK(Error):
class CheckSpHttpResponse500(Error):
- """ Checks that the SP's HTTP response status is >= 500. This is useful
- to check if the SP correctly flags errors such as an invalid signature
+ """Checks that the SP's HTTP response status is >= 500. This is useful
+ to check if the SP correctly flags errors such as an invalid signature
"""
+
cid = "check-sp-http-response-500"
msg = "SP does not return a HTTP 5xx status when it shold do so."
@@ -229,7 +231,7 @@ class CheckSpHttpResponse500(Error):
if _response.status_code < 500:
self._status = self.status
self._message = self.msg
- #res["content"] = _content #too big + charset converstion needed
+ # res["content"] = _content #too big + charset converstion needed
res["url"] = conv.position
res["http_status"] = _response.status_code
@@ -237,8 +239,8 @@ class CheckSpHttpResponse500(Error):
class MissingRedirect(CriticalError):
- """ At this point in the flow a redirect back to the client was expected.
- """
+ """At this point in the flow a redirect back to the client was expected."""
+
cid = "missing-redirect"
msg = "Expected redirect to the RP, got something else"
@@ -248,7 +250,8 @@ class MissingRedirect(CriticalError):
class Parse(CriticalError):
- """ Parsing the response """
+ """Parsing the response"""
+
cid = "response-parse"
errmsg = "Parse error"
@@ -264,15 +267,13 @@ class Parse(CriticalError):
self._status = self.status
self._message = (
"Didn't get a response of the type I expected:",
- " '%s' instead of '%s', content:'%s'" % (
- cname, conv.response_type, _rmsg))
- return {
- "response_type": conv.response_type,
- "url": conv.position
- }
+ " '%s' instead of '%s', content:'%s'" % (cname, conv.response_type, _rmsg),
+ )
+ return {"response_type": conv.response_type, "url": conv.position}
return {}
+
def factory(cid, classes):
if len(classes) == 0:
for name, obj in inspect.getmembers(sys.modules[__name__]):
diff --git a/src/saml2test/interaction.py b/src/saml2test/interaction.py
index 119d1289..9c1dad6e 100644
--- a/src/saml2test/interaction.py
+++ b/src/saml2test/interaction.py
@@ -1,15 +1,16 @@
-__author__ = 'rohe0002'
+__author__ = "rohe0002"
import json
import logging
-import six
-from urlparse import urlparse
from bs4 import BeautifulSoup
-
from mechanize import ParseResponseEx
-from mechanize._form import ControlNotFoundError, AmbiguityError
+from mechanize._form import AmbiguityError
+from mechanize._form import ControlNotFoundError
from mechanize._form import ListControl
+import six
+from urlparse import urlparse
+
logger = logging.getLogger(__name__)
@@ -35,11 +36,12 @@ def NoneFunc():
return None
-class RResponse():
+class RResponse:
"""
A Response class that behaves in the way that mechanize expects it.
Links to a requests.Response
"""
+
def __init__(self, resp):
self._resp = resp
self.index = 0
@@ -80,10 +82,10 @@ class RResponse():
if self._len == self.index:
part = None
elif self._len - self.index < size:
- part = self.text[self.index:]
+ part = self.text[self.index :]
self.index = self._len
else:
- part = self.text[self.index:self.index + size]
+ part = self.text[self.index : self.index + size]
self.index += size
return part
else:
@@ -121,8 +123,7 @@ class Interaction(object):
_match += 1
else:
_c = _bs.title.contents
- if isinstance(_c, list) and not isinstance(
- _c, six.string_types):
+ if isinstance(_c, list) and not isinstance(_c, six.string_types):
for _line in _c:
if val in _line:
_match += 1
@@ -155,9 +156,9 @@ class Interaction(object):
if not forms:
raise FlowException(content=response.text, url=url)
- #if len(forms) == 1:
+ # if len(forms) == 1:
# return forms[0]
- #else:
+ # else:
_form = None
# ignore the first form, because I use ParseResponseEx which adds
@@ -242,8 +243,7 @@ class Interaction(object):
url = request._Request__original
if form.method == "POST":
- return self.httpc.send(url, "POST", data=request.data,
- headers=headers)
+ return self.httpc.send(url, "POST", data=request.data, headers=headers)
else:
return self.httpc.send(url, "GET", headers=headers)
@@ -263,7 +263,7 @@ class Interaction(object):
_url = kwargs["location"]
form = self.pick_form(response, _url, **kwargs)
- #form.backwards_compatible = False
+ # form.backwards_compatible = False
if not form:
raise Exception("Can't pick a form !!")
@@ -286,12 +286,11 @@ class Interaction(object):
raise
if form.action in kwargs["conv"].my_endpoints():
- return {"SAMLResponse": form["SAMLResponse"],
- "RelayState": form["RelayState"]}
+ return {"SAMLResponse": form["SAMLResponse"], "RelayState": form["RelayState"]}
return self.do_click(form, **kwargs)
- #noinspection PyUnusedLocal
+ # noinspection PyUnusedLocal
def chose(self, orig_response, path, **kwargs):
"""
Sends a HTTP GET to a url given by the present url and the given
@@ -316,7 +315,7 @@ class Interaction(object):
logger.info("GET %s", url)
return self.httpc.send(url, "GET")
- #return resp, ""
+ # return resp, ""
def post_form(self, orig_response, **kwargs):
"""
@@ -334,20 +333,19 @@ class Interaction(object):
return self.do_click(form, **kwargs)
- #noinspection PyUnusedLocal
+ # noinspection PyUnusedLocal
def parse(self, orig_response, **kwargs):
# content is a form from which I get the SAMLResponse
response = RResponse(orig_response)
form = self.pick_form(response, **kwargs)
- #form.backwards_compatible = False
+ # form.backwards_compatible = False
if not form:
raise InteractionNeeded("Can't pick a form !!")
- return {"SAMLResponse": form["SAMLResponse"],
- "RelayState": form["RelayState"]}
+ return {"SAMLResponse": form["SAMLResponse"], "RelayState": form["RelayState"]}
- #noinspection PyUnusedLocal
+ # noinspection PyUnusedLocal
def interaction(self, args):
_type = args["type"]
if _type == "form":
@@ -359,6 +357,7 @@ class Interaction(object):
else:
return NoneFunc
+
# ========================================================================
@@ -370,7 +369,7 @@ class Action(object):
def update(self, dic):
self.args.update(dic)
- #noinspection PyUnusedLocal
+ # noinspection PyUnusedLocal
def post_op(self, result, conv, args):
pass
diff --git a/src/saml2test/opfunc.py b/src/saml2test/opfunc.py
index 51c86ddb..09491739 100644
--- a/src/saml2test/opfunc.py
+++ b/src/saml2test/opfunc.py
@@ -1,14 +1,15 @@
-import logging
import json
-import six
-
-from urlparse import urlparse
+import logging
from mechanize import ParseResponseEx
-from mechanize._form import ControlNotFoundError, AmbiguityError
+from mechanize._form import AmbiguityError
+from mechanize._form import ControlNotFoundError
from mechanize._form import ListControl
+import six
+from urlparse import urlparse
+
-__author__ = 'rohe0002'
+__author__ = "rohe0002"
logger = logging.getLogger(__name__)
@@ -24,9 +25,9 @@ class FlowException(Exception):
return json.dumps(self.__dict__)
-class DResponse():
- """ A Response class that behaves in the way that mechanize expects it
- """
+class DResponse:
+ """A Response class that behaves in the way that mechanize expects it"""
+
def __init__(self, **kwargs):
self.status = 200 # default
self.index = 0
@@ -73,10 +74,10 @@ class DResponse():
if self._len == self.index:
part = None
elif self._len - self.index < size:
- part = self._message[self.index:]
+ part = self._message[self.index :]
self.index = self._len
else:
- part = self._message[self.index:self.index + size]
+ part = self._message[self.index : self.index + size]
self.index += size
return part
else:
@@ -113,8 +114,7 @@ def do_request(client, url, method, body="", headers=None):
logger.info("--> BODY: %s", body)
logger.info("--> Headers: %s", headers)
- response = client.http_request(url, method=method, data=body,
- headers=headers)
+ response = client.http_request(url, method=method, data=body, headers=headers)
logger.info("<-- RESPONSE: %s", response)
logger.info("<-- CONTENT: %s", response.text)
@@ -138,9 +138,9 @@ def pick_form(response, content, url=None, **kwargs):
if not forms:
raise FlowException(content=content, url=url)
- #if len(forms) == 1:
+ # if len(forms) == 1:
# return forms[0]
- #else:
+ # else:
_form = None
# ignore the first form for now
@@ -213,9 +213,9 @@ def do_click(client, form, **kwargs):
else:
_nr += 1
except ControlNotFoundError:
- raise Exception("No submit control with the name='%s' and "
- "value='%s' could be found" % (_name,
- _val))
+ raise Exception(
+ "No submit control with the name='%s' and " "value='%s' could be found" % (_name, _val)
+ )
else:
request = form.click()
@@ -251,7 +251,7 @@ def select_form(client, orig_response, content, **kwargs):
response.write(content)
form = pick_form(response, content, _url, **kwargs)
- #form.backwards_compatible = False
+ # form.backwards_compatible = False
if not form:
raise Exception("Can't pick a form !!")
@@ -276,7 +276,7 @@ def select_form(client, orig_response, content, **kwargs):
return do_click(client, form, **kwargs)
-#noinspection PyUnusedLocal
+# noinspection PyUnusedLocal
def chose(client, orig_response, content, path, **kwargs):
"""
Sends a HTTP GET to a url given by the present url and the given
@@ -335,6 +335,7 @@ def interaction(args):
else:
return NoneFunc
+
# ========================================================================
@@ -352,7 +353,7 @@ class Operation(object):
def update(self, dic):
self.args.update(dic)
- #noinspection PyUnusedLocal
+ # noinspection PyUnusedLocal
def post_op(self, result, environ, args):
pass
diff --git a/src/saml2test/status.py b/src/saml2test/status.py
index 4f5ba840..40f3a123 100644
--- a/src/saml2test/status.py
+++ b/src/saml2test/status.py
@@ -1,4 +1,4 @@
-__author__ = 'rolandh'
+__author__ = "rolandh"
INFORMATION = 0
OK = 1
@@ -7,5 +7,4 @@ ERROR = 3
CRITICAL = 4
INTERACTION = 5
-STATUSCODE = ["INFORMATION", "OK", "WARNING", "ERROR", "CRITICAL",
- "INTERACTION"]
+STATUSCODE = ["INFORMATION", "OK", "WARNING", "ERROR", "CRITICAL", "INTERACTION"]
diff --git a/src/saml2test/tool.py b/src/saml2test/tool.py
index da96c336..b373f608 100644
--- a/src/saml2test/tool.py
+++ b/src/saml2test/tool.py
@@ -1,21 +1,25 @@
-import cookielib
+import logging
import sys
import traceback
-import logging
-from urlparse import parse_qs
+
+import cookielib
import six
+from urlparse import parse_qs
-from saml2test.opfunc import Operation
-from saml2test import CheckError, FatalError
-from saml2test.check import ExpectedError, ERROR
-from saml2test.interaction import Interaction
+from saml2test import CheckError
+from saml2test import FatalError
+from saml2test import OperationError
+from saml2test.check import ERROR
+from saml2test.check import ExpectedError
from saml2test.interaction import Action
+from saml2test.interaction import Interaction
from saml2test.interaction import InteractionNeeded
-from saml2test.status import STATUSCODE
+from saml2test.opfunc import Operation
from saml2test.status import INTERACTION
-from saml2test import OperationError
+from saml2test.status import STATUSCODE
+
-__author__ = 'rolandh'
+__author__ = "rolandh"
logger = logging.getLogger(__name__)
@@ -26,9 +30,17 @@ class Conversation(object):
:ivar protocol_response: List of the received protocol messages
"""
- def __init__(self, client, config, interaction,
- check_factory=None, msg_factory=None,
- features=None, verbose=False, expect_exception=None):
+ def __init__(
+ self,
+ client,
+ config,
+ interaction,
+ check_factory=None,
+ msg_factory=None,
+ features=None,
+ verbose=False,
+ expect_exception=None,
+ ):
self.client = client
self.client_config = config
self.test_output = []
@@ -38,9 +50,7 @@ class Conversation(object):
self.msg_factory = msg_factory
self.expect_exception = expect_exception
- self.cjar = {"browser": cookielib.CookieJar(),
- "rp": cookielib.CookieJar(),
- "service": cookielib.CookieJar()}
+ self.cjar = {"browser": cookielib.CookieJar(), "rp": cookielib.CookieJar(), "service": cookielib.CookieJar()}
self.protocol_response = []
self.last_response = None
@@ -116,8 +126,7 @@ class Conversation(object):
else:
rdseq.append(url)
if len(rdseq) > 8:
- raise FatalError(
- "Too long sequence of redirects: %s" % rdseq)
+ raise FatalError("Too long sequence of redirects: %s" % rdseq)
logger.info("HTTP %d Location: %s", _response.status_code, url)
# If back to me
@@ -166,15 +175,13 @@ class Conversation(object):
_spec = self.interaction.pick_interaction(_base, content)
except InteractionNeeded:
self.position = url
- cnt = content.replace("\n", '').replace("\t", '').replace("\r",
- '')
+ cnt = content.replace("\n", "").replace("\t", "").replace("\r", "")
logger.error("URL: %s", url)
logger.error("Page Content: %s", cnt)
raise
except KeyError:
self.position = url
- cnt = content.replace("\n", '').replace("\t", '').replace("\r",
- '')
+ cnt = content.replace("\n", "").replace("\t", "").replace("\r", "")
logger.error("URL: %s", url)
logger.error("Page Content: %s", cnt)
self.err_check("interaction-needed")
@@ -183,11 +190,14 @@ class Conversation(object):
_same_actions += 1
if _same_actions >= 3:
self.test_output.append(
- {"status": ERROR,
- "message": "Interaction loop detection",
- #"id": "exception",
- #"name": "interaction needed",
- "url": self.position})
+ {
+ "status": ERROR,
+ "message": "Interaction loop detection",
+ # "id": "exception",
+ # "name": "interaction needed",
+ "url": self.position,
+ }
+ )
raise OperationError()
else:
_last_action = _spec
@@ -200,8 +210,7 @@ class Conversation(object):
_op = Action(_spec["control"])
try:
- _response = _op(self.client, self, url, _response, content,
- self.features)
+ _response = _op(self.client, self, url, _response, content, self.features)
if isinstance(_response, dict):
self.last_response = _response
self.last_content = _response
@@ -215,11 +224,14 @@ class Conversation(object):
txt = "Got status code '%s', error: %s"
logger.error(txt, _response.status_code, content)
self.test_output.append(
- {"status": ERROR,
- "message": txt % (_response.status_code, content),
- #"id": "exception",
- #"name": "interaction needed",
- "url": self.position})
+ {
+ "status": ERROR,
+ "message": txt % (_response.status_code, content),
+ # "id": "exception",
+ # "name": "interaction needed",
+ "url": self.position,
+ }
+ )
raise OperationError()
except (FatalError, InteractionNeeded, OperationError):
raise
@@ -289,18 +301,21 @@ class Conversation(object):
try:
self.do_query()
except InteractionNeeded:
- cnt = self.last_content.replace("\n", '').replace(
- "\t", '').replace("\r", '')
- self.test_output.append({"status": INTERACTION,
- "message": cnt,
- "id": "exception",
- "name": "interaction needed",
- "url": self.position})
+ cnt = self.last_content.replace("\n", "").replace("\t", "").replace("\r", "")
+ self.test_output.append(
+ {
+ "status": INTERACTION,
+ "message": cnt,
+ "id": "exception",
+ "name": "interaction needed",
+ "url": self.position,
+ }
+ )
break
except (FatalError, OperationError):
raise
except Exception as err:
- #self.err_check("exception", err)
+ # self.err_check("exception", err)
raise
try:
diff --git a/src/utility/metadata.py b/src/utility/metadata.py
index bf1c4a18..5ee15978 100644
--- a/src/utility/metadata.py
+++ b/src/utility/metadata.py
@@ -1,11 +1,16 @@
-import os.path, sys, time, urllib
-from time import strftime
import logging
+import os.path
+import sys
+import time
+from time import strftime
+import urllib
+
-__author__ = 'rhoerbe'
+__author__ = "rhoerbe"
logger = logging.getLogger(__name__)
+
def fetch_metadata(url, path, maxage=600):
"""
:param url: metadata remote location
@@ -19,18 +24,18 @@ def fetch_metadata(url, path, maxage=600):
logger.debug("metadata file %s not found", path)
elif (os.path.getmtime(path) + maxage) < time.time():
fetch = True
- logger.debug("metadata file %s from %s is more than %s s old",
- path,
- strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(path))),
- maxage)
+ logger.debug(
+ "metadata file %s from %s is more than %s s old",
+ path,
+ strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(path))),
+ maxage,
+ )
else:
logger.debug("metadata file %s is less than %s s old", path, maxage)
if fetch:
- f=urllib.URLopener()
+ f = urllib.URLopener()
try:
f.retrieve(url, path)
logger.debug("downloaded metadata from %s into %s", url, path)
except:
- logger.debug("downloaded metadata from %s failed: %s",
- url, sys.exc_info()[0])
-
+ logger.debug("downloaded metadata from %s failed: %s", url, sys.exc_info()[0])