From: cantor Date: Sat, 18 Sep 2010 22:27:46 +0000 (+0000) Subject: Implement basic methods, add subclass for the guts. X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fresolver.git;a=commitdiff_plain;h=ebc845ceb5411c95de71a8d7842f68283da60385 Implement basic methods, add subclass for the guts. git-svn-id: https://svn.middleware.georgetown.edu/shib-extension/cpp-sp-resolver/trunk@265 3ebe4818-3638-0410-822d-ece5924dabe2 --- diff --git a/shibresolver/resolver.cpp b/shibresolver/resolver.cpp index dbe3968..9a95fe8 100644 --- a/shibresolver/resolver.cpp +++ b/shibresolver/resolver.cpp @@ -22,6 +22,11 @@ #include "internal.h" +#include +#include +#include + +using namespace shibresolver; using namespace shibsp; #ifndef SHIBSP_LITE using namespace opensaml; @@ -29,6 +34,92 @@ using namespace opensaml; using namespace xmltooling; using namespace std; +namespace shibresolver { + class SHIBRESOLVER_DLLLOCAL ResolverImpl : public ShibbolethResolver, public Remoted { + public: + ResolverImpl() {} + ~ResolverImpl() {} + + void resolve(); + void receive(DDF& in, ostream& out); + }; +}; + +ShibbolethResolver* ShibbolethResolver::create() +{ + return new ResolverImpl(); +} + +ShibbolethResolver::ShibbolethResolver() +{ +} + +ShibbolethResolver::~ShibbolethResolver() +{ + for_each(m_resolvedAttributes.begin(), m_resolvedAttributes.end(), xmltooling::cleanup()); + if (m_mapper) + m_mapper->unlock(); + if (m_sp) + m_sp->unlock(); +} + +void ShibbolethResolver::setServiceURI(const char* uri) +{ + m_serviceURI.erase(); + if (uri) + m_serviceURI = uri; +} + +void ShibbolethResolver::setApplicationID(const char* appID) +{ + m_appID.erase(); + if (appID) + m_appID = appID; +} + +void ShibbolethResolver::setIssuer(const char* issuer) +{ + m_issuer.erase(); + if (issuer) + m_issuer = issuer; +} + +void ShibbolethResolver::addToken( +#ifdef SHIBSP_LITE + const XMLObject* token +#else + const saml2::Assertion* token +#endif + ) +{ + if (token) + m_tokens.push_back(token); +} + +void ShibbolethResolver::addAttribute(Attribute* attr) +{ + if (attr) + m_inputAttributes.push_back(attr); +} + +vector& ShibbolethResolver::getResolvedAttributes() +{ + return m_resolvedAttributes; +} + +RequestMapper::Settings ShibbolethResolver::getSettings() const +{ + return m_settings; +} + +void ResolverImpl::resolve() +{ +} + +void ResolverImpl::receive(DDF& in, ostream& out) +{ +} + extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*) { // Register factory functions with appropriate plugin managers in the XMLTooling/SAML/SPConfig objects. diff --git a/shibresolver/resolver.h b/shibresolver/resolver.h index 610ea46..947e8ab 100644 --- a/shibresolver/resolver.h +++ b/shibresolver/resolver.h @@ -125,7 +125,7 @@ namespace shibresolver { * * @return array of resolved Attributes */ - std::vector& getResolvedAttributes() const; + std::vector& getResolvedAttributes(); /** * Returns mapped PropertySet and AccessControl objects, if any.