Skip to content

test_namespace_processing fails with saml2.xml.schema.XMLSchemaError #1009

@bdrung

Description

@bdrung

The newly added test test_namespace_processing fails during Ubuntu package build:

=================================== FAILURES ===================================
__________________________ test_namespace_processing ___________________________

doc = '<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n            <saml2:Attribute Name="urn:mace:dir:attribute-def:uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">alum11</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="urn:mace:terena.org:attribute-def:schacHomeOrganization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:nil="true" xsi:type="xs:string" /></saml2:Attribute></saml2:AttributeStatement>'
validator = XMLSchema10(name='saml-schema-protocol-2.0.xsd', namespace='urn:oasis:names:tc:SAML:2.0:protocol')

    def validate(doc, validator=None):
        validator = _schema_validator_default if validator is None else validator
        try:
>           validator.validate(doc)

saml2/xml/schema/__init__.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3/dist-packages/xmlschema/validators/schemas.py:1335: in validate
    for error in self.iter_errors(source, path, schema_path, use_defaults,
/usr/lib/python3/dist-packages/xmlschema/validators/schemas.py:1458: in iter_errors
    xsd_element.raw_decode(elem, validation, context)
/usr/lib/python3/dist-packages/xmlschema/validators/elements.py:746: in raw_decode
    content = content_decoder.raw_decode(obj, validation, context)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/xmlschema/validators/groups.py:1036: in raw_decode
    result_item = xsd_element.raw_decode(child, validation, context)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/xmlschema/validators/elements.py:746: in raw_decode
    content = content_decoder.raw_decode(obj, validation, context)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/xmlschema/validators/groups.py:1005: in raw_decode
    self.check_dynamic_context(child, xsd_element, model.element, namespaces)
/usr/lib/python3/dist-packages/xmlschema/validators/groups.py:878: in check_dynamic_context
    xsd_type = self.maps.get_instance_type(
/usr/lib/python3/dist-packages/xmlschema/validators/xsd_globals.py:241: in get_instance_type
    xsi_type = self.types[extended_name]
               ^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = {'{http://www.w3.org/2001/XMLSchema}anyType': XsdComplexType(name='xs:anyType'), '{http://www.w3.org/2001/XMLSchema}anySimpleType': XsdSimpleType(name='anySimpleType'), '{http://www.w3.org/2001/XMLSchema}anyAtomicType': XsdAtomicRestriction(name='anyAtomicType'), '{http://www.w3.org/2001/XMLSchema}string': XsdAtomicBuiltin(name='xs:string'), '{http://www.w3.org/2001/XMLSchema}decimal': XsdAtomicBuiltin(name='xs:decimal'), '{http://www.w3.org/2001/XMLSchema}gDay': XsdAtomicBuiltin(name='xs:gDay'), '{http://www.w3.org/2001/XMLSchema}gMonth': XsdAtomicBuiltin(name='xs:gMonth'), '{http://www.w3.org/2001/XMLSchema}gMonthDay': XsdAtomicBuiltin(name='xs:gMonthDay'), '{http://www.w3.org/2001/XMLSchema}time': XsdAtomicBuiltin(name='xs:time'), '{http://www.w3.org/2001/XMLSchema}duration': XsdAtomicBuiltin(name='xs:duration'), '{http://www.w3.org/2001/XMLSchema}QName': XsdAtomicBuiltin(name='xs:QName'), '{http://www.w3.org/2001/XMLSchema}NOTATION': XsdAtomicBuiltin(name='xs:NOTATION'), '{http://www.w3.org/2001/XMLSchema}anyURI': XsdAtomicBuiltin(name='xs:anyURI'), '{http://www.w3.org/2001/XMLSchema}boolean': XsdAtomicBuiltin(name='xs:boolean'), '{http://www.w3.org/2001/XMLSchema}base64Binary': XsdAtomicBuiltin(name='xs:base64Binary'), '{http://www.w3.org/2001/XMLSchema}hexBinary': XsdAtomicBuiltin(name='xs:hexBinary'), '{http://www.w3.org/2001/XMLSchema}normalizedString': XsdAtomicBuiltin(name='xs:normalizedString'), '{http://www.w3.org/2001/XMLSchema}token': XsdAtomicBuiltin(name='xs:token'), '{http://www.w3.org/2001/XMLSchema}language': XsdAtomicBuiltin(name='xs:language'), '{http://www.w3.org/2001/XMLSchema}Name': XsdAtomicBuiltin(name='xs:Name'), '{http://www.w3.org/2001/XMLSchema}NCName': XsdAtomicBuiltin(name='xs:NCName'), '{http://www.w3.org/2001/XMLSchema}ID': XsdAtomicBuiltin(name='xs:ID'), '{http://www.w3.org/2001/XMLSchema}IDREF': XsdAtomicBuiltin(name='xs:IDREF'), '{http://www.w3.org/2001/XMLSchema}ENTITY': XsdAtomicBuiltin(name='xs:ENTITY'), '{http://www.w3.org/2001/XMLSchema}NMTOKEN': XsdAtomicBuiltin(name='xs:NMTOKEN'), '{http://www.w3.org/2001/XMLSchema}integer': XsdAtomicBuiltin(name='xs:integer'), '{http://www.w3.org/2001/XMLSchema}long': XsdAtomicBuiltin(name='xs:long'), '{http://www.w3.org/2001/XMLSchema}int': XsdAtomicBuiltin(name='xs:int'), '{http://www.w3.org/2001/XMLSchema}short': XsdAtomicBuiltin(name='xs:short'), '{http://www.w3.org/2001/XMLSchema}byte': XsdAtomicBuiltin(name='xs:byte'), '{http://www.w3.org/2001/XMLSchema}nonNegativeInteger': XsdAtomicBuiltin(name='xs:nonNegativeInteger'), '{http://www.w3.org/2001/XMLSchema}positiveInteger': XsdAtomicBuiltin(name='xs:positiveInteger'), '{http://www.w3.org/2001/XMLSchema}unsignedLong': XsdAtomicBuiltin(name='xs:unsignedLong'), '{http://www.w3.org/2001/XMLSchema}unsignedInt': XsdAtomicBuiltin(name='xs:unsignedInt'), '{http://www.w3.org/2001/XMLSchema}unsignedShort': XsdAtomicBuiltin(name='xs:unsignedShort'), '{http://www.w3.org/2001/XMLSchema}unsignedByte': XsdAtomicBuiltin(name='xs:unsignedByte'), '{http://www.w3.org/2001/XMLSchema}nonPositiveInteger': XsdAtomicBuiltin(name='xs:nonPositiveInteger'), '{http://www.w3.org/2001/XMLSchema}negativeInteger': XsdAtomicBuiltin(name='xs:negativeInteger'), '{http://www.w3.org/2001/XMLSchema}double': XsdAtomicBuiltin(name='xs:double'), '{http://www.w3.org/2001/XMLSchema}float': XsdAtomicBuiltin(name='xs:float'), '{http://www.w3.org/2001/XMLSchema}dateTime': XsdAtomicBuiltin(name='xs:dateTime'), '{http://www.w3.org/2001/XMLSchema}date': XsdAtomicBuiltin(name='xs:date'), '{http://www.w3.org/2001/XMLSchema}gYear': XsdAtomicBuiltin(name='xs:gYear'), '{http://www.w3.org/2001/XMLSchema}gYearMonth': XsdAtomicBuiltin(name='xs:gYearMonth'), '{http://schemas.xmlsoap.org/soap/envelope/}encodingStyle': XsdList(name='tns:encodingStyle'), '{http://www.w3.org/2001/XMLSchema}allNNI': XsdUnion(name='xs:allNNI'), '{http://www.w3.org/2001/XMLSchema}openAttrs': XsdComplexType(name='xs:openAttrs'), '{http://www.w3.org/2001/XMLSchema}annotated': XsdComplexType(name='xs:annotated'), '{http://www.w3.org/2001/XMLSchema}formChoice': XsdAtomicRestriction(name='xs:formChoice'), '{http://www.w3.org/2001/XMLSchema}derivationControl': XsdAtomicRestriction(name='xs:derivationControl'), '{http://www.w3.org/2001/XMLSchema}reducedDerivationControl': XsdAtomicRestriction(name='xs:reducedDerivationControl'), '{http://www.w3.org/2001/XMLSchema}derivationSet': XsdUnion(name='xs:derivationSet'), '{http://www.w3.org/2001/XMLSchema}typeDerivationControl': XsdAtomicRestriction(name='xs:typeDerivationControl'), '{http://www.w3.org/2001/XMLSchema}fullDerivationSet': XsdUnion(name='xs:fullDerivationSet'), '{http://www.w3.org/2001/XMLSchema}attribute': XsdComplexType(name='xs:attribute'), '{http://www.w3.org/2001/XMLSchema}topLevelAttribute': XsdComplexType(name='xs:topLevelAttribute'), '{http://www.w3.org/2001/XMLSchema}complexType': XsdComplexType(name='xs:complexType'), '{http://www.w3.org/2001/XMLSchema}topLevelComplexType': XsdComplexType(name='xs:topLevelComplexType'), '{http://www.w3.org/2001/XMLSchema}localComplexType': XsdComplexType(name='xs:localComplexType'), '{http://www.w3.org/2001/XMLSchema}restrictionType': XsdComplexType(name='xs:restrictionType'), '{http://www.w3.org/2001/XMLSchema}complexRestrictionType': XsdComplexType(name='xs:complexRestrictionType'), '{http://www.w3.org/2001/XMLSchema}extensionType': XsdComplexType(name='xs:extensionType'), '{http://www.w3.org/2001/XMLSchema}simpleRestrictionType': XsdComplexType(name='xs:simpleRestrictionType'), '{http://www.w3.org/2001/XMLSchema}simpleExtensionType': XsdComplexType(name='xs:simpleExtensionType'), '{http://www.w3.org/2001/XMLSchema}blockSet': XsdUnion(name='xs:blockSet'), '{http://www.w3.org/2001/XMLSchema}element': XsdComplexType(name='xs:element'), '{http://www.w3.org/2001/XMLSchema}topLevelElement': XsdComplexType(name='xs:topLevelElement'), '{http://www.w3.org/2001/XMLSchema}localElement': XsdComplexType(name='xs:localElement'), '{http://www.w3.org/2001/XMLSchema}group': XsdComplexType(name='xs:group'), '{http://www.w3.org/2001/XMLSchema}realGroup': XsdComplexType(name='xs:realGroup'), '{http://www.w3.org/2001/XMLSchema}namedGroup': XsdComplexType(name='xs:namedGroup'), '{http://www.w3.org/2001/XMLSchema}groupRef': XsdComplexType(name='xs:groupRef'), '{http://www.w3.org/2001/XMLSchema}explicitGroup': XsdComplexType(name='xs:explicitGroup'), '{http://www.w3.org/2001/XMLSchema}simpleExplicitGroup': XsdComplexType(name='xs:simpleExplicitGroup'), '{http://www.w3.org/2001/XMLSchema}narrowMaxMin': XsdComplexType(name='xs:narrowMaxMin'), '{http://www.w3.org/2001/XMLSchema}all': XsdComplexType(name='xs:all'), '{http://www.w3.org/2001/XMLSchema}namespaceList': XsdUnion(name='xs:namespaceList'), '{http://www.w3.org/2001/XMLSchema}wildcard': XsdComplexType(name='xs:wildcard'), '{http://www.w3.org/2001/XMLSchema}attributeGroup': XsdComplexType(name='xs:attributeGroup'), '{http://www.w3.org/2001/XMLSchema}namedAttributeGroup': XsdComplexType(name='xs:namedAttributeGroup'), '{http://www.w3.org/2001/XMLSchema}attributeGroupRef': XsdComplexType(name='xs:attributeGroupRef'), '{http://www.w3.org/2001/XMLSchema}keybase': XsdComplexType(name='xs:keybase'), '{http://www.w3.org/2001/XMLSchema}public': XsdAtomicRestriction(name='xs:public'), '{http://www.w3.org/2001/XMLSchema}IDREFS': XsdAtomicRestriction(name='xs:IDREFS'), '{http://www.w3.org/2001/XMLSchema}ENTITIES': XsdAtomicRestriction(name='xs:ENTITIES'), '{http://www.w3.org/2001/XMLSchema}NMTOKENS': XsdAtomicRestriction(name='xs:NMTOKENS'), '{http://www.w3.org/2001/XMLSchema}simpleDerivationSet': XsdUnion(name='xs:simpleDerivationSet'), '{http://www.w3.org/2001/XMLSchema}simpleType': XsdComplexType(name='xs:simpleType'), '{http://www.w3.org/2001/XMLSchema}topLevelSimpleType': XsdComplexType(name='xs:topLevelSimpleType'), '{http://www.w3.org/2001/XMLSchema}localSimpleType': XsdComplexType(name='xs:localSimpleType'), '{http://www.w3.org/2001/XMLSchema}facet': XsdComplexType(name='xs:facet'), '{http://www.w3.org/2001/XMLSchema}noFixedFacet': XsdComplexType(name='xs:noFixedFacet'), '{http://www.w3.org/2001/XMLSchema}numFacet': XsdComplexType(name='xs:numFacet'), '{urn:oasis:names:tc:SAML:2.0:protocol}RequestAbstractType': XsdComplexType(name='samlp:RequestAbstractType'), '{urn:oasis:names:tc:SAML:2.0:protocol}ExtensionsType': XsdComplexType(name='samlp:ExtensionsType'), '{urn:oasis:names:tc:SAML:2.0:protocol}StatusResponseType': XsdComplexType(name='samlp:StatusResponseType'), '{urn:oasis:names:tc:SAML:2.0:protocol}StatusType': XsdComplexType(name='samlp:StatusType'), '{urn:oasis:names:tc:SAML:2.0:protocol}StatusCodeType': XsdComplexType(name='samlp:StatusCodeType'), '{urn:oasis:names:tc:SAML:2.0:protocol}StatusDetailType': XsdComplexType(name='samlp:StatusDetailType'), '{urn:oasis:names:tc:SAML:2.0:protocol}AssertionIDRequestType': XsdComplexType(name='samlp:AssertionIDRequestType'), '{urn:oasis:names:tc:SAML:2.0:protocol}SubjectQueryAbstractType': XsdComplexType(name='samlp:SubjectQueryAbstractType'), '{urn:oasis:names:tc:SAML:2.0:protocol}AuthnQueryType': XsdComplexType(name='samlp:AuthnQueryType'), '{urn:oasis:names:tc:SAML:2.0:protocol}AuthnContextComparisonType': XsdAtomicRestriction(name='samlp:AuthnContextComparisonType'), '{urn:oasis:names:tc:SAML:2.0:protocol}RequestedAuthnContextType': XsdComplexType(name='samlp:RequestedAuthnContextType'), '{urn:oasis:names:tc:SAML:2.0:protocol}AttributeQueryType': XsdComplexType(name='samlp:AttributeQueryType'), '{urn:oasis:names:tc:SAML:2.0:protocol}AuthzDecisionQueryType': XsdComplexType(name='samlp:AuthzDecisionQueryType'), '{urn:oasis:names:tc:SAML:2.0:protocol}AuthnRequestType': XsdComplexType(name='samlp:AuthnRequestType'), '{urn:oasis:names:tc:SAML:2.0:protocol}NameIDPolicyType': XsdComplexType(name='samlp:NameIDPolicyType'), '{urn:oasis:names:tc:SAML:2.0:protocol}ScopingType': XsdComplexType(name='samlp:ScopingType'), '{urn:oasis:names:tc:SAML:2.0:protocol}IDPListType': XsdComplexType(name='samlp:IDPListType'), '{urn:oasis:names:tc:SAML:2.0:protocol}IDPEntryType': XsdComplexType(name='samlp:IDPEntryType'), '{urn:oasis:names:tc:SAML:2.0:protocol}ResponseType': XsdComplexType(name='samlp:ResponseType'), '{urn:oasis:names:tc:SAML:2.0:protocol}ArtifactResolveType': XsdComplexType(name='samlp:ArtifactResolveType'), '{urn:oasis:names:tc:SAML:2.0:protocol}ArtifactResponseType': XsdComplexType(name='samlp:ArtifactResponseType'), '{urn:oasis:names:tc:SAML:2.0:protocol}ManageNameIDRequestType': XsdComplexType(name='samlp:ManageNameIDRequestType'), '{urn:oasis:names:tc:SAML:2.0:protocol}TerminateType': XsdComplexType(name='samlp:TerminateType'), '{urn:oasis:names:tc:SAML:2.0:protocol}LogoutRequestType': XsdComplexType(name='samlp:LogoutRequestType'), '{urn:oasis:names:tc:SAML:2.0:protocol}NameIDMappingRequestType': XsdComplexType(name='samlp:NameIDMappingRequestType'), '{urn:oasis:names:tc:SAML:2.0:protocol}NameIDMappingResponseType': XsdComplexType(name='samlp:NameIDMappingResponseType'), '{urn:oasis:names:tc:SAML:2.0:assertion}BaseIDAbstractType': XsdComplexType(name='saml:BaseIDAbstractType'), '{urn:oasis:names:tc:SAML:2.0:assertion}NameIDType': XsdComplexType(name='saml:NameIDType'), '{urn:oasis:names:tc:SAML:2.0:assertion}EncryptedElementType': XsdComplexType(name='saml:EncryptedElementType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AssertionType': XsdComplexType(name='saml:AssertionType'), '{urn:oasis:names:tc:SAML:2.0:assertion}SubjectType': XsdComplexType(name='saml:SubjectType'), '{urn:oasis:names:tc:SAML:2.0:assertion}SubjectConfirmationType': XsdComplexType(name='saml:SubjectConfirmationType'), '{urn:oasis:names:tc:SAML:2.0:assertion}SubjectConfirmationDataType': XsdComplexType(name='saml:SubjectConfirmationDataType'), '{urn:oasis:names:tc:SAML:2.0:assertion}KeyInfoConfirmationDataType': XsdComplexType(name='saml:KeyInfoConfirmationDataType'), '{urn:oasis:names:tc:SAML:2.0:assertion}ConditionsType': XsdComplexType(name='saml:ConditionsType'), '{urn:oasis:names:tc:SAML:2.0:assertion}ConditionAbstractType': XsdComplexType(name='saml:ConditionAbstractType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AudienceRestrictionType': XsdComplexType(name='saml:AudienceRestrictionType'), '{urn:oasis:names:tc:SAML:2.0:assertion}OneTimeUseType': XsdComplexType(name='saml:OneTimeUseType'), '{urn:oasis:names:tc:SAML:2.0:assertion}ProxyRestrictionType': XsdComplexType(name='saml:ProxyRestrictionType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AdviceType': XsdComplexType(name='saml:AdviceType'), '{urn:oasis:names:tc:SAML:2.0:assertion}StatementAbstractType': XsdComplexType(name='saml:StatementAbstractType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AuthnStatementType': XsdComplexType(name='saml:AuthnStatementType'), '{urn:oasis:names:tc:SAML:2.0:assertion}SubjectLocalityType': XsdComplexType(name='saml:SubjectLocalityType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AuthnContextType': XsdComplexType(name='saml:AuthnContextType'), '{urn:oasis:names:tc:SAML:2.0:assertion}DecisionType': XsdAtomicRestriction(name='saml:DecisionType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AuthzDecisionStatementType': XsdComplexType(name='saml:AuthzDecisionStatementType'), '{urn:oasis:names:tc:SAML:2.0:assertion}ActionType': XsdComplexType(name='saml:ActionType'), '{urn:oasis:names:tc:SAML:2.0:assertion}EvidenceType': XsdComplexType(name='saml:EvidenceType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AttributeStatementType': XsdComplexType(name='saml:AttributeStatementType'), '{urn:oasis:names:tc:SAML:2.0:assertion}AttributeType': XsdComplexType(name='saml:AttributeType'), '{http://www.w3.org/2000/09/xmldsig#}CryptoBinary': XsdAtomicRestriction(name='ds:CryptoBinary'), '{http://www.w3.org/2000/09/xmldsig#}SignatureType': XsdComplexType(name='ds:SignatureType'), '{http://www.w3.org/2000/09/xmldsig#}SignatureValueType': XsdComplexType(name='ds:SignatureValueType'), '{http://www.w3.org/2000/09/xmldsig#}SignedInfoType': XsdComplexType(name='ds:SignedInfoType'), '{http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethodType': XsdComplexType(name='ds:CanonicalizationMethodType'), '{http://www.w3.org/2000/09/xmldsig#}SignatureMethodType': XsdComplexType(name='ds:SignatureMethodType'), '{http://www.w3.org/2000/09/xmldsig#}ReferenceType': XsdComplexType(name='ds:ReferenceType'), '{http://www.w3.org/2000/09/xmldsig#}TransformsType': XsdComplexType(name='ds:TransformsType'), '{http://www.w3.org/2000/09/xmldsig#}TransformType': XsdComplexType(name='ds:TransformType'), '{http://www.w3.org/2000/09/xmldsig#}DigestMethodType': XsdComplexType(name='ds:DigestMethodType'), '{http://www.w3.org/2000/09/xmldsig#}DigestValueType': XsdAtomicRestriction(name='ds:DigestValueType'), '{http://www.w3.org/2000/09/xmldsig#}KeyInfoType': XsdComplexType(name='ds:KeyInfoType'), '{http://www.w3.org/2000/09/xmldsig#}KeyValueType': XsdComplexType(name='ds:KeyValueType'), '{http://www.w3.org/2000/09/xmldsig#}RetrievalMethodType': XsdComplexType(name='ds:RetrievalMethodType'), '{http://www.w3.org/2000/09/xmldsig#}X509DataType': XsdComplexType(name='ds:X509DataType'), '{http://www.w3.org/2000/09/xmldsig#}X509IssuerSerialType': XsdComplexType(name='ds:X509IssuerSerialType'), '{http://www.w3.org/2000/09/xmldsig#}PGPDataType': XsdComplexType(name='ds:PGPDataType'), '{http://www.w3.org/2000/09/xmldsig#}SPKIDataType': XsdComplexType(name='ds:SPKIDataType'), '{http://www.w3.org/2000/09/xmldsig#}ObjectType': XsdComplexType(name='ds:ObjectType'), '{http://www.w3.org/2000/09/xmldsig#}ManifestType': XsdComplexType(name='ds:ManifestType'), '{http://www.w3.org/2000/09/xmldsig#}SignaturePropertiesType': XsdComplexType(name='ds:SignaturePropertiesType'), '{http://www.w3.org/2000/09/xmldsig#}SignaturePropertyType': XsdComplexType(name='ds:SignaturePropertyType'), '{http://www.w3.org/2000/09/xmldsig#}HMACOutputLengthType': XsdAtomicRestriction(name='ds:HMACOutputLengthType'), '{http://www.w3.org/2000/09/xmldsig#}DSAKeyValueType': XsdComplexType(name='ds:DSAKeyValueType'), '{http://www.w3.org/2000/09/xmldsig#}RSAKeyValueType': XsdComplexType(name='ds:RSAKeyValueType'), '{http://www.w3.org/2001/04/xmlenc#}EncryptedType': XsdComplexType(name='xenc:EncryptedType'), '{http://www.w3.org/2001/04/xmlenc#}EncryptionMethodType': XsdComplexType(name='xenc:EncryptionMethodType'), '{http://www.w3.org/2001/04/xmlenc#}KeySizeType': XsdAtomicRestriction(name='xenc:KeySizeType'), '{http://www.w3.org/2001/04/xmlenc#}CipherDataType': XsdComplexType(name='xenc:CipherDataType'), '{http://www.w3.org/2001/04/xmlenc#}CipherReferenceType': XsdComplexType(name='xenc:CipherReferenceType'), '{http://www.w3.org/2001/04/xmlenc#}TransformsType': XsdComplexType(name='xenc:TransformsType'), '{http://www.w3.org/2001/04/xmlenc#}EncryptedDataType': XsdComplexType(name='xenc:EncryptedDataType'), '{http://www.w3.org/2001/04/xmlenc#}EncryptedKeyType': XsdComplexType(name='xenc:EncryptedKeyType'), '{http://www.w3.org/2001/04/xmlenc#}AgreementMethodType': XsdComplexType(name='xenc:AgreementMethodType'), '{http://www.w3.org/2001/04/xmlenc#}ReferenceType': XsdComplexType(name='xenc:ReferenceType'), '{http://www.w3.org/2001/04/xmlenc#}EncryptionPropertiesType': XsdComplexType(name='xenc:EncryptionPropertiesType'), '{http://www.w3.org/2001/04/xmlenc#}EncryptionPropertyType': XsdComplexType(name='xenc:EncryptionPropertyType'), '{http://schemas.xmlsoap.org/soap/envelope/}Envelope': XsdComplexType(name='tns:Envelope'), '{http://schemas.xmlsoap.org/soap/envelope/}Header': XsdComplexType(name='tns:Header'), '{http://schemas.xmlsoap.org/soap/envelope/}Body': XsdComplexType(name='tns:Body'), '{http://schemas.xmlsoap.org/soap/envelope/}Fault': XsdComplexType(name='tns:Fault'), '{http://schemas.xmlsoap.org/soap/envelope/}detail': XsdComplexType(name='tns:detail'), '{http://www.w3.org/2009/xmlenc11#}ConcatKDFParamsType': XsdComplexType(name='xenc11:ConcatKDFParamsType'), '{http://www.w3.org/2009/xmlenc11#}DerivedKeyType': XsdComplexType(name='xenc11:DerivedKeyType'), '{http://www.w3.org/2009/xmlenc11#}KeyDerivationMethodType': XsdComplexType(name='xenc11:KeyDerivationMethodType'), '{http://www.w3.org/2009/xmlenc11#}AlgorithmIdentifierType': XsdComplexType(name='xenc11:AlgorithmIdentifierType'), '{http://www.w3.org/2009/xmlenc11#}PRFAlgorithmIdentifierType': XsdComplexType(name='xenc11:PRFAlgorithmIdentifierType'), '{http://www.w3.org/2009/xmlenc11#}PBKDF2ParameterType': XsdComplexType(name='xenc11:PBKDF2ParameterType'), '{http://www.w3.org/2009/xmlenc11#}MGFType': XsdComplexType(name='xenc11:MGFType'), '{urn:oasis:names:tc:SAML:2.0:metadata}entityIDType': XsdAtomicRestriction(name='md:entityIDType'), '{urn:oasis:names:tc:SAML:2.0:metadata}localizedNameType': XsdComplexType(name='md:localizedNameType'), '{urn:oasis:names:tc:SAML:2.0:metadata}localizedURIType': XsdComplexType(name='md:localizedURIType'), '{urn:oasis:names:tc:SAML:2.0:metadata}ExtensionsType': XsdComplexType(name='md:ExtensionsType'), '{urn:oasis:names:tc:SAML:2.0:metadata}EndpointType': XsdComplexType(name='md:EndpointType'), '{urn:oasis:names:tc:SAML:2.0:metadata}IndexedEndpointType': XsdComplexType(name='md:IndexedEndpointType'), '{urn:oasis:names:tc:SAML:2.0:metadata}EntitiesDescriptorType': XsdComplexType(name='md:EntitiesDescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}EntityDescriptorType': XsdComplexType(name='md:EntityDescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}OrganizationType': XsdComplexType(name='md:OrganizationType'), '{urn:oasis:names:tc:SAML:2.0:metadata}ContactTypeType': XsdAtomicRestriction(name='md:ContactTypeType'), '{urn:oasis:names:tc:SAML:2.0:metadata}ContactType': XsdComplexType(name='md:ContactType'), '{urn:oasis:names:tc:SAML:2.0:metadata}AdditionalMetadataLocationType': XsdComplexType(name='md:AdditionalMetadataLocationType'), '{urn:oasis:names:tc:SAML:2.0:metadata}anyURIListType': XsdList(name='md:anyURIListType'), '{urn:oasis:names:tc:SAML:2.0:metadata}RoleDescriptorType': XsdComplexType(name='md:RoleDescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}KeyTypes': XsdAtomicRestriction(name='md:KeyTypes'), '{urn:oasis:names:tc:SAML:2.0:metadata}KeyDescriptorType': XsdComplexType(name='md:KeyDescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}SSODescriptorType': XsdComplexType(name='md:SSODescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}IDPSSODescriptorType': XsdComplexType(name='md:IDPSSODescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptorType': XsdComplexType(name='md:SPSSODescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}AttributeConsumingServiceType': XsdComplexType(name='md:AttributeConsumingServiceType'), '{urn:oasis:names:tc:SAML:2.0:metadata}RequestedAttributeType': XsdComplexType(name='md:RequestedAttributeType'), '{urn:oasis:names:tc:SAML:2.0:metadata}AuthnAuthorityDescriptorType': XsdComplexType(name='md:AuthnAuthorityDescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}PDPDescriptorType': XsdComplexType(name='md:PDPDescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}AttributeAuthorityDescriptorType': XsdComplexType(name='md:AttributeAuthorityDescriptorType'), '{urn:oasis:names:tc:SAML:2.0:metadata}AffiliationDescriptorType': XsdComplexType(name='md:AffiliationDescriptorType'), '{http://eidas.europa.eu/metadata/servicelist}MetadataServiceListType': XsdComplexType(name='ser:MetadataServiceListType'), '{http://eidas.europa.eu/metadata/servicelist}SchemeInformationType': XsdComplexType(name='ser:SchemeInformationType'), '{http://eidas.europa.eu/metadata/servicelist}MetadataSchemeEndpointListType': XsdComplexType(name='ser:MetadataSchemeEndpointListType'), '{http://eidas.europa.eu/metadata/servicelist}DistributionPointsType': XsdComplexType(name='ser:DistributionPointsType'), '{http://eidas.europa.eu/metadata/servicelist}MetadataLocationType': XsdComplexType(name='ser:MetadataLocationType'), '{http://eidas.europa.eu/metadata/servicelist}MsEndpointType': XsdComplexType(name='ser:MsEndpointType'), '{http://eidas.europa.eu/saml-extensions}SPTypeType': XsdAtomicRestriction(name='eidas:SPTypeType'), '{http://eidas.europa.eu/saml-extensions}NodeCountryType': XsdAtomicRestriction(name='eidas:NodeCountryType'), '{http://eidas.europa.eu/saml-extensions}RequestedAttributesType': XsdComplexType(name='eidas:RequestedAttributesType'), '{http://eidas.europa.eu/saml-extensions}RequestedAttributeType': XsdComplexType(name='eidas:RequestedAttributeType'), '{http://eidas.europa.eu/attributes/naturalperson}PersonIdentifierType': XsdAtomicRestriction(name='PersonIdentifierType'), '{http://eidas.europa.eu/attributes/naturalperson}CurrentFamilyNameType': XsdComplexType(name='CurrentFamilyNameType'), '{http://eidas.europa.eu/attributes/naturalperson}CurrentGivenNameType': XsdComplexType(name='CurrentGivenNameType'), '{http://eidas.europa.eu/attributes/naturalperson}DateOfBirthType': XsdAtomicRestriction(name='DateOfBirthType'), '{http://eidas.europa.eu/attributes/naturalperson}CurrentAddressStructuredType': XsdComplexType(name='CurrentAddressStructuredType'), '{http://eidas.europa.eu/attributes/naturalperson}CurrentAddressType': XsdAtomicRestriction(name='CurrentAddressType'), '{http://eidas.europa.eu/attributes/naturalperson}GenderType': XsdAtomicRestriction(name='GenderType'), '{http://eidas.europa.eu/attributes/naturalperson}BirthNameType': XsdComplexType(name='BirthNameType'), '{http://eidas.europa.eu/attributes/naturalperson}PlaceOfBirthType': XsdComplexType(name='PlaceOfBirthType'), '{http://eidas.europa.eu/attributes/legalperson}LegalPersonIdentifierType': XsdAtomicRestriction(name='LegalPersonIdentifierType'), '{http://eidas.europa.eu/attributes/legalperson}LegalNameType': XsdComplexType(name='LegalNameType'), '{http://eidas.europa.eu/attributes/legalperson}LegalPersonAddressStructuredType': XsdComplexType(name='LegalPersonAddressStructuredType'), '{http://eidas.europa.eu/attributes/legalperson}LegalPersonAddressType': XsdAtomicRestriction(name='LegalPersonAddressType'), '{http://eidas.europa.eu/attributes/legalperson}VATRegistrationNumberType': XsdAtomicRestriction(name='VATRegistrationNumberType'), '{http://eidas.europa.eu/attributes/legalperson}TaxReferenceType': XsdAtomicRestriction(name='TaxReferenceType'), '{http://eidas.europa.eu/attributes/legalperson}D-2012-17-EUIdentifierType': XsdAtomicRestriction(name='D-2012-17-EUIdentifierType'), '{http://eidas.europa.eu/attributes/legalperson}LEIType': XsdAtomicRestriction(name='LEIType'), '{http://eidas.europa.eu/attributes/legalperson}EORIType': XsdAtomicRestriction(name='EORIType'), '{http://eidas.europa.eu/attributes/legalperson}SEEDType': XsdAtomicRestriction(name='SEEDType'), '{http://eidas.europa.eu/attributes/legalperson}SICType': XsdAtomicRestriction(name='SICType')}
qname = 'xs:string'

    def __getitem__(self, qname: str) -> CT:
        try:
            return self._store[qname]
        except KeyError:
            if qname in self._staging:
                return self._build_global(qname)
    
            msg = _('global {} {!r} not found').format(self.label, qname)
>           raise XMLSchemaKeyError(msg) from None
E           xmlschema.exceptions.XMLSchemaKeyError: "global component 'xs:string' not found"

/usr/lib/python3/dist-packages/xmlschema/validators/builders.py:394: XMLSchemaKeyError

The above exception was the direct cause of the following exception:

    def test_namespace_processing():
        elem = create_class_from_xml_string(
            AttributeStatement,
            """
            <saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
                <saml:Attribute Name="urn:mace:dir:attribute-def:uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                    <saml:AttributeValue xsi:type="xs:string">alum11</saml:AttributeValue>
                </saml:Attribute>
                <saml:Attribute Name="urn:mace:terena.org:attribute-def:schacHomeOrganization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                    <saml:AttributeValue xsi:type="xs:string"/>
                </saml:Attribute>
            </saml:AttributeStatement>
            """,
        )
>       validate_doc_with_schema(str(elem))

tests/test_schema_validator.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

doc = '<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n            <saml2:Attribute Name="urn:mace:dir:attribute-def:uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">alum11</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="urn:mace:terena.org:attribute-def:schacHomeOrganization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:nil="true" xsi:type="xs:string" /></saml2:Attribute></saml2:AttributeStatement>'
validator = XMLSchema10(name='saml-schema-protocol-2.0.xsd', namespace='urn:oasis:names:tc:SAML:2.0:protocol')

    def validate(doc, validator=None):
        validator = _schema_validator_default if validator is None else validator
        try:
            validator.validate(doc)
        except _XMLSchemaException as e:
            error_context = {
                "doc": doc,
                "error": str(e),
            }
>           raise XMLSchemaError(error_context) from e
E           saml2.xml.schema.XMLSchemaError: {'doc': '<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n            <saml2:Attribute Name="urn:mace:dir:attribute-def:uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">alum11</saml2:AttributeValue></saml2:Attribute><saml2:Attribute Name="urn:mace:terena.org:attribute-def:schacHomeOrganization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">\n                <saml2:AttributeValue xsi:nil="true" xsi:type="xs:string" /></saml2:Attribute></saml2:AttributeStatement>', 'error': '"global component \'xs:string\' not found"'}

saml2/xml/schema/__init__.py:69: XMLSchemaError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions