projects
/
shibboleth
/
cpp-opensaml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
01fe9dc
)
Allow for use as XMLTooling extension, clean up some header use in tests.
author
Scott Cantor
<cantor.2@osu.edu>
Wed, 6 Sep 2006 18:03:44 +0000
(18:03 +0000)
committer
Scott Cantor
<cantor.2@osu.edu>
Wed, 6 Sep 2006 18:03:44 +0000
(18:03 +0000)
13 files changed:
saml/SAMLConfig.cpp
patch
|
blob
|
history
saml/SAMLConfig.h
patch
|
blob
|
history
saml/internal.h
patch
|
blob
|
history
saml/saml.vcproj
patch
|
blob
|
history
samltest/SAMLArtifactCreationTest.h
patch
|
blob
|
history
samltest/SAMLArtifactType0001Test.h
patch
|
blob
|
history
samltest/SAMLArtifactType0002Test.h
patch
|
blob
|
history
samltest/SAMLArtifactType0004Test.h
patch
|
blob
|
history
samltest/internal.h
patch
|
blob
|
history
samltest/saml2/metadata/FilesystemMetadataProviderTest.h
patch
|
blob
|
history
samltest/samltest.h
patch
|
blob
|
history
samltest/security/AbstractPKIXTrustEngineTest.h
patch
|
blob
|
history
samltest/security/ExplicitKeyTrustEngineTest.h
patch
|
blob
|
history
diff --git
a/saml/SAMLConfig.cpp
b/saml/SAMLConfig.cpp
index
6f4bf76
..
a842faf
100644
(file)
--- a/
saml/SAMLConfig.cpp
+++ b/
saml/SAMLConfig.cpp
@@
-49,6
+49,20
@@
using namespace xmltooling;
using namespace log4cpp;
using namespace std;
using namespace log4cpp;
using namespace std;
+// Expose entry points when used as an extension library
+
+extern "C" int SAML_API xmltooling_extension_init(void*)
+{
+ if (SAMLConfig::getConfig().init(false))
+ return 0;
+ return -1;
+}
+
+extern "C" void SAML_API xmltooling_extension_term()
+{
+ SAMLConfig::getConfig().term(false);
+}
+
DECL_EXCEPTION_FACTORY(ArtifactException,opensaml);
DECL_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
DECL_EXCEPTION_FACTORY(ArtifactException,opensaml);
DECL_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
@@
-66,7
+80,7
@@
SAMLInternalConfig& SAMLInternalConfig::getInternalConfig()
return g_config;
}
return g_config;
}
-bool SAMLInternalConfig::init()
+bool SAMLInternalConfig::init(
bool initXMLTooling
)
{
#ifdef _DEBUG
xmltooling::NDC ndc("init");
{
#ifdef _DEBUG
xmltooling::NDC ndc("init");
@@
-74,8
+88,10
@@
bool SAMLInternalConfig::init()
Category& log=Category::getInstance(SAML_LOGCAT".SAMLConfig");
log.debug("library initialization started");
Category& log=Category::getInstance(SAML_LOGCAT".SAMLConfig");
log.debug("library initialization started");
- XMLToolingConfig::getConfig().init();
- log.debug("XMLTooling library initialized");
+ if (initXMLTooling) {
+ XMLToolingConfig::getConfig().init();
+ log.debug("XMLTooling library initialized");
+ }
REGISTER_EXCEPTION_FACTORY(ArtifactException,opensaml);
REGISTER_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
REGISTER_EXCEPTION_FACTORY(ArtifactException,opensaml);
REGISTER_EXCEPTION_FACTORY(MetadataFilterException,opensaml::saml2md);
@@
-94,11
+110,12
@@
bool SAMLInternalConfig::init()
return true;
}
return true;
}
-void SAMLInternalConfig::term()
+void SAMLInternalConfig::term(
bool termXMLTooling
)
{
#ifdef _DEBUG
xmltooling::NDC ndc("term");
#endif
{
#ifdef _DEBUG
xmltooling::NDC ndc("term");
#endif
+ Category& log=Category::getInstance(SAML_LOGCAT".SAMLConfig");
saml1::AssertionSchemaValidators.destroyValidators();
saml1p::ProtocolSchemaValidators.destroyValidators();
saml1::AssertionSchemaValidators.destroyValidators();
saml1p::ProtocolSchemaValidators.destroyValidators();
@@
-110,8
+127,11
@@
void SAMLInternalConfig::term()
MetadataProviderManager.deregisterFactories();
TrustEngineManager.deregisterFactories();
MetadataProviderManager.deregisterFactories();
TrustEngineManager.deregisterFactories();
- XMLToolingConfig::getConfig().term();
- Category::getInstance(SAML_LOGCAT".SAMLConfig").info("library shutdown complete");
+ if (termXMLTooling) {
+ XMLToolingConfig::getConfig().term();
+ log.debug("XMLTooling library shut down");
+ }
+ log.info("library shutdown complete");
}
void SAMLInternalConfig::generateRandomBytes(void* buf, unsigned int len)
}
void SAMLInternalConfig::generateRandomBytes(void* buf, unsigned int len)
diff --git
a/saml/SAMLConfig.h
b/saml/SAMLConfig.h
index
b97bda0
..
0474707
100644
(file)
--- a/
saml/SAMLConfig.h
+++ b/
saml/SAMLConfig.h
@@
-69,19
+69,26
@@
namespace opensaml {
* Initializes library
\r
*
\r
* Each process using the library MUST call this function exactly once
\r
* Initializes library
\r
*
\r
* Each process using the library MUST call this function exactly once
\r
- * before using any library classes.
\r
+ * before using any library classes. The flag controls whether this is the
\r
+ * "dominant" library or not and can allow the SAML library to be loaded
\r
+ * as an extension of XMLTooling rather than subsuming it.
\r
*
\r
*
\r
+ * @param initXMLTooling true iff this method should initialize the XMLTooling layer
\r
* @return true iff initialization was successful
\r
*/
\r
* @return true iff initialization was successful
\r
*/
\r
- virtual bool init()=0;
\r
+ virtual bool init(
bool initXMLTooling=true
)=0;
\r
\r
/**
\r
* Shuts down library
\r
*
\r
* Each process using the library SHOULD call this function exactly once
\r
\r
/**
\r
* Shuts down library
\r
*
\r
* Each process using the library SHOULD call this function exactly once
\r
- * before terminating itself
\r
+ * before terminating itself. The flag controls whether this is the
\r
+ * "dominant" library or not and can allow the SAML library to be loaded
\r
+ * as an extension of XMLTooling rather than subsuming it.
\r
+ *
\r
+ * @param termXMLTooling true iff this method should shutdown the XMLTooling layer
\r
*/
\r
*/
\r
- virtual void term()=0;
\r
+ virtual void term(
bool termXMLTooling=true
)=0;
\r
\r
/**
\r
* Generate random information using the underlying security library
\r
\r
/**
\r
* Generate random information using the underlying security library
\r
diff --git
a/saml/internal.h
b/saml/internal.h
index
9be5928
..
72beb8e
100644
(file)
--- a/
saml/internal.h
+++ b/
saml/internal.h
@@
-89,8
+89,8
@@
namespace opensaml {
static SAMLInternalConfig& getInternalConfig();
// global per-process setup and shutdown of runtime
static SAMLInternalConfig& getInternalConfig();
// global per-process setup and shutdown of runtime
- bool init();
- void term();
+ bool init(
bool initXMLTooling=true
);
+ void term(
bool termXMLTooling=true
);
void generateRandomBytes(void* buf, unsigned int len);
void generateRandomBytes(std::string& buf, unsigned int len);
void generateRandomBytes(void* buf, unsigned int len);
void generateRandomBytes(std::string& buf, unsigned int len);
diff --git
a/saml/saml.vcproj
b/saml/saml.vcproj
index
e5aa7c0
..
27b7e03
100644
(file)
--- a/
saml/saml.vcproj
+++ b/
saml/saml.vcproj
@@
-240,6
+240,14
@@
>
\r
</Filter>
\r
</Filter>
\r
>
\r
</Filter>
\r
</Filter>
\r
+ <Filter
\r
+ Name="binding"
\r
+ >
\r
+ <Filter
\r
+ Name="impl"
\r
+ >
\r
+ </Filter>
\r
+ </Filter>
\r
</Filter>
\r
<Filter
\r
Name="signature"
\r
</Filter>
\r
<Filter
\r
Name="signature"
\r
@@
-328,6
+336,14
@@
</File>
\r
</Filter>
\r
</Filter>
\r
</File>
\r
</Filter>
\r
</Filter>
\r
+ <Filter
\r
+ Name="binding"
\r
+ >
\r
+ <Filter
\r
+ Name="impl"
\r
+ >
\r
+ </Filter>
\r
+ </Filter>
\r
</Filter>
\r
<Filter
\r
Name="encryption"
\r
</Filter>
\r
<Filter
\r
Name="encryption"
\r
@@
-422,6
+438,10
@@
Name="profile"
\r
>
\r
</Filter>
\r
Name="profile"
\r
>
\r
</Filter>
\r
+ <Filter
\r
+ Name="binding"
\r
+ >
\r
+ </Filter>
\r
</Filter>
\r
<Filter
\r
Name="signature"
\r
</Filter>
\r
<Filter
\r
Name="signature"
\r
@@
-482,6
+502,10
@@
>
\r
</File>
\r
</Filter>
\r
>
\r
</File>
\r
</Filter>
\r
+ <Filter
\r
+ Name="binding"
\r
+ >
\r
+ </Filter>
\r
</Filter>
\r
<Filter
\r
Name="encryption"
\r
</Filter>
\r
<Filter
\r
Name="encryption"
\r
diff --git
a/samltest/SAMLArtifactCreationTest.h
b/samltest/SAMLArtifactCreationTest.h
index
104e7b1
..
a62f4c5
100644
(file)
--- a/
samltest/SAMLArtifactCreationTest.h
+++ b/
samltest/SAMLArtifactCreationTest.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <saml/saml1/core/SAMLArtifactType0001.h>
\r
#include <saml/saml1/core/SAMLArtifactType0002.h>
\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>
\r
#include <saml/saml1/core/SAMLArtifactType0001.h>
\r
#include <saml/saml1/core/SAMLArtifactType0002.h>
\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>
\r
diff --git
a/samltest/SAMLArtifactType0001Test.h
b/samltest/SAMLArtifactType0001Test.h
index
48c8754
..
78ef996
100644
(file)
--- a/
samltest/SAMLArtifactType0001Test.h
+++ b/
samltest/SAMLArtifactType0001Test.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <saml/saml1/core/SAMLArtifactType0001.h>
\r
\r
using namespace opensaml::saml1p;
\r
#include <saml/saml1/core/SAMLArtifactType0001.h>
\r
\r
using namespace opensaml::saml1p;
\r
diff --git
a/samltest/SAMLArtifactType0002Test.h
b/samltest/SAMLArtifactType0002Test.h
index
45365d8
..
545564a
100644
(file)
--- a/
samltest/SAMLArtifactType0002Test.h
+++ b/
samltest/SAMLArtifactType0002Test.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <saml/saml1/core/SAMLArtifactType0002.h>
\r
\r
using namespace opensaml::saml1p;
\r
#include <saml/saml1/core/SAMLArtifactType0002.h>
\r
\r
using namespace opensaml::saml1p;
\r
diff --git
a/samltest/SAMLArtifactType0004Test.h
b/samltest/SAMLArtifactType0004Test.h
index
e2f57d0
..
52273aa
100644
(file)
--- a/
samltest/SAMLArtifactType0004Test.h
+++ b/
samltest/SAMLArtifactType0004Test.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>
\r
\r
using namespace opensaml::saml2p;
\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>
\r
\r
using namespace opensaml::saml2p;
\r
diff --git
a/samltest/internal.h
b/samltest/internal.h
index
4575bc4
..
b5e1bd5
100644
(file)
--- a/
samltest/internal.h
+++ b/
samltest/internal.h
@@
-18,12
+18,12
@@
#include <fstream>
#include <saml/exceptions.h>
#include <fstream>
#include <saml/exceptions.h>
-#include <saml/SAMLConfig.h>
#include <saml/util/SAMLConstants.h>
#include <xmltooling/exceptions.h>
#include <xmltooling/validation/Validator.h>
#include <xmltooling/XMLObject.h>
#include <xmltooling/XMLObjectBuilder.h>
#include <saml/util/SAMLConstants.h>
#include <xmltooling/exceptions.h>
#include <xmltooling/validation/Validator.h>
#include <xmltooling/XMLObject.h>
#include <xmltooling/XMLObjectBuilder.h>
+#include <xmltooling/XMLToolingConfig.h>
using namespace opensaml;
using namespace xmltooling;
using namespace opensaml;
using namespace xmltooling;
diff --git
a/samltest/saml2/metadata/FilesystemMetadataProviderTest.h
b/samltest/saml2/metadata/FilesystemMetadataProviderTest.h
index
a6093b1
..
5358d3e
100644
(file)
--- a/
samltest/saml2/metadata/FilesystemMetadataProviderTest.h
+++ b/
samltest/saml2/metadata/FilesystemMetadataProviderTest.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>
\r
#include <saml/saml2/metadata/Metadata.h>
\r
#include <saml/saml2/metadata/MetadataProvider.h>
\r
#include <saml/saml2/core/SAML2ArtifactType0004.h>
\r
#include <saml/saml2/metadata/Metadata.h>
\r
#include <saml/saml2/metadata/MetadataProvider.h>
\r
diff --git
a/samltest/samltest.h
b/samltest/samltest.h
index
4033914
..
92509d8
100644
(file)
--- a/
samltest/samltest.h
+++ b/
samltest/samltest.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <fstream>
\r
#include <cxxtest/GlobalFixture.h>
\r
\r
#include <fstream>
\r
#include <cxxtest/GlobalFixture.h>
\r
diff --git
a/samltest/security/AbstractPKIXTrustEngineTest.h
b/samltest/security/AbstractPKIXTrustEngineTest.h
index
3db7df2
..
346bade
100644
(file)
--- a/
samltest/security/AbstractPKIXTrustEngineTest.h
+++ b/
samltest/security/AbstractPKIXTrustEngineTest.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <saml/security/AbstractPKIXTrustEngine.h>
\r
#include <saml/saml2/metadata/MetadataProvider.h>
\r
\r
#include <saml/security/AbstractPKIXTrustEngine.h>
\r
#include <saml/saml2/metadata/MetadataProvider.h>
\r
\r
diff --git
a/samltest/security/ExplicitKeyTrustEngineTest.h
b/samltest/security/ExplicitKeyTrustEngineTest.h
index
53416e9
..
e531e8a
100644
(file)
--- a/
samltest/security/ExplicitKeyTrustEngineTest.h
+++ b/
samltest/security/ExplicitKeyTrustEngineTest.h
@@
-15,6
+15,7
@@
*/
\r
\r
#include "internal.h"
\r
*/
\r
\r
#include "internal.h"
\r
+#include <saml/SAMLConfig.h>
\r
#include <saml/security/TrustEngine.h>
\r
#include <saml/saml2/metadata/MetadataProvider.h>
\r
\r
#include <saml/security/TrustEngine.h>
\r
#include <saml/saml2/metadata/MetadataProvider.h>
\r
\r