[shibboleth-sp2] 64/82: Get rid of "Native" in names, its just IIS7
Etienne Dysli Metref
edm-guest at moszumanska.debian.org
Thu Nov 16 08:16:26 UTC 2017
This is an automated email from the git hooks/post-receive script.
edm-guest pushed a commit to branch master
in repository shibboleth-sp2.
commit 85ea3e7786db8ef3befdc40fbc215520c6945017
Author: Rod Widdowson <rdw at steadingsoftware.com>
Date: Fri Sep 8 13:50:20 2017 +0100
Get rid of "Native" in names, its just IIS7
---
Projects/vc15/iis7_shib/iis7_shib.vcxproj | 8 +-
Projects/vc15/iis7_shib/iis7_shib.vcxproj.filters | 12 +-
iis7_shib/{NativeRequest.cpp => IIS7Request.cpp} | 54 +++----
iis7_shib/ShibHttpModule.cpp | 6 +-
.../headers/{NativeRequest.hpp => IIS7Request.hpp} | 178 ++++++++++-----------
5 files changed, 129 insertions(+), 129 deletions(-)
diff --git a/Projects/vc15/iis7_shib/iis7_shib.vcxproj b/Projects/vc15/iis7_shib/iis7_shib.vcxproj
index dacb7ac..e5357d4 100644
--- a/Projects/vc15/iis7_shib/iis7_shib.vcxproj
+++ b/Projects/vc15/iis7_shib/iis7_shib.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@@ -198,7 +198,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="..\..\..\iis7_shib\NativeRequest.cpp" />
+ <ClCompile Include="..\..\..\iis7_shib\IIS7Request.cpp" />
<ClCompile Include="..\..\..\iis7_shib\register.cpp" />
<ClCompile Include="..\..\..\iis7_shib\ShibHttpModule.cpp" />
<ClCompile Include="..\..\..\iis7_shib\ShibUser.cpp" />
@@ -217,7 +217,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\iis7_shib\headers\IIS7_shib.hpp" />
- <ClInclude Include="..\..\..\iis7_shib\headers\NativeRequest.hpp" />
+ <ClInclude Include="..\..\..\iis7_shib\headers\IIS7Request.hpp" />
<ClInclude Include="..\..\..\iis7_shib\headers\ShibHttpModule.hpp" />
<ClInclude Include="..\..\..\iis7_shib\headers\ShibUser.hpp" />
<ClInclude Include="..\..\..\iis7_shib\resource.h" />
@@ -225,4 +225,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
diff --git a/Projects/vc15/iis7_shib/iis7_shib.vcxproj.filters b/Projects/vc15/iis7_shib/iis7_shib.vcxproj.filters
index 1e3cdcd..4cb3b61 100644
--- a/Projects/vc15/iis7_shib/iis7_shib.vcxproj.filters
+++ b/Projects/vc15/iis7_shib/iis7_shib.vcxproj.filters
@@ -15,15 +15,15 @@
<ClCompile Include="..\..\..\iis7_shib\ShibUser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\iis7_shib\NativeRequest.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\iis7_shib\ShibHttpModule.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\util\RegistrySignature.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\iis7_shib\IIS7Request.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\Iis7_Shib\iis7_shib.rc">
@@ -34,9 +34,6 @@
<ClInclude Include="..\..\..\iis7_shib\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\..\iis7_shib\headers\NativeRequest.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\..\iis7_shib\headers\IIS7_shib.hpp">
<Filter>Header Files</Filter>
</ClInclude>
@@ -46,5 +43,8 @@
<ClInclude Include="..\..\..\iis7_shib\headers\ShibUser.hpp">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\iis7_shib\headers\IIS7Request.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/iis7_shib/NativeRequest.cpp b/iis7_shib/IIS7Request.cpp
similarity index 89%
rename from iis7_shib/NativeRequest.cpp
rename to iis7_shib/IIS7Request.cpp
index 926ba11..6fab59b 100644
--- a/iis7_shib/NativeRequest.cpp
+++ b/iis7_shib/IIS7Request.cpp
@@ -29,13 +29,13 @@
#include <shibsp/exceptions.h>
#include <codecvt> // 16 bit to 8 bit chars
-#include "NativeRequest.hpp"
+#include "IIS7Request.hpp"
#include "ShibHttpModule.hpp"
#include "ShibUser.hpp"
using namespace Config;
-NativeRequest::NativeRequest(IHttpContext *pHttpContext, IHttpEventProvider *pEventProvider, bool checkUser) : AbstractSPRequest(SHIBSP_LOGCAT ".NATIVE"),
+IIS7Request::IIS7Request(IHttpContext *pHttpContext, IHttpEventProvider *pEventProvider, bool checkUser) : AbstractSPRequest(SHIBSP_LOGCAT ".NATIVE"),
m_ctx(pHttpContext), m_request(pHttpContext->GetRequest()), m_response(pHttpContext->GetResponse()),
m_firsttime(true), m_gotBody(false), m_event(pEventProvider)
{
@@ -147,7 +147,7 @@ NativeRequest::NativeRequest(IHttpContext *pHttpContext, IHttpEventProvider *pEv
}
}
-void NativeRequest::setHeader(const char* name, const char* value)
+void IIS7Request::setHeader(const char* name, const char* value)
{
if (m_useHeaders) {
const string hdr = g_bSafeHeaderNames ? makeSafeHeader(name) : (string(name) + ':');
@@ -176,7 +176,7 @@ void NativeRequest::setHeader(const char* name, const char* value)
}
}
-void NativeRequest::setRemoteUser(const char* user)
+void IIS7Request::setRemoteUser(const char* user)
{
m_remoteUser = user;
// Setting the variable REMOTE_USER fails, so set the Principal if we are called appropriately.
@@ -195,7 +195,7 @@ void NativeRequest::setRemoteUser(const char* user)
}
}
-const vector<string>& NativeRequest::getClientCertificates() const
+const vector<string>& IIS7Request::getClientCertificates() const
// TODO test - all the calls are commented out.
{
if (m_certs.empty()) {
@@ -223,12 +223,12 @@ const vector<string>& NativeRequest::getClientCertificates() const
return m_certs;
}
-const char* NativeRequest::getMethod() const
+const char* IIS7Request::getMethod() const
{
return m_request->GetHttpMethod();
}
-void NativeRequest::clearHeader(const char* rawname, const char* cginame)
+void IIS7Request::clearHeader(const char* rawname, const char* cginame)
{
if (m_useHeaders) {
if (g_checkSpoofing && m_firsttime) {
@@ -253,24 +253,24 @@ void NativeRequest::clearHeader(const char* rawname, const char* cginame)
}
}
-long NativeRequest::returnDecline()
+long IIS7Request::returnDecline()
{
return RQ_NOTIFICATION_CONTINUE;
}
-long NativeRequest::returnOK()
+long IIS7Request::returnOK()
{
return RQ_NOTIFICATION_CONTINUE;
}
-void NativeRequest::log(SPLogLevel level, const string& msg) const
+void IIS7Request::log(SPLogLevel level, const string& msg) const
{
AbstractSPRequest::log(level, msg);
if (level >= SPCrit)
LogEvent(nullptr, EVENTLOG_ERROR_TYPE, SHIB_NATIVE_CRITICAL, nullptr, msg.c_str());
}
-string NativeRequest::getRemoteAddr() const
+string IIS7Request::getRemoteAddr() const
{
string ret = AbstractSPRequest::getRemoteAddr();
if (ret.empty()) {
@@ -284,7 +284,7 @@ string NativeRequest::getRemoteAddr() const
return ret;
}
-string NativeRequest::getSecureHeader(const char* name) const
+string IIS7Request::getSecureHeader(const char* name) const
{
string hdr = g_bSafeHeaderNames ? makeSafeHeader(name) : (string(name) + ':');
PCSTR p = m_request->GetHeader(hdr.c_str());
@@ -293,22 +293,22 @@ string NativeRequest::getSecureHeader(const char* name) const
//
// XMLTooling::GenericRequest
//
-const char* NativeRequest::getScheme() const
+const char* IIS7Request::getScheme() const
{
return m_SSL ? "https" : "http";
}
-const char* NativeRequest::getHostname() const
+const char* IIS7Request::getHostname() const
{
return m_hostname.c_str();
}
-int NativeRequest::getPort() const
+int IIS7Request::getPort() const
{
return m_port;
}
-string NativeRequest::getContentType() const
+string IIS7Request::getContentType() const
{
PCSTR type;
DWORD len;
@@ -319,7 +319,7 @@ string NativeRequest::getContentType() const
return "";
}
-long NativeRequest::getContentLength() const
+long IIS7Request::getContentLength() const
{
PCSTR length;
DWORD len;
@@ -330,7 +330,7 @@ long NativeRequest::getContentLength() const
return 0;
}
-string NativeRequest::getRemoteUser() const
+string IIS7Request::getRemoteUser() const
{
if (!m_remoteUser.empty()) {
return m_remoteUser;
@@ -340,7 +340,7 @@ string NativeRequest::getRemoteUser() const
return m_remoteUser;
}
-const char* NativeRequest::getRequestBody() const
+const char* IIS7Request::getRequestBody() const
{
if (m_gotBody) {
return m_body.c_str();
@@ -373,7 +373,7 @@ const char* NativeRequest::getRequestBody() const
//
// XMLTooing:: HTTPRequest
//
-const char* NativeRequest::getQueryString() const
+const char* IIS7Request::getQueryString() const
{
PCSTR qs;
DWORD len;
@@ -384,14 +384,14 @@ const char* NativeRequest::getQueryString() const
return "";
}
-string NativeRequest::getHeader(const char* name) const
+string IIS7Request::getHeader(const char* name) const
{
PCSTR p = m_request->GetHeader(name);
return (nullptr == p) ? "" : p;
}
// XMLTooing:: HTTPResponse, GenericResponse
-long NativeRequest::sendResponse(istream& in, long status)
+long IIS7Request::sendResponse(istream& in, long status)
{
const char* codestr="200 OK";
switch (status) {
@@ -431,7 +431,7 @@ long NativeRequest::sendResponse(istream& in, long status)
}
// XMLTooing:: HTTPResponse
-void NativeRequest::setResponseHeader(const char* name, const char* value)
+void IIS7Request::setResponseHeader(const char* name, const char* value)
{
HTTPResponse::setResponseHeader(name, value);
@@ -449,7 +449,7 @@ void NativeRequest::setResponseHeader(const char* name, const char* value)
}
}
-long NativeRequest::sendRedirect(const char* url)
+long IIS7Request::sendRedirect(const char* url)
{
HTTPResponse::sendRedirect(url);
HRESULT hr = m_response->Redirect(url);
@@ -460,7 +460,7 @@ long NativeRequest::sendRedirect(const char* url)
return RQ_NOTIFICATION_FINISH_REQUEST;
}
-string NativeRequest::makeSafeHeader(const char* rawname) const
+string IIS7Request::makeSafeHeader(const char* rawname) const
{
string hdr;
for (; *rawname; ++rawname) {
@@ -471,7 +471,7 @@ string NativeRequest::makeSafeHeader(const char* rawname) const
}
// TODO We need a strategy for what is logged, what is fatal and how.
-void NativeRequest::logFatal(const string& operation, HRESULT hr) const
+void IIS7Request::logFatal(const string& operation, HRESULT hr) const
{
string msg(operation + " failed: " + lexical_cast<string>(hr));
LogEvent(nullptr, EVENTLOG_ERROR_TYPE, SHIB_NATIVE_CRITICAL, nullptr, msg.c_str());
@@ -480,7 +480,7 @@ void NativeRequest::logFatal(const string& operation, HRESULT hr) const
}
}
-void NativeRequest::throwError(const string& operation, HRESULT hr) const
+void IIS7Request::throwError(const string& operation, HRESULT hr) const
{
string msg(operation + " failed: " + lexical_cast<string>(hr));
throw IOException(msg.c_str());
diff --git a/iis7_shib/ShibHttpModule.cpp b/iis7_shib/ShibHttpModule.cpp
index 74fe7a2..88b2e69 100644
--- a/iis7_shib/ShibHttpModule.cpp
+++ b/iis7_shib/ShibHttpModule.cpp
@@ -24,7 +24,7 @@
#include <xmltooling/util/NDC.h>
#include "ShibHttpModule.hpp"
-#include "NativeRequest.hpp"
+#include "IIS7Request.hpp"
using namespace Config;
@@ -39,7 +39,7 @@ ShibHttpModule::DoHandler(
xmltooling::NDC ndc(threadid.c_str());
// TODO the handler and the Filter both use the same class. Should it?
- NativeRequest handler(pHttpContext, pProvider, false);
+ IIS7Request handler(pHttpContext, pProvider, false);
pair<bool, long> res = handler.getServiceProvider().doHandler(handler);
@@ -62,7 +62,7 @@ ShibHttpModule::DoFilter(
xmltooling::NDC ndc(threadid.c_str());
// TODO Different class?
- NativeRequest filter(pHttpContext, pProvider, true);
+ IIS7Request filter(pHttpContext, pProvider, true);
pair<bool, long> res = filter.getServiceProvider().doAuthentication(filter);
if (res.first) {
diff --git a/iis7_shib/headers/NativeRequest.hpp b/iis7_shib/headers/IIS7Request.hpp
similarity index 91%
rename from iis7_shib/headers/NativeRequest.hpp
rename to iis7_shib/headers/IIS7Request.hpp
index 135b2e2..310e3d2 100644
--- a/iis7_shib/headers/NativeRequest.hpp
+++ b/iis7_shib/headers/IIS7Request.hpp
@@ -1,89 +1,89 @@
-/**
-* Licensed to the University Corporation for Advanced Internet
-* Development, Inc. (UCAID) under one or more contributor license
-* agreements. See the NOTICE file distributed with this work for
-* additional information regarding copyright ownership.
-*
-* UCAID licenses this file to you under the Apache License,
-* Version 2.0 (the "License"); you may not use this file except
-* in compliance with the License. You may obtain a copy of the
-* License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-* either express or implied. See the License for the specific
-* language governing permissions and limitations under the License.
-*/
-#pragma once
-
-#include <shibsp/AbstractSPRequest.h>
-
-class NativeRequest : public AbstractSPRequest {
-
-private:
- IHttpContext *m_ctx;
- IHttpRequest *m_request;
- IHttpResponse *m_response;
- IHttpEventProvider *m_event;
- bool m_firsttime;
- // TODO
- int m_port;
- string m_hostname;
- bool m_SSL;
- bool m_useVariables;
- bool m_useHeaders;
- mutable string m_remoteUser;
- mutable vector<string> m_certs;
- mutable string m_body;
- mutable bool m_gotBody;
- string m_allhttp;
- set<wstring> m_roles;
-
-public:
- NativeRequest(_In_ IHttpContext *pHttpContext, _In_ IHttpEventProvider *pEventProvider, _In_ bool checkUser);
- string makeSafeHeader(const char* rawname) const;
- bool isUseHeaders() { return m_useHeaders; }
-
-protected:
- //
- // AbstractSP
- //
- void setHeader(const char* name, const char* value);
- void setRemoteUser(const char* user);
- const vector<string>& getClientCertificates() const;
- const char* getMethod() const;
- void clearHeader(const char* rawname, const char* cginame);
- long returnDecline();
- long returnOK();
- void log(SPLogLevel level, const string& msg) const;
- string getRemoteAddr() const;
- string getSecureHeader(const char* name) const;
- //
- // XMLTooling::GenericRequest
- //
- const char* getScheme() const;
- const char* getHostname() const;
- int getPort() const;
- string getContentType() const;
- long getContentLength() const;
- string getRemoteUser() const;
- const char* getRequestBody() const;
- //
- // XMLTooing:: HTTPRequest
- //
- const char* getQueryString() const;
- string getHeader(const char* name) const;
-
- // XMLTooing:: HTTPResponse, GenericResponse
- long sendResponse(istream& in, long status);
- void setResponseHeader(const char* name, const char* value);
- long sendRedirect(const char* url);
-
-private:
- void logFatal(const string& operation, HRESULT hr) const;
- void throwError(const string& operation, HRESULT hr) const;
-
-};
+/**
+* Licensed to the University Corporation for Advanced Internet
+* Development, Inc. (UCAID) under one or more contributor license
+* agreements. See the NOTICE file distributed with this work for
+* additional information regarding copyright ownership.
+*
+* UCAID licenses this file to you under the Apache License,
+* Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the
+* License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+* either express or implied. See the License for the specific
+* language governing permissions and limitations under the License.
+*/
+#pragma once
+
+#include <shibsp/AbstractSPRequest.h>
+
+class IIS7Request : public AbstractSPRequest {
+
+private:
+ IHttpContext *m_ctx;
+ IHttpRequest *m_request;
+ IHttpResponse *m_response;
+ IHttpEventProvider *m_event;
+ bool m_firsttime;
+ // TODO
+ int m_port;
+ string m_hostname;
+ bool m_SSL;
+ bool m_useVariables;
+ bool m_useHeaders;
+ mutable string m_remoteUser;
+ mutable vector<string> m_certs;
+ mutable string m_body;
+ mutable bool m_gotBody;
+ string m_allhttp;
+ set<wstring> m_roles;
+
+public:
+ IIS7Request(_In_ IHttpContext *pHttpContext, _In_ IHttpEventProvider *pEventProvider, _In_ bool checkUser);
+ string makeSafeHeader(const char* rawname) const;
+ bool isUseHeaders() { return m_useHeaders; }
+
+protected:
+ //
+ // AbstractSP
+ //
+ void setHeader(const char* name, const char* value);
+ void setRemoteUser(const char* user);
+ const vector<string>& getClientCertificates() const;
+ const char* getMethod() const;
+ void clearHeader(const char* rawname, const char* cginame);
+ long returnDecline();
+ long returnOK();
+ void log(SPLogLevel level, const string& msg) const;
+ string getRemoteAddr() const;
+ string getSecureHeader(const char* name) const;
+ //
+ // XMLTooling::GenericRequest
+ //
+ const char* getScheme() const;
+ const char* getHostname() const;
+ int getPort() const;
+ string getContentType() const;
+ long getContentLength() const;
+ string getRemoteUser() const;
+ const char* getRequestBody() const;
+ //
+ // XMLTooing:: HTTPRequest
+ //
+ const char* getQueryString() const;
+ string getHeader(const char* name) const;
+
+ // XMLTooing:: HTTPResponse, GenericResponse
+ long sendResponse(istream& in, long status);
+ void setResponseHeader(const char* name, const char* value);
+ long sendRedirect(const char* url);
+
+private:
+ void logFatal(const string& operation, HRESULT hr) const;
+ void throwError(const string& operation, HRESULT hr) const;
+
+};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/shibboleth-sp2.git
More information about the Pkg-shibboleth-devel
mailing list