/*\r
- * Copyright 2001-2006 Internet2\r
+ * Copyright 2001-2007 Internet2\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
#include "internal.h"\r
\r
#include <saml/SAMLConfig.h>\r
-#include <saml/binding/HTTPRequest.h>\r
-#include <saml/binding/HTTPResponse.h>\r
#include <saml/binding/MessageDecoder.h>\r
#include <saml/binding/MessageEncoder.h>\r
-#include <saml/binding/URLEncoder.h>\r
+#include <saml/binding/SecurityPolicyRule.h>\r
#include <saml/saml2/metadata/Metadata.h>\r
#include <saml/saml2/metadata/MetadataProvider.h>\r
+#include <xmltooling/io/HTTPRequest.h>\r
+#include <xmltooling/io/HTTPResponse.h>\r
#include <xmltooling/security/TrustEngine.h>\r
+#include <xmltooling/util/URLEncoder.h>\r
\r
using namespace opensaml::saml2md;\r
+using namespace opensaml;\r
using namespace xmlsignature;\r
\r
class SAMLBindingBaseTestCase : public HTTPRequest, public HTTPResponse\r
doc->getDocumentElement()->setAttributeNS(NULL,path.get(),file.get());\r
\r
m_metadata = SAMLConfig::getConfig().MetadataProviderManager.newPlugin(\r
- FILESYSTEM_METADATA_PROVIDER,doc->getDocumentElement()\r
+ XML_METADATA_PROVIDER,doc->getDocumentElement()\r
);\r
m_metadata->init();\r
\r
return "https";\r
}\r
\r
- bool isSecure() const {\r
- return true;\r
+ const char* getHostname() const {\r
+ return "localhost";\r
+ }\r
+\r
+ int getPort() const {\r
+ return 443;\r
}\r
\r
string getContentType() const {\r
return -1;\r
}\r
\r
+ const char* getRequestURI() const {\r
+ return "/";\r
+ }\r
+\r
const char* getRequestURL() const {\r
return m_url.c_str();\r
}\r
\r
// HTTPResponse methods\r
\r
- void setHeader(const char* name, const char* value) {\r
+ void setResponseHeader(const char* name, const char* value) {\r
m_headers[name] = value ? value : "";\r
}\r
\r
- void setContentType(const char* type) {\r
- setHeader("Content-Type", type);\r
- }\r
- \r
- void setCookie(const char* name, const char* value) {\r
- m_headers["Set-Cookie"] = string(name) + "=" + (value ? value : "");\r
- }\r
- \r
// The amount of error checking missing from this is incredible, but as long\r
// as the test data isn't unexpected or malformed, it should work.\r
\r
pch=strchr(pch,'&');\r
if (pch)\r
*pch++=0;\r
- SAMLConfig::getConfig().getURLEncoder()->decode(value);\r
+ XMLToolingConfig::getConfig().getURLEncoder()->decode(value);\r
m_fields[name] = value;\r
name = pch; \r
}\r
return decoded;\r
}\r
\r
- long sendResponse(std::istream& inputStream) {\r
- return sendResponse(inputStream, HTTPResponse::SAML_HTTP_STATUS_OK);\r
- }\r
-\r
- long sendError(std::istream& inputStream) {\r
- return sendResponse(inputStream, HTTPResponse::SAML_HTTP_STATUS_ERROR);\r
- }\r
+ using HTTPResponse::sendResponse;\r
\r
long sendResponse(std::istream& inputStream, long status) {\r
m_method="POST";\r