From: scantor Date: Tue, 5 Jun 2012 19:33:42 +0000 (+0000) Subject: https://issues.shibboleth.net/jira/browse/SSPCPP-445 X-Git-Tag: 2.5.0~66 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fsp.git;a=commitdiff_plain;h=ce34db72685bfbed36c5a59c45fa44d08ef3bea4 https://issues.shibboleth.net/jira/browse/SSPCPP-445 git-svn-id: https://svn.shibboleth.net/cpp-sp/branches/REL_2@3692 cb58f699-b61c-0410-a6fe-9272a202ed29 --- diff --git a/adfs/adfs.cpp b/adfs/adfs.cpp index 9f52cad..f1191be 100644 --- a/adfs/adfs.cpp +++ b/adfs/adfs.cpp @@ -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 doRequest( const Application& application, diff --git a/shibsp/handler/SessionInitiator.h b/shibsp/handler/SessionInitiator.h index 3643aef..046d0be 100644 --- a/shibsp/handler/SessionInitiator.h +++ b/shibsp/handler/SessionInitiator.h @@ -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 }; diff --git a/shibsp/handler/impl/ChainingSessionInitiator.cpp b/shibsp/handler/impl/ChainingSessionInitiator.cpp index 9a37efd..ecb881c 100644 --- a/shibsp/handler/impl/ChainingSessionInitiator.cpp +++ b/shibsp/handler/impl/ChainingSessionInitiator.cpp @@ -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 diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp index 32fe3a8..7b13888 100644 --- a/shibsp/handler/impl/SAML2SessionInitiator.cpp +++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp @@ -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 doRequest( const Application& application, diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp index b45551d..3b66de0 100644 --- a/shibsp/handler/impl/SessionInitiator.cpp +++ b/shibsp/handler/impl/SessionInitiator.cpp @@ -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; diff --git a/shibsp/handler/impl/Shib1SessionInitiator.cpp b/shibsp/handler/impl/Shib1SessionInitiator.cpp index 1674b66..3715512 100644 --- a/shibsp/handler/impl/Shib1SessionInitiator.cpp +++ b/shibsp/handler/impl/Shib1SessionInitiator.cpp @@ -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 doRequest( const Application& application,