#include "ServiceProvider.h"
#include "SessionCache.h"
#include "SPConfig.h"
-#include "attribute/AttributeDecoder.h"
-#include "attribute/filtering/AttributeFilter.h"
-#include "attribute/filtering/MatchFunctor.h"
-#include "attribute/resolver/AttributeExtractor.h"
-#include "attribute/resolver/AttributeResolver.h"
-#include "binding/ArtifactResolver.h"
+#include "attribute/Attribute.h"
#include "handler/SessionInitiator.h"
-#include "metadata/MetadataExt.h"
#include "remoting/ListenerService.h"
-#include "security/PKIXTrustEngine.h"
+
+#ifndef SHIBSP_LITE
+# include "attribute/AttributeDecoder.h"
+# include "attribute/filtering/AttributeFilter.h"
+# include "attribute/filtering/MatchFunctor.h"
+# include "attribute/resolver/AttributeExtractor.h"
+# include "attribute/resolver/AttributeResolver.h"
+# include "binding/ArtifactResolver.h"
+# include "metadata/MetadataExt.h"
+# include "security/PKIXTrustEngine.h"
+# include <saml/SAMLConfig.h>
+#else
+# include <xmltooling/XMLToolingConfig.h>
+#endif
#include <log4cpp/Category.hh>
-#include <saml/SAMLConfig.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/TemplateEngine.h>
DECL_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp);
DECL_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
+#ifdef SHIBSP_LITE
+DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(RetryableProfileException,opensaml);
+#endif
+
namespace shibsp {
SPInternalConfig g_config;
}
catalog_path = SHIBSP_SCHEMAS;
XMLToolingConfig::getConfig().catalog_path = catalog_path;
+#ifndef SHIBSP_LITE
if (!SAMLConfig::getConfig().init()) {
log.fatal("failed to initialize OpenSAML library");
return false;
}
+#else
+ if (!XMLToolingConfig::getConfig().init()) {
+ log.fatal("failed to initialize XMLTooling library");
+ return false;
+ }
+#endif
XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp");
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeResolutionException,shibsp);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
-
+
+#ifdef SHIBSP_LITE
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml);
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml);
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(RetryableProfileException,opensaml);
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
+#endif
+
+#ifndef SHIBSP_LITE
if (isEnabled(Metadata))
registerMetadataExtClasses();
if (isEnabled(Trust))
registerPKIXTrustEngine();
+#endif
registerAttributeFactories();
registerHandlers();
registerSessionInitiators();
registerServiceProviders();
+#ifndef SHIBSP_LITE
if (isEnabled(AttributeResolution)) {
- registerAttributeDecoders();
registerAttributeExtractors();
- registerAttributeFilters();
+ registerAttributeDecoders();
registerAttributeResolvers();
+ registerAttributeFilters();
registerMatchFunctors();
}
+#endif
if (isEnabled(Listener))
registerListenerServices();
if (isEnabled(Caching))
registerSessionCaches();
+#ifndef SHIBSP_LITE
if (isEnabled(OutOfProcess))
m_artifactResolver = new ArtifactResolver();
-
+#endif
+
log.info("library initialization complete");
return true;
}
log.info("shutting down the library");
setServiceProvider(NULL);
+#ifndef SHIBSP_LITE
setArtifactResolver(NULL);
+#endif
+ ArtifactResolutionServiceManager.deregisterFactories();
AssertionConsumerServiceManager.deregisterFactories();
+ LogoutInitiatorManager.deregisterFactories();
ManageNameIDServiceManager.deregisterFactories();
SessionInitiatorManager.deregisterFactories();
SingleLogoutServiceManager.deregisterFactories();
ServiceProviderManager.deregisterFactories();
Attribute::deregisterFactories();
+#ifndef SHIBSP_LITE
if (isEnabled(AttributeResolution)) {
MatchFunctorManager.deregisterFactories();
- AttributeDecoderManager.deregisterFactories();
AttributeFilterManager.deregisterFactories();
+ AttributeDecoderManager.deregisterFactories();
AttributeExtractorManager.deregisterFactories();
AttributeResolverManager.deregisterFactories();
}
+#endif
if (isEnabled(Listener))
ListenerServiceManager.deregisterFactories();
if (isEnabled(Caching))
SessionCacheManager.deregisterFactories();
+#ifndef SHIBSP_LITE
SAMLConfig::getConfig().term();
+#else
+ XMLToolingConfig::getConfig().term();
+#endif
log.info("library shutdown complete");
}