X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fsaml2%2Fmetadata%2Fimpl%2FMetadataSchemaValidators.cpp;h=c5d751ce82274a9fe79947d7fd498b7bffe4c7c0;hp=80c72cd3636ceedff4c1c378dd006f86867e3bf2;hb=48857ad9a82c4695800123ecef931e7f8d9de199;hpb=183eb414fe7425776a43c94c5859e709f4fb77ac diff --git a/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp b/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp index 80c72cd..c5d751c 100644 --- a/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp +++ b/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp @@ -1,5 +1,5 @@ /* -* Copyright 2001-2007 Internet2 +* Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ using namespace xmltooling; using namespace std; using samlconstants::SAML20MD_NS; using samlconstants::SAML20MD_QUERY_EXT_NS; +using samlconstants::SAML20MD_ENTITY_ATTRIBUTE_NS; namespace opensaml { namespace saml2md { @@ -245,6 +246,12 @@ namespace opensaml { if (ptr->getEntityDescriptors().empty() && ptr->getEntitiesDescriptors().empty()) throw ValidationException("EntitiesDescriptor must contain at least one child descriptor."); END_XMLOBJECTVALIDATOR; + + BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,EntityAttributes); + if (!ptr->hasChildren()) + throw ValidationException("EntityAttributes must contain at least one child element."); + END_XMLOBJECTVALIDATOR; + }; }; @@ -349,4 +356,12 @@ void opensaml::saml2md::registerMetadataClasses() { q=xmltooling::QName(SAML20MD_QUERY_EXT_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME); XMLObjectBuilder::registerBuilder(q,new AuthzDecisionQueryDescriptorTypeBuilder()); SchemaValidators.registerValidator(q,new RoleDescriptorSchemaValidator()); + + q=xmltooling::QName(SAML20MD_ENTITY_ATTRIBUTE_NS,EntityAttributes::LOCAL_NAME); + XMLObjectBuilder::registerBuilder(q,new EntityAttributesBuilder()); + SchemaValidators.registerValidator(q,new EntityAttributesSchemaValidator()); + + q=xmltooling::QName(SAML20MD_ENTITY_ATTRIBUTE_NS,EntityAttributes::TYPE_NAME); + XMLObjectBuilder::registerBuilder(q,new EntityAttributesBuilder()); + SchemaValidators.registerValidator(q,new EntityAttributesSchemaValidator()); }