[cpp-opensaml] branch main updated: Rename the exclusion test and data.
Scott Cantor
cantor.2 at osu.edu
Mon Dec 7 20:35:15 UTC 2020
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository cpp-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-opensaml.git;a=commit;h=a636798a59f1b8262bb026bddc765ab2f2565b5c
The following commit(s) were added to refs/heads/main by this push:
new a636798 Rename the exclusion test and data.
a636798 is described below
commit a636798a59f1b8262bb026bddc765ab2f2565b5c
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Dec 7 15:35:09 2020 -0500
Rename the exclusion test and data.
---
samltest/Makefile.am | 1 +
.../{XMLWithBlacklists.xml => XMLWithExcludes.xml} | 2 +-
samltest/saml2/metadata/XMLMetadataProviderTest.h | 81 +++++++++++-----------
3 files changed, 41 insertions(+), 43 deletions(-)
diff --git a/samltest/Makefile.am b/samltest/Makefile.am
index c8e38d4..1cf5883 100644
--- a/samltest/Makefile.am
+++ b/samltest/Makefile.am
@@ -119,6 +119,7 @@ samltest_CXXFLAGS = \
$(xerces_CFLAGS) \
$(xmlsec_CFLAGS) \
$(xmltooling_CFLAGS)
+
samltest_LDADD = $(top_builddir)/saml/libsaml.la \
$(xerces_LIBS) \
$(xmlsec_LIBS) \
diff --git a/samltest/data/saml2/metadata/XMLWithBlacklists.xml b/samltest/data/saml2/metadata/XMLWithExcludes.xml
similarity index 90%
rename from samltest/data/saml2/metadata/XMLWithBlacklists.xml
rename to samltest/data/saml2/metadata/XMLWithExcludes.xml
index ebe1d2f..c3c2bbb 100644
--- a/samltest/data/saml2/metadata/XMLWithBlacklists.xml
+++ b/samltest/data/saml2/metadata/XMLWithExcludes.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<FilesystemMetadataProvider path="../samltest/data/saml2/metadata/InCommon-metadata.xml.bck" validate="0">
- <MetadataFilter type="Blacklist">
+ <MetadataFilter type="Exclude">
<Exclude>urn:mace:incommon:washington.edu</Exclude>
<Exclude>urn:mace:incommon:osu.edu</Exclude>
<Exclude>urn:mace:incommon:internet2.edu</Exclude>
diff --git a/samltest/saml2/metadata/XMLMetadataProviderTest.h b/samltest/saml2/metadata/XMLMetadataProviderTest.h
index 881168d..f616c25 100644
--- a/samltest/saml2/metadata/XMLMetadataProviderTest.h
+++ b/samltest/saml2/metadata/XMLMetadataProviderTest.h
@@ -53,6 +53,43 @@ public:
SAMLObjectBaseTestCase::tearDown();
}
+ void testHTTPProvider()
+ {
+ skipNetworked();
+ string config = data_path + "saml2/metadata/HTTPMetadataProvider.xml";
+ ifstream in(config.c_str());
+ DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
+ XercesJanitor<DOMDocument> janitor(doc);
+
+ scoped_ptr<MetadataProvider> metadataProvider(\
+ SAMLConfig::getConfig().MetadataProviderManager.newPlugin(XML_METADATA_PROVIDER, doc->getDocumentElement(), false)
+ );
+ try {
+ metadataProvider->init();
+ } catch (const XMLToolingException& ex) {
+ TS_TRACE(ex.what());
+ throw;
+ }
+
+ Locker locker(metadataProvider.get());
+ const EntityDescriptor* descriptor = metadataProvider->getEntityDescriptor(MetadataProvider::Criteria(entityID, nullptr, nullptr, false)).first;
+ TSM_ASSERT("Retrieved entity descriptor was null", descriptor != nullptr);
+ assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());
+ TSM_ASSERT_EQUALS("Unexpected number of roles", 1, descriptor->getIDPSSODescriptors().size());
+ TSM_ASSERT("Role lookup failed", find_if(descriptor->getIDPSSODescriptors(), isValidForProtocol(supportedProtocol)) != nullptr);
+ TSM_ASSERT("Role lookup failed", find_if(descriptor->getIDPSSODescriptors(), isValidForProtocol(supportedProtocol2)) != nullptr);
+
+ static const char* providerIdStr = "urn:mace:incommon:washington.edu";
+ scoped_ptr<SAML2ArtifactType0004> artifact(
+ new SAML2ArtifactType0004(
+ SecurityHelper::doHash("SHA1", providerIdStr, strlen(providerIdStr), false), 1
+ )
+ );
+ descriptor = metadataProvider->getEntityDescriptor(MetadataProvider::Criteria(artifact.get(), nullptr, nullptr, false)).first;
+ TSM_ASSERT("Retrieved entity descriptor was null", descriptor != nullptr);
+ assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());
+ }
+
void testBadSig()
{
skipNetworked();
@@ -131,49 +168,9 @@ public:
assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());
}
-
- void testHTTPProvider()
- {
- skipNetworked();
- string config = data_path + "saml2/metadata/HTTPMetadataProvider.xml";
- ifstream in(config.c_str());
- DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
- XercesJanitor<DOMDocument> janitor(doc);
-
- scoped_ptr<MetadataProvider> metadataProvider(\
- SAMLConfig::getConfig().MetadataProviderManager.newPlugin(XML_METADATA_PROVIDER, doc->getDocumentElement(), false)
- );
- try {
- metadataProvider->init();
- } catch (const XMLToolingException& ex) {
- TS_TRACE(ex.what());
- throw;
- }
-
- Locker locker(metadataProvider.get());
- const EntityDescriptor* descriptor = metadataProvider->getEntityDescriptor(MetadataProvider::Criteria(entityID, nullptr, nullptr, false)).first;
- TSM_ASSERT("Retrieved entity descriptor was null", descriptor != nullptr);
- assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());
- TSM_ASSERT_EQUALS("Unexpected number of roles", 1, descriptor->getIDPSSODescriptors().size());
- TSM_ASSERT("Role lookup failed", find_if(descriptor->getIDPSSODescriptors(), isValidForProtocol(supportedProtocol)) != nullptr);
- TSM_ASSERT("Role lookup failed", find_if(descriptor->getIDPSSODescriptors(), isValidForProtocol(supportedProtocol2)) != nullptr);
-
- static const char* providerIdStr = "urn:mace:incommon:washington.edu";
- scoped_ptr<SAML2ArtifactType0004> artifact(
- new SAML2ArtifactType0004(
- SecurityHelper::doHash("SHA1", providerIdStr, strlen(providerIdStr), false), 1
- )
- );
- descriptor = metadataProvider->getEntityDescriptor(MetadataProvider::Criteria(artifact.get(), nullptr, nullptr, false)).first;
- TSM_ASSERT("Retrieved entity descriptor was null", descriptor != nullptr);
- assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());
- }
-
-
-
- void testXMLWithBlacklists() {
+ void testXMLWithExcludes() {
skipNetworked();
- string config = data_path + "saml2/metadata/XMLWithBlacklists.xml";
+ string config = data_path + "saml2/metadata/XMLWithExcludes.xml";
ifstream in(config.c_str());
DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
XercesJanitor<DOMDocument> janitor(doc);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list