bool ScopedAttribute::accept(IDOM_Element* e) const
{
- IOriginSiteMapper* mapper=ShibConfig::getConfig()->origin_mapper;
+ IOriginSiteMapper* mapper=ShibConfig::getConfig().origin_mapper;
Iterator<xstring> domains=mapper->getSecurityDomains(m_defaultScope.c_str());
const XMLCh* this_scope=NULL;
IDOM_Attr* scope=e->getAttributeNodeNS(NULL,Scope);
{
public:
// global per-process setup and shutdown of Shibboleth runtime
- static bool init(ShibConfig* pconfig);
- static void term();
+ virtual bool init();
+ virtual void term();
// enables runtime and clients to access configuration
- static const ShibConfig* getConfig();
+ static ShibConfig& getConfig();
/* start of external configuration */
IOriginSiteMapper* origin_mapper;
/* end of external configuration */
-
- private:
- static const ShibConfig* g_config;
};
struct SHIB_EXPORTS Constants
#include <shib.h>
using namespace shibboleth;
-// This is currently *NOT* threadsafe code.
-const ShibConfig* ShibConfig::g_config=NULL;
+ShibConfig g_config;
-bool ShibConfig::init(ShibConfig* pconfig)
+bool ShibConfig::init()
{
- if (!pconfig)
- return false;
- g_config=pconfig;
-
// Register extension schema.
saml::XML::registerSchema(XML::SHIB_NS,XML::SHIB_SCHEMA_ID);
{
}
-const ShibConfig* ShibConfig::getConfig()
+ShibConfig& ShibConfig::getConfig()
{
return g_config;
}