Skip to content

Commit 9be1a1b

Browse files
committed
Disabled all the oauth1 public apis for xp project.
1 parent d9e2b4b commit 9be1a1b

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

Release/include/cpprest/http_client.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ namespace pplx = Concurrency;
5858
#include "cpprest/web_utilities.h"
5959
#include "cpprest/basic_types.h"
6060
#include "cpprest/asyncrt_utils.h"
61+
62+
#if !defined(CPPREST_TARGET_XP) && !defined(_PHONE8_)
6163
#include "cpprest/oauth1.h"
64+
#endif
65+
6266
#include "cpprest/oauth2.h"
6367

6468
namespace web
@@ -107,6 +111,7 @@ class http_client_config
107111
{
108112
}
109113

114+
#if !defined(CPPREST_TARGET_XP) && !defined(_PHONE8_)
110115
/// <summary>
111116
/// Get OAuth 1.0 configuration.
112117
/// </summary>
@@ -124,6 +129,7 @@ class http_client_config
124129
{
125130
m_oauth1 = std::make_shared<oauth1::experimental::oauth1_config>(std::move(config));
126131
}
132+
#endif
127133

128134
/// <summary>
129135
/// Get OAuth 2.0 configuration.
@@ -289,7 +295,10 @@ class http_client_config
289295
}
290296

291297
private:
298+
#if !defined(CPPREST_TARGET_XP) && !defined(_PHONE8_)
292299
std::shared_ptr<oauth1::experimental::oauth1_config> m_oauth1;
300+
#endif // !defined(CPPREST_TARGET_XP) && !defined(_PHONE8_)
301+
293302
std::shared_ptr<oauth2::experimental::oauth2_config> m_oauth2;
294303
web_proxy m_proxy;
295304
http::client::credentials m_credentials;

Release/include/cpprest/http_client_impl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,11 @@ void http_client::build_pipeline(uri base_uri, http_client_config client_config)
460460
details::verify_uri(base_uri);
461461

462462
std::vector<std::shared_ptr<http::http_pipeline_stage> > extra_handlers;
463+
464+
#if !defined(CPPREST_TARGET_XP) && !defined(_PHONE8_)
463465
extra_handlers.push_back(std::make_shared<oauth1::details::oauth1_handler>(client_config.oauth1()));
466+
#endif // !defined(CPPREST_TARGET_XP) && !defined(_PHONE8_)
467+
464468
extra_handlers.push_back(std::make_shared<oauth2::details::oauth2_handler>(client_config.oauth2()));
465469

466470
m_pipeline = ::web::http::http_pipeline::create_pipeline(std::make_shared<details::http_network_handler>(std::move(base_uri), std::move(client_config)));

Release/src/build/sources.proj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@
138138
<ClInclude Include="$(CasablancaIncludeDir)\cpprest\http_client_impl.h">
139139
<Filter>Header Files\cpprest</Filter>
140140
</ClInclude>
141-
<ClInclude Include="$(CasablancaIncludeDir)\cpprest\oauth1.h">
142-
<Filter>Header Files\cpprest</Filter>
143-
</ClInclude>
144141
<ClInclude Include="$(CasablancaIncludeDir)\cpprest\oauth2.h">
145142
<Filter>Header Files\cpprest</Filter>
146143
</ClInclude>
@@ -161,9 +158,6 @@
161158
<ClCompile Include="$(CasablancaSrcDir)\http\common\http_msg.cpp">
162159
<Filter>Source Files</Filter>
163160
</ClCompile>
164-
<ClCompile Include="$(CasablancaSrcDir)\http\oauth\oauth1.cpp">
165-
<Filter>Source Files</Filter>
166-
</ClCompile>
167161
<ClCompile Include="$(CasablancaSrcDir)\http\oauth\oauth2.cpp">
168162
<Filter>Source Files</Filter>
169163
</ClCompile>
@@ -222,6 +216,12 @@
222216
</ClInclude>
223217
<ClCompile Include="$(CasablancaSrcDir)\http\listener\http_msg_listen.cpp">
224218
<Filter>Source Files</Filter>
219+
</ClCompile>
220+
<ClInclude Include="$(CasablancaIncludeDir)\cpprest\oauth1.h">
221+
<Filter>Header Files\cpprest</Filter>
222+
</ClInclude>
223+
<ClCompile Include="$(CasablancaSrcDir)\http\oauth\oauth1.cpp">
224+
<Filter>Source Files</Filter>
225225
</ClCompile>
226226
</ItemGroup>
227227

Release/src/http/oauth/oauth1.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,7 @@ namespace experimental
5454
//
5555
// Start of platform-dependent _hmac_sha1() block...
5656
//
57-
#if _WIN32_WINNT < _WIN32_WINNT_VISTA || _PHONE8_ // Windows XP or Windows Phone 8.0
58-
59-
std::vector<unsigned char> oauth1_config::_hmac_sha1(const utility::string_t&, const utility::string_t&)
60-
{
61-
throw oauth1_exception(U("oauth1 is not supported"));
62-
}
63-
64-
#elif defined(_MS_WINDOWS) && !defined(__cplusplus_winrt) // Windows desktop
57+
#if defined(_MS_WINDOWS) && !defined(__cplusplus_winrt) // Windows desktop
6558

6659
#include <winternl.h>
6760
#include <bcrypt.h>

0 commit comments

Comments
 (0)