https://issues.shibboleth.net/jira/browse/SSPCPP-445
authorscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 5 Jun 2012 19:33:42 +0000 (19:33 +0000)
committerscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 5 Jun 2012 19:33:42 +0000 (19:33 +0000)
git-svn-id: https://svn.shibboleth.net/cpp-sp/branches/REL_2@3692 cb58f699-b61c-0410-a6fe-9272a202ed29

adfs/adfs.cpp
shibsp/handler/SessionInitiator.h
shibsp/handler/impl/ChainingSessionInitiator.cpp
shibsp/handler/impl/SAML2SessionInitiator.cpp
shibsp/handler/impl/SessionInitiator.cpp
shibsp/handler/impl/Shib1SessionInitiator.cpp

index 9f52cad..f1191be 100644 (file)
@@ -154,6 +154,12 @@ namespace {
             return m_binding.get();
         }
 
+#ifndef SHIBSP_LITE
+        void generateMetadata(saml2md::SPSSODescriptor& role, const char* handlerURL) const {
+            doGenerateMetadata(role, handlerURL);
+        }
+#endif
+
     private:
         pair<bool,long> doRequest(
             const Application& application,
index 3643aef..046d0be 100644 (file)
@@ -108,6 +108,15 @@ namespace shibsp {
 #ifndef SHIBSP_LITE
         const char* getType() const;
         void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const;
+
+        /**
+         * Generates RequestInitiator metadata when instructed. Allows subclasses to decide whether it's
+         * appropriate to do so instead of requiring them to override the method to stop it.
+         *
+         * @param role          role object to inject metadata into
+         * @param handlerURL    base of endpoint to generate metadata with
+         */
+        void doGenerateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const;
 #endif
     };
     
index 9a37efd..ecb881c 100644 (file)
@@ -57,7 +57,7 @@ namespace shibsp {
 
 #ifndef SHIBSP_LITE
         void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const {
-            SessionInitiator::generateMetadata(role, handlerURL);
+            doGenerateMetadata(role, handlerURL);   // assumes all chains support the RequestInitiator protocol
             for_each(m_handlers.begin(), m_handlers.end(), boost::bind(&SessionInitiator::generateMetadata, _1, boost::ref(role), handlerURL));
         }
 #endif
index 32fe3a8..7b13888 100644 (file)
@@ -84,6 +84,12 @@ namespace shibsp {
             return samlconstants::SAML20P_NS;
         }
 
+#ifndef SHIBSP_LITE
+        void generateMetadata(saml2md::SPSSODescriptor& role, const char* handlerURL) const {
+            doGenerateMetadata(role, handlerURL);
+        }
+#endif
+
     private:
         pair<bool,long> doRequest(
             const Application& application,
index b45551d..3b66de0 100644 (file)
@@ -82,6 +82,11 @@ const char* SessionInitiator::getType() const
 
 void SessionInitiator::generateMetadata(SPSSODescriptor& role, const char* handlerURL) const
 {
+    // In case any plugins were directly calling this before, we stub it out.
+}
+
+void SessionInitiator::doGenerateMetadata(SPSSODescriptor& role, const char* handlerURL) const
+{
     if (getParent())
         return;
     const char* loc = getString("Location").second;
index 1674b66..3715512 100644 (file)
@@ -83,6 +83,12 @@ namespace shibsp {
             return samlconstants::SAML11_PROTOCOL_ENUM;
         }
 
+#ifndef SHIBSP_LITE
+        void generateMetadata(saml2md::SPSSODescriptor& role, const char* handlerURL) const {
+            doGenerateMetadata(role, handlerURL);
+        }
+#endif
+
     private:
         pair<bool,long> doRequest(
             const Application& application,