/*
- * Copyright 2001-2005 Internet2
+ * Copyright 2001-2007 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// IApplication
const char* getId() const {return getString("id").second;}
const char* getHash() const {return m_hash.c_str();}
- Iterator<IAAP*> getAAPProviders() const;
MetadataProvider* getMetadataProvider() const;
TrustEngine* getTrustEngine() const;
const vector<const XMLCh*>& getAudiences() const;
const ServiceProvider* m_sp; // this is ok because its locking scope includes us
const XMLApplication* m_base;
string m_hash;
- vector<IAAP*> m_aaps;
MetadataProvider* m_metadata;
TrustEngine* m_trust;
vector<const XMLCh*> m_audiences;
// Always include our own providerId as an audience.
m_audiences.push_back(getXMLString("providerId").second);
- if (conf.isEnabled(SPConfig::AAP)) {
+ if (conf.isEnabled(SPConfig::AttributeResolver)) {
child = XMLHelper::getFirstChildElement(e,AAPProvider);
while (child) {
- xmltooling::auto_ptr_char type(child->getAttributeNS(NULL,_type));
- log.info("building AAP provider of type %s...",type.get());
- try {
- IPlugIn* plugin=shibConf.getPlugMgr().newPlugin(type.get(),child);
- IAAP* aap=dynamic_cast<IAAP*>(plugin);
- if (aap)
- m_aaps.push_back(aap);
- else {
- delete plugin;
- log.crit("plugin was not an AAP provider");
- }
- }
- catch (exception& ex) {
- log.crit("error building AAP provider: %s", ex.what());
- }
-
+ // TODO: some kind of compatibility
child = XMLHelper::getNextSiblingElement(child,AAPProvider);
}
}
#else
for_each(m_credMap.begin(),m_credMap.end(),xmltooling::cleanup_pair<const XMLCh*,PropertySet>());
#endif
- for_each(m_aaps.begin(),m_aaps.end(),xmltooling::cleanup<IAAP>());
delete m_trust;
delete m_metadata;
return m_base->getPropertySet(name,ns);
}
-Iterator<IAAP*> XMLApplication::getAAPProviders() const
-{
- return (m_aaps.empty() && m_base) ? m_base->getAAPProviders() : m_aaps;
-}
-
MetadataProvider* XMLApplication::getMetadataProvider() const
{
return (!m_metadata && m_base) ? m_base->getMetadataProvider() : m_metadata;
short XMLConfigImpl::acceptNode(const DOMNode* node) const
{
- if (!XMLString::equals(node->getNamespaceURI(),shibspconstants::SHIB1SPCONFIG_NS))
+ if (!XMLString::equals(node->getNamespaceURI(),shibspconstants::SHIB1SPCONFIG_NS) &&
+ !XMLString::equals(node->getNamespaceURI(),shibspconstants::SHIB2SPCONFIG_NS))
return FILTER_ACCEPT;
const XMLCh* name=node->getLocalName();
if (XMLString::equals(name,Applications) ||
try {
SPConfig& conf=SPConfig::getConfig();
- SAMLConfig& shibConf=SAMLConfig::getConfig();
XMLToolingConfig& xmlConf=XMLToolingConfig::getConfig();
const DOMElement* SHAR=XMLHelper::getFirstChildElement(e,OutOfProcess);
if (!SHAR)
// Much of the processing can only occur on the first instantiation.
if (first) {
+ // Set clock skew.
+ pair<bool,unsigned int> skew=getUnsignedInt("clockSkew");
+ if (skew.first)
+ xmlConf.clock_skew_secs=skew.second;
// Extensions
doExtensions(e, "global", log);
}
}
- // Now we load any attribute factories
- child = XMLHelper::getFirstChildElement(e,AttributeFactory);
- while (child) {
- xmltooling::auto_ptr_char type(child->getAttributeNS(NULL,_type));
- log.info("building Attribute factory of type %s...",type.get());
- try {
- IPlugIn* plugin=shibConf.getPlugMgr().newPlugin(type.get(),child);
- if (plugin) {
- IAttributeFactory* fact=dynamic_cast<IAttributeFactory*>(plugin);
- if (fact) {
- m_attrFactories.push_back(fact);
- ShibConfig::getConfig().regAttributeMapping(
- child->getAttributeNS(NULL,opensaml::saml1::Attribute::ATTRIBUTENAME_ATTRIB_NAME), fact
- );
- }
- else {
- delete plugin;
- log.crit("plugin was not an Attribute factory");
- }
- }
- }
- catch (exception& ex) {
- log.crit("error building Attribute factory: %s", ex.what());
- }
-
- child = XMLHelper::getNextSiblingElement(child,AttributeFactory);
- }
-
// Load the default application. This actually has a fixed ID of "default". ;-)
child=XMLHelper::getFirstChildElement(e,Applications);
if (!child) {