Rebuilt
This commit is contained in:
@@ -1,260 +1,338 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2010 Umeå University
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Contains classes representing SAML Metadata Documentation and
|
||||
Registration Information Extensions
|
||||
"""
|
||||
#
|
||||
# Generated Mon Oct 25 16:19:28 2010 by parse_xsd.py version 0.4.
|
||||
#
|
||||
|
||||
import saml2
|
||||
from saml2 import SamlBase
|
||||
|
||||
NAMESPACE = "urn:oasis:names:tc:SAML:2.0:metadata:dri"
|
||||
from saml2 import md
|
||||
|
||||
#-----------------------------------------------
|
||||
# <element name=”CreationInstant” type=”datetime” />
|
||||
#-----------------------------------------------
|
||||
NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:metadata:dri'
|
||||
|
||||
class CreationInstant(SamlBase):
|
||||
"""The dri:CreationInstant element"""
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:CreationInstant element """
|
||||
|
||||
c_tag = 'CreationInstant'
|
||||
c_type = "datetime"
|
||||
c_namespace = NAMESPACE
|
||||
c_value_type = {'base': 'datetime'}
|
||||
c_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 creation_instant_from_string(xml_string):
|
||||
""" Create CreationInstant instance from an XML string """
|
||||
return saml2.create_class_from_xml_string(CreationInstant, xml_string)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# <element name=”SerialNumber” type=”string” />
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
class SerialNumber(SamlBase):
|
||||
"""The dri:SerialNumber element"""
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:SerialNumber element """
|
||||
|
||||
c_tag = 'SerialNumber'
|
||||
c_type = "string"
|
||||
c_namespace = NAMESPACE
|
||||
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 serial_number_instant_from_string(xml_string):
|
||||
""" Create SerialNumber instance from an XML string """
|
||||
def serial_number_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(SerialNumber, xml_string)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# <element name=”UsagePolicy” type=”anyURI” />
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
class UsagePolicy(SamlBase):
|
||||
"""The dri:UsagePolicy element"""
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:UsagePolicy element """
|
||||
|
||||
c_tag = 'UsagePolicy'
|
||||
c_type = "anyURI"
|
||||
c_namespace = NAMESPACE
|
||||
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 usage_policy_instant_from_string(xml_string):
|
||||
""" Create UsagePolicy instance from an XML string """
|
||||
def usage_policy_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(UsagePolicy, xml_string)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# <element name=”Publisher” type=”dri:PublisherType”/>
|
||||
# <complexType name=”PublisherType”>
|
||||
# <attribute name=”PublisherID” type=”md:entityIDType” use=”required” />
|
||||
# <attribute name=”CreationInstant” type=”datetime” />
|
||||
# <attribute name=”SerialNumber” type=”string”/>
|
||||
# </complexType>
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
class Publisher(SamlBase):
|
||||
"""The dri:Publisher element"""
|
||||
class PublisherType_(SamlBase):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:PublisherType element """
|
||||
|
||||
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,
|
||||
):
|
||||
SamlBase.__init__(self,
|
||||
text=text,
|
||||
extension_elements=extension_elements,
|
||||
extension_attributes=extension_attributes,
|
||||
)
|
||||
self.publisher_id=publisher_id
|
||||
self.creation_instant=creation_instant
|
||||
self.serial_number=serial_number
|
||||
|
||||
def publisher_type__from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(PublisherType_, xml_string)
|
||||
|
||||
|
||||
class RegistrationAuthority(md.EntityIDType_):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationAuthority element """
|
||||
|
||||
c_tag = 'RegistrationAuthority'
|
||||
c_namespace = NAMESPACE
|
||||
c_children = md.EntityIDType_.c_children.copy()
|
||||
c_attributes = md.EntityIDType_.c_attributes.copy()
|
||||
c_child_order = md.EntityIDType_.c_child_order[:]
|
||||
c_cardinality = md.EntityIDType_.c_cardinality.copy()
|
||||
|
||||
def registration_authority_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(RegistrationAuthority, xml_string)
|
||||
|
||||
|
||||
class RegistrationInstant(SamlBase):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationInstant element """
|
||||
|
||||
c_tag = 'RegistrationInstant'
|
||||
c_namespace = NAMESPACE
|
||||
c_value_type = {'base': 'datetime'}
|
||||
c_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 registration_instant_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(RegistrationInstant, xml_string)
|
||||
|
||||
|
||||
class RegistrationPolicy(SamlBase):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationPolicy element """
|
||||
|
||||
c_tag = 'RegistrationPolicy'
|
||||
c_namespace = NAMESPACE
|
||||
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 registration_policy_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(RegistrationPolicy, xml_string)
|
||||
|
||||
|
||||
class Publisher(PublisherType_):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:Publisher element """
|
||||
|
||||
c_tag = 'Publisher'
|
||||
c_type = "anyURI"
|
||||
c_children = SamlBase.c_children.copy()
|
||||
c_attributes = SamlBase.c_attributes.copy()
|
||||
# c_attributes['PublisherID'] = ('publisher_id', "md:entityIDType")
|
||||
c_attributes['PublisherID'] = 'publisher_id'
|
||||
c_attributes['CreationInstant'] = 'creation_instant'
|
||||
c_attributes['SerialNumber'] = 'serial_number'
|
||||
c_namespace = NAMESPACE
|
||||
c_children = PublisherType_.c_children.copy()
|
||||
c_attributes = PublisherType_.c_attributes.copy()
|
||||
c_child_order = PublisherType_.c_child_order[:]
|
||||
c_cardinality = PublisherType_.c_cardinality.copy()
|
||||
|
||||
def __init__(self, publisher_id=None, creation_instant=None,
|
||||
serial_number=None, text=None,
|
||||
extension_elements=None, extension_attributes=None):
|
||||
"""Constructor for Publisher
|
||||
|
||||
:param text: The text data in the this element
|
||||
:param extension_elements: A list of ExtensionElement instances
|
||||
:param extension_attributes: A dictionary of attribute value string
|
||||
pairs.
|
||||
"""
|
||||
SamlBase.__init__(self, text, extension_elements, extension_attributes)
|
||||
self.publisher_id = publisher_id
|
||||
self.creation_instant = creation_instant
|
||||
self.serial_number = serial_number
|
||||
|
||||
def publisher_instant_from_string(xml_string):
|
||||
""" Create Publisher instance from an XML string """
|
||||
def publisher_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(Publisher, xml_string)
|
||||
|
||||
#-----------------------------------------------
|
||||
#<element DocumentInfo type=”dri:DocumentInfoType” />
|
||||
#<complexType name=”DocumentInfoType”>
|
||||
# <sequence>
|
||||
# <element ref=”dri:CreationInstant” minOccurs=”0”/>
|
||||
# <element ref=”dri:SerialNumber” minOccurs=”0” />
|
||||
# <element ref=”dri:UsagePolicy” minOccurs=”0” />
|
||||
# <element ref=”dri:Publishers” minOccurs=”0” />
|
||||
# </sequence>
|
||||
#</complexType>
|
||||
|
||||
class DocumentInfo(SamlBase):
|
||||
"""The dri:DocumentInfo element"""
|
||||
class RegistrationInfoType_(SamlBase):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationInfoType element """
|
||||
|
||||
c_tag = 'DocumentInfo'
|
||||
c_type = "complex"
|
||||
c_tag = 'RegistrationInfoType'
|
||||
c_namespace = NAMESPACE
|
||||
c_children = SamlBase.c_children.copy()
|
||||
c_attributes = SamlBase.c_attributes.copy()
|
||||
c_children['{%s}CreationInstant' % NAMESPACE] = (
|
||||
'creation_instant', CreationInstant)
|
||||
c_children['{%s}SerialNumber' % NAMESPACE] = (
|
||||
'serial_number', SerialNumber)
|
||||
c_children['{%s}UsagePolicy' % NAMESPACE] = (
|
||||
'usage_policy', UsagePolicy)
|
||||
c_children['{%s}Publishers' % NAMESPACE] = (
|
||||
'publishers', Publishers)
|
||||
c_child_order = ["creation_instant", "serial_number",
|
||||
"usage_policy", "publishers"]
|
||||
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, creation_instant=None, serial_number=None,
|
||||
usage_policy=None, publishers=None, text=None,
|
||||
extension_elements=None, extension_attributes=None):
|
||||
"""Constructor for UsagePolicy, an extension point that allows
|
||||
applications to add new kinds of identifiers.
|
||||
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,
|
||||
)
|
||||
self.registration_authority=registration_authority
|
||||
self.registration_instant=registration_instant
|
||||
self.registration_policy=registration_policy
|
||||
|
||||
:param text: The text data in the this element
|
||||
:param extension_elements: A list of ExtensionElement instances
|
||||
:param extension_attributes: A dictionary of attribute value string
|
||||
pairs.
|
||||
"""
|
||||
SamlBase.__init__(self, text, extension_elements, extension_attributes)
|
||||
self.creation_instant = creation_instant
|
||||
self.serial_number = serial_number
|
||||
self.usage_policy = usage_policy
|
||||
self.publishers = publishers
|
||||
def registration_info_type__from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(RegistrationInfoType_, xml_string)
|
||||
|
||||
def document_info_instant_from_string(xml_string):
|
||||
""" Create DocumentInfo instance from an XML string """
|
||||
|
||||
class PublishersType_(SamlBase):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:PublishersType element """
|
||||
|
||||
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,
|
||||
):
|
||||
SamlBase.__init__(self,
|
||||
text=text,
|
||||
extension_elements=extension_elements,
|
||||
extension_attributes=extension_attributes,
|
||||
)
|
||||
self.publisher=publisher or []
|
||||
|
||||
def publishers_type__from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(PublishersType_, xml_string)
|
||||
|
||||
|
||||
class RegistrationInfo(RegistrationInfoType_):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:RegistrationInfo element """
|
||||
|
||||
c_tag = 'RegistrationInfo'
|
||||
c_namespace = NAMESPACE
|
||||
c_children = RegistrationInfoType_.c_children.copy()
|
||||
c_attributes = RegistrationInfoType_.c_attributes.copy()
|
||||
c_child_order = RegistrationInfoType_.c_child_order[:]
|
||||
c_cardinality = RegistrationInfoType_.c_cardinality.copy()
|
||||
|
||||
def registration_info_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(RegistrationInfo, xml_string)
|
||||
|
||||
|
||||
class Publishers(PublishersType_):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:Publishers element """
|
||||
|
||||
c_tag = 'Publishers'
|
||||
c_namespace = NAMESPACE
|
||||
c_children = PublishersType_.c_children.copy()
|
||||
c_attributes = PublishersType_.c_attributes.copy()
|
||||
c_child_order = PublishersType_.c_child_order[:]
|
||||
c_cardinality = PublishersType_.c_cardinality.copy()
|
||||
|
||||
def publishers_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(Publishers, xml_string)
|
||||
|
||||
|
||||
class DocumentInfoType_(SamlBase):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:DocumentInfoType element """
|
||||
|
||||
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,
|
||||
):
|
||||
SamlBase.__init__(self,
|
||||
text=text,
|
||||
extension_elements=extension_elements,
|
||||
extension_attributes=extension_attributes,
|
||||
)
|
||||
self.creation_instant=creation_instant
|
||||
self.serial_number=serial_number
|
||||
self.usage_policy=usage_policy
|
||||
self.publishers=publishers
|
||||
|
||||
def document_info_type__from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(DocumentInfoType_, xml_string)
|
||||
|
||||
|
||||
class DocumentInfo(DocumentInfoType_):
|
||||
"""The urn:oasis:names:tc:SAML:2.0:metadata:dri:DocumentInfo element """
|
||||
|
||||
c_tag = 'DocumentInfo'
|
||||
c_namespace = NAMESPACE
|
||||
c_children = DocumentInfoType_.c_children.copy()
|
||||
c_attributes = DocumentInfoType_.c_attributes.copy()
|
||||
c_child_order = DocumentInfoType_.c_child_order[:]
|
||||
c_cardinality = DocumentInfoType_.c_cardinality.copy()
|
||||
|
||||
def document_info_from_string(xml_string):
|
||||
return saml2.create_class_from_xml_string(DocumentInfo, xml_string)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# <element name=”RegistrationAuthority” type=”md:entityIDType” />
|
||||
# ---------------------------------------------------------------------------
|
||||
ELEMENT_FROM_STRING = {
|
||||
DocumentInfo.c_tag: document_info_from_string,
|
||||
DocumentInfoType_.c_tag: document_info_type__from_string,
|
||||
CreationInstant.c_tag: creation_instant_from_string,
|
||||
SerialNumber.c_tag: serial_number_from_string,
|
||||
UsagePolicy.c_tag: usage_policy_from_string,
|
||||
Publishers.c_tag: publishers_from_string,
|
||||
PublishersType_.c_tag: publishers_type__from_string,
|
||||
Publisher.c_tag: publisher_from_string,
|
||||
PublisherType_.c_tag: publisher_type__from_string,
|
||||
RegistrationInfo.c_tag: registration_info_from_string,
|
||||
RegistrationInfoType_.c_tag: registration_info_type__from_string,
|
||||
RegistrationAuthority.c_tag: registration_authority_from_string,
|
||||
RegistrationInstant.c_tag: registration_instant_from_string,
|
||||
RegistrationPolicy.c_tag: registration_policy_from_string,
|
||||
}
|
||||
|
||||
class RegistrationAuthority(SamlBase):
|
||||
"""The dri:RegistrationAuthority element"""
|
||||
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,
|
||||
}
|
||||
|
||||
c_tag = 'RegistrationAuthority'
|
||||
c_type = "md:entityIDType"
|
||||
c_children = SamlBase.c_children.copy()
|
||||
c_attributes = SamlBase.c_attributes.copy()
|
||||
|
||||
def registration_authority_instant_from_string(xml_string):
|
||||
""" Create RegistrationAuthority instance from an XML string """
|
||||
return saml2.create_class_from_xml_string(RegistrationAuthority, xml_string)
|
||||
def factory(tag, **kwargs):
|
||||
return ELEMENT_BY_TAG[tag](**kwargs)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# <element name=”RegistrationInstant” type=”datetime” />
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class RegistrationInstant(SamlBase):
|
||||
"""The dri:RegistrationInstant element"""
|
||||
|
||||
c_tag = 'RegistrationInstant'
|
||||
c_type = "datetime"
|
||||
c_children = SamlBase.c_children.copy()
|
||||
c_attributes = SamlBase.c_attributes.copy()
|
||||
|
||||
def registration_instant_instant_from_string(xml_string):
|
||||
""" Create RegistrationInstant instance from an XML string """
|
||||
return saml2.create_class_from_xml_string(RegistrationInstant, xml_string)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# <element name=”RegistrationPolicy” type=”anyURI” />
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class RegistrationPolicy(SamlBase):
|
||||
"""The dri:RegistrationPolicy element"""
|
||||
|
||||
c_tag = 'RegistrationPolicy'
|
||||
c_type = "anyURI"
|
||||
c_children = SamlBase.c_children.copy()
|
||||
c_attributes = SamlBase.c_attributes.copy()
|
||||
|
||||
def registration_policy_instant_from_string(xml_string):
|
||||
""" Create RegistrationPolicy instance from an XML string """
|
||||
return saml2.create_class_from_xml_string(RegistrationPolicy, xml_string)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# <element name=”RegistrationInfo” type=”dri:RegistrationInfoType” />
|
||||
# <complexType name=”RegistrationInfoType”>
|
||||
# <sequence>
|
||||
# <element ref=”dri:RegistrationAuthority” />
|
||||
# <element ref=”dri:RegistrationInstant” />
|
||||
# <element ref=”dri:RegistrationPolicy” minOccurs=”0” />
|
||||
# </sequence>
|
||||
# </complexType>
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class RegistrationInfo(SamlBase):
|
||||
"""The dri:RegistrationInfo element"""
|
||||
|
||||
c_tag = 'RegistrationInfo'
|
||||
c_type = "complex"
|
||||
c_children = SamlBase.c_children.copy()
|
||||
c_attributes = SamlBase.c_attributes.copy()
|
||||
c_children['{%s}RegistrationAuthority' % NAMESPACE] = (
|
||||
'registration_authority', RegistrationAuthority)
|
||||
c_children['{%s}RegistrationInstant' % NAMESPACE] = (
|
||||
'registration_instant', RegistrationInstant)
|
||||
c_children['{%s}RegistrationPolicy' % NAMESPACE] = (
|
||||
'registration_policy', RegistrationPolicy)
|
||||
c_child_order = ["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):
|
||||
"""Constructor for UsagePolicy, an extension point that allows
|
||||
applications to add new kinds of identifiers.
|
||||
|
||||
:param text: The text data in the this element
|
||||
:param extension_elements: A list of ExtensionElement instances
|
||||
:param extension_attributes: A dictionary of attribute value string
|
||||
pairs.
|
||||
"""
|
||||
SamlBase.__init__(self, text, extension_elements, extension_attributes)
|
||||
self.registration_authority = registration_authority
|
||||
self.registration_instant = registration_instant
|
||||
self.registration_policy = registration_policy
|
||||
|
||||
def registration_info_instant_from_string(xml_string):
|
||||
""" Create RegistrationInfo instance from an XML string """
|
||||
return saml2.create_class_from_xml_string(RegistrationInfo, xml_string)
|
||||
|
||||
Reference in New Issue
Block a user