/shibboleth.spec
/.settings
/*.suo
+/Debug
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isapi_shib", "isapi_shib\isapi_shib.vcproj", "{87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}"
ProjectSection(ProjectDependencies) = postProject
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
{84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib13", "apache\mod_shib13.vcproj", "{D243B43E-728E-4F32-BDFF-B3A897037C6D}"
ProjectSection(ProjectDependencies) = postProject
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
{84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib20", "apache\mod_shib20.vcproj", "{68E9568B-476C-4289-B93C-893432378ADC}"
ProjectSection(ProjectDependencies) = postProject
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
{84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsapi_shib", "nsapi_shib\nsapi_shib.vcproj", "{1396D80A-8672-4224-9B02-95F3F4207CDB}"
ProjectSection(ProjectDependencies) = postProject
- {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+ {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "posttest", "posttest\posttest.vcproj", "{16E70C47-789E-43D5-AFDF-964D386C3CB5}"
ProjectSection(ProjectDependencies) = postProject
- {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+ {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shar", "shar\shar.vcproj", "{F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}"
ProjectSection(ProjectDependencies) = postProject
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
{84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
EndProjectSection
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibtarget", "shib-target\shibtarget.vcproj", "{84890110-2190-4AAE-9BDC-58F90DF71E4F}"
ProjectSection(ProjectDependencies) = postProject
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibtest", "shibtest\shibtest.vcproj", "{67AF22A3-C26E-40BE-B0CA-2ABEE5123763}"
ProjectSection(ProjectDependencies) = postProject
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
{84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testclient", "shar\testclient.vcproj", "{B3F1E899-86F9-4D3A-8026-B57D1A5B90B1}"
ProjectSection(ProjectDependencies) = postProject
- {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+ {84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlproviders", "xmlproviders\xmlproviders.vcproj", "{68E46D06-6B91-4C59-A700-78DD4D4C420B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shib22", "apache\mod_shib22.vcproj", "{B44C0852-83B8-4FB2-A86E-097C9C8256D0}"
ProjectSection(ProjectDependencies) = postProject
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
{84890110-2190-4AAE-9BDC-58F90DF71E4F} = {84890110-2190-4AAE-9BDC-58F90DF71E4F}
{E6CAB6C8-1D73-4410-970A-52BF9EC57810} = {E6CAB6C8-1D73-4410-970A-52BF9EC57810}
EndProjectSection
#include <saml/saml.h>
#include <shib/shib.h>
#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
#include <xercesc/util/regx/RegularExpression.hpp>
#ifdef WIN32
#include <unistd.h> // for getpid()
#endif
+using namespace shibsp;
using namespace shibtarget;
using namespace saml;
using namespace xmltooling;
try {
g_Config=&ShibTargetConfig::getConfig();
- g_Config->setFeatures(
- ShibTargetConfig::Caching |
- ShibTargetConfig::Listener |
- ShibTargetConfig::Metadata |
- ShibTargetConfig::AAP |
- ShibTargetConfig::RequestMapper |
- ShibTargetConfig::InProcess |
- ShibTargetConfig::Logging
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Caching |
+ SPConfig::Listener |
+ SPConfig::Metadata |
+ SPConfig::AAP |
+ SPConfig::RequestMapper |
+ SPConfig::InProcess |
+ SPConfig::Logging
);
if (!g_Config->init(g_szSchemaDir)) {
ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() failed to initialize libraries");
</References>
<Files>
<File
- RelativePath="mod_apache.cpp"
- >
- </File>
- <File
RelativePath="mod_shib_13.cpp"
>
</File>
#include <saml/saml.h>
#include <shib/shib.h>
#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
#include <ctime>
#include <fstream>
#include <httpfilt.h>
#include <httpext.h>
+using namespace shibsp;
using namespace shibtarget;
using namespace saml;
using namespace xmltooling;
if (!config)
config=SHIB_CONFIG;
g_Config=&ShibTargetConfig::getConfig();
- g_Config->setFeatures(
- ShibTargetConfig::Listener |
- ShibTargetConfig::Caching |
- ShibTargetConfig::Metadata |
- ShibTargetConfig::AAP |
- ShibTargetConfig::RequestMapper |
- ShibTargetConfig::InProcess |
- ShibTargetConfig::Logging
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Listener |
+ SPConfig::Caching |
+ SPConfig::Metadata |
+ SPConfig::AAP |
+ SPConfig::RequestMapper |
+ SPConfig::InProcess |
+ SPConfig::Logging
);
if (!g_Config->init(schemadir)) {
g_Config=NULL;
#include <saml/saml.h>
#include <shib/shib.h>
#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
#include <ctime>
#include <fstream>
#include <nsapi.h>
}
+using namespace shibsp;
using namespace shibtarget;
using namespace saml;
using namespace xmltooling;
if (!config)
config=SHIB_CONFIG;
g_Config=&ShibTargetConfig::getConfig();
- g_Config->setFeatures(
- ShibTargetConfig::Listener |
- ShibTargetConfig::Caching |
- ShibTargetConfig::Metadata |
- ShibTargetConfig::AAP |
- ShibTargetConfig::RequestMapper |
- ShibTargetConfig::InProcess |
- ShibTargetConfig::Logging
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Listener |
+ SPConfig::Caching |
+ SPConfig::Metadata |
+ SPConfig::AAP |
+ SPConfig::RequestMapper |
+ SPConfig::InProcess |
+ SPConfig::Logging
);
if (!g_Config->init(schemadir)) {
g_Config=NULL;
#endif
#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#include <signal.h>
#include <log4cpp/Category.hh>
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
using namespace log4cpp;
+using namespace std;
bool shibd_shutdown = false;
const char* shar_config = NULL;
if (preinit) {
// initialize the shib-target library
- conf.setFeatures(
- ShibTargetConfig::Listener |
- ShibTargetConfig::Caching |
- ShibTargetConfig::Metadata |
- ShibTargetConfig::Trust |
- ShibTargetConfig::Credentials |
- ShibTargetConfig::AAP |
- ShibTargetConfig::OutOfProcess |
- (shar_checkonly ? (ShibTargetConfig::InProcess | ShibTargetConfig::RequestMapper) : ShibTargetConfig::Logging)
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Listener |
+ SPConfig::Caching |
+ SPConfig::Metadata |
+ SPConfig::Trust |
+ SPConfig::Credentials |
+ SPConfig::AAP |
+ SPConfig::OutOfProcess |
+ (shar_checkonly ? (SPConfig::InProcess | SPConfig::RequestMapper) : SPConfig::Logging)
);
if (!shar_config)
shar_config=getenv("SHIBCONFIG");
// initialize the shib-target library
ShibTargetConfig& conf=ShibTargetConfig::getConfig();
- conf.setFeatures(
- ShibTargetConfig::Listener |
- ShibTargetConfig::Caching |
- ShibTargetConfig::Metadata |
- ShibTargetConfig::Trust |
- ShibTargetConfig::Credentials |
- ShibTargetConfig::AAP |
- ShibTargetConfig::OutOfProcess |
- (shar_checkonly ? (ShibTargetConfig::InProcess | ShibTargetConfig::RequestMapper) : ShibTargetConfig::Logging)
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Listener |
+ SPConfig::Caching |
+ SPConfig::Metadata |
+ SPConfig::Trust |
+ SPConfig::Credentials |
+ SPConfig::AAP |
+ SPConfig::OutOfProcess |
+ (shar_checkonly ? (SPConfig::InProcess | SPConfig::RequestMapper) : SPConfig::Logging)
);
if (!conf.init(shar_schemadir) || !conf.load(shar_config)) {
fprintf(stderr, "configuration is invalid, check console for specific problems\n");
#endif
#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
#include <iostream>
-using namespace std;
-using namespace saml;
+using namespace shibsp;
using namespace shibtarget;
+using namespace saml;
+using namespace std;
int main (int argc, char *argv[])
{
schemadir=SHIB_SCHEMAS;
ShibTargetConfig& conf=ShibTargetConfig::getConfig();
- conf.setFeatures(ShibTargetConfig::Listener | ShibTargetConfig::InProcess);
+ SPConfig::getConfig().setFeatures(SPConfig::Listener | SPConfig::InProcess);
if (!conf.init(schemadir) || !conf.load(config))
return -10;
#include <errno.h>
#include <sstream>
+#include <shibsp/SPConfig.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
+using namespace shibsp;
using namespace shibtarget;
using namespace saml;
using namespace xmltooling;
m_shutdown(NULL), m_child_lock(NULL), m_child_wait(NULL), m_socketpool(NULL), m_socket((ShibSocket)0)
{
// Are we a client?
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+ if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
m_socketpool=new SocketPool(*log,this);
}
// Are we a server?
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+ if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
m_child_lock = Mutex::create();
m_child_wait = CondWait::create();
}
Override::~Override()
{
delete m_acl;
- for_each(m_map.begin(),m_map.end(),cleanup_pair<string,Override>());
+ for_each(m_map.begin(),m_map.end(),xmltooling::cleanup_pair<string,Override>());
}
pair<bool,bool> Override::getBool(const char* name, const char* ns) const
#define SHIBT_LOGCAT "shibtarget"
#define SHIBTRAN_LOGCAT "Shibboleth-TRANSACTION"
-// Controls default logging level of console tools and other situations
-// where full shibboleth.xml-based logging isn't used.
-#define SHIB_LOGGING "WARN"
-
namespace shibtarget {
// Generic class, which handles the IPropertySet configuration interface.
// Most of the basic configuration details are exposed via this interface.
#endif
#include <log4cpp/Category.hh>
+#include <shibsp/SPConfig.h>
#include <ctime>
#include <algorithm>
#include <dmalloc.h>
#endif
+using namespace shibsp;
using namespace shibtarget;
using namespace shibboleth;
using namespace saml;
// Save actual objects only if we're running inprocess. The subject needs to be
// owned by the entry, so we'll defer creation of a cloned copy.
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+ if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
if (m_obj["tokens.filtered"].isstring())
m_pFiltered=filtered.release();
}
m_obj.addmember("tokens.filtered").string(fstr.c_str());
// Save actual objects only if we're running inprocess.
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+ if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
m_pUnfiltered=unfiltered.release();
if (m_obj["tokens.filtered"].isstring())
m_pFiltered=filtered.release();
m_obj.addmember("tokens.filtered").string(fstr.c_str());
// Save actual objects only if we're running inprocess.
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+ if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
m_pUnfiltered=respFromSink.release();
if (m_obj["tokens.filtered"].isstring())
m_pFiltered=filteredFromSink.release();
m_responseExpiration=calculateExpiration(*new_responses.second);
// Save actual objects only if we're running inprocess.
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::InProcess)) {
+ if (SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
m_pUnfiltered=r1.release();
if (m_obj["tokens.filtered"].isstring())
m_pFiltered=r2.release();
// Register for remoted messages.
IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
- if (listener && ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+ if (listener && SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
restoreInsert=listener->regListener("SessionCache::insert",this);
restoreFind=listener->regListener("SessionCache::find",this);
restoreRemove=listener->regListener("SessionCache::remove",this);
// Unregister remoted messages.
IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
- if (listener && ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+ if (listener && SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
listener->unregListener("SessionCache::insert",this,restoreInsert);
listener->unregListener("SessionCache::find",this,restoreFind);
listener->unregListener("SessionCache::remove",this,restoreRemove);
}
- for_each(m_hashtable.begin(),m_hashtable.end(),shibtarget::cleanup_pair<string,MemorySessionCacheEntry>());
+ for_each(m_hashtable.begin(),m_hashtable.end(),xmltooling::cleanup_pair<string,MemorySessionCacheEntry>());
delete m_lock;
delete shutdown_wait;
}
IPlugIn* MemoryCacheFactory(const DOMElement* e)
{
// If this is a long-lived process, we return the "real" cache.
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess))
+ if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess))
return new MemorySessionCache(e);
// Otherwise, we return a stubbed front-end that remotes calls to the real cache.
return new StubCache(e);
*/
#include "internal.h"
-#include <saml/SAMLConfig.h>
#include <saml/util/SAMLConstants.h>
+#include <shibsp/SPConfig.h>
#include <xmltooling/XMLToolingConfig.h>
#include <xmltooling/util/NDC.h>
-#include <xmltooling/util/TemplateEngine.h>
#include <log4cpp/OstreamAppender.hh>
+using namespace shibsp;
using namespace shibtarget;
using namespace shibboleth;
using namespace saml;
using namespace log4cpp;
using namespace std;
-using xmltooling::TemplateEngine;
using xmltooling::XMLToolingConfig;
namespace {
bool STConfig::init(const char* schemadir)
{
- // Chain this to XMLTooling for now...
- const char* loglevel=getenv("SHIB_LOGGING");
- if (!loglevel)
- loglevel = SHIB_LOGGING;
- XMLToolingConfig::getConfig().log_config(loglevel);
-
#ifdef _DEBUG
xmltooling::NDC ndc("init");
#endif
SAMLConfig& samlConf=SAMLConfig::getConfig();
if (schemadir)
samlConf.schema_dir = schemadir;
- try {
- if (!samlConf.init() || !opensaml::SAMLConfig::getConfig().init()) {
- log.fatal("Failed to initialize SAML Library");
- return false;
- }
- }
- catch (...) {
- log.fatal("Died initializing SAML Library");
+ if (!samlConf.init() || !SPConfig::getConfig().init(NULL)) {
+ log.fatal("failed to initialize SP library");
return false;
}
- XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
- XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp");
-
ShibConfig& shibConf=ShibConfig::getConfig();
- try {
- if (!shibConf.init()) {
- log.fatal("Failed to initialize Shib library");
- samlConf.term();
- return false;
- }
- }
- catch (...) {
- log.fatal("Died initializing Shib library.");
+ if (!shibConf.init()) {
+ log.fatal("Failed to initialize Shib library");
samlConf.term();
return false;
}
pair<bool,unsigned int> skew=m_ini->getUnsignedInt("clockSkew");
SAMLConfig::getConfig().clock_skew_secs=skew.first ? skew.second : 180;
if (skew.first)
- xmltooling::XMLToolingConfig::getConfig().clock_skew_secs=skew.second;
+ XMLToolingConfig::getConfig().clock_skew_secs=skew.second;
m_tranLog=new FixedContextCategory(SHIBTRAN_LOGCAT);
m_tranLog->info("opened transaction log");
delete m_ini;
m_ini = NULL;
ShibConfig::getConfig().term();
- opensaml::SAMLConfig::getConfig().term();
SAMLConfig::getConfig().term();
+ SPConfig::getConfig().term();
log.info("library shutdown complete");
}
*/
#include "internal.h"
+
#include <ctime>
#include <saml/util/CommonDomainCookie.h>
+#include <shibsp/SPConfig.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
using namespace log4cpp;
+using namespace std;
using opensaml::CommonDomainCookie;
m_address += "::SAML1Consumer::run";
// Register for remoted messages.
- if (ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess)) {
+ if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
if (listener)
listener->regListener(m_address.c_str(),this);
SAML1Consumer::~SAML1Consumer()
{
IListener* listener=ShibTargetConfig::getConfig().getINI()->getListener();
- if (listener && ShibTargetConfig::getConfig().isEnabled(ShibTargetConfig::OutOfProcess))
+ if (listener && SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess))
listener->unregListener(m_address.c_str(),this);
counter--;
}
#include "internal.h"
+#include <shibsp/SPConfig.h>
#include <log4cpp/Category.hh>
#include <log4cpp/PropertyConfigurator.hh>
#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
using namespace log4cpp;
+using namespace std;
namespace shibtarget {
{
for (map<string,pair<char*,const XMLCh*> >::iterator i=m_map.begin(); i!=m_map.end(); i++)
XMLString::release(&(i->second.first));
- for_each(m_nested.begin(),m_nested.end(),shibtarget::cleanup_pair<string,IPropertySet>());
+ for_each(m_nested.begin(),m_nested.end(),xmltooling::cleanup_pair<string,IPropertySet>());
}
void XMLPropertySet::load(
m_hash+=getString("providerId").second;
m_hash=SAMLArtifact::toHex(SAMLArtifactType0001::generateSourceId(m_hash.c_str()));
- ShibTargetConfig& conf=ShibTargetConfig::getConfig();
+ SPConfig& conf=SPConfig::getConfig();
SAMLConfig& shibConf=SAMLConfig::getConfig();
// Process handlers.
// Always include our own providerId as an audience.
m_audiences.push_back(getXMLString("providerId").second);
- if (conf.isEnabled(ShibTargetConfig::AAP)) {
+ if (conf.isEnabled(SPConfig::AAP)) {
nlist=e->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(AAPProvider));
for (i=0; nlist && i<nlist->getLength(); i++) {
if (nlist->item(i)->getParentNode()->isSameNode(e)) {
}
}
- if (conf.isEnabled(ShibTargetConfig::Metadata)) {
+ if (conf.isEnabled(SPConfig::Metadata)) {
nlist=e->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MetadataProvider));
for (i=0; nlist && i<nlist->getLength(); i++) {
if (nlist->item(i)->getParentNode()->isSameNode(e)) {
}
}
- if (conf.isEnabled(ShibTargetConfig::Trust)) {
+ if (conf.isEnabled(SPConfig::Trust)) {
nlist=e->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(TrustProvider));
for (i=0; nlist && i<nlist->getLength(); i++) {
if (nlist->item(i)->getParentNode()->isSameNode(e)) {
}
}
- if (conf.isEnabled(ShibTargetConfig::OutOfProcess)) {
+ if (conf.isEnabled(SPConfig::OutOfProcess)) {
// Really finally, build local browser profile and binding objects.
m_profile=new ShibBrowserProfile(
this,
delete m_bindingHook;
delete m_binding;
delete m_profile;
- for_each(m_handlers.begin(),m_handlers.end(),shibtarget::cleanup<IHandler>());
+ for_each(m_handlers.begin(),m_handlers.end(),xmltooling::cleanup<IHandler>());
delete m_credDefault;
#ifdef HAVE_GOOD_STL
- for_each(m_credMap.begin(),m_credMap.end(),shibtarget::cleanup_pair<xstring,XMLPropertySet>());
+ for_each(m_credMap.begin(),m_credMap.end(),xmltooling::cleanup_pair<xstring,XMLPropertySet>());
#else
- for_each(m_credMap.begin(),m_credMap.end(),shibtarget::cleanup_pair<const XMLCh*,XMLPropertySet>());
+ for_each(m_credMap.begin(),m_credMap.end(),xmltooling::cleanup_pair<const XMLCh*,XMLPropertySet>());
#endif
- for_each(m_designators.begin(),m_designators.end(),shibtarget::cleanup<SAMLAttributeDesignator>());
- for_each(m_aaps.begin(),m_aaps.end(),shibtarget::cleanup<IAAP>());
- for_each(m_metadatas.begin(),m_metadatas.end(),shibtarget::cleanup<IMetadata>());
- for_each(m_trusts.begin(),m_trusts.end(),shibtarget::cleanup<ITrust>());
+ for_each(m_designators.begin(),m_designators.end(),xmltooling::cleanup<SAMLAttributeDesignator>());
+ for_each(m_aaps.begin(),m_aaps.end(),xmltooling::cleanup<IAAP>());
+ for_each(m_metadatas.begin(),m_metadatas.end(),xmltooling::cleanup<IMetadata>());
+ for_each(m_trusts.begin(),m_trusts.end(),xmltooling::cleanup<ITrust>());
}
short XMLApplication::acceptNode(const DOMNode* node) const
}
SAMLConfig& shibConf=SAMLConfig::getConfig();
- ShibTargetConfig& conf=ShibTargetConfig::getConfig();
+ SPConfig& conf=SPConfig::getConfig();
const DOMElement* SHAR=saml::XML::getFirstChildElement(ReloadableXMLFileImpl::m_root,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(SHAR));
if (!SHAR)
SHAR=saml::XML::getFirstChildElement(ReloadableXMLFileImpl::m_root,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Global));
SHIRE=saml::XML::getFirstChildElement(ReloadableXMLFileImpl::m_root,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(InProcess));
// Initialize log4cpp manually in order to redirect log messages as soon as possible.
- if (conf.isEnabled(ShibTargetConfig::Logging)) {
+ if (conf.isEnabled(SPConfig::Logging)) {
const XMLCh* logger=NULL;
- if (conf.isEnabled(ShibTargetConfig::OutOfProcess))
+ if (conf.isEnabled(SPConfig::OutOfProcess))
logger=SHAR->getAttributeNS(NULL,SHIBT_L(logger));
- else if (conf.isEnabled(ShibTargetConfig::InProcess))
+ else if (conf.isEnabled(SPConfig::InProcess))
logger=SHIRE->getAttributeNS(NULL,SHIBT_L(logger));
if (!logger || !*logger)
logger=ReloadableXMLFileImpl::m_root->getAttributeNS(NULL,SHIBT_L(logger));
}
}
- if (conf.isEnabled(ShibTargetConfig::OutOfProcess)) {
+ if (conf.isEnabled(SPConfig::OutOfProcess)) {
exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Extensions));
if (exts) {
exts=saml::XML::getFirstChildElement(exts,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Library));
}
}
- if (conf.isEnabled(ShibTargetConfig::InProcess)) {
+ if (conf.isEnabled(SPConfig::InProcess)) {
exts=saml::XML::getFirstChildElement(SHIRE,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Extensions));
if (exts) {
exts=saml::XML::getFirstChildElement(exts,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(Library));
}
// Instantiate the Listener and SessionCache objects.
- if (conf.isEnabled(ShibTargetConfig::Listener)) {
+ if (conf.isEnabled(SPConfig::Listener)) {
IPlugIn* plugin=NULL;
exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(UnixListener));
if (exts) {
}
}
- if (conf.isEnabled(ShibTargetConfig::Caching)) {
+ if (conf.isEnabled(SPConfig::Caching)) {
IPlugIn* plugin=NULL;
- const DOMElement* container=conf.isEnabled(ShibTargetConfig::OutOfProcess) ? SHAR : SHIRE;
+ const DOMElement* container=conf.isEnabled(SPConfig::OutOfProcess) ? SHAR : SHIRE;
exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MemorySessionCache));
if (exts) {
log.info("building Session Cache of type %s...",shibtarget::XML::MemorySessionCacheType);
}
// Replay cache.
- container=conf.isEnabled(ShibTargetConfig::OutOfProcess) ? SHAR : SHIRE;
+ container=conf.isEnabled(SPConfig::OutOfProcess) ? SHAR : SHIRE;
exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(ODBCReplayCache));
if (exts) {
log.info("building Replay Cache of type %s...",shibtarget::XML::ODBCReplayCacheType);
}
// Back to the fully dynamic stuff...next up is the Request Mapper.
- if (conf.isEnabled(ShibTargetConfig::RequestMapper)) {
+ if (conf.isEnabled(SPConfig::RequestMapper)) {
const DOMElement* child=saml::XML::getFirstChildElement(SHIRE,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(RequestMapProvider));
if (child) {
auto_ptr_char type(child->getAttributeNS(NULL,SHIBT_L(type)));
// Now we load any credentials providers.
DOMNodeList* nlist;
- if (conf.isEnabled(ShibTargetConfig::Credentials)) {
+ if (conf.isEnabled(SPConfig::Credentials)) {
nlist=ReloadableXMLFileImpl::m_root->getElementsByTagNameNS(shibtarget::XML::SHIBTARGET_NS,SHIBT_L(CredentialsProvider));
for (unsigned int i=0; nlist && i<nlist->getLength(); i++) {
auto_ptr_char type(static_cast<DOMElement*>(nlist->item(i))->getAttributeNS(NULL,SHIBT_L(type)));
XMLConfigImpl::~XMLConfigImpl()
{
delete m_requestMapper;
- for_each(m_appmap.begin(),m_appmap.end(),cleanup_pair<string,IApplication>());
- for_each(m_creds.begin(),m_creds.end(),cleanup<ICredentials>());
+ for_each(m_appmap.begin(),m_appmap.end(),xmltooling::cleanup_pair<string,IApplication>());
+ for_each(m_creds.begin(),m_creds.end(),xmltooling::cleanup<ICredentials>());
ShibConfig::getConfig().clearAttributeMappings();
- for_each(m_attrFactories.begin(),m_attrFactories.end(),cleanup<IAttributeFactory>());
+ for_each(m_attrFactories.begin(),m_attrFactories.end(),xmltooling::cleanup<IAttributeFactory>());
}
class SHIBTARGET_EXPORTS ShibTargetConfig
{
public:
- ShibTargetConfig() : m_ini(NULL), m_features(0) {}
+ ShibTargetConfig() : m_ini(NULL) {}
virtual ~ShibTargetConfig() {}
virtual bool init(const char* schemadir) = 0;
virtual bool load(const char* config) = 0;
virtual void shutdown() = 0;
- enum components_t {
- Listener = 1,
- Caching = 2,
- Metadata = 4,
- Trust = 8,
- Credentials = 16,
- AAP = 32,
- RequestMapper = 64,
- OutOfProcess = 128,
- InProcess = 256,
- Logging = 512
- };
- void setFeatures(long enabled) {m_features = enabled;}
- bool isEnabled(components_t feature) {return (m_features & feature)>0;}
virtual IConfig* getINI() const {return m_ini;}
static ShibTargetConfig& getConfig();
protected:
IConfig* m_ini;
-
- private:
- unsigned long m_features;
};
class ShibTargetPriv;
static const XMLCh UnixListener[];
};
};
-
-
- // Template cleanup functors for use with for_each algorithm
- template<class T> struct cleanup
- {
- void operator()(T* ptr) {delete ptr;}
- void operator()(const T* ptr) {delete const_cast<T*>(ptr);}
- };
-
- template<class A,class B> struct cleanup_pair
- {
- void operator()(std::pair<A,B*> p) {delete p.second;}
- };
}
#endif /* SHIB_TARGET_H */
--- /dev/null
+AUTOMAKE_OPTIONS = foreign
+
+pkgsysconfdir = $(sysconfdir)/@PACKAGE@
+xmldir = $(datadir)/xml
+
+lib_LTLIBRARIES = libshibsp.la
+
+libshibspincludedir = $(includedir)/shibsp
+
+libshibspinclude_HEADERS = \
+ base.h \
+ exceptions.h \
+ paths.h \
+ version.h \
+ SPConfig.h
+
+noinst_HEADERS = \
+ internal.h
+
+libshibsp_la_SOURCES = \
+ SPConfig.cpp
+
+# this is different from the project version
+# http://sources.redhat.com/autobook/autobook/autobook_91.html
+libshibsp_la_LDFLAGS = -version-info 1:0:0
+
+paths.h: ${srcdir}/paths.h.in Makefile ${top_builddir}/config.status
+ rm -f $@.tmp
+ sed < ${srcdir}/$@.in > $@.tmp \
+ -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:' \
+ -e 's:@-XMLDIR-@:${xmldir}:'
+ cmp -s $@ $@.tmp || mv $@.tmp $@
+ rm -f $@.tmp
+
+install-exec-hook:
+ for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done
+
+EXTRA_DIST = shibsp.vcproj paths.h.in
+BUILT_SOURCES = paths.h
--- /dev/null
+
+/*
+ * Copyright 2001-2006 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SPConfig.cpp
+ *
+ * Library configuration
+ */
+
+#include "internal.h"
+#include "exceptions.h"
+#include "SPConfig.h"
+
+#include <log4cpp/Category.hh>
+#include <saml/SAMLConfig.h>
+#include <xmltooling/util/NDC.h>
+#include <xmltooling/util/TemplateEngine.h>
+
+using namespace shibsp;
+using namespace opensaml;
+using namespace xmltooling;
+using namespace log4cpp;
+
+DECL_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
+
+namespace shibsp {
+ SPInternalConfig g_config;
+}
+
+SPConfig& SPConfig::getConfig()
+{
+ return g_config;
+}
+
+SPInternalConfig& SPInternalConfig::getInternalConfig()
+{
+ return g_config;
+}
+
+void SPConfig::setServiceProvider(ServiceProvider* serviceProvider)
+{
+ //delete m_serviceProvider;
+ m_serviceProvider = serviceProvider;
+}
+
+bool SPInternalConfig::init(const char* catalog_path)
+{
+#ifdef _DEBUG
+ NDC ndc("init");
+#endif
+ Category& log=Category::getInstance(SHIBSP_LOGCAT".Config");
+ log.debug("library initialization started");
+
+ const char* loglevel=getenv("SHIBSP_LOGGING");
+ if (!loglevel)
+ loglevel = SHIBSP_LOGGING;
+ XMLToolingConfig::getConfig().log_config(loglevel);
+
+ if (catalog_path)
+ XMLToolingConfig::getConfig().catalog_path = catalog_path;
+
+ if (!SAMLConfig::getConfig().init()) {
+ log.fatal("failed to initialize OpenSAML library");
+ return false;
+ }
+
+ XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
+ XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp");
+
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp);
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
+
+ log.info("library initialization complete");
+ return true;
+}
+
+void SPInternalConfig::term()
+{
+#ifdef _DEBUG
+ NDC ndc("term");
+#endif
+ Category& log=Category::getInstance(SHIBSP_LOGCAT".Config");
+ log.info("shutting down the library");
+
+ //delete m_serviceProvider;
+ m_serviceProvider = NULL;
+
+ SAMLConfig::getConfig().term();
+ log.info("library shutdown complete");
+}
--- /dev/null
+/*
+ * Copyright 2001-2006 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file shibsp/SPConfig.h
+ *
+ * Library configuration
+ */
+
+#ifndef __shibsp_config_h__
+#define __shibsp_config_h__
+
+#include <shibsp/base.h>
+
+/**
+ * @namespace shibsp
+ * Shibboleth Service Provider Library
+ */
+namespace shibsp {
+
+ class SHIBSP_API ServiceProvider;
+
+ /**
+ * Singleton object that manages library startup/shutdown.
+ */
+ class SHIBSP_API SPConfig
+ {
+ MAKE_NONCOPYABLE(SPConfig);
+ public:
+ virtual ~SPConfig() {}
+
+ /**
+ * Returns the global configuration object for the library.
+ *
+ * @return reference to the global library configuration object
+ */
+ static SPConfig& getConfig();
+
+ /**
+ * Bitmask values representing subsystems of the library.
+ */
+ enum components_t {
+ Listener = 1,
+ Caching = 2,
+ Metadata = 4,
+ Trust = 8,
+ Credentials = 16,
+ AAP = 32,
+ RequestMapper = 64,
+ OutOfProcess = 128,
+ InProcess = 256,
+ Logging = 512
+ };
+
+ /**
+ * Set a bitmask of subsystems to activate.
+ *
+ * @param enabled bitmask of component constants
+ */
+ void setFeatures(unsigned long enabled) {
+ m_features = enabled;
+ }
+
+ /**
+ * Test whether a subsystem is enabled.
+ *
+ * @param feature subsystem/component to test
+ * @return true iff feature is enabled
+ */
+ bool isEnabled(components_t feature) {
+ return (m_features & feature)>0;
+ }
+
+ /**
+ * Initializes library
+ *
+ * Each process using the library MUST call this function exactly once
+ * before using any library classes.
+ *
+ * @param catalog_path delimited set of schema catalog files to load
+ * @return true iff initialization was successful
+ */
+ virtual bool init(const char* catalog_path)=0;
+
+ /**
+ * Shuts down library
+ *
+ * Each process using the library SHOULD call this function exactly once
+ * before terminating itself.
+ */
+ virtual void term()=0;
+
+ /**
+ * Sets the global ServiceProvider instance.
+ * This method must be externally synchronized with any code that uses the object.
+ * Any previously set object is destroyed.
+ *
+ * @param serviceProvider new ServiceProvider instance to store
+ */
+ void setServiceProvider(ServiceProvider* serviceProvider);
+
+ /**
+ * Returns the global ServiceProvider instance.
+ *
+ * @return global ServiceProvider or NULL
+ */
+ ServiceProvider* getServiceProvider() const {
+ return m_serviceProvider;
+ }
+
+ protected:
+ SPConfig() : m_serviceProvider(NULL) {}
+
+ /** Global ServiceProvider instance. */
+ ServiceProvider* m_serviceProvider;
+
+ private:
+ unsigned long m_features;
+ };
+
+};
+
+#endif /* __shibsp_config_h__ */
--- /dev/null
+/*
+ * Copyright 2001-2006 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file shibsp/base.h
+ *
+ * Base header file definitions
+ * Must be included prior to including any other header
+ */
+
+#ifndef __shibsp_base_h__
+#define __shibsp_base_h__
+
+#include <saml/base.h>
+
+// Windows and GCC4 Symbol Visibility Macros
+#ifdef WIN32
+ #define SHIBSP_IMPORT __declspec(dllimport)
+ #define SHIBSP_EXPORT __declspec(dllexport)
+ #define SHIBSP_DLLLOCAL
+ #define SHIBSP_DLLPUBLIC
+#else
+ #define SHIBSP_IMPORT
+ #ifdef GCC_HASCLASSVISIBILITY
+ #define SHIBSP_EXPORT __attribute__ ((visibility("default")))
+ #define SHIBSP_DLLLOCAL __attribute__ ((visibility("hidden")))
+ #define SHIBSP_DLLPUBLIC __attribute__ ((visibility("default")))
+ #else
+ #define SHIBSP_EXPORT
+ #define SHIBSP_DLLLOCAL
+ #define SHIBSP_DLLPUBLIC
+ #endif
+#endif
+
+// Define SHIBSP_API for DLL builds
+#ifdef SHIBSP_EXPORTS
+ #define SHIBSP_API SHIBSP_EXPORT
+#else
+ #define SHIBSP_API SHIBSP_IMPORT
+#endif
+
+// Throwable classes must always be visible on GCC in all binaries
+#ifdef WIN32
+ #define SHIBSP_EXCEPTIONAPI(api) api
+#elif defined(GCC_HASCLASSVISIBILITY)
+ #define SHIBSP_EXCEPTIONAPI(api) SHIBSP_EXPORT
+#else
+ #define SHIBSP_EXCEPTIONAPI(api)
+#endif
+
+#ifdef WIN32
+
+/**
+ * Default catalog path on Windows.
+ */
+# define SHIBSP_SCHEMAS "/opt/shibboleth-sp/share/xml/xmltooling/catalog.xml;/opt/shibboleth-sp/share/xml/opensaml/catalog.xml;/opt/shibboleth-sp/share/xml/shibboleth/catalog.xml"
+
+/**
+ * Default path to configuration file on Windows.
+ */
+# define SHIBSP_CONFIG "/opt/shibboleth-sp/etc/shibboleth/shibboleth.xml"
+
+#else
+# include <shibsp/paths.h>
+#endif
+
+/**
+ * Logging category for Service Provider functions.
+ */
+#define SHIBSP_LOGCAT "Shibboleth.SP"
+
+/**
+ * Logging category for Service Provider auditing.
+ */
+#define SHIBSP_TX_LOGCAT "Shibboleth-TRANSACTION"
+
+/**
+ * Controls default logging level of console tools and other situations
+ * where fully-configured logging isn't used.
+ */
+#define SHIBSP_LOGGING "WARN"
+
+#endif /* __shibsp_base_h__ */
--- /dev/null
+/*
+ * Copyright 2001-2006 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file shibsp/exceptions.h
+ *
+ * Exception classes
+ */
+
+#ifndef __shibsp_exceptions_h__
+#define __shibsp_exceptions_h__
+
+#include <shibsp/base.h>
+#include <saml/exceptions.h>
+
+namespace shibsp {
+
+ DECL_XMLTOOLING_EXCEPTION(ConfigurationException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,xmltooling::XMLToolingException,Exceptions during configuration.);
+ DECL_XMLTOOLING_EXCEPTION(ListenerException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),shibsp,xmltooling::XMLToolingException,Exceptions during inter-process communication.);
+
+};
+
+#endif /* __shibsp_exceptions_h__ */
--- /dev/null
+/*
+ * Copyright 2001-2005 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * internal.h - internally visible classes
+ */
+
+#ifndef __shibsp_internal_h__
+#define __shibsp_internal_h__
+
+#ifdef WIN32
+# define _CRT_SECURE_NO_DEPRECATE 1
+# define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
+
+// Export public APIs
+#define SHIBSP_EXPORTS
+
+// eventually we might be able to support autoconf via cygwin...
+#if defined (_MSC_VER) || defined(__BORLANDC__)
+# include "config_win32.h"
+#else
+# include "config.h"
+#endif
+
+#include "base.h"
+#include "SPConfig.h"
+
+namespace shibsp {
+
+ /// @cond OFF
+ class SPInternalConfig : public SPConfig
+ {
+ public:
+ SPInternalConfig() {}
+
+ static SPInternalConfig& getInternalConfig();
+
+ bool init(const char* catalog_path);
+ void term();
+
+ private:
+ };
+ /// @endcond
+
+};
+
+#endif /* __shibsp_internal_h__ */
--- /dev/null
+/*\r
+ * Copyright 2001-2005 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @file shibsp/paths.h\r
+ * \r
+ * Default configuration paths.\r
+ */\r
+\r
+#ifndef __shibsp_paths_h__\r
+#define __shibsp_paths_h__\r
+\r
+/**\r
+ * Default schema catalogs.\r
+ */\r
+#define SHIBSP_SCHEMAS "@-XMLDIR-@/xmltooling/catalog.xml:@-XMLDIR-@/opensaml/catalog.xml:@-XMLDIR-@/shibboleth/catalog.xml"\r
+\r
+/**\r
+ * Default location of SP configuration file.\r
+ */\r
+#define SHIBSP_CONFIG "@-PKGSYSCONFDIR-@/shibboleth.xml"\r
+\r
+#endif /* __shibsp_paths_h__ */\r
AdditionalLibraryDirectories=""..\..\cpp-opensaml1\saml\Debug";"..\..\cpp-opensaml2\Debug";"..\..\cpp-xmltooling\Debug""\r
GenerateDebugInformation="true"\r
SubSystem="2"\r
- ImportLibrary="$(TargetDir)$(TargetName)1D.lib"\r
+ ImportLibrary="$(TargetDir)$(ProjectName)1D.lib"\r
TargetMachine="1"\r
/>\r
<Tool\r
SubSystem="2"\r
OptimizeReferences="2"\r
EnableCOMDATFolding="2"\r
- ImportLibrary="$(TargetDir)$(TargetName)1.lib"\r
+ ImportLibrary="$(TargetDir)$(ProjectName)1.lib"\r
TargetMachine="1"\r
/>\r
<Tool\r
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
>\r
+ <File\r
+ RelativePath=".\SPConfig.cpp"\r
+ >\r
+ </File>\r
</Filter>\r
<Filter\r
Name="Header Files"\r
Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
>\r
+ <File\r
+ RelativePath=".\base.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\exceptions.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\internal.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\SPConfig.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\version.h"\r
+ >\r
+ </File>\r
</Filter>\r
<Filter\r
Name="Resource Files"\r
--- /dev/null
+/*
+ * Copyright 2001-2006 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * version.h
+ *
+ * Library version macros and constants
+ */
+
+#ifndef __shibsp_version_h__
+#define __shibsp_version_h__
+
+// This is all based on Xerces, on the theory it might be useful to
+// support this kind of stuff in the future. If they ever yank some
+// of this stuff, it can be copied into here.
+
+#include <xercesc/util/XercesVersion.hpp>
+
+// ---------------------------------------------------------------------------
+// V E R S I O N S P E C I F I C A T I O N
+
+/**
+ * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH OPENSAML VERSION
+ * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE
+ */
+
+#define SHIBSP_VERSION_MAJOR 1
+#define SHIBSP_VERSION_MINOR 0
+#define SHIBSP_VERSION_REVISION 0
+
+/** DO NOT MODIFY BELOW THIS LINE */
+
+/**
+ * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING:
+ *
+ * gShibSPVersionStr, gShibSPFullVersionStr, gShibSPMajVersion, gShibSPMinVersion, gShibSPRevision
+ */
+
+// ---------------------------------------------------------------------------
+// V E R S I O N I N F O R M A T I O N
+
+// ShibSP version strings; these particular macros cannot be used for
+// conditional compilation as they are not numeric constants
+
+#define SHIBSP_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+#define SHIBSP_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+#define SHIBSP_FULLVERSIONNUM INVK_CAT3_SEP_NIL(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+#define SHIBSP_VERSIONSTR INVK_CAT2_SEP_UNDERSCORE(SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR)
+
+const char* const gShibSPVersionStr = SHIBSP_VERSIONSTR;
+const char* const gShibSPFullVersionStr = SHIBSP_FULLVERSIONSTR;
+const unsigned int gShibSPMajVersion = SHIBSP_VERSION_MAJOR;
+const unsigned int gShibSPMinVersion = SHIBSP_VERSION_MINOR;
+const unsigned int gShibSPRevision = SHIBSP_VERSION_REVISION;
+
+// ShibSP version numeric constants that can be used for conditional
+// compilation purposes.
+
+#define _SHIBSP_VERSION CALC_EXPANDED_FORM (SHIBSP_VERSION_MAJOR,SHIBSP_VERSION_MINOR,SHIBSP_VERSION_REVISION)
+
+#endif /* __shibsp_version_h__ */
#endif
#include <fstream>
-#include "../shib-target/shib-target.h"
+#include <shib-target/shib-target.h>
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+#include <shibsp/SPConfig.h>
+
+using namespace shibsp;
using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
+using namespace std;
int main(int argc,char* argv[])
{
a_param="default";
ShibTargetConfig& conf=ShibTargetConfig::getConfig();
- conf.setFeatures(
- ShibTargetConfig::Listener |
- ShibTargetConfig::Metadata |
- ShibTargetConfig::Trust |
- ShibTargetConfig::OutOfProcess
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Listener |
+ SPConfig::Metadata |
+ SPConfig::Trust |
+ SPConfig::OutOfProcess
);
if (!conf.init(path) || !conf.load(config))
return -10;
# define _CRT_SECURE_NO_DEPRECATE 1
#endif
-#include "../shib-target/shib-target.h"
+#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
using namespace shibtarget;
+using namespace shibboleth;
+using namespace saml;
+using namespace std;
int main(int argc,char* argv[])
{
a_param="default";
ShibTargetConfig& conf=ShibTargetConfig::getConfig();
- conf.setFeatures(
- ShibTargetConfig::Metadata |
- ShibTargetConfig::Trust |
- ShibTargetConfig::Credentials |
- ShibTargetConfig::AAP |
- ShibTargetConfig::OutOfProcess |
- ShibTargetConfig::Caching
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Metadata |
+ SPConfig::Trust |
+ SPConfig::Credentials |
+ SPConfig::AAP |
+ SPConfig::OutOfProcess |
+ SPConfig::Caching
);
if (!conf.init(path) || !conf.load(config))
return -10;
FileResolver::~FileResolver()
{
for_each(m_certs.begin(),m_certs.end(),X509_free);
- for_each(m_xseccerts.begin(),m_xseccerts.end(),shibtarget::cleanup<XSECCryptoX509>());
+ for_each(m_xseccerts.begin(),m_xseccerts.end(),xmltooling::cleanup<XSECCryptoX509>());
}
void FileResolver::attach(void* ctx) const
XMLAAPImpl::~XMLAAPImpl()
{
#ifdef HAVE_GOOD_STL
- for_each(m_attrMap.begin(),m_attrMap.end(),shibtarget::cleanup_pair<xstring,AttributeRule>());
+ for_each(m_attrMap.begin(),m_attrMap.end(),xmltooling::cleanup_pair<xstring,AttributeRule>());
#else
- for_each(m_attrMap.begin(),m_attrMap.end(),shibtarget::cleanup_pair<string,AttributeRule>());
+ for_each(m_attrMap.begin(),m_attrMap.end(),xmltooling::cleanup_pair<string,AttributeRule>());
#endif
}
Operator::~Operator()
{
- for_each(m_operands.begin(),m_operands.end(),shibtarget::cleanup<IAuthz>());
+ for_each(m_operands.begin(),m_operands.end(),xmltooling::cleanup<IAuthz>());
}
bool Operator::authorized(ShibTarget* st, ISessionCacheEntry* entry) const
XMLCredentialsImpl::~XMLCredentialsImpl()
{
- for_each(m_resolverMap.begin(),m_resolverMap.end(),shibtarget::cleanup_pair<string,ICredResolver>());
+ for_each(m_resolverMap.begin(),m_resolverMap.end(),xmltooling::cleanup_pair<string,ICredResolver>());
}
const ICredResolver* XMLCredentials::lookup(const char* id) const
XMLMetadataImpl::KeyDescriptor::~KeyDescriptor()
{
- for_each(m_methods.begin(),m_methods.end(),shibtarget::cleanup<XENCEncryptionMethod>());
+ for_each(m_methods.begin(),m_methods.end(),xmltooling::cleanup<XENCEncryptionMethod>());
delete m_klist;
}
XMLMetadataImpl::KeyAuthority::~KeyAuthority()
{
- for_each(m_klists.begin(),m_klists.end(),shibtarget::cleanup<DSIGKeyInfoList>());
+ for_each(m_klists.begin(),m_klists.end(),xmltooling::cleanup<DSIGKeyInfoList>());
}
XMLMetadataImpl::Role::Role(const EntityDescriptor* provider, time_t validUntil, const DOMElement* e)
delete m_org;
delete m_errorURL;
if (m_protocolEnumCopy) XMLString::release(&m_protocolEnumCopy);
- for_each(m_keys.begin(),m_keys.end(),shibtarget::cleanup<IKeyDescriptor>());
- for_each(m_contacts.begin(),m_contacts.end(),shibtarget::cleanup<IContactPerson>());
+ for_each(m_keys.begin(),m_keys.end(),xmltooling::cleanup<IKeyDescriptor>());
+ for_each(m_contacts.begin(),m_contacts.end(),xmltooling::cleanup<IContactPerson>());
}
bool XMLMetadataImpl::Role::hasSupport(const XMLCh* protocol) const
XMLMetadataImpl::IDPRole::~IDPRole()
{
- for_each(m_attrs.begin(),m_attrs.end(),shibtarget::cleanup<SAMLAttribute>());
+ for_each(m_attrs.begin(),m_attrs.end(),xmltooling::cleanup<SAMLAttribute>());
}
XMLMetadataImpl::AARole::AARole(const EntityDescriptor* provider, time_t validUntil, const DOMElement* e)
XMLMetadataImpl::AARole::~AARole()
{
- for_each(m_attrs.begin(),m_attrs.end(),shibtarget::cleanup<SAMLAttribute>());
+ for_each(m_attrs.begin(),m_attrs.end(),xmltooling::cleanup<SAMLAttribute>());
}
XMLMetadataImpl::EntityDescriptor::EntityDescriptor(
XMLMetadataImpl::EntityDescriptor::~EntityDescriptor()
{
delete m_org;
- for_each(m_contacts.begin(),m_contacts.end(),shibtarget::cleanup<IContactPerson>());
- for_each(m_roles.begin(),m_roles.end(),shibtarget::cleanup<IRoleDescriptor>());
- for_each(m_keyauths.begin(),m_keyauths.end(),shibtarget::cleanup<IKeyAuthority>());
+ for_each(m_contacts.begin(),m_contacts.end(),xmltooling::cleanup<IContactPerson>());
+ for_each(m_roles.begin(),m_roles.end(),xmltooling::cleanup<IRoleDescriptor>());
+ for_each(m_keyauths.begin(),m_keyauths.end(),xmltooling::cleanup<IKeyAuthority>());
}
XMLMetadataImpl::EntitiesDescriptor::EntitiesDescriptor(
XMLMetadataImpl::EntitiesDescriptor::~EntitiesDescriptor()
{
- for_each(m_providers.begin(),m_providers.end(),shibtarget::cleanup<IEntityDescriptor>());
- for_each(m_groups.begin(),m_groups.end(),shibtarget::cleanup<IEntitiesDescriptor>());
- for_each(m_keyauths.begin(),m_keyauths.end(),shibtarget::cleanup<IKeyAuthority>());
+ for_each(m_providers.begin(),m_providers.end(),xmltooling::cleanup<IEntityDescriptor>());
+ for_each(m_groups.begin(),m_groups.end(),xmltooling::cleanup<IEntitiesDescriptor>());
+ for_each(m_keyauths.begin(),m_keyauths.end(),xmltooling::cleanup<IKeyAuthority>());
}
void XMLMetadataImpl::init()
XMLTrustImpl::~XMLTrustImpl()
{
- for_each(m_keyauths.begin(),m_keyauths.end(),shibtarget::cleanup<KeyAuthority>());
- for_each(m_keybinds.begin(),m_keybinds.end(),shibtarget::cleanup<DSIGKeyInfoList>());
+ for_each(m_keyauths.begin(),m_keyauths.end(),xmltooling::cleanup<KeyAuthority>());
+ for_each(m_keybinds.begin(),m_keybinds.end(),xmltooling::cleanup<DSIGKeyInfoList>());
}
XMLTrust::XMLTrust(const DOMElement* e) : ReloadableXMLFile(e), m_delegate(NULL)
XMLTrust::~XMLTrust()
{
delete m_delegate;
- for_each(m_resolvers.begin(),m_resolvers.end(),shibtarget::cleanup<KeyInfoResolver>());
+ for_each(m_resolvers.begin(),m_resolvers.end(),xmltooling::cleanup<KeyInfoResolver>());
}
static int error_callback(int ok, X509_STORE_CTX* ctx)