-<?xml version="1.0" encoding="UTF-8"?>\r
-<?fileVersion 4.0.0?>\r
-\r
-<cproject>\r
+<?xml version="1.0" encoding="UTF-8"?><?fileVersion 4.0.0?><cproject>\r
<storageModule moduleId="org.eclipse.cdt.core.settings">\r
<cconfiguration id="converted.config.2133715230">\r
<storageModule moduleId="scannerConfiguration">\r
</extensions>\r
</storageModule>\r
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>\r
+\r
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
<storageModule moduleId="org.eclipse.cdt.core.pathentry">\r
+<pathentry kind="mac" name="_MSC_VER" path="" value=""/>\r
+<pathentry kind="mac" name="WIN32" path="" value=""/>\r
+<pathentry include="C:/xerces-c_2_8_0-x86-windows-vc_8_0/include" kind="inc" path="" system="true"/>\r
+<pathentry include="C:/xml-security-c-1.4.0/include" kind="inc" path="" system="true"/>\r
+<pathentry include="C:/log4shib-1.0/include" kind="inc" path="" system="true"/>\r
+<pathentry include="C:/cxxtest" kind="inc" path="" system="true"/>\r
<pathentry kind="out" path=""/>\r
<pathentry kind="out" path="debug"/>\r
<pathentry kind="out" path="saml/Debug"/>\r
<pathentry kind="src" path="samltest/saml2/metadata"/>\r
<pathentry kind="src" path="samltest/security"/>\r
<pathentry kind="src" path="samltest/signature"/>\r
-<pathentry kind="mac" name="_MSC_VER" path="" value=""/>\r
-<pathentry kind="mac" name="WIN32" path="" value=""/>\r
-<pathentry base-path="OpenSAML2-C" include="" kind="inc" path="" system="true"/>\r
-<pathentry base-path="OpenSAML2-C" include="saml" kind="inc" path="" system="true"/>\r
-<pathentry base-path="XMLTooling-C" include="" kind="inc" path="" system="true"/>\r
-<pathentry include="C:/xerces-c2_7_0-win32/include" kind="inc" path="" system="true"/>\r
-<pathentry include="C:/xml-security-c-1.2.0/include" kind="inc" path="" system="true"/>\r
-<pathentry include="C:/log4cpp-0.3.5rc1/include" kind="inc" path="" system="true"/>\r
-<pathentry include="C:/cxxtest" kind="inc" path="" system="true"/>\r
<pathentry kind="src" path="samltest/encryption"/>\r
<pathentry kind="src" path="samlsign"/>\r
</storageModule>\r
-<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
</cconfiguration>\r
</storageModule>\r
</cproject>\r
saml2/metadata/impl/MetadataImpl.cpp \
saml2/metadata/impl/MetadataProvider.cpp \
saml2/metadata/impl/MetadataSchemaValidators.cpp \
+ saml2/metadata/impl/NullMetadataProvider.cpp \
saml2/metadata/impl/SignatureMetadataFilter.cpp \
saml2/metadata/impl/WhitelistMetadataFilter.cpp \
saml2/metadata/impl/XMLMetadataProvider.cpp \
>\r
</File>\r
<File\r
+ RelativePath=".\saml2\metadata\impl\NullMetadataProvider.cpp"\r
+ >\r
+ </File>\r
+ <File\r
RelativePath=".\saml2\metadata\impl\SignatureMetadataFilter.cpp"\r
>\r
</File>\r
* This is customized to return a SubjectConfirmationData element with an
* xsi:type of KeyInfoConfirmationDataType.
*/
- class SAML_API KeyInfoConfirmationDataTypeBuilder : public xmltooling::XMLObjectBuilder {
+ class SAML_API KeyInfoConfirmationDataTypeBuilder : public xmltooling::ConcreteXMLObjectBuilder {
public:
virtual ~KeyInfoConfirmationDataTypeBuilder() {}
/** Default builder. */
* This is customized to return a RoleDescriptor element with an
* xsi:type of AuthnQueryDescriptorType.
*/
- class SAML_API AuthnQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
+ class SAML_API AuthnQueryDescriptorTypeBuilder : public xmltooling::ConcreteXMLObjectBuilder {
public:
virtual ~AuthnQueryDescriptorTypeBuilder() {}
/** Default builder. */
* This is customized to return a RoleDescriptor element with an
* xsi:type of AttributeQueryDescriptorType.
*/
- class SAML_API AttributeQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
+ class SAML_API AttributeQueryDescriptorTypeBuilder : public xmltooling::ConcreteXMLObjectBuilder {
public:
virtual ~AttributeQueryDescriptorTypeBuilder() {}
/** Default builder. */
* This is customized to return a RoleDescriptor element with an
* xsi:type of AuthzDecisionQueryDescriptorType.
*/
- class SAML_API AuthzDecisionQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
+ class SAML_API AuthzDecisionQueryDescriptorTypeBuilder : public xmltooling::ConcreteXMLObjectBuilder {
public:
virtual ~AuthzDecisionQueryDescriptorTypeBuilder() {}
/** Default builder. */
/** MetadataProvider that wraps a sequence of metadata providers. */
#define CHAINING_METADATA_PROVIDER "Chaining"
+ /** MetadataProvider that returns an empty "dummy" entity descriptor. */
+ #define NULL_METADATA_PROVIDER "Null"
+
DECL_XMLTOOLING_EXCEPTION(MetadataException,SAML_EXCEPTIONAPI(SAML_API),opensaml::saml2md,xmltooling::XMLToolingException,Exceptions related to metadata use);
};
};
/**
* DynamicMetadataProvider.cpp
*
- * Base class for caching metadata providers.
+ * Simple implementation of a dynamic caching MetadataProvider.
*/
#include "internal.h"
SAML_DLLLOCAL PluginManager<MetadataProvider,string,const DOMElement*>::Factory XMLMetadataProviderFactory;
SAML_DLLLOCAL PluginManager<MetadataProvider,string,const DOMElement*>::Factory DynamicMetadataProviderFactory;
SAML_DLLLOCAL PluginManager<MetadataProvider,string,const DOMElement*>::Factory ChainingMetadataProviderFactory;
+ SAML_DLLLOCAL PluginManager<MetadataProvider,string,const DOMElement*>::Factory NullMetadataProviderFactory;
SAML_DLLLOCAL PluginManager<MetadataFilter,string,const DOMElement*>::Factory BlacklistMetadataFilterFactory;
SAML_DLLLOCAL PluginManager<MetadataFilter,string,const DOMElement*>::Factory WhitelistMetadataFilterFactory;
SAML_DLLLOCAL PluginManager<MetadataFilter,string,const DOMElement*>::Factory SignatureMetadataFilterFactory;
conf.MetadataProviderManager.registerFactory(XML_METADATA_PROVIDER, XMLMetadataProviderFactory);
conf.MetadataProviderManager.registerFactory(DYNAMIC_METADATA_PROVIDER, DynamicMetadataProviderFactory);
conf.MetadataProviderManager.registerFactory(CHAINING_METADATA_PROVIDER, ChainingMetadataProviderFactory);
+ conf.MetadataProviderManager.registerFactory(NULL_METADATA_PROVIDER, NullMetadataProviderFactory);
}
void SAML_API opensaml::saml2md::registerMetadataFilters()
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * NullMetadataProvider.cpp
+ *
+ * Dummy provider that returns an empty entity supporting any role.
+ */
+
+#include "internal.h"
+#include "saml2/metadata/Metadata.h"
+#include "saml2/metadata/DynamicMetadataProvider.h"
+
+#include <xmltooling/util/XMLHelper.h>
+
+using namespace opensaml::saml2md;
+using namespace xmltooling;
+using namespace std;
+
+namespace opensaml {
+ namespace saml2md {
+ class SAML_DLLLOCAL NullMetadataProvider : public DynamicMetadataProvider
+ {
+ public:
+ NullMetadataProvider(const DOMElement* e) : DynamicMetadataProvider(e), m_template(NULL) {
+ e = XMLHelper::getFirstChildElement(e, samlconstants::SAML20MD_NS, EntityDescriptor::LOCAL_NAME);
+ if (e)
+ m_template = dynamic_cast<EntityDescriptor*>(XMLObjectBuilder::buildOneFromElement(const_cast<DOMElement*>(e)));
+ }
+
+ virtual ~NullMetadataProvider() {
+ delete m_template;
+ }
+
+ protected:
+ EntityDescriptor* resolve(const char* entityID) const;
+
+ private:
+ EntityDescriptor* m_template;
+ };
+
+ MetadataProvider* SAML_DLLLOCAL NullMetadataProviderFactory(const DOMElement* const & e)
+ {
+ return new NullMetadataProvider(e);
+ }
+ };
+};
+
+EntityDescriptor* NullMetadataProvider::resolve(const char* entityID) const
+{
+ // Resolving for us just means fabricating a new dummy element.
+ EntityDescriptor* entity = m_template ? m_template->cloneEntityDescriptor() : EntityDescriptorBuilder::buildEntityDescriptor();
+ auto_ptr_XMLCh temp(entityID);
+ entity->setEntityID(temp.get());
+ return entity;
+}