[cpp-sp] branch main updated: Remove legacy SP classes and clean up header usage.
Scott Cantor
cantor.2 at osu.edu
Tue Jan 7 17:56:39 UTC 2025
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=c5f8ac2c3e3fc312ceb2750d5f829b46936be864
The following commit(s) were added to refs/heads/main by this push:
new c5f8ac2c Remove legacy SP classes and clean up header usage.
c5f8ac2c is described below
commit c5f8ac2c3e3fc312ceb2750d5f829b46936be864
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Jan 7 12:56:30 2025 -0500
Remove legacy SP classes and clean up header usage.
---
apache/mod_shib_24.cpp | 60 +---
fastcgi/shibauthorizer.cpp | 79 ++---
fastcgi/shibresponder.cpp | 64 +---
iis7_shib/ShibHttpModule.cpp | 16 +-
iis7_shib/headers/IIS7_shib.hpp | 26 +-
shibsp/Agent.cpp | 368 +++++++++++------------
shibsp/Agent.h | 16 +-
shibsp/Application.cpp | 176 -----------
shibsp/Application.h | 269 -----------------
shibsp/Makefile.am | 8 -
shibsp/SPRequest.h | 4 +-
shibsp/attribute/Attribute.cpp | 4 -
shibsp/attribute/BinaryAttribute.cpp | 2 +
shibsp/base.h | 9 +-
shibsp/handler/RemotedHandler.h | 40 ---
shibsp/handler/impl/AbstractHandler.cpp | 29 +-
shibsp/handler/impl/AdminLogoutInitiator.cpp | 4 +-
shibsp/handler/impl/AssertionConsumerService.cpp | 4 +-
shibsp/handler/impl/AssertionLookup.cpp | 4 +-
shibsp/handler/impl/AttributeCheckerHandler.cpp | 6 +-
shibsp/handler/impl/DiscoveryFeed.cpp | 6 +-
shibsp/handler/impl/LocalLogoutInitiator.cpp | 4 +-
shibsp/handler/impl/LogoutHandler.cpp | 5 +-
shibsp/handler/impl/LogoutInitiator.cpp | 1 +
shibsp/handler/impl/MetadataGenerator.cpp | 6 +-
shibsp/handler/impl/RemotedHandler.cpp | 39 ---
shibsp/handler/impl/SAML2Consumer.cpp | 1 +
shibsp/handler/impl/SAML2Logout.cpp | 5 +-
shibsp/handler/impl/SAML2LogoutInitiator.cpp | 4 +-
shibsp/handler/impl/SAML2SessionInitiator.cpp | 7 +-
shibsp/handler/impl/SAMLDSSessionInitiator.cpp | 1 +
shibsp/handler/impl/SecuredHandler.cpp | 38 ++-
shibsp/handler/impl/SessionHandler.cpp | 2 +-
shibsp/handler/impl/SessionInitiator.cpp | 2 +-
shibsp/handler/impl/StatusHandler.cpp | 4 +-
shibsp/impl/ChainingAccessControl.cpp | 1 +
shibsp/impl/StorageServiceSessionCache.cpp | 13 +-
shibsp/impl/StorageServiceSessionCache.h | 3 +
shibsp/impl/StoredSession.cpp | 3 +-
shibsp/impl/XMLAccessControl.cpp | 1 +
shibsp/internal.h | 4 -
shibsp/logging/impl/ConsoleLoggingService.cpp | 1 +
shibsp/util/DOMPropertySet.cpp | 6 +-
shibsp/util/DOMPropertySet.h | 4 +
shibsp/util/IPRange.cpp | 3 +-
shibsp/util/SPConstants.cpp | 1 +
46 files changed, 359 insertions(+), 994 deletions(-)
diff --git a/apache/mod_shib_24.cpp b/apache/mod_shib_24.cpp
index dd770805..9553dd9d 100644
--- a/apache/mod_shib_24.cpp
+++ b/apache/mod_shib_24.cpp
@@ -42,8 +42,6 @@
#include <shibsp/Agent.h>
#include <shibsp/AgentConfig.h>
#include <shibsp/RequestMapper.h>
-#include <shibsp/SPConfig.h>
-#include <shibsp/ServiceProvider.h>
#include <shibsp/SessionCache.h>
#include <shibsp/attribute/Attribute.h>
#include <shibsp/util/Lockable.h>
@@ -93,7 +91,6 @@ namespace exp = std;
#endif
using namespace shibsp;
-using namespace xmltooling;
using namespace boost::property_tree;
using namespace std;
@@ -104,7 +101,7 @@ namespace {
char* g_szSHIBConfig = nullptr;
char* g_szSchemaDir = nullptr;
char* g_szPrefix = nullptr;
- SPConfig* g_Config = nullptr;
+ AgentConfig* g_Config = nullptr;
string g_unsetHeaderValue,g_spoofKey;
bool g_checkSpoofing = true;
bool g_catchAll = false;
@@ -829,7 +826,7 @@ private:
bool checkAttribute(const SPRequest& request, const Attribute* attr, const char* toMatch, bool isRegex=false) const;
};
-AccessControl* htAccessFactory(const xercesc::DOMElement* const &, bool)
+AccessControl* htAccessFactory(const ptree&, bool)
{
return new htAccessControl();
}
@@ -1422,22 +1419,14 @@ apr_status_t shib_post_config(apr_pool_t* p, apr_pool_t*, apr_pool_t*, server_re
return !OK;
}
- g_Config = &SPConfig::getConfig();
- g_Config->setFeatures(
- SPConfig::Listener |
- SPConfig::Caching |
- SPConfig::RequestMapping |
- SPConfig::InProcess |
- SPConfig::Logging |
- SPConfig::Handlers
- );
+ AgentConfig::getConfig().RequestMapperManager.registerFactory(NATIVE_REQUEST_MAPPER, &ApacheRequestMapFactory);
+
+ g_Config = &AgentConfig::getConfig();
if (!g_Config->init(g_szSchemaDir, g_szPrefix)) {
ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_NOERRNO, 0, s, "post_config: shib_module failed to initialize libraries");
return !OK;
}
- AgentConfig::getConfig().RequestMapperManager.registerFactory(NATIVE_REQUEST_MAPPER, &ApacheRequestMapFactory);
-
// Set the cleanup handler, passing in the server_rec for logging.
apr_pool_cleanup_register(p, s, &shib_exit, apr_pool_cleanup_null);
@@ -1447,8 +1436,9 @@ apr_status_t shib_post_config(apr_pool_t* p, apr_pool_t*, apr_pool_t*, server_re
/*
* shib_child_init()
* Things to do when the child process is initialized.
- * We can't use post-config for all of it on 2.x because only the forking thread shows
- * up in the child, losing the internal threads spun up by plugins in the SP.
+ * For now, we have no background threads, but if we introduce any, we'd have to switch
+ * back to deferring their creation until this step because only the forking thread shows
+ * up in the child, losing any internal threads spun up by plugins in the agent library.
*/
extern "C" void shib_child_init(apr_pool_t* p, server_rec* s)
{
@@ -1456,33 +1446,15 @@ extern "C" void shib_child_init(apr_pool_t* p, server_rec* s)
ap_log_error(APLOG_MARK, APLOG_INFO|APLOG_NOERRNO, 0, s, "child_init: shib_module initializing in pid (%d)", (int)getpid());
- try {
- if (!g_Config->instantiate(g_szSHIBConfig, true))
- throw runtime_error("unknown error");
- }
- catch (std::exception& ex) {
- ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_NOERRNO, 0, s, "child_init: shib_module failed to load configuration: %s", ex.what());
- g_Config->term();
- exit(1);
- }
-
- ServiceProvider* sp = g_Config->getServiceProvider();
- xmltooling::Locker locker(sp);
- const PropertySet* props = sp->getPropertySet("InProcess");
- if (props) {
- pair<bool,const char*> unsetValue = props->getString("unsetHeaderValue");
- if (unsetValue.first)
- g_unsetHeaderValue = unsetValue.second;
- pair<bool,bool> flag=props->getBool("checkSpoofing");
- g_checkSpoofing = !flag.first || flag.second;
- if (g_checkSpoofing) {
- unsetValue=props->getString("spoofKey");
- if (unsetValue.first)
- g_spoofKey = unsetValue.second;
- }
- flag=props->getBool("catchAll");
- g_catchAll = flag.first && flag.second;
+ const Agent& agent = g_Config->getAgent();
+ g_unsetHeaderValue = agent.getString("unsetHeaderValue");
+ g_checkSpoofing = agent.getBool("checkSpoofing", true);
+ if (g_checkSpoofing) {
+ const char* altkey = agent.getString("spoofKey");
+ if (altkey)
+ g_spoofKey = altkey;
}
+ g_catchAll = agent.getBool("catchAll", false);
// Set the cleanup handler, passing in the server_rec for logging.
apr_pool_cleanup_register(p, s, &shib_exit, apr_pool_cleanup_null);
diff --git a/fastcgi/shibauthorizer.cpp b/fastcgi/shibauthorizer.cpp
index 3c0b6c13..893b0c4c 100644
--- a/fastcgi/shibauthorizer.cpp
+++ b/fastcgi/shibauthorizer.cpp
@@ -1,21 +1,15 @@
/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/* shibauthorizer.cpp - Shibboleth FastCGI Authorizer
@@ -31,13 +25,8 @@
#define _SCL_SECURE_NO_WARNINGS 1
#include <shibsp/AbstractSPRequest.h>
-#include <shibsp/SPConfig.h>
-#include <shibsp/ServiceProvider.h>
-#include <xmltooling/unicode.h>
-#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/util/XMLConstants.h>
-#include <xmltooling/util/XMLHelper.h>
-#include <xercesc/util/XMLUniDefs.hpp>
+#include <shibsp/Agent.h>
+#include <shibsp/AgentConfig.h>
#include <stdexcept>
#include <stdlib.h>
@@ -48,13 +37,8 @@
#include <fcgio.h>
using namespace shibsp;
-using namespace xmltooling;
-using namespace xercesc;
using namespace std;
-static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h);
-static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
-
typedef enum {
SHIB_RETURN_OK,
SHIB_RETURN_KO,
@@ -124,11 +108,6 @@ public:
const char* s = FCGX_GetParam("REMOTE_ADDR", m_req->envp);
return s ? s : "";
}
- void log(SPLogLevel level, const string& msg) const {
- AbstractSPRequest::log(level,msg);
- if (level >= SPError)
- cerr << "shib: " << msg;
- }
void clearHeader(const char* rawname, const char* cginame) {
// No need, since we use environment variables.
}
@@ -276,27 +255,9 @@ static void print_error(const char* msg)
int main(void)
{
- SPConfig* g_Config=&SPConfig::getConfig();
- g_Config->setFeatures(
- SPConfig::Listener |
- SPConfig::Caching |
- SPConfig::RequestMapping |
- SPConfig::InProcess |
- SPConfig::Logging |
- SPConfig::Handlers
- );
+ AgentConfig* g_Config = &AgentConfig::getConfig();
if (!g_Config->init()) {
- cerr << "failed to initialize Shibboleth libraries" << endl;
- exit(1);
- }
-
- try {
- if (!g_Config->instantiate(nullptr, true))
- throw runtime_error("unknown error");
- }
- catch (exception& ex) {
- g_Config->term();
- cerr << "exception while initializing Shibboleth configuration: " << ex.what() << endl;
+ cerr << "failed to initialize Shibboleth agent" << endl;
exit(1);
}
@@ -338,9 +299,9 @@ int main(void)
try {
ShibTargetFCGIAuth sta(&request, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort);
- pair<bool,long> res = sta.getServiceProvider().doAuthentication(sta);
+ pair<bool,long> res = sta.getAgent().doAuthentication(sta);
if (res.first) {
- sta.log(SPRequest::SPDebug, "shib: doAuthentication handled the request");
+ sta.debug(Priority::SHIB_DEBUG, "shib: doAuthentication handled the request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok(sta.m_request_headers);
@@ -360,9 +321,9 @@ int main(void)
}
}
- res = sta.getServiceProvider().doExport(sta);
+ res = sta.getAgent().doExport(sta);
if (res.first) {
- sta.log(SPRequest::SPDebug, "shib: doExport handled request");
+ sta.log(Priority::SHIB_DEBUG, "shib: doExport handled request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok(sta.m_request_headers);
@@ -382,9 +343,9 @@ int main(void)
}
}
- res = sta.getServiceProvider().doAuthorization(sta);
+ res = sta.getAgent().doAuthorization(sta);
if (res.first) {
- sta.log(SPRequest::SPDebug, "shib: doAuthorization handled request");
+ sta.log(Priority::SHIB_DEBUG, "shib: doAuthorization handled request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok(sta.m_request_headers);
@@ -407,7 +368,7 @@ int main(void)
print_ok(sta.m_request_headers);
}
- catch (exception& e) {
+ catch (const exception& e) {
cerr << "shib: FastCGI authorizer caught an exception: " << e.what() << endl;
print_error("<html><body>FastCGI Shibboleth authorizer caught an exception, check log for details.</body></html>");
}
diff --git a/fastcgi/shibresponder.cpp b/fastcgi/shibresponder.cpp
index 7379180b..25ddaad6 100644
--- a/fastcgi/shibresponder.cpp
+++ b/fastcgi/shibresponder.cpp
@@ -1,21 +1,15 @@
/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/* shibresponder.cpp - Shibboleth FastCGI Responder/Handler
@@ -31,13 +25,8 @@
#define _SCL_SECURE_NO_WARNINGS 1
#include <shibsp/AbstractSPRequest.h>
-#include <shibsp/SPConfig.h>
-#include <shibsp/ServiceProvider.h>
-#include <xmltooling/unicode.h>
-#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/util/XMLConstants.h>
-#include <xmltooling/util/XMLHelper.h>
-#include <xercesc/util/XMLUniDefs.hpp>
+#include <shibsp/Agent.h>
+#include <shibsp/AgentConfig.h>
#include <stdexcept>
#include <stdlib.h>
@@ -48,13 +37,8 @@
#include <fcgio.h>
using namespace shibsp;
-using namespace xmltooling;
-using namespace xercesc;
using namespace std;
-static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h);
-static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
-
typedef enum {
SHIB_RETURN_OK,
SHIB_RETURN_KO,
@@ -280,27 +264,9 @@ static void print_error(const char* msg) {
int main(void)
{
- SPConfig* g_Config=&SPConfig::getConfig();
- g_Config->setFeatures(
- SPConfig::Listener |
- SPConfig::Caching |
- SPConfig::RequestMapping |
- SPConfig::InProcess |
- SPConfig::Logging |
- SPConfig::Handlers
- );
+ AgentConfig* g_Config = &AgentConfig::getConfig();
if (!g_Config->init()) {
- cerr << "failed to initialize Shibboleth libraries" << endl;
- exit(1);
- }
-
- try {
- if (!g_Config->instantiate(nullptr, true))
- throw runtime_error("unknown error");
- }
- catch (exception& ex) {
- g_Config->term();
- cerr << "exception while initializing Shibboleth configuration: " << ex.what() << endl;
+ cerr << "failed to initialize Shibboleth agent" << endl;
exit(1);
}
@@ -351,9 +317,9 @@ int main(void)
try {
ShibTargetFCGI stf(&request, content, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort);
- pair<bool,long> res = stf.getServiceProvider().doHandler(stf);
+ pair<bool,long> res = stf.getAgent().doHandler(stf);
if (res.first) {
- stf.log(SPRequest::SPDebug, "shib: doHandler handled the request");
+ stf.log(Priority::SHIB_DEBUG, "shib: doHandler handled the request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok();
diff --git a/iis7_shib/ShibHttpModule.cpp b/iis7_shib/ShibHttpModule.cpp
index 98997b52..e83636bc 100644
--- a/iis7_shib/ShibHttpModule.cpp
+++ b/iis7_shib/ShibHttpModule.cpp
@@ -112,17 +112,17 @@ ShibHttpModule::OnBeginRequest(
return DoHandler(pHttpContext, pProvider);
}
catch (const bad_alloc&) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), "Fatal Server Memory Error", 0, E_OUTOFMEMORY);
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), "Fatal Server Memory Error", 0, E_OUTOFMEMORY);
}
catch (long e) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), "Fatal Server Win32 Error", 0, HRESULT_FROM_WIN32(e));
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), "Fatal Server Win32 Error", 0, HRESULT_FROM_WIN32(e));
}
catch (const std::exception& e) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), e.what());
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), e.what());
}
catch (...) {
if (g_catchAll) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), "Fatal Server Error Caught");
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), "Fatal Server Error Caught");
}
else {
throw;
@@ -144,17 +144,17 @@ ShibHttpModule::OnAuthenticateRequest(
return DoFilter(pHttpContext, pProvider);
}
catch (const bad_alloc&) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), "Fatal Server Memory Error", 0, E_OUTOFMEMORY);
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), "Fatal Server Memory Error", 0, E_OUTOFMEMORY);
}
catch (long e) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), "Fatal Server Win32 Error", 0, HRESULT_FROM_WIN32(e));
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), "Fatal Server Win32 Error", 0, HRESULT_FROM_WIN32(e));
}
catch (const std::exception& e) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), e.what());
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), e.what());
}
catch (...) {
if (g_catchAll) {
- res->SetStatus(static_cast<USHORT>(xmltooling::HTTPResponse::XMLTOOLING_HTTP_STATUS_ERROR), "Fatal Server Error Caught");
+ res->SetStatus(static_cast<USHORT>(HTTPResponse::SHIBSP_HTTP_STATUS_ERROR), "Fatal Server Error Caught");
}
else {
throw;
diff --git a/iis7_shib/headers/IIS7_shib.hpp b/iis7_shib/headers/IIS7_shib.hpp
index 26bc46cf..da2690ba 100644
--- a/iis7_shib/headers/IIS7_shib.hpp
+++ b/iis7_shib/headers/IIS7_shib.hpp
@@ -24,25 +24,25 @@
#include <http.h>
#include "httpserv.h"
-//
-// Miscelanea
-//
-#include <set>
-#include <list>
-#include <boost/lexical_cast.hpp>
-#include <string>
-
// Shibboleth
#define SHIBSP_LITE
#include "config_win32.h"
-#include <shibsp/SPConfig.h>
-#include <shibsp/ServiceProvider.h>
+#include <shibsp/Agent.h>
+#include <shibsp/AgentConfig.h>
+#include <shibsp/exceptions.h>
+#include <shibsp/logging/Priority.h>
#include <shibsp/util/PropertySet.h>
#include <xmltooling/Lockable.h>
-#include <xmltooling/logging.h>
#include <xmltooling/util/XMLHelper.h>
-#include <shibsp/exceptions.h>
+
+//
+// Miscelanea
+//
+#include <set>
+#include <list>
+#include <boost/lexical_cast.hpp>
+#include <string>
using namespace shibsp;
using namespace xmltooling;
@@ -111,5 +111,5 @@ namespace Config {
BOOL LogEvent(
WORD wType,
DWORD dwEventID,
- xmltooling::logging::Priority::PriorityLevel priority,
+ Priority::Value priority,
LPCSTR message);
\ No newline at end of file
diff --git a/shibsp/Agent.cpp b/shibsp/Agent.cpp
index 2d041fd9..8a42e2c1 100644
--- a/shibsp/Agent.cpp
+++ b/shibsp/Agent.cpp
@@ -19,15 +19,15 @@
*/
#include "internal.h"
-#include "AgentConfig.h"
#include "exceptions.h"
+#include "Agent.h"
+#include "AgentConfig.h"
#include "AccessControl.h"
-#include "Application.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "SPRequest.h"
#include "attribute/Attribute.h"
#include "handler/SessionInitiator.h"
+#include "logging/Category.h"
#include "util/Date.h"
#include "util/PathResolver.h"
#include "util/URLEncoder.h"
@@ -45,193 +45,183 @@
#endif
using namespace shibsp;
-using namespace xmltooling;
using namespace std;
-namespace shibsp {
- SHIBSP_DLLLOCAL PluginManager<ServiceProvider,string,const DOMElement*>::Factory XMLServiceProviderFactory;
+Agent::Agent()
+{
+ m_authTypes.insert("shibboleth");
+}
- long SHIBSP_DLLLOCAL handleError(
- Category& log, SPRequest& request, const Session* session=nullptr, const exception* ex=nullptr, bool mayRedirect=true
- )
- {
- // The properties we need can be set in the RequestMap, or the Errors element.
- bool externalParameters = false;
- const char* redirectErrors = nullptr;
+Agent::~Agent()
+{
+}
- const agent_exception* richEx = dynamic_cast<const agent_exception*>(ex);
+long Agent::handleError(Category& log, SPRequest& request, const Session* session, const exception* ex, bool mayRedirect) const
+{
+ // The properties we need can be set in the RequestMap, or the Errors element.
+ bool externalParameters = false;
+ const char* redirectErrors = nullptr;
- // Now look for settings in the request map.
- try {
- RequestMapper::Settings settings = request.getRequestSettings();
- externalParameters = settings.first->getBool("externalParameters", false);
- if (mayRedirect)
- redirectErrors = settings.first->getString("redirectErrors");
- }
- catch (const exception& ex) {
- log.error(ex.what());
- }
+ const agent_exception* richEx = dynamic_cast<const agent_exception*>(ex);
- // Check for redirection on errors.
- if (mayRedirect && redirectErrors) {
- string loc(redirectErrors);
- request.absolutize(loc);
- const agent_exception* richEx = dynamic_cast<const agent_exception*>(ex);
- if (richEx) {
- // TODO: probably alter how this works or what's included.
- loc = loc + '?' + richEx->toQueryString();
- }
- return request.sendRedirect(loc.c_str());
+ // Now look for settings in the request map.
+ try {
+ RequestMapper::Settings settings = request.getRequestSettings();
+ externalParameters = settings.first->getBool("externalParameters", false);
+ if (mayRedirect)
+ redirectErrors = settings.first->getString("redirectErrors");
+ }
+ catch (const exception& ex) {
+ log.error(ex.what());
+ }
+
+ // Check for redirection on errors.
+ if (mayRedirect && redirectErrors) {
+ string loc(redirectErrors);
+ request.absolutize(loc);
+ const agent_exception* richEx = dynamic_cast<const agent_exception*>(ex);
+ if (richEx) {
+ // TODO: probably alter how this works or what's included.
+ loc = loc + '?' + richEx->toQueryString();
}
+ return request.sendRedirect(loc.c_str());
+ }
- // TODO: this probably changes significantly, but ultimately we're trying to pass
- // back a status code.
+ // TODO: this probably changes significantly, but ultimately we're trying to pass
+ // back a status code.
- istringstream msg("Internal Server Error. Please contact the site administrator.");
- return request.sendResponse(msg, richEx ? richEx->getStatusCode() : HTTPResponse::SHIBSP_HTTP_STATUS_ERROR);
- }
+ istringstream msg("Internal Server Error. Please contact the site administrator.");
+ return request.sendResponse(msg, richEx ? richEx->getStatusCode() : HTTPResponse::SHIBSP_HTTP_STATUS_ERROR);
+}
- void SHIBSP_DLLLOCAL clearHeaders(SPRequest& request) {
- request.clearHeader("Shib-Cookie-Name", "HTTP_SHIB_COOKIE_NAME");
- request.clearHeader("Shib-Session-ID", "HTTP_SHIB_SESSION_ID");
- request.clearHeader("Shib-Session-Index", "HTTP_SHIB_SESSION_INDEX");
- request.clearHeader("Shib-Session-Expires", "HTTP_SHIB_SESSION_EXPIRES");
- request.clearHeader("Shib-Session-Inactivity", "HTTP_SHIB_SESSION_INACTIVITY");
- request.clearHeader("Shib-Identity-Provider", "HTTP_SHIB_IDENTITY_PROVIDER");
- request.clearHeader("Shib-Authentication-Method", "HTTP_SHIB_AUTHENTICATION_METHOD");
- request.clearHeader("Shib-Authentication-Instant", "HTTP_SHIB_AUTHENTICATION_INSTANT");
- request.clearHeader("Shib-AuthnContext-Class", "HTTP_SHIB_AUTHNCONTEXT_CLASS");
- request.clearHeader("Shib-AuthnContext-Decl", "HTTP_SHIB_AUTHNCONTEXT_DECL");
- request.clearHeader("Shib-Assertion-Count", "HTTP_SHIB_ASSERTION_COUNT");
- request.clearHeader("Shib-Handler", "HTTP_SHIB_HANDLER");
- request.clearHeader("REMOTE_USER", "HTTP_REMOTE_USER");
- // TODO: Redo the handling of attribute headers in the code, likely supplanting all of the above...
- //request.clearAttributeHeaders();
- }
+void Agent::clearHeaders(SPRequest& request) const {
+ request.clearHeader("Shib-Cookie-Name", "HTTP_SHIB_COOKIE_NAME");
+ request.clearHeader("Shib-Session-ID", "HTTP_SHIB_SESSION_ID");
+ request.clearHeader("Shib-Session-Index", "HTTP_SHIB_SESSION_INDEX");
+ request.clearHeader("Shib-Session-Expires", "HTTP_SHIB_SESSION_EXPIRES");
+ request.clearHeader("Shib-Session-Inactivity", "HTTP_SHIB_SESSION_INACTIVITY");
+ request.clearHeader("Shib-Identity-Provider", "HTTP_SHIB_IDENTITY_PROVIDER");
+ request.clearHeader("Shib-Authentication-Method", "HTTP_SHIB_AUTHENTICATION_METHOD");
+ request.clearHeader("Shib-Authentication-Instant", "HTTP_SHIB_AUTHENTICATION_INSTANT");
+ request.clearHeader("Shib-AuthnContext-Class", "HTTP_SHIB_AUTHNCONTEXT_CLASS");
+ request.clearHeader("Shib-AuthnContext-Decl", "HTTP_SHIB_AUTHNCONTEXT_DECL");
+ request.clearHeader("Shib-Assertion-Count", "HTTP_SHIB_ASSERTION_COUNT");
+ request.clearHeader("Shib-Handler", "HTTP_SHIB_HANDLER");
+ request.clearHeader("REMOTE_USER", "HTTP_REMOTE_USER");
+ // TODO: Redo the handling of attribute headers in the code, likely supplanting all of the above...
+ //request.clearAttributeHeaders();
+}
- void SHIBSP_DLLLOCAL exportAttributes(SPRequest& request, const Session* session, RequestMapper::Settings settings) {
-
- const char* enc = settings.first->getString("encoding");
- if (enc && strcmp(enc, "URL"))
- throw ConfigurationException(string("Unsupported value for 'encoding' content setting: ") + enc);
-
- const URLEncoder& encoder = AgentConfig::getConfig().getURLEncoder();
-
- // Default delimiter is semicolon but is now configurable.
- const char* delim = settings.first->getString("attributeValueDelimiter", ";");
- size_t delim_len = strlen(delim);
-
- bool exportDups = settings.first->getBool("exportDuplicateValues", true);
- const multimap<string,const Attribute*>& attributes = session->getIndexedAttributes();
-
- // Default export strategy will include duplicates.
- if (exportDups) {
- for (multimap<string,const Attribute*>::const_iterator a = attributes.begin(); a != attributes.end(); ++a) {
- if (a->second->isInternal())
- continue;
- string header(request.getSecureHeader(a->first.c_str()));
- const vector<string>& vals = a->second->getSerializedValues();
- for (vector<string>::const_iterator v = vals.begin(); v != vals.end(); ++v) {
- if (!header.empty())
- header += delim;
- if (enc) {
- // If URL-encoding, any semicolons will get escaped anyway.
- header += encoder.encode(v->c_str());
+void Agent::exportAttributes(SPRequest& request, const Session* session) const {
+
+ RequestMapper::Settings settings = request.getRequestSettings();
+
+ const char* enc = settings.first->getString("encoding");
+ if (enc && strcmp(enc, "URL"))
+ throw ConfigurationException(string("Unsupported value for 'encoding' content setting: ") + enc);
+
+ const URLEncoder& encoder = AgentConfig::getConfig().getURLEncoder();
+
+ // Default delimiter is semicolon but is now configurable.
+ const char* delim = settings.first->getString("attributeValueDelimiter", ";");
+ size_t delim_len = strlen(delim);
+
+ bool exportDups = settings.first->getBool("exportDuplicateValues", true);
+ const multimap<string,const Attribute*>& attributes = session->getIndexedAttributes();
+
+ // Default export strategy will include duplicates.
+ if (exportDups) {
+ for (multimap<string,const Attribute*>::const_iterator a = attributes.begin(); a != attributes.end(); ++a) {
+ if (a->second->isInternal())
+ continue;
+ string header(request.getSecureHeader(a->first.c_str()));
+ const vector<string>& vals = a->second->getSerializedValues();
+ for (vector<string>::const_iterator v = vals.begin(); v != vals.end(); ++v) {
+ if (!header.empty())
+ header += delim;
+ if (enc) {
+ // If URL-encoding, any semicolons will get escaped anyway.
+ header += encoder.encode(v->c_str());
+ }
+ else {
+ string::size_type pos = v->find(delim, string::size_type(0));
+ if (pos != string::npos) {
+ string value(*v);
+ for (; pos != string::npos; pos = value.find(delim, pos)) {
+ value.insert(pos, "\\");
+ pos += delim_len + 1;
+ }
+ header += value;
}
else {
- string::size_type pos = v->find(delim, string::size_type(0));
- if (pos != string::npos) {
- string value(*v);
- for (; pos != string::npos; pos = value.find(delim, pos)) {
- value.insert(pos, "\\");
- pos += delim_len + 1;
- }
- header += value;
- }
- else {
- header += (*v);
- }
+ header += (*v);
}
}
- request.setHeader(a->first.c_str(), header.c_str());
}
+ request.setHeader(a->first.c_str(), header.c_str());
+ }
+ }
+ else {
+ // Capture values in a map of sets to check for duplicates on the fly.
+ map< string,set<string> > valueMap;
+ for (multimap<string,const Attribute*>::const_iterator a = attributes.begin(); a != attributes.end(); ++a) {
+ if (a->second->isInternal())
+ continue;
+ const vector<string>& vals = a->second->getSerializedValues();
+ valueMap[a->first].insert(vals.begin(), vals.end());
}
- else {
- // Capture values in a map of sets to check for duplicates on the fly.
- map< string,set<string> > valueMap;
- for (multimap<string,const Attribute*>::const_iterator a = attributes.begin(); a != attributes.end(); ++a) {
- if (a->second->isInternal())
- continue;
- const vector<string>& vals = a->second->getSerializedValues();
- valueMap[a->first].insert(vals.begin(), vals.end());
- }
- // Export the mapped sets to the headers.
- for (map< string,set<string> >::const_iterator deduped = valueMap.begin(); deduped != valueMap.end(); ++deduped) {
- string header;
- for (set<string>::const_iterator v = deduped->second.begin(); v != deduped->second.end(); ++v) {
- if (!header.empty())
- header += delim;
- if (enc) {
- // If URL-encoding, any semicolons will get escaped anyway.
- header += encoder.encode(v->c_str());
+ // Export the mapped sets to the headers.
+ for (map< string,set<string> >::const_iterator deduped = valueMap.begin(); deduped != valueMap.end(); ++deduped) {
+ string header;
+ for (set<string>::const_iterator v = deduped->second.begin(); v != deduped->second.end(); ++v) {
+ if (!header.empty())
+ header += delim;
+ if (enc) {
+ // If URL-encoding, any semicolons will get escaped anyway.
+ header += encoder.encode(v->c_str());
+ }
+ else {
+ string::size_type pos = v->find(delim, string::size_type(0));
+ if (pos != string::npos) {
+ string value(*v);
+ for (; pos != string::npos; pos = value.find(delim, pos)) {
+ value.insert(pos, "\\");
+ pos += delim_len + 1;
+ }
+ header += value;
}
else {
- string::size_type pos = v->find(delim, string::size_type(0));
- if (pos != string::npos) {
- string value(*v);
- for (; pos != string::npos; pos = value.find(delim, pos)) {
- value.insert(pos, "\\");
- pos += delim_len + 1;
- }
- header += value;
- }
- else {
- header += (*v);
- }
+ header += (*v);
}
}
- request.setHeader(deduped->first.c_str(), header.c_str());
}
+ request.setHeader(deduped->first.c_str(), header.c_str());
}
+ }
- // Check for REMOTE_USER.
- bool remoteUserSet = false;
- vector<string> dummy;
- const vector<string>& rmids = dummy; // app.getRemoteUserAttributeIds(); TODO: re implement this elsewhere
- for (vector<string>::const_iterator rmid = rmids.begin(); !remoteUserSet && rmid != rmids.end(); ++rmid) {
- pair<multimap<string,const Attribute*>::const_iterator,multimap<string,const Attribute*>::const_iterator> matches =
- attributes.equal_range(*rmid);
- for (; matches.first != matches.second; ++matches.first) {
- const vector<string>& vals = matches.first->second->getSerializedValues();
- if (!vals.empty()) {
- if (enc)
- request.setRemoteUser(encoder.encode(vals.front().c_str()).c_str());
- else
- request.setRemoteUser(vals.front().c_str());
- remoteUserSet = true;
- break;
- }
+ // Check for REMOTE_USER.
+ bool remoteUserSet = false;
+ vector<string> dummy;
+ const vector<string>& rmids = dummy; // app.getRemoteUserAttributeIds(); TODO: re implement this elsewhere
+ for (vector<string>::const_iterator rmid = rmids.begin(); !remoteUserSet && rmid != rmids.end(); ++rmid) {
+ pair<multimap<string,const Attribute*>::const_iterator,multimap<string,const Attribute*>::const_iterator> matches =
+ attributes.equal_range(*rmid);
+ for (; matches.first != matches.second; ++matches.first) {
+ const vector<string>& vals = matches.first->second->getSerializedValues();
+ if (!vals.empty()) {
+ if (enc)
+ request.setRemoteUser(encoder.encode(vals.front().c_str()).c_str());
+ else
+ request.setRemoteUser(vals.front().c_str());
+ remoteUserSet = true;
+ break;
}
}
}
-};
-
-void SHIBSP_API shibsp::registerServiceProviders()
-{
- SPConfig::getConfig().ServiceProviderManager.registerFactory(XML_SERVICE_PROVIDER, XMLServiceProviderFactory);
-}
-
-ServiceProvider::ServiceProvider()
-{
- m_authTypes.insert("shibboleth");
}
-ServiceProvider::~ServiceProvider()
-{
-}
-
-pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handler) const
+pair<bool,long> Agent::doAuthentication(SPRequest& request, bool handler) const
{
Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
@@ -324,26 +314,29 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
return make_pair(true, request.sendRedirect(loc.c_str()));
}
}
- app->setHeader(request, "Shib-Handler", handlerURL);
+ request.setHeader("Shib-Handler", handlerURL);
}
else {
// No session. Maybe that's acceptable?
if (!requireSession && !requireSessionWith) {
- app->setHeader(request, "Shib-Handler", handlerURL);
+ request.setHeader("Shib-Handler", handlerURL);
return make_pair(true, request.returnOK());
}
// No session, but we require one. Initiate a new session using the indicated method.
+
+ // TODO: replace with new handler infra
+
const SessionInitiator* initiator=nullptr;
if (requireSessionWith) {
- SPConfig::getConfig().deprecation().warn("requireSessionWith");
- initiator=app->getSessionInitiatorById(requireSessionWith);
+ AgentConfig::getConfig().deprecation().warn("requireSessionWith");
+ //initiator = app->getSessionInitiatorById(requireSessionWith);
if (!initiator) {
throw ConfigurationException(string("No session initiator found with id: ") + requireSessionWith);
}
}
else {
- initiator=app->getDefaultSessionInitiator();
+ //initiator = app->getDefaultSessionInitiator();
if (!initiator)
throw ConfigurationException("No default session initiator found, check configuration.");
}
@@ -369,7 +362,7 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
}
}
-pair<bool,long> ServiceProvider::doAuthorization(SPRequest& request) const
+pair<bool,long> Agent::doAuthorization(SPRequest& request) const
{
Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
@@ -437,7 +430,7 @@ pair<bool,long> ServiceProvider::doAuthorization(SPRequest& request) const
}
}
-pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSession) const
+pair<bool,long> Agent::doExport(SPRequest& request, bool requireSession) const
{
Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
@@ -471,10 +464,8 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
return make_pair(false, 0L); // just bail silently
}
- app->setHeader(request, "Shib-Application-ID", app->getId());
- app->setHeader(request, "Shib-Session-ID", session->getID());
-
- const PropertySet* sessionProps = app->getPropertySet("Sessions");
+ request.setHeader("Shib-Application-ID", settings.first->getString("applicationId", "default"));
+ request.setHeader("Shib-Session-ID", session->getID());
// Check for export of "standard" variables.
// A 3.0 release would switch this default to false and rely solely on the
@@ -483,36 +474,36 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
if (stdvars) {
const char* hval = session->getEntityID();
if (hval)
- app->setHeader(request, "Shib-Identity-Provider", hval);
+ request.setHeader("Shib-Identity-Provider", hval);
time_t ts = session->getAuthnInstant();
if (ts > 0) {
// TODO: Need to see what the output format of this really is.
ostringstream os;
os << date::format("%FT%TZ", chrono::system_clock::from_time_t(ts));
- app->setHeader(request, "Shib-Authentication-Instant", os.str().c_str());
+ request.setHeader("Shib-Authentication-Instant", os.str().c_str());
}
hval = session->getAuthnContextClassRef();
if (hval) {
- app->setHeader(request, "Shib-Authentication-Method", hval);
- app->setHeader(request, "Shib-AuthnContext-Class", hval);
+ request.setHeader("Shib-Authentication-Method", hval);
+ request.setHeader("Shib-AuthnContext-Class", hval);
}
- app->setHeader(request, "Shib-Session-Expires", boost::lexical_cast<string>(session->getExpiration()).c_str());
- pair<bool,unsigned int> timeout = sessionProps ? sessionProps->getUnsignedInt("timeout") : pair<bool,unsigned int>(false, 0);
- if (timeout.first && timeout.second > 0) {
- app->setHeader(request, "Shib-Session-Inactivity", boost::lexical_cast<string>(session->getLastAccess() + timeout.second).c_str());
+ request.setHeader( "Shib-Session-Expires", boost::lexical_cast<string>(session->getExpiration()).c_str());
+ unsigned int timeout = settings.first->getUnsignedInt("timeout", 3600);
+ if (timeout > 0) {
+ request.setHeader( "Shib-Session-Inactivity", boost::lexical_cast<string>(session->getLastAccess() + timeout).c_str());
}
}
// Check for export of algorithmically-derived portion of cookie names.
bool exportCookie = settings.first->getBool("exportCookie", false);
if (exportCookie) {
- pair<string,const char*> cookieprops = app->getCookieNameProps(nullptr);
- app->setHeader(request, "Shib-Cookie-Name", cookieprops.first.c_str());
+ pair<string,const char*> cookieprops = request.getCookieNameProps(nullptr);
+ request.setHeader("Shib-Cookie-Name", cookieprops.first.c_str());
}
// Export the attributes.
- exportAttributes(request, session, settings);
+ exportAttributes(request, session);
return make_pair(false,0L);
}
@@ -522,7 +513,7 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
}
}
-pair<bool,long> ServiceProvider::doHandler(SPRequest& request) const
+pair<bool,long> Agent::doHandler(SPRequest& request) const
{
Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
@@ -559,16 +550,11 @@ pair<bool,long> ServiceProvider::doHandler(SPRequest& request) const
if (!boost::contains(targetURL, handlerURL))
return make_pair(true, request.returnDecline());
- const PropertySet* sessionProps = app->getPropertySet("Sessions");
- if (!sessionProps)
- throw ConfigurationException("Unable to map request to application session settings, check configuration.");
-
- // Process incoming request.
- pair<bool,bool> handlerSSL = sessionProps->getBool("handlerSSL");
-
// We dispatch based on our path info. We know the request URL begins with or equals the handler URL,
// so the path info is the next character (or null).
- const Handler* handler = app->getHandler(targetURL.c_str() + strlen(handlerURL));
+
+ // TODO: replace with new handler infra
+ const Handler* handler = nullptr; // app->getHandler(targetURL.c_str() + strlen(handlerURL));
if (!handler)
throw ConfigurationException("Shibboleth handler invoked at an unconfigured location.");
diff --git a/shibsp/Agent.h b/shibsp/Agent.h
index 832a7178..3ba6a982 100644
--- a/shibsp/Agent.h
+++ b/shibsp/Agent.h
@@ -27,12 +27,12 @@
namespace shibsp {
- class SHIBSP_API Application;
+ class SHIBSP_API Category;
class SHIBSP_API Handler;
class SHIBSP_API RemotingService;
class SHIBSP_API RequestMapper;
+ class SHIBSP_API Session;
class SHIBSP_API SessionCache;
- //class SHIBSP_API AgentRequest;
class SHIBSP_API SPRequest;
#if defined (_MSC_VER)
@@ -136,6 +136,18 @@ namespace shibsp {
protected:
/** The AuthTypes to "recognize" (defaults to "shibboleth"). */
std::set<std::string> m_authTypes;
+
+ private:
+ long handleError(
+ Category& log,
+ SPRequest& request,
+ const Session* session=nullptr,
+ const std::exception* ex=nullptr,
+ bool mayRedirect=true
+ ) const;
+ void clearHeaders(SPRequest& request) const;
+ void exportAttributes(SPRequest& request, const Session* session) const;
+
};
#if defined (_MSC_VER)
diff --git a/shibsp/Application.cpp b/shibsp/Application.cpp
deleted file mode 100644
index 88abdee0..00000000
--- a/shibsp/Application.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * Application.cpp
- *
- * Interface to a Shibboleth Application instance.
- */
-
-#include "internal.h"
-#include "Application.h"
-#include "SPRequest.h"
-#include "ServiceProvider.h"
-#include "attribute/Attribute.h"
-#include "remoting/RemotingService.h"
-
-#include <algorithm>
-#define BOOST_BIND_GLOBAL_PLACEHOLDERS
-#include <boost/bind.hpp>
-#include <xmltooling/util/Threads.h>
-
-using namespace shibsp;
-using namespace xmltooling;
-using namespace boost;
-using namespace std;
-
-Application::Application(const ServiceProvider* sp) : m_sp(sp), m_lock(RWLock::create())
-{
-}
-
-Application::~Application()
-{
- delete m_lock;
-}
-
-const ServiceProvider& Application::getServiceProvider() const
-{
- return *m_sp;
-}
-
-const char* Application::getId() const
-{
- pair<bool,const char*> ret = getString("id");
- return ret.first ? ret.second : "default";
-}
-
-string Application::getCookieName(const char* prefix, time_t* lifetime) const
-{
- if (lifetime)
- *lifetime = 0;
- if (!prefix)
- prefix = "";
- const PropertySet* props = getPropertySet("Sessions");
- if (props) {
- if (lifetime) {
- pair<bool,unsigned int> lt = props->getUnsignedInt("cookieLifetime");
- if (lt.first)
- *lifetime = lt.second;
- }
- pair<bool,const char*> p = props->getString("cookieName");
- if (p.first)
- return string(prefix) + p.second;
- }
-
- return string(prefix) + getHash();
-}
-
-pair<string,const char*> Application::getCookieNameProps(const char* prefix, time_t* lifetime) const
-{
- // TODO: remove in V4 if it ever drops.
-
- static const char* defProps="; path=/; HttpOnly";
- static const char* sslProps="; path=/; secure; HttpOnly";
-
- if (lifetime)
- *lifetime = 0;
- if (!prefix)
- prefix = "";
- const PropertySet* props = getPropertySet("Sessions");
- if (props) {
- if (lifetime) {
- pair<bool,unsigned int> lt = props->getUnsignedInt("cookieLifetime");
- if (lt.first)
- *lifetime = lt.second;
- }
- pair<bool,const char*> p = props->getString("cookieProps");
- if (!p.first || !strcmp(p.second, "http"))
- p.second = defProps;
- else if (!strcmp(p.second, "https"))
- p.second = sslProps;
- pair<bool,const char*> p2 = props->getString("cookieName");
- if (p2.first)
- return make_pair(string(prefix) + p2.second, p.second);
- return make_pair(string(prefix) + getHash(), p.second);
- }
-
- // Shouldn't happen, but just in case..
- return pair<string,const char*>(prefix, defProps);
-}
-
-void Application::clearHeader(SPRequest& request, const char* rawname, const char* cginame) const
-{
- request.clearHeader(rawname, cginame);
-}
-
-void Application::setHeader(SPRequest& request, const char* name, const char* value) const
-{
- request.setHeader(name, value);
-}
-
-string Application::getSecureHeader(const SPRequest& request, const char* name) const
-{
- return request.getSecureHeader(name);
-}
-
-void Application::clearAttributeHeaders(SPRequest& request) const
-{
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
- for (vector< pair<string,string> >::const_iterator i = m_unsetHeaders.begin(); i != m_unsetHeaders.end(); ++i) {
- request.clearHeader(i->first.c_str(), i->second.c_str());
- }
- return;
- }
-
- m_lock->rdlock();
- if (m_unsetHeaders.empty()) {
- // No headers yet, so we have to request them from the remote half.
- m_lock->unlock();
- m_lock->wrlock();
- if (m_unsetHeaders.empty()) {
- SharedLock wrlock(m_lock, false);
- string addr=string(getId()) + "::getHeaders::Application";
- DDF out,in = DDF(addr.c_str());
- DDFJanitor jin(in),jout(out);
- //out = getServiceProvider().getListenerService()->send(in);
- if (out.islist()) {
- DDF header = out.first();
- while (header.name() && header.isstring()) {
- m_unsetHeaders.push_back(pair<string,string>(header.name(),header.string()));
- header = out.next();
- }
- }
- }
- else {
- m_lock->unlock();
- }
- m_lock->rdlock();
- }
-
- // Now holding read lock.
- SharedLock unsetLock(m_lock, false);
- for (vector< pair<string,string> >::const_iterator i = m_unsetHeaders.begin(); i != m_unsetHeaders.end(); ++i) {
- request.clearHeader(i->first.c_str(), i->second.c_str());
- }
-}
-
-void Application::limitRedirect(const GenericRequest& request, const char* url) const
-{
-}
diff --git a/shibsp/Application.h b/shibsp/Application.h
deleted file mode 100644
index 8cb3eba3..00000000
--- a/shibsp/Application.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * @file shibsp/Application.h
- *
- * Interface to a Shibboleth Application instance.
- */
-
-#ifndef __shibsp_app_h__
-#define __shibsp_app_h__
-
-#include <shibsp/util/PropertySet.h>
-
-#include <string>
-#include <vector>
-
-namespace xmltooling {
- class XMLTOOL_API RWLock;
-};
-
-namespace shibsp {
-
- class SHIBSP_API Attribute;
- class SHIBSP_API GenericRequest;
- class SHIBSP_API Handler;
- class SHIBSP_API ServiceProvider;
- class SHIBSP_API SessionInitiator;
- class SHIBSP_API SPRequest;
-
-#if defined (_MSC_VER)
- #pragma warning( push )
- #pragma warning( disable : 4251 )
-#endif
-
- /**
- * Interface to a Shibboleth Application instance.
- *
- * <p>An Application is a logical set of resources that act as a unit
- * of session management and policy.
- */
- class SHIBSP_API Application : public virtual PropertySet
- {
- MAKE_NONCOPYABLE(Application);
- protected:
- /**
- * Constructor.
- *
- * @param sp parent ServiceProvider instance
- */
- Application(const ServiceProvider* sp);
-
- /** Pointer to parent SP instance. */
- const ServiceProvider* m_sp;
-
- /** Shared lock for manipulating application state. */
- mutable xmltooling::RWLock* m_lock;
-
- /** Pairs of raw and normalized CGI header names to clear. */
- mutable std::vector< std::pair<std::string,std::string> > m_unsetHeaders;
-
- public:
- virtual ~Application();
-
- /**
- * Returns the owning ServiceProvider instance.
- *
- * @return a locked ServiceProvider
- */
- const ServiceProvider& getServiceProvider() const;
-
- /**
- * Returns the Application's ID.
- *
- * @return the ID
- */
- virtual const char* getId() const;
-
- /**
- * Returns a unique hash for the Application.
- *
- * @return a value resulting from a computation over the Application's configuration
- */
- virtual const char* getHash() const=0;
-
- /**
- * @Deprecated
- *
- * Returns the cookies name to use for this Application.
- *
- * @param prefix a value to prepend to the base cookie name
- * @param lifetime if non-null, will be populated with a suggested lifetime for the cookie, or 0 if session-bound
- * @return the assigned cookie name to use
- */
- virtual std::string getCookieName(const char* prefix, time_t* lifetime=nullptr) const;
-
- /**
- * @Deprecated
- *
- * Returns the name and cookie properties to use for this Application.
- *
- * @param prefix a value to prepend to the base cookie name
- * @param lifetime if non-null, will be populated with a suggested lifetime for the cookie, or 0 if session-bound
- * @return a pair containing the cookie name and the string to append to the cookie value
- */
- virtual std::pair<std::string,const char*> getCookieNameProps(const char* prefix, time_t* lifetime=nullptr) const;
-
-#ifndef SHIBSP_LITE
- /**
- * Returns configuration properties governing security interactions with a peer.
- *
- * @param provider a peer entity's metadata
- * @return the applicable PropertySet
- */
- virtual const PropertySet* getRelyingParty(const opensaml::saml2md::EntityDescriptor* provider) const=0;
-
- /**
- * Returns configuration properties governing security interactions with a named peer.
- *
- * @param entityID a peer name
- * @return the applicable PropertySet
- */
- virtual const PropertySet* getRelyingParty(const XMLCh* entityID) const=0;
-#endif
-
- /**
- * Returns the designated notification URL, or an empty string if no more locations are specified.
- *
- * @param request requested URL to use to fill in missing pieces of notification URL
- * @param front true iff front channel notification is desired, false iff back channel is desired
- * @param index zero-based index of URL to return
- * @return the designated URL, or an empty string
- */
- virtual std::string getNotificationURL(const char* request, bool front, unsigned int index) const=0;
-
- /**
- * Returns an array of attribute IDs to use as a REMOTE_USER value, in order of preference.
- *
- * @return an array of attribute IDs, possibly empty
- */
- virtual const std::vector<std::string>& getRemoteUserAttributeIds() const=0;
-
- /**
- * Ensures no value exists for a request header, allowing for application-specific customization.
- *
- * @param request SP request to modify
- * @param rawname raw name of header to clear
- * @param cginame CGI-equivalent name of header, <strong>MUST</strong> begin with "HTTP_".
- */
- virtual void clearHeader(SPRequest& request, const char* rawname, const char* cginame) const;
-
- /**
- * Sets a value for a request header allowing for application-specific customization.
- *
- * @param request SP request to modify
- * @param name name of header to set
- * @param value value to set
- */
- virtual void setHeader(SPRequest& request, const char* name, const char* value) const;
-
- /**
- * Returns a non-spoofable request header value allowing for application-specific customization.
- *
- * @param request SP request to access
- * @param name the name of the secure header to return
- * @return the header's value, or an empty string
- */
- virtual std::string getSecureHeader(const SPRequest& request, const char* name) const;
-
- /**
- * Clears any headers that may be used to hold attributes after export.
- *
- * @param request SP request to clear
- */
- virtual void clearAttributeHeaders(SPRequest& request) const;
-
- /**
- * Returns the default SessionInitiator when automatically requesting a session.
- *
- * @return the default SessionInitiator, or nullptr
- */
- virtual const SessionInitiator* getDefaultSessionInitiator() const=0;
-
- /**
- * Returns a SessionInitiator with a particular ID when automatically requesting a session.
- *
- * @param id an identifier unique to the Application
- * @return the designated SessionInitiator, or nullptr
- */
- virtual const SessionInitiator* getSessionInitiatorById(const char* id) const=0;
-
- /**
- * Returns the default AssertionConsumerService Handler
- * for use in AuthnRequest messages.
- *
- * @return the default AssertionConsumerService, or nullptr
- */
- virtual const Handler* getDefaultAssertionConsumerService() const=0;
-
- /**
- * Returns an AssertionConsumerService Handler with a particular index
- * for use in AuthnRequest messages.
- *
- * @param index an index unique to an application
- * @return the designated AssertionConsumerService, or nullptr
- */
- virtual const Handler* getAssertionConsumerServiceByIndex(unsigned short index) const=0;
-
- /**
- * Returns an AssertionConsumerService Handler that supports
- * a particular protocol "family" and optional binding.
- *
- * @param protocol a protocol identifier
- * @param binding a binding identifier
- * @return a matching AssertionConsumerService, or nullptr
- */
- virtual const Handler* getAssertionConsumerServiceByProtocol(const XMLCh* protocol, const char* binding=nullptr) const=0;
-
- /**
- * Returns the Handler associated with a particular path/location.
- *
- * @param path the PATH_INFO appended to the end of a base Handler location
- * that invokes the Handler
- * @return the mapped Handler, or nullptr
- */
- virtual const Handler* getHandler(const char* path) const=0;
-
- /**
- * Returns all registered Handlers.
- *
- * @param handlers array to populate
- */
- virtual void getHandlers(std::vector<const Handler*>& handlers) const=0;
-
- /**
- * Checks a proposed redirect URL against application-specific settings for legal redirects,
- * such as same-host restrictions or allowed domains, and raises a SecurityPolicyException
- * in the event of a violation.
- *
- * @param request the request leading to the redirect
- * @param url an absolute URL to validate
- */
- virtual void limitRedirect(const GenericRequest& request, const char* url) const;
- };
-
-#if defined (_MSC_VER)
- #pragma warning( pop )
-#endif
-
-};
-
-#endif /* __shibsp_app_h__ */
diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am
index 32407005..f1ee5868 100644
--- a/shibsp/Makefile.am
+++ b/shibsp/Makefile.am
@@ -25,13 +25,10 @@ libshibspinclude_HEADERS = \
AccessControl.h \
Agent.h \
AgentConfig.h \
- Application.h \
base.h \
exceptions.h \
RequestMapper.h \
- ServiceProvider.h \
SessionCache.h \
- SPConfig.h \
SPRequest.h \
version.h
@@ -94,10 +91,7 @@ noinst_HEADERS = \
libshibsp_la_SOURCES = \
AbstractSPRequest.cpp \
Agent.cpp \
- Application.cpp \
exceptions.cpp \
- ServiceProvider.cpp \
- SPConfig.cpp \
version.cpp \
attribute/Attribute.cpp \
attribute/BinaryAttribute.cpp \
@@ -129,9 +123,7 @@ libshibsp_la_SOURCES = \
impl/StoredSession.cpp \
impl/StorageServiceSessionCache.cpp \
impl/XMLAccessControl.cpp \
- impl/XMLApplication.cpp \
impl/XMLRequestMapper.cpp \
- impl/XMLServiceProvider.cpp \
io/impl/HTTPRequest.cpp \
io/impl/HTTPResponse.cpp \
logging/impl/AbstractLoggingService.cpp \
diff --git a/shibsp/SPRequest.h b/shibsp/SPRequest.h
index fd067243..ca7fdfad 100644
--- a/shibsp/SPRequest.h
+++ b/shibsp/SPRequest.h
@@ -29,8 +29,6 @@
namespace shibsp {
class SHIBSP_API Agent;
- class SHIBSP_API Application;
- class SHIBSP_API ServiceProvider;
class SHIBSP_API Session;
/**
@@ -40,7 +38,7 @@ namespace shibsp {
* a shim must be supplied in the form of this interface to adapt the
* library to different proprietary server APIs.
*
- * <p>This interface need not be threadsafe.
+ * <p>This interface need not be threadsafe.</p>
*/
class SHIBSP_API SPRequest : public virtual HTTPRequest, public virtual HTTPResponse
{
diff --git a/shibsp/attribute/Attribute.cpp b/shibsp/attribute/Attribute.cpp
index 06467e41..9ab335d3 100644
--- a/shibsp/attribute/Attribute.cpp
+++ b/shibsp/attribute/Attribute.cpp
@@ -26,11 +26,7 @@
#include "internal.h"
#include "exceptions.h"
-#include "SPConfig.h"
#include "attribute/SimpleAttribute.h"
-#ifndef SHIBSP_LITE
-# include "attribute/AttributeDecoder.h"
-#endif
#include "util/SPConstants.h"
using namespace shibsp;
diff --git a/shibsp/attribute/BinaryAttribute.cpp b/shibsp/attribute/BinaryAttribute.cpp
index 6b65dccb..818f6e6e 100644
--- a/shibsp/attribute/BinaryAttribute.cpp
+++ b/shibsp/attribute/BinaryAttribute.cpp
@@ -28,8 +28,10 @@
#include "attribute/BinaryAttribute.h"
#include <xercesc/util/Base64.hpp>
+#include <xercesc/util/XMLString.hpp>
using namespace shibsp;
+using namespace xercesc;
using namespace std;
namespace shibsp {
diff --git a/shibsp/base.h b/shibsp/base.h
index 560a172b..afece18d 100644
--- a/shibsp/base.h
+++ b/shibsp/base.h
@@ -28,12 +28,9 @@
#ifndef __shibsp_base_h__
#define __shibsp_base_h__
-#ifdef SHIBSP_LITE
-# define XMLTOOLING_LITE
-# include <xmltooling/base.h>
-#else
-# include <saml/base.h>
-#endif
+// TODO: remove
+#define XMLTOOLING_LITE
+#include <xmltooling/base.h>
#if defined (_MSC_VER) || defined(__BORLANDC__)
#include <shibsp/config_pub_win32.h>
diff --git a/shibsp/handler/RemotedHandler.h b/shibsp/handler/RemotedHandler.h
index 76788767..36f77c1c 100644
--- a/shibsp/handler/RemotedHandler.h
+++ b/shibsp/handler/RemotedHandler.h
@@ -98,46 +98,6 @@ namespace shibsp {
*/
virtual std::pair<bool,long> unwrap(SPRequest& request, DDF& out) const;
- /**
- * Builds a new request instance around a remoted data object.
- *
- * @param app the application
- * @param in the dataflow object containing the remoted request
- * @return a call-specific request object based on the input, to be freed by the caller
- */
- HTTPRequest* getRequest(const Application& app, DDF& in) const;
-
- /**
- * Builds a new response instance around an outgoing data object.
- *
- * @param app the application
- * @param out the dataflow object to be returned by the caller
- * @return a call-specific response object, to be freed by the caller
- */
- HTTPResponse* getResponse(const Application& app, DDF& out) const;
-
- /**
- * @Deprecated
- *
- * Builds a new request instance around a remoted data object.
- *
- * @param app the application
- * @param in the dataflow object containing the remoted request
- * @return a call-specific request object based on the input, to be freed by the caller
- */
- HTTPRequest* getRequest(DDF& in) const;
-
- /**
- * @Deprecated
- *
- * Builds a new response instance around an outgoing data object.
- *
- * @param app the application
- * @param out the dataflow object to be returned by the caller
- * @return a call-specific response object, to be freed by the caller
- */
- HTTPResponse* getResponse(DDF& out) const;
-
/** Message address for remote half. */
std::string m_address;
};
diff --git a/shibsp/handler/impl/AbstractHandler.cpp b/shibsp/handler/impl/AbstractHandler.cpp
index 7347b588..ce5e9639 100644
--- a/shibsp/handler/impl/AbstractHandler.cpp
+++ b/shibsp/handler/impl/AbstractHandler.cpp
@@ -84,15 +84,15 @@ namespace shibsp {
void SHIBSP_API shibsp::registerHandlers()
{
- SPConfig& conf=SPConfig::getConfig();
+ AgentConfig& conf=AgentConfig::getConfig();
//conf.AssertionConsumerServiceManager.registerFactory(SAML20_ASSERTION_CONSUMER_SERVICE, SAML2ConsumerFactory);
- conf.HandlerManager.registerFactory(ATTR_CHECKER_HANDLER, AttributeCheckerFactory);
- conf.HandlerManager.registerFactory(DISCOVERY_FEED_HANDLER, DiscoveryFeedFactory);
- conf.HandlerManager.registerFactory(METADATA_GENERATOR_HANDLER, MetadataGeneratorFactory);
- conf.HandlerManager.registerFactory(STATUS_HANDLER, StatusHandlerFactory);
- conf.HandlerManager.registerFactory(SESSION_HANDLER, SessionHandlerFactory);
+ //conf.HandlerManager.registerFactory(ATTR_CHECKER_HANDLER, AttributeCheckerFactory);
+ //conf.HandlerManager.registerFactory(DISCOVERY_FEED_HANDLER, DiscoveryFeedFactory);
+ //conf.HandlerManager.registerFactory(METADATA_GENERATOR_HANDLER, MetadataGeneratorFactory);
+ //conf.HandlerManager.registerFactory(STATUS_HANDLER, StatusHandlerFactory);
+ //conf.HandlerManager.registerFactory(SESSION_HANDLER, SessionHandlerFactory);
//conf.HandlerManager.registerFactory(SAML20_LOGOUT_HANDLER, SAML2LogoutFactory);
@@ -206,7 +206,7 @@ void Handler::preserveRelayState(SPRequest& request, string& relayState) const
if (relayState.find("cookie:") != 0 && relayState.find("ss:") != 0) {
mech+=3;
if (*mech) {
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
#ifndef SHIBSP_LITE
StorageService* storage = application.getServiceProvider().getStorageService(mech.second);
if (storage) {
@@ -234,7 +234,7 @@ void Handler::preserveRelayState(SPRequest& request, string& relayState) const
throw ConfigurationException("Lite version of library cannot be used out of process.");
#endif
}
- else if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
+ else if (true) {
DDF out,in = DDF("set::RelayState").structure();
in.addmember("id").string(mech);
in.addmember("value").unsafe_string(relayState.c_str());
@@ -269,7 +269,7 @@ void Handler::recoverRelayState(SPRequest& request, string& relayState, bool cle
string ssid = relayState.substr(3, key - state);
key++;
if (!ssid.empty() && *key) {
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
#ifndef SHIBSP_LITE
StorageService* storage = conf.getServiceProvider()->getStorageService(ssid.c_str());
if (storage) {
@@ -298,7 +298,7 @@ void Handler::recoverRelayState(SPRequest& request, string& relayState, bool cle
}
#endif
}
- else if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
+ else if (true) {
DDF out,in = DDF("get::RelayState").structure();
in.addmember("id").string(ssid.c_str());
in.addmember("key").string(key);
@@ -537,7 +537,7 @@ void AbstractHandler::preservePostData(SPRequest& request, const char* relayStat
}
string postkey;
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
DDFJanitor postjan(postData);
#ifndef SHIBSP_LITE
StorageService* storage = application.getServiceProvider().getStorageService(mech.second);
@@ -559,7 +559,7 @@ void AbstractHandler::preservePostData(SPRequest& request, const char* relayStat
throw ConfigurationException("Lite version of library cannot be used out of process.");
#endif
}
- else if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
+ else if (true) {
DDF out,in = DDF("set::PostData").structure();
DDFJanitor jin(in),jout(out);
in.addmember("id").string(mech);
@@ -625,8 +625,7 @@ DDF AbstractHandler::recoverPostData(SPRequest& request, const char* relayState)
string ssid = string(cookie).substr(3, key - state);
key++;
if (!ssid.empty() && *key) {
- SPConfig& conf = SPConfig::getConfig();
- if (conf.isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
#ifndef SHIBSP_LITE
StorageService* storage = conf.getServiceProvider()->getStorageService(ssid.c_str());
if (storage) {
@@ -646,7 +645,7 @@ DDF AbstractHandler::recoverPostData(SPRequest& request, const char* relayState)
}
#endif
}
- else if (conf.isEnabled(SPConfig::InProcess)) {
+ else if (true) {
DDF in = DDF("get::PostData").structure();
DDFJanitor jin(in);
in.addmember("id").string(ssid.c_str());
diff --git a/shibsp/handler/impl/AdminLogoutInitiator.cpp b/shibsp/handler/impl/AdminLogoutInitiator.cpp
index adfa4066..afb178fb 100644
--- a/shibsp/handler/impl/AdminLogoutInitiator.cpp
+++ b/shibsp/handler/impl/AdminLogoutInitiator.cpp
@@ -28,7 +28,6 @@
#include "exceptions.h"
#include "Agent.h"
#include "AgentConfig.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "handler/SecuredHandler.h"
#include "handler/LogoutInitiator.h"
@@ -37,6 +36,7 @@
using namespace shibsp;
using namespace xmltooling;
+using namespace xercesc;
using namespace boost;
using namespace std;
@@ -125,7 +125,7 @@ pair<bool,long> AdminLogoutInitiator::run(SPRequest& request, bool isHandler) co
if (ret.first)
return ret;
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively.
return doRequest(request);
}
diff --git a/shibsp/handler/impl/AssertionConsumerService.cpp b/shibsp/handler/impl/AssertionConsumerService.cpp
index 720a8d36..4f32ee3d 100644
--- a/shibsp/handler/impl/AssertionConsumerService.cpp
+++ b/shibsp/handler/impl/AssertionConsumerService.cpp
@@ -26,7 +26,6 @@
#include "internal.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SPRequest.h"
#include "handler/AssertionConsumerService.h"
#include "util/CGIParser.h"
@@ -37,6 +36,7 @@
using namespace shibspconstants;
using namespace shibsp;
using namespace xmltooling;
+using namespace xercesc;
using namespace boost;
using namespace std;
@@ -77,7 +77,7 @@ pair<bool,long> AssertionConsumerService::run(SPRequest& request, bool isHandler
}
}
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively and directly process the message.
return processMessage(request);
}
diff --git a/shibsp/handler/impl/AssertionLookup.cpp b/shibsp/handler/impl/AssertionLookup.cpp
index 888377dd..9b239f35 100644
--- a/shibsp/handler/impl/AssertionLookup.cpp
+++ b/shibsp/handler/impl/AssertionLookup.cpp
@@ -26,7 +26,6 @@
#include "internal.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "SPRequest.h"
#include "handler/RemotedHandler.h"
@@ -39,6 +38,7 @@
using namespace shibspconstants;
using namespace shibsp;
using namespace xmltooling;
+using namespace xercesc;
using namespace boost;
using namespace std;
@@ -98,7 +98,7 @@ pair<bool,long> AssertionLookup::run(SPRequest& request, bool isHandler) const
return ret;
try {
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively and directly process the message.
return processMessage(request);
}
diff --git a/shibsp/handler/impl/AttributeCheckerHandler.cpp b/shibsp/handler/impl/AttributeCheckerHandler.cpp
index d66d7070..5a8e832b 100644
--- a/shibsp/handler/impl/AttributeCheckerHandler.cpp
+++ b/shibsp/handler/impl/AttributeCheckerHandler.cpp
@@ -29,7 +29,6 @@
#include "Agent.h"
#include "AgentConfig.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "SPRequest.h"
#include "attribute/Attribute.h"
@@ -49,6 +48,7 @@
using namespace shibsp;
using namespace xmltooling;
using namespace boost;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -108,8 +108,6 @@ namespace shibsp {
AttributeCheckerHandler::AttributeCheckerHandler(const DOMElement* e, const char* appId, bool deprecationSupport)
: AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT ".Handler.AttributeChecker"), &g_Blocker)
{
- if (!SPConfig::getConfig().isEnabled(SPConfig::InProcess))
- return;
m_template = XMLHelper::getAttrString(e, nullptr, _template);
if (m_template.empty())
throw ConfigurationException("AttributeChecker missing required template setting.");
@@ -128,7 +126,7 @@ AttributeCheckerHandler::AttributeCheckerHandler(const DOMElement* e, const char
throw ConfigurationException("AttributeChecker requires either the attributes setting or an ACL");
}
else {
- m_acl.reset(SPConfig::getConfig().AccessControlManager.newPlugin(XML_ACCESS_CONTROL, e, deprecationSupport));
+ //m_acl.reset(AgentConfig::getConfig().AccessControlManager.newPlugin(XML_ACCESS_CONTROL, e, deprecationSupport));
}
}
diff --git a/shibsp/handler/impl/DiscoveryFeed.cpp b/shibsp/handler/impl/DiscoveryFeed.cpp
index 45c4c466..032cab5c 100644
--- a/shibsp/handler/impl/DiscoveryFeed.cpp
+++ b/shibsp/handler/impl/DiscoveryFeed.cpp
@@ -27,7 +27,6 @@
#include "internal.h"
#include "AgentConfig.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SPRequest.h"
#include "handler/AbstractHandler.h"
#include "handler/RemotedHandler.h"
@@ -40,6 +39,7 @@
#include <xmltooling/util/Threads.h>
using namespace shibsp;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -140,14 +140,12 @@ DiscoveryFeed::~DiscoveryFeed()
pair<bool,long> DiscoveryFeed::run(SPRequest& request, bool isHandler) const
{
try {
- SPConfig& conf = SPConfig::getConfig();
-
string s;
if (m_cacheToClient) {
s = request.getHeader("If-None-Match");
}
- if (conf.isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively and directly process the message.
if (m_dir.empty()) {
// The feed is directly returned.
diff --git a/shibsp/handler/impl/LocalLogoutInitiator.cpp b/shibsp/handler/impl/LocalLogoutInitiator.cpp
index 7ea1d017..73fbea98 100644
--- a/shibsp/handler/impl/LocalLogoutInitiator.cpp
+++ b/shibsp/handler/impl/LocalLogoutInitiator.cpp
@@ -27,7 +27,6 @@
#include "internal.h"
#include "exceptions.h"
#include "Agent.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "SPRequest.h"
#include "handler/AbstractHandler.h"
@@ -35,6 +34,7 @@
#include <mutex>
using namespace shibsp;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -100,7 +100,7 @@ pair<bool,long> LocalLogoutInitiator::run(SPRequest& request, bool isHandler) co
if (ret.first)
return ret;
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively.
Session* session = nullptr;
try {
diff --git a/shibsp/handler/impl/LogoutHandler.cpp b/shibsp/handler/impl/LogoutHandler.cpp
index 6c5bf989..49c65d6c 100644
--- a/shibsp/handler/impl/LogoutHandler.cpp
+++ b/shibsp/handler/impl/LogoutHandler.cpp
@@ -27,10 +27,10 @@
#include "internal.h"
#include "exceptions.h"
#include "AgentConfig.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "SPRequest.h"
#include "handler/LogoutHandler.h"
+#include "logging/Category.h"
#include "util/PathResolver.h"
#include "util/URLEncoder.h"
@@ -38,6 +38,7 @@
#include <boost/lexical_cast.hpp>
using namespace shibsp;
+using namespace xercesc;
using namespace std;
LogoutHandler::LogoutHandler() : m_initiator(true)
@@ -181,7 +182,7 @@ bool LogoutHandler::notifyBackChannel(const SPRequest& request, const vector<str
if (endpoint.empty())
return true;
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
#ifndef SHIBSP_LITE
scoped_ptr<Envelope> env(EnvelopeBuilder::buildEnvelope());
Body* body = BodyBuilder::buildBody();
diff --git a/shibsp/handler/impl/LogoutInitiator.cpp b/shibsp/handler/impl/LogoutInitiator.cpp
index 78b17ab5..b0ef2198 100644
--- a/shibsp/handler/impl/LogoutInitiator.cpp
+++ b/shibsp/handler/impl/LogoutInitiator.cpp
@@ -29,6 +29,7 @@
using namespace shibsp;
using namespace xmltooling;
+using namespace xercesc;
using namespace std;
LogoutInitiator::LogoutInitiator()
diff --git a/shibsp/handler/impl/MetadataGenerator.cpp b/shibsp/handler/impl/MetadataGenerator.cpp
index 9d493552..d2767961 100644
--- a/shibsp/handler/impl/MetadataGenerator.cpp
+++ b/shibsp/handler/impl/MetadataGenerator.cpp
@@ -26,7 +26,6 @@
#include "internal.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SPRequest.h"
#include "handler/RemotedHandler.h"
#include "handler/SecuredHandler.h"
@@ -37,6 +36,7 @@
using namespace shibsp;
using namespace boost;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -160,7 +160,7 @@ MetadataGenerator::MetadataGenerator(const DOMElement* e, const char* appId)
,m_http(0), m_https(0), m_encryptionBuilder(nullptr), m_digestBuilder(nullptr)
#endif
{
- SPConfig::getConfig().deprecation().warn(METADATA_GENERATOR_HANDLER" handler");
+ //SPConfig::getConfig().deprecation().warn(METADATA_GENERATOR_HANDLER" handler");
string address(appId);
address += getString("Location").second;
@@ -344,7 +344,7 @@ pair<bool,long> MetadataGenerator::run(SPRequest& request, bool isHandler) const
return ret;
try {
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively and directly process the message.
return processMessage(request.getHandlerURL(), request.getParameter("entityID"), request);
}
diff --git a/shibsp/handler/impl/RemotedHandler.cpp b/shibsp/handler/impl/RemotedHandler.cpp
index 7327e7df..ce02b773 100644
--- a/shibsp/handler/impl/RemotedHandler.cpp
+++ b/shibsp/handler/impl/RemotedHandler.cpp
@@ -20,7 +20,6 @@
#include "internal.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SPRequest.h"
#include "handler/RemotedHandler.h"
@@ -374,41 +373,3 @@ pair<bool,long> RemotedHandler::unwrap(SPRequest& request, DDF& out) const
}
return make_pair(false, 0L);
}
-
-HTTPRequest* RemotedHandler::getRequest(DDF& in) const
-{
- // TODO: remove in V4
-#ifndef SHIBSP_LITE
- return new RemotedRequest(nullptr, in);
-#else
- throw ConfigurationException("Cannot process message using lite version of shibsp library.");
-#endif
-}
-
-HTTPResponse* RemotedHandler::getResponse(DDF& out) const
-{
- // TODO: remove in V4
-#ifndef SHIBSP_LITE
- return new RemotedResponse(nullptr, out);
-#else
- throw ConfigurationException("Cannot process message using lite version of shibsp library.");
-#endif
-}
-
-HTTPRequest* RemotedHandler::getRequest(const Application& app, DDF& in) const
-{
-#ifndef SHIBSP_LITE
- return new RemotedRequest(&app, in);
-#else
- throw ConfigurationException("Cannot process message using lite version of shibsp library.");
-#endif
-}
-
-HTTPResponse* RemotedHandler::getResponse(const Application& app, DDF& out) const
-{
-#ifndef SHIBSP_LITE
- return new RemotedResponse(&app, out);
-#else
- throw ConfigurationException("Cannot process message using lite version of shibsp library.");
-#endif
-}
diff --git a/shibsp/handler/impl/SAML2Consumer.cpp b/shibsp/handler/impl/SAML2Consumer.cpp
index 5306cf45..9728b69d 100644
--- a/shibsp/handler/impl/SAML2Consumer.cpp
+++ b/shibsp/handler/impl/SAML2Consumer.cpp
@@ -29,6 +29,7 @@
using namespace shibsp;
using namespace xmltooling;
+using namespace xercesc;
using namespace std;
namespace shibsp {
diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp
index 59f54b7d..b2b3c00e 100644
--- a/shibsp/handler/impl/SAML2Logout.cpp
+++ b/shibsp/handler/impl/SAML2Logout.cpp
@@ -26,7 +26,6 @@
#include "internal.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SPRequest.h"
#include "handler/AbstractHandler.h"
#include "handler/LogoutHandler.h"
@@ -36,6 +35,7 @@
using namespace shibsp;
using namespace boost;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -141,8 +141,7 @@ pair<bool,long> SAML2Logout::run(SPRequest& request, bool isHandler) const
if (ret.first)
return ret;
- SPConfig& conf = SPConfig::getConfig();
- if (conf.isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively and directly process the message.
return doRequest(request);
}
diff --git a/shibsp/handler/impl/SAML2LogoutInitiator.cpp b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
index 016ad037..8cd0175e 100644
--- a/shibsp/handler/impl/SAML2LogoutInitiator.cpp
+++ b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
@@ -27,7 +27,6 @@
#include "internal.h"
#include "exceptions.h"
#include "Agent.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "handler/AbstractHandler.h"
#include "handler/LogoutInitiator.h"
@@ -35,6 +34,7 @@
#include <mutex>
using namespace shibsp;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -165,7 +165,7 @@ pair<bool,long> SAML2LogoutInitiator::run(SPRequest& request, bool isHandler) co
return make_pair(false, 0L);
}
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively.
return doRequest(request, session);
}
diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp
index 9bedb24f..5459501c 100644
--- a/shibsp/handler/impl/SAML2SessionInitiator.cpp
+++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp
@@ -26,7 +26,6 @@
#include "internal.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "handler/AbstractHandler.h"
#include "handler/RemotedHandler.h"
#include "handler/SessionInitiator.h"
@@ -37,6 +36,7 @@
using namespace shibsp;
using namespace xmltooling;
using namespace boost;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -203,7 +203,6 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
if (isHandler) {
prop.second = request.getParameter("acsIndex");
if (prop.second && *prop.second) {
- SPConfig::getConfig().deprecation().warn("Use of acsIndex when specifying response endpoint");
//ACS = app.getAssertionConsumerServiceByIndex(atoi(prop.second));
if (!ACS)
request.log(Priority::SHIB_WARN, "invalid acsIndex specified in request, using acsIndex property");
@@ -285,7 +284,6 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
// Try fixed index property.
pair<bool,unsigned int> index = getUnsignedInt("acsIndex", request, HANDLER_PROPERTY_MAP|HANDLER_PROPERTY_FIXED);
if (index.first) {
- SPConfig::getConfig().deprecation().warn("Use of acsIndex when specifying response endpoint");
//ACS = app.getAssertionConsumerServiceByIndex(index.second);
}
}
@@ -297,8 +295,7 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
// flip the index to an SSL-version.
string ACSloc = request.getHandlerURL(target.c_str());
- SPConfig& conf = SPConfig::getConfig();
- if (conf.isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
if (acsByIndex.first && acsByIndex.second) {
// Pass by Index.
if (isHandler) {
diff --git a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
index 2c2bf99f..28fd875f 100644
--- a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
+++ b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
@@ -31,6 +31,7 @@
using namespace shibsp;
using namespace boost;
+using namespace xercesc;
using namespace std;
namespace shibsp {
diff --git a/shibsp/handler/impl/SecuredHandler.cpp b/shibsp/handler/impl/SecuredHandler.cpp
index 82ca17ab..be44baec 100644
--- a/shibsp/handler/impl/SecuredHandler.cpp
+++ b/shibsp/handler/impl/SecuredHandler.cpp
@@ -36,6 +36,7 @@
using namespace shibsp;
using namespace boost;
+using namespace xercesc;
using namespace std;
namespace {
@@ -59,24 +60,22 @@ SecuredHandler::SecuredHandler(
const Remapper* remapper
) : AbstractHandler(e, log, filter ? filter : &g_Blocker, remapper)
{
- if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
- pair<bool,const char*> acl = getString(aclProperty);
- if (!acl.first && defaultACL) {
- m_log.info("installing default ACL (%s)", defaultACL);
- acl.first = true;
- acl.second = defaultACL;
- }
- if (acl.first) {
- string aclbuf(acl.second);
- trim(aclbuf);
- vector<string> aclarray;
- split(aclarray, aclbuf, is_space(), algorithm::token_compress_on);
- for_each(aclarray.begin(), aclarray.end(), boost::bind(&SecuredHandler::parseACL, this, _1));
- if (m_acl.empty()) {
- m_log.warn("invalid CIDR range(s) in handler's acl property, allowing 127.0.0.1 and ::1 as a fall back");
- m_acl.push_back(IPRange::parseCIDRBlock("127.0.0.1"));
- m_acl.push_back(IPRange::parseCIDRBlock("::1"));
- }
+ pair<bool,const char*> acl = getString(aclProperty);
+ if (!acl.first && defaultACL) {
+ m_log.info("installing default ACL (%s)", defaultACL);
+ acl.first = true;
+ acl.second = defaultACL;
+ }
+ if (acl.first) {
+ string aclbuf(acl.second);
+ trim(aclbuf);
+ vector<string> aclarray;
+ split(aclarray, aclbuf, is_space(), algorithm::token_compress_on);
+ for_each(aclarray.begin(), aclarray.end(), boost::bind(&SecuredHandler::parseACL, this, _1));
+ if (m_acl.empty()) {
+ m_log.warn("invalid CIDR range(s) in handler's acl property, allowing 127.0.0.1 and ::1 as a fall back");
+ m_acl.push_back(IPRange::parseCIDRBlock("127.0.0.1"));
+ m_acl.push_back(IPRange::parseCIDRBlock("::1"));
}
}
}
@@ -97,8 +96,7 @@ void SecuredHandler::parseACL(const string& acl)
pair<bool,long> SecuredHandler::run(SPRequest& request, bool isHandler) const
{
- SPConfig& conf = SPConfig::getConfig();
- if (conf.isEnabled(SPConfig::InProcess) && !m_acl.empty()) {
+ if (!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(Priority::SHIB_WARN, string("handler request blocked from invalid address (") + request.getRemoteAddr() + ')');
diff --git a/shibsp/handler/impl/SessionHandler.cpp b/shibsp/handler/impl/SessionHandler.cpp
index 41b92ef0..d1fb9c24 100644
--- a/shibsp/handler/impl/SessionHandler.cpp
+++ b/shibsp/handler/impl/SessionHandler.cpp
@@ -26,7 +26,6 @@
#include "internal.h"
#include "exceptions.h"
-#include "ServiceProvider.h"
#include "SessionCache.h"
#include "SPRequest.h"
#include "attribute/Attribute.h"
@@ -38,6 +37,7 @@
using namespace shibsp;
using namespace xmltooling;
+using namespace xercesc;
using namespace std;
namespace shibsp {
diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp
index 44dd7f02..1f7aef63 100644
--- a/shibsp/handler/impl/SessionInitiator.cpp
+++ b/shibsp/handler/impl/SessionInitiator.cpp
@@ -30,6 +30,7 @@
#include "handler/SessionInitiator.h"
using namespace shibsp;
+using namespace xercesc;
using namespace std;
SessionInitiator::SessionInitiator()
@@ -43,7 +44,6 @@ SessionInitiator::~SessionInitiator()
const char* SessionInitiator::remap(const char* src, Category& log) const
{
if (XMLString::equals(src, "defaultACSIndex")) {
- SPConfig::getConfig().deprecation().warn("old setting - remapping property (defaultACSIndex) to (acsIndex)");
return "acsIndex";
}
else {
diff --git a/shibsp/handler/impl/StatusHandler.cpp b/shibsp/handler/impl/StatusHandler.cpp
index 112e962b..8e6f82e0 100644
--- a/shibsp/handler/impl/StatusHandler.cpp
+++ b/shibsp/handler/impl/StatusHandler.cpp
@@ -27,7 +27,6 @@
#include "internal.h"
#include "exceptions.h"
#include "Agent.h"
-#include "ServiceProvider.h"
#include "SPRequest.h"
#include "handler/RemotedHandler.h"
#include "handler/SecuredHandler.h"
@@ -47,6 +46,7 @@
using namespace shibsp;
using namespace xmltooling;
+using namespace xercesc;
using namespace std;
namespace shibsp {
@@ -266,7 +266,7 @@ pair<bool,long> StatusHandler::run(SPRequest& request, bool isHandler) const
}
try {
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// When out of process, we run natively and directly process the message.
return processMessage(request);
}
diff --git a/shibsp/impl/ChainingAccessControl.cpp b/shibsp/impl/ChainingAccessControl.cpp
index 6404ce02..8932bbab 100644
--- a/shibsp/impl/ChainingAccessControl.cpp
+++ b/shibsp/impl/ChainingAccessControl.cpp
@@ -25,6 +25,7 @@
#include "AgentConfig.h"
#include "SessionCache.h"
#include "SPRequest.h"
+#include "logging/Category.h"
#include <algorithm>
#include <memory>
diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp
index 26618c0c..e839d7ea 100644
--- a/shibsp/impl/StorageServiceSessionCache.cpp
+++ b/shibsp/impl/StorageServiceSessionCache.cpp
@@ -40,6 +40,7 @@
#include "handler/RemotedHandler.h"
#include "impl/StoredSession.h"
#include "impl/StorageServiceSessionCache.h"
+#include "logging/Category.h"
#include "util/IPRange.h"
#include "util/SPConstants.h"
@@ -57,6 +58,7 @@
using namespace shibsp;
using namespace xmltooling;
using namespace boost;
+using namespace xercesc;
using namespace std;
SessionCache* SHIBSP_DLLLOCAL StorageServiceCacheFactory(const DOMElement* const & e, bool deprecationSupport)
@@ -66,7 +68,7 @@ SessionCache* SHIBSP_DLLLOCAL StorageServiceCacheFactory(const DOMElement* const
void SHIBSP_API shibsp::registerSessionCaches()
{
- SPConfig::getConfig().SessionCacheManager.registerFactory(STORAGESERVICE_SESSION_CACHE, StorageServiceCacheFactory);
+ //SPConfig::getConfig().SessionCacheManager.registerFactory(STORAGESERVICE_SESSION_CACHE, StorageServiceCacheFactory);
}
SessionCache::SessionCache()
@@ -85,8 +87,7 @@ SSCache::SSCache(const DOMElement* e, bool deprecationSupport)
m_root(e), m_inprocTimeout(900), m_cacheTimeout(0), m_cacheAllowance(0),
m_log(Category::getInstance(SHIBSP_LOGCAT ".SessionCache")), inproc(true), shutdown(false)
{
- SPConfig& conf = SPConfig::getConfig();
- inproc = conf.isEnabled(SPConfig::InProcess);
+ inproc = true;
static const XMLCh cacheAllowance[] = UNICODE_LITERAL_14(c,a,c,h,e,A,l,l,o,w,a,n,c,e);
static const XMLCh cacheAssertions[] = UNICODE_LITERAL_15(c,a,c,h,e,A,s,s,e,r,t,i,o,n,s);
@@ -104,7 +105,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)) {
- SPConfig::getConfig().deprecation().warn("cacheTimeout property 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);
@@ -843,7 +844,7 @@ Session* SSCache::_find(const char* bucketID, const char* key, const char* recov
}
if (!session) {
- if (!SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (true) {
m_log.debug("session not found locally, remoting the search");
// Remote the request.
DDF in("find::" STORAGESERVICE_SESSION_CACHE "::SessionCache"), out;
@@ -1052,7 +1053,7 @@ void SSCache::remove(const char* bucketID, const char* key, time_t revocationExp
if (inproc)
dormant(key);
- if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (false) {
// Remove the session from storage directly.
#ifndef SHIBSP_LITE
m_storage->deleteContext(key);
diff --git a/shibsp/impl/StorageServiceSessionCache.h b/shibsp/impl/StorageServiceSessionCache.h
index 4c7745db..60f6ed63 100644
--- a/shibsp/impl/StorageServiceSessionCache.h
+++ b/shibsp/impl/StorageServiceSessionCache.h
@@ -32,6 +32,7 @@
#include <ctime>
#include <boost/scoped_ptr.hpp>
+#include <xercesc/dom/DOM.hpp>
namespace xmltooling {
class CondWait;
@@ -41,8 +42,10 @@ namespace xmltooling {
namespace shibsp {
+ class Category;
class IPRange;
class StoredSession;
+
class SHIBSP_DLLLOCAL SSCache : public SessionCache
{
public:
diff --git a/shibsp/impl/StoredSession.cpp b/shibsp/impl/StoredSession.cpp
index ecb8f032..c8c50748 100644
--- a/shibsp/impl/StoredSession.cpp
+++ b/shibsp/impl/StoredSession.cpp
@@ -29,6 +29,7 @@
#include "attribute/Attribute.h"
#include "impl/StoredSession.h"
#include "impl/StorageServiceSessionCache.h"
+#include "logging/Category.h"
using namespace shibsp;
using namespace boost;
@@ -149,7 +150,7 @@ void StoredSession::validate(const char* bucketID, const char* client_addr, time
if (!timeout && !client_addr)
return;
- if (!SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+ if (true) {
DDF in("touch::" STORAGESERVICE_SESSION_CACHE "::SessionCache"), out;
DDFJanitor jin(in);
in.structure();
diff --git a/shibsp/impl/XMLAccessControl.cpp b/shibsp/impl/XMLAccessControl.cpp
index 74c057a5..284685b3 100644
--- a/shibsp/impl/XMLAccessControl.cpp
+++ b/shibsp/impl/XMLAccessControl.cpp
@@ -25,6 +25,7 @@
#include "SessionCache.h"
#include "SPRequest.h"
#include "attribute/Attribute.h"
+#include "logging/Category.h"
#include "util/Lockable.h"
#include "util/Misc.h"
#include "util/ReloadableXMLFile.h"
diff --git a/shibsp/internal.h b/shibsp/internal.h
index 1479f372..f2222080 100644
--- a/shibsp/internal.h
+++ b/shibsp/internal.h
@@ -51,11 +51,7 @@
#endif
#include "base.h"
-#include "SPConfig.h"
-#include "logging/Category.h"
#include <memory>
-using namespace xercesc;
-
#endif /* __shibsp_internal_h__ */
diff --git a/shibsp/logging/impl/ConsoleLoggingService.cpp b/shibsp/logging/impl/ConsoleLoggingService.cpp
index 1968e9a2..aa936300 100644
--- a/shibsp/logging/impl/ConsoleLoggingService.cpp
+++ b/shibsp/logging/impl/ConsoleLoggingService.cpp
@@ -23,6 +23,7 @@
#include "util/Date.h"
#include <chrono>
+#include <iostream>
#include <boost/property_tree/ptree.hpp>
using namespace shibsp;
diff --git a/shibsp/util/DOMPropertySet.cpp b/shibsp/util/DOMPropertySet.cpp
index 0c2d01ea..e5c330ed 100644
--- a/shibsp/util/DOMPropertySet.cpp
+++ b/shibsp/util/DOMPropertySet.cpp
@@ -25,12 +25,16 @@
*/
#include "internal.h"
+
+#include "AgentConfig.h"
+#include "logging/Category.h"
#include "util/DOMPropertySet.h"
#include "util/SPConstants.h"
#include <algorithm>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
+#include <xmltooling/QName.h>
#include <xmltooling/util/XMLConstants.h>
#include <xmltooling/util/XMLHelper.h>
@@ -60,7 +64,7 @@ const char* DOMPropertySet::STLRemapper::remap(const char* src, Category& log) c
{
map<string,string>::const_iterator i = src ? m_rules.find(src) : m_rules.end();
if (i != m_rules.end()) {
- SPConfig::getConfig().deprecation().warn("legacy configuration, remapping property/set (%s) to (%s)", src, i->second.c_str());
+ AgentConfig::getConfig().deprecation().warn("legacy configuration, remapping property/set (%s) to (%s)", src, i->second.c_str());
return i->second.c_str();
}
else {
diff --git a/shibsp/util/DOMPropertySet.h b/shibsp/util/DOMPropertySet.h
index 62cca06f..62ab9d60 100644
--- a/shibsp/util/DOMPropertySet.h
+++ b/shibsp/util/DOMPropertySet.h
@@ -28,9 +28,11 @@
#define __shibsp_dompropset_h__
#include <shibsp/util/PropertySet.h>
+#include <xmltooling/unicode.h>
#include <set>
#include <boost/shared_ptr.hpp>
+#include <xercesc/dom/DOM.hpp>
#if defined (_MSC_VER)
# pragma warning( push )
@@ -43,6 +45,8 @@ namespace xmltooling {
namespace shibsp {
+ class SHIBSP_API Category;
+
/**
* DOM-based property set implementation.
*/
diff --git a/shibsp/util/IPRange.cpp b/shibsp/util/IPRange.cpp
index 532cf9e9..2cf829cb 100644
--- a/shibsp/util/IPRange.cpp
+++ b/shibsp/util/IPRange.cpp
@@ -19,13 +19,14 @@
*/
/**
- * @file IPRange.cpp
+ * util/IPRange.cpp
*
* Represents a range of IP addresses.
*/
#include "internal.h"
#include "exceptions.h"
+#include "logging/Category.h"
#include "util/IPRange.h"
#ifdef WIN32
diff --git a/shibsp/util/SPConstants.cpp b/shibsp/util/SPConstants.cpp
index a6c2ed7e..ce21cc79 100644
--- a/shibsp/util/SPConstants.cpp
+++ b/shibsp/util/SPConstants.cpp
@@ -29,6 +29,7 @@
#include <xercesc/util/XMLUniDefs.hpp>
using namespace shibspconstants;
+using namespace xercesc;
const XMLCh shibspconstants::SHIB1_PROTOCOL_ENUM[] = // urn:mace:shibboleth:1.0
{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_m, chLatin_a, chLatin_c, chLatin_e, chColon,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list