[cpp-sp] branch main updated: Migrate off custom logging constants.
Scott Cantor
cantor.2 at osu.edu
Tue Dec 31 16:52:31 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=f04faafa81de9902925da6791ab04367fbeb9d36
The following commit(s) were added to refs/heads/main by this push:
new f04faafa Migrate off custom logging constants.
f04faafa is described below
commit f04faafa81de9902925da6791ab04367fbeb9d36
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Dec 31 11:52:26 2024 -0500
Migrate off custom logging constants.
---
apache/mod_shib_24.cpp | 58 ++++++++++++-------------
shibsp/AbstractSPRequest.cpp | 19 ++------
shibsp/AbstractSPRequest.h | 4 +-
shibsp/SPConfig.cpp | 2 -
shibsp/SPRequest.h | 14 ++----
shibsp/ServiceProvider.cpp | 8 ++--
shibsp/handler/AbstractHandler.h | 2 +-
shibsp/handler/Handler.h | 29 ++++++-------
shibsp/handler/LogoutInitiator.h | 11 -----
shibsp/handler/SessionInitiator.h | 9 ----
shibsp/handler/impl/AbstractHandler.cpp | 50 ++++++++++-----------
shibsp/handler/impl/AttributeCheckerHandler.cpp | 4 +-
shibsp/handler/impl/DiscoveryFeed.cpp | 2 +-
shibsp/handler/impl/LogoutInitiator.cpp | 14 ------
shibsp/handler/impl/SAML2SessionInitiator.cpp | 15 ++-----
shibsp/handler/impl/SecuredHandler.cpp | 2 +-
shibsp/handler/impl/SessionInitiator.cpp | 19 ++------
shibsp/impl/ChainingAccessControl.cpp | 6 +--
shibsp/impl/DefaultAgent.cpp | 36 +++++----------
shibsp/impl/XMLAccessControl.cpp | 28 ++++++------
shibsp/impl/XMLApplication.cpp | 4 --
21 files changed, 116 insertions(+), 220 deletions(-)
diff --git a/apache/mod_shib_24.cpp b/apache/mod_shib_24.cpp
index 249e0cad..88afc53f 100644
--- a/apache/mod_shib_24.cpp
+++ b/apache/mod_shib_24.cpp
@@ -363,7 +363,7 @@ public:
m_firsttime = false;
}
if (!m_firsttime)
- log(SPDebug, "shib_check_user running more than once");
+ log(Priority::SHIB_DEBUG, "shib_check_user running more than once");
}
return true;
}
@@ -400,14 +400,14 @@ public:
return ret;
return m_req->useragent_ip;
}
- void log(SPLogLevel level, const string& msg) const {
+ void log(Priority::Value level, const string& msg) const {
AbstractSPRequest::log(level,msg);
ap_log_rerror(
APLOG_MARK,
- (level == SPDebug ? APLOG_DEBUG :
- (level == SPInfo ? APLOG_INFO :
- (level == SPWarn ? APLOG_WARNING :
- (level == SPError ? APLOG_ERR : APLOG_CRIT))))|APLOG_NOERRNO,
+ (level == Priority::SHIB_DEBUG ? APLOG_DEBUG :
+ (level == Priority::SHIB_INFO ? APLOG_INFO :
+ (level == Priority::SHIB_WARN ? APLOG_WARNING :
+ (level == Priority::SHIB_ERROR ? APLOG_ERR : APLOG_CRIT))))|APLOG_NOERRNO,
0, m_req,
"%s",
msg.c_str()
@@ -426,7 +426,7 @@ public:
apr_bucket *bucket;
apr_status_t rv = ap_get_brigade(m_req->input_filters, bb, AP_MODE_READBYTES, APR_BLOCK_READ, HUGE_STRING_LEN);
if (rv != APR_SUCCESS) {
- log(SPError, "Apache function (ap_get_brigade) failed while reading request body.");
+ log(Priority::SHIB_ERROR, "Apache function (ap_get_brigade) failed while reading request body.");
break;
}
@@ -852,7 +852,7 @@ AccessControl::aclresult_t htAccessControl::doAccessControl(const ShibTargetApac
result = aclplugin->authorized(sta, session);
}
catch (const xml_parser_error& e) {
- sta.log(SPRequest::SPError, e.what());
+ sta.log(Priority::SHIB_ERROR, e.what());
}
return result;
}
@@ -884,7 +884,7 @@ AccessControl::aclresult_t htAccessControl::doUser(const ShibTargetApache& sta,
match = exp::regex_match(sta.getRemoteUser(), re, exp::regex_constants::match_any | exp::regex_constants::match_not_null);
}
catch (const exp::regex_error& e) {
- sta.log(SPRequest::SPError,
+ sta.log(Priority::SHIB_ERROR,
string("htaccess plugin caught exception while parsing regular expression (") + w + "): " + e.what());
}
}
@@ -893,8 +893,8 @@ AccessControl::aclresult_t htAccessControl::doUser(const ShibTargetApache& sta,
}
if (match) {
- if (sta.isPriorityEnabled(SPRequest::SPDebug))
- sta.log(SPRequest::SPDebug,
+ if (sta.isPriorityEnabled(Priority::SHIB_DEBUG))
+ sta.log(Priority::SHIB_DEBUG,
string("htaccess: require user ") + (negated ? "rejecting (" : "accepting (") + sta.getRemoteUser() + ")");
return (negated ? shib_acl_false : shib_acl_true);
}
@@ -929,7 +929,7 @@ AccessControl::aclresult_t htAccessControl::doAuthnContext(const ShibTargetApach
match = exp::regex_match(ref, re, exp::regex_constants::match_any | exp::regex_constants::match_not_null);
}
catch (const exp::regex_error& e) {
- sta.log(SPRequest::SPError,
+ sta.log(Priority::SHIB_ERROR,
string("htaccess plugin caught exception while parsing regular expression (") + w + "): " + e.what());
}
}
@@ -938,8 +938,8 @@ AccessControl::aclresult_t htAccessControl::doAuthnContext(const ShibTargetApach
}
if (match) {
- if (sta.isPriorityEnabled(SPRequest::SPDebug))
- sta.log(SPRequest::SPDebug,
+ if (sta.isPriorityEnabled(Priority::SHIB_DEBUG))
+ sta.log(Priority::SHIB_DEBUG,
string("htaccess: require authnContext ") + (negated ? "rejecting (" : "accepting (") + ref + ")");
return (negated ? shib_acl_false : shib_acl_true);
}
@@ -947,8 +947,8 @@ AccessControl::aclresult_t htAccessControl::doAuthnContext(const ShibTargetApach
return (negated ? shib_acl_true : shib_acl_false);
}
- if (sta.isPriorityEnabled(SPRequest::SPDebug))
- sta.log(SPRequest::SPDebug, "htaccess: require authnContext rejecting session with no context associated");
+ if (sta.isPriorityEnabled(Priority::SHIB_DEBUG))
+ sta.log(Priority::SHIB_DEBUG, "htaccess: require authnContext rejecting session with no context associated");
return shib_acl_false;
}
@@ -965,22 +965,22 @@ bool htAccessControl::checkAttribute(const SPRequest& request, const Attribute*
try {
exp::regex exp(toMatch, flags);
if (exp::regex_match(*v, exp, exp::regex_constants::match_any | exp::regex_constants::match_not_null)) {
- if (request.isPriorityEnabled(SPRequest::SPDebug))
- request.log(SPRequest::SPDebug, string("htaccess: expecting regexp ") + toMatch + ", got " + *v + ": accepted");
+ if (request.isPriorityEnabled(Priority::SHIB_DEBUG))
+ request.log(Priority::SHIB_DEBUG, string("htaccess: expecting regexp ") + toMatch + ", got " + *v + ": accepted");
return true;
}
} catch (const exp::regex_error& e) {
- request.log(SPRequest::SPError,
+ request.log(Priority::SHIB_ERROR,
string("htaccess plugin caught exception while parsing regular expression (") + toMatch + "): " + e.what());
}
}
else if ((caseSensitive && *v == toMatch) || (!caseSensitive && !strcasecmp(v->c_str(), toMatch))) {
- if (request.isPriorityEnabled(SPRequest::SPDebug))
- request.log(SPRequest::SPDebug, string("htaccess: expecting ") + toMatch + ", got " + *v + ": accepted");
+ if (request.isPriorityEnabled(Priority::SHIB_DEBUG))
+ request.log(Priority::SHIB_DEBUG, string("htaccess: expecting ") + toMatch + ", got " + *v + ": accepted");
return true;
}
- else if (request.isPriorityEnabled(SPRequest::SPDebug)) {
- request.log(SPRequest::SPDebug, string("htaccess: expecting ") + toMatch + ", got " + *v + ": rejected");
+ else if (request.isPriorityEnabled(Priority::SHIB_DEBUG)) {
+ request.log(Priority::SHIB_DEBUG, string("htaccess: expecting ") + toMatch + ", got " + *v + ": rejected");
}
}
return false;
@@ -1188,15 +1188,15 @@ extern "C" authz_status shib_session_check_authz(request_rec* r, const char*, co
Session* session = sta.first->getSession(false, true, false);
lock_guard<Session> slocker(*session, adopt_lock);
if (session) {
- sta.first->log(SPRequest::SPDebug, "htaccess: accepting shib-session/valid-user based on active session");
+ sta.first->log(Priority::SHIB_DEBUG, "htaccess: accepting shib-session/valid-user based on active session");
return AUTHZ_GRANTED;
}
}
catch (std::exception& e) {
- sta.first->log(SPRequest::SPWarn, string("htaccess: unable to obtain session for access control check: ") + e.what());
+ sta.first->log(Priority::SHIB_WARN, string("htaccess: unable to obtain session for access control check: ") + e.what());
}
- sta.first->log(SPRequest::SPDebug, "htaccess: denying shib-access/valid-user rule, no active session");
+ sta.first->log(Priority::SHIB_DEBUG, "htaccess: denying shib-access/valid-user rule, no active session");
return AUTHZ_DENIED_NO_USER;
}
@@ -1289,7 +1289,7 @@ extern "C" authz_status shib_acclass_check_authz(request_rec* r, const char* req
return session ? AUTHZ_DENIED : AUTHZ_DENIED_NO_USER;
}
catch (std::exception& e) {
- sta.first->log(SPRequest::SPWarn, string("htaccess: unable to obtain session for access control check: ") + e.what());
+ sta.first->log(Priority::SHIB_WARN, string("htaccess: unable to obtain session for access control check: ") + e.what());
}
return AUTHZ_GENERAL_ERROR;
@@ -1314,7 +1314,7 @@ extern "C" authz_status shib_attr_check_authz(request_rec* r, const char* requir
return session ? AUTHZ_DENIED : AUTHZ_DENIED_NO_USER;
}
catch (std::exception& e) {
- sta.first->log(SPRequest::SPWarn, string("htaccess: unable to obtain session for access control check: ") + e.what());
+ sta.first->log(Priority::SHIB_WARN, string("htaccess: unable to obtain session for access control check: ") + e.what());
}
return AUTHZ_GENERAL_ERROR;
@@ -1339,7 +1339,7 @@ extern "C" authz_status shib_plugin_check_authz(request_rec* r, const char* requ
return session ? AUTHZ_DENIED : AUTHZ_DENIED_NO_USER;
}
catch (std::exception& e) {
- sta.first->log(SPRequest::SPWarn, string("htaccess: unable to obtain session for access control check: ") + e.what());
+ sta.first->log(Priority::SHIB_WARN, string("htaccess: unable to obtain session for access control check: ") + e.what());
}
return AUTHZ_GENERAL_ERROR;
diff --git a/shibsp/AbstractSPRequest.cpp b/shibsp/AbstractSPRequest.cpp
index c14ac6e1..515f517a 100644
--- a/shibsp/AbstractSPRequest.cpp
+++ b/shibsp/AbstractSPRequest.cpp
@@ -342,23 +342,12 @@ void AbstractSPRequest::setCookie(const char* name, const char* value, time_t ex
}
}
-void AbstractSPRequest::log(SPLogLevel level, const std::string& msg) const
+void AbstractSPRequest::log(Priority::Value level, const std::string& msg) const
{
- m_log.log(
- (level == SPDebug ? Priority::SHIB_DEBUG :
- (level == SPInfo ? Priority::SHIB_INFO :
- (level == SPWarn ? Priority::SHIB_WARN :
- (level == SPError ? Priority::SHIB_ERROR : Priority::SHIB_CRIT)))),
- msg
- );
+ m_log.log(level, msg);
}
-bool AbstractSPRequest::isPriorityEnabled(SPLogLevel level) const
+bool AbstractSPRequest::isPriorityEnabled(Priority::Value level) const
{
- return m_log.isPriorityEnabled(
- (level == SPDebug ? Priority::SHIB_DEBUG :
- (level == SPInfo ? Priority::SHIB_INFO :
- (level == SPWarn ? Priority::SHIB_WARN :
- (level == SPError ? Priority::SHIB_ERROR : Priority::SHIB_CRIT))))
- );
+ return m_log.isPriorityEnabled(level);
}
diff --git a/shibsp/AbstractSPRequest.h b/shibsp/AbstractSPRequest.h
index 132d3e16..5f57b124 100644
--- a/shibsp/AbstractSPRequest.h
+++ b/shibsp/AbstractSPRequest.h
@@ -73,8 +73,8 @@ namespace shibsp {
const char* getCookie(const char* name) const;
void setAuthType(const char* authtype);
void setCookie(const char* name, const char* value, time_t expires = 0, samesite_t sameSite = SAMESITE_ABSENT);
- void log(SPLogLevel level, const std::string& msg) const;
- bool isPriorityEnabled(SPLogLevel level) const;
+ void log(Priority::Value level, const std::string& msg) const;
+ bool isPriorityEnabled(Priority::Value level) const;
private:
Category& m_log;
diff --git a/shibsp/SPConfig.cpp b/shibsp/SPConfig.cpp
index 5840a036..eb53207a 100644
--- a/shibsp/SPConfig.cpp
+++ b/shibsp/SPConfig.cpp
@@ -150,8 +150,6 @@ bool SPConfig::init(const char* catalog_path, const char* inst_prefix)
if (isEnabled(Handlers)) {
registerHandlers();
- registerLogoutInitiators();
- registerSessionInitiators();
}
registerServiceProviders();
diff --git a/shibsp/SPRequest.h b/shibsp/SPRequest.h
index 4eeab88f..09303e76 100644
--- a/shibsp/SPRequest.h
+++ b/shibsp/SPRequest.h
@@ -24,6 +24,7 @@
#include <shibsp/RequestMapper.h>
#include <shibsp/io/HTTPRequest.h>
#include <shibsp/io/HTTPResponse.h>
+#include <shibsp/logging/Priority.h>
namespace shibsp {
@@ -128,22 +129,13 @@ namespace shibsp {
*/
virtual void setAuthType(const char* authtype)=0;
- /** Portable logging levels. */
- enum SPLogLevel {
- SPDebug,
- SPInfo,
- SPWarn,
- SPError,
- SPCrit
- };
-
/**
* Log to native server environment.
*
* @param level logging level
* @param msg message to log
*/
- virtual void log(SPLogLevel level, const std::string& msg) const=0;
+ virtual void log(Priority::Value level, const std::string& msg) const=0;
/**
* Test logging level.
@@ -151,7 +143,7 @@ namespace shibsp {
* @param level logging level
* @return true iff logging level is enabled
*/
- virtual bool isPriorityEnabled(SPLogLevel level) const=0;
+ virtual bool isPriorityEnabled(Priority::Value level) const=0;
/**
* Indicates that processing was declined, meaning no action is required during this phase of processing.
diff --git a/shibsp/ServiceProvider.cpp b/shibsp/ServiceProvider.cpp
index 7363012c..60800a51 100644
--- a/shibsp/ServiceProvider.cpp
+++ b/shibsp/ServiceProvider.cpp
@@ -427,7 +427,7 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
return make_pair(false,0L);
}
catch (const exception& e) {
- request.log(SPRequest::SPError, e.what());
+ request.log(Priority::SHIB_ERROR, e.what());
TemplateParameters tp(&e);
tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?'));
return make_pair(true, sendError(log, request, app, "session", tp));
@@ -498,7 +498,7 @@ pair<bool,long> ServiceProvider::doAuthorization(SPRequest& request) const
}
}
catch (const exception& e) {
- request.log(SPRequest::SPError, e.what());
+ request.log(Priority::SHIB_ERROR, e.what());
TemplateParameters tp(&e, nullptr, session);
tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?'));
return make_pair(true, sendError(log, request, app, "access", tp));
@@ -586,7 +586,7 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
return make_pair(false,0L);
}
catch (const exception& e) {
- request.log(SPRequest::SPError, e.what());
+ request.log(Priority::SHIB_ERROR, e.what());
TemplateParameters tp(&e, nullptr, session);
tp.m_map["requestURL"] = targetURL.substr(0,targetURL.find('?'));
return make_pair(true, sendError(log, request, app, "session", tp));
@@ -661,7 +661,7 @@ pair<bool,long> ServiceProvider::doHandler(SPRequest& request) const
throw ConfigurationException("Configured Shibboleth handler failed to process the request.");
}
catch (const exception& e) {
- request.log(SPRequest::SPError, e.what());
+ request.log(Priority::SHIB_ERROR, e.what());
Session* session = nullptr;
try {
session = request.getSession(false, true, false); // do not cache
diff --git a/shibsp/handler/AbstractHandler.h b/shibsp/handler/AbstractHandler.h
index 3b0bba11..e7c8d7e8 100644
--- a/shibsp/handler/AbstractHandler.h
+++ b/shibsp/handler/AbstractHandler.h
@@ -64,7 +64,7 @@ namespace shibsp {
const Remapper* remapper=nullptr
);
- void log(SPRequest::SPLogLevel level, const std::string& msg) const;
+ void log(Priority::Value level, const std::string& msg) const;
#ifndef SHIBSP_LITE
/**
diff --git a/shibsp/handler/Handler.h b/shibsp/handler/Handler.h
index c9e1d742..b9a25676 100644
--- a/shibsp/handler/Handler.h
+++ b/shibsp/handler/Handler.h
@@ -28,6 +28,7 @@
#define __shibsp_handler_h__
#include <shibsp/SPRequest.h>
+#include <shibsp/logging/Priority.h>
#include <shibsp/util/PropertySet.h>
namespace shibsp {
@@ -50,7 +51,7 @@ namespace shibsp {
* @param level logging level
* @param msg message to log
*/
- virtual void log(SPRequest::SPLogLevel level, const std::string& msg) const;
+ virtual void log(Priority::Value level, const std::string& msg) const;
/**
* Prevents unused relay state from building up by cleaning old state from the client.
@@ -105,13 +106,6 @@ namespace shibsp {
public:
virtual ~Handler();
- /**
- * Returns an identifier for the protocol family associated with the handler, if any.
- *
- * @return a protocol identifier, or nullptr
- */
- virtual const XMLCh* getProtocolFamily() const;
-
/**
* Executes handler functionality as an incoming request.
*
@@ -135,17 +129,20 @@ namespace shibsp {
/** Registers Handler implementations. */
void SHIBSP_API registerHandlers();
- /** Handler for SAML 2.0 SSO. */
- #define SAML20_ASSERTION_CONSUMER_SERVICE "SAML2"
+ /** SessionInitiator that supports SAML 2.0 AuthnRequests. */
+ #define SESSION_INITIATOR "SessionInitiator"
+
+ /** Handler for SSO token handling (the inbound side of SSO). */
+ #define TOKEN_CONSUMER_HANDLER "TokenConsumer"
- /** Handler for SAML 2.0 SLO. */
- #define SAML20_LOGOUT_HANDLER "SAML2"
+ /** Handler for logout. */
+ #define LOGOUT_INITIATOR_HANDLER "LogoutInitiator"
- /** Handler for SAML 2.0 NIM. */
- #define SAML20_NAMEID_MGMT_SERVICE "SAML2"
+ /** Handler for logout. */
+ #define LOGOUT_CONSUMER_HANDLER "LogoutConsumer"
- /** Handler for SAML 2.0 Artifact Resolution. */
- #define SAML20_ARTIFACT_RESOLUTION_SERVICE "SAML2"
+ /** LogoutInitiator that supports administrative logout. */
+ #define ADMIN_LOGOUT "AdminLogout"
/** Handler for hooking new sessions with attribute checking. */
#define ATTR_CHECKER_HANDLER "AttributeChecker"
diff --git a/shibsp/handler/LogoutInitiator.h b/shibsp/handler/LogoutInitiator.h
index f1505670..bb2532a7 100644
--- a/shibsp/handler/LogoutInitiator.h
+++ b/shibsp/handler/LogoutInitiator.h
@@ -41,18 +41,7 @@ namespace shibsp {
public:
virtual ~LogoutInitiator();
};
-
- /** Registers LogoutInitiator implementations. */
- void SHIBSP_API registerLogoutInitiators();
- /** LogoutInitiator that supports administrative logout. */
- #define ADMIN_LOGOUT_INITIATOR "Admin"
-
- /** LogoutInitiator that supports SAML 2.0 LogoutRequests. */
- #define SAML2_LOGOUT_INITIATOR "SAML2"
-
- /** LogoutInitiator that supports local-only logout. */
- #define LOCAL_LOGOUT_INITIATOR "Local"
};
#endif /* __shibsp_logoutinitiator_h__ */
diff --git a/shibsp/handler/SessionInitiator.h b/shibsp/handler/SessionInitiator.h
index aee9ff4d..3a134209 100644
--- a/shibsp/handler/SessionInitiator.h
+++ b/shibsp/handler/SessionInitiator.h
@@ -96,15 +96,6 @@ namespace shibsp {
const char* remap(const char* src, Category& log) const;
};
- /** Registers SessionInitiator implementations. */
- void SHIBSP_API registerSessionInitiators();
-
- /** SessionInitiator that supports SAML 2.0 AuthnRequests. */
- #define SAML2_SESSION_INITIATOR "SAML2"
-
- /** SessionInitiator that supports SAML Discovery Service protocol. */
- #define SAMLDS_SESSION_INITIATOR "SAMLDS"
-
};
#if defined (_MSC_VER)
diff --git a/shibsp/handler/impl/AbstractHandler.cpp b/shibsp/handler/impl/AbstractHandler.cpp
index 58d9e477..ab913c4a 100644
--- a/shibsp/handler/impl/AbstractHandler.cpp
+++ b/shibsp/handler/impl/AbstractHandler.cpp
@@ -60,6 +60,12 @@ namespace shibsp {
SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory StatusHandlerFactory;
SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory SessionHandlerFactory;
+ SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory AdminLogoutInitiatorFactory;
+ SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory SAML2LogoutInitiatorFactory;
+ SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory LocalLogoutInitiatorFactory;
+
+ SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory SAML2SessionInitiatorFactory;
+ SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory SAMLDSSessionInitiatorFactory;
void SHIBSP_DLLLOCAL generateRandomHex(std::string& buf, unsigned int len) {
static char DIGITS[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
@@ -82,7 +88,7 @@ void SHIBSP_API shibsp::registerHandlers()
{
SPConfig& conf=SPConfig::getConfig();
- conf.AssertionConsumerServiceManager.registerFactory(SAML20_ASSERTION_CONSUMER_SERVICE, SAML2ConsumerFactory);
+ //conf.AssertionConsumerServiceManager.registerFactory(SAML20_ASSERTION_CONSUMER_SERVICE, SAML2ConsumerFactory);
conf.HandlerManager.registerFactory(ATTR_CHECKER_HANDLER, AttributeCheckerFactory);
conf.HandlerManager.registerFactory(DISCOVERY_FEED_HANDLER, DiscoveryFeedFactory);
@@ -90,7 +96,14 @@ void SHIBSP_API shibsp::registerHandlers()
conf.HandlerManager.registerFactory(STATUS_HANDLER, StatusHandlerFactory);
conf.HandlerManager.registerFactory(SESSION_HANDLER, SessionHandlerFactory);
- conf.SingleLogoutServiceManager.registerFactory(SAML20_LOGOUT_HANDLER, SAML2LogoutFactory);
+ //conf.HandlerManager.registerFactory(SAML20_LOGOUT_HANDLER, SAML2LogoutFactory);
+
+ //conf.HandlerManager.registerFactory(ADMIN_LOGOUT_INITIATOR, AdminLogoutInitiatorFactory);
+ //conf.HandlerManager.registerFactory(SAML2_LOGOUT_INITIATOR, SAML2LogoutInitiatorFactory);
+ //conf.HandlerManager.registerFactory(LOCAL_LOGOUT_INITIATOR, LocalLogoutInitiatorFactory);
+
+ //conf.SessionInitiatorManager.registerFactory(SAML2_SESSION_INITIATOR, SAML2SessionInitiatorFactory);
+ //conf.SessionInitiatorManager.registerFactory(SAMLDS_SESSION_INITIATOR, SAMLDSSessionInitiatorFactory);
}
Handler::Handler()
@@ -101,25 +114,14 @@ Handler::~Handler()
{
}
-const XMLCh* Handler::getProtocolFamily() const
-{
- return nullptr;
-}
-
const char* Handler::getEventType() const
{
return nullptr;
}
-void Handler::log(SPRequest::SPLogLevel level, const string& msg) const
+void Handler::log(Priority::Value level, const string& msg) const
{
- Category::getInstance(SHIBSP_LOGCAT ".Handler").log(
- (level == SPRequest::SPDebug ? Priority::SHIB_DEBUG :
- (level == SPRequest::SPInfo ? Priority::SHIB_INFO :
- (level == SPRequest::SPWarn ? Priority::SHIB_WARN :
- (level == SPRequest::SPError ? Priority::SHIB_ERROR : Priority::SHIB_CRIT)))),
- msg
- );
+ Category::getInstance(SHIBSP_LOGCAT ".Handler").log(level, msg);
}
void Handler::cleanRelayState(
@@ -176,9 +178,9 @@ void Handler::cleanRelayState(
}
if (purgedRSCookies > 0)
- log(SPRequest::SPDebug, string("purged ") + lexical_cast<string>(purgedRSCookies) + " stale relay state cookie(s) from client");
+ log(Priority::SHIB_DEBUG, string("purged ") + lexical_cast<string>(purgedRSCookies) + " stale relay state cookie(s) from client");
if (purgedOSCookies > 0)
- log(SPRequest::SPDebug, string("purged ") + lexical_cast<string>(purgedOSCookies) + " stale request correlation cookie(s) from client");
+ log(Priority::SHIB_DEBUG, string("purged ") + lexical_cast<string>(purgedOSCookies) + " stale request correlation cookie(s) from client");
}
void Handler::preserveRelayState(const Application& application, HTTPResponse& response, string& relayState) const
@@ -324,7 +326,7 @@ void Handler::recoverRelayState(
DDFJanitor jin(in),jout(out);
//out = application.getServiceProvider().getListenerService()->send(in);
if (!out.isstring()) {
- log(SPRequest::SPError, "StorageService-backed RelayState mechanism did not return a state value.");
+ log(Priority::SHIB_ERROR, "StorageService-backed RelayState mechanism did not return a state value.");
relayState.erase();
}
else {
@@ -384,15 +386,9 @@ AbstractHandler::~AbstractHandler()
{
}
-void AbstractHandler::log(SPRequest::SPLogLevel level, const string& msg) const
+void AbstractHandler::log(Priority::Value level, const string& msg) const
{
- m_log.log(
- (level == SPRequest::SPDebug ? Priority::SHIB_DEBUG :
- (level == SPRequest::SPInfo ? Priority::SHIB_INFO :
- (level == SPRequest::SPWarn ? Priority::SHIB_WARN :
- (level == SPRequest::SPError ? Priority::SHIB_ERROR : Priority::SHIB_CRIT)))),
- msg
- );
+ m_log.log(level, msg);
}
#ifndef SHIBSP_LITE
@@ -626,7 +622,7 @@ void AbstractHandler::preservePostData(
}
if (purgedCookies > 0)
- log(SPRequest::SPDebug, string("purged ") + lexical_cast<string>(purgedCookies) + " stale POST preservation cookie(s) from client");
+ log(Priority::SHIB_DEBUG, string("purged ") + lexical_cast<string>(purgedCookies) + " stale POST preservation cookie(s) from client");
// Set a cookie with key info.
response.setCookie(shib_cookie.c_str(), postkey.c_str(), 0, HTTPResponse::SAMESITE_NONE);
diff --git a/shibsp/handler/impl/AttributeCheckerHandler.cpp b/shibsp/handler/impl/AttributeCheckerHandler.cpp
index 7c363f45..6ce8a805 100644
--- a/shibsp/handler/impl/AttributeCheckerHandler.cpp
+++ b/shibsp/handler/impl/AttributeCheckerHandler.cpp
@@ -152,10 +152,10 @@ pair<bool,long> AttributeCheckerHandler::run(SPRequest& request, bool isHandler)
try {
session = request.getSession(true, false, false);
if (!session)
- request.log(SPRequest::SPWarn, "AttributeChecker found session unavailable immediately after creation");
+ request.log(Priority::SHIB_WARN, "AttributeChecker found session unavailable immediately after creation");
}
catch (const std::exception& ex) {
- request.log(SPRequest::SPWarn, string("AttributeChecker caught exception accessing session immediately after creation: ") + ex.what());
+ request.log(Priority::SHIB_WARN, string("AttributeChecker caught exception accessing session immediately after creation: ") + ex.what());
}
unique_lock<Session> sessionLocker(*session, adopt_lock);
diff --git a/shibsp/handler/impl/DiscoveryFeed.cpp b/shibsp/handler/impl/DiscoveryFeed.cpp
index 80ac60c5..ecc48cec 100644
--- a/shibsp/handler/impl/DiscoveryFeed.cpp
+++ b/shibsp/handler/impl/DiscoveryFeed.cpp
@@ -216,7 +216,7 @@ pair<bool,long> DiscoveryFeed::run(SPRequest& request, bool isHandler) const
return make_pair(true, request.sendResponse(feed));
}
catch (std::exception& ex) {
- request.log(SPRequest::SPError, string("error while processing request:") + ex.what());
+ request.log(Priority::SHIB_ERROR, string("error while processing request:") + ex.what());
istringstream msg("Discovery Request Failed");
return make_pair(true, request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR));
}
diff --git a/shibsp/handler/impl/LogoutInitiator.cpp b/shibsp/handler/impl/LogoutInitiator.cpp
index 202c3936..78b17ab5 100644
--- a/shibsp/handler/impl/LogoutInitiator.cpp
+++ b/shibsp/handler/impl/LogoutInitiator.cpp
@@ -31,20 +31,6 @@ using namespace shibsp;
using namespace xmltooling;
using namespace std;
-namespace shibsp {
- SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory AdminLogoutInitiatorFactory;
- SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory SAML2LogoutInitiatorFactory;
- SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory LocalLogoutInitiatorFactory;
-};
-
-void SHIBSP_API shibsp::registerLogoutInitiators()
-{
- SPConfig& conf=SPConfig::getConfig();
- conf.LogoutInitiatorManager.registerFactory(ADMIN_LOGOUT_INITIATOR, AdminLogoutInitiatorFactory);
- conf.LogoutInitiatorManager.registerFactory(SAML2_LOGOUT_INITIATOR, SAML2LogoutInitiatorFactory);
- conf.LogoutInitiatorManager.registerFactory(LOCAL_LOGOUT_INITIATOR, LocalLogoutInitiatorFactory);
-}
-
LogoutInitiator::LogoutInitiator()
{
}
diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp
index 5d1e206c..9135aba8 100644
--- a/shibsp/handler/impl/SAML2SessionInitiator.cpp
+++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp
@@ -212,9 +212,9 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
SPConfig::getConfig().deprecation().warn("Use of acsIndex when specifying response endpoint");
ACS = app.getAssertionConsumerServiceByIndex(atoi(prop.second));
if (!ACS)
- request.log(SPRequest::SPWarn, "invalid acsIndex specified in request, using acsIndex property");
+ request.log(Priority::SHIB_WARN, "invalid acsIndex specified in request, using acsIndex property");
else if (ECP && !XMLString::equals(ACS->getString("Binding").second, nullptr)) {
- request.log(SPRequest::SPWarn, "acsIndex in request referenced a non-PAOS ACS, using default ACS location");
+ request.log(Priority::SHIB_WARN, "acsIndex in request referenced a non-PAOS ACS, using default ACS location");
ACS = nullptr;
}
}
@@ -283,7 +283,7 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
if (!ACS) {
if (ECP) {
- ACS = app.getAssertionConsumerServiceByProtocol(getProtocolFamily(), nullptr);
+ //ACS = app.getAssertionConsumerServiceByProtocol(getProtocolFamily(), nullptr);
if (!ACS)
throw ConfigurationException("Unable to locate PAOS response endpoint.");
}
@@ -297,15 +297,6 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
}
}
- // If we picked by index, validate the ACS for use with this protocol.
- if (!ECP && (!ACS || !XMLString::equals(getProtocolFamily(), ACS->getProtocolFamily()))) {
- if (ACS)
- request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-SAML 2.0 ACS, using default SAML 2.0 ACS");
- ACS = app.getAssertionConsumerServiceByProtocol(getProtocolFamily());
- if (!ACS)
- throw ConfigurationException("Unable to locate a SAML 2.0 ACS endpoint to use for response.");
- }
-
// To invoke the request builder, the key requirement is to figure out how
// to express the ACS, by index or value, and if by value, where.
// We have to compute the handlerURL no matter what, because we may need to
diff --git a/shibsp/handler/impl/SecuredHandler.cpp b/shibsp/handler/impl/SecuredHandler.cpp
index 22d7d678..ae12aea7 100644
--- a/shibsp/handler/impl/SecuredHandler.cpp
+++ b/shibsp/handler/impl/SecuredHandler.cpp
@@ -102,7 +102,7 @@ pair<bool,long> SecuredHandler::run(SPRequest& request, bool isHandler) const
if (conf.isEnabled(SPConfig::InProcess) && !m_acl.empty()) {
static bool (IPRange::* contains)(const char*) const = &IPRange::contains;
if (find_if(m_acl.begin(), m_acl.end(), boost::bind(contains, _1, request.getRemoteAddr().c_str())) == m_acl.end()) {
- request.log(SPRequest::SPWarn, string("handler request blocked from invalid address (") + request.getRemoteAddr() + ')');
+ request.log(Priority::SHIB_WARN, string("handler request blocked from invalid address (") + request.getRemoteAddr() + ')');
istringstream msg("Access Denied");
return make_pair(true, request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_FORBIDDEN));
}
diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp
index 47abb0e1..b6ccde91 100644
--- a/shibsp/handler/impl/SessionInitiator.cpp
+++ b/shibsp/handler/impl/SessionInitiator.cpp
@@ -34,19 +34,6 @@ using namespace shibsp;
using namespace xmltooling;
using namespace std;
-
-namespace shibsp {
- SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory SAML2SessionInitiatorFactory;
- SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory SAMLDSSessionInitiatorFactory;
-};
-
-void SHIBSP_API shibsp::registerSessionInitiators()
-{
- SPConfig& conf=SPConfig::getConfig();
- conf.SessionInitiatorManager.registerFactory(SAML2_SESSION_INITIATOR, SAML2SessionInitiatorFactory);
- conf.SessionInitiatorManager.registerFactory(SAMLDS_SESSION_INITIATOR, SAMLDSSessionInitiatorFactory);
-}
-
SessionInitiator::SessionInitiator()
{
}
@@ -99,7 +86,7 @@ bool SessionInitiator::checkCompatibility(SPRequest& request, bool isHandler) co
// Check for support of isPassive if it's used.
if (isPassive && getSupportedOptions().count("isPassive") == 0) {
if (getParent()) {
- log(SPRequest::SPInfo, "handler does not support isPassive option");
+ log(Priority::SHIB_INFO, "handler does not support isPassive option");
return false;
}
throw ConfigurationException("Unsupported option (isPassive) supplied to SessionInitiator.");
@@ -159,8 +146,8 @@ pair<bool,long> SessionInitiator::run(SPRequest& request, bool isHandler) const
if (returnOnError) {
// Log it and attempt to recover relay state so we can get back.
- log(SPRequest::SPError, ex.what());
- log(SPRequest::SPInfo, "trapping SessionInitiator error condition and returning to target location");
+ log(Priority::SHIB_ERROR, ex.what());
+ log(Priority::SHIB_INFO, "trapping SessionInitiator error condition and returning to target location");
flag = request.getParameter("target");
string target(flag ? flag : "");
recoverRelayState(request.getApplication(), request, request, target, false);
diff --git a/shibsp/impl/ChainingAccessControl.cpp b/shibsp/impl/ChainingAccessControl.cpp
index d4da5747..6404ce02 100644
--- a/shibsp/impl/ChainingAccessControl.cpp
+++ b/shibsp/impl/ChainingAccessControl.cpp
@@ -141,7 +141,7 @@ AccessControl::aclresult_t ChainingAccessControl::authorized(const SPRequest& re
{
for (const auto& i : m_ac) {
if (i->authorized(request, session) != shib_acl_true) {
- request.log(SPRequest::SPDebug, "embedded AccessControl plugin unsuccessful, denying access");
+ request.log(Priority::SHIB_DEBUG, "embedded AccessControl plugin unsuccessful, denying access");
return shib_acl_false;
}
}
@@ -154,10 +154,10 @@ AccessControl::aclresult_t ChainingAccessControl::authorized(const SPRequest& re
if (i->authorized(request,session) == shib_acl_true)
return shib_acl_true;
}
- request.log(SPRequest::SPDebug, "all embedded AccessControl plugins unsuccessful, denying access");
+ request.log(Priority::SHIB_DEBUG, "all embedded AccessControl plugins unsuccessful, denying access");
return shib_acl_false;
}
}
- request.log(SPRequest::SPWarn, "unknown operation in access control policy, denying access");
+ request.log(Priority::SHIB_DEBUG, "unknown operation in access control policy, denying access");
return shib_acl_false;
}
diff --git a/shibsp/impl/DefaultAgent.cpp b/shibsp/impl/DefaultAgent.cpp
index c9962fb8..64ca9ecf 100644
--- a/shibsp/impl/DefaultAgent.cpp
+++ b/shibsp/impl/DefaultAgent.cpp
@@ -30,10 +30,8 @@
#include "logging/Category.h"
#include "remoting/RemotingService.h"
#include "util/BoostPropertySet.h"
-#include "util/PathResolver.h"
#include "util/SPConstants.h"
-#include <fstream>
#include <boost/algorithm/string.hpp>
#include <boost/property_tree/ptree.hpp>
@@ -146,14 +144,9 @@ void DefaultAgent::doRemotingService()
{
boost::optional<ptree&> child = m_pt.get_child_optional("remoting");
if (child) {
- string t(child->get("type", ""));
- if (!t.empty()) {
- m_log.info("building RemotingService of type %s...", t.c_str());
- m_remotingService.reset(AgentConfig::getConfig().RemotingServiceManager.newPlugin(t.c_str(), *child, true));
- } else {
- m_log.error("[remoting] section missing type property");
- throw ConfigurationException("Missing type property in [remoting] section.");
- }
+ string t(child->get("type", HTTP_REMOTING_SERVICE));
+ m_log.info("building RemotingService of type %s...", t.c_str());
+ m_remotingService.reset(AgentConfig::getConfig().RemotingServiceManager.newPlugin(t.c_str(), *child, true));
} else {
m_log.debug("[remoting] section absent, skipping RemotingService creation");
}
@@ -163,14 +156,10 @@ void DefaultAgent::doSessionCache()
{
boost::optional<ptree&> child = m_pt.get_child_optional("session-cache");
if (child) {
- string t(child->get("type", ""));
- if (!t.empty()) {
- m_log.info("building SessionCache of type %s...", t.c_str());
- m_sessionCache.reset(AgentConfig::getConfig().SessionCacheManager.newPlugin(t.c_str(), *child, true));
- } else {
- m_log.error("[session-cache] section missing type property");
- throw ConfigurationException("Missing type property in [session-cache] section.");
- }
+ // TODO: change the expected default type
+ string t(child->get("type", STORAGESERVICE_SESSION_CACHE));
+ m_log.info("building SessionCache of type %s...", t.c_str());
+ m_sessionCache.reset(AgentConfig::getConfig().SessionCacheManager.newPlugin(t.c_str(), *child, true));
} else {
m_log.debug("[session-cache] section absent, skipping SessionCache creation");
}
@@ -180,14 +169,9 @@ void DefaultAgent::doRequestMapper()
{
boost::optional<ptree&> child = m_pt.get_child_optional("request-mapper");
if (child) {
- string t(child->get("type", ""));
- if (!t.empty()) {
- m_log.info("building RequestMapper of type %s...", t.c_str());
- m_requestMapper.reset(AgentConfig::getConfig().RequestMapperManager.newPlugin(t.c_str(), *child, true));
- } else {
- m_log.error("[request-mapper] section missing type property");
- throw ConfigurationException("Missing type property in [request-mapper] section.");
- }
+ string t(child->get("type", NATIVE_REQUEST_MAPPER));
+ m_log.info("building RequestMapper of type %s...", t.c_str());
+ m_requestMapper.reset(AgentConfig::getConfig().RequestMapperManager.newPlugin(t.c_str(), *child, true));
} else {
m_log.debug("[request-mapper] section absent, skipping RequestMapper creation");
}
diff --git a/shibsp/impl/XMLAccessControl.cpp b/shibsp/impl/XMLAccessControl.cpp
index c6fac11b..2b3debbd 100644
--- a/shibsp/impl/XMLAccessControl.cpp
+++ b/shibsp/impl/XMLAccessControl.cpp
@@ -169,20 +169,20 @@ AccessControl::aclresult_t Rule::authorized(const SPRequest& request, const Sess
// Map alias in rule to the attribute.
if (!session) {
- request.log(SPRequest::SPWarn, "AccessControl plugin not given a valid session to evaluate, are you using lazy sessions?");
+ request.log(Priority::SHIB_WARN, "AccessControl plugin not given a valid session to evaluate, are you using lazy sessions?");
return shib_acl_false;
}
if (m_alias == "valid-user") {
if (session) {
- request.log(SPRequest::SPDebug,"AccessControl rule accepting valid-user based on active session");
+ request.log(Priority::SHIB_DEBUG," AccessControl rule accepting valid-user based on active session");
return shib_acl_true;
}
return shib_acl_false;
}
if (m_alias == "user") {
if (m_vals.find(request.getRemoteUser()) != m_vals.end()) {
- request.log(SPRequest::SPDebug, string("AccessControl rule expecting REMOTE_USER (") + request.getRemoteUser() + "), authz granted");
+ request.log(Priority::SHIB_DEBUG, string("AccessControl rule expecting REMOTE_USER (") + request.getRemoteUser() + "), authz granted");
return shib_acl_true;
}
return shib_acl_false;
@@ -190,7 +190,7 @@ AccessControl::aclresult_t Rule::authorized(const SPRequest& request, const Sess
else if (m_alias == "authnContextClassRef") {
const char* ref = session->getAuthnContextClassRef();
if (ref && m_vals.find(ref) != m_vals.end()) {
- request.log(SPRequest::SPDebug, string("AccessControl rule expecting authnContextClassRef (") + ref + "), authz granted");
+ request.log(Priority::SHIB_DEBUG, string("AccessControl rule expecting authnContextClassRef (") + ref + "), authz granted");
return shib_acl_true;
}
return shib_acl_false;
@@ -200,11 +200,11 @@ AccessControl::aclresult_t Rule::authorized(const SPRequest& request, const Sess
pair<multimap<string,const Attribute*>::const_iterator, multimap<string,const Attribute*>::const_iterator> attrs =
session->getIndexedAttributes().equal_range(m_alias);
if (attrs.first == attrs.second) {
- request.log(SPRequest::SPWarn, string("AccessControl rule requires attribute (") + m_alias + "), not found in session");
+ request.log(Priority::SHIB_WARN, string("AccessControl rule requires attribute (") + m_alias + "), not found in session");
return shib_acl_false;
}
else if (m_vals.empty()) {
- request.log(SPRequest::SPDebug, string("AccessControl rule requires presence of attribute (") + m_alias + "), authz granted");
+ request.log(Priority::SHIB_DEBUG, string("AccessControl rule requires presence of attribute (") + m_alias + "), authz granted");
return shib_acl_true;
}
@@ -216,7 +216,7 @@ AccessControl::aclresult_t Rule::authorized(const SPRequest& request, const Sess
for (set<string>::const_iterator i = m_vals.begin(); i != m_vals.end(); ++i) {
for (vector<string>::const_iterator j = vals.begin(); j != vals.end(); ++j) {
if ((caseSensitive && *i == *j) || (!caseSensitive && !strcasecmp(i->c_str(),j->c_str()))) {
- request.log(SPRequest::SPDebug, string("AccessControl rule expecting (") + *j + "), authz granted");
+ request.log(Priority::SHIB_DEBUG, string("AccessControl rule expecting (") + *j + "), authz granted");
return shib_acl_true;
}
}
@@ -253,13 +253,13 @@ AccessControl::aclresult_t RuleRegex::authorized(const SPRequest& request, const
static exp::regex_constants::match_flag_type match_flags = exp::regex_constants::match_any | exp::regex_constants::match_not_null;
if (!session) {
- request.log(SPRequest::SPWarn, "AccessControl plugin not given a valid session to evaluate, are you using lazy sessions?");
+ request.log(Priority::SHIB_WARN, "AccessControl plugin not given a valid session to evaluate, are you using lazy sessions?");
return shib_acl_false;
}
if (m_alias == "valid-user") {
if (session) {
- request.log(SPRequest::SPDebug,"AccessControl rule accepting valid-user based on active session");
+ request.log(Priority::SHIB_DEBUG,"AccessControl rule accepting valid-user based on active session");
return shib_acl_true;
}
return shib_acl_false;
@@ -267,14 +267,14 @@ AccessControl::aclresult_t RuleRegex::authorized(const SPRequest& request, const
if (m_alias == "user") {
if (exp::regex_match(request.getRemoteUser(), m_re, match_flags)) {
- request.log(SPRequest::SPDebug, string("AccessControl rule expecting REMOTE_USER regex (") + m_exp + "), authz granted");
+ request.log(Priority::SHIB_DEBUG, string("AccessControl rule expecting REMOTE_USER regex (") + m_exp + "), authz granted");
return shib_acl_true;
}
return shib_acl_false;
}
else if (m_alias == "authnContextClassRef") {
if (session->getAuthnContextClassRef() && exp::regex_match(session->getAuthnContextClassRef(), m_re, match_flags)) {
- request.log(SPRequest::SPDebug, string("AccessControl rule expecting authnContextClassRef regex (") + m_exp + "), authz granted");
+ request.log(Priority::SHIB_DEBUG, string("AccessControl rule expecting authnContextClassRef regex (") + m_exp + "), authz granted");
return shib_acl_true;
}
return shib_acl_false;
@@ -283,7 +283,7 @@ AccessControl::aclresult_t RuleRegex::authorized(const SPRequest& request, const
// Find the attribute(s) matching the require rule.
auto attrs = session->getIndexedAttributes().equal_range(m_alias);
if (attrs.first == attrs.second) {
- request.log(SPRequest::SPWarn, string("AccessControl rule requires attribute (") + m_alias + "), not found in session");
+ request.log(Priority::SHIB_WARN, string("AccessControl rule requires attribute (") + m_alias + "), not found in session");
return shib_acl_false;
}
@@ -291,7 +291,7 @@ AccessControl::aclresult_t RuleRegex::authorized(const SPRequest& request, const
// Now we have to intersect the attribute's values against the regular expression.
for (const string& v : attrs.first->second->getSerializedValues()) {
if (exp::regex_match(v, m_re, match_flags)) {
- request.log(SPRequest::SPDebug, string("AccessControl rule expecting regex (") + m_exp + "), authz granted");
+ request.log(Priority::SHIB_DEBUG, string("AccessControl rule expecting regex (") + m_exp + "), authz granted");
return shib_acl_true;
}
}
@@ -365,7 +365,7 @@ AccessControl::aclresult_t Operator::authorized(const SPRequest& request, const
return shib_acl_false;
}
}
- request.log(SPRequest::SPWarn,"unknown operation in access control policy, denying access");
+ request.log(Priority::SHIB_WARN,"unknown operation in access control policy, denying access");
return shib_acl_false;
}
diff --git a/shibsp/impl/XMLApplication.cpp b/shibsp/impl/XMLApplication.cpp
index 8d9d9be5..51d72d99 100644
--- a/shibsp/impl/XMLApplication.cpp
+++ b/shibsp/impl/XMLApplication.cpp
@@ -451,10 +451,6 @@ void XMLApplication::doHandlers(const DOMElement* e, Category& log)
handler.reset(
conf.AssertionConsumerServiceManager.newPlugin(bindprop.c_str(), pair<const DOMElement*,const char*>(child, getId()), m_deprecationSupport)
);
- // Map by protocol.
- const XMLCh* protfamily = handler->getProtocolFamily();
- if (protfamily)
- m_acsProtocolMap[protfamily].push_back(handler.get());
m_acsIndexMap[handler->getUnsignedInt("index").second] = handler.get();
if (!hardACS) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list