[cpp-sp] branch main updated: SSPCPP-935 - Add deprecations to all at risk features

Scott Cantor cantor.2 at osu.edu
Thu Oct 21 16:53:44 UTC 2021


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=a9dc58bf9a190ea4640d8e0cbf7fde393c351626

The following commit(s) were added to refs/heads/main by this push:
     new a9dc58bf SSPCPP-935 - Add deprecations to all at risk features
a9dc58bf is described below

commit a9dc58bf9a190ea4640d8e0cbf7fde393c351626
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Oct 21 12:53:06 2021 -0400

    SSPCPP-935 - Add deprecations to all at risk features
    
    https://shibboleth.atlassian.net/browse/SSPCPP-935
    
    Convert older warnings to use helper methods.
---
 shibsp/attribute/filtering/impl/AndMatchFunctor.cpp      | 6 ++----
 shibsp/attribute/filtering/impl/NotMatchFunctor.cpp      | 6 ++----
 shibsp/attribute/filtering/impl/OrMatchFunctor.cpp       | 6 ++----
 shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp   | 2 +-
 shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp | 2 +-
 shibsp/handler/impl/SessionInitiator.cpp                 | 2 +-
 shibsp/impl/StorageServiceSessionCache.cpp               | 2 +-
 shibsp/impl/XMLApplication.cpp                           | 8 ++++----
 shibsp/impl/XMLRequestMapper.cpp                         | 4 ++--
 shibsp/impl/XMLSecurityPolicyProvider.cpp                | 8 ++++----
 shibsp/impl/XMLServiceProvider.cpp                       | 4 ++--
 shibsp/util/DOMPropertySet.cpp                           | 2 +-
 12 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp b/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp
index 051ac702..533615dc 100644
--- a/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp
@@ -96,8 +96,7 @@ AndMatchFunctor::AndMatchFunctor(const pair<const FilterPolicyContext*,const DOM
 
         if (XMLString::equals(e->getNamespaceURI(), shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS)) {
             auto_ptr_char ns(e->getNamespaceURI());
-            Category::getInstance(SHIBSP_LOGCAT ".AttributeFilter.AND").warn(
-                "Legacy filter namespace '%s' is DEPRECATED and will be removed from a future version.", ns.get());
+            SPConfig::getConfig().deprecation().warn("legacy Attribute Filter namespace '%s'", ns.get());
         }
 
         if (XMLString::equals(e->getLocalName(), Rule)) {
@@ -133,8 +132,7 @@ MatchFunctor* AndMatchFunctor::buildFunctor(const DOMElement* e, const FilterPol
         XMLString::equals(type->getNamespaceURI(), shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS)) {
 
         auto_ptr_char ns(type->getNamespaceURI());
-        Category::getInstance(SHIBSP_LOGCAT ".AttributeFilter.AND").warn(
-            "Legacy filter namespace '%s' is DEPRECATED and will be removed from a future version.", ns.get());
+        SPConfig::getConfig().deprecation().warn("legacy Attribute Filter namespace '%s'", ns.get());
     }
 
     auto_ptr<MatchFunctor> func(SPConfig::getConfig().MatchFunctorManager.newPlugin(*type, make_pair(functorMap,e), deprecationSupport));
diff --git a/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp b/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp
index 2873e6a2..82351fae 100644
--- a/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp
@@ -84,8 +84,7 @@ NotMatchFunctor::NotMatchFunctor(const pair<const FilterPolicyContext*,const DOM
 
         if (XMLString::equals(e->getNamespaceURI(), shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS)) {
             auto_ptr_char ns(e->getNamespaceURI());
-            Category::getInstance(SHIBSP_LOGCAT ".AttributeFilter.NOT").warn(
-                "Legacy filter namespace '%s' is DEPRECATED and will be removed from a future version.", ns.get());
+            SPConfig::getConfig().deprecation().warn("legacy Attribute Filter namespace '%s'", ns.get());
         }
 
         if (XMLString::equals(e->getLocalName(), Rule)) {
@@ -119,8 +118,7 @@ MatchFunctor* NotMatchFunctor::buildFunctor(const DOMElement* e, const FilterPol
         XMLString::equals(type->getNamespaceURI(), shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS)) {
 
         auto_ptr_char ns(type->getNamespaceURI());
-        Category::getInstance(SHIBSP_LOGCAT ".AttributeFilter.NOT").warn(
-            "Legacy filter namespace '%s' is DEPRECATED and will be removed from a future version.", ns.get());
+        SPConfig::getConfig().deprecation().warn("legacy Attribute Filter namespace '%s'", ns.get());
     }
 
     auto_ptr<MatchFunctor> func(SPConfig::getConfig().MatchFunctorManager.newPlugin(*type, make_pair(functorMap,e), deprecationSupport));
diff --git a/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp b/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp
index 5ca24107..c6de23aa 100644
--- a/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp
@@ -92,8 +92,7 @@ OrMatchFunctor::OrMatchFunctor(const pair<const FilterPolicyContext*,const DOMEl
 
         if (XMLString::equals(e->getNamespaceURI(), shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS)) {
             auto_ptr_char ns(e->getNamespaceURI());
-            Category::getInstance(SHIBSP_LOGCAT ".AttributeFilter.OR").warn(
-                "Legacy filter namespace '%s' is DEPRECATED and will be removed from a future version.", ns.get());
+            SPConfig::getConfig().deprecation().warn("legacy Attribute Filter namespace '%s'", ns.get());
         }
 
         if (XMLString::equals(e->getLocalName(), Rule)) {
@@ -129,8 +128,7 @@ MatchFunctor* OrMatchFunctor::buildFunctor(const DOMElement* e, const FilterPoli
         XMLString::equals(type->getNamespaceURI(), shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS)) {
 
         auto_ptr_char ns(type->getNamespaceURI());
-        Category::getInstance(SHIBSP_LOGCAT ".AttributeFilter.OR").warn(
-            "Legacy filter namespace '%s' is DEPRECATED and will be removed from a future version.", ns.get());
+        SPConfig::getConfig().deprecation().warn("legacy Attribute Filter namespace '%s'", ns.get());
     }
 
     auto_ptr<MatchFunctor> func(SPConfig::getConfig().MatchFunctorManager.newPlugin(*type, make_pair(functorMap,e), deprecationSupport));
diff --git a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp
index 3bce0bba..887e77a2 100644
--- a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp
+++ b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp
@@ -251,7 +251,7 @@ MatchFunctor* XMLFilterImpl::buildFunctor(
             XMLString::equals(type->getNamespaceURI(), shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS)) {
 
             auto_ptr_char ns(type->getNamespaceURI());
-            m_log.warn("Legacy filter namespace '%s' is DEPRECATED and will be removed from a future version.", ns.get());
+            SPConfig::getConfig().deprecation().warn("legacy Attribute Filter namespace '%s'", ns.get());
         }
 
         try {
diff --git a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
index 7022de3e..927788c8 100644
--- a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
+++ b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
@@ -369,7 +369,7 @@ XMLExtractorImpl::XMLExtractorImpl(const DOMElement* e, Category& log, bool depr
         if (deprecationSupport) {
             name = child->getAttributeNS(nullptr, _aliases);
             if (name && *name) {
-                m_log.warn("DEPRECATED: attribute mapping rule (%s) uses deprecated aliases feature", id.get());
+                SPConfig::getConfig().deprecation().warn("attribute mapping rule (%s) uses deprecated aliases feature", id.get());
                 auto_ptr_char aliases(name);
                 string dup(aliases.get());
                 set<string> new_aliases;
diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp
index c6b2a661..14a36531 100644
--- a/shibsp/handler/impl/SessionInitiator.cpp
+++ b/shibsp/handler/impl/SessionInitiator.cpp
@@ -74,7 +74,7 @@ SessionInitiator::~SessionInitiator()
 const char* SessionInitiator::remap(const char* src, Category& log) const
 {
     if (XMLString::equals(src, "defaultACSIndex")) {
-        log.warn("DEPRECATED configuration - remapping property/set (%s) to (%s)", src, "acsIndex");
+        SPConfig::getConfig().deprecation().warn("old setting - remapping property (defaultACSIndex) to (acsIndex)");
         return "acsIndex";
     }
     else {
diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp
index a8d5c64b..796eb20e 100644
--- a/shibsp/impl/StorageServiceSessionCache.cpp
+++ b/shibsp/impl/StorageServiceSessionCache.cpp
@@ -122,7 +122,7 @@ SSCache::SSCache(const DOMElement* e, bool deprecationSupport)
     static const XMLCh _unreliableNetworks[] =  UNICODE_LITERAL_18(u,n,r,e,l,i,a,b,l,e,N,e,t,w,o,r,k,s);
 
     if (e && e->hasAttributeNS(nullptr, cacheTimeout)) {
-        m_log.warn("DEPRECATED: cacheTimeout property is replaced by cacheAllowance (see documentation)");
+        SPConfig::getConfig().deprecation().warn("cacheTimeout property replaced by cacheAllowance (see documentation)");
         m_cacheTimeout = XMLHelper::getAttrInt(e, 0, cacheTimeout);
     }
     m_cacheAllowance = XMLHelper::getAttrInt(e, 0, cacheAllowance);
diff --git a/shibsp/impl/XMLApplication.cpp b/shibsp/impl/XMLApplication.cpp
index 707bd5f2..4720320b 100644
--- a/shibsp/impl/XMLApplication.cpp
+++ b/shibsp/impl/XMLApplication.cpp
@@ -153,15 +153,15 @@ XMLApplication::XMLApplication(
                     m_redirectLimit = REDIRECT_LIMIT_ALLOW;
                 }
                 else if (!strcmp(prop.second, "exact+whitelist")) {
-                    log.warn("DEPRECATED: redirectLimit of \"exact+whitelist\" replaced by \"exact+allow\"");
+                    SPConfig::getConfig().deprecation().warn("redirectLimit of \"exact+whitelist\" replaced by \"exact+allow\"");
                     m_redirectLimit = REDIRECT_LIMIT_EXACT_ALLOW;
                 }
                 else if (!strcmp(prop.second, "host+whitelist")) {
-                    log.warn("DEPRECATED: redirectLimit of \"host+whitelist\" replaced by \"host+allow\"");
+                    SPConfig::getConfig().deprecation().warn("redirectLimit of \"host+whitelist\" replaced by \"host+allow\"");
                     m_redirectLimit = REDIRECT_LIMIT_HOST_ALLOW;
                 }
                 else if (!strcmp(prop.second, "whitelist")) {
-                    log.warn("DEPRECATED: redirectLimit of \"whitelist\" replaced by \"allow\"");
+                    SPConfig::getConfig().deprecation().warn("redirectLimit of \"whitelist\" replaced by \"allow\"");
                     m_redirectLimit = REDIRECT_LIMIT_ALLOW;
                 }
                 else {
@@ -248,7 +248,7 @@ XMLApplication::XMLApplication(
 #ifndef SHIBSP_LITE
     nlist = e->getElementsByTagNameNS(samlconstants::SAML20_NS, Audience::LOCAL_NAME);
     if (nlist && nlist->getLength()) {
-        log.warn("DEPRECATED: use of <saml:Audience> elements outside of a Security Policy Rule");
+        SPConfig::getConfig().deprecation().warn("use of <saml:Audience> elements outside of a Security Policy Rule");
         for (XMLSize_t i = 0; i < nlist->getLength(); ++i)
             if (nlist->item(i)->getParentNode()->isSameNode(e) && nlist->item(i)->hasChildNodes())
                 m_audiences.push_back(nlist->item(i)->getFirstChild()->getNodeValue());
diff --git a/shibsp/impl/XMLRequestMapper.cpp b/shibsp/impl/XMLRequestMapper.cpp
index de6ae01d..9e7ffae1 100644
--- a/shibsp/impl/XMLRequestMapper.cpp
+++ b/shibsp/impl/XMLRequestMapper.cpp
@@ -317,7 +317,7 @@ Override::Override(bool unicodeAware, const DOMElement* e, Category& log, const
             if (path && path->hasAttributeNS(nullptr, ignoreCase)) {
                 // In this one case, we've left ignoreCase reversed (true means case sensitive, false means insensitive).
                 // This was to protect people who followed the security advisory for SSPCPP-691 and reversed their setting.
-                log.error("DEPRECATED: ignoreCase attribute in PathRegex element will be interpreted backwards. Replace with caseSensitive");
+                SPConfig::getConfig().deprecation().error("ignoreCase attribute in PathRegex element will be interpreted backwards. Replace with caseSensitive");
                 caseSensitive = XMLHelper::getAttrBool(path, true, ignoreCase);
             } else {
                 // If the old ignoreCase setting isn't set, then we just process normally.
@@ -509,7 +509,7 @@ XMLRequestMapperImpl::XMLRequestMapperImpl(const DOMElement* e, Category& log) :
     }
 
     if (XMLString::equals(e->getNamespaceURI(), shibspconstants::SHIB2SPCONFIG_NS)) {
-        log.warn("DEPRECATED: legacy 2.0 configuration, support will be removed from a future version of the software");
+        SPConfig::getConfig().deprecation().warn("legacy V2 configuration");
     }
 
     // Load the property set.
diff --git a/shibsp/impl/XMLSecurityPolicyProvider.cpp b/shibsp/impl/XMLSecurityPolicyProvider.cpp
index f3ac2ca4..a091a9d3 100644
--- a/shibsp/impl/XMLSecurityPolicyProvider.cpp
+++ b/shibsp/impl/XMLSecurityPolicyProvider.cpp
@@ -245,14 +245,14 @@ XMLSecurityPolicyProviderImpl::XMLSecurityPolicyProviderImpl(const DOMElement* e
 
     bool deprecationSupport = false;
     if (XMLString::equals(e->getNamespaceURI(), shibspconstants::SHIB2SPCONFIG_NS)) {
-        log.warn("DEPRECATED: legacy 2.0 configuration, support will be removed from a future version of the software");
+        SPConfig::getConfig().deprecation().warn("legacy V2 configuration");
         deprecationSupport = true;
     }
 
     const XMLCh* algs = nullptr;
     const DOMElement* alglist = XMLHelper::getLastChildElement(e, AlgorithmBlacklist);
     if (alglist) {
-        log.warn("DEPRECATED: <AlgorithmBlacklist> and includeDefaultBlacklist replaced by <ExcludedAlgorithms> and excludeDefaults");
+        SPConfig::getConfig().deprecation().warn("<AlgorithmBlacklist> and includeDefaultBlacklist replaced by <ExcludedAlgorithms> and excludeDefaults");
         m_excludeDefaults = XMLHelper::getAttrBool(alglist, true, includeDefaultBlacklist);
         if (alglist->hasChildNodes()) {
             algs = alglist->getFirstChild()->getNodeValue();
@@ -261,7 +261,7 @@ XMLSecurityPolicyProviderImpl::XMLSecurityPolicyProviderImpl(const DOMElement* e
     else {
         alglist = XMLHelper::getLastChildElement(e, AlgorithmWhitelist);
         if (alglist) {
-            log.warn("DEPRECATED: <AlgorithmWhitelist> replaced by <IncludedAlgorithms>");
+            SPConfig::getConfig().deprecation().warn("<AlgorithmWhitelist> replaced by <IncludedAlgorithms>");
             if (alglist->hasChildNodes()) {
                 algs = alglist->getFirstChild()->getNodeValue();
             }
@@ -335,7 +335,7 @@ XMLSecurityPolicyProviderImpl::XMLSecurityPolicyProviderImpl(const DOMElement* e
 
         if (rules.second.size() == 0) {
             // Process Rule elements.
-            log.warn("DEPRECATED: Rule elements detected, convert to PolicyRule syntax");
+            SPConfig::getConfig().deprecation().warn("Rule elements detected, convert to PolicyRule syntax");
             rule = XMLHelper::getFirstChildElement(e, Rule);
             while (rule) {
                 string t(XMLHelper::getAttrString(rule, nullptr, _type));
diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp
index 9b58543c..14a3a22a 100644
--- a/shibsp/impl/XMLServiceProvider.cpp
+++ b/shibsp/impl/XMLServiceProvider.cpp
@@ -382,7 +382,7 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, XMLConfig* outer,
 #endif
 
     if (XMLString::equals(e->getNamespaceURI(), shibspconstants::SHIB2SPCONFIG_NS)) {
-        log.warn("DEPRECATED: legacy 2.0 configuration, support will be removed from a future version of the software");
+        SPConfig::getConfig().deprecation().warn("legacy V2 configuration");
         m_deprecationSupport = true;
     }
 
@@ -494,7 +494,7 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, XMLConfig* outer,
         // For backward compatibility, wrap in a plugin element.
         DOMElement* polwrapper = e->getOwnerDocument()->createElementNS(nullptr, _SecurityPolicyProvider);
         polwrapper->appendChild(child);
-        log.warn("DEPRECATED: inline SecurityPolicy configuration, externalize via <SecurityPolicyProvider>");
+        SPConfig::getConfig().deprecation().warn("inline SecurityPolicy configuration, externalize via <SecurityPolicyProvider>");
         m_policy.reset(conf.SecurityPolicyProviderManager.newPlugin(XML_SECURITYPOLICY_PROVIDER, polwrapper, m_deprecationSupport));
     }
     else {
diff --git a/shibsp/util/DOMPropertySet.cpp b/shibsp/util/DOMPropertySet.cpp
index 961b4558..f50f5007 100644
--- a/shibsp/util/DOMPropertySet.cpp
+++ b/shibsp/util/DOMPropertySet.cpp
@@ -68,7 +68,7 @@ const char* DOMPropertySet::STLRemapper::remap(const char* src, xmltooling::logg
 {
     map<string,string>::const_iterator i = src ? m_rules.find(src) : m_rules.end();
     if (i != m_rules.end()) {
-        log.info("DEPRECATED: legacy configuration, remapping property/set (%s) to (%s)", src, i->second.c_str());
+        SPConfig::getConfig().deprecation().warn("legacy configuration, remapping property/set (%s) to (%s)", src, i->second.c_str());
         return i->second.c_str();
     }
     else {

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


More information about the commits mailing list