Layered basic metadata plugin on top of new base class.
authorScott Cantor <cantor.2@osu.edu>
Wed, 3 Jan 2007 21:53:06 +0000 (21:53 +0000)
committerScott Cantor <cantor.2@osu.edu>
Wed, 3 Jan 2007 21:53:06 +0000 (21:53 +0000)
17 files changed:
saml/Makefile.am
saml/saml.vcproj
saml/saml2/metadata/MetadataProvider.h
saml/saml2/metadata/impl/FilesystemMetadataProvider.cpp [deleted file]
saml/saml2/metadata/impl/MetadataProvider.cpp
saml/saml2/metadata/impl/XMLMetadataProvider.cpp [new file with mode: 0644]
samltest/Makefile.am
samltest/binding.h
samltest/data/saml2/metadata/XMLMetadataProvider.xml [moved from samltest/data/saml2/metadata/FilesystemMetadataProvider.xml with 100% similarity]
samltest/data/saml2/metadata/XMLWithBlacklists.xml [moved from samltest/data/saml2/metadata/FilesystemWithBlacklists.xml with 100% similarity]
samltest/data/saml2/metadata/XMLWithWhitelists.xml [moved from samltest/data/saml2/metadata/FilesystemWithWhitelists.xml with 100% similarity]
samltest/data/security/XMLMetadataProvider.xml [moved from samltest/data/security/FilesystemMetadataProvider.xml with 100% similarity]
samltest/internal.h
samltest/saml2/metadata/XMLMetadataProviderTest.h [moved from samltest/saml2/metadata/FilesystemMetadataProviderTest.h with 89% similarity]
samltest/samltest.vcproj
samltest/security/AbstractPKIXTrustEngineTest.h
samltest/security/ExplicitKeyTrustEngineTest.h

index 81322b2..d639669 100644 (file)
@@ -143,13 +143,13 @@ libsaml_la_SOURCES = \
        saml2/metadata/impl/AbstractMetadataProvider.cpp \
        saml2/metadata/impl/BlacklistMetadataFilter.cpp \
        saml2/metadata/impl/ChainingMetadataProvider.cpp \
-       saml2/metadata/impl/FilesystemMetadataProvider.cpp \
        saml2/metadata/impl/MetadataImpl.cpp \
        saml2/metadata/impl/MetadataProvider.cpp \
        saml2/metadata/impl/MetadataSchemaValidators.cpp \
        saml2/metadata/impl/ObservableMetadataProvider.cpp \
        saml2/metadata/impl/SignatureMetadataFilter.cpp \
        saml2/metadata/impl/WhitelistMetadataFilter.cpp \
+       saml2/metadata/impl/XMLMetadataProvider.cpp \
        saml2/binding/impl/SAML2Artifact.cpp \
        saml2/binding/impl/SAML2ArtifactType0004.cpp \
        saml2/binding/impl/SAML2ArtifactDecoder.cpp \
index 864a6e2..5e8a06f 100644 (file)
                                                        >\r
                                                </File>\r
                                                <File\r
-                                                       RelativePath=".\saml2\metadata\impl\FilesystemMetadataProvider.cpp"\r
-                                                       >\r
-                                               </File>\r
-                                               <File\r
                                                        RelativePath=".\saml2\metadata\impl\MetadataImpl.cpp"\r
                                                        >\r
                                                </File>\r
                                                        RelativePath=".\saml2\metadata\impl\WhitelistMetadataFilter.cpp"\r
                                                        >\r
                                                </File>\r
+                                               <File\r
+                                                       RelativePath=".\saml2\metadata\impl\XMLMetadataProvider.cpp"\r
+                                                       >\r
+                                               </File>\r
                                        </Filter>\r
                                </Filter>\r
                                <Filter\r
index 3a297d5..660d89c 100644 (file)
@@ -204,8 +204,8 @@ namespace opensaml {
          */
         void SAML_API registerMetadataProviders();
         
-        /** MetadataProvider based on local XML files */
-        #define FILESYSTEM_METADATA_PROVIDER  "org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider"
+        /** MetadataProvider based on local or remote XML file */
+        #define XML_METADATA_PROVIDER  "org.opensaml.saml2.metadata.provider.XMLMetadataProvider"
 
         /** MetadataProvider that wraps a sequence of metadata providers. */
         #define CHAINING_METADATA_PROVIDER  "org.opensaml.saml2.metadata.provider.ChainingMetadataProvider"
diff --git a/saml/saml2/metadata/impl/FilesystemMetadataProvider.cpp b/saml/saml2/metadata/impl/FilesystemMetadataProvider.cpp
deleted file mode 100644 (file)
index 97bc35f..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- *  Copyright 2001-2006 Internet2
- * 
- * 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.
- */
-
-/**
- * FilesystemMetadataProvider.cpp
- * 
- * Supplies metadata from a local file, detecting and reloading changes.
- */
-
-#include "internal.h"
-#include "saml2/metadata/Metadata.h"
-#include "saml2/metadata/AbstractMetadataProvider.h"
-
-#include <ctime>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <log4cpp/Category.hh>
-#include <xercesc/framework/LocalFileInputSource.hpp>
-#include <xercesc/framework/Wrapper4InputSource.hpp>
-#include <xercesc/util/XMLUniDefs.hpp>
-#include <xmltooling/util/NDC.h>
-#include <xmltooling/util/Threads.h>
-#include <xmltooling/util/XMLConstants.h>
-
-using namespace opensaml::saml2md;
-using namespace xmltooling;
-using namespace log4cpp;
-using namespace std;
-
-namespace opensaml {
-    namespace saml2md {
-        
-        
-        class SAML_DLLLOCAL FilesystemMetadataProvider : public AbstractMetadataProvider
-        {
-        public:
-            FilesystemMetadataProvider(const DOMElement* e);
-            ~FilesystemMetadataProvider();
-
-            Lockable* lock();
-            void unlock() {
-                if (m_lock)
-                    m_lock->unlock();
-            }
-
-            void init();
-
-            const XMLObject* getMetadata() const {
-                return m_object;
-            }
-
-        private:
-            XMLObject* load() const;
-            void index();
-        
-            const DOMElement* m_root; // survives only until init() method is done
-            std::string m_source;
-            time_t m_filestamp;
-            bool m_validate;
-            RWLock* m_lock;
-            XMLObject* m_object;
-        }; 
-
-        MetadataProvider* SAML_DLLLOCAL FilesystemMetadataProviderFactory(const DOMElement* const & e)
-        {
-            return new FilesystemMetadataProvider(e);
-        }
-
-    };
-};
-
-static const XMLCh uri[] =      UNICODE_LITERAL_3(u,r,i);
-static const XMLCh url[] =      UNICODE_LITERAL_3(u,r,l);
-static const XMLCh path[] =     UNICODE_LITERAL_4(p,a,t,h);
-static const XMLCh pathname[] = UNICODE_LITERAL_8(p,a,t,h,n,a,m,e);
-static const XMLCh file[] =     UNICODE_LITERAL_4(f,i,l,e);
-static const XMLCh filename[] = UNICODE_LITERAL_8(f,i,l,e,n,a,m,e);
-static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
-
-FilesystemMetadataProvider::FilesystemMetadataProvider(const DOMElement* e)
-    : AbstractMetadataProvider(e), m_root(e), m_filestamp(0), m_validate(false), m_lock(NULL), m_object(NULL)
-{
-#ifdef _DEBUG
-    NDC ndc("FilesystemMetadataProvider");
-#endif
-    Category& log=Category::getInstance(SAML_LOGCAT".Metadata");
-
-    // Establish source of data...
-    const XMLCh* source=e->getAttributeNS(NULL,uri);
-    if (!source || !*source) {
-        source=e->getAttributeNS(NULL,url);
-        if (!source || !*source) {
-            source=e->getAttributeNS(NULL,path);
-            if (!source || !*source) {
-                source=e->getAttributeNS(NULL,pathname);
-                if (!source || !*source) {
-                    source=e->getAttributeNS(NULL,file);
-                    if (!source || !*source) {
-                        source=e->getAttributeNS(NULL,filename);
-                    }
-                }
-            }
-        }
-    }
-    
-    if (source && *source) {
-        const XMLCh* valflag=e->getAttributeNS(NULL,validate);
-        m_validate=(XMLString::equals(valflag,xmlconstants::XML_TRUE) || XMLString::equals(valflag,xmlconstants::XML_ONE));
-        
-        auto_ptr_char temp(source);
-        m_source=temp.get();
-        log.debug("using external metadata file (%s)", temp.get());
-
-#ifdef WIN32
-        struct _stat stat_buf;
-        if (_stat(m_source.c_str(), &stat_buf) == 0)
-#else
-        struct stat stat_buf;
-        if (stat(m_source.c_str(), &stat_buf) == 0)
-#endif
-            m_filestamp=stat_buf.st_mtime;
-        m_lock=RWLock::create();
-    }
-    else
-        log.debug("no file path/name supplied, will look for metadata inline");
-}
-
-FilesystemMetadataProvider::~FilesystemMetadataProvider()
-{
-    delete m_lock;
-    delete m_object;
-}
-
-void FilesystemMetadataProvider::init()
-{
-    m_object=load();
-    index();
-}
-
-XMLObject* FilesystemMetadataProvider::load() const
-{
-#ifdef _DEBUG
-    NDC ndc("load");
-#endif
-    Category& log=Category::getInstance(SAML_LOGCAT".Metadata");
-    
-    try {
-        XMLObject* xmlObject=NULL;
-        
-        if (!m_source.empty()) {
-            // Data comes from a file we have to parse.
-            log.debug("loading metadata from file...");
-            auto_ptr_XMLCh widenit(m_source.c_str());
-            LocalFileInputSource src(widenit.get());
-            Wrapper4InputSource dsrc(&src,false);
-            DOMDocument* doc=NULL;
-            if (m_validate)
-                doc=XMLToolingConfig::getConfig().getValidatingParser().parse(dsrc);
-            else
-                doc=XMLToolingConfig::getConfig().getParser().parse(dsrc);
-            XercesJanitor<DOMDocument> docjanitor(doc);
-            log.infoStream() << "loaded and parsed XML file (" << m_source << ")" << CategoryStream::ENDLINE;
-            
-            // Unmarshall objects, binding the document.
-            xmlObject = XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true);
-            docjanitor.release();
-        }
-        else {
-            // Data comes from the DOM we were handed.
-            log.debug("loading inline metadata...");
-            DOMElement* child = XMLHelper::getFirstChildElement(m_root);
-            if (!child)
-                throw XMLToolingException("No metadata was found inline.");
-            xmlObject = XMLObjectBuilder::buildOneFromElement(child);
-        }
-        
-        auto_ptr<XMLObject> xmlObjectPtr(xmlObject);
-        
-        doFilters(*xmlObject);
-        
-        xmlObjectPtr->releaseThisAndChildrenDOM();
-        xmlObjectPtr->setDocument(NULL);
-        return xmlObjectPtr.release();
-    }
-    catch (XMLException& e) {
-        auto_ptr_char msg(e.getMessage());
-        log.errorStream() << "Xerces parser error while loading metadata from ("
-            << (m_source.empty() ? "inline" : m_source) << "): " << msg.get() << CategoryStream::ENDLINE;
-        throw XMLParserException(msg.get());
-    }
-    catch (XMLToolingException& e) {
-        log.errorStream() << "error while loading metadata from ("
-            << (m_source.empty() ? "inline" : m_source) << "): " << e.what() << CategoryStream::ENDLINE;
-        throw;
-    }
-}
-
-Lockable* FilesystemMetadataProvider::lock()
-{
-    if (!m_lock)
-        return this;
-        
-    m_lock->rdlock();
-
-    // Check if we need to refresh.
-#ifdef WIN32
-    struct _stat stat_buf;
-    if (_stat(m_source.c_str(), &stat_buf) == 0)
-#else
-    struct stat stat_buf;
-    if (stat(m_source.c_str(), &stat_buf) == 0)
-#endif
-    {
-        if (m_filestamp>0 && m_filestamp<stat_buf.st_mtime) {
-            // Elevate lock and recheck.
-            m_lock->unlock();
-            m_lock->wrlock();
-            if (m_filestamp>0 && m_filestamp<stat_buf.st_mtime) {
-                SharedLock lockwrap(m_lock,false);  // pops write lock
-                try {
-                    // Update the timestamp regardless. No point in repeatedly trying.
-                    m_filestamp=stat_buf.st_mtime;
-                    XMLObject* newstuff = load();
-                    delete m_object;
-                    m_object = newstuff;
-                    index();
-                    emitChangeEvent();
-                }
-                catch(XMLToolingException& e) {
-                    Category::getInstance(SAML_LOGCAT".Metadata").error("failed to reload metadata from file, sticking with what we have: %s", e.what());
-                }
-            }
-            else {
-                m_lock->unlock();
-            }
-            m_lock->rdlock();
-        }
-    }
-    return this;
-}
-
-void FilesystemMetadataProvider::index()
-{
-    clearDescriptorIndex();
-    EntitiesDescriptor* group=dynamic_cast<EntitiesDescriptor*>(m_object);
-    if (group) {
-        AbstractMetadataProvider::index(group, SAMLTIME_MAX);
-        return;
-    }
-    EntityDescriptor* site=dynamic_cast<EntityDescriptor*>(m_object);
-    AbstractMetadataProvider::index(site, SAMLTIME_MAX);
-}
index 8c01e62..7d8de17 100644 (file)
@@ -36,7 +36,7 @@ using namespace std;
 
 namespace opensaml {
     namespace saml2md {
-        SAML_DLLLOCAL PluginManager<MetadataProvider,const DOMElement*>::Factory FilesystemMetadataProviderFactory;
+        SAML_DLLLOCAL PluginManager<MetadataProvider,const DOMElement*>::Factory XMLMetadataProviderFactory;
         SAML_DLLLOCAL PluginManager<MetadataProvider,const DOMElement*>::Factory ChainingMetadataProviderFactory;
         SAML_DLLLOCAL PluginManager<MetadataFilter,const DOMElement*>::Factory BlacklistMetadataFilterFactory;
         SAML_DLLLOCAL PluginManager<MetadataFilter,const DOMElement*>::Factory WhitelistMetadataFilterFactory;
@@ -47,10 +47,10 @@ namespace opensaml {
 void SAML_API opensaml::saml2md::registerMetadataProviders()
 {
     SAMLConfig& conf=SAMLConfig::getConfig();
-    conf.MetadataProviderManager.registerFactory(FILESYSTEM_METADATA_PROVIDER, FilesystemMetadataProviderFactory);
+    conf.MetadataProviderManager.registerFactory(XML_METADATA_PROVIDER, XMLMetadataProviderFactory);
     conf.MetadataProviderManager.registerFactory(CHAINING_METADATA_PROVIDER, ChainingMetadataProviderFactory);
-    conf.MetadataProviderManager.registerFactory("edu.internet2.middleware.shibboleth.metadata.provider.XMLMetadata", FilesystemMetadataProviderFactory);
-    conf.MetadataProviderManager.registerFactory("edu.internet2.middleware.shibboleth.common.provider.XMLMetadata", FilesystemMetadataProviderFactory);
+    conf.MetadataProviderManager.registerFactory("edu.internet2.middleware.shibboleth.metadata.provider.XMLMetadata", XMLMetadataProviderFactory);
+    conf.MetadataProviderManager.registerFactory("edu.internet2.middleware.shibboleth.common.provider.XMLMetadata", XMLMetadataProviderFactory);
 }
 
 void SAML_API opensaml::saml2md::registerMetadataFilters()
diff --git a/saml/saml2/metadata/impl/XMLMetadataProvider.cpp b/saml/saml2/metadata/impl/XMLMetadataProvider.cpp
new file mode 100644 (file)
index 0000000..d47a1d4
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ *  Copyright 2001-2006 Internet2
+ * 
+ * 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.
+ */
+
+/**
+ * XMLMetadataProvider.cpp
+ * 
+ * Supplies metadata from an XML file
+ */
+
+#include "internal.h"
+#include "saml2/metadata/Metadata.h"
+#include "saml2/metadata/AbstractMetadataProvider.h"
+
+#include <log4cpp/Category.hh>
+#include <xmltooling/util/NDC.h>
+#include <xmltooling/util/ReloadableXMLFile.h>
+#include <xmltooling/util/XMLConstants.h>
+
+using namespace opensaml::saml2md;
+using namespace xmltooling;
+using namespace log4cpp;
+using namespace std;
+
+#if defined (_MSC_VER)
+    #pragma warning( push )
+    #pragma warning( disable : 4250 )
+#endif
+
+namespace opensaml {
+    namespace saml2md {
+
+        class SAML_DLLLOCAL XMLMetadataProvider : public AbstractMetadataProvider, public ReloadableXMLFile
+        {
+        public:
+            XMLMetadataProvider(const DOMElement* e) : AbstractMetadataProvider(e), ReloadableXMLFile(e), m_object(NULL) {}
+            virtual ~XMLMetadataProvider() {
+                delete m_object;
+            }
+
+            void init() {
+                load(); // guarantees an exception or the metadata is loaded
+            }
+            
+            pair<bool,DOMElement*> load();
+
+            const XMLObject* getMetadata() const {
+                return m_object;
+            }
+
+        private:
+            void index();
+        
+            XMLObject* m_object;
+        }; 
+
+        MetadataProvider* SAML_DLLLOCAL XMLMetadataProviderFactory(const DOMElement* const & e)
+        {
+            return new XMLMetadataProvider(e);
+        }
+
+    };
+};
+
+#if defined (_MSC_VER)
+    #pragma warning( pop )
+#endif
+
+pair<bool,DOMElement*> XMLMetadataProvider::load()
+{
+#ifdef _DEBUG
+    NDC ndc("load");
+#endif
+    
+    try {
+        // Load from source using base class.
+        pair<bool,DOMElement*> raw = ReloadableXMLFile::load();
+        
+        // If we own it, wrap it for now.
+        XercesJanitor<DOMDocument> docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL);
+                
+        // Unmarshall objects, binding the document.
+        XMLObject* xmlObject=XMLObjectBuilder::buildOneFromElement(raw.second, true);
+        docjanitor.release();
+        
+        // Preprocess the metadata.
+        auto_ptr<XMLObject> xmlObjectPtr(xmlObject);
+        doFilters(*xmlObject);
+        xmlObjectPtr->releaseThisAndChildrenDOM();
+        xmlObjectPtr->setDocument(NULL);
+        
+        // Swap it in.
+        bool changed = m_object!=NULL;
+        delete m_object;
+        m_object = xmlObjectPtr.release();
+        index();
+        if (changed)
+            emitChangeEvent();
+        return make_pair(false,(DOMElement*)NULL);
+    }
+    catch (XMLToolingException& e) {
+        Category::getInstance(SAML_LOGCAT".Metadata").error("error while loading metadata: %s", e.what());
+        throw;
+    }
+}
+
+void XMLMetadataProvider::index()
+{
+    clearDescriptorIndex();
+    EntitiesDescriptor* group=dynamic_cast<EntitiesDescriptor*>(m_object);
+    if (group) {
+        AbstractMetadataProvider::index(group, SAMLTIME_MAX);
+        return;
+    }
+    EntityDescriptor* site=dynamic_cast<EntityDescriptor*>(m_object);
+    AbstractMetadataProvider::index(site, SAMLTIME_MAX);
+}
index 681cb7a..932a2c5 100644 (file)
@@ -92,7 +92,7 @@ samltest_h = \
     saml2/binding/SAML2ArtifactTest.h \
     saml2/binding/SAML2POSTTest.h \
     saml2/binding/SAML2RedirectTest.h \
-    saml2/metadata/FilesystemMetadataProviderTest.h
+    saml2/metadata/XMLMetadataProviderTest.h
 
 noinst_HEADERS = \
        binding.h \
index fea95fb..2947a49 100644 (file)
@@ -66,7 +66,7 @@ public:
             doc->getDocumentElement()->setAttributeNS(NULL,path.get(),file.get());\r
     \r
             m_metadata = SAMLConfig::getConfig().MetadataProviderManager.newPlugin(\r
-                FILESYSTEM_METADATA_PROVIDER,doc->getDocumentElement()\r
+                XML_METADATA_PROVIDER,doc->getDocumentElement()\r
                 );\r
             m_metadata->init();\r
 \r
index 1cfe28f..5dddfa1 100644 (file)
  * limitations under the License.
  */
 
+#ifdef WIN32\r
+# define _CRT_SECURE_NO_DEPRECATE 1\r
+# define _CRT_NONSTDC_NO_DEPRECATE 1\r
+#endif\r
+
 #include <cxxtest/TestSuite.h>
 
 #include <fstream>
@@ -23,7 +23,7 @@
 using namespace opensaml::saml2md;
 using namespace opensaml::saml2p;
 
-class FilesystemMetadataProviderTest : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
+class XMLMetadataProviderTest : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {
     XMLCh* entityID;
     XMLCh* entityID2;
     XMLCh* supportedProtocol;
@@ -46,8 +46,8 @@ public:
         SAMLObjectBaseTestCase::tearDown();
     }
 
-    void testFilesystemProvider() {
-        string config = data_path + "saml2/metadata/FilesystemMetadataProvider.xml";
+    void testXMLProvider() {
+        string config = data_path + "saml2/metadata/XMLMetadataProvider.xml";
         ifstream in(config.c_str());
         DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
         XercesJanitor<DOMDocument> janitor(doc);
@@ -58,7 +58,7 @@ public:
         doc->getDocumentElement()->setAttributeNS(NULL,path.get(),file.get());
 
         auto_ptr<MetadataProvider> metadataProvider(
-            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(FILESYSTEM_METADATA_PROVIDER,doc->getDocumentElement())
+            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(XML_METADATA_PROVIDER,doc->getDocumentElement())
             );
         try {
             metadataProvider->init();
@@ -84,8 +84,8 @@ public:
         assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());
     }
 
-    void testFilesystemWithBlacklists() {
-        string config = data_path + "saml2/metadata/FilesystemWithBlacklists.xml";
+    void testXMLWithBlacklists() {
+        string config = data_path + "saml2/metadata/XMLWithBlacklists.xml";
         ifstream in(config.c_str());
         DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
         XercesJanitor<DOMDocument> janitor(doc);
@@ -96,7 +96,7 @@ public:
         doc->getDocumentElement()->setAttributeNS(NULL,path.get(),file.get());
 
         auto_ptr<MetadataProvider> metadataProvider(
-            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(FILESYSTEM_METADATA_PROVIDER,doc->getDocumentElement())
+            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(XML_METADATA_PROVIDER,doc->getDocumentElement())
             );
         try {
             metadataProvider->init();
@@ -114,8 +114,8 @@ public:
         assertEquals("Entity's ID does not match requested ID", entityID2, descriptor->getEntityID());
     }
 
-    void testFilesystemWithWhitelists() {
-        string config = data_path + "saml2/metadata/FilesystemWithWhitelists.xml";
+    void testXMLWithWhitelists() {
+        string config = data_path + "saml2/metadata/XMLWithWhitelists.xml";
         ifstream in(config.c_str());
         DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
         XercesJanitor<DOMDocument> janitor(doc);
@@ -126,7 +126,7 @@ public:
         doc->getDocumentElement()->setAttributeNS(NULL,path.get(),file.get());
 
         auto_ptr<MetadataProvider> metadataProvider(
-            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(FILESYSTEM_METADATA_PROVIDER,doc->getDocumentElement())
+            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(XML_METADATA_PROVIDER,doc->getDocumentElement())
             );
         try {
             metadataProvider->init();
index 75f8f94..f044fd7 100644 (file)
                                        Name="metadata"\r
                                        >\r
                                        <File\r
-                                               RelativePath=".\saml2\metadata\FilesystemMetadataProviderTest.cpp"\r
+                                               RelativePath=".\saml2\metadata\XMLMetadataProviderTest.cpp"\r
                                                >\r
                                        </File>\r
                                </Filter>\r
                                        Name="metadata"\r
                                        >\r
                                        <File\r
-                                               RelativePath=".\saml2\metadata\FilesystemMetadataProviderTest.h"\r
+                                               RelativePath=".\saml2\metadata\XMLMetadataProviderTest.h"\r
                                                >\r
                                                <FileConfiguration\r
                                                        Name="Debug|Win32"\r
index 67f4ffb..4d43fc6 100644 (file)
@@ -93,7 +93,7 @@ public:
     }
 
     void testExplicitKeyTrustEngine() {
-        string config = data_path + "security/FilesystemMetadataProvider.xml";
+        string config = data_path + "security/XMLMetadataProvider.xml";
         ifstream in(config.c_str());
         DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
         XercesJanitor<DOMDocument> janitor(doc);
@@ -105,7 +105,7 @@ public:
 
         // Build metadata provider.
         auto_ptr<MetadataProvider> metadataProvider(
-            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(FILESYSTEM_METADATA_PROVIDER,doc->getDocumentElement())
+            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(XML_METADATA_PROVIDER,doc->getDocumentElement())
             );
         try {
             metadataProvider->init();
index 78271bf..d2dd668 100644 (file)
@@ -36,7 +36,7 @@ public:
     }
 
     void testExplicitKeyTrustEngine() {
-        string config = data_path + "security/FilesystemMetadataProvider.xml";
+        string config = data_path + "security/XMLMetadataProvider.xml";
         ifstream in(config.c_str());
         DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
         XercesJanitor<DOMDocument> janitor(doc);
@@ -48,7 +48,7 @@ public:
 
         // Build metadata provider.
         auto_ptr<MetadataProvider> metadataProvider(
-            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(FILESYSTEM_METADATA_PROVIDER,doc->getDocumentElement())
+            SAMLConfig::getConfig().MetadataProviderManager.newPlugin(XML_METADATA_PROVIDER,doc->getDocumentElement())
             );
         try {
             metadataProvider->init();