X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=samltest%2Fbinding.h;h=cdaa3bc1451654fa0c2bada70728e1ec5a98ff97;hb=b77db92eb98aa1692101a1823fdf0ea700dd35e4;hp=2947a49c1063b491e1a243e5d341fc848afaada3;hpb=86e185cf72d47f6d3250414f7451ece13e7b7ec5;p=shibboleth%2Fcpp-opensaml.git diff --git a/samltest/binding.h b/samltest/binding.h index 2947a49..cdaa3bc 100644 --- a/samltest/binding.h +++ b/samltest/binding.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Internet2 + * 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. @@ -17,17 +17,18 @@ #include "internal.h" #include -#include -#include #include #include #include -#include #include #include +#include +#include #include +#include using namespace opensaml::saml2md; +using namespace opensaml; using namespace xmlsignature; class SAMLBindingBaseTestCase : public HTTPRequest, public HTTPResponse @@ -126,8 +127,12 @@ public: return "https"; } - bool isSecure() const { - return true; + const char* getHostname() const { + return "localhost"; + } + + int getPort() const { + return 443; } string getContentType() const { @@ -138,6 +143,10 @@ public: return -1; } + const char* getRequestURI() const { + return "/"; + } + const char* getRequestURL() const { return m_url.c_str(); } @@ -182,18 +191,10 @@ public: // HTTPResponse methods - void setHeader(const char* name, const char* value) { + void setResponseHeader(const char* name, const char* value) { m_headers[name] = value ? value : ""; } - void setContentType(const char* type) { - setHeader("Content-Type", type); - } - - void setCookie(const char* name, const char* value) { - m_headers["Set-Cookie"] = string(name) + "=" + (value ? value : ""); - } - // The amount of error checking missing from this is incredible, but as long // as the test data isn't unexpected or malformed, it should work. @@ -212,7 +213,7 @@ public: pch=strchr(pch,'&'); if (pch) *pch++=0; - SAMLConfig::getConfig().getURLEncoder()->decode(value); + XMLToolingConfig::getConfig().getURLEncoder()->decode(value); m_fields[name] = value; name = pch; } @@ -248,13 +249,7 @@ public: return decoded; } - long sendResponse(std::istream& inputStream) { - return sendResponse(inputStream, HTTPResponse::SAML_HTTP_STATUS_OK); - } - - long sendError(std::istream& inputStream) { - return sendResponse(inputStream, HTTPResponse::SAML_HTTP_STATUS_ERROR); - } + using HTTPResponse::sendResponse; long sendResponse(std::istream& inputStream, long status) { m_method="POST";