[cpp-sp] 02/02: Camel case some settings, adjust plugin API

Scott Cantor cantor.2 at osu.edu
Tue Dec 31 00:18:21 UTC 2024


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=d998c3698c54900b1b7a2f9f903f190e559a3b94

commit d998c3698c54900b1b7a2f9f903f190e559a3b94
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Dec 30 19:18:10 2024 -0500

    Camel case some settings, adjust plugin API
---
 apache/mod_shib_24.cpp                             |   6 +-
 shibsp/AgentConfig.h                               |  39 ++--
 shibsp/impl/AgentConfig.cpp                        |   6 +-
 shibsp/impl/ChainingAccessControl.cpp              |   8 +-
 shibsp/impl/DefaultAgent.cpp                       | 224 ++++++---------------
 shibsp/impl/XMLAccessControl.cpp                   |   2 +-
 shibsp/impl/XMLRequestMapper.cpp                   |  10 +-
 shibsp/logging/impl/AbstractLoggingService.cpp     |  12 +-
 shibsp/logging/impl/ConsoleLoggingService.cpp      |   4 +-
 shibsp/logging/impl/SyslogLoggingService.cpp       |  11 +-
 tests/data/console-shibboleth.ini                  |   9 +-
 tests/data/fatal-exts-shibboleth.ini               |   3 +-
 tests/data/impl/console-shibboleth.ini             |   3 +-
 tests/data/nonfatal-exts-shibboleth.ini            |   3 +-
 tests/data/syslog-shibboleth.ini                   |   5 +-
 .../util/reloadablefile/console-shibboleth.ini     |   3 +-
 16 files changed, 118 insertions(+), 230 deletions(-)

diff --git a/apache/mod_shib_24.cpp b/apache/mod_shib_24.cpp
index 50428c6e..249e0cad 100644
--- a/apache/mod_shib_24.cpp
+++ b/apache/mod_shib_24.cpp
@@ -1021,7 +1021,7 @@ AccessControl::aclresult_t htAccessControl::authorized(const SPRequest& request,
 class ApacheRequestMapper : public virtual RequestMapper, public virtual PropertySet2
 {
 public:
-    ApacheRequestMapper(const ptree& pt, bool deprecationSupport=true);
+    ApacheRequestMapper(ptree& pt, bool deprecationSupport=true);
     ~ApacheRequestMapper() {}
     void lock_shared() { m_mapper->lock_shared(); }
     bool try_lock_shared() { return m_mapper->try_lock_shared(); }
@@ -1043,12 +1043,12 @@ private:
     mutable htAccessControl m_htaccess;
 };
 
-RequestMapper* ApacheRequestMapFactory(const ptree& pt, bool deprecationSupport)
+RequestMapper* ApacheRequestMapFactory(ptree& pt, bool deprecationSupport)
 {
     return new ApacheRequestMapper(pt, deprecationSupport);
 }
 
-ApacheRequestMapper::ApacheRequestMapper(const ptree& pt, bool deprecationSupport)
+ApacheRequestMapper::ApacheRequestMapper(ptree& pt, bool deprecationSupport)
     : m_mapper(AgentConfig::getConfig().RequestMapperManager.newPlugin(XML_REQUEST_MAPPER, pt, deprecationSupport))
 {
 }
diff --git a/shibsp/AgentConfig.h b/shibsp/AgentConfig.h
index d8836c00..3aec1672 100644
--- a/shibsp/AgentConfig.h
+++ b/shibsp/AgentConfig.h
@@ -78,40 +78,25 @@ namespace shibsp {
          */
         virtual void term()=0;
 
-        /**
-         * Loads a shared/dynamic library extension.
-         *
-         * <p>Extension libraries are managed using a pair of "C" linkage functions:<br>
-         *      extern "C" int shibsp_extension_init(void* context);<br>
-         *      extern "C" void shibsp_extension_term();
-         *
-         * <p>This method is internally synchronized.</p>
-         *
-         * @param path      pathname of shared library to load into process
-         * @param context   arbitrary data to pass to library initialization hook
-         * @return true iff library was loaded successfully
-         */
-        virtual bool load_library(const char* path, void* context=nullptr)=0;
-
         /**
          * Manages factories for AccessControl plugins.
          */
-        PluginManager<AccessControl,std::string,const boost::property_tree::ptree&> AccessControlManager;
+        PluginManager<AccessControl,std::string,boost::property_tree::ptree&> AccessControlManager;
 
         /**
          * Manages factories for Agent plugins.
          */
-        PluginManager<Agent,std::string,const boost::property_tree::ptree&> AgentManager;
+        PluginManager<Agent,std::string,boost::property_tree::ptree&> AgentManager;
 
         /**
          * Manages factories for LoggingService plugins.
          */
-        PluginManager<LoggingService,std::string,const boost::property_tree::ptree&> LoggingServiceManager;
+        PluginManager<LoggingService,std::string,boost::property_tree::ptree&> LoggingServiceManager;
 
         /**
          * Manages factories for RequestMapper plugins.
          */
-        PluginManager<RequestMapper,std::string,const boost::property_tree::ptree&> RequestMapperManager;
+        PluginManager<RequestMapper,std::string,boost::property_tree::ptree&> RequestMapperManager;
 
         /**
          * Returns a PathResolver instance.
@@ -128,22 +113,22 @@ namespace shibsp {
         virtual const URLEncoder& getURLEncoder() const=0;
 
         /**
-         * Returns the global Agent instance.
+         * Returns the configured logging service.
          * 
          * <p>This method will throw in the event the library is not yet initialized.</p>
-         *
-         * @return  global Agent
+         * 
+         * @return logging service
          */
-        virtual Agent& getAgent() const=0;
+        virtual LoggingService& getLoggingService() const=0;
 
         /**
-         * Returns the configured logging service.
+         * Returns the global Agent instance.
          * 
          * <p>This method will throw in the event the library is not yet initialized.</p>
-         * 
-         * @return logging service
+         *
+         * @return  global Agent
          */
-        virtual LoggingService& getLoggingService() const=0;
+        virtual Agent& getAgent() const=0;
 
         /**
          * Helper for deprecation warnings about an at-risk feature or setting.
diff --git a/shibsp/impl/AgentConfig.cpp b/shibsp/impl/AgentConfig.cpp
index 0ff85f30..76caeb62 100644
--- a/shibsp/impl/AgentConfig.cpp
+++ b/shibsp/impl/AgentConfig.cpp
@@ -26,6 +26,7 @@
 #include "Agent.h"
 #include "AgentConfig.h"
 #include "RequestMapper.h"
+#include "io/HTTPResponse.h"
 #include "logging/LoggingService.h"
 #include "util/Misc.h"
 #include "util/PathResolver.h"
@@ -50,7 +51,6 @@
 using namespace shibsp;
 using namespace xmltooling;
 using namespace boost::property_tree;
-using namespace boost;
 using namespace std;
 
 namespace shibsp {
@@ -71,8 +71,8 @@ namespace shibsp {
             return m_urlEncoder;
         }
 
-        Agent& getAgent() const;
         LoggingService& getLoggingService() const;
+        Agent& getAgent() const;
 
     private:
         bool _init(const char* inst_prefix=nullptr, const char* config_file=nullptr, bool rethrow=false);
@@ -238,7 +238,7 @@ bool AgentInternalConfig::_init(const char* inst_prefix, const char* config_file
         loadExtensions(log);
 
         // Check for an overridden "agent-type" under the "global" subtree.
-        static const char AGENT_TYPE_PROP_PATH[] = "global.agent-type";
+        static const char AGENT_TYPE_PROP_PATH[] = "global.agentType";
         string type = m_config.get(AGENT_TYPE_PROP_PATH, DEFAULT_AGENT);
         m_agent.reset(AgentManager.newPlugin(type, m_config, true));
         m_agent->init();
diff --git a/shibsp/impl/ChainingAccessControl.cpp b/shibsp/impl/ChainingAccessControl.cpp
index 1632d91a..d4da5747 100644
--- a/shibsp/impl/ChainingAccessControl.cpp
+++ b/shibsp/impl/ChainingAccessControl.cpp
@@ -36,7 +36,7 @@ using namespace boost::property_tree;
 using namespace std;
 
 namespace shibsp {
-    extern AccessControl* SHIBSP_DLLLOCAL XMLAccessControlFactory(const ptree& pt, bool deprecationSupport);
+    extern AccessControl* SHIBSP_DLLLOCAL XMLAccessControlFactory(ptree& pt, bool deprecationSupport);
 }
 
 AccessControl::AccessControl()
@@ -53,7 +53,7 @@ namespace {
     class ChainingAccessControl : public AccessControl
     {
     public:
-        ChainingAccessControl(const ptree& pt, bool deprecationSupport);
+        ChainingAccessControl(ptree& pt, bool deprecationSupport);
 
         ~ChainingAccessControl() {}
 
@@ -79,7 +79,7 @@ namespace {
         vector<unique_ptr<AccessControl>> m_ac;
     };
 
-    AccessControl* SHIBSP_DLLLOCAL ChainingAccessControlFactory(const ptree& pt, bool deprecationSupport)
+    AccessControl* SHIBSP_DLLLOCAL ChainingAccessControlFactory(ptree& pt, bool deprecationSupport)
     {
         return new ChainingAccessControl(pt, deprecationSupport);
     }
@@ -92,7 +92,7 @@ void SHIBSP_API shibsp::registerAccessControls()
     conf.AccessControlManager.registerFactory(XML_ACCESS_CONTROL, XMLAccessControlFactory);
 }
 
-ChainingAccessControl::ChainingAccessControl(const ptree& pt, bool deprecationSupport) : m_op(OP_AND)
+ChainingAccessControl::ChainingAccessControl(ptree& pt, bool deprecationSupport) : m_op(OP_AND)
 {
     static const char OPERATOR_PROP_PATH[] = "<xmlattr>.operator";
     static const char AND_OPERATOR[] = "AND";
diff --git a/shibsp/impl/DefaultAgent.cpp b/shibsp/impl/DefaultAgent.cpp
index c145ae02..833fff7b 100644
--- a/shibsp/impl/DefaultAgent.cpp
+++ b/shibsp/impl/DefaultAgent.cpp
@@ -26,6 +26,7 @@
 #include "AgentConfig.h"
 #include "RequestMapper.h"
 #include "SessionCache.h"
+#include "io/HTTPResponse.h"
 #include "logging/Category.h"
 #include "util/BoostPropertySet.h"
 #include "util/PathResolver.h"
@@ -54,7 +55,7 @@ namespace {
     class SHIBSP_DLLLOCAL DefaultAgent : public Agent, public BoostPropertySet
     {
     public:
-        DefaultAgent(const ptree& pt) : m_pt(pt), m_log(Category::getInstance(SHIBSP_LOGCAT ".Agent")) {}
+        DefaultAgent(ptree& pt) : m_pt(pt), m_log(Category::getInstance(SHIBSP_LOGCAT ".Agent")) {}
         ~DefaultAgent() {}
 
         void init();
@@ -80,17 +81,18 @@ namespace {
         }
 
     private:
-        //void doListener(const xercesc::DOMElement*);
-        //void doCaching(const xercesc::DOMElement*);
+        void doRemoting();
+        void doSessionCache();
+        void doRequestMapper();
 
-        const ptree& m_pt;
+        ptree& m_pt;
         Category& m_log;
 
         // The order of these members actually matters. If we want to rely on auto-destruction, then
         // anything dependent on anything else has to come later in the object so it will pop first.
         // Remoting is the lowest, then the cache, and finally the rest.
         //unique_ptr<ListenerService> m_listener;
-        //unique_ptr<SessionCache> m_sessionCache;
+        unique_ptr<SessionCache> m_sessionCache;
         unique_ptr<RequestMapper> m_requestMapper;
     };
 
@@ -100,11 +102,8 @@ namespace {
 
     static const XMLCh applicationId[] =        UNICODE_LITERAL_13(a,p,p,l,i,c,a,t,i,o,n,I,d);
     static const XMLCh _default[] =             UNICODE_LITERAL_7(d,e,f,a,u,l,t);
-    static const XMLCh _Extensions[] =          UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
-    static const XMLCh _fatal[] =               UNICODE_LITERAL_5(f,a,t,a,l);
     static const XMLCh _id[] =                  UNICODE_LITERAL_2(i,d);
     static const XMLCh InProcess[] =            UNICODE_LITERAL_9(I,n,P,r,o,c,e,s,s);
-    static const XMLCh Library[] =              UNICODE_LITERAL_7(L,i,b,r,a,r,y);
     static const XMLCh Listener[] =             UNICODE_LITERAL_8(L,i,s,t,e,n,e,r);
     static const XMLCh logger[] =               UNICODE_LITERAL_6(l,o,g,g,e,r);
     static const XMLCh _option[] =              UNICODE_LITERAL_6(o,p,t,i,o,n);
@@ -119,183 +118,54 @@ namespace {
     static const XMLCh _type[] =                UNICODE_LITERAL_4(t,y,p,e);
     static const XMLCh UnixListener[] =         UNICODE_LITERAL_12(U,n,i,x,L,i,s,t,e,n,e,r);
 
-    Agent* DefaultAgentFactory(const ptree& pt, bool deprecationSupport)
+    Agent* DefaultAgentFactory(ptree& pt, bool deprecationSupport)
     {
         return new DefaultAgent(pt);
     }
 };
 
 namespace shibsp {
-    void SHIBSP_API shibsp::registerAgents()
-    {
+    void SHIBSP_API shibsp::registerAgents() {
         AgentConfig::getConfig().AgentManager.registerFactory(DEFAULT_AGENT, DefaultAgentFactory);
     }
 };
 
 void DefaultAgent::init()
 {
-    /*
-    const SPConfig& conf=SPConfig::getConfig();
-    const DOMElement* SHAR=XMLHelper::getFirstChildElement(e, OutOfProcess);
-    const DOMElement* SHIRE=XMLHelper::getFirstChildElement(e, InProcess);
-
-    // Initialize logging manually in order to redirect log messages as soon as possible.
-    // If no explicit config is supplied, we now assume the caller has done this, so that
-    // setuid processes can potentially do this as root.
-
-    // We also no longer do this on reloads, as this results in race conditions that could
-    // crash the process.
-
-    if (first && conf.isEnabled(SPConfig::Logging)) {
-        string logconf;
-        if (conf.isEnabled(SPConfig::OutOfProcess))
-            logconf = XMLHelper::getAttrString(SHAR, nullptr, logger);
-        else if (conf.isEnabled(SPConfig::InProcess))
-            logconf = XMLHelper::getAttrString(SHIRE, nullptr, logger);
-        if (logconf.empty())
-            logconf = XMLHelper::getAttrString(e, nullptr, logger);
-        if (!logconf.empty()) {
-            log.debug("loading new logging configuration from (%s), check log destination for status of configuration", logconf.c_str());
-            if (!XMLToolingConfig::getConfig().log_config(logconf.c_str()))
-                log.crit("failed to load new logging configuration from (%s)", logconf.c_str());
-        }
+    // First load "global" property tree as this PropertySet.
+    const boost::optional<ptree&> global = m_pt.get_child_optional("global");
+    if (global) {
+        load(global.get());
     }
 
-    // Re-log library versions now that logging is set up.
-    log.info("Shibboleth SP Version %s", PACKAGE_VERSION);
-    log.info(
-        "Library versions: %s %s, Xerces-C %s, XMLTooling-C %s, Shibboleth %s",
-# if defined(LOG4SHIB_VERSION)
-    "log4shib", LOG4SHIB_VERSION,
-# elif defined(LOG4CPP_VERSION)
-    "log4cpp", LOG4CPP_VERSION,
-# else
-    "", "",
-# endif
-        XERCES_FULLVERSIONDOT, gXMLToolingDotVersionStr, gShibSPDotVersionStr
-        );
-
-    if (XMLString::equals(e->getNamespaceURI(), shibspconstants::SHIB2SPCONFIG_NS)) {
-        SPConfig::getConfig().deprecation().warn("legacy V2 configuration");
-        m_deprecationSupport = true;
+    const char* prop = getString("allowedSchemes", "https http");
+    if (prop) {
+        HTTPResponse::getAllowedSchemes().clear();
+        string schemes(prop);
+        boost::trim(schemes);
+        boost::split(HTTPResponse::getAllowedSchemes(), schemes, boost::is_space(), boost::algorithm::token_compress_on);
     }
 
-    // First load any property sets.
-    load(e, nullptr, this);
-
-    DOMElement* child;
-
-    // Much of the processing can only occur on the first instantiation.
-    if (first) {
-        // Set clock skew.
-        pair<bool,unsigned int> skew=getUnsignedInt("clockSkew");
-        if (skew.first)
-            xmlConf.clock_skew_secs=min(skew.second,(60*60*24*7*28));
-
-        pair<bool,const char*> unsafe = getString("unsafeChars");
-        if (unsafe.first)
-            TemplateEngine::unsafe_chars = unsafe.second;
-
-        unsafe = getString("allowedSchemes");
-        if (unsafe.first) {
-            HTTPResponse::getAllowedSchemes().clear();
-            string schemes(unsafe.second);
-            trim(schemes);
-            split(HTTPResponse::getAllowedSchemes(), schemes, is_space(), algorithm::token_compress_on);
-        }
-
-        // Extensions
-        doExtensions(e, "global", log);
-        if (conf.isEnabled(SPConfig::OutOfProcess))
-            doExtensions(SHAR, "out of process", log);
-
-        if (conf.isEnabled(SPConfig::InProcess))
-            doExtensions(SHIRE, "in process", log);
-
-        // Instantiate the ListenerService and SessionCache objects.
-        if (conf.isEnabled(SPConfig::Listener))
-            doListener(e, outer, log);
-
-        if (conf.isEnabled(SPConfig::Caching))
-            doCaching(e, outer, log);
-    } // end of first-time-only stuff
-
-    // Back to the fully dynamic stuff...next up is the RequestMapper.
-    if (conf.isEnabled(SPConfig::RequestMapping)) {
-        if (child = XMLHelper::getFirstChildElement(e, _RequestMapper)) {
-            string t(XMLHelper::getAttrString(child, nullptr, _type));
-            if (!t.empty()) {
-                log.info("building RequestMapper of type %s...", t.c_str());
-                m_requestMapper.reset(conf.RequestMapperManager.newPlugin(t.c_str(), child, m_deprecationSupport));
-            }
-        }
-        if (!m_requestMapper) {
-            log.info("no RequestMapper specified, using 'Native' plugin with empty/default map");
-            child = e->getOwnerDocument()->createElementNS(nullptr, _RequestMapper);
-            DOMElement* mapperDummy = e->getOwnerDocument()->createElementNS(e->getNamespaceURI(), RequestMap);
-            mapperDummy->setAttributeNS(nullptr, applicationId, _default);
-            child->appendChild(mapperDummy);
-            m_requestMapper.reset(conf.RequestMapperManager.newPlugin(NATIVE_REQUEST_MAPPER, child, m_deprecationSupport));
-        }
+    prop = getString("extraAuthTypes");
+    if (prop) {
+        string types(prop);
+        boost::trim(types);
+        boost::split(m_authTypes, types, boost::is_space(), boost::algorithm::token_compress_on);
+        m_authTypes.insert("shibboleth");
     }
 
-    // Load the default application.
-    child = XMLHelper::getLastChildElement(e, ApplicationDefaults);
-    if (!child) {
-        log.crit("can't build default Application object, missing conf:ApplicationDefaults element?");
-        throw ConfigurationException("can't build default Application object, missing conf:ApplicationDefaults element?");
-    }
-    boost::shared_ptr<XMLApplication> defapp(new XMLApplication(outer, child, m_deprecationSupport));
-    m_appmap[defapp->getId()] = defapp;
-    m_defaultApplication = defapp.get();
-
-    // Load any overrides.
-    DOMElement* override = XMLHelper::getFirstChildElement(child, ApplicationOverride);
-    while (override) {
-        boost::shared_ptr<XMLApplication> iapp(new XMLApplication(outer, override, m_deprecationSupport, m_defaultApplication));
-        if (m_appmap.count(iapp->getId()))
-            log.crit("found conf:ApplicationOverride element with duplicate id attribute (%s), skipping it", iapp->getId());
-        else
-            m_appmap[iapp->getId()] = iapp;
-
-        override = XMLHelper::getNextSiblingElement(override, ApplicationOverride);
-    }
-
-    // Save off any external override paths.
-    override = XMLHelper::getFirstChildElement(child, ExternalApplicationOverrides);
-    while (override) {
-        string extoverridepath(XMLHelper::getAttrString(override, nullptr, _path));
-        AgentConfig::getConfig().getPathResolver().resolve(extoverridepath, PathResolver::SHIBSP_CFG_FILE);
-        if (!extoverridepath.empty()) {
-            log.info("adding external ApplicationOverride search path: %s", extoverridepath.c_str());
-            m_externalAppPaths.push_back(extoverridepath);
-        }
+    const AgentConfig& conf = AgentConfig::getConfig();
 
-        override = XMLHelper::getNextSiblingElement(override, ExternalApplicationOverrides);
-    }
+    doRemoting();
+    doSessionCache();
+    doRequestMapper();
 
-    if (!m_externalAppPaths.empty())
-        m_appMapLock.reset(Mutex::create());
-
-    // Check for extra AuthTypes to recognize.
-    if (conf.isEnabled(SPConfig::InProcess)) {
-        const PropertySet* inprocs = getPropertySet("InProcess");
-        if (inprocs) {
-            pair<bool,const char*> extraAuthTypes = inprocs->getString("extraAuthTypes");
-            if (extraAuthTypes.first) {
-                string types(extraAuthTypes.second);
-                trim(types);
-                split(outer->m_authTypes, types, is_space(), algorithm::token_compress_on);
-                outer->m_authTypes.insert("shibboleth");
-            }
-        }
-    }
-    */
+    // TODO: the Application related material needs to be replaced with new approaches.
 }
 
-/*
-void XMLConfigImpl::doListener(const DOMElement* e, XMLConfig* conf, Category& log)
+void DefaultAgent::doRemoting()
 {
+    /*
 #ifdef WIN32
     string plugtype(TCP_LISTENER_SERVICE);
 #else
@@ -320,10 +190,12 @@ void XMLConfigImpl::doListener(const DOMElement* e, XMLConfig* conf, Category& l
 
     log.info("building ListenerService of type %s...", plugtype.c_str());
     conf->m_listener.reset(SPConfig::getConfig().ListenerServiceManager.newPlugin(plugtype.c_str(), child, m_deprecationSupport));
+    */
 }
 
-void XMLConfigImpl::doCaching(const DOMElement* e, XMLConfig* conf, Category& log)
+void DefaultAgent::doSessionCache()
 {
+    /*
     const SPConfig& spConf = SPConfig::getConfig();
 
     DOMElement* child = XMLHelper::getFirstChildElement(e, _SessionCache);
@@ -338,5 +210,29 @@ void XMLConfigImpl::doCaching(const DOMElement* e, XMLConfig* conf, Category& lo
         log.info("no SessionCache specified, using StorageService-backed instance");
         conf->m_sessionCache.reset(spConf.SessionCacheManager.newPlugin(STORAGESERVICE_SESSION_CACHE, nullptr, m_deprecationSupport));
     }
+    */
+}
+
+void DefaultAgent::doRequestMapper()
+{
+    const boost::optional<ptree&> child = m_pt.get_child_optional("request-mapper");
+
+    /*
+    // Back to the fully dynamic stuff...next up is the RequestMapper.
+    if (child = XMLHelper::getFirstChildElement(e, _RequestMapper)) {
+        string t(XMLHelper::getAttrString(child, nullptr, _type));
+        if (!t.empty()) {
+            log.info("building RequestMapper of type %s...", t.c_str());
+            m_requestMapper.reset(conf.RequestMapperManager.newPlugin(t.c_str(), child, m_deprecationSupport));
+        }
+    }
+    if (!m_requestMapper) {
+        log.info("no RequestMapper specified, using 'Native' plugin with empty/default map");
+        child = e->getOwnerDocument()->createElementNS(nullptr, _RequestMapper);
+        DOMElement* mapperDummy = e->getOwnerDocument()->createElementNS(e->getNamespaceURI(), RequestMap);
+        mapperDummy->setAttributeNS(nullptr, applicationId, _default);
+        child->appendChild(mapperDummy);
+        m_requestMapper.reset(conf.RequestMapperManager.newPlugin(NATIVE_REQUEST_MAPPER, child, m_deprecationSupport));
+    }
+    */
 }
-*/
diff --git a/shibsp/impl/XMLAccessControl.cpp b/shibsp/impl/XMLAccessControl.cpp
index 410670bf..752c7faa 100644
--- a/shibsp/impl/XMLAccessControl.cpp
+++ b/shibsp/impl/XMLAccessControl.cpp
@@ -131,7 +131,7 @@ namespace {
 }
 
 namespace shibsp {
-    AccessControl* SHIBSP_DLLLOCAL XMLAccessControlFactory(const ptree& pt, bool deprecationSupport)
+    AccessControl* SHIBSP_DLLLOCAL XMLAccessControlFactory(ptree& pt, bool deprecationSupport)
     {
         return new XMLAccessControl(pt);
     }
diff --git a/shibsp/impl/XMLRequestMapper.cpp b/shibsp/impl/XMLRequestMapper.cpp
index cc1cec6f..341b42ad 100644
--- a/shibsp/impl/XMLRequestMapper.cpp
+++ b/shibsp/impl/XMLRequestMapper.cpp
@@ -76,7 +76,7 @@ namespace {
         }
 
     protected:
-        void loadACL(const ptree& pt, Category& log);
+        void loadACL(ptree& pt, Category& log);
 
         bool m_unicodeAware;
         // This uses shared_ptr to support multiple mappings for a given Override for Host.
@@ -117,7 +117,7 @@ namespace {
     class XMLRequestMapper : public RequestMapper, public ReloadableXMLFile
     {
     public:
-        XMLRequestMapper(const ptree& pt)
+        XMLRequestMapper(ptree& pt)
             : ReloadableXMLFile(REQUEST_MAP_PROP_PATH, pt, Category::getInstance(SHIBSP_LOGCAT ".RequestMapper")) {
             if (!load().second) {
                 throw ConfigurationException("Initial RequestMapper configuration was invalid.");
@@ -139,7 +139,7 @@ namespace {
     #pragma warning( pop )
 #endif
 
-    RequestMapper* SHIBSP_DLLLOCAL XMLRequestMapperFactory(const ptree& pt, bool deprecationSupport)
+    RequestMapper* SHIBSP_DLLLOCAL XMLRequestMapperFactory(ptree& pt, bool deprecationSupport)
     {
         return new XMLRequestMapper(pt);
     }
@@ -163,7 +163,7 @@ RequestMapper::~RequestMapper()
 {
 }
 
-void Override::loadACL(const ptree& pt, Category& log)
+void Override::loadACL(ptree& pt, Category& log)
 {
     // This method looks for a supported child element to use as the basis
     // of constructing an AccessControl plugin.
@@ -174,7 +174,7 @@ void Override::loadACL(const ptree& pt, Category& log)
     static const char TYPE_PROP_PATH[] = "<xmlattr>.type";
 
     try {
-        boost::optional<const ptree&> acl = pt.get_child_optional(HTACCESS_PROP_PATH);
+        boost::optional<ptree&> acl = pt.get_child_optional(HTACCESS_PROP_PATH);
         if (acl) {
             log.info("building Apache htaccess AccessControl provider...");
             m_acl.reset(AgentConfig::getConfig().AccessControlManager.newPlugin(HT_ACCESS_CONTROL, acl.get(), false));
diff --git a/shibsp/logging/impl/AbstractLoggingService.cpp b/shibsp/logging/impl/AbstractLoggingService.cpp
index 3531c9bf..bb44872a 100644
--- a/shibsp/logging/impl/AbstractLoggingService.cpp
+++ b/shibsp/logging/impl/AbstractLoggingService.cpp
@@ -15,8 +15,8 @@
 /**
  * logging/impl/AbstractLoggingService.cpp
  *
- * Base class for logging service implementations.
- */
+ * Base class for logging service implementations. 
+ */    
 
 #include "internal.h"
 
@@ -39,11 +39,11 @@ namespace shibsp {
         }
     };
 
-    extern LoggingService* SHIBSP_DLLLOCAL ConsoleLoggingServiceFactory(const ptree& pt, bool);
+    extern LoggingService* SHIBSP_DLLLOCAL ConsoleLoggingServiceFactory(ptree& pt, bool);
 #ifdef WIN32
-    extern LoggingService* SHIBSP_DLLLOCAL WindowsLoggingServiceFactory(const ptree& pt, bool);
+    extern LoggingService* SHIBSP_DLLLOCAL WindowsLoggingServiceFactory(ptree& pt, bool);
 #else
-    extern LoggingService* SHIBSP_DLLLOCAL SyslogLoggingServiceFactory(const ptree& pt, bool);
+    extern LoggingService* SHIBSP_DLLLOCAL SyslogLoggingServiceFactory(ptree& pt, bool);
 #endif
 }
 
@@ -60,7 +60,7 @@ void SHIBSP_API shibsp::registerLoggingServices()
 
 const char LoggingService::LOGGING_TYPE_PROP_PATH[] = "logging.type";
 const char AbstractLoggingService::CATEGORIES_SECTION_NAME[] = "logging-categories";
-const char AbstractLoggingService::DEFAULT_LEVEL_PROP_PATH[] = "logging.default-level";
+const char AbstractLoggingService::DEFAULT_LEVEL_PROP_PATH[] = "logging.defaultLevel";
 
 LoggingService::LoggingService() {}
 
diff --git a/shibsp/logging/impl/ConsoleLoggingService.cpp b/shibsp/logging/impl/ConsoleLoggingService.cpp
index 376cecbf..1968e9a2 100644
--- a/shibsp/logging/impl/ConsoleLoggingService.cpp
+++ b/shibsp/logging/impl/ConsoleLoggingService.cpp
@@ -42,7 +42,7 @@ namespace shibsp {
 
     };
 
-    LoggingService* SHIBSP_DLLLOCAL ConsoleLoggingServiceFactory(const ptree& pt, bool) {
+    LoggingService* SHIBSP_DLLLOCAL ConsoleLoggingServiceFactory(ptree& pt, bool) {
         return new ConsoleLoggingService(pt);
     }
 
@@ -63,4 +63,4 @@ void ConsoleLoggingService::outputMessage(const Category& category, Priority::Va
         << " [" << category.getName() << "] - "
         << message
         << endl;
-}
\ No newline at end of file
+}
diff --git a/shibsp/logging/impl/SyslogLoggingService.cpp b/shibsp/logging/impl/SyslogLoggingService.cpp
index e923b4bc..77072a8b 100644
--- a/shibsp/logging/impl/SyslogLoggingService.cpp
+++ b/shibsp/logging/impl/SyslogLoggingService.cpp
@@ -36,9 +36,6 @@ namespace shibsp {
     public:
         SyslogLoggingService(const ptree& pt);
 
-        static const char OPENSYSLOG_PROP_PATH[];
-        static const char FACILITY_PROP_PATH[];
-
         bool init();
         void term();
 
@@ -54,18 +51,18 @@ namespace shibsp {
         int m_facility;
     };
 
-    LoggingService* SHIBSP_DLLLOCAL SyslogLoggingServiceFactory(const ptree& pt, bool) {
+    LoggingService* SHIBSP_DLLLOCAL SyslogLoggingServiceFactory(ptree& pt, bool) {
         return new SyslogLoggingService(pt);
     }
 
 }
 
-const char SyslogLoggingService::OPENSYSLOG_PROP_PATH[] = "logging.open-syslog";
-const char SyslogLoggingService::FACILITY_PROP_PATH[] = "logging.facility";
-
 SyslogLoggingService::SyslogLoggingService(const ptree& pt)
     : AbstractLoggingService(pt), m_open(false), m_facility(LOG_USER)
 {
+    static const char OPENSYSLOG_PROP_PATH[] = "logging.openSyslog";
+    static const char FACILITY_PROP_PATH[] = "logging.facility";
+
     string opt = pt.get(OPENSYSLOG_PROP_PATH, "1");
     m_open = (opt == "1" || opt == "true");
 
diff --git a/tests/data/console-shibboleth.ini b/tests/data/console-shibboleth.ini
index b0c2fb47..a5523093 100644
--- a/tests/data/console-shibboleth.ini
+++ b/tests/data/console-shibboleth.ini
@@ -1,10 +1,15 @@
 [global]
 # Use "partial" for partial matching
-regex-matching = full
+regexMatching = full
+
+#[extensions]
+# true/false value signals whether extension failure is fatal
+#/path/to/extension.so = true
 
 [logging]
 type = console
-default-level = WARN
+defaultLevel = WARN
 
 [logging-categories]
 Shibboleth.AgentConfig = DEBUG
+
diff --git a/tests/data/fatal-exts-shibboleth.ini b/tests/data/fatal-exts-shibboleth.ini
index 6eb50679..4bed3bcd 100644
--- a/tests/data/fatal-exts-shibboleth.ini
+++ b/tests/data/fatal-exts-shibboleth.ini
@@ -3,7 +3,8 @@
 
 [logging]
 type = console
-default-level = WARN
+defaultLevel = WARN
 
 [logging-categories]
 Shibboleth.AgentConfig = DEBUG
+
diff --git a/tests/data/impl/console-shibboleth.ini b/tests/data/impl/console-shibboleth.ini
index c92d4b7b..f666b523 100644
--- a/tests/data/impl/console-shibboleth.ini
+++ b/tests/data/impl/console-shibboleth.ini
@@ -1,9 +1,10 @@
 [logging]
 type = console
-default-level = INFO
+defaultLevel = INFO
 
 [logging-categories]
 Shibboleth.AgentConfig = WARN
 Shibboleth.AccessControl = DEBUG
 Shibboleth.RequestMapper = DEBUG
 Shibboleth.DummyRequest = DEBUG
+
diff --git a/tests/data/nonfatal-exts-shibboleth.ini b/tests/data/nonfatal-exts-shibboleth.ini
index 121af6fc..cd562e2f 100644
--- a/tests/data/nonfatal-exts-shibboleth.ini
+++ b/tests/data/nonfatal-exts-shibboleth.ini
@@ -3,7 +3,8 @@
 
 [logging]
 type = console
-default-level = WARN
+defaultLevel = WARN
 
 [logging-categories]
 Shibboleth.AgentConfig = DEBUG
+
diff --git a/tests/data/syslog-shibboleth.ini b/tests/data/syslog-shibboleth.ini
index 98d0e018..44c43ba8 100644
--- a/tests/data/syslog-shibboleth.ini
+++ b/tests/data/syslog-shibboleth.ini
@@ -1,8 +1,9 @@
 [logging]
 type = syslog
-default-level = WARN
-open-syslog = true
+defaultLevel = WARN
+openSyslog = true
 facility = 32
 
 [logging-categories]
 Shibboleth.AgentConfig = WARN
+
diff --git a/tests/data/util/reloadablefile/console-shibboleth.ini b/tests/data/util/reloadablefile/console-shibboleth.ini
index dd4ff8f9..e2d06c12 100644
--- a/tests/data/util/reloadablefile/console-shibboleth.ini
+++ b/tests/data/util/reloadablefile/console-shibboleth.ini
@@ -4,4 +4,5 @@ default-level = INFO
 
 [logging-categories]
 Shibboleth.AgentConfig = DEBUG
-DummyXMLFile = DEBUG
\ No newline at end of file
+DummyXMLFile = DEBUG
+

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list