Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
a73b00d
Initial WebSocket implementation
LarryOsterman Jun 17, 2022
ae9de9e
Checkpoint
LarryOsterman Jun 20, 2022
3d505a0
Support multiple frame sizes; preliminary doxygen
LarryOsterman Jun 28, 2022
7e0e9fc
Multi-threaded stress test
LarryOsterman Jun 28, 2022
98d9913
Merge branch 'main' into larryo/createwebsockets
LarryOsterman Jun 28, 2022
97e6360
Starting implementation of WinHTTP websocket transport
LarryOsterman Jun 29, 2022
fdad3f3
Merge branch 'main' into larryo/createwebsockets
LarryOsterman Jun 30, 2022
1372b0a
Completed implementation of HTTP websockets
LarryOsterman Jul 1, 2022
daa1163
Merge branch 'main' into larryo/createwebsockets
LarryOsterman Jul 5, 2022
8cd1e7c
CI fixes
LarryOsterman Jul 5, 2022
4ff6584
cspell
LarryOsterman Jul 5, 2022
0f509cc
cspell
LarryOsterman Jul 5, 2022
20fdade
detail->details
LarryOsterman Jul 5, 2022
f709bc4
C++15 fixes
LarryOsterman Jul 5, 2022
0b4b752
CI fixes
LarryOsterman Jul 5, 2022
b475efa
CI changes
LarryOsterman Jul 5, 2022
d29fc89
CI fixes
LarryOsterman Jul 5, 2022
791550b
clang-format
LarryOsterman Jul 5, 2022
89cf5f6
ci fixes
LarryOsterman Jul 5, 2022
7e43022
dead code handling?
LarryOsterman Jul 5, 2022
9c69110
clang_format
LarryOsterman Jul 5, 2022
95d28b1
clang-format
LarryOsterman Jul 5, 2022
59da14b
Trial: Added pip install websockets
LarryOsterman Jul 5, 2022
d7da11c
First try at websocket server
LarryOsterman Jul 6, 2022
a997d8d
corrected condition for websocket
LarryOsterman Jul 6, 2022
76ec50c
Merge branch 'main' into larryo/createwebsockets
LarryOsterman Jul 6, 2022
5d17885
Checkpoint with traces
LarryOsterman Jul 6, 2022
ad82111
Try again with conditional
LarryOsterman Jul 6, 2022
9b684a3
updated working directory
LarryOsterman Jul 6, 2022
b85c763
Try updating Python version
LarryOsterman Jul 6, 2022
9379b0b
Try updating Python version v2
LarryOsterman Jul 6, 2022
de6cfee
Parameterize websocket server
LarryOsterman Jul 6, 2022
a37acf2
Thread parameters to build job
LarryOsterman Jul 6, 2022
392be84
Check to ensure the websocket server is running at test start
LarryOsterman Jul 6, 2022
cccb566
Copy websocket server to build output directory
LarryOsterman Jul 7, 2022
7bca96e
Try to find requirements.txt
LarryOsterman Jul 7, 2022
87e6095
Diagnostics on prerequisites
LarryOsterman Jul 7, 2022
4bae101
Diagnostics on prerequisites
LarryOsterman Jul 7, 2022
fa67d1e
Copy websocket server to build output directory
LarryOsterman Jul 7, 2022
8fa2eae
Yet another try at the CI pipeline
LarryOsterman Jul 7, 2022
6741a78
Yet another try at the CI pipeline 2
LarryOsterman Jul 7, 2022
530a92f
Update sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_h…
LarryOsterman Jul 7, 2022
05eba24
Update sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_h…
LarryOsterman Jul 7, 2022
802d4c1
Update sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_h…
LarryOsterman Jul 7, 2022
af0f8d9
Update sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_h…
LarryOsterman Jul 7, 2022
a3f4278
Update sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_h…
LarryOsterman Jul 7, 2022
a1173f9
Update sdk/core/azure-core/src/cryptography/sha_hash.cpp
LarryOsterman Jul 7, 2022
07d554c
another CI try
LarryOsterman Jul 7, 2022
e4fef51
Try to find requirements and python server
LarryOsterman Jul 7, 2022
4aa0751
Correct multi-line pwsh syntax
LarryOsterman Jul 7, 2022
1b8cebe
Fixed name of websocket server
LarryOsterman Jul 7, 2022
db9c7ac
Skip PythonTests when not building tests
LarryOsterman Jul 7, 2022
3433116
Skip PythonTests when not building tests2
LarryOsterman Jul 7, 2022
c2d7ade
Skip PythonTests when not building tests3
LarryOsterman Jul 7, 2022
ceed005
Skip PythonTests when not building tests4
LarryOsterman Jul 7, 2022
71263b7
Skip PythonTests when not building tests5
LarryOsterman Jul 7, 2022
e2b5956
Skip PythonTests when not building tests6
LarryOsterman Jul 7, 2022
679f02c
Skip PythonTests when not building tests7
LarryOsterman Jul 7, 2022
c364959
Another try at conditional
LarryOsterman Jul 7, 2022
b435dc4
Turn off python webserver if build_testing is not on
LarryOsterman Jul 7, 2022
05e0da0
clang-format
LarryOsterman Jul 7, 2022
bed2ce4
Merge branch 'main' into larryo/createwebsockets
LarryOsterman Jul 7, 2022
b19b426
Added coverage tests for curl websocket transport
LarryOsterman Jul 8, 2022
4a55591
Artifact name fix
LarryOsterman Jul 8, 2022
d84dd28
Log websocket outputs
LarryOsterman Jul 8, 2022
0776a20
Use RAII pointer for CURL transport
LarryOsterman Jul 8, 2022
6e3c4b2
Noise reduction in test code
LarryOsterman Jul 8, 2022
1899c31
More iterations in multithreaded test; dont publish if no tests
LarryOsterman Jul 8, 2022
f4b7685
Disclaimers on SHA1 and MD5 hash algorithms
LarryOsterman Jul 8, 2022
d8de4c2
clang-format; improved conditional for websocketserver log
LarryOsterman Jul 8, 2022
a92f5d5
Chagned remarks to warning on SHA/MD5 deprecation
LarryOsterman Jul 8, 2022
07339d5
Updated hash comments
LarryOsterman Jul 8, 2022
8d225cc
Stop websocket server after tests complete
LarryOsterman Jul 8, 2022
de390ee
Use unique name for websocket logs
LarryOsterman Jul 8, 2022
3808eb4
clang-format
LarryOsterman Jul 8, 2022
01db8dd
First try at core specific pipelines.
LarryOsterman Jul 8, 2022
79a0c07
Merge branch 'main' into larryo/createwebsockets
LarryOsterman Jul 8, 2022
4453714
Pre and Post test steps
danieljurek Jul 8, 2022
9311f26
Do not insert template
danieljurek Jul 8, 2022
f022cdd
Clean up most references to earlier parameters
danieljurek Jul 8, 2022
3203843
Merge branch 'larryo/createwebsockets' of https://github.com/LarryOst…
LarryOsterman Jul 8, 2022
a617e3e
Add pre and post steps back in
danieljurek Jul 8, 2022
cd8acdc
Build fixes from merge
LarryOsterman Jul 8, 2022
ba02cd2
Merge branch 'larryo/createwebsockets' of https://github.com/LarryOst…
LarryOsterman Jul 8, 2022
5e1c78d
Inline pre and post-test steps
danieljurek Jul 8, 2022
6e39b3b
Shut down websocket server; clang-format
LarryOsterman Jul 8, 2022
3cc6182
Added conditions on test steps
LarryOsterman Jul 8, 2022
d7eed26
Only terminate websocket server if it was started
LarryOsterman Jul 8, 2022
f653b18
110000 multithreaded requests
LarryOsterman Jul 8, 2022
ea35542
curl.exe -> curl
LarryOsterman Jul 8, 2022
d7ef5a0
More test iterations
LarryOsterman Jul 9, 2022
dfc3d03
Code coverage improvements
LarryOsterman Jul 11, 2022
d374e13
cspell
LarryOsterman Jul 11, 2022
d34ca22
Faster multithreaded testl; increased more coverage
LarryOsterman Jul 11, 2022
fa3e8de
Reduce code complexity upon closer reading of RFC 6455
LarryOsterman Jul 11, 2022
23efd91
fixed docstrings
LarryOsterman Jul 11, 2022
46fb880
Drain in-flight messages when processing close
LarryOsterman Jul 11, 2022
b3b75b8
Added test for binary fragmentation
LarryOsterman Jul 11, 2022
efe18bf
More code coverage tweaks
LarryOsterman Jul 12, 2022
a582150
Fixed exception thrown on wrong AsXxx
LarryOsterman Jul 12, 2022
ff6a811
clang_format
LarryOsterman Jul 12, 2022
6cfc9d7
More code coverage
LarryOsterman Jul 12, 2022
50f02ce
Teach WinHTTP transport that WebSockets is also a non-https scheme
LarryOsterman Jul 13, 2022
9044b5d
Disable native transport support for curl transports to improve code …
LarryOsterman Jul 13, 2022
ac056f6
Removed WinHTTP transport option for websockets, moved it to code
LarryOsterman Jul 13, 2022
51a63de
Time out long running failure test
LarryOsterman Jul 13, 2022
36a76e9
Merge branch 'Azure:main' into larryo/createwebsockets
LarryOsterman Jul 13, 2022
0e77d3a
Removed commented out code
LarryOsterman Jul 13, 2022
5ba011e
Merge branch 'larryo/createwebsockets' of https://github.com/LarryOst…
LarryOsterman Jul 13, 2022
d891283
Added ping support to websockets
LarryOsterman Jul 13, 2022
a11167b
Set state to closed when receiving closed frame
LarryOsterman Jul 14, 2022
a0c4d08
Ping support on winhttp
LarryOsterman Jul 14, 2022
b978582
Comment updates
LarryOsterman Jul 14, 2022
75b9487
Code review feedback
LarryOsterman Jul 14, 2022
7681305
clang fixes
LarryOsterman Jul 14, 2022
1915b76
clang_format
LarryOsterman Jul 14, 2022
ab6b497
Get rid of diamond anti-pattern in WebSocketTransport
LarryOsterman Jul 15, 2022
9f83554
Removed CompleteUpgrade since it did nothing
LarryOsterman Jul 15, 2022
9ebc88f
Implemented ping support; some internal cleanup and simplification; U…
LarryOsterman Jul 20, 2022
0b964da
Compilation errors with winhttp
LarryOsterman Jul 20, 2022
48cca80
gpp 5 doesn't have std::atomic_uint32_t
LarryOsterman Jul 20, 2022
2272289
Increased iteration count for multithreaded test
LarryOsterman Jul 20, 2022
8cf06dd
Noise reduction; Increased test size
LarryOsterman Jul 21, 2022
4308164
code review feedback
LarryOsterman Jul 21, 2022
9df1b13
Pull request feedback
LarryOsterman Jul 21, 2022
dddac79
CI changes
LarryOsterman Jul 21, 2022
1711fca
Better path to PS1 file
LarryOsterman Jul 21, 2022
05c43c3
Powershell comments are # not //
LarryOsterman Jul 21, 2022
48486e8
clang-format and set socketserver log file
LarryOsterman Jul 21, 2022
011b10d
Moved WebSocket API to _internal namespace; implementation is still i…
LarryOsterman Jul 22, 2022
3925f04
clang-format
LarryOsterman Jul 22, 2022
ec10454
Force python3 usage for linux.
LarryOsterman Jul 22, 2022
e491cad
Different attempt at launching nohup
LarryOsterman Jul 22, 2022
d40286c
Another attempt at launching nohup
LarryOsterman Jul 22, 2022
2e8346b
Still another attempt at launching nohup
LarryOsterman Jul 22, 2022
013d000
Put back original linux python launch action to get CI pipeline worki…
LarryOsterman Jul 22, 2022
a5ef68e
Added test case to close socket while a receive is outstanding
LarryOsterman Jul 22, 2022
83a4885
clang-format
LarryOsterman Jul 22, 2022
2367577
Added multithreaded test with multiple websockets
LarryOsterman Jul 22, 2022
d9cd38c
clang-format; changed name of the connection upgrade message for WinH…
LarryOsterman Jul 25, 2022
3e35367
clang-format
LarryOsterman Jul 25, 2022
549d2bd
Update sdk/core/azure-core/src/http/curl/curl.cpp
LarryOsterman Jul 25, 2022
15e0afe
Pull request feedback
LarryOsterman Jul 26, 2022
d5e02ef
Fixed CI build problem
LarryOsterman Jul 26, 2022
afbab8a
Improved text for HasNativeWebsocketSupport.
LarryOsterman Jul 26, 2022
91ea0a1
PR changes
LarryOsterman Jul 26, 2022
d8e175b
more feedback
LarryOsterman Jul 26, 2022
ad4db25
clang-format
LarryOsterman Jul 26, 2022
980b547
code review feedback
LarryOsterman Jul 26, 2022
41c49c0
Renamed GetChosenProtocl to GetNegotiatedProtocol
LarryOsterman Jul 26, 2022
7f3d8fe
Renamed NativeClose to Close since it's valid for all WebSocket trans…
LarryOsterman Jul 26, 2022
0a80a7e
Fixed horrible variable name
LarryOsterman Jul 26, 2022
755fc80
Simplified expression
LarryOsterman Jul 26, 2022
1072f76
Update sdk/core/azure-core/src/http/websockets/websockets_impl.cpp
LarryOsterman Jul 26, 2022
fa8f236
Code review feedback
LarryOsterman Jul 27, 2022
868e68f
Update sdk/core/azure-core/src/http/websockets/websockets_impl.cpp
LarryOsterman Jul 27, 2022
74f40c0
Pull request feedback
LarryOsterman Jul 27, 2022
cfe8fae
Merge branch 'larryo/createwebsockets' of https://github.com/LarryOst…
LarryOsterman Jul 27, 2022
8155506
Code Review feedback
LarryOsterman Jul 27, 2022
965538e
clang-format
LarryOsterman Jul 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"ncus",
"Niels",
"nlohmann",
"nohup",
"nostd",
"noclean",
"NOCLOSE",
Expand All @@ -99,6 +100,7 @@
"pdbs",
"Piotrowski",
"PUCHAR",
"PVOID",
"pwsh",
"Ragrs",
"Ragzrs",
Expand Down
8 changes: 8 additions & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ parameters:
- name: TestEnv
type: object
default: []
- name: PreTestSteps
type: object
default: []
- name: PostTestSteps
type: object
default: []

jobs:
- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml
Expand All @@ -53,6 +59,8 @@ jobs:
LineCoverageTarget: ${{ parameters.LineCoverageTarget }}
BranchCoverageTarget: ${{ parameters.BranchCoverageTarget }}
TestEnv: ${{ parameters.TestEnv }}
PreTestSteps: ${{ parameters.PreTestSteps }}
PostTestSteps: ${{ parameters.PostTestSteps }}

# Disable build for cpp - client
- ${{ if ne(parameters.ServiceDirectory, 'not-specified' )}}:
Expand Down
11 changes: 11 additions & 0 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ parameters:
- name: UsePlatformContainer
type: boolean
default: false
- name: PreTestSteps
type: object
default: []
- name: PostTestSteps
type: object
default: []


jobs:
- job:
Expand Down Expand Up @@ -137,6 +144,8 @@ jobs:
BuildArgs: "$(BuildArgs)"
Env: "$(CmakeEnvArg)"

- ${{ parameters.PreTestSteps }}

- pwsh: |
ctest `
-C Debug `
Expand All @@ -148,6 +157,8 @@ jobs:
workingDirectory: build
displayName: Test

- ${{ parameters.PostTestSteps }}

- task: PublishTestResults@2
inputs:
testResultsFormat: cTest
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/templates/jobs/live.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ parameters:
- name: UsePlatformContainer
type: boolean
default: false
- name: PreTestSteps
type: object
default: []
- name: PostTestSteps
type: object
default: []

jobs:
- job: ValidateLive
Expand Down Expand Up @@ -126,6 +132,8 @@ jobs:
Location: ${{ coalesce(parameters.Location, parameters.CloudConfig.Location) }}
SubscriptionConfiguration: ${{ parameters.CloudConfig.SubscriptionConfiguration }}

- ${{ parameters.PreTestSteps }}

# For non multi-config generator use the same build configuration to run tests
# We don't need to set it to invoke ctest
# Visual Studio generator used in CI is a multi-config generator.
Expand All @@ -141,6 +149,8 @@ jobs:
succeeded(),
ne(variables['RunSamples'], '1'))

- ${{ parameters.PostTestSteps }}

- task: PublishTestResults@2
inputs:
testResultsFormat: cTest
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ parameters:
- name: UnsupportedClouds
type: string
default: ''
- name: PreTestSteps
type: object
default: []
- name: PostTestSteps
type: object
default: []


stages:
Expand Down Expand Up @@ -96,6 +102,8 @@ stages:
${{ if eq(parameters.ServiceDirectory, 'template') }}:
TestPipeline: true
TestEnv: ${{ parameters.TestEnv }}
PreTestSteps: ${{ parameters.PreTestSteps }}
PostTestSteps: ${{ parameters.PostTestSteps }}

- ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(parameters.LiveTestCtestRegex, '')) }}:
- template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
Expand All @@ -110,6 +118,8 @@ stages:
Clouds: ${{ parameters.Clouds }}
SupportedClouds: ${{ parameters.SupportedClouds }}
UnsupportedClouds: ${{ parameters.UnsupportedClouds }}
PreTestSteps: ${{ parameters.PreTestSteps }}
PostTestSteps: ${{ parameters.PostTestSteps }}

- ${{ if and(eq(variables['System.TeamProject'], 'internal'), not(endsWith(variables['Build.DefinitionName'], ' - tests'))) }}:
- template: archetype-cpp-release.yml
Expand Down
8 changes: 8 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ parameters:
- name: UnsupportedClouds
type: string
default: ''
- name: PreTestSteps
type: object
default: []
- name: PostTestSteps
type: object
default: []

stages:
- ${{ each cloud in parameters.CloudConfig }}:
Expand Down Expand Up @@ -57,3 +63,5 @@ stages:
Coverage: ${{ parameters.Coverage}}
CoverageReportPath: ${{ parameters.CoverageReportPath}}
TimeoutInMinutes: ${{ parameters.TimeoutInMinutes}}
PreTestSteps: ${{ parameters.PreTestSteps }}
PostTestSteps: ${{ parameters.PostTestSteps }}
2 changes: 1 addition & 1 deletion sdk/core/azure-core-tracing-opentelemetry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (BUILD_AZURE_CORE_TRACING_OPENTELEMETRY)
find_package(azure-core-cpp REQUIRED)
endif()
endif()
find_package(opentelemetry-cpp "1.3.0" CONFIG REQUIRED)
find_package(opentelemetry-cpp CONFIG REQUIRED)

set(
AZURE_CORE_OPENTELEMETRY_HEADER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ TEST_F(OpenTelemetryTests, SetStatus)

span->SetStatus(Azure::Core::Tracing::_internal::SpanStatus::Error, {});
span->SetStatus(Azure::Core::Tracing::_internal::SpanStatus::Ok, {});
EXPECT_THROW(
span->SetStatus(static_cast<Azure::Core::Tracing::_internal::SpanStatus>(357), {}),
std::runtime_error);

span->End({});

Expand All @@ -553,7 +556,7 @@ TEST_F(OpenTelemetryTests, SetStatus)

span->SetStatus(Azure::Core::Tracing::_internal::SpanStatus::Error, "Something went wrong.");

span->End({});
span->End(Azure::DateTime(std::chrono::system_clock::now()));

// Return the collected spans.
auto spans = m_spanData->GetSpans();
Expand Down
16 changes: 13 additions & 3 deletions sdk/core/azure-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,20 @@ if(BUILD_TRANSPORT_CURL)
src/http/curl/curl_connection_pool_private.hpp
src/http/curl/curl_connection_private.hpp
src/http/curl/curl_session_private.hpp
)
src/http/curl/curl_websockets.cpp
)
SET(CURL_TRANSPORT_ADAPTER_INC
inc/azure/core/http/curl_transport.hpp
inc/azure/core/http/websockets/curl_websockets_transport.hpp
)
endif()
if(BUILD_TRANSPORT_WINHTTP)
SET(WIN_TRANSPORT_ADAPTER_SRC src/http/winhttp/win_http_transport.cpp)
SET(WIN_TRANSPORT_ADAPTER_INC inc/azure/core/http/win_http_transport.hpp)
SET(WIN_TRANSPORT_ADAPTER_SRC
src/http/winhttp/win_http_transport.cpp
src/http/winhttp/win_http_websockets.cpp)
SET(WIN_TRANSPORT_ADAPTER_INC
inc/azure/core/http/win_http_transport.hpp
inc/azure/core/http/websockets/win_http_websockets_transport.hpp)
endif()

set(
Expand All @@ -74,6 +80,8 @@ set(
inc/azure/core/http/policies/policy.hpp
inc/azure/core/http/raw_response.hpp
inc/azure/core/http/transport.hpp
inc/azure/core/http/websockets/websockets.hpp
inc/azure/core/http/websockets/websockets_transport.hpp
inc/azure/core/internal/client_options.hpp
inc/azure/core/internal/contract.hpp
inc/azure/core/internal/cryptography/sha_hash.hpp
Expand Down Expand Up @@ -132,6 +140,8 @@ set(
src/http/transport_policy.cpp
src/http/url.cpp
src/http/user_agent.cpp
src/http/websockets/websockets.cpp
src/http/websockets/websockets_impl.cpp
src/io/body_stream.cpp
src/io/random_access_file_body_stream.cpp
src/logger.cpp
Expand Down
15 changes: 9 additions & 6 deletions sdk/core/azure-core/inc/azure/core/base64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ namespace Azure { namespace Core {

/**
* @brief Used to convert one form of data into another, for example encoding binary data into
* Base64 text.
* Base64 encoded octets.
*
* @note Base64 encoded data is a subset of the ASCII encoding (characters 0-127). As such,
* it can be considered a subset of UTF-8.
*/
class Convert final {
private:
Expand All @@ -31,17 +34,17 @@ namespace Azure { namespace Core {

public:
/**
* @brief Encodes the vector of binary data into UTF-8 encoded text represented as Base64.
* @brief Encodes a vector of binary data using Base64.
*
* @param data The input vector that contains binary data that needs to be encoded.
* @return The UTF-8 encoded text in Base64.
* @param data The input vector that contains binary data to be encoded.
* @return The Base64 encoded contents of the vector.
*/
static std::string Base64Encode(const std::vector<uint8_t>& data);

/**
* @brief Decodes the UTF-8 encoded text represented as Base64 into binary data.
* @brief Decodes a Base64 encoded data into a vector of binary data.
*
* @param text The input UTF-8 encoded text in Base64 that needs to be decoded.
* @param text Base64 encoded data to be decoded.
* @return The decoded binary data.
*/
static std::vector<uint8_t> Base64Decode(const std::string& text);
Expand Down
5 changes: 5 additions & 0 deletions sdk/core/azure-core/inc/azure/core/cryptography/hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ namespace Azure { namespace Core { namespace Cryptography {
/**
* @brief Represents the class for the MD5 hash function which maps binary data of an arbitrary
* length to small binary data of a fixed length.
*
* @warning MD5 is a deprecated hashing algorithm and SHOULD NOT be used,
* unless it is used to implement a specific protocol (See RFC 6151 for more information
* about the weaknesses of the MD5 hash function). Client implementers should strongly prefer the
* SHA256, SHA384, and SHA512 hash functions.
*/
class Md5Hash final : public Hash {

Expand Down
18 changes: 16 additions & 2 deletions sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "azure/core/http/transport.hpp"

namespace Azure { namespace Core { namespace Http {
class CurlNetworkConnection;

namespace _detail {
/**
Expand Down Expand Up @@ -46,7 +47,7 @@ namespace Azure { namespace Core { namespace Http {
/**
* @brief Set the libcurl connection options like a proxy and CA path.
*/
struct CurlTransportOptions final
struct CurlTransportOptions
{
/**
* @brief The string for the proxy is passed directly to the libcurl handle without any parsing.
Expand Down Expand Up @@ -126,10 +127,17 @@ namespace Azure { namespace Core { namespace Http {
/**
* @brief Concrete implementation of an HTTP Transport that uses libcurl.
*/
class CurlTransport final : public HttpTransport {
class CurlTransport : public HttpTransport {
private:
CurlTransportOptions m_options;

protected:
/**
* @brief Called when an HTTP response indicates the connection should be upgraded to
* a websocket. Takes ownership of the CurlNetworkConnection object.
*/
virtual void OnUpgradedConnection(std::unique_ptr<CurlNetworkConnection>&&){};

public:
/**
* @brief Construct a new CurlTransport object.
Expand All @@ -140,6 +148,12 @@ namespace Azure { namespace Core { namespace Http {
{
}

// See also:
// [Core Guidelines C.35: "A base class destructor should be either public
// and virtual or protected and
// non-virtual"](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-non-virtual)
virtual ~CurlTransport() = default;

/**
* @brief Implements interface to send an HTTP Request and produce an HTTP RawResponse
*
Expand Down
6 changes: 6 additions & 0 deletions sdk/core/azure-core/inc/azure/core/http/transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ namespace Azure { namespace Core { namespace Http {
* @return A reference to this instance.
*/
HttpTransport& operator=(const HttpTransport& other) = default;

/**
* @brief Returns true if the HttpTransport supports WebSockets (the ability to
* communicate bidirectionally on the TCP connection used by the HTTP transport).
*/
virtual bool HasWebSocketSupport() const { return false; }
};

}}} // namespace Azure::Core::Http
Loading