From 5cff286c0a848185b10fe618326fddc172af342b Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 27 Jul 2022 11:03:42 -0700 Subject: [PATCH 01/75] Initial WebSockets implementation. (#3823) * Initial WebSocket implementation Co-authored-by: Rick Winter Co-authored-by: Daniel Jurek Co-authored-by: Ahson Khan --- .vscode/cspell.json | 2 + .../templates/jobs/archetype-sdk-client.yml | 8 + eng/pipelines/templates/jobs/ci.tests.yml | 11 + eng/pipelines/templates/jobs/live.tests.yml | 10 + .../templates/stages/archetype-sdk-client.yml | 10 + .../templates/stages/archetype-sdk-tests.yml | 8 + .../CMakeLists.txt | 2 +- .../test/ut/azure_core_otel_test.cpp | 5 +- sdk/core/azure-core/CMakeLists.txt | 16 +- sdk/core/azure-core/inc/azure/core/base64.hpp | 15 +- .../inc/azure/core/cryptography/hash.hpp | 5 + .../inc/azure/core/http/curl_transport.hpp | 18 +- .../inc/azure/core/http/transport.hpp | 6 + .../websockets/curl_websockets_transport.hpp | 155 +++ .../azure/core/http/websockets/websockets.hpp | 404 ++++++++ .../http/websockets/websockets_transport.hpp | 204 ++++ .../win_http_websockets_transport.hpp | 140 +++ .../azure/core/http/win_http_transport.hpp | 102 +- .../core/internal/cryptography/sha_hash.hpp | 56 ++ sdk/core/azure-core/src/base64.cpp | 6 +- sdk/core/azure-core/src/cryptography/md5.cpp | 1 - .../azure-core/src/cryptography/sha_hash.cpp | 18 + .../src/environment_log_level_listener.cpp | 4 +- sdk/core/azure-core/src/http/curl/curl.cpp | 95 +- .../curl/curl_connection_pool_private.hpp | 14 - .../src/http/curl/curl_connection_private.hpp | 27 +- .../src/http/curl/curl_session_private.hpp | 15 +- .../src/http/curl/curl_websockets.cpp | 82 ++ .../src/http/websockets/websockets.cpp | 106 +++ .../src/http/websockets/websockets_impl.cpp | 879 ++++++++++++++++++ .../src/http/websockets/websockets_impl.hpp | 372 ++++++++ .../src/http/winhttp/win_http_transport.cpp | 196 ++-- .../src/http/winhttp/win_http_websockets.cpp | 221 +++++ sdk/core/azure-core/test/ut/CMakeLists.txt | 14 +- .../test/ut/Start-WebSocketServer.ps1 | 13 + sdk/core/azure-core/test/ut/requirements.txt | 1 + sdk/core/azure-core/test/ut/sha_test.cpp | 124 ++- .../azure-core/test/ut/websocket_server.py | 155 +++ .../azure-core/test/ut/websocket_test.cpp | 875 +++++++++++++++++ sdk/core/ci.yml | 50 + 40 files changed, 4215 insertions(+), 230 deletions(-) create mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp create mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp create mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp create mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp create mode 100644 sdk/core/azure-core/src/http/curl/curl_websockets.cpp create mode 100644 sdk/core/azure-core/src/http/websockets/websockets.cpp create mode 100644 sdk/core/azure-core/src/http/websockets/websockets_impl.cpp create mode 100644 sdk/core/azure-core/src/http/websockets/websockets_impl.hpp create mode 100644 sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp create mode 100644 sdk/core/azure-core/test/ut/Start-WebSocketServer.ps1 create mode 100644 sdk/core/azure-core/test/ut/requirements.txt create mode 100644 sdk/core/azure-core/test/ut/websocket_server.py create mode 100644 sdk/core/azure-core/test/ut/websocket_test.cpp diff --git a/.vscode/cspell.json b/.vscode/cspell.json index cd1346732a..f4dc3a9d1a 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -84,6 +84,7 @@ "ncus", "Niels", "nlohmann", + "nohup", "nostd", "noclean", "NOCLOSE", @@ -99,6 +100,7 @@ "pdbs", "Piotrowski", "PUCHAR", + "PVOID", "pwsh", "Ragrs", "Ragzrs", diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 14883215a9..6a1652faec 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -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 @@ -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' )}}: diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 9f27a6f855..87b5eb0f82 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -46,6 +46,13 @@ parameters: - name: UsePlatformContainer type: boolean default: false + - name: PreTestSteps + type: object + default: [] + - name: PostTestSteps + type: object + default: [] + jobs: - job: @@ -137,6 +144,8 @@ jobs: BuildArgs: "$(BuildArgs)" Env: "$(CmakeEnvArg)" + - ${{ parameters.PreTestSteps }} + - pwsh: | ctest ` -C Debug ` @@ -148,6 +157,8 @@ jobs: workingDirectory: build displayName: Test + - ${{ parameters.PostTestSteps }} + - task: PublishTestResults@2 inputs: testResultsFormat: cTest diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index e5272766e3..19e73bb0b5 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -36,6 +36,12 @@ parameters: - name: UsePlatformContainer type: boolean default: false +- name: PreTestSteps + type: object + default: [] +- name: PostTestSteps + type: object + default: [] jobs: - job: ValidateLive @@ -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. @@ -141,6 +149,8 @@ jobs: succeeded(), ne(variables['RunSamples'], '1')) + - ${{ parameters.PostTestSteps }} + - task: PublishTestResults@2 inputs: testResultsFormat: cTest diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index a9bc6a575c..334e580647 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -67,6 +67,12 @@ parameters: - name: UnsupportedClouds type: string default: '' +- name: PreTestSteps + type: object + default: [] +- name: PostTestSteps + type: object + default: [] stages: @@ -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 @@ -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 diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index 737de7b297..a4aba5565b 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -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 }}: @@ -57,3 +63,5 @@ stages: Coverage: ${{ parameters.Coverage}} CoverageReportPath: ${{ parameters.CoverageReportPath}} TimeoutInMinutes: ${{ parameters.TimeoutInMinutes}} + PreTestSteps: ${{ parameters.PreTestSteps }} + PostTestSteps: ${{ parameters.PostTestSteps }} diff --git a/sdk/core/azure-core-tracing-opentelemetry/CMakeLists.txt b/sdk/core/azure-core-tracing-opentelemetry/CMakeLists.txt index bf3077e676..6d0dc15151 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/CMakeLists.txt +++ b/sdk/core/azure-core-tracing-opentelemetry/CMakeLists.txt @@ -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 diff --git a/sdk/core/azure-core-tracing-opentelemetry/test/ut/azure_core_otel_test.cpp b/sdk/core/azure-core-tracing-opentelemetry/test/ut/azure_core_otel_test.cpp index bba341df18..ded42c49d3 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/test/ut/azure_core_otel_test.cpp +++ b/sdk/core/azure-core-tracing-opentelemetry/test/ut/azure_core_otel_test.cpp @@ -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(357), {}), + std::runtime_error); span->End({}); @@ -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(); diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index 978a59def3..6d94397403 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -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( @@ -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 @@ -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 diff --git a/sdk/core/azure-core/inc/azure/core/base64.hpp b/sdk/core/azure-core/inc/azure/core/base64.hpp index 689736ab53..cb5daadcf5 100644 --- a/sdk/core/azure-core/inc/azure/core/base64.hpp +++ b/sdk/core/azure-core/inc/azure/core/base64.hpp @@ -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: @@ -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& 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 Base64Decode(const std::string& text); diff --git a/sdk/core/azure-core/inc/azure/core/cryptography/hash.hpp b/sdk/core/azure-core/inc/azure/core/cryptography/hash.hpp index 9ef494cab1..a2225574cf 100644 --- a/sdk/core/azure-core/inc/azure/core/cryptography/hash.hpp +++ b/sdk/core/azure-core/inc/azure/core/cryptography/hash.hpp @@ -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 { diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index a06fac3499..398708399e 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -13,6 +13,7 @@ #include "azure/core/http/transport.hpp" namespace Azure { namespace Core { namespace Http { + class CurlNetworkConnection; namespace _detail { /** @@ -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. @@ -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&&){}; + public: /** * @brief Construct a new CurlTransport object. @@ -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 * diff --git a/sdk/core/azure-core/inc/azure/core/http/transport.hpp b/sdk/core/azure-core/inc/azure/core/http/transport.hpp index 64d6f6da15..448f060319 100644 --- a/sdk/core/azure-core/inc/azure/core/http/transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/transport.hpp @@ -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 diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp new file mode 100644 index 0000000000..d3b1ecb1ad --- /dev/null +++ b/sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief #Azure::Core::Http::WebSockets::WebSocketTransport implementation via CURL. + */ + +#pragma once + +#include "azure/core/context.hpp" +#include "azure/core/http/curl_transport.hpp" +#include "azure/core/http/http.hpp" +#include "azure/core/http/transport.hpp" +#include "azure/core/http/websockets/websockets_transport.hpp" +#include + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { + + struct CurlWebSocketTransportOptions : public Azure::Core::Http::CurlTransportOptions + { + }; + /** + * @brief Concrete implementation of a WebSocket Transport that uses libcurl. + */ + class CurlWebSocketTransport : public CurlTransport, public WebSocketTransport { + public: + /** + * @brief Construct a new CurlWebSocketTransport object. + * + * @param options Optional parameter to override the default options. + */ + CurlWebSocketTransport( + CurlWebSocketTransportOptions const& options = CurlWebSocketTransportOptions()) + : CurlTransport(options) + { + } + + /** + * @brief Implements interface to send an HTTP Request and produce an HTTP RawResponse + * + * @param request an HTTP Request to be send. + * @param context A context to control the request lifetime. + * + * @return unique ptr to an HTTP RawResponse. + */ + virtual std::unique_ptr Send(Request& request, Context const& context) override; + + /** + * @brief Indicates if the transport natively supports websockets or not. + * + * @details For the CURL websocket transport, the transport does NOT support native websockets - + * it is the responsibility of the client of the WebSocketTransport to format WebSocket protocol + * elements. + */ + virtual bool HasBuiltInWebSocketSupport() override { return false; } + + /** + * @brief Closes the WebSocket handle. + * + */ + virtual void Close() override; + + // Native WebSocket support methods. + /** + * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. + * + * @details Not implemented for CURL websockets because CURL does not support native websockets. + * + * The first param is the close reason, the second is descriptive text. + */ + virtual void NativeCloseSocket(uint16_t, std::string const&, Azure::Core::Context const&) + override + { + throw std::runtime_error("Not implemented."); + } + + /** + * @brief Retrieve the status of the close socket operation. + * + * @details Not implemented for CURL websockets because CURL does not support native websockets. + * + */ + NativeWebSocketCloseInformation NativeGetCloseSocketInformation( + const Azure::Core::Context&) override + { + throw std::runtime_error("Not implemented"); + } + + /** + * @brief Send a frame of data to the remote node. + * + * @details Not implemented for CURL websockets because CURL does not support native websockets. + * + */ + virtual void NativeSendFrame( + NativeWebSocketFrameType, + std::vector const&, + Azure::Core::Context const&) override + { + throw std::runtime_error("Not implemented."); + } + + /** + * @brief Receive a frame of data from the remote node. + * + * @details Not implemented for CURL websockets because CURL does not support native websockets. + * + */ + virtual NativeWebSocketReceiveInformation NativeReceiveFrame( + Azure::Core::Context const&) override + { + throw std::runtime_error("Not implemented"); + } + + // Non-Native WebSocket support. + /** + * @brief This function is used when working with streams to pull more data from the wire. + * Function will try to keep pulling data from socket until the buffer is all written or until + * there is no more data to get from the socket. + * + * @param buffer Buffer to fill with data. + * @param bufferSize Size of buffer. + * @param context Context to control the request lifetime. + * + * @returns Buffer data received. + * + */ + virtual size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) + override; + + /** + * @brief This method will use libcurl socket to write all the bytes from buffer. + * + * @param buffer Buffer to send. + * @param bufferSize Number of bytes to write. + * @param context Context for the operation. + */ + virtual int SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) + override; + + /** + * @brief returns true if this transport supports WebSockets, false otherwise. + */ + bool HasWebSocketSupport() const override { return true; } + + private: + // std::unique_ptr cannot be constructed on an incomplete type (CurlNetworkConnection), but + // std::shared_ptr can be. + std::shared_ptr m_upgradedConnection; + void OnUpgradedConnection( + std::unique_ptr&& upgradedConnection) override; + }; + +}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp new file mode 100644 index 0000000000..a0a55d3bd4 --- /dev/null +++ b/sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief Azure Core APIs implementing the WebSocket protocol [RFC 6455] + * (https://www.rfc-editor.org/rfc/rfc6455.html). + */ + +#pragma once + +#include "azure/core/context.hpp" +#include "azure/core/http/http.hpp" +#include "azure/core/http/transport.hpp" +#include "azure/core/internal/client_options.hpp" +#include +#include + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { + namespace _detail { + class WebSocketImplementation; + } + namespace _internal { + + enum class WebSocketFrameType : int + { + Unknown, + TextFrameReceived, + BinaryFrameReceived, + PeerClosedReceived, + }; + + enum class WebSocketErrorCode : uint16_t + { + OK = 1000, + EndpointDisappearing = 1001, + ProtocolError = 1002, + UnknownDataType = 1003, + Reserved1 = 1004, + NoStatusCodePresent = 1005, + ConnectionClosedWithoutCloseFrame = 1006, + InvalidMessageData = 1007, + PolicyViolation = 1008, + MessageTooLarge = 1009, + ExtensionNotFound = 1010, + UnexpectedError = 1011, + TlsHandshakeFailure = 1015, + }; + + class WebSocketTextFrame; + class WebSocketBinaryFrame; + class WebSocketPeerCloseFrame; + + namespace _detail { + class WebSocketImplementation; + } + /** @brief Statistics about data sent and received by the WebSocket. + * + * @remarks This class is primarily intended for test collateral and debugging to allow + * a caller to determine information about the status of a WebSocket. + * + * Note: Some of these statistics are not available if the underlying transport supports native + * websockets. + */ + struct WebSocketStatistics + { + /** @brief The number of WebSocket frames sent on this WebSocket. */ + uint32_t FramesSent; + + /** @brief The number of bytes of data sent to the peer on this WebSocket. */ + uint32_t BytesSent; + + /** @brief The number of WebSocket frames received from the peer. */ + uint32_t FramesReceived; + + /** @brief The number of bytes received from the peer. */ + uint32_t BytesReceived; + + /** @brief The number of "Ping" frames received from the peer. */ + uint32_t PingFramesReceived; + + /** @brief The number of "Ping" frames sent to the peer. */ + uint32_t PingFramesSent; + + /** @brief The number of "Pong" frames received from the peer. */ + uint32_t PongFramesReceived; + + /** @brief The number of "Pong" frames sent to the peer. */ + uint32_t PongFramesSent; + + /** @brief The number of "Text" frames received from the peer. */ + uint32_t TextFramesReceived; + + /** @brief The number of "Text" frames sent to the peer. */ + uint32_t TextFramesSent; + + /** @brief The number of "Binary" frames received from the peer. */ + uint32_t BinaryFramesReceived; + + /** @brief The number of "Binary" frames sent to the peer. */ + uint32_t BinaryFramesSent; + + /** @brief The number of "Continuation" frames sent to the peer. */ + uint32_t ContinuationFramesSent; + + /** @brief The number of "Continuation" frames received from the peer. */ + uint32_t ContinuationFramesReceived; + + /** @brief The number of "Close" frames received from the peer. */ + uint32_t CloseFramesReceived; + + /** @brief The number of frames received which were not processed. */ + uint32_t FramesDropped; + + /** @brief The number of frames received which were not returned because they were received + * after the Close() method was called. */ + + uint32_t FramesDroppedByClose; + /** @brief The number of frames dropped because they were over the maximum payload size. */ + + uint32_t FramesDroppedByPayloadSizeLimit; + /** @brief The number of frames dropped because they were out of compliance with the protocol. + */ + uint32_t FramesDroppedByProtocolError; + + /** @brief The number of reads performed on the transport.*/ + uint32_t TransportReads; + + /** @brief The number of bytes read from the transport. */ + uint32_t TransportReadBytes; + }; + + /** @brief A frame of data received from a WebSocket. + */ + class WebSocketFrame { + public: + /** @brief The type of frame received: Text, Binary or Close. */ + WebSocketFrameType FrameType{}; + + /** @brief True if the frame received is a "final" frame */ + bool IsFinalFrame{false}; + + /** @brief Returns the contents of the frame as a Text frame. + * @returns A WebSocketTextFrame containing the contents of the frame. + */ + std::shared_ptr AsTextFrame(); + + /** @brief Returns the contents of the frame as a Binary frame. + * @returns A WebSocketBinaryFrame containing the contents of the frame. + */ + + std::shared_ptr AsBinaryFrame(); + /** @brief Returns the contents of the frame as a Peer Close frame. + * @returns A WebSocketPeerCloseFrame containing the contents of the frame. + */ + std::shared_ptr AsPeerCloseFrame(); + + /** @brief Construct a new instance of a WebSocketFrame.*/ + WebSocketFrame() = default; + + /** @brief Construct a new instance of a WebSocketFrame with a specific frame type. + * @param frameType The type of frame received. + */ + WebSocketFrame(WebSocketFrameType frameType) : FrameType{frameType} {} + + /** @brief Construct a new instance of a WebSocketFrame with a specific frame type and final + * flag. + * @param frameType The type of frame received. + * @param isFinalFrame true if the frame is the final frame. + */ + WebSocketFrame(WebSocketFrameType frameType, bool isFinalFrame) + : FrameType{frameType}, IsFinalFrame{isFinalFrame} + { + } + }; + + /** @brief Contains the contents of a WebSocket Text frame.*/ + class WebSocketTextFrame : public WebSocketFrame, + public std::enable_shared_from_this { + friend Azure::Core::Http::WebSockets::_detail::WebSocketImplementation; + + private: + public: + /** @brief Constructs a new WebSocketTextFrame */ + WebSocketTextFrame() : WebSocketFrame(WebSocketFrameType::TextFrameReceived){}; + + /** @brief Text of the frame received from the remote peer. */ + std::string Text; + + private: + /** @brief Constructs a new WebSocketTextFrame + * @param isFinalFrame True if this is the final frame in a multi-frame message. + * @param body UTF-8 encoded text of the frame data. + * @param size Length in bytes of the frame body. + */ + WebSocketTextFrame(bool isFinalFrame, uint8_t const* body, size_t size) + : WebSocketFrame{WebSocketFrameType::TextFrameReceived, isFinalFrame}, + Text(body, body + size) + { + } + }; + + /** @brief Contains the contents of a WebSocket Binary frame.*/ + class WebSocketBinaryFrame : public WebSocketFrame, + public std::enable_shared_from_this { + friend Azure::Core::Http::WebSockets::_detail::WebSocketImplementation; + + private: + public: + /** @brief Constructs a new WebSocketBinaryFrame */ + WebSocketBinaryFrame() : WebSocketFrame(WebSocketFrameType::BinaryFrameReceived){}; + + /** @brief Binary frame data received from the remote peer. */ + std::vector Data; + + /** @brief Constructs a new WebSocketBinaryFrame + * @param isFinal True if this is the final frame in a multi-frame message. + * @param body binary of the frame data. + * @param size Length in bytes of the frame body. + */ + private: + WebSocketBinaryFrame(bool isFinal, uint8_t const* body, size_t size) + : WebSocketFrame{WebSocketFrameType::BinaryFrameReceived, isFinal}, + Data(body, body + size) + { + } + }; + + /** @brief Contains the contents of a WebSocket Close frame.*/ + class WebSocketPeerCloseFrame : public WebSocketFrame, + public std::enable_shared_from_this { + friend Azure::Core::Http::WebSockets::_detail::WebSocketImplementation; + + public: + /** @brief Constructs a new WebSocketPeerCloseFrame */ + WebSocketPeerCloseFrame() : WebSocketFrame(WebSocketFrameType::PeerClosedReceived){}; + + /** @brief Status code sent from the remote peer. Typically a member of the WebSocketErrorCode + * enumeration */ + uint16_t RemoteStatusCode{}; + + /** @brief Optional text sent from the remote peer. */ + std::string RemoteCloseReason; + + private: + /** @brief Constructs a new WebSocketBinaryFrame + * @param remoteStatusCode Status code sent by the remote peer. + * @param remoteCloseReason Optional reason sent by the remote peer. + */ + WebSocketPeerCloseFrame(uint16_t remoteStatusCode, std::string const& remoteCloseReason) + : WebSocketFrame{WebSocketFrameType::PeerClosedReceived}, + RemoteStatusCode(remoteStatusCode), RemoteCloseReason(remoteCloseReason) + { + } + }; + + struct WebSocketOptions : Azure::Core::_internal::ClientOptions + { + /** + * @brief The set of protocols which are supported by this client + */ + std::vector Protocols = {}; + + /** + * @brief The protocol name of the service client. Used for the User-Agent header + * in the initial WebSocket handshake. + */ + std::string ServiceName; + + /** + * @brief The version of the service client. Used for the User-Agent header in the + * initial WebSocket handshake + */ + std::string ServiceVersion; + + /** + * @brief The period of time between ping operations, default is 60 seconds. + */ + std::chrono::duration PingInterval{std::chrono::seconds{60}}; + + /** + * @brief Construct an instance of a WebSocketOptions type. + * + * @param protocols Supported protocols for this websocket client. + */ + explicit WebSocketOptions(std::vector protocols) + : Azure::Core::_internal::ClientOptions{}, Protocols(protocols) + { + } + WebSocketOptions() = default; + }; + + class WebSocket { + public: + /** @brief Constructs a new instance of a WebSocket with the specified WebSocket options. + * + * @param remoteUrl The URL of the remote WebSocket server. + * @param options The options to use for the WebSocket. + */ + explicit WebSocket( + Azure::Core::Url const& remoteUrl, + WebSocketOptions const& options = WebSocketOptions{}); + + /** @brief Destroys an instance of a WebSocket. + */ + ~WebSocket(); + + /** @brief Opens a WebSocket connection to a remote server. + * + * @param context Context for the operation, used for cancellation and timeout. + */ + void Open(Azure::Core::Context const& context = Azure::Core::Context{}); + + /** @brief Closes a WebSocket connection to the remote server gracefully. + * + * @param context Context for the operation. + */ + void Close(Azure::Core::Context const& context = Azure::Core::Context{}); + + /** @brief Closes a WebSocket connection to the remote server with additional context. + * + * @param closeStatus 16 bit WebSocket error code. + * @param closeReason String describing the reason for closing the socket. + * @param context Context for the operation. + */ + void Close( + uint16_t closeStatus, + std::string const& closeReason = {}, + Azure::Core::Context const& context = Azure::Core::Context{}); + + /** @brief Sends a String frame to the remote server. + * + * @param textFrame UTF-8 encoded text to send. + * @param isFinalFrame if True, this is the final frame in a multi-frame message. + * @param context Context for the operation. + */ + void SendFrame( + std::string const& textFrame, + bool isFinalFrame = false, + Azure::Core::Context const& context = Azure::Core::Context{}); + + /** @brief Sends a Binary frame to the remote server. + * + * @param binaryFrame Binary data to send. + * @param isFinalFrame if True, this is the final frame in a multi-frame message. + * @param context Context for the operation. + */ + void SendFrame( + std::vector const& binaryFrame, + bool isFinalFrame = false, + Azure::Core::Context const& context = Azure::Core::Context{}); + + /** @brief Receive a frame from the remote server. + * + * @param context Context for the operation. + * + * @returns The received WebSocket frame. + * + */ + std::shared_ptr ReceiveFrame( + Azure::Core::Context const& context = Azure::Core::Context{}); + + /** @brief AddHeader - Adds a header to the initial handshake. + * + * @note This API is ignored after the WebSocket is opened. + * + * @param headerName Name of header to add to the initial handshake request. + * @param headerValue Value of header to add. + */ + void AddHeader(std::string const& headerName, std::string const& headerValue); + + /** @brief Determine if the WebSocket is open. + * + * @returns true if the WebSocket is open, false otherwise. + */ + bool IsOpen() const; + + /** @brief Returns "true" if the configured websocket transport + * supports websockets in the transport, or if the websocket implementation + * is providing websocket protocol support. + * + * @returns true if the HTTP transport used for WebSocket support directly supports the + * WebSocket API. + */ + bool HasBuiltInWebSocketSupport() const; + + /** @brief Returns the protocol chosen by the remote server during the initial handshake. + * + * @returns The protocol negotiated between client and server. + */ + std::string const& GetNegotiatedProtocol() const; + + /** @brief Returns statistics about the WebSocket. + * + * @returns The statistics about the WebSocket. + */ + WebSocketStatistics GetStatistics() const; + + private: + std::unique_ptr + m_socketImplementation; + }; + } // namespace _internal +}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp new file mode 100644 index 0000000000..1afda3c0d2 --- /dev/null +++ b/sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief Utilities to be used by HTTP WebSocket transport implementations. + */ + +#pragma once + +#include "azure/core/context.hpp" +#include "azure/core/http/http.hpp" + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { + + /** + * @brief Base class for all WebSocket transport implementations. + */ + class WebSocketTransport { + public: + /** + * @brief Web Socket Frame type, one of Text or Binary. + */ + enum class NativeWebSocketFrameType + { + /** + * @brief Indicates that the frame is a partial UTF-8 encoded text frame - it is NOT the + * complete frame to be sent to the remote node. + */ + TextFragment, + /** + * @brief Indicates that the frame is either the complete UTF-8 encoded text frame to be sent + * to the remote node or the final frame of a multipart message. + */ + Text, + /** + * @brief Indicates that the frame is either the complete binary frame to be sent + * to the remote node or the final frame of a multipart message. + */ + Binary, + /** + * @brief Indicates that the frame is a partial binary frame - it is NOT the + * complete frame to be sent to the remote node. + */ + BinaryFragment, + + /** + * @brief Indicates that the frame is a "close" frame - the remote node + * sent a close frame. + */ + Closed, + }; + + /** @brief Close information returned from a WebSocket transport that has builtin support + * for WebSockets. + */ + struct NativeWebSocketCloseInformation + { + /** + * @brief Close response code. + */ + uint16_t CloseReason; + /** + * @brief Close reason. + */ + std::string CloseReasonDescription; + }; + /** @brief Frame information returned from a WebSocket transport that has builtin support + * for WebSockets. + */ + struct NativeWebSocketReceiveInformation + { + /** + * @brief Type of frame received. + */ + NativeWebSocketFrameType FrameType; + /** + * @brief Data received. + */ + std::vector FrameData; + }; + /** + * @brief Destructs `%WebSocketTransport`. + * + */ + virtual ~WebSocketTransport() {} + + /** + * @brief Indicates whether the transport natively supports WebSockets. + * + * @returns true if the transport has native websocket support, false otherwise. + */ + virtual bool HasBuiltInWebSocketSupport() = 0; + + /** + * @brief Closes the WebSocket. + * + * Does not notify the remote endpoint that the socket is being closed. + * + */ + virtual void Close() = 0; + + /**************/ + /* Native WebSocket support functions*/ + /**************/ + /** + * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. + * + * @param status Status value to be sent to the remote node. Application defined. + * @param disconnectReason UTF-8 encoded reason for the disconnection. Optional. + * @param context Context for the operation. + */ + virtual void NativeCloseSocket( + uint16_t status, + std::string const& disconnectReason, + Azure::Core::Context const& context) + = 0; + + /** + * @brief Retrieve the information associated with a WebSocket close response. + * + * @param context Context for the operation. + * + * @returns a tuple containing the status code and string. + */ + virtual NativeWebSocketCloseInformation NativeGetCloseSocketInformation( + Azure::Core::Context const& context) + = 0; + + /** + * @brief Send a frame of data to the remote node. + * + * @param frameType Frame type sent to the server, Text or Binary. + * @param frameData Frame data to be sent to the server. + * @param context Context for the operation. + */ + virtual void NativeSendFrame( + NativeWebSocketFrameType frameType, + std::vector const& frameData, + Azure::Core::Context const& context) + = 0; + + /** + * @brief Receive a frame from the remote WebSocket server. + * + * @param context Context for the operation. + * + * @returns a tuple containing the Frame data received from the remote server and the type of + * data returned from the remote endpoint + */ + virtual NativeWebSocketReceiveInformation NativeReceiveFrame( + Azure::Core::Context const& context) + = 0; + + /**************/ + /* Non Native WebSocket support functions */ + /**************/ + + /** + * @brief This function is used when working with streams to pull more data from the wire. + * Function will try to keep pulling data from socket until the buffer is all written or until + * there is no more data to get from the socket. + * + */ + virtual size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) = 0; + + /** + * @brief This method will use the raw socket to write all the bytes from buffer. + * + */ + virtual int SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) = 0; + + protected: + /** + * @brief Constructs a default instance of `%WebSocketTransport`. + * + */ + WebSocketTransport() = default; + + /** + * @brief Constructs `%HttpTransport` by copying another instance of `%HttpTransport`. + * + * @param other An instance to copy. + */ + WebSocketTransport(const WebSocketTransport& other) = default; + + /** + * @brief Constructs a WebSocketTransport from another WebSocketTransport. + * + * @param other An instance to move in. + */ + WebSocketTransport(WebSocketTransport&& other) = default; + + /** + * @brief Assigns one WebSocketTransport to another. + * + * @param other An instance to assign. + * + * @return A reference to this instance. + */ + WebSocketTransport& operator=(const WebSocketTransport& other) = default; + }; + +}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp new file mode 100644 index 0000000000..8fdf5b533c --- /dev/null +++ b/sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief #Azure::Core::Http::WebSockets::WebSocketTransport implementation via WInHTTP. + */ + +#pragma once + +#include "azure/core/context.hpp" +#include "azure/core/http/http.hpp" +#include "azure/core/http/transport.hpp" +#include "azure/core/http/websockets/websockets_transport.hpp" +#include "azure/core/http/win_http_transport.hpp" +#include +#include + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { + + /** + * @brief Concrete implementation of a WebSocket Transport that uses WinHTTP. + */ + class WinHttpWebSocketTransport : public WebSocketTransport, public WinHttpTransport { + + Azure::Core::Http::_detail::unique_HINTERNET m_socketHandle; + std::mutex m_sendMutex; + std::mutex m_receiveMutex; + + // Called by the + void OnUpgradedConnection( + Azure::Core::Http::_detail::unique_HINTERNET const& requestHandle) override; + + public: + /** + * @brief Construct a new WinHTTP WebSocket Transport. + * + * @param options Optional parameter to override the default options. + */ + WinHttpWebSocketTransport(WinHttpTransportOptions const& options = WinHttpTransportOptions()) + : WinHttpTransport(options) + { + } + + /** + * @brief Implements interface to send an HTTP Request and produce an HTTP RawResponse + * + * @param request an HTTP Request to be send. + * @param context A context to control the request lifetime. + * + * @return unique ptr to an HTTP RawResponse. + */ + virtual std::unique_ptr Send(Request& request, Context const& context) override; + + /** + * @brief Indicates if the transports natively websockets or not. + * + * @details For the WinHTTP websocket transport, the WinHTTP API supports websockets. + */ + virtual bool HasBuiltInWebSocketSupport() override { return true; } + + /** + * @brief Close the underlying WebSocket handle. + * + */ + virtual void Close() override; + + // Native WebSocket support methods. + /** + * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. + * + * @details Not implemented for CURL websockets because CURL does not support native websockets. + * + * @param status Status value to be sent to the remote node. Application defined. + * @param disconnectReason UTF-8 encoded reason for the disconnection. Optional. + * @param context Context for the operation. + * + */ + virtual void NativeCloseSocket(uint16_t, std::string const&, Azure::Core::Context const&) + override; + + /** + * @brief Retrieve the information associated with a WebSocket close response. + * + * Should only be called when a Receive operation returns WebSocketFrameType::CloseFrameType + * + * @param context Context for the operation. + * + * @returns a tuple containing the status code and string. + */ + virtual NativeWebSocketCloseInformation NativeGetCloseSocketInformation( + Azure::Core::Context const& context) override; + + /** + * @brief Send a frame of data to the remote node. + * + * @details Not implemented for CURL websockets because CURL does not support native + * websockets. + * + * @brief frameType Frame type sent to the server, Text or Binary. + * @brief frameData Frame data to be sent to the server. + */ + virtual void NativeSendFrame( + NativeWebSocketFrameType, + std::vector const&, + Azure::Core::Context const&) override; + + virtual NativeWebSocketReceiveInformation NativeReceiveFrame( + Azure::Core::Context const&) override; + + // Non-Native WebSocket support. + /** + * @brief This function is used when working with streams to pull more data from the wire. + * Function will try to keep pulling data from socket until the buffer is all written or + * until there is no more data to get from the socket. + * + * @details Not implemented for WinHTTP websockets because WinHTTP implements websockets + * natively. + */ + virtual size_t ReadFromSocket(uint8_t*, size_t, Context const&) override + { + throw std::runtime_error("Not implemented."); + } + + /** + * @brief This method will use sockets to write all the bytes from buffer. + * + * @details Not implemented for WinHTTP websockets because WinHTTP implements websockets + * natively. + * + */ + virtual int SendBuffer(uint8_t const*, size_t, Context const&) override + { + throw std::runtime_error("Not implemented."); + } + + bool HasWebSocketSupport() const override { return true; } + }; + +}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 6090d6b49a..459c400db3 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -24,6 +24,7 @@ #include #endif +#include #include #include #include @@ -35,41 +36,22 @@ namespace Azure { namespace Core { namespace Http { constexpr static size_t DefaultUploadChunkSize = 1024 * 64; constexpr static size_t MaximumUploadChunkSize = 1024 * 1024; - struct HandleManager final - { - Context const& m_context; - Request& m_request; - HINTERNET m_connectionHandle; - HINTERNET m_requestHandle; - - HandleManager(Request& request, Context const& context) - : m_request(request), m_context(context) - { - m_connectionHandle = NULL; - m_requestHandle = NULL; - } - - ~HandleManager() + // unique_ptr class wrapping an HINTERNET handle + class HINTERNET_deleter { + public: + void operator()(HINTERNET handle) noexcept { - // Close the handles and set them to null to avoid multiple calls to WinHTTP to close the - // handles. - if (m_requestHandle) - { - WinHttpCloseHandle(m_requestHandle); - m_requestHandle = NULL; - } - - if (m_connectionHandle) + if (handle != nullptr) { - WinHttpCloseHandle(m_connectionHandle); - m_connectionHandle = NULL; + WinHttpCloseHandle(handle); } } }; + using unique_HINTERNET = std::unique_ptr; class WinHttpStream final : public Azure::Core::IO::BodyStream { private: - std::unique_ptr m_handleManager; + _detail::unique_HINTERNET m_requestHandle; bool m_isEOF; /** @@ -99,8 +81,8 @@ namespace Azure { namespace Core { namespace Http { size_t OnRead(uint8_t* buffer, size_t count, Azure::Core::Context const& context) override; public: - WinHttpStream(std::unique_ptr handleManager, int64_t contentLength) - : m_handleManager(std::move(handleManager)), m_contentLength(contentLength), + WinHttpStream(_detail::unique_HINTERNET& requestHandle, int64_t contentLength) + : m_requestHandle(std::move(requestHandle)), m_contentLength(contentLength), m_isEOF(false), m_streamTotalRead(0) { } @@ -130,28 +112,53 @@ namespace Azure { namespace Core { namespace Http { * @brief Concrete implementation of an HTTP transport that uses WinHTTP when sending and * receiving requests and responses over the wire. */ - class WinHttpTransport final : public HttpTransport { + class WinHttpTransport : public HttpTransport { private: WinHttpTransportOptions m_options; // This should remain immutable and not be modified after calling the ctor, to avoid threading // issues. - HINTERNET m_sessionHandle = NULL; - - HINTERNET CreateSessionHandle(); - void CreateConnectionHandle(std::unique_ptr<_detail::HandleManager>& handleManager); - void CreateRequestHandle(std::unique_ptr<_detail::HandleManager>& handleManager); - void Upload(std::unique_ptr<_detail::HandleManager>& handleManager); - void SendRequest(std::unique_ptr<_detail::HandleManager>& handleManager); - void ReceiveResponse(std::unique_ptr<_detail::HandleManager>& handleManager); + _detail::unique_HINTERNET m_sessionHandle; + + _detail::unique_HINTERNET CreateSessionHandle(); + _detail::unique_HINTERNET CreateConnectionHandle( + Azure::Core::Url const& url, + Azure::Core::Context const& context); + _detail::unique_HINTERNET CreateRequestHandle( + _detail::unique_HINTERNET const& connectionHandle, + Azure::Core::Url const& url, + Azure::Core::Http::HttpMethod const& method); + void Upload( + _detail::unique_HINTERNET const& requestHandle, + Azure::Core::Http::Request& request, + Azure::Core::Context const& context); + void SendRequest( + _detail::unique_HINTERNET const& requestHandle, + Azure::Core::Http::Request& request, + Azure::Core::Context const& context); + void ReceiveResponse( + _detail::unique_HINTERNET const& requestHandle, + Azure::Core::Context const& context); int64_t GetContentLength( - std::unique_ptr<_detail::HandleManager>& handleManager, + _detail::unique_HINTERNET const& requestHandle, HttpMethod requestMethod, HttpStatusCode responseStatusCode); std::unique_ptr SendRequestAndGetResponse( - std::unique_ptr<_detail::HandleManager> handleManager, + _detail::unique_HINTERNET& requestHandle, HttpMethod requestMethod); + // Callback to allow a derived transport to extract the request handle. Used for WebSocket + // transports. + protected: + virtual void OnUpgradedConnection(_detail::unique_HINTERNET const&){}; + /** + * @brief Throw an exception based on the Win32 Error code + * + * @param exceptionMessage Message describing error. + * @param error Win32 Error code. + */ + void GetErrorAndThrow(const std::string& exceptionMessage, DWORD error = GetLastError()); + public: /** * @brief Constructs `%WinHttpTransport`. @@ -170,16 +177,11 @@ namespace Azure { namespace Core { namespace Http { */ virtual std::unique_ptr Send(Request& request, Context const& context) override; - ~WinHttpTransport() - { - // Close the handles and set them to null to avoid multiple calls to WinHTTP to close the - // handles. - if (m_sessionHandle) - { - WinHttpCloseHandle(m_sessionHandle); - m_sessionHandle = NULL; - } - } + // 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 ~WinHttpTransport() = default; }; }}} // namespace Azure::Core::Http diff --git a/sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_hash.hpp b/sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_hash.hpp index 446243fe69..87ecf1ddc1 100644 --- a/sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_hash.hpp +++ b/sdk/core/azure-core/inc/azure/core/internal/cryptography/sha_hash.hpp @@ -17,6 +17,62 @@ namespace Azure { namespace Core { namespace Cryptography { namespace _internal { + /** + * @brief Defines #Sha1Hash. + * + * @warning SHA1 is a deprecated hashing algorithm and SHOULD NOT be used, + * unless it is used to implement a specific protocol (for instance, RFC 6455 and + * RFC 7517 both require the use of SHA1 hashes). SHA256, SHA384, and SHA512 are all preferred to + * SHA1. + * + */ + class Sha1Hash final : public Azure::Core::Cryptography::Hash { + public: + /** + * @brief Construct a default instance of #Sha1Hash. + * + */ + Sha1Hash(); + + /** + * @brief Cleanup any state when destroying the instance of #Sha1Hash. + * + */ + ~Sha1Hash() {} + + private: + /** + * @brief Underlying implementation based on the OS. + * + */ + std::unique_ptr m_portableImplementation; + + /** + * @brief Computes the hash value of the specified binary input data, including any previously + * appended. + * @param data The pointer to binary data to compute the hash value for. + * @param length The size of the data provided. + * @return The computed SHA1 hash value corresponding to the input provided including any + * previously appended. + */ + std::vector OnFinal(const uint8_t* data, size_t length) override + { + return m_portableImplementation->Final(data, length); + } + + /** + * @brief Used to append partial binary input data to compute the SHA1 hash in a streaming + * fashion. + * @remark Once all the data has been added, call #Final() to get the computed hash value. + * @param data The pointer to the current block of binary data that is used for hash + * calculation. + * @param length The size of the data provided. + */ + void OnAppend(const uint8_t* data, size_t length) override + { + return m_portableImplementation->Append(data, length); + } + }; /** * @brief Defines #Sha256Hash. * diff --git a/sdk/core/azure-core/src/base64.cpp b/sdk/core/azure-core/src/base64.cpp index 867e796bc5..a2e214c5bc 100644 --- a/sdk/core/azure-core/src/base64.cpp +++ b/sdk/core/azure-core/src/base64.cpp @@ -313,10 +313,10 @@ static void Base64WriteIntAsFourBytes(char* destination, int32_t value) destination[0] = static_cast(value & 0xFF); } -std::string Base64Encode(const std::vector& data) +std::string Base64Encode(uint8_t const* const data, size_t length) { size_t sourceIndex = 0; - auto inputSize = data.size(); + auto inputSize = length; auto maxEncodedSize = ((inputSize + 2) / 3) * 4; // Use a string with size to the max possible result std::string encodedResult(maxEncodedSize, '0'); @@ -490,7 +490,7 @@ namespace Azure { namespace Core { std::string Convert::Base64Encode(const std::vector& data) { - return ::Base64Encode(data); + return ::Base64Encode(data.data(), data.size()); } std::vector Convert::Base64Decode(const std::string& text) diff --git a/sdk/core/azure-core/src/cryptography/md5.cpp b/sdk/core/azure-core/src/cryptography/md5.cpp index a4bbaa217c..79a4a1210f 100644 --- a/sdk/core/azure-core/src/cryptography/md5.cpp +++ b/sdk/core/azure-core/src/cryptography/md5.cpp @@ -194,7 +194,6 @@ class Md5OpenSSL final : public Azure::Core::Cryptography::Hash { } if (1 != EVP_DigestInit_ex(m_context, EVP_md5(), NULL)) { - EVP_MD_CTX_free(m_context); throw std::runtime_error("Crypto error while init Md5Hash."); } } diff --git a/sdk/core/azure-core/src/cryptography/sha_hash.cpp b/sdk/core/azure-core/src/cryptography/sha_hash.cpp index 3ef52b4fb9..95b06b7d7a 100644 --- a/sdk/core/azure-core/src/cryptography/sha_hash.cpp +++ b/sdk/core/azure-core/src/cryptography/sha_hash.cpp @@ -26,6 +26,7 @@ namespace { enum class SHASize { + SHA1, SHA256, SHA384, SHA512 @@ -65,6 +66,13 @@ class SHAWithOpenSSL final : public Azure::Core::Cryptography::Hash { } switch (size) { + case SHASize::SHA1: { + if (1 != EVP_DigestInit_ex(m_context, EVP_sha1(), NULL)) + { + throw std::runtime_error("Crypto error while initializing Sha1Hash."); + } + break; + } case SHASize::SHA256: { if (1 != EVP_DigestInit_ex(m_context, EVP_sha256(), NULL)) { @@ -97,6 +105,11 @@ class SHAWithOpenSSL final : public Azure::Core::Cryptography::Hash { } // namespace +Azure::Core::Cryptography::_internal::Sha1Hash::Sha1Hash() + : m_portableImplementation(std::make_unique(SHASize::SHA1)) +{ +} + Azure::Core::Cryptography::_internal::Sha256Hash::Sha256Hash() : m_portableImplementation(std::make_unique(SHASize::SHA256)) { @@ -222,6 +235,11 @@ class SHAWithBCrypt final : public Azure::Core::Cryptography::Hash { } // namespace +Azure::Core::Cryptography::_internal::Sha1Hash::Sha1Hash() + : m_portableImplementation(std::make_unique(BCRYPT_SHA1_ALGORITHM)) +{ +} + Azure::Core::Cryptography::_internal::Sha256Hash::Sha256Hash() : m_portableImplementation(std::make_unique(BCRYPT_SHA256_ALGORITHM)) { diff --git a/sdk/core/azure-core/src/environment_log_level_listener.cpp b/sdk/core/azure-core/src/environment_log_level_listener.cpp index ffcf1e6076..98ef17dcf3 100644 --- a/sdk/core/azure-core/src/environment_log_level_listener.cpp +++ b/sdk/core/azure-core/src/environment_log_level_listener.cpp @@ -9,6 +9,7 @@ #include #include +#include using Azure::Core::_internal::Environment; using namespace Azure::Core::Diagnostics; @@ -114,7 +115,8 @@ EnvironmentLogLevelListener::GetLogListener() << Azure::DateTime(std::chrono::system_clock::now()) .ToString( DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits) - << "] " << LogLevelToConsoleString(level) << " : " << message << std::endl; + << " T: " << std::this_thread::get_id() << "] " << LogLevelToConsoleString(level) + << " : " << message << std::endl; }; return consoleLogger; diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 6c5123907b..ea65dbd39a 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -39,9 +39,13 @@ template // C26812: The enum type 'CURLoption' is un-scoped. Prefer 'enum class' over 'enum' (Enum.3) #pragma warning(disable : 26812) #endif -inline bool SetLibcurlOption(CURL* handle, CURLoption option, T value, CURLcode* outError) +inline bool SetLibcurlOption( + Azure::Core::Http::_detail::unique_CURL const& handle, + CURLoption option, + T value, + CURLcode* outError) { - *outError = curl_easy_setopt(handle, option, value); + *outError = curl_easy_setopt(handle.get(), option, value); return *outError == CURLE_OK; } #if defined(_MSC_VER) @@ -134,15 +138,7 @@ void WinSocketSetBuffSize(curl_socket_t socket) // if WSAloctl succeeded (returned 0), set the socket buffer size. // Specifies the total per-socket buffer space reserved for sends. // https://docs.microsoft.com/windows/win32/api/winsock/nf-winsock-setsockopt - auto result = setsockopt(socket, SOL_SOCKET, SO_SNDBUF, (const char*)&ideal, sizeof(ideal)); - - if (Log::ShouldWrite(Logger::Level::Verbose)) - { - Log::Write( - Logger::Level::Verbose, - LogMsgPrefix + "Windows - calling setsockopt after uploading chunk. ideal = " - + std::to_string(ideal) + " result = " + std::to_string(result)); - } + setsockopt(socket, SOL_SOCKET, SO_SNDBUF, (const char*)&ideal, sizeof(ideal)); } } #endif @@ -321,6 +317,14 @@ std::unique_ptr CurlTransport::Send(Request& request, Context const throw Azure::Core::Http::TransportException( "Error while sending request. " + std::string(curl_easy_strerror(performing))); } + if (HasWebSocketSupport()) + { + std::unique_ptr upgradedConnection(session->ExtractConnection()); + if (upgradedConnection) + { + OnUpgradedConnection(std::move(upgradedConnection)); + } + } Log::Write( Logger::Level::Verbose, @@ -421,6 +425,18 @@ CURLcode CurlSession::Perform(Context const& context) return result; } +std::unique_ptr CurlSession::ExtractConnection() +{ + if (m_connectionUpgraded) + { + return std::move(m_connection); + } + else + { + return nullptr; + } +} + // Creates an HTTP Response with specific bodyType static std::unique_ptr CreateHTTPResponse( uint8_t const* const begin, @@ -484,7 +500,10 @@ CURLcode CurlConnection::SendBuffer( { size_t sentBytesPerRequest = 0; sendResult = curl_easy_send( - m_handle, buffer + sentBytesTotal, bufferSize - sentBytesTotal, &sentBytesPerRequest); + m_handle.get(), + buffer + sentBytesTotal, + bufferSize - sentBytesTotal, + &sentBytesPerRequest); switch (sendResult) { @@ -719,11 +738,19 @@ void CurlSession::ReadStatusLineAndHeadersFromRawResponse( auto connectionHeader = headers.find("connection"); if (connectionHeader != headers.end()) { - if (connectionHeader->second == "close") + if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( + connectionHeader->second, "close")) { // Use connection shut-down so it won't be moved it back to the connection pool. m_connection->Shutdown(); } + // If the server indicated that the connection header is "upgrade", it means that this + // is a WebSocket connection so the caller may be upgrading the connection. + if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( + connectionHeader->second, "upgrade")) + { + m_connectionUpgraded = true; + } } auto isContentLengthHeaderInResponse = headers.find("content-length"); @@ -880,6 +907,11 @@ size_t CurlSession::OnRead(uint8_t* buffer, size_t count, Context const& context return 0; } + // If we no longer have a connection, read 0 bytes. + if (!m_connection) + { + return 0; + } // Read from socket when no more data on internal buffer // For chunk request, read a chunk based on chunk size totalRead = m_connection->ReadFromSocket(buffer, static_cast(readRequestLength), context); @@ -932,8 +964,7 @@ size_t CurlConnection::ReadFromSocket(uint8_t* buffer, size_t bufferSize, Contex size_t readBytes = 0; for (CURLcode readResult = CURLE_AGAIN; readResult == CURLE_AGAIN;) { - readResult = curl_easy_recv(m_handle, buffer, bufferSize, &readBytes); - + readResult = curl_easy_recv(m_handle.get(), buffer, bufferSize, &readBytes); switch (readResult) { case CURLE_AGAIN: { @@ -1294,15 +1325,12 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo return connection; } } - lock.unlock(); } // Creating a new connection is thread safe. No need to lock mutex here. // No available connection for the pool for the required host. Create one Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Spawn new connection."); - - auto newHandle = std::unique_ptr(curl_easy_init()); - + unique_CURL newHandle(curl_easy_init(), CURL_deleter{}); if (!newHandle) { throw Azure::Core::Http::TransportException( @@ -1312,22 +1340,21 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo CURLcode result; // Libcurl setup before open connection (url, connect_only, timeout) - if (!SetLibcurlOption( - newHandle.get(), CURLOPT_URL, request.GetUrl().GetAbsoluteUrl().data(), &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_URL, request.GetUrl().GetAbsoluteUrl().data(), &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " + std::string(curl_easy_strerror(result))); } - if (port != 0 && !SetLibcurlOption(newHandle.get(), CURLOPT_PORT, port, &result)) + if (port != 0 && !SetLibcurlOption(newHandle, CURLOPT_PORT, port, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " + std::string(curl_easy_strerror(result))); } - if (!SetLibcurlOption(newHandle.get(), CURLOPT_CONNECT_ONLY, 1L, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_CONNECT_ONLY, 1L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " @@ -1337,7 +1364,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo // Set timeout to 24h. Libcurl will fail uploading on windows if timeout is: // timeout >= 25 days. Fails as soon as trying to upload any data // 25 days < timeout > 1 days. Fail on huge uploads ( > 1GB) - if (!SetLibcurlOption(newHandle.get(), CURLOPT_TIMEOUT, 60L * 60L * 24L, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_TIMEOUT, 60L * 60L * 24L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " @@ -1346,8 +1373,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (options.ConnectionTimeout != Azure::Core::Http::_detail::DefaultConnectionTimeout) { - if (!SetLibcurlOption( - newHandle.get(), CURLOPT_CONNECTTIMEOUT_MS, options.ConnectionTimeout, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_CONNECTTIMEOUT_MS, options.ConnectionTimeout, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1362,7 +1388,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo */ if (options.Proxy) { - if (!SetLibcurlOption(newHandle.get(), CURLOPT_PROXY, options.Proxy->c_str(), &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_PROXY, options.Proxy->c_str(), &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1373,7 +1399,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (!options.CAInfo.empty()) { - if (!SetLibcurlOption(newHandle.get(), CURLOPT_CAINFO, options.CAInfo.c_str(), &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_CAINFO, options.CAInfo.c_str(), &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1388,7 +1414,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo sslOption |= CURLSSLOPT_NO_REVOKE; } - if (!SetLibcurlOption(newHandle.get(), CURLOPT_SSL_OPTIONS, sslOption, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_SSL_OPTIONS, sslOption, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1398,7 +1424,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (!options.SslVerifyPeer) { - if (!SetLibcurlOption(newHandle.get(), CURLOPT_SSL_VERIFYPEER, 0L, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_SSL_VERIFYPEER, 0L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1408,7 +1434,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (options.NoSignal) { - if (!SetLibcurlOption(newHandle.get(), CURLOPT_NOSIGNAL, 1L, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_NOSIGNAL, 1L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1420,7 +1446,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo // curl-transport adapter supports only HTTP/1.1 // https://github.com/Azure/azure-sdk-for-cpp/issues/2848 // The libcurl uses HTTP/2 by default, if it can be negotiated with a server on handshake. - if (!SetLibcurlOption(newHandle.get(), CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1428,7 +1454,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo } // Make libcurl to support only TLS v1.2 or later - if (!SetLibcurlOption(newHandle.get(), CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2, &result)) + if (!SetLibcurlOption(newHandle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1443,7 +1469,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo + std::string(curl_easy_strerror(performResult))); } - return std::make_unique(newHandle.release(), connectionKey); + return std::make_unique(std::move(newHandle), connectionKey); } // Move the connection back to the connection pool. Push it to the front so it becomes the @@ -1507,5 +1533,4 @@ void CurlConnectionPool::MoveConnectionBackToPool( { Log::Write(Logger::Level::Verbose, "Clean thread running. Won't start a new one."); } - lock.unlock(); } diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp index dff3fad2f1..fdf1334360 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp @@ -126,18 +126,4 @@ namespace Azure { namespace Core { namespace Http { namespace _detail { std::thread m_cleanThread; }; - /** - * @brief std::default_delete for the CURL * type , used for std::unique_ptr - * - */ - class CURL_deleter { - public: - void operator()(CURL* handle) noexcept - { - if (handle != nullptr) - { - curl_easy_cleanup(handle); - } - } - }; }}}} // namespace Azure::Core::Http::_detail diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index 4965848104..705ec2d862 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -47,6 +47,23 @@ namespace Azure { namespace Core { namespace Http { // Define the maximun allowed connections per host-index in the pool. If this number is reached // for the host-index, next connections trying to be added to the pool will be ignored. constexpr static int32_t MaxConnectionsPerIndex = 1024; + + /** + * @brief std::default_delete for the CURL * type , used for std::unique_ptr + * + */ + class CURL_deleter { + public: + void operator()(CURL* handle) noexcept + { + if (handle != nullptr) + { + curl_easy_cleanup(handle); + } + } + }; + using unique_CURL = std::unique_ptr; + } // namespace _detail /** @@ -122,7 +139,7 @@ namespace Azure { namespace Core { namespace Http { */ class CurlConnection final : public CurlNetworkConnection { private: - CURL* m_handle; + _detail::unique_CURL m_handle; curl_socket_t m_curlSocket; std::chrono::steady_clock::time_point m_lastUseTime; std::string m_connectionKey; @@ -135,8 +152,8 @@ namespace Azure { namespace Core { namespace Http { * * @param connectionPropertiesKey CURL connection properties key */ - CurlConnection(CURL* handle, std::string connectionPropertiesKey) - : m_handle(handle), m_connectionKey(std::move(connectionPropertiesKey)) + CurlConnection(_detail::unique_CURL&& handle, std::string connectionPropertiesKey) + : m_handle(std::move(handle)), m_connectionKey(std::move(connectionPropertiesKey)) { // Get the socket that libcurl is using from handle. Will use this to wait while // reading/writing @@ -146,7 +163,7 @@ namespace Azure { namespace Core { namespace Http { // C26812: The enum type 'CURLcode' is un-scoped. Prefer 'enum class' over 'enum' (Enum.3) #pragma warning(disable : 26812) #endif - auto result = curl_easy_getinfo(m_handle, CURLINFO_ACTIVESOCKET, &m_curlSocket); + auto result = curl_easy_getinfo(m_handle.get(), CURLINFO_ACTIVESOCKET, &m_curlSocket); #if defined(_MSC_VER) #pragma warning(pop) #endif @@ -162,7 +179,7 @@ namespace Azure { namespace Core { namespace Http { * @brief Destructor. * @details Cleans up CURL (invokes `curl_easy_cleanup()`). */ - ~CurlConnection() override { curl_easy_cleanup(this->m_handle); } + ~CurlConnection() override {} std::string const& GetConnectionKey() const override { return this->m_connectionKey; } diff --git a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp index 3e39a2c739..be77f85fbe 100644 --- a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp @@ -274,6 +274,12 @@ namespace Azure { namespace Core { namespace Http { size_t m_sessionTotalRead = 0; + /** + * @brief If True, the connection is going to be "upgraded" into a websocket connection, so + * block moving the connection to the pool. + */ + bool m_connectionUpgraded = false; + /** * @brief Internal buffer from a session used to read bytes from a socket. This buffer is only * used while constructing an HTTP RawResponse without adding a body to it. Customers would @@ -388,7 +394,7 @@ namespace Azure { namespace Core { namespace Http { // By not moving the connection back to the pool, it gets destroyed calling the connection // destructor to clean libcurl handle and close the connection. // IsEOF will also handle a connection that fail to complete an upload request. - if (IsEOF() && m_keepAlive) + if (IsEOF() && m_keepAlive && !m_connectionUpgraded) { _detail::CurlConnectionPool::g_curlConnectionPool.MoveConnectionBackToPool( std::move(m_connection), m_lastStatusCode); @@ -418,6 +424,13 @@ namespace Azure { namespace Core { namespace Http { * @return The size of the payload. */ int64_t Length() const override { return m_contentLength; } + + /** + * @brief Return the network connection if the server indicated that the connection is upgraded. + * + * @return The network connection, or null if the connection was not upgraded. + */ + std::unique_ptr ExtractConnection(); }; }}} // namespace Azure::Core::Http diff --git a/sdk/core/azure-core/src/http/curl/curl_websockets.cpp b/sdk/core/azure-core/src/http/curl/curl_websockets.cpp new file mode 100644 index 0000000000..49e182caee --- /dev/null +++ b/sdk/core/azure-core/src/http/curl/curl_websockets.cpp @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +#include "azure/core/http/http.hpp" +#include "azure/core/http/policies/policy.hpp" +#include "azure/core/http/transport.hpp" +#include "azure/core/http/websockets/curl_websockets_transport.hpp" +#include "azure/core/internal/diagnostics/log.hpp" +#include "azure/core/platform.hpp" + +// Private include +#include "curl_connection_private.hpp" + +#if defined(AZ_PLATFORM_POSIX) +#include // for poll() +#include // for socket shutdown +#elif defined(AZ_PLATFORM_WINDOWS) +#if !defined(WIN32_LEAN_AND_MEAN) +#define WIN32_LEAN_AND_MEAN +#endif +#if !defined(NOMINMAX) +#define NOMINMAX +#endif +#include +#include // for WSAPoll(); +#endif + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { + + void CurlWebSocketTransport::Close() { m_upgradedConnection->Shutdown(); } + + // Send an HTTP request to the remote server. + std::unique_ptr CurlWebSocketTransport::Send( + Request& request, + Context const& context) + { + // CURL doesn't understand the ws and wss protocols, so change the URL to be http based. + std::string requestScheme(request.GetUrl().GetScheme()); + if (requestScheme == "wss" || requestScheme == "ws") + { + if (requestScheme == "wss") + { + request.GetUrl().SetScheme("https"); + } + else + { + request.GetUrl().SetScheme("http"); + } + } + return CurlTransport::Send(request, context); + } + + size_t CurlWebSocketTransport::ReadFromSocket( + uint8_t* buffer, + size_t bufferSize, + Context const& context) + { + return m_upgradedConnection->ReadFromSocket(buffer, bufferSize, context); + } + + /** + * @brief This method will use libcurl socket to write all the bytes from buffer. + * + */ + int CurlWebSocketTransport::SendBuffer( + uint8_t const* buffer, + size_t bufferSize, + Context const& context) + { + return m_upgradedConnection->SendBuffer(buffer, bufferSize, context); + } + + void CurlWebSocketTransport::OnUpgradedConnection( + std::unique_ptr&& upgradedConnection) + { + // Note that m_upgradedConnection is a std::shared_ptr. We define it as a std::shared_ptr + // because a std::shared_ptr can be declared on an incomplete type, while a std::unique_ptr + // cannot. + m_upgradedConnection = std::move(upgradedConnection); + } + +}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/src/http/websockets/websockets.cpp b/sdk/core/azure-core/src/http/websockets/websockets.cpp new file mode 100644 index 0000000000..65102f31ab --- /dev/null +++ b/sdk/core/azure-core/src/http/websockets/websockets.cpp @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +#include "azure/core/http/websockets/websockets.hpp" +#include "azure/core/context.hpp" +#include "websockets_impl.hpp" + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { namespace _internal { + + WebSocket::WebSocket(Azure::Core::Url const& remoteUrl, WebSocketOptions const& options) + : m_socketImplementation( + std::make_unique( + remoteUrl, + options)) + + { + } + WebSocket::~WebSocket() {} + + void WebSocket::Open(Azure::Core::Context const& context) + { + m_socketImplementation->Open(context); + } + void WebSocket::Close(Azure::Core::Context const& context) + { + m_socketImplementation->Close( + static_cast(WebSocketErrorCode::EndpointDisappearing), {}, context); + } + void WebSocket::Close( + uint16_t closeStatus, + std::string const& closeReason, + Azure::Core::Context const& context) + { + m_socketImplementation->Close(closeStatus, closeReason, context); + } + + void WebSocket::SendFrame( + std::string const& textFrame, + bool isFinalFrame, + Azure::Core::Context const& context) + { + m_socketImplementation->SendFrame(textFrame, isFinalFrame, context); + } + + void WebSocket::SendFrame( + std::vector const& binaryFrame, + bool isFinalFrame, + Azure::Core::Context const& context) + { + m_socketImplementation->SendFrame(binaryFrame, isFinalFrame, context); + } + + WebSocketStatistics WebSocket::GetStatistics() const + { + return m_socketImplementation->GetStatistics(); + } + + bool WebSocket::HasBuiltInWebSocketSupport() const + { + return m_socketImplementation->HasBuiltInWebSocketSupport(); + } + + std::shared_ptr WebSocket::ReceiveFrame(Azure::Core::Context const& context) + { + return m_socketImplementation->ReceiveFrame(context); + } + + void WebSocket::AddHeader(std::string const& headerName, std::string const& headerValue) + { + m_socketImplementation->AddHeader(headerName, headerValue); + } + std::string const& WebSocket::GetNegotiatedProtocol() const + { + return m_socketImplementation->GetNegotiatedProtocol(); + } + + bool WebSocket::IsOpen() const { return m_socketImplementation->IsOpen(); } + + std::shared_ptr WebSocketFrame::AsTextFrame() + { + if (FrameType != WebSocketFrameType::TextFrameReceived) + { + throw std::logic_error("Cannot cast to TextFrameReceived."); + } + return static_cast(this)->shared_from_this(); + } + + std::shared_ptr WebSocketFrame::AsBinaryFrame() + { + if (FrameType != WebSocketFrameType::BinaryFrameReceived) + { + throw std::logic_error("Cannot cast to BinaryFrameReceived."); + } + return static_cast(this)->shared_from_this(); + } + + std::shared_ptr WebSocketFrame::AsPeerCloseFrame() + { + if (FrameType != WebSocketFrameType::PeerClosedReceived) + { + throw std::logic_error("Cannot cast to PeerClose."); + } + return static_cast(this)->shared_from_this(); + } + +}}}}} // namespace Azure::Core::Http::WebSockets::_internal diff --git a/sdk/core/azure-core/src/http/websockets/websockets_impl.cpp b/sdk/core/azure-core/src/http/websockets/websockets_impl.cpp new file mode 100644 index 0000000000..90a9a69e33 --- /dev/null +++ b/sdk/core/azure-core/src/http/websockets/websockets_impl.cpp @@ -0,0 +1,879 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT +#include "websockets_impl.hpp" +#include "azure/core/base64.hpp" +#include "azure/core/http/policies/policy.hpp" +#include "azure/core/internal/cryptography/sha_hash.hpp" +// SUPPORT_NATIVE_TRANSPORT indicates if WinHTTP should be compiled with native transport support +// or not. +// Note that this is primarily required to improve the code coverage numbers in the CI pipeline. +#if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) +#include "azure/core/http/websockets/win_http_websockets_transport.hpp" +#define SUPPORT_NATIVE_TRANSPORT 1 +#elif defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) +#include "azure/core/http/websockets/curl_websockets_transport.hpp" +#define SUPPORT_NATIVE_TRANSPORT 0 +#endif +#include "azure/core/internal/diagnostics/log.hpp" +#include +#include +#include +#include +#include +#include +#include + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { namespace _detail { + using namespace Azure::Core::Http::WebSockets::_internal; + using namespace Azure::Core::Diagnostics::_internal; + using namespace Azure::Core::Diagnostics; + using namespace std::chrono_literals; + + namespace { + std::string HexEncode(std::vector const& data, size_t length) + { + std::stringstream ss; + for (size_t i = 0; i < std::min(data.size(), length); i++) + { + ss << std::hex << std::setfill('0') << std::setw(2) << static_cast(data[i]); + } + return ss.str(); + } + } // namespace + + WebSocketImplementation::WebSocketImplementation( + Azure::Core::Url const& remoteUrl, + WebSocketOptions const& options) + : m_remoteUrl(remoteUrl), m_options(options), m_pingThread(this, m_options.PingInterval) + { + } + + void WebSocketImplementation::Open(Azure::Core::Context const& context) + { + if (m_state != SocketState::Invalid && m_state != SocketState::Closed) + { + throw std::runtime_error( + "Socket in unexpected state: " + std::to_string(static_cast(m_state))); + } + m_state = SocketState::Opening; + +#if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) + WinHttpTransportOptions transportOptions; + auto winHttpTransport + = std::make_shared( + transportOptions); + m_transport = std::static_pointer_cast(winHttpTransport); + m_options.Transport.Transport = std::static_pointer_cast(winHttpTransport); +#elif defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) + CurlWebSocketTransportOptions transportOptions; + transportOptions.HttpKeepAlive = false; + auto curlWebSockets + = std::make_shared(transportOptions); + + m_transport = std::static_pointer_cast(curlWebSockets); + m_options.Transport.Transport = std::static_pointer_cast(curlWebSockets); +#endif + + std::vector> perCallPolicies{}; + std::vector> perRetryPolicies{}; + // If the caller has told us a service name, add the telemetry policy to the pipeline to add + // a user agent header to the request. + if (!m_options.ServiceName.empty()) + { + perCallPolicies.push_back( + std::make_unique( + m_options.ServiceName, m_options.ServiceVersion, m_options.Telemetry)); + } + Azure::Core::Http::_internal::HttpPipeline openPipeline( + m_options, std::move(perRetryPolicies), std::move(perCallPolicies)); + + Azure::Core::Http::Request openSocketRequest( + Azure::Core::Http::HttpMethod::Get, m_remoteUrl, false); + + // Generate the random request key. Only used when the transport doesn't support websockets + // natively. + auto randomKey = GenerateRandomKey(); + auto encodedKey = Azure::Core::Convert::Base64Encode(randomKey); + if (!m_transport->HasBuiltInWebSocketSupport()) + { + // If the transport doesn't support WebSockets natively, set the standardized WebSocket + // upgrade headers. + openSocketRequest.SetHeader("Upgrade", "websocket"); + openSocketRequest.SetHeader("Connection", "upgrade"); + openSocketRequest.SetHeader("Sec-WebSocket-Version", "13"); + openSocketRequest.SetHeader("Sec-WebSocket-Key", encodedKey); + } + if (!m_options.Protocols.empty()) + { + + std::string protocols; + for (auto const& protocol : m_options.Protocols) + { + protocols += protocol; + protocols += ", "; + } + protocols = protocols.substr(0, protocols.size() - 2); + openSocketRequest.SetHeader("Sec-WebSocket-Protocol", protocols); + } + for (auto const& additionalHeader : m_headers) + { + openSocketRequest.SetHeader(additionalHeader.first, additionalHeader.second); + } + std::string remoteOrigin; + remoteOrigin = m_remoteUrl.GetScheme(); + remoteOrigin += "://"; + remoteOrigin += m_remoteUrl.GetHost(); + openSocketRequest.SetHeader("Origin", remoteOrigin); + + // Send the connect request to the WebSocket server. + auto response = openPipeline.Send(openSocketRequest, context); + + // Ensure that the server thinks we're switching protocols. If it doesn't, + // fail immediately. + if (response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::SwitchingProtocols) + { + throw Azure::Core::Http::TransportException("Unexpected handshake response"); + } + + // Prove that the server received this socket request. + auto& responseHeaders = response->GetHeaders(); + if (!m_transport->HasBuiltInWebSocketSupport()) + { + auto socketAccept(responseHeaders.find("Sec-WebSocket-Accept")); + if (socketAccept == responseHeaders.end()) + { + throw Azure::Core::Http::TransportException("Missing Sec-WebSocket-Accept header"); + } + // Verify that the WebSocket server received *this* open request. + else + { + VerifySocketAccept(encodedKey, socketAccept->second); + } + m_initialBodyStream = response->ExtractBodyStream(); + m_pingThread.Start(m_transport); + } + + // Remember the protocol that the client chose. + auto chosenProtocol = responseHeaders.find("Sec-WebSocket-Protocol"); + if (chosenProtocol != responseHeaders.end()) + { + m_chosenProtocol = chosenProtocol->second; + } + + m_state = SocketState::Open; + } + bool WebSocketImplementation::HasBuiltInWebSocketSupport() + { + std::lock_guard lock(m_stateMutex); + m_stateOwner = std::this_thread::get_id(); + if (m_state != SocketState::Open) + { + throw std::runtime_error( + "Socket is not open." + std::to_string(static_cast(m_state))); + } + return m_transport->HasBuiltInWebSocketSupport(); + } + + std::string const& WebSocketImplementation::GetNegotiatedProtocol() + { + std::lock_guard lock(m_stateMutex); + m_stateOwner = std::this_thread::get_id(); + if (m_state != SocketState::Open) + { + throw std::runtime_error( + "Socket is not open." + std::to_string(static_cast(m_state))); + } + return m_chosenProtocol; + } + + void WebSocketImplementation::AddHeader(std::string const& header, std::string const& headerValue) + { + std::lock_guard lock(m_stateMutex); + m_stateOwner = std::this_thread::get_id(); + if (m_state != SocketState::Closed && m_state != SocketState::Invalid) + { + throw std::runtime_error("AddHeader can only be called on closed sockets."); + } + m_headers.emplace(std::make_pair(header, headerValue)); + } + + void WebSocketImplementation::Close( + uint16_t closeStatus, + std::string const& closeReason, + Azure::Core::Context const& context) + { + std::unique_lock lock(m_stateMutex); + m_stateOwner = std::this_thread::get_id(); + + // If we're closing an already closed socket, we're done. + if (m_state == SocketState::Closed) + { + return; + } + if (m_state != SocketState::Open) + { + throw std::runtime_error( + "Socket is not open." + std::to_string(static_cast(m_state))); + } + m_state = SocketState::Closing; +#if SUPPORT_NATIVE_TRANSPORT + if (m_transport->HasBuiltInWebSocketSupport()) + { + m_transport->NativeCloseSocket(closeStatus, closeReason.c_str(), context); + } + else +#endif + { + // Send a going away message to the server. + std::vector closePayload; + closePayload.push_back(closeStatus >> 8); + closePayload.push_back(closeStatus & 0xff); + closePayload.insert(closePayload.end(), closeReason.begin(), closeReason.end()); + std::vector closeFrame = EncodeFrame(SocketOpcode::Close, true, closePayload); + SendTransportBuffer(closeFrame, context); + + // Unlock the state mutex before waiting for the close response to be received. + lock.unlock(); + // Drain the incoming series of frames from the server. + // Note that there might be in-flight frames that were sent from the other end of the + // WebSocket that we don't care about any more (since we're closing the WebSocket). So + // drain those frames. + auto closeResponse = ReceiveTransportFrame(context); + while (closeResponse && closeResponse->Opcode != SocketOpcode::Close) + { + m_receiveStatistics.FramesDroppedByClose++; + Log::Write( + Logger::Level::Warning, + "Received unexpected frame during close. Opcode: " + + std::to_string(static_cast(closeResponse->Opcode))); + closeResponse = ReceiveTransportFrame(context); + } + + // Re-acquire the state lock once we've received the close response. + lock.lock(); + m_stateOwner = std::this_thread::get_id(); + } + // Close the socket - after this point, the m_transport is invalid. + m_pingThread.Shutdown(); + m_transport->Close(); + m_state = SocketState::Closed; + } + + void WebSocketImplementation::SendFrame( + std::string const& textFrame, + bool isFinalFrame, + Azure::Core::Context const& context) + { + std::lock_guard lock(m_stateMutex); + m_stateOwner = std::this_thread::get_id(); + if (m_state != SocketState::Open) + { + throw std::runtime_error( + "Socket is not open." + std::to_string(static_cast(m_state))); + } + std::vector utf8text(textFrame.begin(), textFrame.end()); + m_receiveStatistics.TextFramesSent++; +#if SUPPORT_NATIVE_TRANSPORT + if (m_transport->HasBuiltInWebSocketSupport()) + { + m_transport->NativeSendFrame( + (isFinalFrame ? WebSocketTransport::NativeWebSocketFrameType::Text + : WebSocketTransport::NativeWebSocketFrameType::TextFragment), + utf8text, + context); + } + else +#endif + { + std::vector sendFrame = EncodeFrame(SocketOpcode::TextFrame, isFinalFrame, utf8text); + SendTransportBuffer(sendFrame, context); + } + } + + void WebSocketImplementation::SendFrame( + std::vector const& binaryFrame, + bool isFinalFrame, + Azure::Core::Context const& context) + { + std::lock_guard lock(m_stateMutex); + m_stateOwner = std::this_thread::get_id(); + + if (m_state != SocketState::Open) + { + throw std::runtime_error( + "Socket is not open." + std::to_string(static_cast(m_state))); + } + m_receiveStatistics.BinaryFramesSent++; +#if SUPPORT_NATIVE_TRANSPORT + if (m_transport->HasBuiltInWebSocketSupport()) + { + m_transport->NativeSendFrame( + (isFinalFrame ? WebSocketTransport::NativeWebSocketFrameType::Binary + : WebSocketTransport::NativeWebSocketFrameType::BinaryFragment), + binaryFrame, + context); + } + else +#endif + { + std::vector sendFrame + = EncodeFrame(SocketOpcode::BinaryFrame, isFinalFrame, binaryFrame); + + SendTransportBuffer(sendFrame, context); + } + } + + std::shared_ptr WebSocketImplementation::ReceiveFrame( + Azure::Core::Context const& context) + { + std::unique_lock lock(m_stateMutex); + m_stateOwner = std::this_thread::get_id(); + + if (m_state != SocketState::Open && m_state != SocketState::Closing) + { + throw std::runtime_error( + "Socket is not open." + std::to_string(static_cast(m_state))); + } + + // Unlock the state lock to allow other threads to run. If we don't, we might end up in in a + // situation where the server won't respond to the this client because all the client threads + // are blocked on the state lock. + lock.unlock(); + + std::shared_ptr frame; + // Loop until we receive an returnable incoming frame. + // If the incoming frame is returnable, we return the value from the frame. + while (true) + { + frame = ReceiveTransportFrame(context); + if (frame) + { + switch (frame->Opcode) + { + // When we receive a "ping" frame, we want to send a Pong frame back to the server. + case SocketOpcode::Ping: + Log::Write( + Logger::Level::Verbose, "Received Ping frame: " + HexEncode(frame->Payload, 16)); + SendPong(frame->Payload, context); + break; + + // We want to ignore all incoming "Pong" frames. + case SocketOpcode::Pong: + Log::Write( + Logger::Level::Verbose, "Received Pong frame: " + HexEncode(frame->Payload, 16)); + break; + + case SocketOpcode::BinaryFrame: + m_currentMessageType = SocketMessageType::Binary; + return std::shared_ptr(new WebSocketBinaryFrame( + frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); + + case SocketOpcode::TextFrame: + m_currentMessageType = SocketMessageType::Text; + return std::shared_ptr(new WebSocketTextFrame( + frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); + + case SocketOpcode::Close: { + if (frame->Payload.size() < 2) + { + throw std::runtime_error("Close response buffer is too short."); + } + // Encode the payload for close according to RFC 6455 + // section 5.5.1. The first two bytes of the payload contain the status code. + // The remainder of the payload is a UTF-8 encoded string. + uint16_t errorCode = 0; + errorCode |= (frame->Payload[0] << 8) & 0xff00; + errorCode |= (frame->Payload[1] & 0x00ff); + + // We received a close frame, mark the socket as closed. Make sure we + // reacquire the state lock before setting the state to closed. + lock.lock(); + m_stateOwner = std::this_thread::get_id(); + m_state = SocketState::Closed; + + return std::shared_ptr(new WebSocketPeerCloseFrame( + errorCode, std::string(frame->Payload.begin() + 2, frame->Payload.end()))); + } + + // Continuation frames need to be treated somewhat specially. + // We depend on the fact that the protocol requires that a Continuation frame + // only be sent if it is part of a multi-frame message whose previous frame was a Text + // or Binary frame. + case SocketOpcode::Continuation: + if (m_currentMessageType == SocketMessageType::Text) + { + if (frame->IsFinalFrame) + { + m_currentMessageType = SocketMessageType::Unknown; + } + return std::shared_ptr(new WebSocketTextFrame( + frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); + } + else if (m_currentMessageType == SocketMessageType::Binary) + { + if (frame->IsFinalFrame) + { + m_currentMessageType = SocketMessageType::Unknown; + } + return std::shared_ptr(new WebSocketBinaryFrame( + frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); + } + else + { + m_receiveStatistics.FramesDroppedByProtocolError++; + throw std::runtime_error("Unknown message type and received continuation opcode"); + } + default: + throw std::runtime_error("Unknown frame type received."); + } + } + else + { + if (m_state != SocketState::Closed && m_state != SocketState::Closing) + { + throw std::runtime_error("Transport is at EOF, no frame to receive."); + } + // The socket was closed, most likely locally, so fake a close frame response. + return std::shared_ptr(new WebSocketPeerCloseFrame()); + } + + context.ThrowIfCancelled(); + } + } + + std::shared_ptr + WebSocketImplementation::ReceiveTransportFrame(Azure::Core::Context const& context) + { +#if SUPPORT_NATIVE_TRANSPORT + if (m_transport->HasBuiltInWebSocketSupport()) + { + auto payload = m_transport->NativeReceiveFrame(context); + m_receiveStatistics.FramesReceived++; + switch (payload.FrameType) + { + case WebSocketTransport::NativeWebSocketFrameType::Binary: + m_receiveStatistics.BinaryFramesReceived++; + return std::make_shared( + SocketOpcode::BinaryFrame, true, payload.FrameData); + case WebSocketTransport::NativeWebSocketFrameType::BinaryFragment: + m_receiveStatistics.BinaryFramesReceived++; + return std::make_shared( + SocketOpcode::BinaryFrame, false, payload.FrameData); + case WebSocketTransport::NativeWebSocketFrameType::Text: + m_receiveStatistics.TextFramesReceived++; + return std::make_shared( + SocketOpcode::TextFrame, true, payload.FrameData); + case WebSocketTransport::NativeWebSocketFrameType::TextFragment: + m_receiveStatistics.TextFramesReceived++; + return std::make_shared( + SocketOpcode::TextFrame, false, payload.FrameData); + case WebSocketTransport::NativeWebSocketFrameType::Closed: { + m_receiveStatistics.CloseFramesReceived++; + auto closeResult = m_transport->NativeGetCloseSocketInformation(context); + std::vector closePayload; + closePayload.push_back(closeResult.CloseReason >> 8); + closePayload.push_back(closeResult.CloseReason & 0xff); + closePayload.insert( + closePayload.end(), + closeResult.CloseReasonDescription.begin(), + closeResult.CloseReasonDescription.end()); + return std::make_shared(SocketOpcode::Close, true, closePayload); + } + default: + throw std::runtime_error("Unexpected frame type received."); + } + } + else +#endif + { + std::shared_ptr frame = DecodeFrame(context); + if (frame) + { + + // Handle statistics for the incoming frame. + m_receiveStatistics.FramesReceived++; + switch (frame->Opcode) + { + case SocketOpcode::Ping: { + m_receiveStatistics.PingFramesReceived++; + break; + } + case SocketOpcode::Pong: { + m_receiveStatistics.PongFramesReceived++; + break; + } + case SocketOpcode::TextFrame: { + m_receiveStatistics.TextFramesReceived++; + break; + } + case SocketOpcode::BinaryFrame: { + m_receiveStatistics.BinaryFramesReceived++; + break; + } + case SocketOpcode::Close: { + m_receiveStatistics.CloseFramesReceived++; + break; + } + case SocketOpcode::Continuation: { + m_receiveStatistics.ContinuationFramesReceived++; + break; + } + default: { + m_receiveStatistics.UnknownFramesReceived++; + break; + } + } + } + else + { + m_receiveStatistics.FramesDropped++; + } + return frame; + } + } + + WebSocketStatistics WebSocketImplementation::GetStatistics() const + { + WebSocketStatistics returnValue{}; + returnValue.FramesSent = m_receiveStatistics.FramesSent.load(); + returnValue.FramesReceived = m_receiveStatistics.FramesReceived.load(); + returnValue.BinaryFramesReceived = m_receiveStatistics.BinaryFramesReceived.load(); + returnValue.TextFramesReceived = m_receiveStatistics.TextFramesReceived.load(); + returnValue.BinaryFramesSent = m_receiveStatistics.BinaryFramesSent.load(); + returnValue.TextFramesSent = m_receiveStatistics.TextFramesSent.load(); + returnValue.PingFramesReceived = m_receiveStatistics.PingFramesReceived.load(); + returnValue.PongFramesReceived = m_receiveStatistics.PongFramesReceived.load(); + returnValue.PingFramesSent = m_receiveStatistics.PingFramesSent.load(); + returnValue.PongFramesSent = m_receiveStatistics.PongFramesSent.load(); + + returnValue.BytesSent = m_receiveStatistics.BytesSent.load(); + returnValue.BytesReceived = m_receiveStatistics.BytesReceived.load(); + returnValue.FramesDropped = m_receiveStatistics.FramesDropped.load(); + returnValue.FramesDroppedByClose = m_receiveStatistics.FramesDroppedByClose.load(); + returnValue.FramesDroppedByPayloadSizeLimit + = m_receiveStatistics.FramesDroppedByPayloadSizeLimit.load(); + returnValue.FramesDroppedByProtocolError + = m_receiveStatistics.FramesDroppedByProtocolError.load(); + returnValue.TransportReadBytes = m_receiveStatistics.TransportReadBytes.load(); + returnValue.TransportReads = m_receiveStatistics.TransportReads.load(); + return returnValue; + } + + std::vector WebSocketImplementation::EncodeFrame( + SocketOpcode opcode, + bool isFinal, + std::vector const& payload) + { + std::vector encodedFrame; + // Add opcode+fin. + encodedFrame.push_back(static_cast(opcode) | (isFinal ? 0x80 : 0)); + uint8_t maskAndLength = 0; + maskAndLength |= 0x80; + + // Payloads smaller than 125 bytes are encoded directly in the maskAndLength field. + uint64_t payloadSize = static_cast(payload.size()); + if (payloadSize <= 125) + { + maskAndLength |= static_cast(payload.size()); + } + else if (payloadSize <= 65535) + { + // Payloads greater than 125 whose size can fit in a 16 bit integer bytes + // are encoded as a 16 bit unsigned integer in network byte order. + maskAndLength |= 126; + } + else + { + // Payloads greater than 65536 have their length are encoded as a 64 bit unsigned integer + // in network byte order. + maskAndLength |= 127; + } + encodedFrame.push_back(maskAndLength); + // Encode a 16 bit length. + if (payloadSize > 125 && payloadSize <= 65535) + { + encodedFrame.push_back(static_cast(payload.size()) >> 8); + encodedFrame.push_back(static_cast(payload.size()) & 0xff); + } + // Encode a 64 bit length. + else if (payloadSize >= 65536) + { + + encodedFrame.push_back((payloadSize >> 56) & 0xff); + encodedFrame.push_back((payloadSize >> 48) & 0xff); + encodedFrame.push_back((payloadSize >> 40) & 0xff); + encodedFrame.push_back((payloadSize >> 32) & 0xff); + encodedFrame.push_back((payloadSize >> 24) & 0xff); + encodedFrame.push_back((payloadSize >> 16) & 0xff); + encodedFrame.push_back((payloadSize >> 8) & 0xff); + encodedFrame.push_back(payloadSize & 0xff); + } + // Calculate the masking key. This MUST be 4 bytes of high entropy random numbers used to + // mask the input data. + { + // Start by generating the mask - 4 bytes of random data. + std::vector mask = GenerateRandomBytes(4); + + // Append the mask to the payload. + encodedFrame.insert(encodedFrame.end(), mask.begin(), mask.end()); + + // And mask the payload before transmitting it. + size_t index = 0; + for (auto ch : payload) + { + encodedFrame.push_back(ch ^ mask[index % 4]); + index += 1; + } + } + + return encodedFrame; + } + std::shared_ptr + WebSocketImplementation::DecodeFrame(Azure::Core::Context const& context) + { + // Ensure single threaded access to receive this frame. + std::unique_lock lock(m_transportMutex); + if (IsTransportEof()) + { + throw std::runtime_error("Frame buffer is too small."); + } + uint8_t payloadByte = ReadTransportByte(context); + // If the transport is at EOF, then there is no payload data, so just return null. + if (IsTransportEof()) + { + return nullptr; + } + SocketOpcode opcode = static_cast(payloadByte & 0x7f); + bool isFinal = (payloadByte & 0x80) != 0; + payloadByte = ReadTransportByte(context); + if (IsTransportEof()) + { + return nullptr; + } + if (payloadByte & 0x80) + { + throw std::runtime_error("Server sent a frame with a reserved bit set."); + } + int64_t payloadLength = payloadByte & 0x7f; + if (payloadLength <= 125) + { + payloadByte += 1; + } + else if (payloadLength == 126) + { + payloadLength = ReadTransportShort(context); + } + else if (payloadLength == 127) + { + payloadLength = ReadTransportInt64(context); + } + else + { + throw std::logic_error("Unexpected payload length."); + } + if (IsTransportEof()) + { + return nullptr; + } + + std::vector payload(ReadTransportBytes(static_cast(payloadLength), context)); + if (IsTransportEof()) + { + return nullptr; + } + return std::make_shared(opcode, isFinal, payload); + } + + uint8_t WebSocketImplementation::ReadTransportByte(Azure::Core::Context const& context) + { + if (m_bufferPos >= m_bufferLen) + { + // Start by reading data from our initial body stream. + m_bufferLen = m_initialBodyStream->ReadToCount(m_buffer, m_bufferSize, context); + if (m_bufferLen == 0) + { + // If we run out of the initial stream, we need to read from the transport. + m_bufferLen = m_transport->ReadFromSocket(m_buffer, m_bufferSize, context); + m_receiveStatistics.TransportReads++; + m_receiveStatistics.TransportReadBytes += static_cast(m_bufferLen); + } + else + { + Azure::Core::Diagnostics::_internal::Log::Write( + Azure::Core::Diagnostics::Logger::Level::Informational, + "Read data from initial stream"); + } + m_bufferPos = 0; + if (m_bufferLen == 0) + { + m_eof = true; + return 0; + } + } + + m_receiveStatistics.BytesReceived++; + return m_buffer[m_bufferPos++]; + } + uint16_t WebSocketImplementation::ReadTransportShort(Azure::Core::Context const& context) + { + uint16_t result = ReadTransportByte(context); + result <<= 8; + result |= ReadTransportByte(context); + return result; + } + uint64_t WebSocketImplementation::ReadTransportInt64(Azure::Core::Context const& context) + { + uint64_t result = 0; + + result |= (static_cast(ReadTransportByte(context)) << 56 & 0xff00000000000000); + result |= (static_cast(ReadTransportByte(context)) << 48 & 0x00ff000000000000); + result |= (static_cast(ReadTransportByte(context)) << 40 & 0x0000ff0000000000); + result |= (static_cast(ReadTransportByte(context)) << 32 & 0x000000ff00000000); + result |= (static_cast(ReadTransportByte(context)) << 24 & 0x00000000ff000000); + result |= (static_cast(ReadTransportByte(context)) << 16 & 0x0000000000ff0000); + result |= (static_cast(ReadTransportByte(context)) << 8 & 0x000000000000ff00); + result |= static_cast(ReadTransportByte(context)); + return result; + } + std::vector WebSocketImplementation::ReadTransportBytes( + size_t readLength, + Azure::Core::Context const& context) + { + std::vector result; + size_t index = 0; + while (index < readLength) + { + uint8_t byte = ReadTransportByte(context); + result.push_back(byte); + index += 1; + } + return result; + } + + void WebSocketImplementation::SendTransportBuffer( + std::vector const& sendFrame, + Azure::Core::Context const& context) + { + std::unique_lock transportLock(m_transportMutex); + m_receiveStatistics.BytesSent += static_cast(sendFrame.size()); + m_receiveStatistics.FramesSent += 1; + m_transport->SendBuffer(sendFrame.data(), sendFrame.size(), context); + } + + // Verify the Sec-WebSocket-Accept header as defined in RFC 6455 Section 1.3, which defines + // the opening handshake used for establishing the WebSocket connection. + std::string acceptHeaderGuid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; + void WebSocketImplementation::VerifySocketAccept( + std::string const& encodedKey, + std::string const& acceptHeader) + { + std::string concatenatedKey(encodedKey); + concatenatedKey += acceptHeaderGuid; + Azure::Core::Cryptography::_internal::Sha1Hash sha1hash; + + sha1hash.Append( + reinterpret_cast(concatenatedKey.data()), concatenatedKey.size()); + auto keyHash = sha1hash.Final(); + std::string encodedHash = Azure::Core::Convert::Base64Encode(keyHash); + if (encodedHash != acceptHeader) + { + throw std::runtime_error( + "Hash returned by WebSocket server does not match expected hash. Aborting"); + } + } + + WebSocketImplementation::PingThread::PingThread( + WebSocketImplementation* socketImplementation, + std::chrono::duration pingInterval) + : m_webSocketImplementation(socketImplementation), m_pingInterval(pingInterval) + { + } + void WebSocketImplementation::PingThread::Start(std::shared_ptr transport) + { + m_stop = false; + // Spin up a thread to receive data from the transport. + if (!transport->HasBuiltInWebSocketSupport()) + { + std::unique_lock lock(m_pingThreadStarted); + m_pingThread = std::thread{&PingThread::PingThreadLoop, this}; + m_pingThreadReady.wait(lock); + } + } + + WebSocketImplementation::PingThread::~PingThread() + { + // Ensure that the receive thread is stopped. + Shutdown(); + } + void WebSocketImplementation::PingThread::Shutdown() + { + if (m_pingThread.joinable()) + { + std::unique_lock lock(m_stopMutex); + m_stop = true; + lock.unlock(); + m_pingThreadStopped.notify_all(); + + m_pingThread.join(); + } + } + + void WebSocketImplementation::PingThread::PingThreadLoop() + { + Log::Write(Logger::Level::Verbose, "Start Ping Thread Loop."); + { + std::unique_lock lock(m_pingThreadStarted); + m_pingThreadReady.notify_all(); + } + while (true) + { + std::unique_lock lock(m_stopMutex); + if (this->m_pingThreadStopped.wait_for(lock, m_pingInterval) == std::cv_status::timeout) + { + Log::Write(Logger::Level::Verbose, "Send Ping to peer."); + + // The receiveContext timed out, this means we timed out our "ping" timeout. + // Send a "Ping" request to the remote node. + auto pingData = GenerateRandomBytes(4); + SendPing(pingData, Azure::Core::Context{}); + } + if (m_stop) + { + Log::Write(Logger::Level::Verbose, "Exiting ping thread"); + return; + } + } + } + + bool WebSocketImplementation::PingThread::SendPing( + std::vector const& pingData, + Azure::Core::Context const& context) + { + std::vector pingFrame = EncodeFrame(SocketOpcode::Ping, true, pingData); + m_webSocketImplementation->m_receiveStatistics.PingFramesSent++; + m_webSocketImplementation->SendTransportBuffer(pingFrame, context); + return true; + } + + void WebSocketImplementation::SendPong( + std::vector const& pongData, + Azure::Core::Context const& context) + { + std::vector pongFrame = EncodeFrame(SocketOpcode::Pong, true, pongData); + + m_receiveStatistics.PongFramesSent++; + SendTransportBuffer(pongFrame, context); + } + + // Generator for random bytes. Used in WebSocketImplementation and tests. + std::vector GenerateRandomBytes(size_t vectorSize) + { + std::random_device randomEngine; + + std::vector rv(vectorSize); + std::generate(begin(rv), end(rv), [&randomEngine]() mutable { + return static_cast(randomEngine() % UINT8_MAX); + }); + return rv; + } +}}}}} // namespace Azure::Core::Http::WebSockets::_detail diff --git a/sdk/core/azure-core/src/http/websockets/websockets_impl.hpp b/sdk/core/azure-core/src/http/websockets/websockets_impl.hpp new file mode 100644 index 0000000000..73a10ec143 --- /dev/null +++ b/sdk/core/azure-core/src/http/websockets/websockets_impl.hpp @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT +#include "azure/core/http/websockets/websockets.hpp" +#include "azure/core/http/websockets/websockets_transport.hpp" +#include "azure/core/internal/diagnostics/log.hpp" +#include "azure/core/internal/http/pipeline.hpp" +#include +#include +#include +#include +#include + +// Implementation of WebSocket protocol. +namespace Azure { namespace Core { namespace Http { namespace WebSockets { namespace _detail { + + // Generator for random bytes. Used in WebSocketImplementation and tests. + std::vector GenerateRandomBytes(size_t vectorSize); + + class WebSocketImplementation { + enum class SocketState + { + Invalid, + Closed, + Opening, + Open, + Closing, + }; + + public: + WebSocketImplementation( + Azure::Core::Url const& remoteUrl, + _internal::WebSocketOptions const& options); + + void Open(Azure::Core::Context const& context); + void Close( + uint16_t closeStatus, + std::string const& closeReason, + Azure::Core::Context const& context); + void SendFrame( + std::string const& textFrame, + bool isFinalFrame, + Azure::Core::Context const& context); + void SendFrame( + std::vector const& binaryFrame, + bool isFinalFrame, + Azure::Core::Context const& context); + + std::shared_ptr<_internal::WebSocketFrame> ReceiveFrame(Azure::Core::Context const& context); + + void AddHeader(std::string const& headerName, std::string const& headerValue); + + std::string const& GetNegotiatedProtocol(); + bool IsOpen() { return m_state == SocketState::Open; } + bool HasBuiltInWebSocketSupport(); + + _internal::WebSocketStatistics GetStatistics() const; + + private: + // WebSocket opcodes. + enum class SocketOpcode : uint8_t + { + Continuation = 0x00, + TextFrame = 0x01, + BinaryFrame = 0x02, + Close = 0x08, + Ping = 0x09, + Pong = 0x0a + }; + + /** + * Indicates the type of the message currently being processed. Used when processing + * Continuation Opcode frames. + */ + enum class SocketMessageType : int + { + Unknown, + Text, + Binary, + }; + + class WebSocketInternalFrame { + public: + SocketOpcode Opcode{}; + bool IsFinalFrame{false}; + std::vector Payload; + std::exception_ptr Exception; + WebSocketInternalFrame( + SocketOpcode opcode, + bool isFinalFrame, + std::vector const& payload) + : Opcode(opcode), IsFinalFrame(isFinalFrame), Payload(payload) + { + } + WebSocketInternalFrame(std::exception_ptr exception) : Exception(exception) {} + }; + + struct ReceiveStatistics + { + std::atomic FramesSent; + std::atomic FramesReceived; + std::atomic BytesSent; + std::atomic BytesReceived; + std::atomic PingFramesSent; + std::atomic PingFramesReceived; + std::atomic PongFramesSent; + std::atomic PongFramesReceived; + std::atomic TextFramesReceived; + std::atomic BinaryFramesReceived; + std::atomic ContinuationFramesReceived; + std::atomic CloseFramesReceived; + std::atomic UnknownFramesReceived; + std::atomic FramesDropped; + std::atomic FramesDroppedByPayloadSizeLimit; + std::atomic FramesDroppedByProtocolError; + std::atomic TransportReads; + std::atomic TransportReadBytes; + std::atomic BinaryFramesSent; + std::atomic TextFramesSent; + std::atomic FramesDroppedByClose; + + void Reset() + { + FramesSent = 0; + BytesSent = 0; + FramesReceived = 0; + BytesReceived = 0; + PingFramesReceived = 0; + PingFramesSent = 0; + PongFramesReceived = 0; + PongFramesSent = 0; + TextFramesReceived = 0; + TextFramesSent = 0; + BinaryFramesReceived = 0; + BinaryFramesSent = 0; + ContinuationFramesReceived = 0; + CloseFramesReceived = 0; + UnknownFramesReceived = 0; + FramesDropped = 0; + FramesDroppedByClose = 0; + FramesDroppedByPayloadSizeLimit = 0; + FramesDroppedByProtocolError = 0; + TransportReads = 0; + TransportReadBytes = 0; + } + }; + /** + * @brief The PingThread handles sending Ping operations from the WebSocket server. + * + */ + class PingThread { + public: + /** + * @brief Construct a new ReceiveQueue object. + * + * @param webSocketImplementation Parent object, used to send Ping threads. + * @param pingInterval Interval to wait between sending pings. + */ + PingThread( + WebSocketImplementation* webSocketImplementation, + std::chrono::duration pingInterval); + /** + * @brief Destroys a ReceiveQueue object. Blocks until the queue thread is completed. + */ + ~PingThread(); + + /** + * @brief Start the receive queue. This will start a thread that will process incoming frames. + * + * @param transport The websocket transport to use for receiving frames. + */ + void Start(std::shared_ptr transport); + /** + * @brief Stop the receive queue. This will stop the thread that processes incoming frames. + */ + void Shutdown(); + + private: + /** + * @brief The receive queue thread. + */ + void PingThreadLoop(); + /** + * @brief Send a "ping" frame to the other side of the WebSocket. + * + * @returns True if the ping was sent, false if the underlying transport didn't support "Ping" + * operations. + */ + bool SendPing(std::vector const& pingData, Azure::Core::Context const& context); + + WebSocketImplementation* m_webSocketImplementation; + std::chrono::duration m_pingInterval; + std::thread m_pingThread; + std::mutex m_pingThreadStarted; + std::condition_variable m_pingThreadReady; + + std::mutex m_stopMutex; + std::condition_variable m_pingThreadStopped; + bool m_stop = false; + }; + + /** + * @brief Encode a websocket frame according to RFC 6455 section 5.2. + * + * This wire format for the data transfer part is described by the ABNF + * [RFC5234] given in detail in this section. (Note that, unlike in + * other sections of this document, the ABNF in this section is + * operating on groups of bits. The length of each group of bits is + * indicated in a comment. When encoded on the wire, the most + * significant bit is the leftmost in the ABNF). A high-level overview + * of the framing is given in the following figure. In a case of + * conflict between the figure below and the ABNF specified later in + * this section, the figure is authoritative. + * + * 0 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-------+-+-------------+-------------------------------+ + * |F|R|R|R| opcode|M| Payload len | Extended payload length | + * |I|S|S|S| (4) |A| (7) | (16/64) | + * |N|V|V|V| |S| | (if payload len==126/127) | + * | |1|2|3| |K| | | + * +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + + * | Extended payload length continued, if payload len == 127 | + * + - - - - - - - - - - - - - - - +-------------------------------+ + * | |Masking-key, if MASK set to 1 | + * +-------------------------------+-------------------------------+ + * | Masking-key (continued) | Payload Data | + * +-------------------------------- - - - - - - - - - - - - - - - + + * : Payload Data continued ... : + * + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + * | Payload Data continued ... | + * +---------------------------------------------------------------+ + * + * FIN: 1 bit + * + * Indicates that this is the final fragment in a message. The first + * fragment MAY also be the final fragment. + * + * RSV1, RSV2, RSV3: 1 bit each + * + * MUST be 0 unless an extension is negotiated that defines meanings + * for non-zero values. If a nonzero value is received and none of + * the negotiated extensions defines the meaning of such a nonzero + * value, the receiving endpoint MUST _Fail the WebSocket + * Connection_. + * + * Opcode: 4 bits + * + * Defines the interpretation of the "Payload data". If an unknown + * opcode is received, the receiving endpoint MUST _Fail the + * WebSocket Connection_. The following values are defined. + * + * * %x0 denotes a continuation frame + * + * * %x1 denotes a text frame + * + * * %x2 denotes a binary frame + * + * * %x3-7 are reserved for further non-control frames + * + * * %x8 denotes a connection close + * + * * %x9 denotes a ping + * + * * %xA denotes a pong + * + * * %xB-F are reserved for further control frames + * + * Mask: 1 bit + * + * Defines whether the "Payload data" is masked. If set to 1, a + * masking key is present in masking-key, and this is used to unmask + * the "Payload data" as per Section 5.3. All frames sent from + * client to server have this bit set to 1. + * + * Payload length: 7 bits, 7+16 bits, or 7+64 bits + * + * The length of the "Payload data", in bytes: if 0-125, that is the + * payload length. If 126, the following 2 bytes interpreted as a + * 16-bit unsigned integer are the payload length. If 127, the + * following 8 bytes interpreted as a 64-bit unsigned integer (the + * most significant bit MUST be 0) are the payload length. Multibyte + * length quantities are expressed in network byte order. Note that + * in all cases, the minimal number of bytes MUST be used to encode + * the length, for example, the length of a 124-byte-long string + * can't be encoded as the sequence 126, 0, 124. The payload length + * is the length of the "Extension data" + the length of the + * "Application data". The length of the "Extension data" may be + * zero, in which case the payload length is the length of the + * "Application data". + * Masking-key: 0 or 4 bytes + * + * All frames sent from the client to the server are masked by a + * 32-bit value that is contained within the frame. This field is + * present if the mask bit is set to 1 and is absent if the mask bit + * is set to 0. See Section 5.3 for further information on client- + * to-server masking. + * + * Payload data: (x+y) bytes + * + * The "Payload data" is defined as "Extension data" concatenated + * with "Application data". + * + * Extension data: x bytes + * + * The "Extension data" is 0 bytes unless an extension has been + * negotiated. Any extension MUST specify the length of the + * "Extension data", or how that length may be calculated, and how + * the extension use MUST be negotiated during the opening handshake. + * If present, the "Extension data" is included in the total payload + * length. + * + * Application data: y bytes + * + * Arbitrary "Application data", taking up the remainder of the frame + * after any "Extension data". The length of the "Application data" + * is equal to the payload length minus the length of the "Extension + * data". + */ + static std::vector EncodeFrame( + SocketOpcode opcode, + bool isFinal, + std::vector const& payload); + + SocketState m_state{SocketState::Invalid}; + + std::vector GenerateRandomKey() { return GenerateRandomBytes(16); }; + void VerifySocketAccept(std::string const& encodedKey, std::string const& acceptHeader); + + /********* + * Buffered Read Support. Read data from the underlying transport into a buffer. + */ + uint8_t ReadTransportByte(Azure::Core::Context const& context); + uint16_t ReadTransportShort(Azure::Core::Context const& context); + uint64_t ReadTransportInt64(Azure::Core::Context const& context); + std::vector ReadTransportBytes(size_t readLength, Azure::Core::Context const& context); + bool IsTransportEof() const { return m_eof; } + void SendPong(std::vector const& pongData, Azure::Core::Context const& context); + void SendTransportBuffer( + std::vector const& payload, + Azure::Core::Context const& context); + std::shared_ptr ReceiveTransportFrame( + Azure::Core::Context const& context); + + /** + * @brief Decode a frame received from the websocket server. + * + * @returns A pointer to the start of the decoded data. + */ + std::shared_ptr DecodeFrame(Azure::Core::Context const& context); + + Azure::Core::Url m_remoteUrl; + _internal::WebSocketOptions m_options; + std::map m_headers; + std::string m_chosenProtocol; + std::shared_ptr m_transport; + PingThread m_pingThread; + SocketMessageType m_currentMessageType{SocketMessageType::Unknown}; + std::mutex m_stateMutex; + std::thread::id m_stateOwner; + + ReceiveStatistics m_receiveStatistics{}; + + std::mutex m_transportMutex; + + std::unique_ptr m_initialBodyStream; + constexpr static size_t m_bufferSize = 1024; + uint8_t m_buffer[m_bufferSize]{}; + size_t m_bufferPos = 0; + size_t m_bufferLen = 0; + bool m_eof = false; + }; +}}}}} // namespace Azure::Core::Http::WebSockets::_detail diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index 7726305bf9..9131eb98df 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -20,6 +20,7 @@ using namespace Azure::Core::Http; namespace { const std::string HttpScheme = "http"; +const std::string WebSocketScheme = "ws"; inline std::wstring HttpMethodToWideString(HttpMethod method) { @@ -198,9 +199,8 @@ std::string GetHeadersAsString(Azure::Core::Http::Request const& request) } // namespace -void GetErrorAndThrow(const std::string& exceptionMessage) +void WinHttpTransport::GetErrorAndThrow(const std::string& exceptionMessage, DWORD error) { - DWORD error = GetLastError(); std::string errorMessage = exceptionMessage + " Error Code: " + std::to_string(error); char* errorMsg = nullptr; @@ -226,17 +226,19 @@ void GetErrorAndThrow(const std::string& exceptionMessage) throw Azure::Core::Http::TransportException(errorMessage); } -HINTERNET WinHttpTransport::CreateSessionHandle() +_detail::unique_HINTERNET WinHttpTransport::CreateSessionHandle() { // Use WinHttpOpen to obtain a session handle. // The dwFlags is set to 0 - all WinHTTP functions are performed synchronously. - HINTERNET sessionHandle = WinHttpOpen( - NULL, // Do not use a fallback user-agent string, and only rely on the header within the - // request itself. - WINHTTP_ACCESS_TYPE_NO_PROXY, - WINHTTP_NO_PROXY_NAME, - WINHTTP_NO_PROXY_BYPASS, - 0); + _detail::unique_HINTERNET sessionHandle( + WinHttpOpen( + NULL, // Do not use a fallback user-agent string, and only rely on the header within the + // request itself. + WINHTTP_ACCESS_TYPE_NO_PROXY, + WINHTTP_NO_PROXY_NAME, + WINHTTP_NO_PROXY_BYPASS, + 0), + _detail::HINTERNET_deleter{}); if (!sessionHandle) { @@ -253,19 +255,22 @@ HINTERNET WinHttpTransport::CreateSessionHandle() #ifdef WINHTTP_OPTION_TCP_FAST_OPEN BOOL tcp_fast_open = TRUE; WinHttpSetOption( - sessionHandle, WINHTTP_OPTION_TCP_FAST_OPEN, &tcp_fast_open, sizeof(tcp_fast_open)); + sessionHandle.get(), WINHTTP_OPTION_TCP_FAST_OPEN, &tcp_fast_open, sizeof(tcp_fast_open)); #endif #ifdef WINHTTP_OPTION_TLS_FALSE_START BOOL tls_false_start = TRUE; WinHttpSetOption( - sessionHandle, WINHTTP_OPTION_TLS_FALSE_START, &tls_false_start, sizeof(tls_false_start)); + sessionHandle.get(), + WINHTTP_OPTION_TLS_FALSE_START, + &tls_false_start, + sizeof(tls_false_start)); #endif // Enforce TLS version 1.2 auto tlsOption = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; if (!WinHttpSetOption( - sessionHandle, WINHTTP_OPTION_SECURE_PROTOCOLS, &tlsOption, sizeof(tlsOption))) + sessionHandle.get(), WINHTTP_OPTION_SECURE_PROTOCOLS, &tlsOption, sizeof(tlsOption))) { GetErrorAndThrow("Error while enforcing TLS 1.2 for connection request."); } @@ -278,23 +283,26 @@ WinHttpTransport::WinHttpTransport(WinHttpTransportOptions const& options) { } -void WinHttpTransport::CreateConnectionHandle( - std::unique_ptr<_detail::HandleManager>& handleManager) +_detail::unique_HINTERNET WinHttpTransport::CreateConnectionHandle( + Azure::Core::Url const& url, + Azure::Core::Context const& context) { // If port is 0, i.e. INTERNET_DEFAULT_PORT, it uses port 80 for HTTP and port 443 for HTTPS. - uint16_t port = handleManager->m_request.GetUrl().GetPort(); + uint16_t port = url.GetPort(); - handleManager->m_context.ThrowIfCancelled(); + context.ThrowIfCancelled(); // Specify an HTTP server. // This function always operates synchronously. - handleManager->m_connectionHandle = WinHttpConnect( - m_sessionHandle, - StringToWideString(handleManager->m_request.GetUrl().GetHost()).c_str(), - port == 0 ? INTERNET_DEFAULT_PORT : port, - 0); - - if (!handleManager->m_connectionHandle) + _detail::unique_HINTERNET rv( + WinHttpConnect( + m_sessionHandle.get(), + StringToWideString(url.GetHost()).c_str(), + port == 0 ? INTERNET_DEFAULT_PORT : port, + 0), + _detail::HINTERNET_deleter{}); + + if (!rv) { // Errors include: // ERROR_WINHTTP_INCORRECT_HANDLE_TYPE @@ -306,29 +314,35 @@ void WinHttpTransport::CreateConnectionHandle( // ERROR_NOT_ENOUGH_MEMORY GetErrorAndThrow("Error while getting a connection handle."); } + return rv; } -void WinHttpTransport::CreateRequestHandle(std::unique_ptr<_detail::HandleManager>& handleManager) +_detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( + _detail::unique_HINTERNET const& connectionHandle, + Azure::Core::Url const& url, + Azure::Core::Http::HttpMethod const& method) { - const std::string& path = handleManager->m_request.GetUrl().GetRelativeUrl(); - HttpMethod requestMethod = handleManager->m_request.GetMethod(); + const std::string& path = url.GetRelativeUrl(); + HttpMethod requestMethod = method; bool const requestSecureHttp( !Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( - handleManager->m_request.GetUrl().GetScheme(), HttpScheme)); + url.GetScheme(), HttpScheme) + && !Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( + url.GetScheme(), WebSocketScheme)); // Create an HTTP request handle. - handleManager->m_requestHandle = WinHttpOpenRequest( - handleManager->m_connectionHandle, - HttpMethodToWideString(requestMethod).c_str(), - path.empty() ? NULL - : StringToWideString(path) - .c_str(), // Name of the target resource of the specified HTTP verb - NULL, // Use HTTP/1.1 - WINHTTP_NO_REFERER, - WINHTTP_DEFAULT_ACCEPT_TYPES, // No media types are accepted by the client - requestSecureHttp ? WINHTTP_FLAG_SECURE : 0); // Uses secure transaction semantics (SSL/TLS) - - if (!handleManager->m_requestHandle) + _detail::unique_HINTERNET request( + WinHttpOpenRequest( + connectionHandle.get(), + HttpMethodToWideString(requestMethod).c_str(), + path.empty() ? NULL : StringToWideString(path).c_str(), // Name of the target resource of + // the specified HTTP verb + NULL, // Use HTTP/1.1 + WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, // No media types are accepted by the client + requestSecureHttp ? WINHTTP_FLAG_SECURE : 0), + _detail::HINTERNET_deleter{}); // Uses secure transaction semantics (SSL/TLS) + if (!request) { // Errors include: // ERROR_WINHTTP_INCORRECT_HANDLE_TYPE @@ -348,10 +362,7 @@ void WinHttpTransport::CreateRequestHandle(std::unique_ptr<_detail::HandleManage // Note: If/When TLS client certificate support is added to the pipeline, this line may need to // be revisited. if (!WinHttpSetOption( - handleManager->m_requestHandle, - WINHTTP_OPTION_CLIENT_CERT_CONTEXT, - WINHTTP_NO_CLIENT_CERT_CONTEXT, - 0)) + request.get(), WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0)) { GetErrorAndThrow("Error while setting client cert context to ignore."); } @@ -360,18 +371,29 @@ void WinHttpTransport::CreateRequestHandle(std::unique_ptr<_detail::HandleManage if (m_options.IgnoreUnknownCertificateAuthority) { auto option = SECURITY_FLAG_IGNORE_UNKNOWN_CA; - if (!WinHttpSetOption( - handleManager->m_requestHandle, WINHTTP_OPTION_SECURITY_FLAGS, &option, sizeof(option))) + if (!WinHttpSetOption(request.get(), WINHTTP_OPTION_SECURITY_FLAGS, &option, sizeof(option))) { GetErrorAndThrow("Error while setting ignore unknown server certificate."); } } + + // If we are supporting WebSockets, then let WinHTTP know that it should + // prepare to upgrade the HttpRequest to a WebSocket. + if (HasWebSocketSupport() + && !WinHttpSetOption(request.get(), WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, nullptr, 0)) + { + GetErrorAndThrow("Error while Enabling WebSocket upgrade."); + } + return request; } // For PUT/POST requests, send additional data using WinHttpWriteData. -void WinHttpTransport::Upload(std::unique_ptr<_detail::HandleManager>& handleManager) +void WinHttpTransport::Upload( + _detail::unique_HINTERNET const& requestHandle, + Azure::Core::Http::Request& request, + Azure::Core::Context const& context) { - auto streamBody = handleManager->m_request.GetBodyStream(); + auto streamBody = request.GetBodyStream(); int64_t streamLength = streamBody->Length(); // Consider using `MaximumUploadChunkSize` here, after some perf measurements @@ -384,8 +406,7 @@ void WinHttpTransport::Upload(std::unique_ptr<_detail::HandleManager>& handleMan while (true) { - size_t rawRequestLen - = streamBody->Read(unique_buffer.get(), uploadChunkSize, handleManager->m_context); + size_t rawRequestLen = streamBody->Read(unique_buffer.get(), uploadChunkSize, context); if (rawRequestLen == 0) { break; @@ -393,11 +414,11 @@ void WinHttpTransport::Upload(std::unique_ptr<_detail::HandleManager>& handleMan DWORD dwBytesWritten = 0; - handleManager->m_context.ThrowIfCancelled(); + context.ThrowIfCancelled(); // Write data to the server. if (!WinHttpWriteData( - handleManager->m_requestHandle, + requestHandle.get(), unique_buffer.get(), static_cast(rawRequestLen), &dwBytesWritten)) @@ -407,29 +428,32 @@ void WinHttpTransport::Upload(std::unique_ptr<_detail::HandleManager>& handleMan } } -void WinHttpTransport::SendRequest(std::unique_ptr<_detail::HandleManager>& handleManager) +void WinHttpTransport::SendRequest( + _detail::unique_HINTERNET const& requestHandle, + Azure::Core::Http::Request& request, + Azure::Core::Context const& context) { std::wstring encodedHeaders; int encodedHeadersLength = 0; - auto requestHeaders = handleManager->m_request.GetHeaders(); + auto requestHeaders = request.GetHeaders(); if (requestHeaders.size() != 0) { // The encodedHeaders will be null-terminated and the length is calculated. encodedHeadersLength = -1; - std::string requestHeaderString = GetHeadersAsString(handleManager->m_request); + std::string requestHeaderString = GetHeadersAsString(request); requestHeaderString.append("\0"); encodedHeaders = StringToWideString(requestHeaderString); } - int64_t streamLength = handleManager->m_request.GetBodyStream()->Length(); + int64_t streamLength = request.GetBodyStream()->Length(); - handleManager->m_context.ThrowIfCancelled(); + context.ThrowIfCancelled(); // Send a request. if (!WinHttpSendRequest( - handleManager->m_requestHandle, + requestHandle.get(), requestHeaders.size() == 0 ? WINHTTP_NO_ADDITIONAL_HEADERS : encodedHeaders.c_str(), encodedHeadersLength, WINHTTP_NO_REQUEST_DATA, @@ -468,18 +492,20 @@ void WinHttpTransport::SendRequest(std::unique_ptr<_detail::HandleManager>& hand if (streamLength > 0) { - Upload(handleManager); + Upload(requestHandle, request, context); } } -void WinHttpTransport::ReceiveResponse(std::unique_ptr<_detail::HandleManager>& handleManager) +void WinHttpTransport::ReceiveResponse( + _detail::unique_HINTERNET const& requestHandle, + Azure::Core::Context const& context) { - handleManager->m_context.ThrowIfCancelled(); + context.ThrowIfCancelled(); // Wait to receive the response to the HTTP request initiated by WinHttpSendRequest. // When WinHttpReceiveResponse completes successfully, the status code and response headers have // been received. - if (!WinHttpReceiveResponse(handleManager->m_requestHandle, NULL)) + if (!WinHttpReceiveResponse(requestHandle.get(), NULL)) { // Errors include: // ERROR_WINHTTP_CANNOT_CONNECT @@ -494,7 +520,7 @@ void WinHttpTransport::ReceiveResponse(std::unique_ptr<_detail::HandleManager>& } int64_t WinHttpTransport::GetContentLength( - std::unique_ptr<_detail::HandleManager>& handleManager, + _detail::unique_HINTERNET const& requestHandle, HttpMethod requestMethod, HttpStatusCode responseStatusCode) { @@ -511,7 +537,7 @@ int64_t WinHttpTransport::GetContentLength( if (requestMethod != HttpMethod::Head && responseStatusCode != HttpStatusCode::NoContent) { if (!WinHttpQueryHeaders( - handleManager->m_requestHandle, + requestHandle.get(), WINHTTP_QUERY_CONTENT_LENGTH | WINHTTP_QUERY_FLAG_NUMBER, WINHTTP_HEADER_NAME_BY_INDEX, &dwContentLength, @@ -530,14 +556,14 @@ int64_t WinHttpTransport::GetContentLength( } std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( - std::unique_ptr<_detail::HandleManager> handleManager, + _detail::unique_HINTERNET& requestHandle, HttpMethod requestMethod) { // First, use WinHttpQueryHeaders to obtain the size of the buffer. // The call is expected to fail since no destination buffer is provided. DWORD sizeOfHeaders = 0; if (WinHttpQueryHeaders( - handleManager->m_requestHandle, + requestHandle.get(), WINHTTP_QUERY_RAW_HEADERS, WINHTTP_HEADER_NAME_BY_INDEX, NULL, @@ -563,7 +589,7 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( // Now, use WinHttpQueryHeaders to retrieve all the headers. // Each header is terminated by "\0". An additional "\0" terminates the list of headers. if (!WinHttpQueryHeaders( - handleManager->m_requestHandle, + requestHandle.get(), WINHTTP_QUERY_RAW_HEADERS, WINHTTP_HEADER_NAME_BY_INDEX, outputBuffer.data(), @@ -583,7 +609,7 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( // Get the HTTP version. if (!WinHttpQueryHeaders( - handleManager->m_requestHandle, + requestHandle.get(), WINHTTP_QUERY_VERSION, WINHTTP_HEADER_NAME_BY_INDEX, outputBuffer.data(), @@ -606,7 +632,7 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( // Get the status code as a number. if (!WinHttpQueryHeaders( - handleManager->m_requestHandle, + requestHandle.get(), WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, WINHTTP_HEADER_NAME_BY_INDEX, &statusCode, @@ -623,7 +649,7 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( DWORD sizeOfReasonPhrase = sizeOfHeaders; if (WinHttpQueryHeaders( - handleManager->m_requestHandle, + requestHandle.get(), WINHTTP_QUERY_STATUS_TEXT, WINHTTP_HEADER_NAME_BY_INDEX, outputBuffer.data(), @@ -642,26 +668,32 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( SetHeaders(responseHeaders, rawResponse); - int64_t contentLength - = GetContentLength(handleManager, requestMethod, rawResponse->GetStatusCode()); + if (HasWebSocketSupport() && (httpStatusCode == HttpStatusCode::SwitchingProtocols)) + { + OnUpgradedConnection(requestHandle); + } + else + { + int64_t contentLength + = GetContentLength(requestHandle, requestMethod, rawResponse->GetStatusCode()); - rawResponse->SetBodyStream( - std::make_unique<_detail::WinHttpStream>(std::move(handleManager), contentLength)); + rawResponse->SetBodyStream( + std::make_unique<_detail::WinHttpStream>(requestHandle, contentLength)); + } return rawResponse; } std::unique_ptr WinHttpTransport::Send(Request& request, Context const& context) { - auto handleManager = std::make_unique<_detail::HandleManager>(request, context); - - CreateConnectionHandle(handleManager); - CreateRequestHandle(handleManager); + _detail::unique_HINTERNET connectionHandle = CreateConnectionHandle(request.GetUrl(), context); + _detail::unique_HINTERNET requestHandle + = CreateRequestHandle(connectionHandle, request.GetUrl(), request.GetMethod()); - SendRequest(handleManager); + SendRequest(requestHandle, request, context); - ReceiveResponse(handleManager); + ReceiveResponse(requestHandle, context); - return SendRequestAndGetResponse(std::move(handleManager), request.GetMethod()); + return SendRequestAndGetResponse(requestHandle, request.GetMethod()); } // Read the response from the sent request. @@ -679,7 +711,7 @@ size_t _detail::WinHttpStream::OnRead(uint8_t* buffer, size_t count, Context con DWORD numberOfBytesRead = 0; if (!WinHttpReadData( - this->m_handleManager->m_requestHandle, + this->m_requestHandle.get(), (LPVOID)(buffer), static_cast(count), &numberOfBytesRead)) diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp new file mode 100644 index 0000000000..7d869ca709 --- /dev/null +++ b/sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +#include "azure/core/http/http.hpp" +#include "azure/core/http/policies/policy.hpp" +#include "azure/core/http/transport.hpp" +#include "azure/core/http/websockets/win_http_websockets_transport.hpp" +#include "azure/core/internal/diagnostics/log.hpp" +#include "azure/core/platform.hpp" + +#if defined(AZ_PLATFORM_POSIX) +#include // for poll() +#include // for socket shutdown +#elif defined(AZ_PLATFORM_WINDOWS) +#if !defined(WIN32_LEAN_AND_MEAN) +#define WIN32_LEAN_AND_MEAN +#endif +#if !defined(NOMINMAX) +#define NOMINMAX +#endif +#include +#include // for WSAPoll(); +#endif +#include + +namespace Azure { namespace Core { namespace Http { namespace WebSockets { + + void WinHttpWebSocketTransport::OnUpgradedConnection( + Azure::Core::Http::_detail::unique_HINTERNET const& requestHandle) + { + // Convert the request handle into a WebSocket handle for us to use later. + m_socketHandle = Azure::Core::Http::_detail::unique_HINTERNET( + WinHttpWebSocketCompleteUpgrade(requestHandle.get(), 0), + Azure::Core::Http::_detail::HINTERNET_deleter{}); + if (!m_socketHandle) + { + GetErrorAndThrow("Error Upgrading HttpRequest handle to WebSocket handle."); + } + } + + std::unique_ptr WinHttpWebSocketTransport::Send( + Azure::Core::Http::Request& request, + Azure::Core::Context const& context) + { + return WinHttpTransport::Send(request, context); + } + + /** + * @brief Close the WebSocket cleanly. + */ + void WinHttpWebSocketTransport::Close() { m_socketHandle.reset(); } + + // Native WebSocket support methods. + /** + * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. + * + * @details Not implemented for CURL websockets because CURL does not support native websockets. + * + * @param status Status value to be sent to the remote node. Application defined. + * @param disconnectReason UTF-8 encoded reason for the disconnection. Optional. + * @param context Context for the operation. + * + */ + void WinHttpWebSocketTransport::NativeCloseSocket( + uint16_t status, + std::string const& disconnectReason, + Azure::Core::Context const& context) + { + context.ThrowIfCancelled(); + + auto err = WinHttpWebSocketClose( + m_socketHandle.get(), + status, + disconnectReason.empty() + ? nullptr + : reinterpret_cast(const_cast(disconnectReason.c_str())), + static_cast(disconnectReason.size())); + if (err != 0) + { + GetErrorAndThrow("WinHttpWebSocketClose() failed", err); + } + + context.ThrowIfCancelled(); + + // Make sure that the server responds gracefully to the close request. + auto closeInformation = NativeGetCloseSocketInformation(context); + + // The server should return the same status we sent. + if (closeInformation.CloseReason != status) + { + throw std::runtime_error( + "Close status mismatch, got " + std::to_string(closeInformation.CloseReason) + + " expected " + std::to_string(status)); + } + } + /** + * @brief Retrieve the information associated with a WebSocket close response. + * + * Should only be called when a Receive operation returns WebSocketFrameType::CloseFrameType + * + * @param context Context for the operation. + * + * @returns a tuple containing the status code and string. + */ + WinHttpWebSocketTransport::NativeWebSocketCloseInformation + WinHttpWebSocketTransport::NativeGetCloseSocketInformation(Azure::Core::Context const& context) + { + context.ThrowIfCancelled(); + uint16_t closeStatus = 0; + char closeReason[WINHTTP_WEB_SOCKET_MAX_CLOSE_REASON_LENGTH]{}; + DWORD closeReasonLength; + + auto err = WinHttpWebSocketQueryCloseStatus( + m_socketHandle.get(), + &closeStatus, + closeReason, + WINHTTP_WEB_SOCKET_MAX_CLOSE_REASON_LENGTH, + &closeReasonLength); + if (err != 0) + { + GetErrorAndThrow("WinHttpGetCloseStatus() failed", err); + } + return NativeWebSocketCloseInformation{closeStatus, std::string(closeReason)}; + } + + /** + * @brief Send a frame of data to the remote node. + * + * @details Not implemented for CURL websockets because CURL does not support native + * websockets. + * + * @brief frameType Frame type sent to the server, Text or Binary. + * @brief frameData Frame data to be sent to the server. + */ + void WinHttpWebSocketTransport::NativeSendFrame( + NativeWebSocketFrameType frameType, + std::vector const& frameData, + Azure::Core::Context const& context) + { + context.ThrowIfCancelled(); + WINHTTP_WEB_SOCKET_BUFFER_TYPE bufferType; + switch (frameType) + { + case NativeWebSocketFrameType::Text: + bufferType = WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE; + break; + case NativeWebSocketFrameType::Binary: + bufferType = WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE; + break; + case NativeWebSocketFrameType::BinaryFragment: + bufferType = WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE; + break; + case NativeWebSocketFrameType::TextFragment: + bufferType = WINHTTP_WEB_SOCKET_UTF8_FRAGMENT_BUFFER_TYPE; + break; + default: + throw std::runtime_error( + "Unknown frame type: " + std::to_string(static_cast(frameType))); + break; + } + // Lock the socket to prevent concurrent writes. WinHTTP gets annoyed if + // there are multiple WinHttpWebSocketSend requests outstanding. + std::lock_guard lock(m_sendMutex); + auto err = WinHttpWebSocketSend( + m_socketHandle.get(), + bufferType, + reinterpret_cast(const_cast(frameData.data())), + static_cast(frameData.size())); + if (err != 0) + { + GetErrorAndThrow("WinHttpWebSocketSend() failed", err); + } + } + + WinHttpWebSocketTransport::NativeWebSocketReceiveInformation + WinHttpWebSocketTransport::NativeReceiveFrame(Azure::Core::Context const& context) + { + WINHTTP_WEB_SOCKET_BUFFER_TYPE bufferType; + NativeWebSocketFrameType frameTypeReceived; + DWORD bufferBytesRead; + std::vector buffer(128); + context.ThrowIfCancelled(); + std::lock_guard lock(m_receiveMutex); + + auto err = WinHttpWebSocketReceive( + m_socketHandle.get(), + reinterpret_cast(buffer.data()), + static_cast(buffer.size()), + &bufferBytesRead, + &bufferType); + if (err != 0 && err != ERROR_INSUFFICIENT_BUFFER) + { + GetErrorAndThrow("WinHttpWebSocketReceive() failed", err); + } + buffer.resize(bufferBytesRead); + + switch (bufferType) + { + case WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE: + frameTypeReceived = NativeWebSocketFrameType::Text; + break; + case WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE: + frameTypeReceived = NativeWebSocketFrameType::Binary; + break; + case WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE: + frameTypeReceived = NativeWebSocketFrameType::BinaryFragment; + break; + case WINHTTP_WEB_SOCKET_UTF8_FRAGMENT_BUFFER_TYPE: + frameTypeReceived = NativeWebSocketFrameType::TextFragment; + break; + case WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE: + frameTypeReceived = NativeWebSocketFrameType::Closed; + break; + default: + throw std::runtime_error("Unknown frame type: " + std::to_string(bufferType)); + break; + } + return NativeWebSocketReceiveInformation{frameTypeReceived, buffer}; + } + +}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index bd75517ce3..ac0023446b 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -80,7 +80,8 @@ add_executable ( transport_adapter_implementation_test.cpp url_test.cpp uuid_test.cpp -) + websocket_test.cpp + ) if (MSVC) # Disable warnings: @@ -98,6 +99,17 @@ if (MSVC) target_compile_options(azure-core-test PUBLIC /wd26495 /wd26812 /wd6326 /wd28204 /wd28020 /wd6330 /wd4389) endif() +# Additional test files to be copied to the output directory. +set(TEST_ADDITIONAL_FILES ${CMAKE_CURRENT_LIST_DIR}/websocket_server.py + ${CMAKE_CURRENT_LIST_DIR}/requirements.txt + ${CMAKE_CURRENT_LIST_DIR}/Start-WebSocketServer.ps1 +) + +add_custom_command(TARGET azure-core-test POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${TEST_ADDITIONAL_FILES} ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${TEST_ADDITIONAL_FILES} + COMMENT 'Copying non-source output files') + # Adding private headers from CORE to the tests so we can test the private APIs with no relative paths include. target_include_directories (azure-core-test PRIVATE $) diff --git a/sdk/core/azure-core/test/ut/Start-WebSocketServer.ps1 b/sdk/core/azure-core/test/ut/Start-WebSocketServer.ps1 new file mode 100644 index 0000000000..7e08280988 --- /dev/null +++ b/sdk/core/azure-core/test/ut/Start-WebSocketServer.ps1 @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT +param( + [string] $LogFileLocation = "$($env:BUILD_SOURCESDIRECTORY)/WebSocketServer.log" +) + +if ($IsWindows) { + Start-Process 'python.exe' ` + -ArgumentList 'websocket_server.py' ` + -NoNewWindow -PassThru -RedirectStandardOutput $LogFileLocation +} else { + Start-Process nohup 'python3 websocket_server.py' -RedirectStandardOutput $LogFileLocation +} diff --git a/sdk/core/azure-core/test/ut/requirements.txt b/sdk/core/azure-core/test/ut/requirements.txt new file mode 100644 index 0000000000..14774b465e --- /dev/null +++ b/sdk/core/azure-core/test/ut/requirements.txt @@ -0,0 +1 @@ +websockets diff --git a/sdk/core/azure-core/test/ut/sha_test.cpp b/sdk/core/azure-core/test/ut/sha_test.cpp index 32bb33a26e..826f805503 100644 --- a/sdk/core/azure-core/test/ut/sha_test.cpp +++ b/sdk/core/azure-core/test/ut/sha_test.cpp @@ -7,38 +7,114 @@ using namespace Azure::Core::Cryptography::_internal; +// cspell: words ABCDE FGHIJ +TEST(SHA, SHA1Test) +{ + { + Sha1Hash sha; + Sha1Hash sha2; + uint8_t data[] = "A"; + auto shaResult = sha.Final(data, sizeof(data)); + auto shaResult2 = sha2.Final(data, sizeof(data)); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } + { + Sha1Hash sha; + Sha1Hash sha2; + std::string data1 = "ABCDE"; + std::string data2 = "FGHIJ"; + sha.Append(reinterpret_cast(data1.data()), data1.size()); + auto shaResult = sha.Final(reinterpret_cast(data2.data()), data2.size()); + auto shaResult2 = sha2.Final( + reinterpret_cast((data1 + data2).data()), data1.size() + data2.size()); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } +} + TEST(SHA, SHA256Test) { - Sha256Hash sha; - Sha256Hash sha2; - uint8_t data[] = "A"; - auto shaResult = sha.Final(data, sizeof(data)); - auto shaResult2 = sha2.Final(data, sizeof(data)); - EXPECT_EQ(shaResult, shaResult2); - for (size_t i = 0; i != shaResult.size(); i++) - printf("%02x", shaResult[i]); + { + + Sha256Hash sha; + Sha256Hash sha2; + uint8_t data[] = "A"; + auto shaResult = sha.Final(data, sizeof(data)); + auto shaResult2 = sha2.Final(data, sizeof(data)); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } + { + Sha256Hash sha; + Sha256Hash sha2; + std::string data1 = "ABCDE"; + std::string data2 = "FGHIJ"; + sha.Append(reinterpret_cast(data1.data()), data1.size()); + auto shaResult = sha.Final(reinterpret_cast(data2.data()), data2.size()); + auto shaResult2 = sha2.Final( + reinterpret_cast((data1 + data2).data()), data1.size() + data2.size()); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } } TEST(SHA, SHA384Test) { - Sha384Hash sha; - Sha384Hash sha2; - uint8_t data[] = "A"; - auto shaResult = sha.Final(data, sizeof(data)); - auto shaResult2 = sha2.Final(data, sizeof(data)); - EXPECT_EQ(shaResult, shaResult2); - for (size_t i = 0; i != shaResult.size(); i++) - printf("%02x", shaResult[i]); + { + + Sha384Hash sha; + Sha384Hash sha2; + uint8_t data[] = "A"; + auto shaResult = sha.Final(data, sizeof(data)); + auto shaResult2 = sha2.Final(data, sizeof(data)); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } + { + Sha384Hash sha; + Sha384Hash sha2; + std::string data1 = "ABCDE"; + std::string data2 = "FGHIJ"; + sha.Append(reinterpret_cast(data1.data()), data1.size()); + auto shaResult = sha.Final(reinterpret_cast(data2.data()), data2.size()); + auto shaResult2 = sha2.Final( + reinterpret_cast((data1 + data2).data()), data1.size() + data2.size()); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } } TEST(SHA, SHA512Test) { - Sha512Hash sha; - Sha512Hash sha2; - uint8_t data[] = "A"; - auto shaResult = sha.Final(data, sizeof(data)); - auto shaResult2 = sha2.Final(data, sizeof(data)); - EXPECT_EQ(shaResult, shaResult2); - for (size_t i = 0; i != shaResult.size(); i++) - printf("%02x", shaResult[i]); + { + + Sha512Hash sha; + Sha512Hash sha2; + uint8_t data[] = "A"; + auto shaResult = sha.Final(data, sizeof(data)); + auto shaResult2 = sha2.Final(data, sizeof(data)); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } + { + Sha512Hash sha; + Sha512Hash sha2; + std::string data1 = "ABCDE"; + std::string data2 = "FGHIJ"; + sha.Append(reinterpret_cast(data1.data()), data1.size()); + auto shaResult = sha.Final(reinterpret_cast(data2.data()), data2.size()); + auto shaResult2 = sha2.Final( + reinterpret_cast((data1 + data2).data()), data1.size() + data2.size()); + EXPECT_EQ(shaResult, shaResult2); + for (size_t i = 0; i != shaResult.size(); i++) + printf("%02x", shaResult[i]); + } } diff --git a/sdk/core/azure-core/test/ut/websocket_server.py b/sdk/core/azure-core/test/ut/websocket_server.py new file mode 100644 index 0000000000..ca7bcc077b --- /dev/null +++ b/sdk/core/azure-core/test/ut/websocket_server.py @@ -0,0 +1,155 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT +from array import array +import asyncio +from operator import length_hint +import threading +from time import sleep +from urllib.parse import ParseResult, urlparse + +import websockets + +# create handler for each connection +customPaths = {} +stop = False + +async def handleControlPath(websocket): + while (1): + data : str = await websocket.recv() + parsedCommand = data.split(' ') + if (parsedCommand[0] == "close"): + print("Closing control channel") + await websocket.send("ok") + print("Terminating WebSocket server.") + stop.set_result(0) + break + elif parsedCommand[0] == "newPath": + print("Add path") + newPath = parsedCommand[1] + print(" Add path ", newPath) + customPaths[newPath] = {"path": newPath, "delay": int(parsedCommand[2]) } + await websocket.send("ok") + else: + print("Unknown command, echoing it.") + await websocket.send(data) + +async def handleCustomPath(websocket, path:dict): + print("Handle custom path", path) + data : str = await websocket.recv() + print("Received ", data) + if ("delay" in path.keys()): + sleep(path["delay"]) + print("Responding") + await websocket.send(data) + await websocket.close() + +def HexEncode(data: bytes)->str: + rv="" + for val in data: + rv+= '{:02X}'.format(val) + return rv + +def ParseQuery(url : ParseResult) -> dict: + rv={} + if len(url.query)!=0: + args = url.query.split('&') + for arg in args: + vals=arg.split('=') + rv[vals[0]]=vals[1] + return rv + +echo_count_lock = threading.Lock() +echo_count_recv = 0 +echo_count_send = 0 +client_count = 0 +async def handleEcho(websocket, url:ParseResult): + global client_count + global echo_count_recv + global echo_count_send + global echo_count_lock + queryValues = ParseQuery(url) + while websocket.open: + try: + data = await websocket.recv() + with echo_count_lock: + echo_count_recv+=1 + if 'delay' in queryValues: + print(f"sleeping for {queryValues['delay']} seconds") + await asyncio.sleep(float(queryValues['delay'])) + print("woken up.") + + if 'fragment' in queryValues and queryValues['fragment']=='true': + await websocket.send(data.split()) + else: + await websocket.send(data) + with echo_count_lock: + echo_count_send+=1 + except websockets.ConnectionClosedOK: + print("Connection closed ok.") + with echo_count_lock: + client_count -= 1 + print(f"Echo count: {echo_count_recv}, {echo_count_send} client_count {client_count}") + if client_count == 0: + echo_count_send = 0 + echo_count_recv = 0 + return + except websockets.ConnectionClosed as ex: + if (ex.rcvd): + print(f"Connection closed exception: {ex.rcvd.code} {ex.rcvd.reason}") + else: + print(f"Connection closed. No close information.") + with echo_count_lock: + client_count -= 1 + print(f"Echo count: recv: {echo_count_recv}, send: {echo_count_send} client_count {client_count}") + if client_count == 0: + echo_count_send = 0 + echo_count_recv = 0 + return + +async def handler(websocket, path : str): + global client_count + print("Socket handler: ", path) + parsedUrl = urlparse(path) + if (parsedUrl.path == '/openclosetest'): + print("Open/Close Test") + try: + data = await websocket.recv() + print(f"OpenCloseTest: Received {data}") + except websockets.ConnectionClosedOK: + print("OpenCloseTest: Connection closed ok.") + except websockets.ConnectionClosed as ex: + print(f"OpenCloseTest: Connection closed exception: {ex.rcvd.code} {ex.rcvd.reason}") + return + elif (parsedUrl.path == '/echotest'): + with echo_count_lock: + client_count+= 1 + await handleEcho(websocket, parsedUrl) + elif (parsedUrl.path == '/closeduringecho'): + data = await websocket.recv() + await websocket.close(1001, 'closed') + elif (parsedUrl.path =='/control'): + await handleControlPath(websocket) + elif (parsedUrl.path in customPaths.keys()): + print("Found path ", path, "in control paths.") + await handleCustomPath(websocket, customPaths[path]) + elif (parsedUrl.path == '/terminateserver'): + print("Terminating WebSocket server.") + stop.set_result(0) + else: + data = await websocket.recv() + print("Received: ", data) + + reply = f"Data received as: {data}!" + await websocket.send(reply) + +async def main(): + global stop + print("Starting server") + loop = asyncio.get_running_loop() + stop = loop.create_future() + async with websockets.serve(handler, "localhost", 8000, ping_interval=7): + await stop # run forever. + +if __name__=="__main__": + asyncio.run(main()) + print("Ending server") diff --git a/sdk/core/azure-core/test/ut/websocket_test.cpp b/sdk/core/azure-core/test/ut/websocket_test.cpp new file mode 100644 index 0000000000..3160934962 --- /dev/null +++ b/sdk/core/azure-core/test/ut/websocket_test.cpp @@ -0,0 +1,875 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +#include "../../src/http/websockets/websockets_impl.hpp" +#include "azure/core/http/websockets/websockets.hpp" +#include "azure/core/internal/json/json.hpp" +#include +#include +#include +#include +#include +#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) +#include "azure/core/http/websockets/curl_websockets_transport.hpp" +#endif +// cspell::words closeme flibbityflobbidy + +using namespace Azure::Core; +using namespace Azure::Core::Http::WebSockets; +using namespace Azure::Core::Http::WebSockets::_internal; +using namespace std::chrono_literals; + +constexpr uint16_t UndefinedButLegalCloseReason = 4500; + +class WebSocketTests : public testing::Test { +private: +protected: + // Create + static void SetUpTestSuite() {} + static void TearDownTestSuite() {} +}; + +TEST_F(WebSocketTests, CreateSimpleSocket) +{ + { + WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000")); + defaultSocket.AddHeader("newHeader", "headerValue"); + EXPECT_THROW(defaultSocket.GetNegotiatedProtocol(), std::runtime_error); + } +} + +TEST_F(WebSocketTests, OpenSimpleSocket) +{ + { + WebSocketOptions options; + WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000/openclosetest"), options); + defaultSocket.AddHeader("newHeader", "headerValue"); + + defaultSocket.Open(); + + EXPECT_THROW(defaultSocket.AddHeader("newHeader", "headerValue"), std::runtime_error); + + // Close the socket without notifying the peer. + defaultSocket.Close(); + } + + { + WebSocketOptions options; + WebSocket defaultSocket(Azure::Core::Url("http://www.microsoft.com/"), options); + defaultSocket.AddHeader("newHeader", "headerValue"); + + // When running this test locally, the call times out, so drop in a 5 second timeout on + // the request. + Azure::Core::Context requestContext = Azure::Core::Context::ApplicationContext.WithDeadline( + std::chrono::system_clock::now() + 5s); + EXPECT_THROW(defaultSocket.Open(requestContext), std::runtime_error); + } +} + +TEST_F(WebSocketTests, OpenAndCloseSocket) +{ + if (false) + { + WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000/openclosetest")); + defaultSocket.AddHeader("newHeader", "headerValue"); + + defaultSocket.Open(); + + // Close the socket without notifying the peer. + defaultSocket.Close(UndefinedButLegalCloseReason); + } + + { + WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000/openclosetest")); + + defaultSocket.Open(); + + // Close the socket without notifying the peer. + defaultSocket.Close(UndefinedButLegalCloseReason, "This is a good reason."); + + // + // Now re-open the socket - this should work to reset everything. + defaultSocket.Open(); + EXPECT_THROW(defaultSocket.Open(), std::runtime_error); + defaultSocket.Close(); + } +} + +TEST_F(WebSocketTests, SimpleEcho) +{ + { + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); + + testSocket.Open(); + + testSocket.SendFrame("Test message", true); + + auto response = testSocket.ReceiveFrame(); + EXPECT_EQ(WebSocketFrameType::TextFrameReceived, response->FrameType); + EXPECT_THROW(response->AsBinaryFrame(), std::logic_error); + auto textResult = response->AsTextFrame(); + EXPECT_EQ("Test message", textResult->Text); + + // Close the socket gracefully. + testSocket.Close(); + } + { + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest?delay=5")); + + testSocket.Open(); + + std::vector binaryData{1, 2, 3, 4, 5, 6}; + + testSocket.SendFrame(binaryData, true); + + auto response = testSocket.ReceiveFrame(); + EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); + EXPECT_THROW(response->AsPeerCloseFrame(), std::logic_error); + EXPECT_THROW(response->AsTextFrame(), std::logic_error); + auto textResult = response->AsBinaryFrame(); + EXPECT_EQ(binaryData, textResult->Data); + + // Close the socket gracefully. + testSocket.Close(); + } + + { + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest?fragment=true&delay=5")); + + testSocket.Open(); + + std::vector binaryData{1, 2, 3, 4, 5, 6}; + + testSocket.SendFrame(binaryData, true); + + std::vector responseData; + std::shared_ptr response; + do + { + response = testSocket.ReceiveFrame(); + EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); + auto binaryResult = response->AsBinaryFrame(); + responseData.insert(responseData.end(), binaryResult->Data.begin(), binaryResult->Data.end()); + } while (!response->IsFinalFrame); + + auto textResult = response->AsBinaryFrame(); + EXPECT_EQ(binaryData, responseData); + + // Close the socket gracefully. + testSocket.Close(); + } +} + +template void EchoRandomData(WebSocket& socket) +{ + std::vector sendData = Azure::Core::Http::WebSockets::_detail::GenerateRandomBytes(N); + + socket.SendFrame(sendData, true); + + std::vector receiveData; + + std::shared_ptr response; + do + { + response = socket.ReceiveFrame(); + EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); + auto binaryResult = response->AsBinaryFrame(); + receiveData.insert(receiveData.end(), binaryResult->Data.begin(), binaryResult->Data.end()); + } while (!response->IsFinalFrame); + + // Make sure we get back the data we sent in the echo request. + EXPECT_EQ(sendData.size(), receiveData.size()); + EXPECT_EQ(sendData, receiveData); +} + +TEST_F(WebSocketTests, VariableSizeEcho) +{ + { + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); + + testSocket.Open(); + { + EchoRandomData<100>(testSocket); + EchoRandomData<124>(testSocket); + EchoRandomData<125>(testSocket); + // The websocket protocol treats lengths of 125, 126 and > 127 specially. + EchoRandomData<126>(testSocket); + EchoRandomData<127>(testSocket); + EchoRandomData<128>(testSocket); + EchoRandomData<1020>(testSocket); // 1K-4 + EchoRandomData<1021>(testSocket); // 1K-3 + EchoRandomData<1022>(testSocket); // 1K-2 + EchoRandomData<1023>(testSocket); // 1K-1 + EchoRandomData<1024>(testSocket); // 1K + EchoRandomData<2048>(testSocket); // 2K + EchoRandomData<4096>(testSocket); // 4K + EchoRandomData<8192>(testSocket); // 8K + // The websocket protocol treats lengths of >65536 specially. + EchoRandomData<65535>(testSocket); // 64K-1 + EchoRandomData<65536>(testSocket); // 64K + EchoRandomData<65537>(testSocket); // 64K+1 + EchoRandomData<131072>(testSocket); // 128K + } + // Close the socket gracefully. + testSocket.Close(); + } +} + +// Generator for random bytes. Used in WebSocketImplementation and tests. +std::vector GenerateRandomBytes(size_t index, size_t vectorSize) +{ + std::random_device randomEngine; + + std::vector rv(vectorSize + 4); + rv[0] = index & 0xff; + rv[1] = (index >> 8) & 0xff; + rv[2] = (index >> 16) & 0xff; + rv[3] = (index >> 24) & 0xff; + std::generate(std::begin(rv) + 4, std::end(rv), [&randomEngine]() mutable { + return static_cast(randomEngine() % UINT8_MAX); + }); + return rv; +} + +TEST_F(WebSocketTests, CloseDuringEcho) +{ + { + WebSocket testSocket(Azure::Core::Url("ws://localhost:8000/closeduringecho")); + + testSocket.Open(); + + testSocket.SendFrame("Test message", true); + + auto response = testSocket.ReceiveFrame(); + EXPECT_EQ(WebSocketFrameType::PeerClosedReceived, response->FrameType); + auto PeerClosedReceived = response->AsPeerCloseFrame(); + EXPECT_EQ(1001, PeerClosedReceived->RemoteStatusCode); + + // Close the socket gracefully. + testSocket.Close(); + } + + // Close the websocket while a thread is waiting for a response. + { + WebSocket testSocket(Azure::Core::Url("ws://localhost:8000/echotest?delay=10")); + + testSocket.Open(); + + std::thread testThread([&]() { + try + { + std::vector sendData = GenerateRandomBytes(0, 100); + testSocket.SendFrame(sendData); + GTEST_LOG_(INFO) << "Receive frame."; + auto response = testSocket.ReceiveFrame(); + GTEST_LOG_(INFO) << "Received frame."; + if (response->FrameType == WebSocketFrameType::PeerClosedReceived) + { + GTEST_LOG_(INFO) << "Peer closed the socket; Terminating thread."; + return; + } + else if (response->FrameType != WebSocketFrameType::BinaryFrameReceived) + { + GTEST_LOG_(INFO) << "Unexpected frame type received."; + } + EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); + auto binaryResult = response->AsBinaryFrame(); + } + catch (Azure::Core::OperationCancelledException& ex) + { + GTEST_LOG_(ERROR) << "Cancelled Exception: " << ex.what() + << " Current Thread: " << std::this_thread::get_id() << std::endl; + } + catch (std::exception const& ex) + { + GTEST_LOG_(ERROR) << "Exception: " << ex.what() << std::endl; + } + }); + + std::this_thread::sleep_for(100ms); + + // Close the socket gracefully. + GTEST_LOG_(INFO) << "Closing Socket."; + EXPECT_NO_THROW(testSocket.Close(UndefinedButLegalCloseReason, "Close Reason.")); + GTEST_LOG_(INFO) << "Closed Socket."; + testThread.join(); + } +} + +TEST_F(WebSocketTests, ExpectThrow) +{ + { + WebSocket testSocket(Azure::Core::Url("ws://localhost:8000/closeduringecho")); + + EXPECT_THROW(testSocket.SendFrame("Foo", true), std::runtime_error); + std::vector data{1, 2, 3, 4}; + EXPECT_THROW(testSocket.SendFrame(data, true), std::runtime_error); + EXPECT_THROW(testSocket.ReceiveFrame(), std::runtime_error); + } +} + +std::string ToHexString(std::vector const& data) +{ + std::stringstream ss; + for (auto const& byte : data) + { + ss << std::hex << std::setfill('0') << std::setw(2) << static_cast(byte); + } + return ss.str(); +} + +TEST_F(WebSocketTests, PingReceiveTest) +{ + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); + + testSocket.Open(); + if (!testSocket.HasBuiltInWebSocketSupport()) + { + + GTEST_LOG_(INFO) << "Sleeping for 15 seconds to collect pings."; + Azure::Core::Context receiveContext = Azure::Core::Context::ApplicationContext.WithDeadline( + Azure::DateTime{std::chrono::system_clock::now() + 15s}); + EXPECT_THROW(testSocket.ReceiveFrame(receiveContext), Azure::Core::OperationCancelledException); + auto statistics = testSocket.GetStatistics(); + GTEST_LOG_(INFO) << "Total bytes sent: " << std::dec << statistics.BytesSent; + GTEST_LOG_(INFO) << "Total bytes received: " << std::dec << statistics.BytesReceived; + GTEST_LOG_(INFO) << "Ping Frames received: " << std::dec << statistics.PingFramesReceived; + GTEST_LOG_(INFO) << "Ping Frames sent: " << std::dec << statistics.PingFramesSent; + GTEST_LOG_(INFO) << "Pong Frames received: " << std::dec << statistics.PongFramesReceived; + GTEST_LOG_(INFO) << "Pong Frames sent: " << std::dec << statistics.PongFramesSent; + GTEST_LOG_(INFO) << "Binary frames sent: " << std::dec << statistics.BinaryFramesSent; + GTEST_LOG_(INFO) << "Binary frames received: " << std::dec << statistics.BinaryFramesReceived; + GTEST_LOG_(INFO) << "Total frames lost: " << std::dec << statistics.FramesDropped; + GTEST_LOG_(INFO) << "Transport Reads " << std::dec << statistics.TransportReads; + GTEST_LOG_(INFO) << "Transport Bytes Read " << std::dec << statistics.TransportReadBytes; + EXPECT_NE(0, statistics.PingFramesReceived); + EXPECT_NE(0, statistics.PongFramesSent); + } +} + +TEST_F(WebSocketTests, PingSendTest) +{ + // Configure the socket to ping every second. + WebSocketOptions socketOptions; + socketOptions.PingInterval = std::chrono::seconds(1); + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest"), socketOptions); + + testSocket.Open(); + if (!testSocket.HasBuiltInWebSocketSupport()) + { + + GTEST_LOG_(INFO) << "Sleeping for 10 seconds to collect pings."; + // Note that we cannot collect incoming pings or outgoing pongs unless we are receiving + // data from the server. + Azure::Core::Context receiveContext = Azure::Core::Context::ApplicationContext.WithDeadline( + Azure::DateTime{std::chrono::system_clock::now() + 10s}); + EXPECT_THROW(testSocket.ReceiveFrame(receiveContext), Azure::Core::OperationCancelledException); + auto statistics = testSocket.GetStatistics(); + GTEST_LOG_(INFO) << "Total bytes sent: " << std::dec << statistics.BytesSent; + GTEST_LOG_(INFO) << "Total bytes received: " << std::dec << statistics.BytesReceived; + GTEST_LOG_(INFO) << "Ping Frames received: " << std::dec << statistics.PingFramesReceived; + GTEST_LOG_(INFO) << "Ping Frames sent: " << std::dec << statistics.PingFramesSent; + GTEST_LOG_(INFO) << "Pong Frames received: " << std::dec << statistics.PongFramesReceived; + GTEST_LOG_(INFO) << "Pong Frames sent: " << std::dec << statistics.PongFramesSent; + GTEST_LOG_(INFO) << "Binary frames sent: " << std::dec << statistics.BinaryFramesSent; + GTEST_LOG_(INFO) << "Binary frames received: " << std::dec << statistics.BinaryFramesReceived; + GTEST_LOG_(INFO) << "Total frames lost: " << std::dec << statistics.FramesDropped; + GTEST_LOG_(INFO) << "Transport Reads " << std::dec << statistics.TransportReads; + GTEST_LOG_(INFO) << "Transport Bytes Read " << std::dec << statistics.TransportReadBytes; + EXPECT_NE(0, statistics.PingFramesSent); + EXPECT_NE(0, statistics.PongFramesReceived); + EXPECT_NE(0, statistics.PingFramesReceived); + EXPECT_NE(0, statistics.PongFramesSent); + } +} + +TEST_F(WebSocketTests, MultiThreadedTestOnSingleSocket) +{ + constexpr size_t threadCount = 50; + constexpr size_t testDataLength = 200000; + constexpr size_t testDataSize = 100; + constexpr auto testDuration = 10s; + + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); + + testSocket.Open(); + + // seed test data for the operations. + std::vector> testData(testDataLength); + std::vector> receivedData(testDataLength); + std::atomic_size_t iterationCount(0); + + // Spin up threadCount threads and hammer the echo server for 10 seconds. + std::vector threads; + std::atomic_int32_t cancellationExceptions{0}; + std::atomic_int32_t exceptions{0}; + for (size_t threadIndex = 0; threadIndex < threadCount; threadIndex += 1) + { + threads.push_back(std::thread([&]() { + std::chrono::time_point startTime + = std::chrono::system_clock::now(); + // Set the context to expire *after* the test is supposed to finish. + Azure::Core::Context context = Azure::Core::Context::ApplicationContext.WithDeadline( + Azure::DateTime{startTime} + testDuration + 10s); + size_t iteration = 0; + try + { + do + { + iteration = iterationCount++; + std::vector sendData = GenerateRandomBytes(iteration, testDataSize); + { + if (iteration < testData.size()) + { + if (testData[iteration].size() != 0) + { + GTEST_LOG_(ERROR) << "Overwriting send frame at offset " << iteration << std::endl; + } + EXPECT_EQ(0, testData[iteration].size()); + testData[iteration] = sendData; + } + } + + testSocket.SendFrame(sendData, true /*, context*/); + auto response = testSocket.ReceiveFrame(context); + EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); + auto binaryResult = response->AsBinaryFrame(); + + // Make sure we get back the data we sent in the echo request. + if (binaryResult->Data.size() == 0) + { + GTEST_LOG_(ERROR) << "Received empty frame at offset " << iteration << std::endl; + } + EXPECT_EQ(sendData.size(), binaryResult->Data.size()); + { + // There is no ordering expectation on the results, so we just remember the data + // as it comes in. We'll make sure we received everything later on. + if (iteration < receivedData.size()) + { + if (receivedData[iteration].size() != 0) + { + GTEST_LOG_(ERROR) << "Overwriting receive frame at offset " << iteration + << std::endl; + } + + EXPECT_EQ(0, receivedData[iteration].size()); + receivedData[iteration] = binaryResult->Data; + } + } + } while (std::chrono::system_clock::now() - startTime < testDuration); + } + catch (Azure::Core::OperationCancelledException& ex) + { + GTEST_LOG_(ERROR) << "Cancelled Exception: " << ex.what() << " at index " << iteration + << " Current Thread: " << std::this_thread::get_id() << std::endl; + cancellationExceptions++; + } + catch (std::exception const& ex) + { + GTEST_LOG_(ERROR) << "Exception: " << ex.what() << std::endl; + exceptions++; + } + })); + } + + // Wait for all the threads to exit. + for (auto& thread : threads) + { + thread.join(); + } + + // We no longer need to worry about synchronization since all the worker threads are done. + GTEST_LOG_(INFO) << "Total server requests: " << iterationCount.load() << std::endl; + GTEST_LOG_(INFO) << "Estimated " << std::dec << testData.size() << " iterations (0x" << std::hex + << testData.size() << ")" << std::endl; + EXPECT_GE(testDataLength, iterationCount.load()); + + auto statistics = testSocket.GetStatistics(); + GTEST_LOG_(INFO) << "Total bytes sent: " << std::dec << statistics.BytesSent; + GTEST_LOG_(INFO) << "Total bytes received: " << std::dec << statistics.BytesReceived; + GTEST_LOG_(INFO) << "Ping Frames received: " << std::dec << statistics.PingFramesReceived; + GTEST_LOG_(INFO) << "Ping Frames sent: " << std::dec << statistics.PingFramesSent; + GTEST_LOG_(INFO) << "Pong Frames received: " << std::dec << statistics.PongFramesReceived; + GTEST_LOG_(INFO) << "Pong Frames sent: " << std::dec << statistics.PongFramesSent; + GTEST_LOG_(INFO) << "Binary frames sent: " << std::dec << statistics.BinaryFramesSent; + GTEST_LOG_(INFO) << "Binary frames received: " << std::dec << statistics.BinaryFramesReceived; + GTEST_LOG_(INFO) << "Total frames lost: " << std::dec << statistics.FramesDropped; + GTEST_LOG_(INFO) << "Transport Reads " << std::dec << statistics.TransportReads; + GTEST_LOG_(INFO) << "Transport Bytes Read " << std::dec << statistics.TransportReadBytes; + + // Close the socket gracefully. + testSocket.Close(); + + EXPECT_EQ(iterationCount.load(), statistics.BinaryFramesSent); + EXPECT_EQ(iterationCount.load(), statistics.BinaryFramesReceived); + + // Resize the test data to the number of actual iterations. + testData.resize(iterationCount.load()); + receivedData.resize(iterationCount.load()); + + // If we've processed every iteration, let's make sure that we received everything we sent. + // If we dropped some results, then we can't check to ensure that we have received everything + // because we can't account for everything sent. + std::multiset testDataStrings; + std::multiset receivedDataStrings; + for (auto const& data : testData) + { + testDataStrings.emplace(ToHexString(data)); + } + for (auto const& data : receivedData) + { + receivedDataStrings.emplace(ToHexString(data)); + } + + EXPECT_EQ(testDataStrings, receivedDataStrings); + for (auto const& data : testDataStrings) + { + if (receivedDataStrings.count(data) != testDataStrings.count(data)) + { + GTEST_LOG_(INFO) << "Missing data. TestDataCount: " << testDataStrings.count(data) + << " ReceivedDataCount: " << receivedDataStrings.count(data) + << " Missing Data: " << data << std::endl; + } + EXPECT_NE(receivedDataStrings.end(), receivedDataStrings.find(data)); + } + for (auto const& data : receivedDataStrings) + { + if (testDataStrings.count(data) != receivedDataStrings.count(data)) + { + GTEST_LOG_(INFO) << "Extra data. TestDataCount: " << testDataStrings.count(data) + << " ReceivedDataCount: " << receivedDataStrings.count(data) + << " Missing Data: " << data << std::endl; + } + + EXPECT_NE(testDataStrings.end(), testDataStrings.find(data)); + } + + // We shouldn't have seen any exceptions during the run. + EXPECT_EQ(0, exceptions.load()); + EXPECT_EQ(0, cancellationExceptions.load()); +} + +TEST_F(WebSocketTests, MultiThreadedTestOnMultipleSockets) +{ + constexpr size_t threadCount = 50; + constexpr size_t testDataLength = 200000; + constexpr size_t testDataSize = 100; + constexpr auto testDuration = 10s; + + // seed test data for the operations. + std::vector> testData(testDataLength); + std::vector> receivedData(testDataLength); + std::atomic_size_t iterationCount(0); + + // Spin up threadCount threads and hammer the echo server for 10 seconds. + std::vector threads; + std::atomic_int32_t cancellationExceptions{0}; + std::atomic_int32_t exceptions{0}; + for (size_t threadIndex = 0; threadIndex < threadCount; threadIndex += 1) + { + threads.push_back(std::thread([&]() { + std::chrono::time_point startTime + = std::chrono::system_clock::now(); + // Set the context to expire *after* the test is supposed to finish. + Azure::Core::Context context = Azure::Core::Context::ApplicationContext.WithDeadline( + Azure::DateTime{startTime} + testDuration + 10s); + size_t iteration = 0; + try + { + WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); + + testSocket.Open(); + + do + { + iteration = iterationCount++; + std::vector sendData = GenerateRandomBytes(iteration, testDataSize); + { + if (iteration < testData.size()) + { + if (testData[iteration].size() != 0) + { + GTEST_LOG_(ERROR) << "Overwriting send frame at offset " << iteration << std::endl; + } + EXPECT_EQ(0, testData[iteration].size()); + testData[iteration] = sendData; + } + } + + testSocket.SendFrame(sendData, true /*, context*/); + auto response = testSocket.ReceiveFrame(context); + EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); + auto binaryResult = response->AsBinaryFrame(); + + // Make sure we get back the data we sent in the echo request. + if (binaryResult->Data.size() == 0) + { + GTEST_LOG_(ERROR) << "Received empty frame at offset " << iteration << std::endl; + } + EXPECT_EQ(sendData.size(), binaryResult->Data.size()); + { + // There is no ordering expectation on the results, so we just remember the data + // as it comes in. We'll make sure we received everything later on. + if (iteration < receivedData.size()) + { + if (receivedData[iteration].size() != 0) + { + GTEST_LOG_(ERROR) << "Overwriting receive frame at offset " << iteration + << std::endl; + } + + EXPECT_EQ(0, receivedData[iteration].size()); + receivedData[iteration] = binaryResult->Data; + } + } + } while (std::chrono::system_clock::now() - startTime < testDuration); + // Close the socket gracefully. + testSocket.Close(); + } + catch (Azure::Core::OperationCancelledException& ex) + { + GTEST_LOG_(ERROR) << "Cancelled Exception: " << ex.what() << " at index " << iteration + << " Current Thread: " << std::this_thread::get_id() << std::endl; + cancellationExceptions++; + } + catch (std::exception const& ex) + { + GTEST_LOG_(ERROR) << "Exception: " << ex.what() << std::endl; + exceptions++; + } + })); + } + + // Wait for all the threads to exit. + for (auto& thread : threads) + { + thread.join(); + } + + // We no longer need to worry about synchronization since all the worker threads are done. + GTEST_LOG_(INFO) << "Total server requests: " << iterationCount.load() << std::endl; + GTEST_LOG_(INFO) << "Estimated " << std::dec << testData.size() << " iterations (0x" << std::hex + << testData.size() << ")" << std::endl; + EXPECT_GE(testDataLength, iterationCount.load()); + + // Resize the test data to the number of actual iterations. + testData.resize(iterationCount.load()); + receivedData.resize(iterationCount.load()); + + // If we've processed every iteration, let's make sure that we received everything we sent. + // If we dropped some results, then we can't check to ensure that we have received everything + // because we can't account for everything sent. + std::multiset testDataStrings; + std::multiset receivedDataStrings; + for (auto const& data : testData) + { + testDataStrings.emplace(ToHexString(data)); + } + for (auto const& data : receivedData) + { + receivedDataStrings.emplace(ToHexString(data)); + } + + EXPECT_EQ(testDataStrings, receivedDataStrings); + for (auto const& data : testDataStrings) + { + if (receivedDataStrings.count(data) != testDataStrings.count(data)) + { + GTEST_LOG_(INFO) << "Missing data. TestDataCount: " << testDataStrings.count(data) + << " ReceivedDataCount: " << receivedDataStrings.count(data) + << " Missing Data: " << data << std::endl; + } + EXPECT_NE(receivedDataStrings.end(), receivedDataStrings.find(data)); + } + for (auto const& data : receivedDataStrings) + { + if (testDataStrings.count(data) != receivedDataStrings.count(data)) + { + GTEST_LOG_(INFO) << "Extra data. TestDataCount: " << testDataStrings.count(data) + << " ReceivedDataCount: " << receivedDataStrings.count(data) + << " Missing Data: " << data << std::endl; + } + + EXPECT_NE(testDataStrings.end(), testDataStrings.find(data)); + } + + // We shouldn't have seen any exceptions during the run. + EXPECT_EQ(0, exceptions.load()); + EXPECT_EQ(0, cancellationExceptions.load()); +} + +// Does not work because curl rejects the wss: scheme. +class LibWebSocketIncrementProtocol { + WebSocketOptions m_options{{"dumb-increment-protocol"}}; + WebSocket m_socket; + +public: + LibWebSocketIncrementProtocol() : m_socket{Azure::Core::Url("wss://libwebsockets.org"), m_options} + { + } + + void Open() { m_socket.Open(); } + int GetNextNumber() + { + // Time out in 5 seconds if no activity. + Azure::Core::Context contextWithTimeout + = Azure::Core::Context().WithDeadline(std::chrono::system_clock::now() + 10s); + auto work = m_socket.ReceiveFrame(contextWithTimeout); + if (work->FrameType == WebSocketFrameType::TextFrameReceived) + { + auto frame = work->AsTextFrame(); + return std::atoi(frame->Text.c_str()); + } + if (work->FrameType == WebSocketFrameType::BinaryFrameReceived) + { + auto frame = work->AsBinaryFrame(); + throw std::runtime_error("Not implemented"); + } + else if (work->FrameType == WebSocketFrameType::PeerClosedReceived) + { + GTEST_LOG_(INFO) << "Remote server closed connection." << std::endl; + throw std::runtime_error("Remote server closed connection."); + } + else + { + throw std::runtime_error("Unknown result type"); + } + } + + void Reset() { m_socket.SendFrame("reset\n", true); } + void RequestClose() { m_socket.SendFrame("closeme\n", true); } + void Close() { m_socket.Close(); } + void Close(uint16_t closeCode, std::string const& reasonText = {}) + { + m_socket.Close(closeCode, reasonText); + } + void ConsumeUntilClosed() + { + while (m_socket.IsOpen()) + { + auto work = m_socket.ReceiveFrame(); + if (work->FrameType == WebSocketFrameType::PeerClosedReceived) + { + auto peerClose = work->AsPeerCloseFrame(); + GTEST_LOG_(INFO) << "Peer closed. Remote Code: " << std::dec << peerClose->RemoteStatusCode + << " (0x" << std::hex << peerClose->RemoteStatusCode << ")" << std::endl; + if (!peerClose->RemoteCloseReason.empty()) + { + GTEST_LOG_(INFO) << " Peer Closed Data: " << peerClose->RemoteCloseReason; + } + GTEST_LOG_(INFO) << std::endl; + return; + } + else if (work->FrameType == WebSocketFrameType::TextFrameReceived) + { + auto frame = work->AsTextFrame(); + GTEST_LOG_(INFO) << "Ignoring " << frame->Text << std::endl; + } + } + } +}; + +class LibWebSocketStatus { + +public: + std::string GetLWSStatus() + { + WebSocketOptions options; + + options.ServiceName = "websockettest"; + // Send 3 protocols to LWS. + options.Protocols.push_back("brownCow"); + options.Protocols.push_back("lws-status"); + options.Protocols.push_back("flibbityflobbidy"); + WebSocket serverSocket(Azure::Core::Url("wss://libwebsockets.org"), options); + serverSocket.Open(); + + // The server should have chosen the lws-status protocol since it doesn't understand the other + // protocols. + EXPECT_EQ("lws-status", serverSocket.GetNegotiatedProtocol()); + std::string returnValue; + std::shared_ptr lwsStatus; + do + { + + lwsStatus = serverSocket.ReceiveFrame(); + EXPECT_EQ(WebSocketFrameType::TextFrameReceived, lwsStatus->FrameType); + if (lwsStatus->FrameType == WebSocketFrameType::TextFrameReceived) + { + auto textFrame = lwsStatus->AsTextFrame(); + returnValue.insert(returnValue.end(), textFrame->Text.begin(), textFrame->Text.end()); + } + } while (!lwsStatus->IsFinalFrame); + serverSocket.Close(); + return returnValue; + } +}; + +TEST_F(WebSocketTests, LibWebSocketOrgLwsStatus) +{ + { + LibWebSocketStatus lwsStatus; + auto serverStatus = lwsStatus.GetLWSStatus(); + GTEST_LOG_(INFO) << "Server status: " << serverStatus << std::endl; + + Azure::Core::Json::_internal::json status; + EXPECT_NO_THROW(status = Azure::Core::Json::_internal::json::parse(serverStatus)); + EXPECT_TRUE(status["conns"].is_array()); + auto& connections = status["conns"].get_ref&>(); + bool foundOurConnection = false; + + // Scan through the list of connections to find a connection from the websockettest. + for (auto& connection : connections) + { + EXPECT_TRUE(connection["ua"].is_string()); + auto userAgent = connection["ua"].get(); + if (userAgent.find("websockettest") != std::string::npos) + { + foundOurConnection = true; + break; + } + } + EXPECT_TRUE(foundOurConnection); + } +} +TEST_F(WebSocketTests, LibWebSocketOrgIncrement) +{ + { + LibWebSocketIncrementProtocol incrementProtocol; + incrementProtocol.Open(); + + // Note that we cannot practically validate the numbers received from the service because + // they may be in flight at the time the "Reset" call is made. + for (auto i = 0; i < 100; i += 1) + { + if (i % 5 == 0) + { + GTEST_LOG_(INFO) << "Reset" << std::endl; + incrementProtocol.Reset(); + } + int number = incrementProtocol.GetNextNumber(); + GTEST_LOG_(INFO) << "Got next number " << number << std::endl; + } + incrementProtocol.RequestClose(); + incrementProtocol.ConsumeUntilClosed(); + } +} +#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) +TEST_F(WebSocketTests, CurlTransportCoverage) +{ + { + + Azure::Core::Http::WebSockets::CurlWebSocketTransportOptions transportOptions; + transportOptions.HttpKeepAlive = false; + auto transport + = std::make_shared(transportOptions); + + EXPECT_THROW(transport->NativeCloseSocket(1001, {}, {}), std::runtime_error); + EXPECT_THROW(transport->NativeGetCloseSocketInformation({}), std::runtime_error); + EXPECT_THROW( + transport->NativeSendFrame(WebSocketTransport::NativeWebSocketFrameType::Binary, {}, {}), + std::runtime_error); + EXPECT_THROW(transport->NativeReceiveFrame({}), std::runtime_error); + } +} +#endif diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 8547868d47..34be7a63ef 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -42,6 +42,56 @@ stages: LiveTestTimeoutInMinutes: 90 # default is 60 min. We need a little longer on worst case for Win+jsonTests LineCoverageTarget: 93 BranchCoverageTarget: 55 + PreTestSteps: + - task: UsePythonVersion@0 + displayName: 'Use Python 3' + inputs: + versionSpec: '3' + condition: and(succeeded(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + + - pwsh: | + python --version + pip install -r requirements.txt + workingDirectory: build/sdk/core/azure-core/test/ut + displayName: Install Python requirements. + condition: and(succeeded(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + - task: PowerShell@2 + displayName: 'Launch python websocket server' + inputs: + pwsh: true + filePath: build/sdk/core/azure-core/test/ut/Start-WebSocketServer.ps1 + arguments: $(Build.SourcesDirectory)/WebSocketServer.log + workingDirectory: build/sdk/core/azure-core/test/ut + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + # It would be nice to collapse this branch with the previous one, but nohup doesn't seem to + # behave when called from powershell. + - bash: | + nohup python sdk/core/azure-core/test/ut/websocket_server.py > $(Build.SourcesDirectory)/WebSocketServer.log & + workingDirectory: build + condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + displayName: Launch python websocket server (Linux). + PostTestSteps: + # Shut down the test server. This uses curl to send a request to the "terminateserver" websocket endpoint. + # When the test server receives a request on terminateserver, it shuts down gracefully. + - pwsh: | + curl ` + --include ` + --no-buffer ` + --header "Connection: Upgrade" ` + --header "Upgrade: websocket" ` + --header "Host: localhost:8000" ` + --header "Origin: http://localhost:8000" ` + --header "Sec-WebSocket-Key: eaQZ9ed+LnT0zs5EvI04aQ==" ` + --header "Sec-WebSocket-Version: 13" ` + http://localhost:8000/terminateserver + displayName: Shutdown WebSocket server. + condition: contains(variables.CmakeArgs, 'BUILD_TESTING=ON') + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactPath: '$(Build.SourcesDirectory)/WebSocketServer.log' + ArtifactName: 'WebSocketLogs-$(Agent.JobName)_attempt_$(System.JobAttempt)' + CustomCondition: contains(variables.CmakeArgs, 'BUILD_TESTING=ON') + Artifacts: - Name: azure-core Path: azure-core From 94055dd04707e951d7d03adde5c511076e8119a9 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Thu, 28 Jul 2022 11:44:41 -0700 Subject: [PATCH 02/75] Merge main with WebSockets. (#3856) Merge Main with feature/websockets branch. Co-authored-by: Ben Broderick Phillips Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com> Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: sima-zhu Co-authored-by: Ahson Khan Co-authored-by: Mike Harder Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> Co-authored-by: Daniel Jurek Co-authored-by: Heath Stewart Co-authored-by: Ben Broderick Phillips Co-authored-by: praveenkuttappan Co-authored-by: Ben Broderick Phillips --- .gitignore | 2 +- .vscode/cspell.json | 2 + eng/common/pipelines/templates/jobs/perf.yml | 142 ++++++++++++++++++ eng/common/scripts/Detect-Api-Changes.ps1 | 10 +- .../scripts/Helpers/Metadata-Helpers.ps1 | 3 +- .../Service-Level-Readme-Automation.ps1 | 16 +- eng/common/scripts/Test-SampleMetadata.ps1 | 7 +- eng/common/scripts/Update-DocsMsMetadata.ps1 | 2 +- eng/common/testproxy/test-proxy-docker.yml | 5 +- eng/common/testproxy/test-proxy-tool.yml | 11 +- .../stages/archetype-cpp-release.yml | 16 +- .../vcpkg/Config.cmake.in | 2 +- .../vcpkg/vcpkg.json | 2 +- sdk/core/azure-core/CMakeLists.txt | 4 + .../test/libcurl-stress-test/CMakeLists.txt | 19 +++ .../test/libcurl-stress-test/Chart.yaml | 16 ++ .../test/libcurl-stress-test/Dockerfile | 16 ++ .../test/libcurl-stress-test/README.md | 29 ++++ .../libcurl_stress_test.cpp | 83 ++++++++++ .../stress-test-resources.bicep | 16 ++ .../templates/deploy-job.yaml | 22 +++ .../CHANGELOG.md | 10 ++ .../src/private/package_version.hpp | 2 +- .../azure-security-keyvault-keys/CHANGELOG.md | 10 ++ .../src/private/package_version.hpp | 2 +- .../CHANGELOG.md | 10 ++ .../src/private/package_version.hpp | 2 +- 27 files changed, 421 insertions(+), 40 deletions(-) create mode 100644 eng/common/pipelines/templates/jobs/perf.yml create mode 100644 sdk/core/azure-core/test/libcurl-stress-test/CMakeLists.txt create mode 100644 sdk/core/azure-core/test/libcurl-stress-test/Chart.yaml create mode 100644 sdk/core/azure-core/test/libcurl-stress-test/Dockerfile create mode 100644 sdk/core/azure-core/test/libcurl-stress-test/README.md create mode 100644 sdk/core/azure-core/test/libcurl-stress-test/libcurl_stress_test.cpp create mode 100644 sdk/core/azure-core/test/libcurl-stress-test/stress-test-resources.bicep create mode 100644 sdk/core/azure-core/test/libcurl-stress-test/templates/deploy-job.yaml diff --git a/.gitignore b/.gitignore index 2b3a003e55..f426b11b3d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ [Rr]eleases/ x64/ x86/ -bld/ +bld*/ [Bb]in/ [Oo]bj/ [Ll]og/ diff --git a/.vscode/cspell.json b/.vscode/cspell.json index f4dc3a9d1a..efe3977771 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -11,6 +11,8 @@ "*.exe", "*.a", "*.lib", + "*.yaml", + "**/libcurl-stress-test/README.md", ".github/CODEOWNERS", ".gitignore", ".vscode/cspell.json", diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml new file mode 100644 index 0000000000..3d3a3f6e31 --- /dev/null +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -0,0 +1,142 @@ +parameters: +- name: Variables + type: object + default: [] +- name: OperatingSystems + type: string + default: 'Linux' +- name: Language + type: string + default: '' +- name: InstallLanguageSteps + type: stepList + default: [] +- name: ServiceDirectory + type: string + default: '' +- name: Services + type: string + default: '' +- name: PackageVersions + type: string + default: '.*' +- name: Tests + type: string + default: '.*' +- name: Arguments + type: string + default: '.*' +- name: Iterations + type: number + default: '5' +- name: AdditionalArguments + type: string + default: '' +- name: EnvVars + type: object + default: {} + +resources: + repositories: + - repository: azure-sdk-tools + type: github + endpoint: Azure + name: Azure/azure-sdk-tools + ref: main + +variables: +- ${{ parameters.Variables }} + +jobs: +- job: Perf + timeoutInMinutes: 360 + strategy: + matrix: + ${{ if contains(parameters.OperatingSystems, 'Linux') }}: + Linux: + Pool: 'azsdk-pool-mms-ubuntu-2004-perf' + OsVmImage: 'MMSUbuntu20.04' + MatrixName: 'Linux' + ${{ if contains(parameters.OperatingSystems, 'Windows') }}: + Windows: + Pool: 'azsdk-pool-mms-win-2019-perf' + OsVmImage: 'MMS2019' + MatrixName: 'Windows' + pool: + name: $(Pool) + vmImage: $(OSVmImage) + steps: + - checkout: self + path: s + + - checkout: azure-sdk-tools + path: s/azure-sdk-tools + + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + parameters: + AgentImage: $(OSVmImage) + + - ${{ parameters.InstallLanguageSteps }} + + - template: /eng/common/TestResources/deploy-test-resources.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + Location: westus + ResourceType: perf + + - pwsh: | + set-content -path config.yml -value "WorkingDirectories:" + add-content -path config.yml -value " ${{ parameters.Language }}: $(Agent.BuildDirectory)/s" + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation + displayName: Create config.yml + + - script: >- + dotnet run -- run + --no-sync + --languages ${{ parameters.Language }} + --services "${{ parameters.Services }}" + --package-versions "${{ parameters.PackageVersions }}" + --tests "${{ parameters.Tests }}" + --arguments "${{ parameters.Arguments }}" + --iterations ${{ parameters.Iterations }} + ${{ parameters.AdditionalArguments }} + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation + env: + ${{ each var in parameters.EnvVars }}: + ${{ var.key }}: ${{ var.value }} + displayName: Run perf tests + + - pwsh: | + get-content results.txt + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results + displayName: Print results.txt + condition: always() + + - pwsh: | + get-content results.csv + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results + displayName: Print results.csv + condition: always() + + - pwsh: | + get-content results.md + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results + displayName: Print results.md + condition: always() + + - pwsh: | + get-content results.json + workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results + displayName: Print results.json + condition: always() + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results + artifactName: results-$(MatrixName) + condition: always() + + - template: /eng/common/TestResources/remove-test-resources.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + ResourceType: perf diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index 1c9cdf696b..572ef43e1c 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -27,6 +27,7 @@ function Submit-Request($filePath, $packageName) if (!$repoName) { $repoName = "azure/azure-sdk-for-$LanguageShort" } + $reviewFileName = "$($packageName)_$($LanguageShort).json" $query = [System.Web.HttpUtility]::ParseQueryString('') $query.Add('artifactName', $ArtifactName) $query.Add('buildId', $BuildId) @@ -35,6 +36,12 @@ function Submit-Request($filePath, $packageName) $query.Add('repoName', $repoName) $query.Add('pullRequestNumber', $PullRequestNumber) $query.Add('packageName', $packageName) + $query.Add('language', $LanguageShort) + $reviewFileFullName = Join-Path -Path $ArtifactPath $packageName $reviewFileName + if (Test-Path $reviewFileFullName) + { + $query.Add('codeFile', $reviewFileName) + } $uri = [System.UriBuilder]$APIViewUri $uri.query = $query.toString() Write-Host "Request URI: $($uri.Uri.OriginalString)" @@ -65,7 +72,7 @@ function Should-Process-Package($pkgPath, $packageName) # Get package info from json file created before updating version to daily dev $pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json $packagePath = $pkgInfo.DirectoryPath - $modifiedFiles = Get-ChangedFiles -DiffPath "$packagePath/*" -DiffFilterType '' + $modifiedFiles = @(Get-ChangedFiles -DiffPath "$packagePath/*" -DiffFilterType '') $filteredFileCount = $modifiedFiles.Count Write-Host "Number of modified files for package: $filteredFileCount" return ($filteredFileCount -gt 0 -and $pkgInfo.IsNewSdk) @@ -80,7 +87,6 @@ function Log-Input-Params() Write-Host "Language: $($Language)" Write-Host "Commit SHA: $($CommitSha)" Write-Host "Repo Name: $($RepoFullName)" - Write-Host "Package Name: $($PackageName)" } Log-Input-Params diff --git a/eng/common/scripts/Helpers/Metadata-Helpers.ps1 b/eng/common/scripts/Helpers/Metadata-Helpers.ps1 index d5cd1af642..ba6f32b7d7 100644 --- a/eng/common/scripts/Helpers/Metadata-Helpers.ps1 +++ b/eng/common/scripts/Helpers/Metadata-Helpers.ps1 @@ -141,8 +141,7 @@ function GenerateDocsMsMetadata($originalMetadata, $language, $languageDisplayNa "ms.service"= $msService } $updatedMetadata = compare-and-merge-metadata -original $originalMetadata -updated $metadataTable - return "--- -$updatedMetadata---`r`n" + return "---`r`n$updatedMetadata---`r`n" } function ServiceLevelReadmeNameStyle($serviceName) { diff --git a/eng/common/scripts/Service-Level-Readme-Automation.ps1 b/eng/common/scripts/Service-Level-Readme-Automation.ps1 index 0fc334dd6b..1bef012293 100644 --- a/eng/common/scripts/Service-Level-Readme-Automation.ps1 +++ b/eng/common/scripts/Service-Level-Readme-Automation.ps1 @@ -76,16 +76,12 @@ function update-metadata-table($readmeFolder, $readmeName, $serviceName, $msServ $readmePath = Join-Path $readmeFolder -ChildPath $readmeName $readmeContent = Get-Content -Path $readmePath -Raw $match = $readmeContent -match "^---\n*(?(.*\n?)*?)---\n*(?(.*\n?)*)" - if (!$match) { - # $Language, $LanguageDisplayName are the variables globally defined in Language-Settings.ps1 - $metadataString = GenerateDocsMsMetadata -language $Language -languageDisplayName $LanguageDisplayName -serviceName $serviceName ` - -tenantId $TenantId -clientId $ClientId -clientSecret $ClientSecret ` - -msService $msService - Set-Content -Path $readmePath -Value "$metadataString$readmeContent" -NoNewline - return + $restContent = $readmeContent + $metadata = "" + if ($match) { + $restContent = $Matches["content"].trim() + $metadata = $Matches["metadata"].trim() } - $restContent = $Matches["content"].trim() - $metadata = $Matches["metadata"].trim() # $Language, $LanguageDisplayName are the variables globally defined in Language-Settings.ps1 $metadataString = GenerateDocsMsMetadata -originalMetadata $metadata -language $Language -languageDisplayName $LanguageDisplayName -serviceName $serviceName ` -tenantId $TenantId -clientId $ClientId -clientSecret $ClientSecret ` @@ -98,7 +94,7 @@ function generate-markdown-table($readmeFolder, $readmeName, $packageInfo, $moni $tableContent = "" # Here is the table, the versioned value will foreach ($pkg in $packageInfo) { - $repositoryLink = "$RepositoryUri/$($pkg.Package)" + $repositoryLink = "$PackageRepositoryUri/$($pkg.Package)" if (Test-Path "Function:$GetRepositoryLinkFn") { $repositoryLink = &$GetRepositoryLinkFn -packageInfo $pkg } diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index d5681e85d3..6ce31c2095 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -73,7 +73,7 @@ process { Write-Error "File '$($file.FullName)' contains invalid product slug: $product" -TargetObject $file ` -Category InvalidData -CategoryTargetName $product -CategoryTargetType string ` - -RecommendedAction 'Use only product slugs listed at https://review.docs.microsoft.com/help/contribute/metadata-taxonomies?branch=master#product' + -RecommendedAction 'Use only product slugs listed at https://review.docs.microsoft.com/help/contribute/metadata-taxonomies?branch=main#product' } } @@ -95,7 +95,7 @@ end { } begin { - # https://review.docs.microsoft.com/help/contribute/metadata-taxonomies?branch=master#product + # https://review.docs.microsoft.com/help/contribute/metadata-taxonomies?branch=main#product $productSlugs = @( "ai-builder", "aspnet", @@ -358,6 +358,7 @@ begin { "ef-core", "ef6", "expression-studio", + "language-service", "m365-ems", "m365-ems-cloud-app-security", "m365-ems-configuration-manager", @@ -498,7 +499,7 @@ Checks sample markdown files' frontmatter for invalid information. .DESCRIPTION Given a collection of markdown files, their frontmatter - if present - is checked for invalid information, including: -Invalid product slugs, i.e. those not listed in https://review.docs.microsoft.com/help/contribute/metadata-taxonomies?branch=master#product. +Invalid product slugs, i.e. those not listed in https://review.docs.microsoft.com/help/contribute/metadata-taxonomies?branch=main#product. .PARAMETER Path Specifies the path to an item to search. Wildcards are permitted. diff --git a/eng/common/scripts/Update-DocsMsMetadata.ps1 b/eng/common/scripts/Update-DocsMsMetadata.ps1 index c0b7d55563..b6b696758a 100644 --- a/eng/common/scripts/Update-DocsMsMetadata.ps1 +++ b/eng/common/scripts/Update-DocsMsMetadata.ps1 @@ -95,7 +95,7 @@ function GetAdjustedReadmeContent($ReadmeContent, $PackageInfo, $PackageMetadata $foundTitle = "" if ($ReadmeContent -match $TITLE_REGEX) { - $ReadmeContent = $ReadmeContent -replace $TITLE_REGEX, "`${0} - Version $($PackageInfo.Version) `n" + $ReadmeContent = $ReadmeContent -replace $TITLE_REGEX, "`${0} - version $($PackageInfo.Version) `n" $foundTitle = $matches["filetitle"] } diff --git a/eng/common/testproxy/test-proxy-docker.yml b/eng/common/testproxy/test-proxy-docker.yml index df2548ab77..52a7c807a3 100644 --- a/eng/common/testproxy/test-proxy-docker.yml +++ b/eng/common/testproxy/test-proxy-docker.yml @@ -1,10 +1,11 @@ parameters: rootFolder: '$(Build.SourcesDirectory)' targetVersion: '' + templateRoot: '$(Build.SourcesDirectory)' steps: - pwsh: | - $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 + ${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' - pwsh: | @@ -12,7 +13,7 @@ steps: displayName: 'Dump active docker information' - pwsh: | - $(Build.SourcesDirectory)/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}" -VersionOverride="${{ parameters.targetVersion }}" + ${{ parameters.templateRoot }}/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}" -VersionOverride="${{ parameters.targetVersion }}" displayName: 'Run the docker container' - pwsh: | diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index 7b5fedaaeb..679ad2108d 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -2,14 +2,15 @@ parameters: rootFolder: '$(Build.SourcesDirectory)' runProxy: true targetVersion: '' + templateRoot: '$(Build.SourcesDirectory)' steps: - pwsh: | - $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 + ${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' - pwsh: | - $version = $(Get-Content "$(Build.SourcesDirectory)/eng/common/testproxy/target_version.txt" -Raw).Trim() + $version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim() $overrideVersion = "${{ parameters.targetVersion }}" if($overrideVersion) { @@ -29,7 +30,7 @@ steps: - ${{ if eq(parameters.runProxy, 'true') }}: - pwsh: | - Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx" + Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx" Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables' @@ -37,13 +38,13 @@ steps: - pwsh: | Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe ` -ArgumentList "--storage-location ${{ parameters.rootFolder }}" ` - -NoNewWindow -PassThru -RedirectStandardOutput $(Build.SourcesDirectory)/test-proxy.log + -NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.templateRoot }}/test-proxy.log displayName: 'Run the testproxy - windows' condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) # nohup does NOT continue beyond the current session if you use it within powershell - bash: | - nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > $(Build.SourcesDirectory)/test-proxy.log & + nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > ${{ parameters.templateRoot }}/test-proxy.log & displayName: "Run the testproxy - linux/mac" condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) workingDirectory: "${{ parameters.rootFolder }}" diff --git a/eng/pipelines/templates/stages/archetype-cpp-release.yml b/eng/pipelines/templates/stages/archetype-cpp-release.yml index 21f35c8ad6..e4070400a6 100644 --- a/eng/pipelines/templates/stages/archetype-cpp-release.yml +++ b/eng/pipelines/templates/stages/archetype-cpp-release.yml @@ -108,7 +108,7 @@ stages: - pwsh: | $branchName = "azure-sdk-for-cpp-${{ artifact.Name }}-$(Build.BuildId)" if ('$(VcpkgForkBranchName)') { - Write-Host "Using queue time branch name" + Write-Host "Using queue time branch name" $branchName = '$(VcpkgForkBranchName)' } Write-Host "##vso[task.setvariable variable=PrBranchName]$branchName" @@ -164,14 +164,12 @@ stages: CommitMsg: Update vcpkg-configuration.json BaseRepoBranch: $(DefaultBranch) - # Set $(HasChanges) to $true so that - # create-pull-request.yml completes the push and PR - # submission steps. This is contegnent upon - # `$(PublishToVcpkg)` being `true`. `$(PublishToVcpkg)` is - # set in `vcpkg-publish.yml` - - pwsh: Write-Host "##vso[task.setvariable variable=HasChanges]$true" - condition: and(succeeded(), eq(variables['PublishToVcpkg'], 'true')) - displayName: Set $(HasChanges) to $true for create-pull-request.yml + # Set $(HasChanges) to $(PublishToVcpkg) so that + # create-pull-request.yml creates or does not create a PR + # based on the deicision of the step that determines + # whether to publish to vcpkg. + - pwsh: Write-Host "##vso[task.setvariable variable=HasChanges]$(PublishToVcpkg)" + displayName: Set $(HasChanges) to $(PublishToVcpkg) for create-pull-request.yml - template: /eng/common/pipelines/templates/steps/set-default-branch.yml parameters: diff --git a/sdk/attestation/azure-security-attestation/vcpkg/Config.cmake.in b/sdk/attestation/azure-security-attestation/vcpkg/Config.cmake.in index a5e4700f81..1872375c39 100644 --- a/sdk/attestation/azure-security-attestation/vcpkg/Config.cmake.in +++ b/sdk/attestation/azure-security-attestation/vcpkg/Config.cmake.in @@ -4,7 +4,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(azure-core-cpp "1.5.0") +find_dependency(azure-core-cpp "1.7.0") find_dependency(OpenSSL) include("${CMAKE_CURRENT_LIST_DIR}/azure-security-attestation-cppTargets.cmake") diff --git a/sdk/attestation/azure-security-attestation/vcpkg/vcpkg.json b/sdk/attestation/azure-security-attestation/vcpkg/vcpkg.json index bf420be4ac..a92569c2d8 100644 --- a/sdk/attestation/azure-security-attestation/vcpkg/vcpkg.json +++ b/sdk/attestation/azure-security-attestation/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-core-cpp", "default-features": false, - "version>=": "1.7.0-beta.1" + "version>=": "1.7.0" }, { "name": "vcpkg-cmake", diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index 6d94397403..4cf4415ad1 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -214,6 +214,10 @@ if(BUILD_TESTING) add_subdirectory(test/nlohmann-json-test) endif() add_subdirectory(test/fault-injector) + + if(BUILD_TRANSPORT_CURL) + add_subdirectory(test/libcurl-stress-test) + endif() endif() if (BUILD_PERFORMANCE_TESTS) diff --git a/sdk/core/azure-core/test/libcurl-stress-test/CMakeLists.txt b/sdk/core/azure-core/test/libcurl-stress-test/CMakeLists.txt new file mode 100644 index 0000000000..e802aaa385 --- /dev/null +++ b/sdk/core/azure-core/test/libcurl-stress-test/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + +cmake_minimum_required(VERSION 3.13) + +project(azure-core-libcurl-stress-test LANGUAGES CXX) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +add_executable( + azure-core-libcurl-stress-test + libcurl_stress_test.cpp +) + +target_link_libraries(azure-core-libcurl-stress-test PRIVATE azure-core) + +create_map_file(azure-core-libcurl-stress-test azure-core-libcurl-stress-test.map) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Dockerfile + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) diff --git a/sdk/core/azure-core/test/libcurl-stress-test/Chart.yaml b/sdk/core/azure-core/test/libcurl-stress-test/Chart.yaml new file mode 100644 index 0000000000..8b3a5f87bf --- /dev/null +++ b/sdk/core/azure-core/test/libcurl-stress-test/Chart.yaml @@ -0,0 +1,16 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + +apiVersion: v2 +name: libcurl-stress-test +description: An example of c++ stress test +version: 0.0.1 +appVersion: v0.1 +annotations: + stressTest: 'true' # enable auto-discovery of this test via `find-all-stress-packages.ps1` + namespace: 'azuresdkforcpp' + +dependencies: +- name: stress-test-addons + version: 0.1.19 + repository: https://stresstestcharts.blob.core.windows.net/helm/ diff --git a/sdk/core/azure-core/test/libcurl-stress-test/Dockerfile b/sdk/core/azure-core/test/libcurl-stress-test/Dockerfile new file mode 100644 index 0000000000..1cdc7c7f49 --- /dev/null +++ b/sdk/core/azure-core/test/libcurl-stress-test/Dockerfile @@ -0,0 +1,16 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + +FROM mcr.microsoft.com/mirror/docker/library/ubuntu:22.04 + +ARG targetTest +ARG build + +# copy the tagrget binary +ADD $targetTest ./$targetTest +RUN chmod +x ./$targetTest + +# install the mem check tool +RUN apt-get update -y +RUN apt-get install valgrind -y + diff --git a/sdk/core/azure-core/test/libcurl-stress-test/README.md b/sdk/core/azure-core/test/libcurl-stress-test/README.md new file mode 100644 index 0000000000..300534d165 --- /dev/null +++ b/sdk/core/azure-core/test/libcurl-stress-test/README.md @@ -0,0 +1,29 @@ +# Stress test prototype +This is work in progress. It's a prototype of how a stress test would look. This PR is to park the work in progress while being dealing with higher priority issues. +## Components +### Code (https://en.wikipedia.org/wiki/C%2B%2B) +The cpp file represents the code for the test, it will generate a number of invalid URLs and then issue CURL send commands. The requests are expected to fail. The point was that it exposes memory leaks in handling the error cases, which we fixed since. + +### Dockerfile (https://www.docker.com/) +Represents the build file for the container in which the test runs, it is based on ubuntu 22.04 , from mcr. +The main change from default ubuntu is making sure we have the valgrind tool installed. Valgrind is a heap monitoring tool that helps identify potential stack traces that might leak memory. While not 100% effective is is great at reducing the surface are for investigations. + +### Helm chart (https://helm.sh/) +Chart.yaml together with the bicep file(https://docs.microsoft.com/azure/azure-resource-manager/bicep/overview?tabs=bicep) and the deploy job file , represent the helm chart needed to deploy to the docker image built from the dockerfile to the stress cluster and execute the stress test. + +The helm chart creates a pod with a container based on the docker image, and executes the test under valgrind. + +To deploy the chart you will need to run "azure-sdk-for-cpp\eng\common\scripts\stress-testing> .\deploy-stress-tests.ps1 -Namespace azuresdkforcpp -SearchDirectory E:\src\azure-sdk-for-cpp\sdk\core\azure-core\test -PushImage" + +Where namaspace will be created if missing , search directory can be any folder where it will search for charts in it and all it's sub dirs, push image will call it to build the docker image. + +ATM the docker image is build by hand and harcoded in the chart to simplify matters. + +To build the image run "docker build -t stresstesttbiruti6oi24k.acr.io/azuresdkforcpp/curlstress:v8 --build-arg targetTest=azure-core-libcurl-stress-test --build-arg build=on ." + +To push to mcr : "docker push stresstesttbiruti6oi24k.acr.io/azuresdkforcpp/curlstress:v8" +Obviously after logging in to the acr "az acr login -n stresspgs7b6dif73rup6.azurecr.io" + +To use another image you will need to go to line 12 in deploy job and update with your new file. + +Once the deploy succeeds run " kubectl logs -n azuresdkforcpp -f libcurl-stress-test" to grab the logs in real time . \ No newline at end of file diff --git a/sdk/core/azure-core/test/libcurl-stress-test/libcurl_stress_test.cpp b/sdk/core/azure-core/test/libcurl-stress-test/libcurl_stress_test.cpp new file mode 100644 index 0000000000..698fc6fd8f --- /dev/null +++ b/sdk/core/azure-core/test/libcurl-stress-test/libcurl_stress_test.cpp @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @brief Validates the Azure Core transport adapters with fault responses from server. + * + * @note This test requires the Http-fault-injector + * (https://github.com/Azure/azure-sdk-tools/tree/main/tools/http-fault-injector) running. Follow + * the instructions to install and run the server before running this test. + * + */ + +#define REQUESTS 100 +#define WARMUP 100 +#define ROUNDS 100 + +#include +#include +#include + +void SendRequest(std::string target) +{ + std::cout << target << std::endl; + // The transport adapter must allow insecure SSL certs. + Azure::Core::Http::CurlTransportOptions curlOptions; + curlOptions.SslVerifyPeer = false; + auto implementationClient = std::make_shared(curlOptions); + + try + { + + Azure::Core::Context context; + auto request + = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(target)); + auto response = implementationClient->Send(request, context); + // Make sure to pull all bytes from network. + auto body = response->ExtractBodyStream()->ReadToEnd(); + } + catch (std::exception const&) + { + // don't print exceptions, they are happening at each request, this is the point of the test + } +} + +void Operation(int repetitions) +{ + std::string base = "https://xyz."; + for (int i = 0; i < repetitions; i++) + { + std::cout << i << std::endl; + SendRequest(base + std::to_string(i) + ".abc"); + } +} + +int main(int argc, char**) +{ + // some param was passed to the program, doesn't matter what it is, + // it is meant for the moment to just run a quick iteration to check for sanity of the test. + // since prototype TODO: pass in warmup/rounds/requests as params. + if (argc != 1) + { + std::cout << "--------------\tBUILD TEST\t--------------" << std::endl; + Operation(5); + std::cout << "--------------\tEND BUILD TEST\t--------------" << std::endl; + return 0; + } + + std::cout << "--------------\tSTARTING TEST\t--------------" << std::endl; + std::cout << "--------------\tPRE WARMUP\t--------------" << std::endl; + Operation(WARMUP); + + std::cout << "--------------\tPOST WARMUP\t--------------" << std::endl; + + for (int i = 0; i < ROUNDS; i++) + { + std::cout << "--------------\tTEST ITERATION:" << i << "\t--------------" << std::endl; + Operation(REQUESTS); + + std::cout << "--------------\tDONE ITERATION:" << i << "\t--------------" << std::endl; + } + + return 0; +} diff --git a/sdk/core/azure-core/test/libcurl-stress-test/stress-test-resources.bicep b/sdk/core/azure-core/test/libcurl-stress-test/stress-test-resources.bicep new file mode 100644 index 0000000000..d008b28bfd --- /dev/null +++ b/sdk/core/azure-core/test/libcurl-stress-test/stress-test-resources.bicep @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT +// +// Dummy parameter to handle defaults the script passes in +param testApplicationOid string = '' + +resource config 'Microsoft.AppConfiguration/configurationStores@2020-07-01-preview' = { + name: 'config-${resourceGroup().name}' + location: resourceGroup().location + sku: { + name: 'Standard' + } +} + +output RESOURCE_GROUP string = resourceGroup().name +output AZURE_CLIENT_OID string = testApplicationOid diff --git a/sdk/core/azure-core/test/libcurl-stress-test/templates/deploy-job.yaml b/sdk/core/azure-core/test/libcurl-stress-test/templates/deploy-job.yaml new file mode 100644 index 0000000000..17c13ebee5 --- /dev/null +++ b/sdk/core/azure-core/test/libcurl-stress-test/templates/deploy-job.yaml @@ -0,0 +1,22 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT +{{- include "stress-test-addons.deploy-job-template.from-pod" (list . "stress.deploy-example") -}} +{{- define "stress.deploy-example" -}} +metadata: + labels: + testName: "libcurl-stress-test" + name: "libcurl-stress-test" +spec: + containers: + - name: libcurl-stress-test + image: stresspgs7b6dif73rup6.azurecr.io/azuresdkforcpp/curlstress:latest + imagePullPolicy: Always + command: + [ + "valgrind", + "--tool=memcheck", + "-s", + "./azure-core-libcurl-stress-test", + ] + {{- include "stress-test-addons.container-env" . | nindent 6 }} +{{- end -}} diff --git a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md index a3ad0491f7..63171c8ca4 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.1.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.1.0-beta.1 (2022-07-07) ### Features Added diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/private/package_version.hpp b/sdk/keyvault/azure-security-keyvault-certificates/src/private/package_version.hpp index ee2c3e9f99..55e836f964 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/src/private/package_version.hpp +++ b/sdk/keyvault/azure-security-keyvault-certificates/src/private/package_version.hpp @@ -13,7 +13,7 @@ #define AZURE_SECURITY_KEYVAULT_CERTIFICATES_VERSION_MAJOR 4 #define AZURE_SECURITY_KEYVAULT_CERTIFICATES_VERSION_MINOR 1 #define AZURE_SECURITY_KEYVAULT_CERTIFICATES_VERSION_PATCH 0 -#define AZURE_SECURITY_KEYVAULT_CERTIFICATES_VERSION_PRERELEASE "beta.1" +#define AZURE_SECURITY_KEYVAULT_CERTIFICATES_VERSION_PRERELEASE "beta.2" #define AZURE_SECURITY_KEYVAULT_CERTIFICATES_VERSION_ITOA_HELPER(i) #i #define AZURE_SECURITY_KEYVAULT_CERTIFICATES_VERSION_ITOA(i) \ diff --git a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md index 0bf3216cbe..5bc04107a4 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.3.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.3.0-beta.1 (2022-07-07) ### Features Added diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/private/package_version.hpp b/sdk/keyvault/azure-security-keyvault-keys/src/private/package_version.hpp index 53d984b152..a79e5bbb04 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/private/package_version.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/src/private/package_version.hpp @@ -13,7 +13,7 @@ #define AZURE_SECURITY_KEYVAULT_KEYS_VERSION_MAJOR 4 #define AZURE_SECURITY_KEYVAULT_KEYS_VERSION_MINOR 3 #define AZURE_SECURITY_KEYVAULT_KEYS_VERSION_PATCH 0 -#define AZURE_SECURITY_KEYVAULT_KEYS_VERSION_PRERELEASE "beta.1" +#define AZURE_SECURITY_KEYVAULT_KEYS_VERSION_PRERELEASE "beta.2" #define AZURE_SECURITY_KEYVAULT_KEYS_VERSION_ITOA_HELPER(i) #i #define AZURE_SECURITY_KEYVAULT_KEYS_VERSION_ITOA(i) \ diff --git a/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md index e848b7c34a..a8d5bab494 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.1.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.1.0-beta.1 (2022-07-07) ### Features Added diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/private/package_version.hpp b/sdk/keyvault/azure-security-keyvault-secrets/src/private/package_version.hpp index 7b5d417fbd..23e0cc9253 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/private/package_version.hpp +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/private/package_version.hpp @@ -13,7 +13,7 @@ #define AZURE_SECURITY_KEYVAULT_SECRETS_VERSION_MAJOR 4 #define AZURE_SECURITY_KEYVAULT_SECRETS_VERSION_MINOR 1 #define AZURE_SECURITY_KEYVAULT_SECRETS_VERSION_PATCH 0 -#define AZURE_SECURITY_KEYVAULT_SECRETS_VERSION_PRERELEASE "beta.1" +#define AZURE_SECURITY_KEYVAULT_SECRETS_VERSION_PRERELEASE "beta.2" #define AZURE_SECURITY_KEYVAULT_SECRETS_VERSION_ITOA_HELPER(i) #i #define AZURE_SECURITY_KEYVAULT_SECRETS_VERSION_ITOA(i) \ From b12942e115be33dc0dbfc3f7f1a08cf706b478ca Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 19 Aug 2022 15:42:47 -0700 Subject: [PATCH 03/75] Add support for Proxy Server to WinHTTP and CURL transports. (#3885) # Add Support for Proxy Server to WinHTTP and CURL transports. This PR adds support for proxy servers (with optional basic authentication) to the HTTP transports supported by C++. * Use a singleton for WinHTTP transport to enable connection pooling across multiple service clients (support modeled after .Net equivalent functionality). * Fixed retry delay to match azure guidelines; documented test hook in CalculateExponentialDelay. Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com> Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Ben Broderick Phillips Co-authored-by: Ben Broderick Phillips Co-authored-by: Rick Winter --- .vscode/cspell.json | 18 +- sdk/core/azure-core/CHANGELOG.md | 3 + sdk/core/azure-core/inc/azure/core/base64.hpp | 25 + .../inc/azure/core/http/curl_transport.hpp | 27 + .../inc/azure/core/http/policies/policy.hpp | 34 +- .../azure/core/http/win_http_transport.hpp | 38 +- sdk/core/azure-core/src/base64.cpp | 7 + sdk/core/azure-core/src/http/curl/curl.cpp | 264 +- .../curl/curl_connection_pool_private.hpp | 12 +- .../src/http/curl/curl_session_private.hpp | 19 +- sdk/core/azure-core/src/http/retry_policy.cpp | 12 + .../azure-core/src/http/transport_policy.cpp | 100 +- .../src/http/winhttp/win_http_transport.cpp | 37 +- sdk/core/azure-core/test/ut/CMakeLists.txt | 6 + .../test/ut/azure_libcurl_core_main_test.cpp | 4 +- sdk/core/azure-core/test/ut/base64_test.cpp | 13 + .../test/ut/curl_connection_pool_test.cpp | 84 +- .../test/ut/curl_session_test_test.cpp | 33 +- .../test/ut/proxy_tests/builddocker.ps1 | 16 + .../proxy_tests/localproxy.passwd/Dockerfile | 30 + .../proxy_tests/localproxy.passwd/proxypasswd | 1 + .../proxy_tests/localproxy.passwd/squid.conf | 7991 ++++++++++++++++ .../test/ut/proxy_tests/localproxy/Dockerfile | 29 + .../test/ut/proxy_tests/localproxy/squid.conf | 7991 ++++++++++++++++ .../azure-core/test/ut/proxy_tests/readme.md | 593 ++ .../proxy_tests/remoteproxy.passwd/Dockerfile | 30 + .../remoteproxy.passwd/proxypasswd | 1 + .../proxy_tests/remoteproxy.passwd/squid.conf | 7999 ++++++++++++++++ .../ut/proxy_tests/remoteproxy/Dockerfile | 29 + .../ut/proxy_tests/remoteproxy/squid.conf | 8001 +++++++++++++++++ .../test/ut/proxy_tests/runproxy.ps1 | 2 + .../test/ut/proxy_tests/verify_proxy.ps1 | 48 + .../test/ut/transport_policy_options.cpp | 411 + .../azure-core/test/ut/websocket_test.cpp | 26 +- sdk/core/ci.yml | 16 + sdk/core/test-resources.bicep | 116 + 36 files changed, 33942 insertions(+), 124 deletions(-) create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/proxypasswd create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/localproxy/squid.conf create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/readme.md create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/proxypasswd create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/squid.conf create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/squid.conf create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 create mode 100644 sdk/core/azure-core/test/ut/transport_policy_options.cpp create mode 100644 sdk/core/test-resources.bicep diff --git a/.vscode/cspell.json b/.vscode/cspell.json index efe3977771..f0d6ff71a7 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -11,11 +11,13 @@ "*.exe", "*.a", "*.lib", - "*.yaml", - "**/libcurl-stress-test/README.md", + "*.yaml", + "**/libcurl-stress-test/README.md", ".github/CODEOWNERS", ".gitignore", ".vscode/cspell.json", + "ci.yml", + "squid.conf*", "eng/common/**/*", "json.hpp", "Dockerfile", @@ -34,6 +36,8 @@ "Aloctl", "azcore", "azsdk", + "azsdkengsys", + "azurecr", "azuresdk", "azuresdkforcpp", "centralus", @@ -80,20 +84,21 @@ "Lohmann", "LPBYTE", "LPSTR", + "LPWSTR", "MHSM", "moxygen", "MSRC", "ncus", "Niels", "nlohmann", - "nohup", - "nostd", "noclean", "NOCLOSE", "NOCRLF", + "nohup", "NOLINT", "NOMINMAX", "northcentralus", + "nostd", "NTSTATUS", "okhttp", "opentelemetry", @@ -101,6 +106,7 @@ "PBYTE", "pdbs", "Piotrowski", + "pscredential", "PUCHAR", "PVOID", "pwsh", @@ -123,22 +129,22 @@ "stoll", "stoull", "STREQ", + "uaenorth", "uksouth", "undeleted", "unscoped", "unskipped", "UPNs", - "uaenorth", "usgov", "usgoviowa", "usgovvirginia", - "westcentralus", "vcpkg", "Viet", "Viktor", "vusg", "Wdocumentation", "Werror", + "westcentralus", "westus", "Wextra", "Wgnu", diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index c5f96f2554..a22b3ae927 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -4,6 +4,9 @@ ### Features Added +- Added support for the `WebSockets` protocol via the `Azure::Core::Http::WebSockets::WebSocket` class. +- Added support for HTTP proxy servers, both unauthenticated and with Plain authentication. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/core/azure-core/inc/azure/core/base64.hpp b/sdk/core/azure-core/inc/azure/core/base64.hpp index cb5daadcf5..b5262e7a94 100644 --- a/sdk/core/azure-core/inc/azure/core/base64.hpp +++ b/sdk/core/azure-core/inc/azure/core/base64.hpp @@ -51,6 +51,31 @@ namespace Azure { namespace Core { }; namespace _internal { + /** + * @brief Used to convert one form of data into another, for example encoding binary data into + * 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: + // This type currently only contains static methods and hence disallowing instance creation. + /** + * @brief An instance of `%Convert` class cannot be created. + * + */ + Convert() = default; + + public: + /** + * @brief Encodes a string using Base64 encoding. + * + * @param data The input string that contains data to be encoded. + * @return The Base64 encoded contents of the vector. + */ + static std::string Base64Encode(const std::string& data); + }; /** * @brief Provides conversion methods for Base64URL. diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index 398708399e..5a8a6d91c0 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -63,6 +63,28 @@ namespace Azure { namespace Core { namespace Http { * */ Azure::Nullable Proxy; + + /** + * @brief Username to be used for proxy connections. + * + * @remark No validation for the string is done by the Azure SDK. More about this option: + * https://curl.haxx.se/libcurl/c/CURLOPT_PROXY_USERNAME.html. + * + * @remark The default value is an empty string (no proxy). + * + */ + std::string ProxyUsername; + + /** + * @brief Password to be used for proxy connections. + * + * @remark No validation for the string is done by the Azure SDK. More about this option: + * https://curl.haxx.se/libcurl/c/CURLOPT_PROXY_PASSWORD.html. + * + * @remark The default value is an empty string (no proxy). + * + */ + std::string ProxyPassword; /** * @brief The string for the certificate authenticator is sent to libcurl handle directly. * @@ -122,6 +144,11 @@ namespace Azure { namespace Core { namespace Http { * */ std::chrono::milliseconds ConnectionTimeout = _detail::DefaultConnectionTimeout; + + /** + * @brief If set, enables extended tracing from LibCURL. + */ + bool EnableCurlTracing = false; }; /** diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 5dcb103e77..645c387108 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -40,8 +40,10 @@ extern std::shared_ptr AzureSdkGetCustomHttpTr namespace Azure { namespace Core { namespace Http { namespace Policies { + struct TransportOptions; namespace _detail { - std::shared_ptr GetTransportAdapter(); + std::shared_ptr GetTransportAdapter(TransportOptions const& transportOptions); + AZ_CORE_DLLEXPORT extern std::set const g_defaultAllowedHttpQueryParameters; AZ_CORE_DLLEXPORT extern CaseInsensitiveSet const g_defaultAllowedHttpHeaders; } // namespace _detail @@ -88,7 +90,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * @note See https://en.cppreference.com/w/cpp/chrono/duration. * */ - std::chrono::milliseconds RetryDelay = std::chrono::seconds(4); + std::chrono::milliseconds RetryDelay = std::chrono::milliseconds(800); /** * @brief The maximum permissible delay between retry attempts. @@ -135,6 +137,27 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { */ struct TransportOptions final { +#if !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) +#if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) || defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) + /** + * @brief Http Proxies used when making an HTTP connection. + * + * @remark The URL for the proxy server to use for this connection. + */ + Azure::Nullable HttpProxy; + + /** + * @brief The username to use when authenticating with the proxy server. + */ + std::string ProxyUserName; + + /** + * @brief The password to use when authenticating with the proxy server. + */ + std::string ProxyPassword; +#endif // defined(CURL_ADAPTER) || defined(WINHTTP_ADAPTER) +#endif // !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) + /** * @brief #Azure::Core::Http::HttpTransport that the transport policy will use to send and * receive requests and responses over the wire. @@ -149,7 +172,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * `::AzureSdkGetCustomHttpTransport()` must be linked in the end-user application. * */ - std::shared_ptr Transport = _detail::GetTransportAdapter(); + std::shared_ptr Transport; }; class NextHttpPolicy; @@ -278,10 +301,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * * @param options #Azure::Core::Http::Policies::TransportOptions. */ - explicit TransportPolicy(TransportOptions options = TransportOptions()) - : m_options(std::move(options)) - { - } + explicit TransportPolicy(TransportOptions const& options = TransportOptions()); std::unique_ptr Clone() const override { diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 459c400db3..7547f05be2 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -105,7 +105,43 @@ namespace Azure { namespace Core { namespace Http { /** * @brief When `true`, allows an invalid certificate authority. */ - bool IgnoreUnknownCertificateAuthority = false; + bool IgnoreUnknownCertificateAuthority{false}; + + /** + * Proxy information. + */ + + /** + * @brief If True, enables the use of the system default proxy. + * + * @remarks Set this to "true" if you would like to use a local HTTP proxy like "Fiddler" to + * capture and analyze HTTP traffic. + * + * Set to "false" by default because it is not recommended to use a proxy for production and + * Fiddler's proxy interferes with the HTTP functional tests. + */ + bool EnableSystemDefaultProxy{false}; + + /** + * @brief Proxy information. + * + * @remark The Proxy Information string is composed of a set of elements + * formatted as follows: + * ([=]["://"][":"]) + * + * Each element should be separated with semicolons or whitespace. + */ + std::string ProxyInformation; + + /** + * @brief User name for proxy authentication. + */ + std::string ProxyUserName; + + /** + * @brief Password for proxy authentication. + */ + std::string ProxyPassword; }; /** diff --git a/sdk/core/azure-core/src/base64.cpp b/sdk/core/azure-core/src/base64.cpp index a2e214c5bc..ab485cc8d3 100644 --- a/sdk/core/azure-core/src/base64.cpp +++ b/sdk/core/azure-core/src/base64.cpp @@ -497,5 +497,12 @@ namespace Azure { namespace Core { { return ::Base64Decode(text); } + namespace _internal { + + std::string Convert::Base64Encode(const std::string& data) + { + return ::Base64Encode(reinterpret_cast(data.data()), data.size()); + } + } // namespace _internal }} // namespace Azure::Core diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index ea65dbd39a..417b9d891c 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT +#include "azure/core/base64.hpp" #include "azure/core/http/curl_transport.hpp" #include "azure/core/http/http.hpp" #include "azure/core/http/policies/policy.hpp" @@ -27,6 +28,8 @@ #endif #include +#include +#include #include #include @@ -129,8 +132,8 @@ using Azure::Core::Diagnostics::_internal::Log; // https://github.com/Azure/azure-sdk-for-cpp/issues/644 void WinSocketSetBuffSize(curl_socket_t socket) { - ULONG ideal; - DWORD ideallen; + ULONG ideal{}; + DWORD ideallen{}; // WSAloctl would get the ideal size for the socket buffer. if (WSAIoctl(socket, SIO_IDEAL_SEND_BACKLOG_QUERY, 0, 0, &ideal, sizeof(ideal), &ideallen, 0, 0) == 0) @@ -143,45 +146,6 @@ void WinSocketSetBuffSize(curl_socket_t socket) } #endif -void static inline SetHeader(Azure::Core::Http::RawResponse& response, std::string const& header) -{ - return Azure::Core::Http::_detail::RawResponseHelpers::SetHeader( - response, - reinterpret_cast(header.data()), - reinterpret_cast(header.data() + header.size())); -} - -static inline std::string GetHeadersAsString(Azure::Core::Http::Request const& request) -{ - std::string requestHeaderString; - - for (auto const& header : request.GetHeaders()) - { - requestHeaderString += header.first; // string (key) - requestHeaderString += ": "; - requestHeaderString += header.second; // string's value - requestHeaderString += "\r\n"; - } - requestHeaderString += "\r\n"; - - return requestHeaderString; -} - -// Writes an HTTP request with RFC 7230 without the body (head line and headers) -// https://tools.ietf.org/html/rfc7230#section-3.1.1 -static inline std::string GetHTTPMessagePreBody(Azure::Core::Http::Request const& request) -{ - std::string httpRequest(request.GetMethod().ToString()); - // HTTP version hardcoded to 1.1 - auto const url = request.GetUrl().GetRelativeUrl(); - httpRequest += " /" + url + " HTTP/1.1\r\n"; - - // headers - httpRequest += GetHeadersAsString(request); - - return httpRequest; -} - static void CleanupThread() { // NOTE: Avoid using Log::Write in here as it may fail on macOS, @@ -281,7 +245,7 @@ std::unique_ptr CurlTransport::Send(Request& request, Context const auto session = std::make_unique( request, CurlConnectionPool::g_curlConnectionPool.ExtractOrCreateCurlConnection(request, m_options), - m_options.HttpKeepAlive); + m_options); CURLcode performing; @@ -309,12 +273,12 @@ std::unique_ptr CurlTransport::Send(Request& request, Context const request, m_options, getConnectionOpenIntent + 1 >= _detail::RequestPoolResetAfterConnectionFailed), - m_options.HttpKeepAlive); + m_options); } if (performing != CURLE_OK) { - throw Azure::Core::Http::TransportException( + throw TransportException( "Error while sending request. " + std::string(curl_easy_strerror(performing))); } if (HasWebSocketSupport()) @@ -359,6 +323,18 @@ CURLcode CurlSession::Perform(Context const& context) "content-length", std::to_string(this->m_request.GetBodyStream()->Length())); } } + // If we are using an HTTP proxy, connecting to an HTTP resource and it has been configured with a + // username and password, we want to set the proxy authentication header. + if (m_httpProxy.HasValue() && m_request.GetUrl().GetScheme() == "http" && !m_httpProxyUser.empty() + && !m_httpProxyPassword.empty()) + { + Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Setting proxy authentication header"); + this->m_request.SetHeader( + "Proxy-Authorization", + "Basic " + + Azure::Core::_internal::Convert::Base64Encode( + m_httpProxyUser + ":" + m_httpProxyPassword)); + } // use expect:100 for PUT requests. Server will decide if it can take our request if (this->m_request.GetMethod() == HttpMethod::Put) @@ -587,6 +563,59 @@ CURLcode CurlSession::SendRawHttp(Context const& context) return this->UploadBody(context); } +void inline CurlSession::SetHeader( + Azure::Core::Http::RawResponse& response, + std::string const& header) +{ + return Azure::Core::Http::_detail::RawResponseHelpers::SetHeader( + response, + reinterpret_cast(header.data()), + reinterpret_cast(header.data() + header.size())); +} + +inline std::string CurlSession::GetHeadersAsString(Azure::Core::Http::Request const& request) +{ + std::string requestHeaderString; + + for (auto const& header : request.GetHeaders()) + { + requestHeaderString += header.first; // string (key) + requestHeaderString += ": "; + requestHeaderString += header.second; // string's value + requestHeaderString += "\r\n"; + } + requestHeaderString += "\r\n"; + + return requestHeaderString; +} + +// Writes an HTTP request with RFC 7230 without the body (head line and headers) +// https://tools.ietf.org/html/rfc7230#section-3.1.1 +inline std::string CurlSession::GetHTTPMessagePreBody(Azure::Core::Http::Request const& request) +{ + std::string httpRequest(request.GetMethod().ToString()); + std::string url; + + // If we're not using a proxy server, *or* the URL we're connecting uses HTTPS then + // we want to send the relative URL (the URL without the host, scheme, port or authn). + // if we ARE using a proxy server and the request is not encrypted, we want to send the full URL. + if (!m_httpProxy.HasValue() || request.GetUrl().GetScheme() == "https") + { + url = "/" + request.GetUrl().GetRelativeUrl(); + } + else + { + url = request.GetUrl().GetAbsoluteUrl(); + } + // HTTP version hardcoded to 1.1 + httpRequest += " " + url + " HTTP/1.1\r\n"; + + // headers + httpRequest += GetHeadersAsString(request); + + return httpRequest; +} + void CurlSession::ParseChunkSize(Context const& context) { // Use this string to construct the chunk size. This is because we could have an internal @@ -1252,14 +1281,28 @@ size_t CurlSession::ResponseBufferParser::BuildHeader( } namespace { +// Calculate the connection key. +// The connection key is a tuple of host, proxy info, TLS info, etc. Basically any characteristics +// of the connection that should indicate that the connection shouldn't be re-used should be listed +// the connection key. inline std::string GetConnectionKey(std::string const& host, CurlTransportOptions const& options) { std::string key(host); + key.append(","); key.append(!options.CAInfo.empty() ? options.CAInfo : "0"); + key.append(","); key.append(options.Proxy ? (options.Proxy->empty() ? "NoProxy" : options.Proxy.Value()) : "0"); + key.append(","); + key.append(options.ProxyUsername.empty() ? "0" : options.ProxyUsername); + key.append(","); + key.append(options.ProxyPassword.empty() ? "0" : options.ProxyPassword); + key.append(","); key.append(!options.SslOptions.EnableCertificateRevocationListCheck ? "1" : "0"); + key.append(","); key.append(options.SslVerifyPeer ? "1" : "0"); + key.append(","); key.append(options.NoSignal ? "1" : "0"); + key.append(","); // using DefaultConnectionTimeout or 0 result in the same setting key.append( (options.ConnectionTimeout == Azure::Core::Http::_detail::DefaultConnectionTimeout @@ -1269,8 +1312,100 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption return key; } + +void DumpCurlInfoToLog(std::string const& text, uint8_t* ptr, size_t size) +{ + + size_t width = 0x10; + + std::stringstream ss; + ss << text << ", " << std::dec << std::setw(10) << std::setfill('0') << size << " bytes: (0x" + << std::setw(8) << std::hex << size << ")"; + + Log::Write(Logger::Level::Verbose, ss.str()); + + for (size_t i = 0; i < size; i += width) + { + ss = std::stringstream(); + ss << std::hex << std::setw(4) << i << ": "; + + /* hex not disabled, show it */ + for (size_t c = 0; c < width; c++) + { + if (i + c < size) + ss << std::hex << std::setw(2) << std::setfill('0') << static_cast(ptr[i + c]) << " "; + else + ss << " "; + } + for (size_t c = 0; (c < width) && (i + c < size); c++) + { + // Log the contents of the buffer as text, if it's printable, print the character, otherwise + // print '.' + if (isprint(ptr[i + c])) + { + ss << ptr[i + c]; + } + else + { + ss << "."; + } + } + + Log::Write(Logger::Level::Verbose, ss.str()); + } +} + } // namespace +int CurlConnectionPool::CurlLoggingCallback( + CURL*, + curl_infotype type, + char* data, + size_t size, + void*) +{ + if (type == CURLINFO_TEXT) + { + std::string textToLog{data}; + // If the last character to log is a \n, remove it because Log::Write will append a \n. + if (textToLog.back() == '\n') + { + textToLog.resize(textToLog.size() - 1); + } + Log::Write(Logger::Level::Verbose, "== Info: " + textToLog); + } + else + { + std::string prefix; + + switch (type) + { + case CURLINFO_HEADER_OUT: + prefix = "=> Send header"; + break; + case CURLINFO_DATA_OUT: + prefix = "=> Send data"; + break; + case CURLINFO_SSL_DATA_OUT: + prefix = "=> Send SSL data"; + break; + case CURLINFO_HEADER_IN: + prefix = "<= Recv header"; + break; + case CURLINFO_DATA_IN: + prefix = "<= Recv data"; + break; + case CURLINFO_SSL_DATA_IN: + prefix = "<= Recv SSL data"; + break; + default: /* in case a new one is introduced to shock us */ + return 0; + } + DumpCurlInfoToLog(prefix, reinterpret_cast(data), size); + } + return 0; +} + std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlConnection( Request& request, CurlTransportOptions const& options, @@ -1339,6 +1474,26 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo } CURLcode result; + if (options.EnableCurlTracing) + { + + if (!SetLibcurlOption( + newHandle, CURLOPT_DEBUGFUNCTION, CurlConnectionPool::CurlLoggingCallback, &result)) + { + throw TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + + std::string(". Could not enable logging callback.") + + std::string(curl_easy_strerror(result))); + } + if (!SetLibcurlOption(newHandle, CURLOPT_VERBOSE, 1, &result)) + { + throw TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + + std::string(". Could not enable verbose logging.") + + std::string(curl_easy_strerror(result))); + } + } + // Libcurl setup before open connection (url, connect_only, timeout) if (!SetLibcurlOption(newHandle, CURLOPT_URL, request.GetUrl().GetAbsoluteUrl().data(), &result)) { @@ -1397,6 +1552,27 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo } } + if (!options.ProxyUsername.empty()) + { + if (!SetLibcurlOption(newHandle, CURLOPT_PROXYUSERNAME, options.ProxyUsername.c_str(), &result)) + { + throw TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + + ". Failed to set proxy username to:" + options.ProxyUsername + ". " + + std::string(curl_easy_strerror(result))); + } + } + if (!options.ProxyPassword.empty()) + { + if (!SetLibcurlOption(newHandle, CURLOPT_PROXYPASSWORD, options.ProxyPassword.c_str(), &result)) + { + throw TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + + ". Failed to set proxy password to:" + options.ProxyPassword + ". " + + std::string(curl_easy_strerror(result))); + } + } + if (!options.CAInfo.empty()) { if (!SetLibcurlOption(newHandle, CURLOPT_CAINFO, options.CAInfo.c_str(), &result)) diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp index fdf1334360..605136c875 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp @@ -18,10 +18,10 @@ #include #include #include -#include #include #include #include +#include #if defined(TESTING_BUILD) // Define the class name that reads from ConnectionPool private members @@ -103,7 +103,8 @@ namespace Azure { namespace Core { namespace Http { namespace _detail { * * @remark There might be multiple connections for each host. */ - std::map>> ConnectionPoolIndex; + std::unordered_map>> + ConnectionPoolIndex; std::mutex ConnectionPoolMutex; @@ -119,6 +120,13 @@ namespace Azure { namespace Core { namespace Http { namespace _detail { // private constructor to keep this as singleton. CurlConnectionPool() { curl_global_init(CURL_GLOBAL_ALL); } + static int CurlLoggingCallback( + CURL* handle, + curl_infotype type, + char* data, + size_t size, + void* userp); + // Makes possible to know the number of current connections in the connection pool for an // index size_t ConnectionsOnPool(std::string const& host) { return ConnectionPoolIndex[host].size(); } diff --git a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp index be77f85fbe..fb805080fb 100644 --- a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp @@ -364,6 +364,10 @@ namespace Azure { namespace Core { namespace Http { */ bool m_keepAlive = true; + Azure::Nullable m_httpProxy; + std::string m_httpProxyUser; + std::string m_httpProxyPassword; + /** * @brief Implement #Azure::Core::IO::BodyStream::OnRead(). Calling this function pulls data * from the wire. @@ -375,14 +379,25 @@ namespace Azure { namespace Core { namespace Http { */ size_t OnRead(uint8_t* buffer, size_t count, Azure::Core::Context const& context) override; + inline std::string GetHTTPMessagePreBody(Azure::Core::Http::Request const& request); + inline std::string GetHeadersAsString(Azure::Core::Http::Request const& request); + inline static void SetHeader( + Azure::Core::Http::RawResponse& response, + std::string const& header); + public: /** * @brief Construct a new Curl Session object. Init internal libcurl handler. * * @param request reference to an HTTP Request. */ - CurlSession(Request& request, std::unique_ptr connection, bool keepAlive) - : m_connection(std::move(connection)), m_request(request), m_keepAlive(keepAlive) + CurlSession( + Request& request, + std::unique_ptr connection, + CurlTransportOptions curlOptions) + : m_connection(std::move(connection)), m_request(request), + m_keepAlive(curlOptions.HttpKeepAlive), m_httpProxy(curlOptions.Proxy), + m_httpProxyUser(curlOptions.ProxyUsername), m_httpProxyPassword(curlOptions.ProxyPassword) { } diff --git a/sdk/core/azure-core/src/http/retry_policy.cpp b/sdk/core/azure-core/src/http/retry_policy.cpp index 99d8f409d1..84b037e66c 100644 --- a/sdk/core/azure-core/src/http/retry_policy.cpp +++ b/sdk/core/azure-core/src/http/retry_policy.cpp @@ -53,6 +53,18 @@ bool GetResponseHeaderBasedDelay(RawResponse const& response, std::chrono::milli return false; } +/** + * @brief Calculate the exponential delay needed for this retry. + * + * @param retryOptions Options controlling the delay algorithm. + * @param attempt Which attempt is this? + * @param jitterFactor Test hook removing the randomness from the delay algorithm. + * + * @returns Number of milliseconds to delay. + * + * @remarks This function calculates the exponential backoff needed for each retry, including a + * jitter factor. + */ std::chrono::milliseconds CalculateExponentialDelay( RetryOptions const& retryOptions, int32_t attempt, diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index 596784ca0c..6f73124f49 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -17,27 +17,107 @@ using namespace Azure::Core::Http; using namespace Azure::Core::Http::Policies; using namespace Azure::Core::Http::Policies::_internal; -std::shared_ptr Azure::Core::Http::Policies::_detail::GetTransportAdapter() -{ - // The order of these checks is important so that WinHTTP is picked over libcurl on Windows, when - // both are defined. +namespace Azure { namespace Core { namespace Http { namespace Policies { namespace _detail { + namespace { + bool AnyTransportOptionsSpecified(TransportOptions const& transportOptions) + { + return !( + !transportOptions.HttpProxy.HasValue() && transportOptions.ProxyPassword.empty() + && transportOptions.ProxyUserName.empty()); + } + // std::once_flag createTransportOnce; + // std::shared_ptr defaultTransport; + } // namespace + + std::shared_ptr GetTransportAdapter(TransportOptions const& transportOptions) + { + // The order of these checks is important so that WinHTTP is picked over libcurl on + // Windows, when both are defined. #if defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) - return ::AzureSdkGetCustomHttpTransport(); + return ::AzureSdkGetCustomHttpTransport(); #elif defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) - return std::make_shared(); + // Since C++11: If multiple threads attempt to initialize the same static local variable + // concurrently, the initialization occurs exactly once. We depend on this behavior to ensure + // that the singleton defaultTransport is correctly initialized. + static std::shared_ptr defaultTransport(std::make_shared()); + if (AnyTransportOptionsSpecified(transportOptions)) + { + WinHttpTransportOptions httpOptions; + if (transportOptions.HttpProxy.HasValue()) + { + // WinHTTP proxy strings are semicolon separated elements, each of which + // has the following format: + // ([=]["://"][":"]) + std::string proxyString; + proxyString = "http=" + transportOptions.HttpProxy.Value(); + proxyString += ";"; + proxyString += "https=" + transportOptions.HttpProxy.Value(); + httpOptions.ProxyInformation = proxyString; + } + httpOptions.ProxyUserName = transportOptions.ProxyUserName; + httpOptions.ProxyPassword = transportOptions.ProxyPassword; + return std::make_shared(httpOptions); + } + else + { + // std::call_once(createTransportOnce, []() { + // defaultTransport = std::make_shared(); + // }); + return defaultTransport; + } #elif defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) - return std::make_shared(); + static std::shared_ptr defaultTransport(std::make_shared()); + if (AnyTransportOptionsSpecified(transportOptions)) + { + CurlTransportOptions curlOptions; + curlOptions.EnableCurlTracing = true; + if (transportOptions.HttpProxy.HasValue()) + { + curlOptions.Proxy = transportOptions.HttpProxy; + } + if (!transportOptions.ProxyUserName.empty()) + { + curlOptions.ProxyUsername = transportOptions.ProxyUserName; + } + if (!transportOptions.ProxyPassword.empty()) + { + curlOptions.ProxyPassword = transportOptions.ProxyPassword; + } + return std::make_shared(curlOptions); + } + return defaultTransport; #else - return std::shared_ptr(); + return std::shared_ptr(); #endif + } +}}}}} // namespace Azure::Core::Http::Policies::_detail + +TransportPolicy::TransportPolicy(TransportOptions const& options) : m_options(options) +{ + // If there's no transport specified, then we need to create one. + // If there is one specified, it's an error to specify other options. + if (m_options.Transport) + { +#if !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) + if (_detail::AnyTransportOptionsSpecified(options)) + { + AZURE_ASSERT_MSG( + false, "Invalid parameter: Proxies cannot be specified when a transport is specified."); + } +#endif + } + else + { + // Configure a transport adapter based on the options and compiler switches. + m_options.Transport = _detail::GetTransportAdapter(m_options); + } } std::unique_ptr TransportPolicy::Send( Request& request, - NextHttpPolicy nextPolicy, + NextHttpPolicy, Context const& context) const { - (void)nextPolicy; context.ThrowIfCancelled(); /* diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index 9131eb98df..3461e12485 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -234,7 +234,9 @@ _detail::unique_HINTERNET WinHttpTransport::CreateSessionHandle() WinHttpOpen( NULL, // Do not use a fallback user-agent string, and only rely on the header within the // request itself. - WINHTTP_ACCESS_TYPE_NO_PROXY, + // If the customer asks for it, enable use of the system default HTTP proxy. + (m_options.EnableSystemDefaultProxy ? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY + : WINHTTP_ACCESS_TYPE_NO_PROXY), WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0), @@ -368,6 +370,32 @@ _detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( } } + if (!m_options.ProxyInformation.empty()) + { + WINHTTP_PROXY_INFO proxyInfo{}; + std::wstring proxyWide{StringToWideString(m_options.ProxyInformation)}; + proxyInfo.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; + proxyInfo.lpszProxy = const_cast(proxyWide.c_str()); + proxyInfo.lpszProxyBypass = WINHTTP_NO_PROXY_BYPASS; + if (!WinHttpSetOption(request.get(), WINHTTP_OPTION_PROXY, &proxyInfo, sizeof(proxyInfo))) + { + GetErrorAndThrow("Error while setting Proxy information."); + } + } + if (!m_options.ProxyUserName.empty() || !m_options.ProxyPassword.empty()) + { + if (!WinHttpSetCredentials( + request.get(), + WINHTTP_AUTH_TARGET_PROXY, + WINHTTP_AUTH_SCHEME_BASIC, + StringToWideString(m_options.ProxyUserName).c_str(), + StringToWideString(m_options.ProxyPassword).c_str(), + 0)) + { + GetErrorAndThrow("Error while setting Proxy credentials."); + } + } + if (m_options.IgnoreUnknownCertificateAuthority) { auto option = SECURITY_FLAG_IGNORE_UNKNOWN_CA; @@ -379,8 +407,12 @@ _detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( // If we are supporting WebSockets, then let WinHTTP know that it should // prepare to upgrade the HttpRequest to a WebSocket. +#pragma warning(push) +// warning C6387: _Param_(3) could be '0'. +#pragma warning(disable : 6387) if (HasWebSocketSupport() && !WinHttpSetOption(request.get(), WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, nullptr, 0)) +#pragma warning(pop) { GetErrorAndThrow("Error while Enabling WebSocket upgrade."); } @@ -578,8 +610,7 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( DWORD error = GetLastError(); if (error != ERROR_INSUFFICIENT_BUFFER) { - throw Azure::Core::Http::TransportException( - "Error while querying response headers. Error Code: " + std::to_string(error) + "."); + GetErrorAndThrow("Error while querying response headers.", error); } } diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index ac0023446b..917615e2d2 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -78,6 +78,7 @@ add_executable ( transport_adapter_base_test.cpp transport_adapter_base_test.hpp transport_adapter_implementation_test.cpp + transport_policy_options.cpp url_test.cpp uuid_test.cpp websocket_test.cpp @@ -99,6 +100,11 @@ if (MSVC) target_compile_options(azure-core-test PUBLIC /wd26495 /wd26812 /wd6326 /wd28204 /wd28020 /wd6330 /wd4389) endif() +if (BUILD_CODE_COVERAGE) +message(STATUS "Building for Code Coverage." ) +add_compile_definitions(CODE_COVERAGE) +endif() + # Additional test files to be copied to the output directory. set(TEST_ADDITIONAL_FILES ${CMAKE_CURRENT_LIST_DIR}/websocket_server.py ${CMAKE_CURRENT_LIST_DIR}/requirements.txt diff --git a/sdk/core/azure-core/test/ut/azure_libcurl_core_main_test.cpp b/sdk/core/azure-core/test/ut/azure_libcurl_core_main_test.cpp index 2e37fb8fbc..feadd5f1c5 100644 --- a/sdk/core/azure-core/test/ut/azure_libcurl_core_main_test.cpp +++ b/sdk/core/azure-core/test/ut/azure_libcurl_core_main_test.cpp @@ -41,8 +41,8 @@ namespace Azure { namespace Core { namespace Test { auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool .ExtractOrCreateCurlConnection(req, options); - auto session = std::make_unique( - req, std::move(connection), options.HttpKeepAlive); + auto session + = std::make_unique(req, std::move(connection), options); session->Perform(Azure::Core::Context::ApplicationContext); // Reading all the response session->ReadToEnd(Azure::Core::Context::ApplicationContext); diff --git a/sdk/core/azure-core/test/ut/base64_test.cpp b/sdk/core/azure-core/test/ut/base64_test.cpp index 5272273c0f..bb11e7a159 100644 --- a/sdk/core/azure-core/test/ut/base64_test.cpp +++ b/sdk/core/azure-core/test/ut/base64_test.cpp @@ -126,6 +126,19 @@ TEST(Base64, Roundtrip) } } +TEST(Base64, RoundtripString) +{ + for (size_t len : {0, 10, 100, 1000, 10000}) + { + std::string data; + data.resize(len); + RandomBuffer(reinterpret_cast(const_cast(data.data())), data.size()); + + std::vector expected{data.begin(), data.end()}; + EXPECT_EQ(Convert::Base64Decode(_internal::Convert::Base64Encode(data)), expected); + } +} + TEST(Base64, ValidDecode) { // cspell::disable diff --git a/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp b/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp index 50b4d10db0..5c5d8cb126 100644 --- a/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp +++ b/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp @@ -55,7 +55,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(AzureSdkHttpbinServer::Get())); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), "001100")); + AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ",0,0,0,0,1,1,0,0")); { // Creating a new connection with default options @@ -65,8 +65,8 @@ namespace Azure { namespace Core { namespace Test { EXPECT_EQ(connection->GetConnectionKey(), expectedConnectionKey); - auto session = std::make_unique( - req, std::move(connection), options.HttpKeepAlive); + auto session + = std::make_unique(req, std::move(connection), options); // Simulate connection was used already session->m_lastStatusCode = Azure::Core::Http::HttpStatusCode::Ok; session->m_sessionState = Azure::Core::Http::CurlSession::SessionState::STREAMING; @@ -102,8 +102,8 @@ namespace Azure { namespace Core { namespace Test { // And the connection key for the connection we got is the expected EXPECT_EQ(connection->GetConnectionKey(), expectedConnectionKey); - auto session = std::make_unique( - req, std::move(connection), options.HttpKeepAlive); + auto session + = std::make_unique(req, std::move(connection), options); // Simulate connection was used already session->m_lastStatusCode = Azure::Core::Http::HttpStatusCode::Ok; session->m_sessionState = Azure::Core::Http::CurlSession::SessionState::STREAMING; @@ -123,8 +123,8 @@ namespace Azure { namespace Core { namespace Test { } // Now test that using a different connection config won't re-use the same connection - std::string const secondExpectedKey - = AzureSdkHttpbinServer::Schema() + "://" + AzureSdkHttpbinServer::Host() + "00100200000"; + std::string const secondExpectedKey = AzureSdkHttpbinServer::Schema() + "://" + + AzureSdkHttpbinServer::Host() + ",0,0,0,0,1,0,0,200000"; { // Creating a new connection with options Azure::Core::Http::CurlTransportOptions options; @@ -147,8 +147,8 @@ namespace Azure { namespace Core { namespace Test { ->GetConnectionKey(), expectedConnectionKey); - auto session = std::make_unique( - req, std::move(connection), options.HttpKeepAlive); + auto session + = std::make_unique(req, std::move(connection), options); // Simulate connection was used already session->m_lastStatusCode = Azure::Core::Http::HttpStatusCode::Ok; session->m_sessionState = Azure::Core::Http::CurlSession::SessionState::STREAMING; @@ -162,13 +162,22 @@ namespace Azure { namespace Core { namespace Test { { std::lock_guard lock( CurlConnectionPool::g_curlConnectionPool.ConnectionPoolMutex); - auto values = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool - .ConnectionPoolIndex.begin(); - EXPECT_EQ(values->second.size(), 1); - EXPECT_EQ(values->second.begin()->get()->GetConnectionKey(), secondExpectedKey); - values++; - EXPECT_EQ(values->second.size(), 1); - EXPECT_EQ(values->second.begin()->get()->GetConnectionKey(), expectedConnectionKey); + for (auto& val : Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool + .ConnectionPoolIndex) + { + EXPECT_EQ(val.second.size(), 1); + } + // The connection pool should have the two connections we added earlier. + EXPECT_NE( + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .end(), + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .find(expectedConnectionKey)); + EXPECT_NE( + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .end(), + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .find(secondExpectedKey)); } { @@ -202,8 +211,8 @@ namespace Azure { namespace Core { namespace Test { ->GetConnectionKey(), secondExpectedKey); - auto session = std::make_unique( - req, std::move(connection), options.HttpKeepAlive); + auto session + = std::make_unique(req, std::move(connection), options); // Simulate connection was used already session->m_lastStatusCode = Azure::Core::Http::HttpStatusCode::Ok; session->m_sessionState = Azure::Core::Http::CurlSession::SessionState::STREAMING; @@ -216,13 +225,22 @@ namespace Azure { namespace Core { namespace Test { { std::lock_guard lock( CurlConnectionPool::g_curlConnectionPool.ConnectionPoolMutex); - auto values = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool - .ConnectionPoolIndex.begin(); - EXPECT_EQ(values->second.size(), 1); - EXPECT_EQ(values->second.begin()->get()->GetConnectionKey(), secondExpectedKey); - values++; - EXPECT_EQ(values->second.size(), 1); - EXPECT_EQ(values->second.begin()->get()->GetConnectionKey(), expectedConnectionKey); + for (auto& val : Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool + .ConnectionPoolIndex) + { + EXPECT_EQ(val.second.size(), 1); + } + // The connection pool should have the two connections we added earlier. + EXPECT_NE( + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .end(), + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .find(expectedConnectionKey)); + EXPECT_NE( + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .end(), + Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool.ConnectionPoolIndex + .find(secondExpectedKey)); } { std::lock_guard lock( @@ -415,7 +433,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(authority)); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), "001100")); + AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ",0,0,0,0,1,1,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool @@ -451,7 +469,9 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(authority)); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ":443001100")); + AzureSdkHttpbinServer::Schema(), + AzureSdkHttpbinServer::Host(), + ":443,0,0,0,0,1,1,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool @@ -488,7 +508,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(authority)); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), "001100")); + AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ",0,0,0,0,1,1,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool @@ -523,7 +543,9 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(authority)); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ":443001100")); + AzureSdkHttpbinServer::Schema(), + AzureSdkHttpbinServer::Host(), + ":443,0,0,0,0,1,1,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool @@ -568,8 +590,8 @@ namespace Azure { namespace Core { namespace Test { { // Check that CURLE_SEND_ERROR is produced when trying to use the connection. - auto session = std::make_unique( - req, std::move(connection), options.HttpKeepAlive); + auto session + = std::make_unique(req, std::move(connection), options); auto r = session->Perform(Azure::Core::Context::ApplicationContext); EXPECT_EQ(CURLE_SEND_ERROR, r); } diff --git a/sdk/core/azure-core/test/ut/curl_session_test_test.cpp b/sdk/core/azure-core/test/ut/curl_session_test_test.cpp index 2b602ac138..af0a79c6c4 100644 --- a/sdk/core/azure-core/test/ut/curl_session_test_test.cpp +++ b/sdk/core/azure-core/test/ut/curl_session_test_test.cpp @@ -41,8 +41,10 @@ namespace Azure { namespace Core { namespace Test { // Move the curlMock to build a session and then send the request // The session will get the response we mock before, so it will pass for this GET + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); EXPECT_NO_THROW(session->Perform(Azure::Core::Context::ApplicationContext)); } @@ -75,8 +77,11 @@ namespace Azure { namespace Core { namespace Test { { // Create the session inside scope so it is released and the connection is moved to the pool + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; + auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); EXPECT_NO_THROW(session->Perform(Azure::Core::Context::ApplicationContext)); } @@ -118,8 +123,10 @@ namespace Azure { namespace Core { namespace Test { { // Create the session inside scope so it is released and the connection is moved to the pool + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); EXPECT_NO_THROW(session->Perform(Azure::Core::Context::ApplicationContext)); auto r = session->ExtractResponse(); @@ -159,8 +166,10 @@ namespace Azure { namespace Core { namespace Test { // Move the curlMock to build a session and then send the request // The session will get the response we mock before, so it will pass for this GET + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); EXPECT_THROW(session->Perform(Azure::Core::Context::ApplicationContext), std::invalid_argument); } @@ -188,8 +197,10 @@ namespace Azure { namespace Core { namespace Test { // Move the curlMock to build a session and then send the request // The session will get the response we mock before, so it will pass for this GET + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); EXPECT_NO_THROW(session->Perform(Azure::Core::Context::ApplicationContext)); } @@ -217,8 +228,10 @@ namespace Azure { namespace Core { namespace Test { // Move the curlMock to build a session and then send the request // The session will get the response we mock before, so it will pass for this GET + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); EXPECT_NO_THROW(session->Perform(Azure::Core::Context::ApplicationContext)); } @@ -292,8 +305,10 @@ namespace Azure { namespace Core { namespace Test { { // Create the session inside scope so it is released and the connection is moved to the pool + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); EXPECT_NO_THROW(session->Perform(Azure::Core::Context::ApplicationContext)); auto response = session->ExtractResponse(); @@ -328,8 +343,10 @@ namespace Azure { namespace Core { namespace Test { { // Create the session inside scope so it is released and the connection is moved to the pool + Azure::Core::Http::CurlTransportOptions transportOptions; + transportOptions.HttpKeepAlive = true; auto session = std::make_unique( - request, std::move(uniqueCurlMock), true); + request, std::move(uniqueCurlMock), transportOptions); auto returnCode = session->Perform(Azure::Core::Context::ApplicationContext); EXPECT_EQ(CURLE_SEND_ERROR, returnCode); diff --git a/sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 new file mode 100644 index 0000000000..55f3aea841 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 @@ -0,0 +1,16 @@ +pushd .\localproxy +docker build -t squid-local . +popd + +pushd .\localproxy.passwd +docker build -t squid-local.passwd . +popd + +pushd .\remoteproxy +docker build -t squid-remote . +popd + +pushd .\remoteproxy.passwd +docker build -t squid-remote.passwd . +popd + diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile new file mode 100644 index 0000000000..4bfef7bd1d --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile @@ -0,0 +1,30 @@ +#@# vim: set filetype=dockerfile: +# Code taken from: https://github.com/hinata/nginx-forward-proxy + +FROM ubuntu/squid +LABEL maintainer "Larry Osterman" + +ENV NGINX_VERSION 1.23.1 + +## +# dependent packages for docker build +## + +WORKDIR /tmp + +RUN apt-get -y update + +## +# application deployment +## + +WORKDIR / + +COPY ./squid.conf /etc/squid/squid.conf +COPY ./proxypasswd /etc/squid/passwords + +EXPOSE 3129 + +STOPSIGNAL SIGTERM + +ENTRYPOINT squid -f /etc/squid/squid.conf && sleep 10 && tail -f /var/log/squid/access.log diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/proxypasswd b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/proxypasswd new file mode 100644 index 0000000000..f9648a4a64 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/proxypasswd @@ -0,0 +1 @@ +user:$apr1$z0tE.mEW$6OXoAgyTD5vBkM5ON3R9h/ diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf new file mode 100644 index 0000000000..594e350202 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf @@ -0,0 +1,7991 @@ +# WELCOME TO SQUID 3.5.27 +# ---------------------------- +# +# This is the documentation for the Squid configuration file. +# This documentation can also be found online at: +# http://www.squid-cache.org/Doc/config/ +# +# You may wish to look at the Squid home page and wiki for the +# FAQ and other documentation: +# http://www.squid-cache.org/ +# http://wiki.squid-cache.org/SquidFaq +# http://wiki.squid-cache.org/ConfigExamples +# +# This documentation shows what the defaults for various directives +# happen to be. If you don't need to change the default, you should +# leave the line out of your squid.conf in most cases. +# +# In some cases "none" refers to no default setting at all, +# while in other cases it refers to the value of the option +# - the comments for that keyword indicate if this is the case. +# + +# Configuration options can be included using the "include" directive. +# Include takes a list of files to include. Quoting and wildcards are +# supported. +# +# For example, +# +# include /path/to/included/file/squid.acl.config +# +# Includes can be nested up to a hard-coded depth of 16 levels. +# This arbitrary restriction is to prevent recursive include references +# from causing Squid entering an infinite loop whilst trying to load +# configuration files. +# +# Values with byte units +# +# Squid accepts size units on some size related directives. All +# such directives are documented with a default value displaying +# a unit. +# +# Units accepted by Squid are: +# bytes - byte +# KB - Kilobyte (1024 bytes) +# MB - Megabyte +# GB - Gigabyte +# +# Values with spaces, quotes, and other special characters +# +# Squid supports directive parameters with spaces, quotes, and other +# special characters. Surround such parameters with "double quotes". Use +# the configuration_includes_quoted_values directive to enable or +# disable that support. +# +# Squid supports reading configuration option parameters from external +# files using the syntax: +# parameters("/path/filename") +# For example: +# acl whitelist dstdomain parameters("/etc/squid/whitelist.txt") +# +# Conditional configuration +# +# If-statements can be used to make configuration directives +# depend on conditions: +# +# if +# ... regular configuration directives ... +# [else +# ... regular configuration directives ...] +# endif +# +# The else part is optional. The keywords "if", "else", and "endif" +# must be typed on their own lines, as if they were regular +# configuration directives. +# +# NOTE: An else-if condition is not supported. +# +# These individual conditions types are supported: +# +# true +# Always evaluates to true. +# false +# Always evaluates to false. +# = +# Equality comparison of two integer numbers. +# +# +# SMP-Related Macros +# +# The following SMP-related preprocessor macros can be used. +# +# ${process_name} expands to the current Squid process "name" +# (e.g., squid1, squid2, or cache1). +# +# ${process_number} expands to the current Squid process +# identifier, which is an integer number (e.g., 1, 2, 3) unique +# across all Squid processes of the current service instance. +# +# ${service_name} expands into the current Squid service instance +# name identifier which is provided by -n on the command line. +# + +# TAG: broken_vary_encoding +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: cache_vary +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: error_map +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: external_refresh_check +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: location_rewrite_program +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: refresh_stale_hit +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: hierarchy_stoplist +# Remove this line. Use always_direct or cache_peer_access ACLs instead if you need to prevent cache_peer use. +#Default: +# none + +# TAG: log_access +# Remove this line. Use acls with access_log directives to control access logging +#Default: +# none + +# TAG: log_icap +# Remove this line. Use acls with icap_log directives to control icap logging +#Default: +# none + +# TAG: ignore_ims_on_miss +# Remove this line. The HTTP/1.1 feature is now configured by 'cache_miss_revalidate'. +#Default: +# none + +# TAG: chunked_request_body_max_size +# Remove this line. Squid is now HTTP/1.1 compliant. +#Default: +# none + +# TAG: dns_v4_fallback +# Remove this line. Squid performs a 'Happy Eyeballs' algorithm, the 'fallback' algorithm is no longer relevant. +#Default: +# none + +# TAG: emulate_httpd_log +# Replace this with an access_log directive using the format 'common' or 'combined'. +#Default: +# none + +# TAG: forward_log +# Use a regular access.log with ACL limiting it to MISS events. +#Default: +# none + +# TAG: ftp_list_width +# Remove this line. Configure FTP page display using the CSS controls in errorpages.css instead. +#Default: +# none + +# TAG: ignore_expect_100 +# Remove this line. The HTTP/1.1 feature is now fully supported by default. +#Default: +# none + +# TAG: log_fqdn +# Remove this option from your config. To log FQDN use %>A in the log format. +#Default: +# none + +# TAG: log_ip_on_direct +# Remove this option from your config. To log server or peer names use % +##auth_param negotiate children 20 startup=0 idle=1 +##auth_param negotiate keep_alive on +## +##auth_param digest program +##auth_param digest children 20 startup=0 idle=1 +##auth_param digest realm Squid proxy-caching web server +##auth_param digest nonce_garbage_interval 5 minutes +##auth_param digest nonce_max_duration 30 minutes +##auth_param digest nonce_max_count 50 +## +##auth_param ntlm program +##auth_param ntlm children 20 startup=0 idle=1 +##auth_param ntlm keep_alive on +## +auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords +auth_param basic children 5 startup=5 idle=1 +auth_param basic realm Squid proxy-caching web server +auth_param basic credentialsttl 2 hours +#Default: +# none + +# TAG: authenticate_cache_garbage_interval +# The time period between garbage collection across the username cache. +# This is a trade-off between memory utilization (long intervals - say +# 2 days) and CPU (short intervals - say 1 minute). Only change if you +# have good reason to. +#Default: +# authenticate_cache_garbage_interval 1 hour + +# TAG: authenticate_ttl +# The time a user & their credentials stay in the logged in +# user cache since their last request. When the garbage +# interval passes, all user credentials that have passed their +# TTL are removed from memory. +#Default: +# authenticate_ttl 1 hour + +# TAG: authenticate_ip_ttl +# If you use proxy authentication and the 'max_user_ip' ACL, +# this directive controls how long Squid remembers the IP +# addresses associated with each user. Use a small value +# (e.g., 60 seconds) if your users might change addresses +# quickly, as is the case with dialup. You might be safe +# using a larger value (e.g., 2 hours) in a corporate LAN +# environment with relatively static address assignments. +#Default: +# authenticate_ip_ttl 1 second + +# ACCESS CONTROLS +# ----------------------------------------------------------------------------- + +# TAG: external_acl_type +# This option defines external acl classes using a helper program +# to look up the status +# +# external_acl_type name [options] FORMAT.. /path/to/helper [helper arguments..] +# +# Options: +# +# ttl=n TTL in seconds for cached results (defaults to 3600 +# for 1 hour) +# +# negative_ttl=n +# TTL for cached negative lookups (default same +# as ttl) +# +# grace=n Percentage remaining of TTL where a refresh of a +# cached entry should be initiated without needing to +# wait for a new reply. (default is for no grace period) +# +# cache=n The maximum number of entries in the result cache. The +# default limit is 262144 entries. Each cache entry usually +# consumes at least 256 bytes. Squid currently does not remove +# expired cache entries until the limit is reached, so a proxy +# will sooner or later reach the limit. The expanded FORMAT +# value is used as the cache key, so if the details in FORMAT +# are highly variable, a larger cache may be needed to produce +# reduction in helper load. +# +# children-max=n +# Maximum number of acl helper processes spawned to service +# external acl lookups of this type. (default 5) +# +# children-startup=n +# Minimum number of acl helper processes to spawn during +# startup and reconfigure to service external acl lookups +# of this type. (default 0) +# +# children-idle=n +# Number of acl helper processes to keep ahead of traffic +# loads. Squid will spawn this many at once whenever load +# rises above the capabilities of existing processes. +# Up to the value of children-max. (default 1) +# +# concurrency=n concurrency level per process. Only used with helpers +# capable of processing more than one query at a time. +# +# protocol=2.5 Compatibility mode for Squid-2.5 external acl helpers. +# +# ipv4 / ipv6 IP protocol used to communicate with this helper. +# The default is to auto-detect IPv6 and use it when available. +# +# +# FORMAT specifications +# +# %LOGIN Authenticated user login name +# %un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul or %LOGIN +# - user name sent by an external ACL, like %EXT_USER +# - SSL client name, like %us in logformat +# - ident user name, like %ui in logformat +# %EXT_USER Username from previous external acl +# %EXT_LOG Log details from previous external acl +# %EXT_TAG Tag from previous external acl +# %IDENT Ident user name +# %SRC Client IP +# %SRCPORT Client source port +# %URI Requested URI +# %DST Requested host +# %PROTO Requested URL scheme +# %PORT Requested port +# %PATH Requested URL path +# %METHOD Request method +# %MYADDR Squid interface address +# %MYPORT Squid http_port number +# %PATH Requested URL-path (including query-string if any) +# %USER_CERT SSL User certificate in PEM format +# %USER_CERTCHAIN SSL User certificate chain in PEM format +# %USER_CERT_xx SSL User certificate subject attribute xx +# %USER_CA_CERT_xx SSL User certificate issuer attribute xx +# %ssl::>sni SSL client SNI sent to Squid +# %ssl::{Header} HTTP request header "Header" +# %>{Hdr:member} +# HTTP request header "Hdr" list member "member" +# %>{Hdr:;member} +# HTTP request header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %<{Header} HTTP reply header "Header" +# %<{Hdr:member} +# HTTP reply header "Hdr" list member "member" +# %<{Hdr:;member} +# HTTP reply header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %ACL The name of the ACL being tested. +# %DATA The ACL arguments. If not used then any arguments +# is automatically added at the end of the line +# sent to the helper. +# NOTE: this will encode the arguments as one token, +# whereas the default will pass each separately. +# +# %% The percent sign. Useful for helpers which need +# an unchanging input format. +# +# +# General request syntax: +# +# [channel-ID] FORMAT-values [acl-values ...] +# +# +# FORMAT-values consists of transaction details expanded with +# whitespace separation per the config file FORMAT specification +# using the FORMAT macros listed above. +# +# acl-values consists of any string specified in the referencing +# config 'acl ... external' line. see the "acl external" directive. +# +# Request values sent to the helper are URL escaped to protect +# each value in requests against whitespaces. +# +# If using protocol=2.5 then the request sent to the helper is not +# URL escaped to protect against whitespace. +# +# NOTE: protocol=3.0 is deprecated as no longer necessary. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# +# The helper receives lines expanded per the above format specification +# and for each input line returns 1 line starting with OK/ERR/BH result +# code and optionally followed by additional keywords with more details. +# +# +# General result syntax: +# +# [channel-ID] result keyword=value ... +# +# Result consists of one of the codes: +# +# OK +# the ACL test produced a match. +# +# ERR +# the ACL test does not produce a match. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. +# +# The meaning of 'a match' is determined by your squid.conf +# access control configuration. See the Squid wiki for details. +# +# Defined keywords: +# +# user= The users name (login) +# +# password= The users password (for login= cache_peer option) +# +# message= Message describing the reason for this response. +# Available as %o in error pages. +# Useful on (ERR and BH results). +# +# tag= Apply a tag to a request. Only sets a tag once, +# does not alter existing tags. +# +# log= String to be logged in access.log. Available as +# %ea in logformat specifications. +# +# clt_conn_tag= Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation +# for this kv-pair. +# +# Any keywords may be sent on any response whether OK, ERR or BH. +# +# All response keyword values need to be a single token with URL +# escaping, or enclosed in double quotes (") and escaped using \ on +# any double quotes or \ characters within the value. The wrapping +# double quotes are removed before the value is interpreted by Squid. +# \r and \n are also replace by CR and LF. +# +# Some example key values: +# +# user=John%20Smith +# user="John Smith" +# user="J. \"Bob\" Smith" +#Default: +# none + +# TAG: acl +# Defining an Access List +# +# Every access list definition must begin with an aclname and acltype, +# followed by either type-specific arguments or a quoted filename that +# they are read from. +# +# acl aclname acltype argument ... +# acl aclname acltype "file" ... +# +# When using "file", the file should contain one item per line. +# +# Some acl types supports options which changes their default behaviour. +# The available options are: +# +# -i,+i By default, regular expressions are CASE-SENSITIVE. To make them +# case-insensitive, use the -i option. To return case-sensitive +# use the +i option between patterns, or make a new ACL line +# without -i. +# +# -n Disable lookups and address type conversions. If lookup or +# conversion is required because the parameter type (IP or +# domain name) does not match the message address type (domain +# name or IP), then the ACL would immediately declare a mismatch +# without any warnings or lookups. +# +# -- Used to stop processing all options, in the case the first acl +# value has '-' character as first character (for example the '-' +# is a valid domain name) +# +# Some acl types require suspending the current request in order +# to access some external data source. +# Those which do are marked with the tag [slow], those which +# don't are marked as [fast]. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl +# for further information +# +# ***** ACL TYPES AVAILABLE ***** +# +# acl aclname src ip-address/mask ... # clients IP address [fast] +# acl aclname src addr1-addr2/mask ... # range of addresses [fast] +# acl aclname dst [-n] ip-address/mask ... # URL host's IP address [slow] +# acl aclname localip ip-address/mask ... # IP address the client connected to [fast] +# +# acl aclname arp mac-address ... (xx:xx:xx:xx:xx:xx notation) +# # [fast] +# # The 'arp' ACL code is not portable to all operating systems. +# # It works on Linux, Solaris, Windows, FreeBSD, and some other +# # BSD variants. +# # +# # NOTE: Squid can only determine the MAC/EUI address for IPv4 +# # clients that are on the same subnet. If the client is on a +# # different subnet, then Squid cannot find out its address. +# # +# # NOTE 2: IPv6 protocol does not contain ARP. MAC/EUI is either +# # encoded directly in the IPv6 address or not available. +# +# acl aclname srcdomain .foo.com ... +# # reverse lookup, from client IP [slow] +# acl aclname dstdomain [-n] .foo.com ... +# # Destination server from URL [fast] +# acl aclname srcdom_regex [-i] \.foo\.com ... +# # regex matching client name [slow] +# acl aclname dstdom_regex [-n] [-i] \.foo\.com ... +# # regex matching server [fast] +# # +# # For dstdomain and dstdom_regex a reverse lookup is tried if a IP +# # based URL is used and no match is found. The name "none" is used +# # if the reverse lookup fails. +# +# acl aclname src_as number ... +# acl aclname dst_as number ... +# # [fast] +# # Except for access control, AS numbers can be used for +# # routing of requests to specific caches. Here's an +# # example for routing all requests for AS#1241 and only +# # those to mycache.mydomain.net: +# # acl asexample dst_as 1241 +# # cache_peer_access mycache.mydomain.net allow asexample +# # cache_peer_access mycache_mydomain.net deny all +# +# acl aclname peername myPeer ... +# # [fast] +# # match against a named cache_peer entry +# # set unique name= on cache_peer lines for reliable use. +# +# acl aclname time [day-abbrevs] [h1:m1-h2:m2] +# # [fast] +# # day-abbrevs: +# # S - Sunday +# # M - Monday +# # T - Tuesday +# # W - Wednesday +# # H - Thursday +# # F - Friday +# # A - Saturday +# # h1:m1 must be less than h2:m2 +# +# acl aclname url_regex [-i] ^http:// ... +# # regex matching on whole URL [fast] +# acl aclname urllogin [-i] [^a-zA-Z0-9] ... +# # regex matching on URL login field +# acl aclname urlpath_regex [-i] \.gif$ ... +# # regex matching on URL path [fast] +# +# acl aclname port 80 70 21 0-1024... # destination TCP port [fast] +# # ranges are alloed +# acl aclname localport 3128 ... # TCP port the client connected to [fast] +# # NP: for interception mode this is usually '80' +# +# acl aclname myportname 3128 ... # *_port name [fast] +# +# acl aclname proto HTTP FTP ... # request protocol [fast] +# +# acl aclname method GET POST ... # HTTP request method [fast] +# +# acl aclname http_status 200 301 500- 400-403 ... +# # status code in reply [fast] +# +# acl aclname browser [-i] regexp ... +# # pattern match on User-Agent header (see also req_header below) [fast] +# +# acl aclname referer_regex [-i] regexp ... +# # pattern match on Referer header [fast] +# # Referer is highly unreliable, so use with care +# +# acl aclname ident username ... +# acl aclname ident_regex [-i] pattern ... +# # string match on ident output [slow] +# # use REQUIRED to accept any non-null ident. +# +# acl aclname proxy_auth [-i] username ... +# acl aclname proxy_auth_regex [-i] pattern ... +# # perform http authentication challenge to the client and match against +# # supplied credentials [slow] +# # +# # takes a list of allowed usernames. +# # use REQUIRED to accept any valid username. +# # +# # Will use proxy authentication in forward-proxy scenarios, and plain +# # http authenticaiton in reverse-proxy scenarios +# # +# # NOTE: when a Proxy-Authentication header is sent but it is not +# # needed during ACL checking the username is NOT logged +# # in access.log. +# # +# # NOTE: proxy_auth requires a EXTERNAL authentication program +# # to check username/password combinations (see +# # auth_param directive). +# # +# # NOTE: proxy_auth can't be used in a transparent/intercepting proxy +# # as the browser needs to be configured for using a proxy in order +# # to respond to proxy authentication. +# +# acl aclname snmp_community string ... +# # A community string to limit access to your SNMP Agent [fast] +# # Example: +# # +# # acl snmppublic snmp_community public +# +# acl aclname maxconn number +# # This will be matched when the client's IP address has +# # more than TCP connections established. [fast] +# # NOTE: This only measures direct TCP links so X-Forwarded-For +# # indirect clients are not counted. +# +# acl aclname max_user_ip [-s] number +# # This will be matched when the user attempts to log in from more +# # than different ip addresses. The authenticate_ip_ttl +# # parameter controls the timeout on the ip entries. [fast] +# # If -s is specified the limit is strict, denying browsing +# # from any further IP addresses until the ttl has expired. Without +# # -s Squid will just annoy the user by "randomly" denying requests. +# # (the counter is reset each time the limit is reached and a +# # request is denied) +# # NOTE: in acceleration mode or where there is mesh of child proxies, +# # clients may appear to come from multiple addresses if they are +# # going through proxy farms, so a limit of 1 may cause user problems. +# +# acl aclname random probability +# # Pseudo-randomly match requests. Based on the probability given. +# # Probability may be written as a decimal (0.333), fraction (1/3) +# # or ratio of matches:non-matches (3:5). +# +# acl aclname req_mime_type [-i] mime-type ... +# # regex match against the mime type of the request generated +# # by the client. Can be used to detect file upload or some +# # types HTTP tunneling requests [fast] +# # NOTE: This does NOT match the reply. You cannot use this +# # to match the returned file type. +# +# acl aclname req_header header-name [-i] any\.regex\.here +# # regex match against any of the known request headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACL [fast] +# +# acl aclname rep_mime_type [-i] mime-type ... +# # regex match against the mime type of the reply received by +# # squid. Can be used to detect file download or some +# # types HTTP tunneling requests. [fast] +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname rep_header header-name [-i] any\.regex\.here +# # regex match against any of the known reply headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACLs [fast] +# +# acl aclname external class_name [arguments...] +# # external ACL lookup via a helper class defined by the +# # external_acl_type directive [slow] +# +# acl aclname user_cert attribute values... +# # match against attributes in a user SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ca_cert attribute values... +# # match against attributes a users issuing CA SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ext_user username ... +# acl aclname ext_user_regex [-i] pattern ... +# # string match on username returned by external acl helper [slow] +# # use REQUIRED to accept any non-null user name. +# +# acl aclname tag tagvalue ... +# # string match on tag returned by external acl helper [fast] +# # DEPRECATED. Only the first tag will match with this ACL. +# # Use the 'note' ACL instead for handling multiple tag values. +# +# acl aclname hier_code codename ... +# # string match against squid hierarchy code(s); [fast] +# # e.g., DIRECT, PARENT_HIT, NONE, etc. +# # +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname note name [value ...] +# # match transaction annotation [fast] +# # Without values, matches any annotation with a given name. +# # With value(s), matches any annotation with a given name that +# # also has one of the given values. +# # Names and values are compared using a string equality test. +# # Annotation sources include note and adaptation_meta directives +# # as well as helper and eCAP responses. +# +# acl aclname adaptation_service service ... +# # Matches the name of any icap_service, ecap_service, +# # adaptation_service_set, or adaptation_service_chain that Squid +# # has used (or attempted to use) for the master transaction. +# # This ACL must be defined after the corresponding adaptation +# # service is named in squid.conf. This ACL is usable with +# # adaptation_meta because it starts matching immediately after +# # the service has been selected for adaptation. +# +# acl aclname any-of acl1 acl2 ... +# # match any one of the acls [fast or slow] +# # The first matching ACL stops further ACL evaluation. +# # +# # ACLs from multiple any-of lines with the same name are ORed. +# # For example, A = (a1 or a2) or (a3 or a4) can be written as +# # acl A any-of a1 a2 +# # acl A any-of a3 a4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# acl aclname all-of acl1 acl2 ... +# # match all of the acls [fast or slow] +# # The first mismatching ACL stops further ACL evaluation. +# # +# # ACLs from multiple all-of lines with the same name are ORed. +# # For example, B = (b1 and b2) or (b3 and b4) can be written as +# # acl B all-of b1 b2 +# # acl B all-of b3 b4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# Examples: +# acl macaddress arp 09:00:2b:23:45:67 +# acl myexample dst_as 1241 +# acl password proxy_auth REQUIRED +# acl fileupload req_mime_type -i ^multipart/form-data$ +# acl javascript rep_mime_type -i ^application/x-javascript$ +# +#Default: +# ACLs all, manager, localhost, and to_localhost are predefined. +# +# +# Recommended minimum configuration: +# + +# Example rule allowing access from your local networks. +# Adapt to list your (internal) IP networks from where browsing +# should be allowed +acl localnet src 10.0.0.0/8 # RFC1918 possible internal network +acl localnet src 172.16.0.0/12 # RFC1918 possible internal network +acl localnet src 192.168.0.0/16 # RFC1918 possible internal network +acl localnet src fc00::/7 # RFC 4193 local private network range +acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines +acl localnet src 2001:4898::/48 + + + +acl SSL_ports port 443 +acl Safe_ports port 80 # http +acl Safe_ports port 21 # ftp +acl Safe_ports port 443 # https +acl Safe_ports port 70 # gopher +acl Safe_ports port 210 # wais +acl Safe_ports port 1025-65535 # unregistered ports +acl Safe_ports port 280 # http-mgmt +acl Safe_ports port 488 # gss-http +acl Safe_ports port 591 # filemaker +acl Safe_ports port 777 # multiling http +acl CONNECT method CONNECT + +# TAG: proxy_protocol_access +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address using PROXY protocol. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# This directive is solely for validating new PROXY protocol +# connections received from a port flagged with require-proxy-header. +# It is checked only once after TCP connection setup. +# +# A deny match results in TCP connection closure. +# +# An allow match is required for Squid to permit the corresponding +# TCP connection, before Squid even looks for HTTP request headers. +# If there is an allow match, Squid starts using PROXY header information +# to determine the source address of the connection for all future ACL +# checks, logging, etc. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# all TCP connections to ports with require-proxy-header will be denied + +# TAG: follow_x_forwarded_for +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# PROXY protocol connections are controlled by the proxy_protocol_access +# directive which is checked before this. +# +# If a request reaches us from a source that is allowed by this +# directive, then we trust the information it provides regarding +# the IP of the client it received from (if any). +# +# For the purpose of ACLs used in this directive the src ACL type always +# matches the address we are testing and srcdomain matches its rDNS. +# +# On each HTTP request Squid checks for X-Forwarded-For header fields. +# If found the header values are iterated in reverse order and an allow +# match is required for Squid to continue on to the next value. +# The verification ends when a value receives a deny match, cannot be +# tested, or there are no more values to test. +# NOTE: Squid does not yet follow the Forwarded HTTP header. +# +# The end result of this process is an IP address that we will +# refer to as the indirect client address. This address may +# be treated as the client address for access control, ICAP, delay +# pools and logging, depending on the acl_uses_indirect_client, +# icap_uses_indirect_client, delay_pool_uses_indirect_client, +# log_uses_indirect_client and tproxy_uses_indirect_client options. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# For example: +# +# acl localhost src 127.0.0.1 +# acl my_other_proxy srcdomain .proxy.example.com +# follow_x_forwarded_for allow localhost +# follow_x_forwarded_for allow my_other_proxy +#Default: +# X-Forwarded-For header will be ignored. + +# TAG: acl_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in acl matching. +# +# NOTE: maxconn ACL considers direct TCP links and indirect +# clients will always have zero. So no match. +#Default: +# acl_uses_indirect_client on + +# TAG: delay_pool_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in delay pools. +#Default: +# delay_pool_uses_indirect_client on + +# TAG: log_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in the access log. +#Default: +# log_uses_indirect_client on + +# TAG: tproxy_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address when spoofing the outgoing client. +# +# This has no effect on requests arriving in non-tproxy +# mode ports. +# +# SECURITY WARNING: Usage of this option is dangerous +# and should not be used trivially. Correct configuration +# of follow_x_forwarded_for with a limited set of trusted +# sources is required to prevent abuse of your proxy. +#Default: +# tproxy_uses_indirect_client off + +# TAG: spoof_client_ip +# Control client IP address spoofing of TPROXY traffic based on +# defined access lists. +# +# spoof_client_ip allow|deny [!]aclname ... +# +# If there are no "spoof_client_ip" lines present, the default +# is to "allow" spoofing of any suitable request. +# +# Note that the cache_peer "no-tproxy" option overrides this ACL. +# +# This clause supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow spoofing on all TPROXY traffic. + +# TAG: http_access +# Allowing or Denying access based on defined access lists +# +# To allow or deny a message received on an HTTP, HTTPS, or FTP port: +# http_access allow|deny [!]aclname ... +# +# NOTE on default values: +# +# If there are no "access" lines present, the default is to deny +# the request. +# +# If none of the "access" lines cause a match, the default is the +# opposite of the last line in the list. If the last line was +# deny, the default is allow. Conversely, if the last line +# is allow, the default will be deny. For these reasons, it is a +# good idea to have an "deny all" entry at the end of your access +# lists to avoid potential confusion. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Default: +# Deny, unless rules exist in squid.conf. +# + +# +# Recommended minimum Access Permission configuration: +# +# Deny requests to certain unsafe ports +http_access deny !Safe_ports + +# Deny CONNECT to other than secure SSL ports +http_access deny CONNECT !SSL_ports + +# Only allow cachemgr access from localhost +http_access allow localhost manager +http_access deny manager + +#auth_param negotiate program /usr/lib/squid/negotiate_wrapper_auth --ntlm /usr/bin/ntlm_auth --helper-protocol=gss-spnego --kerberos /usr/lib/squid/negotiate_kerberos_auth +# +#auth_param negotiate children 30 startup=2 idle=1 +#auth_param negotiate keep_alive on + +acl AuthUsers proxy_auth REQUIRED +http_access allow AuthUsers + +# We strongly recommend the following be uncommented to protect innocent +# web applications running on the proxy server who think the only +# one who can access services on "localhost" is a local user +#http_access deny to_localhost + +# +# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS +# + +# Example rule allowing access from your local networks. +# Adapt localnet in the ACL section to list your (internal) IP networks +# from where browsing should be allowed +http_access allow localnet +http_access allow localhost + +# And finally deny all other access to this proxy +http_access deny all + +# TAG: adapted_http_access +# Allowing or Denying access based on defined access lists +# +# Essentially identical to http_access, but runs after redirectors +# and ICAP/eCAP adaptation. Allowing access control based on their +# output. +# +# If not set then only http_access is used. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: http_reply_access +# Allow replies to client requests. This is complementary to http_access. +# +# http_reply_access allow|deny [!] aclname ... +# +# NOTE: if there are no access lines present, the default is to allow +# all replies. +# +# If none of the access lines cause a match the opposite of the +# last line will apply. Thus it is good practice to end the rules +# with an "allow all" or "deny all" entry. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: icp_access +# Allowing or Denying access to the ICP port based on defined +# access lists +# +# icp_access allow|deny [!]aclname ... +# +# NOTE: The default if no icp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using ICP. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow ICP queries from local networks only +##icp_access allow localnet +##icp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_access +# Allowing or Denying access to the HTCP port based on defined +# access lists +# +# htcp_access allow|deny [!]aclname ... +# +# See also htcp_clr_access for details on access control for +# cache purge (CLR) HTCP messages. +# +# NOTE: The default if no htcp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using the htcp option. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP queries from local networks only +##htcp_access allow localnet +##htcp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_clr_access +# Allowing or Denying access to purge content using HTCP based +# on defined access lists. +# See htcp_access for details on general HTCP access control. +# +# htcp_clr_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP CLR requests from trusted peers +#acl htcp_clr_peer src 192.0.2.2 2001:DB8::2 +#htcp_clr_access allow htcp_clr_peer +#htcp_clr_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: miss_access +# Determines whether network access is permitted when satisfying a request. +# +# For example; +# to force your neighbors to use you as a sibling instead of +# a parent. +# +# acl localclients src 192.0.2.0/24 2001:DB8::a:0/64 +# miss_access deny !localclients +# miss_access allow all +# +# This means only your local clients are allowed to fetch relayed/MISS +# replies from the network and all other clients can only fetch cached +# objects (HITs). +# +# The default for this setting allows all clients who passed the +# http_access rules to relay via this proxy. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: ident_lookup_access +# A list of ACL elements which, if matched, cause an ident +# (RFC 931) lookup to be performed for this request. For +# example, you might choose to always perform ident lookups +# for your main multi-user Unix boxes, but not for your Macs +# and PCs. By default, ident lookups are not performed for +# any requests. +# +# To enable ident lookups for specific client addresses, you +# can follow this example: +# +# acl ident_aware_hosts src 198.168.1.0/24 +# ident_lookup_access allow ident_aware_hosts +# ident_lookup_access deny all +# +# Only src type ACL checks are fully supported. A srcdomain +# ACL might work at times, but it will not always provide +# the correct result. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Unless rules exist in squid.conf, IDENT is not fetched. + +# TAG: reply_body_max_size size [acl acl...] +# This option specifies the maximum size of a reply body. It can be +# used to prevent users from downloading very large files, such as +# MP3's and movies. When the reply headers are received, the +# reply_body_max_size lines are processed, and the first line where +# all (if any) listed ACLs are true is used as the maximum body size +# for this reply. +# +# This size is checked twice. First when we get the reply headers, +# we check the content-length value. If the content length value exists +# and is larger than the allowed size, the request is denied and the +# user receives an error message that says "the request or reply +# is too large." If there is no content-length, and the reply +# size exceeds this limit, the client's connection is just closed +# and they will receive a partial reply. +# +# WARNING: downstream caches probably can not detect a partial reply +# if there is no content-length header, so they will cache +# partial responses and give them out as hits. You should NOT +# use this option if you have downstream caches. +# +# WARNING: A maximum size smaller than the size of squid's error messages +# will cause an infinite loop and crash squid. Ensure that the smallest +# non-zero value you use is greater that the maximum header size plus +# the size of your largest error page. +# +# If you set this parameter none (the default), there will be +# no limit imposed. +# +# Configuration Format is: +# reply_body_max_size SIZE UNITS [acl ...] +# ie. +# reply_body_max_size 10 MB +# +#Default: +# No limit is applied. + +# NETWORK OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: http_port +# Usage: port [mode] [options] +# hostname:port [mode] [options] +# 1.2.3.4:port [mode] [options] +# +# The socket addresses where Squid will listen for HTTP client +# requests. You may specify multiple socket addresses. +# There are three forms: port alone, hostname with port, and +# IP address with port. If you specify a hostname or IP +# address, Squid binds the socket to that specific +# address. Most likely, you do not need to bind to a specific +# address, so you can use the port number alone. +# +# If you are running Squid in accelerator mode, you +# probably want to listen on port 80 also, or instead. +# +# The -a command line option may be used to specify additional +# port(s) where Squid listens for proxy request. Such ports will +# be plain proxy ports with no options. +# +# You may specify multiple socket addresses on multiple lines. +# +# Modes: +# +# intercept Support for IP-Layer NAT interception delivering +# traffic to this Squid port. +# NP: disables authentication on the port. +# +# tproxy Support Linux TPROXY (or BSD divert-to) with spoofing +# of outgoing connections using the client IP address. +# NP: disables authentication on the port. +# +# accel Accelerator / reverse proxy mode +# +# ssl-bump For each CONNECT request allowed by ssl_bump ACLs, +# establish secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# The ssl_bump option is required to fully enable +# bumping of CONNECT requests. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# Accelerator Mode Options: +# +# defaultsite=domainname +# What to use for the Host: header if it is not present +# in a request. Determines what site (not origin server) +# accelerators should consider the default. +# +# no-vhost Disable using HTTP/1.1 Host header for virtual domain support. +# +# protocol= Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to HTTP/1.1 for http_port and +# HTTPS/1.1 for https_port. +# When an unsupported value is configured Squid will +# produce a FATAL error. +# Values: HTTP or HTTP/1.1, HTTPS or HTTPS/1.1 +# +# vport Virtual host port support. Using the http_port number +# instead of the port passed on Host: headers. +# +# vport=NN Virtual host port support. Using the specified port +# number instead of the port passed on Host: headers. +# +# act-as-origin +# Act as if this Squid is the origin server. +# This currently means generate new Date: and Expires: +# headers on HIT instead of adding Age:. +# +# ignore-cc Ignore request Cache-Control headers. +# +# WARNING: This option violates HTTP specifications if +# used in non-accelerator setups. +# +# allow-direct Allow direct forwarding in accelerator mode. Normally +# accelerated requests are denied direct forwarding as if +# never_direct was used. +# +# WARNING: this option opens accelerator mode to security +# vulnerabilities usually only affecting in interception +# mode. Make sure to protect forwarding with suitable +# http_access rules when using this. +# +# +# SSL Bump Mode Options: +# In addition to these options ssl-bump requires TLS/SSL options. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped CONNECT requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is a CA certificate lifetime of the generated +# certificate equals lifetime of the CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# TLS / SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +# +# cipher= Colon separated list of supported ciphers. +# NOTE: some ciphers such as EDH ciphers depend on +# additional settings. If those settings are +# omitted the ciphers may be silently ignored +# by the OpenSSL library. +# +# options= Various SSL implementation options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# NO_TICKET Disables TLS tickets extension +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# See OpenSSL SSL_CTX_set_options documentation for a +# complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# See OpenSSL documentation for details on how to create the +# DH parameter file. Supported curves for ECDH can be listed +# using the "openssl ecparam -list_curves" command. +# WARNING: EDH and EECDH ciphers will be silently disabled if +# this option is not set. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# Other Options: +# +# connection-auth[=on|off] +# use connection-auth=off to tell Squid to prevent +# forwarding Microsoft connection oriented authentication +# (NTLM, Negotiate and Kerberos) +# +# disable-pmtu-discovery= +# Control Path-MTU discovery usage: +# off lets OS decide on what to do (default). +# transparent disable PMTU discovery when transparent +# support is enabled. +# always disable always PMTU discovery. +# +# In many setups of transparently intercepting proxies +# Path-MTU discovery can not work on traffic towards the +# clients. This is the case when the intercepting device +# does not fully track connections and fails to forward +# ICMP must fragment messages to the cache server. If you +# have such setup and experience that certain clients +# sporadically hang or never complete requests set +# disable-pmtu-discovery option to 'transparent'. +# +# name= Specifies a internal name for the port. Defaults to +# the port specification (port or addr:port) +# +# tcpkeepalive[=idle,interval,timeout] +# Enable TCP keepalive probes of idle connections. +# In seconds; idle is the initial time before TCP starts +# probing the connection, interval how often to probe, and +# timeout the time before giving up. +# +# require-proxy-header +# Require PROXY protocol version 1 or 2 connections. +# The proxy_protocol_access is required to whitelist +# downstream proxies which can be trusted. +# +# If you run Squid on a dual-homed machine with an internal +# and an external interface we recommend you to specify the +# internal address:port in http_port. This way Squid will only be +# visible on the internal address. +# +# + +# Squid normally listens to port 3128 +http_port 3129 + +# TAG: https_port +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Usage: [ip:]port cert=certificate.pem [key=key.pem] [mode] [options...] +# +# The socket address where Squid will listen for client requests made +# over TLS or SSL connections. Commonly referred to as HTTPS. +# +# This is most useful for situations where you are running squid in +# accelerator mode and you want to do the SSL work at the accelerator level. +# +# You may specify multiple socket addresses on multiple lines, +# each with their own SSL certificate and/or options. +# +# Modes: +# +# accel Accelerator / reverse proxy mode +# +# intercept Support for IP-Layer interception of +# outgoing requests without browser settings. +# NP: disables authentication and IPv6 on the port. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# ssl-bump For each intercepted connection allowed by ssl_bump +# ACLs, establish a secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# An "ssl_bump server-first" match is required to +# fully enable bumping of intercepted SSL connections. +# +# Requires tproxy or intercept. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# See http_port for a list of generic options +# +# +# SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1 only +# +# cipher= Colon separated list of supported ciphers. +# +# options= Various SSL engine options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1 +# +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# See src/ssl_support.c or OpenSSL SSL_CTX_set_options +# documentation for a complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped SSL requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is CA certificate life time of generated +# certificate equals lifetime of CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# See http_port for a list of available options. +#Default: +# none + +# TAG: ftp_port +# Enables Native FTP proxy by specifying the socket address where Squid +# listens for FTP client requests. See http_port directive for various +# ways to specify the listening address and mode. +# +# Usage: ftp_port address [mode] [options] +# +# WARNING: This is a new, experimental, complex feature that has seen +# limited production exposure. Some Squid modules (e.g., caching) do not +# currently work with native FTP proxying, and many features have not +# even been tested for compatibility. Test well before deploying! +# +# Native FTP proxying differs substantially from proxying HTTP requests +# with ftp:// URIs because Squid works as an FTP server and receives +# actual FTP commands (rather than HTTP requests with FTP URLs). +# +# Native FTP commands accepted at ftp_port are internally converted or +# wrapped into HTTP-like messages. The same happens to Native FTP +# responses received from FTP origin servers. Those HTTP-like messages +# are shoveled through regular access control and adaptation layers +# between the FTP client and the FTP origin server. This allows Squid to +# examine, adapt, block, and log FTP exchanges. Squid reuses most HTTP +# mechanisms when shoveling wrapped FTP messages. For example, +# http_access and adaptation_access directives are used. +# +# Modes: +# +# intercept Same as http_port intercept. The FTP origin address is +# determined based on the intended destination of the +# intercepted connection. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# By default (i.e., without an explicit mode option), Squid extracts the +# FTP origin address from the login@origin parameter of the FTP USER +# command. Many popular FTP clients support such native FTP proxying. +# +# Options: +# +# name=token Specifies an internal name for the port. Defaults to +# the port address. Usable with myportname ACL. +# +# ftp-track-dirs +# Enables tracking of FTP directories by injecting extra +# PWD commands and adjusting Request-URI (in wrapping +# HTTP requests) to reflect the current FTP server +# directory. Tracking is disabled by default. +# +# protocol=FTP Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to FTP. No other accepted +# values have been tested with. An unsupported value +# results in a FATAL error. Accepted values are FTP, +# HTTP (or HTTP/1.1), and HTTPS (or HTTPS/1.1). +# +# Other http_port modes and options that are not specific to HTTP and +# HTTPS may also work. +#Default: +# none + +# TAG: tcp_outgoing_tos +# Allows you to select a TOS/Diffserv value for packets outgoing +# on the server side, based on an ACL. +# +# tcp_outgoing_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_tos 0x00 normal_service_net +# tcp_outgoing_tos 0x20 good_service_net +# +# TOS/DSCP values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_tos +# Allows you to select a TOS/DSCP value for packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_tos 0x00 normal_service_net +# clientside_tos 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any TOS values set here +# will be overwritten by TOS values in qos_flows. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +#Default: +# none + +# TAG: tcp_outgoing_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to outgoing packets +# on the server side, based on an ACL. +# +# tcp_outgoing_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_mark 0x00 normal_service_net +# tcp_outgoing_mark 0x20 good_service_net +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_mark 0x00 normal_service_net +# clientside_mark 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any mark values set here +# will be overwritten by mark values in qos_flows. +#Default: +# none + +# TAG: qos_flows +# Allows you to select a TOS/DSCP value to mark outgoing +# connections to the client, based on where the reply was sourced. +# For platforms using netfilter, allows you to set a netfilter mark +# value instead of, or in addition to, a TOS value. +# +# By default this functionality is disabled. To enable it with the default +# settings simply use "qos_flows mark" or "qos_flows tos". Default +# settings will result in the netfilter mark or TOS value being copied +# from the upstream connection to the client. Note that it is the connection +# CONNMARK value not the packet MARK value that is copied. +# +# It is not currently possible to copy the mark or TOS value from the +# client to the upstream connection request. +# +# TOS values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Mark values can be any unsigned 32-bit integer value. +# +# This setting is configured by setting the following values: +# +# tos|mark Whether to set TOS or netfilter mark values +# +# local-hit=0xFF Value to mark local cache hits. +# +# sibling-hit=0xFF Value to mark hits from sibling peers. +# +# parent-hit=0xFF Value to mark hits from parent peers. +# +# miss=0xFF[/mask] Value to mark cache misses. Takes precedence +# over the preserve-miss feature (see below), unless +# mask is specified, in which case only the bits +# specified in the mask are written. +# +# The TOS variant of the following features are only possible on Linux +# and require your kernel to be patched with the TOS preserving ZPH +# patch, available from http://zph.bratcheda.org +# No patch is needed to preserve the netfilter mark, which will work +# with all variants of netfilter. +# +# disable-preserve-miss +# This option disables the preservation of the TOS or netfilter +# mark. By default, the existing TOS or netfilter mark value of +# the response coming from the remote server will be retained +# and masked with miss-mark. +# NOTE: in the case of a netfilter mark, the mark must be set on +# the connection (using the CONNMARK target) not on the packet +# (MARK target). +# +# miss-mask=0xFF +# Allows you to mask certain bits in the TOS or mark value +# received from the remote server, before copying the value to +# the TOS sent towards clients. +# Default for tos: 0xFF (TOS from server is not changed). +# Default for mark: 0xFFFFFFFF (mark from server is not changed). +# +# All of these features require the --enable-zph-qos compilation flag +# (enabled by default). Netfilter marking also requires the +# libnetfilter_conntrack libraries (--with-netfilter-conntrack) and +# libcap 2.09+ (--with-libcap). +# +#Default: +# none + +# TAG: tcp_outgoing_address +# Allows you to map requests to different outgoing IP addresses +# based on the username or source address of the user making +# the request. +# +# tcp_outgoing_address ipaddr [[!]aclname] ... +# +# For example; +# Forwarding clients with dedicated IPs for certain subnets. +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.2.0/24 +# +# tcp_outgoing_address 2001:db8::c001 good_service_net +# tcp_outgoing_address 10.1.0.2 good_service_net +# +# tcp_outgoing_address 2001:db8::beef normal_service_net +# tcp_outgoing_address 10.1.0.1 normal_service_net +# +# tcp_outgoing_address 2001:db8::1 +# tcp_outgoing_address 10.1.0.3 +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Squid will add an implicit IP version test to each line. +# Requests going to IPv4 websites will use the outgoing 10.1.0.* addresses. +# Requests going to IPv6 websites will use the outgoing 2001:db8:* addresses. +# +# +# NOTE: The use of this directive using client dependent ACLs is +# incompatible with the use of server side persistent connections. To +# ensure correct results it is best to set server_persistent_connections +# to off when using this directive in such configurations. +# +# NOTE: The use of this directive to set a local IP on outgoing TCP links +# is incompatible with using TPROXY to set client IP out outbound TCP links. +# When needing to contact peers use the no-tproxy cache_peer option and the +# client_dst_passthru directive re-enable normal forwarding such as this. +# +#Default: +# Address selection is performed by the operating system. + +# TAG: host_verify_strict +# Regardless of this option setting, when dealing with intercepted +# traffic, Squid always verifies that the destination IP address matches +# the Host header domain or IP (called 'authority form URL'). +# +# This enforcement is performed to satisfy a MUST-level requirement in +# RFC 2616 section 14.23: "The Host field value MUST represent the naming +# authority of the origin server or gateway given by the original URL". +# +# When set to ON: +# Squid always responds with an HTTP 409 (Conflict) error +# page and logs a security warning if there is no match. +# +# Squid verifies that the destination IP address matches +# the Host header for forward-proxy and reverse-proxy traffic +# as well. For those traffic types, Squid also enables the +# following checks, comparing the corresponding Host header +# and Request-URI components: +# +# * The host names (domain or IP) must be identical, +# but valueless or missing Host header disables all checks. +# For the two host names to match, both must be either IP +# or FQDN. +# +# * Port numbers must be identical, but if a port is missing +# the scheme-default port is assumed. +# +# +# When set to OFF (the default): +# Squid allows suspicious requests to continue but logs a +# security warning and blocks caching of the response. +# +# * Forward-proxy traffic is not checked at all. +# +# * Reverse-proxy traffic is not checked at all. +# +# * Intercepted traffic which passes verification is handled +# according to client_dst_passthru. +# +# * Intercepted requests which fail verification are sent +# to the client original destination instead of DIRECT. +# This overrides 'client_dst_passthru off'. +# +# For now suspicious intercepted CONNECT requests are always +# responded to with an HTTP 409 (Conflict) error page. +# +# +# SECURITY NOTE: +# +# As described in CVE-2009-0801 when the Host: header alone is used +# to determine the destination of a request it becomes trivial for +# malicious scripts on remote websites to bypass browser same-origin +# security policy and sandboxing protections. +# +# The cause of this is that such applets are allowed to perform their +# own HTTP stack, in which case the same-origin policy of the browser +# sandbox only verifies that the applet tries to contact the same IP +# as from where it was loaded at the IP level. The Host: header may +# be different from the connected IP and approved origin. +# +#Default: +# host_verify_strict off + +# TAG: client_dst_passthru +# With NAT or TPROXY intercepted traffic Squid may pass the request +# directly to the original client destination IP or seek a faster +# source using the HTTP Host header. +# +# Using Host to locate alternative servers can provide faster +# connectivity with a range of failure recovery options. +# But can also lead to connectivity trouble when the client and +# server are attempting stateful interactions unaware of the proxy. +# +# This option (on by default) prevents alternative DNS entries being +# located to send intercepted traffic DIRECT to an origin server. +# The clients original destination IP and port will be used instead. +# +# Regardless of this option setting, when dealing with intercepted +# traffic Squid will verify the Host: header and any traffic which +# fails Host verification will be treated as if this option were ON. +# +# see host_verify_strict for details on the verification process. +#Default: +# client_dst_passthru on + +# SSL OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ssl_unclean_shutdown +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Some browsers (especially MSIE) bugs out on SSL shutdown +# messages. +#Default: +# ssl_unclean_shutdown off + +# TAG: ssl_engine +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The OpenSSL engine to use. You will need to set this if you +# would like to use hardware SSL acceleration for example. +#Default: +# none + +# TAG: sslproxy_client_certificate +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Certificate to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_client_key +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Key to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_version +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL version level to use when proxying https:// URLs +# +# The versions of SSL/TLS supported: +# +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +#Default: +# automatic SSL/TLS version negotiation + +# TAG: sslproxy_options +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Colon (:) or comma (,) separated list of SSL implementation options +# to use when proxying https:// URLs +# +# The most important being: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using temporary/ephemeral +# DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds suggested as "harmless" +# by OpenSSL. Be warned that this may reduce SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# complete list of possible options. +# +# WARNING: This directive takes a single token. If a space is used +# the value(s) after that space are SILENTLY IGNORED. +#Default: +# none + +# TAG: sslproxy_cipher +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL cipher list to use when proxying https:// URLs +# +# Colon separated list of supported ciphers. +#Default: +# none + +# TAG: sslproxy_cafile +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# file containing CA certificates to use when verifying server +# certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_capath +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# directory containing CA certificates to use when verifying +# server certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_session_ttl +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the timeout value for SSL sessions +#Default: +# sslproxy_session_ttl 300 + +# TAG: sslproxy_session_cache_size +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the cache size to use for ssl session +#Default: +# sslproxy_session_cache_size 2 MB + +# TAG: sslproxy_foreign_intermediate_certs +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Many origin servers fail to send their full server certificate +# chain for verification, assuming the client already has or can +# easily locate any missing intermediate certificates. +# +# Squid uses the certificates from the specified file to fill in +# these missing chains when trying to validate origin server +# certificate chains. +# +# The file is expected to contain zero or more PEM-encoded +# intermediate certificates. These certificates are not treated +# as trusted root certificates, and any self-signed certificate in +# this file will be ignored. +#Default: +# none + +# TAG: sslproxy_cert_sign_hash +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the hashing algorithm to use when signing generated certificates. +# Valid algorithm names depend on the OpenSSL library used. The following +# names are usually available: sha1, sha256, sha512, and md5. Please see +# your OpenSSL library manual for the available hashes. By default, Squids +# that support this option use sha256 hashes. +# +# Squid does not forcefully purge cached certificates that were generated +# with an algorithm other than the currently configured one. They remain +# in the cache, subject to the regular cache eviction policy, and become +# useful if the algorithm changes again. +#Default: +# none + +# TAG: ssl_bump +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# This option is consulted when a CONNECT request is received on +# an http_port (or a new connection is intercepted at an +# https_port), provided that port was configured with an ssl-bump +# flag. The subsequent data on the connection is either treated as +# HTTPS and decrypted OR tunneled at TCP level without decryption, +# depending on the first matching bumping "action". +# +# ssl_bump [!]acl ... +# +# The following bumping actions are currently supported: +# +# splice +# Become a TCP tunnel without decrypting proxied traffic. +# This is the default action. +# +# bump +# When used on step SslBump1, establishes a secure connection +# with the client first, then connect to the server. +# When used on step SslBump2 or SslBump3, establishes a secure +# connection with the server and, using a mimicked server +# certificate, with the client. +# +# peek +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of splicing the +# connection. Peeking at the server certificate (during step 2) +# usually precludes bumping of the connection at step 3. +# +# stare +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of bumping the +# connection. Staring at the server certificate (during step 2) +# usually precludes splicing of the connection at step 3. +# +# terminate +# Close client and server connections. +# +# Backward compatibility actions available at step SslBump1: +# +# client-first +# Bump the connection. Establish a secure connection with the +# client first, then connect to the server. This old mode does +# not allow Squid to mimic server SSL certificate and does not +# work with intercepted SSL connections. +# +# server-first +# Bump the connection. Establish a secure connection with the +# server first, then establish a secure connection with the +# client, using a mimicked server certificate. Works with both +# CONNECT requests and intercepted SSL connections, but does +# not allow to make decisions based on SSL handshake info. +# +# peek-and-splice +# Decide whether to bump or splice the connection based on +# client-to-squid and server-to-squid SSL hello messages. +# XXX: Remove. +# +# none +# Same as the "splice" action. +# +# All ssl_bump rules are evaluated at each of the supported bumping +# steps. Rules with actions that are impossible at the current step are +# ignored. The first matching ssl_bump action wins and is applied at the +# end of the current step. If no rules match, the splice action is used. +# See the at_step ACL for a list of the supported SslBump steps. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also: http_port ssl-bump, https_port ssl-bump, and acl at_step. +# +# +# # Example: Bump all TLS connections except those originating from +# # localhost or those going to example.com. +# +# acl broken_sites ssl::server_name .example.com +# ssl_bump splice localhost +# ssl_bump splice broken_sites +# ssl_bump bump all +#Default: +# Become a TCP tunnel without decrypting proxied traffic. + +# TAG: sslproxy_flags +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Various flags modifying the use of SSL while proxying https:// URLs: +# DONT_VERIFY_PEER Accept certificates that fail verification. +# For refined control, see sslproxy_cert_error. +# NO_DEFAULT_CA Don't use the default CA list built in +# to OpenSSL. +#Default: +# none + +# TAG: sslproxy_cert_error +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Use this ACL to bypass server certificate validation errors. +# +# For example, the following lines will bypass all validation errors +# when talking to servers for example.com. All other +# validation errors will result in ERR_SECURE_CONNECT_FAIL error. +# +# acl BrokenButTrustedServers dstdomain example.com +# sslproxy_cert_error allow BrokenButTrustedServers +# sslproxy_cert_error deny all +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Using slow acl types may result in server crashes +# +# Without this option, all server certificate validation errors +# terminate the transaction to protect Squid and the client. +# +# SQUID_X509_V_ERR_INFINITE_VALIDATION error cannot be bypassed +# but should not happen unless your OpenSSL library is buggy. +# +# SECURITY WARNING: +# Bypassing validation errors is dangerous because an +# error usually implies that the server cannot be trusted +# and the connection may be insecure. +# +# See also: sslproxy_flags and DONT_VERIFY_PEER. +#Default: +# Server certificate errors terminate the transaction. + +# TAG: sslproxy_cert_sign +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_sign acl ... +# +# The following certificate signing algorithms are supported: +# +# signTrusted +# Sign using the configured CA certificate which is usually +# placed in and trusted by end-user browsers. This is the +# default for trusted origin server certificates. +# +# signUntrusted +# Sign to guarantee an X509_V_ERR_CERT_UNTRUSTED browser error. +# This is the default for untrusted origin server certificates +# that are not self-signed (see ssl::certUntrusted). +# +# signSelf +# Sign using a self-signed certificate with the right CN to +# generate a X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT error in the +# browser. This is the default for self-signed origin server +# certificates (see ssl::certSelfSigned). +# +# This clause only supports fast acl types. +# +# When sslproxy_cert_sign acl(s) match, Squid uses the corresponding +# signing algorithm to generate the certificate and ignores all +# subsequent sslproxy_cert_sign options (the first match wins). If no +# acl(s) match, the default signing algorithm is determined by errors +# detected when obtaining and validating the origin server certificate. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslproxy_cert_adapt +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_adapt acl ... +# +# The following certificate adaptation algorithms are supported: +# +# setValidAfter +# Sets the "Not After" property to the "Not After" property of +# the CA certificate used to sign generated certificates. +# +# setValidBefore +# Sets the "Not Before" property to the "Not Before" property of +# the CA certificate used to sign generated certificates. +# +# setCommonName or setCommonName{CN} +# Sets Subject.CN property to the host name specified as a +# CN parameter or, if no explicit CN parameter was specified, +# extracted from the CONNECT request. It is a misconfiguration +# to use setCommonName without an explicit parameter for +# intercepted or tproxied SSL connections. +# +# This clause only supports fast acl types. +# +# Squid first groups sslproxy_cert_adapt options by adaptation algorithm. +# Within a group, when sslproxy_cert_adapt acl(s) match, Squid uses the +# corresponding adaptation algorithm to generate the certificate and +# ignores all subsequent sslproxy_cert_adapt options in that algorithm's +# group (i.e., the first match wins within each algorithm group). If no +# acl(s) match, the default mimicking action takes place. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslpassword_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify a program used for entering SSL key passphrases +# when using encrypted SSL certificate keys. If not specified +# keys must either be unencrypted, or Squid started with the -N +# option to allow it to query interactively for the passphrase. +# +# The key file name is given as argument to the program allowing +# selection of the right password if you have multiple encrypted +# keys. +#Default: +# none + +# OPTIONS RELATING TO EXTERNAL SSL_CRTD +# ----------------------------------------------------------------------------- + +# TAG: sslcrtd_program +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# Specify the location and options of the executable for ssl_crtd process. +# /usr/lib/squid/ssl_crtd program requires -s and -M parameters +# For more information use: +# /usr/lib/squid/ssl_crtd -h +#Default: +# sslcrtd_program /usr/lib/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB + +# TAG: sslcrtd_children +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# The maximum number of processes spawn to service ssl server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# You must have at least one ssl_crtd process. +#Default: +# sslcrtd_children 32 startup=5 idle=1 + +# TAG: sslcrtvalidator_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify the location and options of the executable for ssl_crt_validator +# process. +# +# Usage: sslcrtvalidator_program [ttl=n] [cache=n] path ... +# +# Options: +# ttl=n TTL in seconds for cached results. The default is 60 secs +# cache=n limit the result cache size. The default value is 2048 +#Default: +# none + +# TAG: sslcrtvalidator_children +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The maximum number of processes spawn to service SSL server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each certificate validator helper can handle in +# parallel. A value of 0 indicates the certficate validator does not +# support concurrency. Defaults to 1. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# a request ID in front of the request/response. The request +# ID from the request must be echoed back with the response +# to that request. +# +# You must have at least one ssl_crt_validator process. +#Default: +# sslcrtvalidator_children 32 startup=5 idle=1 concurrency=1 + +# OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM +# ----------------------------------------------------------------------------- + +# TAG: cache_peer +# To specify other caches in a hierarchy, use the format: +# +# cache_peer hostname type http-port icp-port [options] +# +# For example, +# +# # proxy icp +# # hostname type port port options +# # -------------------- -------- ----- ----- ----------- +# cache_peer parent.foo.net parent 3128 3130 default +# cache_peer sib1.foo.net sibling 3128 3130 proxy-only +# cache_peer sib2.foo.net sibling 3128 3130 proxy-only +# cache_peer example.com parent 80 0 default +# cache_peer cdn.example.com sibling 3128 0 +# +# type: either 'parent', 'sibling', or 'multicast'. +# +# proxy-port: The port number where the peer accept HTTP requests. +# For other Squid proxies this is usually 3128 +# For web servers this is usually 80 +# +# icp-port: Used for querying neighbor caches about objects. +# Set to 0 if the peer does not support ICP or HTCP. +# See ICP and HTCP options below for additional details. +# +# +# ==== ICP OPTIONS ==== +# +# You MUST also set icp_port and icp_access explicitly when using these options. +# The defaults will prevent peer traffic using ICP. +# +# +# no-query Disable ICP queries to this neighbor. +# +# multicast-responder +# Indicates the named peer is a member of a multicast group. +# ICP queries will not be sent directly to the peer, but ICP +# replies will be accepted from it. +# +# closest-only Indicates that, for ICP_OP_MISS replies, we'll only forward +# CLOSEST_PARENT_MISSes and never FIRST_PARENT_MISSes. +# +# background-ping +# To only send ICP queries to this neighbor infrequently. +# This is used to keep the neighbor round trip time updated +# and is usually used in conjunction with weighted-round-robin. +# +# +# ==== HTCP OPTIONS ==== +# +# You MUST also set htcp_port and htcp_access explicitly when using these options. +# The defaults will prevent peer traffic using HTCP. +# +# +# htcp Send HTCP, instead of ICP, queries to the neighbor. +# You probably also want to set the "icp-port" to 4827 +# instead of 3130. This directive accepts a comma separated +# list of options described below. +# +# htcp=oldsquid Send HTCP to old Squid versions (2.5 or earlier). +# +# htcp=no-clr Send HTCP to the neighbor but without +# sending any CLR requests. This cannot be used with +# only-clr. +# +# htcp=only-clr Send HTCP to the neighbor but ONLY CLR requests. +# This cannot be used with no-clr. +# +# htcp=no-purge-clr +# Send HTCP to the neighbor including CLRs but only when +# they do not result from PURGE requests. +# +# htcp=forward-clr +# Forward any HTCP CLR requests this proxy receives to the peer. +# +# +# ==== PEER SELECTION METHODS ==== +# +# The default peer selection method is ICP, with the first responding peer +# being used as source. These options can be used for better load balancing. +# +# +# default This is a parent cache which can be used as a "last-resort" +# if a peer cannot be located by any of the peer-selection methods. +# If specified more than once, only the first is used. +# +# round-robin Load-Balance parents which should be used in a round-robin +# fashion in the absence of any ICP queries. +# weight=N can be used to add bias. +# +# weighted-round-robin +# Load-Balance parents which should be used in a round-robin +# fashion with the frequency of each parent being based on the +# round trip time. Closer parents are used more often. +# Usually used for background-ping parents. +# weight=N can be used to add bias. +# +# carp Load-Balance parents which should be used as a CARP array. +# The requests will be distributed among the parents based on the +# CARP load balancing hash function based on their weight. +# +# userhash Load-balance parents based on the client proxy_auth or ident username. +# +# sourcehash Load-balance parents based on the client source IP. +# +# multicast-siblings +# To be used only for cache peers of type "multicast". +# ALL members of this multicast group have "sibling" +# relationship with it, not "parent". This is to a multicast +# group when the requested object would be fetched only from +# a "parent" cache, anyway. It's useful, e.g., when +# configuring a pool of redundant Squid proxies, being +# members of the same multicast group. +# +# +# ==== PEER SELECTION OPTIONS ==== +# +# weight=N use to affect the selection of a peer during any weighted +# peer-selection mechanisms. +# The weight must be an integer; default is 1, +# larger weights are favored more. +# This option does not affect parent selection if a peering +# protocol is not in use. +# +# basetime=N Specify a base amount to be subtracted from round trip +# times of parents. +# It is subtracted before division by weight in calculating +# which parent to fectch from. If the rtt is less than the +# base time the rtt is set to a minimal value. +# +# ttl=N Specify a TTL to use when sending multicast ICP queries +# to this address. +# Only useful when sending to a multicast group. +# Because we don't accept ICP replies from random +# hosts, you must configure other group members as +# peers with the 'multicast-responder' option. +# +# no-delay To prevent access to this neighbor from influencing the +# delay pools. +# +# digest-url=URL Tell Squid to fetch the cache digest (if digests are +# enabled) for this host from the specified URL rather +# than the Squid default location. +# +# +# ==== CARP OPTIONS ==== +# +# carp-key=key-specification +# use a different key than the full URL to hash against the peer. +# the key-specification is a comma-separated list of the keywords +# scheme, host, port, path, params +# Order is not important. +# +# ==== ACCELERATOR / REVERSE-PROXY OPTIONS ==== +# +# originserver Causes this parent to be contacted as an origin server. +# Meant to be used in accelerator setups when the peer +# is a web server. +# +# forceddomain=name +# Set the Host header of requests forwarded to this peer. +# Useful in accelerator setups where the server (peer) +# expects a certain domain name but clients may request +# others. ie example.com or www.example.com +# +# no-digest Disable request of cache digests. +# +# no-netdb-exchange +# Disables requesting ICMP RTT database (NetDB). +# +# +# ==== AUTHENTICATION OPTIONS ==== +# +# login=user:password +# If this is a personal/workgroup proxy and your parent +# requires proxy authentication. +# +# Note: The string can include URL escapes (i.e. %20 for +# spaces). This also means % must be written as %%. +# +# login=PASSTHRU +# Send login details received from client to this peer. +# Both Proxy- and WWW-Authorization headers are passed +# without alteration to the peer. +# Authentication is not required by Squid for this to work. +# +# Note: This will pass any form of authentication but +# only Basic auth will work through a proxy unless the +# connection-auth options are also used. +# +# login=PASS Send login details received from client to this peer. +# Authentication is not required by this option. +# +# If there are no client-provided authentication headers +# to pass on, but username and password are available +# from an external ACL user= and password= result tags +# they may be sent instead. +# +# Note: To combine this with proxy_auth both proxies must +# share the same user database as HTTP only allows for +# a single login (one for proxy, one for origin server). +# Also be warned this will expose your users proxy +# password to the peer. USE WITH CAUTION +# +# login=*:password +# Send the username to the upstream cache, but with a +# fixed password. This is meant to be used when the peer +# is in another administrative domain, but it is still +# needed to identify each user. +# The star can optionally be followed by some extra +# information which is added to the username. This can +# be used to identify this proxy to the peer, similar to +# the login=username:password option above. +# +# login=NEGOTIATE +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The first principal from the default keytab or defined by +# the environment variable KRB5_KTNAME will be used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# login=NEGOTIATE:principal_name +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The principal principal_name from the default keytab or +# defined by the environment variable KRB5_KTNAME will be +# used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# connection-auth=on|off +# Tell Squid that this peer does or not support Microsoft +# connection oriented authentication, and any such +# challenges received from there should be ignored. +# Default is auto to automatically determine the status +# of the peer. +# +# +# ==== SSL / HTTPS / TLS OPTIONS ==== +# +# ssl Encrypt connections to this peer with SSL/TLS. +# +# sslcert=/path/to/ssl/certificate +# A client SSL certificate to use when connecting to +# this peer. +# +# sslkey=/path/to/ssl/key +# The private SSL key corresponding to sslcert above. +# If 'sslkey' is not specified 'sslcert' is assumed to +# reference a combined file containing both the +# certificate and the key. +# +# Notes: +# +# On Debian/Ubuntu systems a default snakeoil certificate is +# available in /etc/ssl and users can set: +# +# cert=/etc/ssl/certs/ssl-cert-snakeoil.pem +# +# and +# +# key=/etc/ssl/private/ssl-cert-snakeoil.key +# +# for testing. +# +# sslversion=1|2|3|4|5|6 +# The SSL version to use when connecting to this peer +# 1 = automatic (default) +# 2 = SSL v2 only +# 3 = SSL v3 only +# 4 = TLS v1.0 only +# 5 = TLS v1.1 only +# 6 = TLS v1.2 only +# +# sslcipher=... The list of valid SSL ciphers to use when connecting +# to this peer. +# +# ssloptions=... Specify various SSL implementation options: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# more complete list. +# +# sslcafile=... A file containing additional CA certificates to use +# when verifying the peer certificate. +# +# sslcapath=... A directory containing additional CA certificates to +# use when verifying the peer certificate. +# +# sslcrlfile=... A certificate revocation list file to use when +# verifying the peer certificate. +# +# sslflags=... Specify various flags modifying the SSL implementation: +# +# DONT_VERIFY_PEER +# Accept certificates even if they fail to +# verify. +# NO_DEFAULT_CA +# Don't use the default CA list built in +# to OpenSSL. +# DONT_VERIFY_DOMAIN +# Don't verify the peer certificate +# matches the server name +# +# ssldomain= The peer name as advertised in it's certificate. +# Used for verifying the correctness of the received peer +# certificate. If not specified the peer hostname will be +# used. +# +# front-end-https +# Enable the "Front-End-Https: On" header needed when +# using Squid as a SSL frontend in front of Microsoft OWA. +# See MS KB document Q307347 for details on this header. +# If set to auto the header will only be added if the +# request is forwarded as a https:// URL. +# +# +# ==== GENERAL OPTIONS ==== +# +# connect-timeout=N +# A peer-specific connect timeout. +# Also see the peer_connect_timeout directive. +# +# connect-fail-limit=N +# How many times connecting to a peer must fail before +# it is marked as down. Standby connection failures +# count towards this limit. Default is 10. +# +# allow-miss Disable Squid's use of only-if-cached when forwarding +# requests to siblings. This is primarily useful when +# icp_hit_stale is used by the sibling. Excessive use +# of this option may result in forwarding loops. One way +# to prevent peering loops when using this option, is to +# deny cache peer usage on requests from a peer: +# acl fromPeer ... +# cache_peer_access peerName deny fromPeer +# +# max-conn=N Limit the number of concurrent connections the Squid +# may open to this peer, including already opened idle +# and standby connections. There is no peer-specific +# connection limit by default. +# +# A peer exceeding the limit is not used for new +# requests unless a standby connection is available. +# +# max-conn currently works poorly with idle persistent +# connections: When a peer reaches its max-conn limit, +# and there are idle persistent connections to the peer, +# the peer may not be selected because the limiting code +# does not know whether Squid can reuse those idle +# connections. +# +# standby=N Maintain a pool of N "hot standby" connections to an +# UP peer, available for requests when no idle +# persistent connection is available (or safe) to use. +# By default and with zero N, no such pool is maintained. +# N must not exceed the max-conn limit (if any). +# +# At start or after reconfiguration, Squid opens new TCP +# standby connections until there are N connections +# available and then replenishes the standby pool as +# opened connections are used up for requests. A used +# connection never goes back to the standby pool, but +# may go to the regular idle persistent connection pool +# shared by all peers and origin servers. +# +# Squid never opens multiple new standby connections +# concurrently. This one-at-a-time approach minimizes +# flooding-like effect on peers. Furthermore, just a few +# standby connections should be sufficient in most cases +# to supply most new requests with a ready-to-use +# connection. +# +# Standby connections obey server_idle_pconn_timeout. +# For the feature to work as intended, the peer must be +# configured to accept and keep them open longer than +# the idle timeout at the connecting Squid, to minimize +# race conditions typical to idle used persistent +# connections. Default request_timeout and +# server_idle_pconn_timeout values ensure such a +# configuration. +# +# name=xxx Unique name for the peer. +# Required if you have multiple peers on the same host +# but different ports. +# This name can be used in cache_peer_access and similar +# directives to identify the peer. +# Can be used by outgoing access controls through the +# peername ACL type. +# +# no-tproxy Do not use the client-spoof TPROXY support when forwarding +# requests to this peer. Use normal address selection instead. +# This overrides the spoof_client_ip ACL. +# +# proxy-only objects fetched from the peer will not be stored locally. +# +#Default: +# none + +# TAG: cache_peer_domain +# Use to limit the domains for which a neighbor cache will be +# queried. +# +# Usage: +# cache_peer_domain cache-host domain [domain ...] +# cache_peer_domain cache-host !domain +# +# For example, specifying +# +# cache_peer_domain parent.foo.net .edu +# +# has the effect such that UDP query packets are sent to +# 'bigserver' only when the requested object exists on a +# server in the .edu domain. Prefixing the domainname +# with '!' means the cache will be queried for objects +# NOT in that domain. +# +# NOTE: * Any number of domains may be given for a cache-host, +# either on the same or separate lines. +# * When multiple domains are given for a particular +# cache-host, the first matched domain is applied. +# * Cache hosts with no domain restrictions are queried +# for all requests. +# * There are no defaults. +# * There is also a 'cache_peer_access' tag in the ACL +# section. +#Default: +# none + +# TAG: cache_peer_access +# Restricts usage of cache_peer proxies. +# +# Usage: +# cache_peer_access peer-name allow|deny [!]aclname ... +# +# For the required peer-name parameter, use either the value of the +# cache_peer name=value parameter or, if name=value is missing, the +# cache_peer hostname parameter. +# +# This directive narrows down the selection of peering candidates, but +# does not determine the order in which the selected candidates are +# contacted. That order is determined by the peer selection algorithms +# (see PEER SELECTION sections in the cache_peer documentation). +# +# If a deny rule matches, the corresponding peer will not be contacted +# for the current transaction -- Squid will not send ICP queries and +# will not forward HTTP requests to that peer. An allow match leaves +# the corresponding peer in the selection. The first match for a given +# peer wins for that peer. +# +# The relative order of cache_peer_access directives for the same peer +# matters. The relative order of any two cache_peer_access directives +# for different peers does not matter. To ease interpretation, it is a +# good idea to group cache_peer_access directives for the same peer +# together. +# +# A single cache_peer_access directive may be evaluated multiple times +# for a given transaction because individual peer selection algorithms +# may check it independently from each other. These redundant checks +# may be optimized away in future Squid versions. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# No peer usage restrictions. + +# TAG: neighbor_type_domain +# Modify the cache_peer neighbor type when passing requests +# about specific domains to the peer. +# +# Usage: +# neighbor_type_domain neighbor parent|sibling domain domain ... +# +# For example: +# cache_peer foo.example.com parent 3128 3130 +# neighbor_type_domain foo.example.com sibling .au .de +# +# The above configuration treats all requests to foo.example.com as a +# parent proxy unless the request is for a .au or .de ccTLD domain name. +#Default: +# The peer type from cache_peer directive is used for all requests to that peer. + +# TAG: dead_peer_timeout (seconds) +# This controls how long Squid waits to declare a peer cache +# as "dead." If there are no ICP replies received in this +# amount of time, Squid will declare the peer dead and not +# expect to receive any further ICP replies. However, it +# continues to send ICP queries, and will mark the peer as +# alive upon receipt of the first subsequent ICP reply. +# +# This timeout also affects when Squid expects to receive ICP +# replies from peers. If more than 'dead_peer' seconds have +# passed since the last ICP reply was received, Squid will not +# expect to receive an ICP reply on the next query. Thus, if +# your time between requests is greater than this timeout, you +# will see a lot of requests sent DIRECT to origin servers +# instead of to your parents. +#Default: +# dead_peer_timeout 10 seconds + +# TAG: forward_max_tries +# Controls how many different forward paths Squid will try +# before giving up. See also forward_timeout. +# +# NOTE: connect_retries (default: none) can make each of these +# possible forwarding paths be tried multiple times. +#Default: +# forward_max_tries 25 + +# MEMORY CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_mem (bytes) +# NOTE: THIS PARAMETER DOES NOT SPECIFY THE MAXIMUM PROCESS SIZE. +# IT ONLY PLACES A LIMIT ON HOW MUCH ADDITIONAL MEMORY SQUID WILL +# USE AS A MEMORY CACHE OF OBJECTS. SQUID USES MEMORY FOR OTHER +# THINGS AS WELL. SEE THE SQUID FAQ SECTION 8 FOR DETAILS. +# +# 'cache_mem' specifies the ideal amount of memory to be used +# for: +# * In-Transit objects +# * Hot Objects +# * Negative-Cached objects +# +# Data for these objects are stored in 4 KB blocks. This +# parameter specifies the ideal upper limit on the total size of +# 4 KB blocks allocated. In-Transit objects take the highest +# priority. +# +# In-transit objects have priority over the others. When +# additional space is needed for incoming data, negative-cached +# and hot objects will be released. In other words, the +# negative-cached and hot objects will fill up any unused space +# not needed for in-transit objects. +# +# If circumstances require, this limit will be exceeded. +# Specifically, if your incoming request rate requires more than +# 'cache_mem' of memory to hold in-transit objects, Squid will +# exceed this limit to satisfy the new requests. When the load +# decreases, blocks will be freed until the high-water mark is +# reached. Thereafter, blocks will be used to store hot +# objects. +# +# If shared memory caching is enabled, Squid does not use the shared +# cache space for in-transit objects, but they still consume as much +# local memory as they need. For more details about the shared memory +# cache, see memory_cache_shared. +#Default: +# cache_mem 256 MB + +# TAG: maximum_object_size_in_memory (bytes) +# Objects greater than this size will not be attempted to kept in +# the memory cache. This should be set high enough to keep objects +# accessed frequently in memory to improve performance whilst low +# enough to keep larger objects from hoarding cache_mem. +#Default: +# maximum_object_size_in_memory 512 KB + +# TAG: memory_cache_shared on|off +# Controls whether the memory cache is shared among SMP workers. +# +# The shared memory cache is meant to occupy cache_mem bytes and replace +# the non-shared memory cache, although some entities may still be +# cached locally by workers for now (e.g., internal and in-transit +# objects may be served from a local memory cache even if shared memory +# caching is enabled). +# +# By default, the memory cache is shared if and only if all of the +# following conditions are satisfied: Squid runs in SMP mode with +# multiple workers, cache_mem is positive, and Squid environment +# supports required IPC primitives (e.g., POSIX shared memory segments +# and GCC-style atomic operations). +# +# To avoid blocking locks, shared memory uses opportunistic algorithms +# that do not guarantee that every cachable entity that could have been +# shared among SMP workers will actually be shared. +#Default: +# "on" where supported if doing memory caching with multiple SMP workers. + +# TAG: memory_cache_mode +# Controls which objects to keep in the memory cache (cache_mem) +# +# always Keep most recently fetched objects in memory (default) +# +# disk Only disk cache hits are kept in memory, which means +# an object must first be cached on disk and then hit +# a second time before cached in memory. +# +# network Only objects fetched from network is kept in memory +#Default: +# Keep the most recently fetched objects in memory + +# TAG: memory_replacement_policy +# The memory replacement policy parameter determines which +# objects are purged from memory when memory space is needed. +# +# See cache_replacement_policy for details on algorithms. +#Default: +# memory_replacement_policy lru + +# DISK CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_replacement_policy +# The cache replacement policy parameter determines which +# objects are evicted (replaced) when disk space is needed. +# +# lru : Squid's original list based LRU policy +# heap GDSF : Greedy-Dual Size Frequency +# heap LFUDA: Least Frequently Used with Dynamic Aging +# heap LRU : LRU policy implemented using a heap +# +# Applies to any cache_dir lines listed below this directive. +# +# The LRU policies keeps recently referenced objects. +# +# The heap GDSF policy optimizes object hit rate by keeping smaller +# popular objects in cache so it has a better chance of getting a +# hit. It achieves a lower byte hit rate than LFUDA though since +# it evicts larger (possibly popular) objects. +# +# The heap LFUDA policy keeps popular objects in cache regardless of +# their size and thus optimizes byte hit rate at the expense of +# hit rate since one large, popular object will prevent many +# smaller, slightly less popular objects from being cached. +# +# Both policies utilize a dynamic aging mechanism that prevents +# cache pollution that can otherwise occur with frequency-based +# replacement policies. +# +# NOTE: if using the LFUDA replacement policy you should increase +# the value of maximum_object_size above its default of 4 MB to +# to maximize the potential byte hit rate improvement of LFUDA. +# +# For more information about the GDSF and LFUDA cache replacement +# policies see http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html +# and http://fog.hpl.external.hp.com/techreports/98/HPL-98-173.html. +#Default: +# cache_replacement_policy lru + +# TAG: minimum_object_size (bytes) +# Objects smaller than this size will NOT be saved on disk. The +# value is specified in bytes, and the default is 0 KB, which +# means all responses can be stored. +#Default: +# no limit + +# TAG: maximum_object_size (bytes) +# Set the default value for max-size parameter on any cache_dir. +# The value is specified in bytes, and the default is 4 MB. +# +# If you wish to get a high BYTES hit ratio, you should probably +# increase this (one 32 MB object hit counts for 3200 10KB +# hits). +# +# If you wish to increase hit ratio more than you want to +# save bandwidth you should leave this low. +# +# NOTE: if using the LFUDA replacement policy you should increase +# this value to maximize the byte hit rate improvement of LFUDA! +# See cache_replacement_policy for a discussion of this policy. +#Default: +# maximum_object_size 4 MB + +# TAG: cache_dir +# Format: +# cache_dir Type Directory-Name Fs-specific-data [options] +# +# You can specify multiple cache_dir lines to spread the +# cache among different disk partitions. +# +# Type specifies the kind of storage system to use. Only "ufs" +# is built by default. To enable any of the other storage systems +# see the --enable-storeio configure option. +# +# 'Directory' is a top-level directory where cache swap +# files will be stored. If you want to use an entire disk +# for caching, this can be the mount-point directory. +# The directory must exist and be writable by the Squid +# process. Squid will NOT create this directory for you. +# +# In SMP configurations, cache_dir must not precede the workers option +# and should use configuration macros or conditionals to give each +# worker interested in disk caching a dedicated cache directory. +# +# +# ==== The ufs store type ==== +# +# "ufs" is the old well-known Squid storage format that has always +# been there. +# +# Usage: +# cache_dir ufs Directory-Name Mbytes L1 L2 [options] +# +# 'Mbytes' is the amount of disk space (MB) to use under this +# directory. The default is 100 MB. Change this to suit your +# configuration. Do NOT put the size of your disk drive here. +# Instead, if you want Squid to use the entire disk drive, +# subtract 20% and use that value. +# +# 'L1' is the number of first-level subdirectories which +# will be created under the 'Directory'. The default is 16. +# +# 'L2' is the number of second-level subdirectories which +# will be created under each first-level directory. The default +# is 256. +# +# +# ==== The aufs store type ==== +# +# "aufs" uses the same storage format as "ufs", utilizing +# POSIX-threads to avoid blocking the main Squid process on +# disk-I/O. This was formerly known in Squid as async-io. +# +# Usage: +# cache_dir aufs Directory-Name Mbytes L1 L2 [options] +# +# see argument descriptions under ufs above +# +# +# ==== The diskd store type ==== +# +# "diskd" uses the same storage format as "ufs", utilizing a +# separate process to avoid blocking the main Squid process on +# disk-I/O. +# +# Usage: +# cache_dir diskd Directory-Name Mbytes L1 L2 [options] [Q1=n] [Q2=n] +# +# see argument descriptions under ufs above +# +# Q1 specifies the number of unacknowledged I/O requests when Squid +# stops opening new files. If this many messages are in the queues, +# Squid won't open new files. Default is 64 +# +# Q2 specifies the number of unacknowledged messages when Squid +# starts blocking. If this many messages are in the queues, +# Squid blocks until it receives some replies. Default is 72 +# +# When Q1 < Q2 (the default), the cache directory is optimized +# for lower response time at the expense of a decrease in hit +# ratio. If Q1 > Q2, the cache directory is optimized for +# higher hit ratio at the expense of an increase in response +# time. +# +# +# ==== The rock store type ==== +# +# Usage: +# cache_dir rock Directory-Name Mbytes [options] +# +# The Rock Store type is a database-style storage. All cached +# entries are stored in a "database" file, using fixed-size slots. +# A single entry occupies one or more slots. +# +# If possible, Squid using Rock Store creates a dedicated kid +# process called "disker" to avoid blocking Squid worker(s) on disk +# I/O. One disker kid is created for each rock cache_dir. Diskers +# are created only when Squid, running in daemon mode, has support +# for the IpcIo disk I/O module. +# +# swap-timeout=msec: Squid will not start writing a miss to or +# reading a hit from disk if it estimates that the swap operation +# will take more than the specified number of milliseconds. By +# default and when set to zero, disables the disk I/O time limit +# enforcement. Ignored when using blocking I/O module because +# blocking synchronous I/O does not allow Squid to estimate the +# expected swap wait time. +# +# max-swap-rate=swaps/sec: Artificially limits disk access using +# the specified I/O rate limit. Swap out requests that +# would cause the average I/O rate to exceed the limit are +# delayed. Individual swap in requests (i.e., hits or reads) are +# not delayed, but they do contribute to measured swap rate and +# since they are placed in the same FIFO queue as swap out +# requests, they may wait longer if max-swap-rate is smaller. +# This is necessary on file systems that buffer "too +# many" writes and then start blocking Squid and other processes +# while committing those writes to disk. Usually used together +# with swap-timeout to avoid excessive delays and queue overflows +# when disk demand exceeds available disk "bandwidth". By default +# and when set to zero, disables the disk I/O rate limit +# enforcement. Currently supported by IpcIo module only. +# +# slot-size=bytes: The size of a database "record" used for +# storing cached responses. A cached response occupies at least +# one slot and all database I/O is done using individual slots so +# increasing this parameter leads to more disk space waste while +# decreasing it leads to more disk I/O overheads. Should be a +# multiple of your operating system I/O page size. Defaults to +# 16KBytes. A housekeeping header is stored with each slot and +# smaller slot-sizes will be rejected. The header is smaller than +# 100 bytes. +# +# +# ==== COMMON OPTIONS ==== +# +# no-store no new objects should be stored to this cache_dir. +# +# min-size=n the minimum object size in bytes this cache_dir +# will accept. It's used to restrict a cache_dir +# to only store large objects (e.g. AUFS) while +# other stores are optimized for smaller objects +# (e.g. Rock). +# Defaults to 0. +# +# max-size=n the maximum object size in bytes this cache_dir +# supports. +# The value in maximum_object_size directive sets +# the default unless more specific details are +# available (ie a small store capacity). +# +# Note: To make optimal use of the max-size limits you should order +# the cache_dir lines with the smallest max-size value first. +# +#Default: +# No disk cache. Store cache ojects only in memory. +# + +# Uncomment and adjust the following to add a disk cache directory. +#cache_dir ufs /var/spool/squid 100 16 256 + +# TAG: store_dir_select_algorithm +# How Squid selects which cache_dir to use when the response +# object will fit into more than one. +# +# Regardless of which algorithm is used the cache_dir min-size +# and max-size parameters are obeyed. As such they can affect +# the selection algorithm by limiting the set of considered +# cache_dir. +# +# Algorithms: +# +# least-load +# +# This algorithm is suited to caches with similar cache_dir +# sizes and disk speeds. +# +# The disk with the least I/O pending is selected. +# When there are multiple disks with the same I/O load ranking +# the cache_dir with most available capacity is selected. +# +# When a mix of cache_dir sizes are configured the faster disks +# have a naturally lower I/O loading and larger disks have more +# capacity. So space used to store objects and data throughput +# may be very unbalanced towards larger disks. +# +# +# round-robin +# +# This algorithm is suited to caches with unequal cache_dir +# disk sizes. +# +# Each cache_dir is selected in a rotation. The next suitable +# cache_dir is used. +# +# Available cache_dir capacity is only considered in relation +# to whether the object will fit and meets the min-size and +# max-size parameters. +# +# Disk I/O loading is only considered to prevent overload on slow +# disks. This algorithm does not spread objects by size, so any +# I/O loading per-disk may appear very unbalanced and volatile. +# +# If several cache_dirs use similar min-size, max-size, or other +# limits to to reject certain responses, then do not group such +# cache_dir lines together, to avoid round-robin selection bias +# towards the first cache_dir after the group. Instead, interleave +# cache_dir lines from different groups. For example: +# +# store_dir_select_algorithm round-robin +# cache_dir rock /hdd1 ... min-size=100000 +# cache_dir rock /ssd1 ... max-size=99999 +# cache_dir rock /hdd2 ... min-size=100000 +# cache_dir rock /ssd2 ... max-size=99999 +# cache_dir rock /hdd3 ... min-size=100000 +# cache_dir rock /ssd3 ... max-size=99999 +#Default: +# store_dir_select_algorithm least-load + +# TAG: max_open_disk_fds +# To avoid having disk as the I/O bottleneck Squid can optionally +# bypass the on-disk cache if more than this amount of disk file +# descriptors are open. +# +# A value of 0 indicates no limit. +#Default: +# no limit + +# TAG: cache_swap_low (percent, 0-100) +# The low-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above this low-water mark and attempts to maintain utilization +# near the low-water mark. +# +# As swap utilization increases towards the high-water mark set +# by cache_swap_high object eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_high and cache_replacement_policy +#Default: +# cache_swap_low 90 + +# TAG: cache_swap_high (percent, 0-100) +# The high-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above the low-water mark set by cache_swap_low and attempts to +# maintain utilization near the low-water mark. +# +# As swap utilization increases towards this high-water mark object +# eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_low and cache_replacement_policy +#Default: +# cache_swap_high 95 + +# LOGFILE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: logformat +# Usage: +# +# logformat +# +# Defines an access log format. +# +# The is a string with embedded % format codes +# +# % format codes all follow the same basic structure where all but +# the formatcode is optional. Output strings are automatically escaped +# as required according to their context and the output format +# modifiers are usually not needed, but can be specified if an explicit +# output format is desired. +# +# % ["|[|'|#] [-] [[0]width] [{argument}] formatcode +# +# " output in quoted string format +# [ output in squid text log format as used by log_mime_hdrs +# # output in URL quoted format +# ' output as-is +# +# - left aligned +# +# width minimum and/or maximum field width: +# [width_min][.width_max] +# When minimum starts with 0, the field is zero-padded. +# String values exceeding maximum width are truncated. +# +# {arg} argument such as header name etc +# +# Format codes: +# +# % a literal % character +# sn Unique sequence number per log line entry +# err_code The ID of an error response served by Squid or +# a similar internal error identifier. +# err_detail Additional err_code-dependent error information. +# note The annotation specified by the argument. Also +# logs the adaptation meta headers set by the +# adaptation_meta configuration parameter. +# If no argument given all annotations logged. +# The argument may include a separator to use with +# annotation values: +# name[:separator] +# By default, multiple note values are separated with "," +# and multiple notes are separated with "\r\n". +# When logging named notes with %{name}note, the +# explicitly configured separator is used between note +# values. When logging all notes with %note, the +# explicitly configured separator is used between +# individual notes. There is currently no way to +# specify both value and notes separators when logging +# all notes with %note. +# +# Connection related format codes: +# +# >a Client source IP address +# >A Client FQDN +# >p Client source port +# >eui Client source EUI (MAC address, EUI-48 or EUI-64 identifier) +# >la Local IP address the client connected to +# >lp Local port number the client connected to +# >qos Client connection TOS/DSCP value set by Squid +# >nfmark Client connection netfilter mark set by Squid +# +# la Local listening IP address the client connection was connected to. +# lp Local listening port number the client connection was connected to. +# +# . format. +# Currently, Squid considers the master transaction +# started when a complete HTTP request header initiating +# the transaction is received from the client. This is +# the same value that Squid uses to calculate transaction +# response time when logging %tr to access.log. Currently, +# Squid uses millisecond resolution for %tS values, +# similar to the default access.log "current time" field +# (%ts.%03tu). +# +# Access Control related format codes: +# +# et Tag returned by external acl +# ea Log string returned by external acl +# un User name (any available) +# ul User name from authentication +# ue User name from external acl helper +# ui User name from ident +# un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul +# - user name supplied by an external ACL, like %ue +# - SSL client name, like %us +# - ident user name, like %ui +# credentials Client credentials. The exact meaning depends on +# the authentication scheme: For Basic authentication, +# it is the password; for Digest, the realm sent by the +# client; for NTLM and Negotiate, the client challenge +# or client credentials prefixed with "YR " or "KK ". +# +# HTTP related format codes: +# +# REQUEST +# +# [http::]rm Request method (GET/POST etc) +# [http::]>rm Request method from client +# [http::]ru Request URL from client +# [http::]rs Request URL scheme from client +# [http::]rd Request URL domain from client +# [http::]rP Request URL port from client +# [http::]rp Request URL path excluding hostname from client +# [http::]rv Request protocol version from client +# [http::]h Original received request header. +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Accepts optional header field name/value filter +# argument using name[:[separator]element] format. +# [http::]>ha Received request header after adaptation and +# redirection (pre-cache REQMOD vectoring point). +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Optional header name argument as for >h +# +# +# RESPONSE +# +# [http::]Hs HTTP status code sent to the client +# +# [http::]h +# +# [http::]mt MIME content type +# +# +# SIZE COUNTERS +# +# [http::]st Total size of request + reply traffic with client +# [http::]>st Total size of request received from client. +# Excluding chunked encoding bytes. +# [http::]sh Size of request headers received from client +# [http::]sni SSL client SNI sent to Squid. Available only +# after the peek, stare, or splice SSL bumping +# actions. +# +# If ICAP is enabled, the following code becomes available (as +# well as ICAP log codes documented with the icap_log option): +# +# icap::tt Total ICAP processing time for the HTTP +# transaction. The timer ticks when ICAP +# ACLs are checked and when ICAP +# transaction is in progress. +# +# If adaptation is enabled the following three codes become available: +# +# adapt::cert_subject The Subject field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Subject often has spaces. +# +# %ssl::>cert_issuer The Issuer field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Issuer often has spaces. +# +# The default formats available (which do not need re-defining) are: +# +#logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %h" "%{User-Agent}>h" %Ss:%Sh +#logformat referrer %ts.%03tu %>a %{Referer}>h %ru +#logformat useragent %>a [%tl] "%{User-Agent}>h" +# +# NOTE: When the log_mime_hdrs directive is set to ON. +# The squid, common and combined formats have a safely encoded copy +# of the mime headers appended to each line within a pair of brackets. +# +# NOTE: The common and combined formats are not quite true to the Apache definition. +# The logs from Squid contain an extra status and hierarchy code appended. +# +#Default: +# The format definitions squid, common, combined, referrer, useragent are built in. + +# TAG: access_log +# Configures whether and how Squid logs HTTP and ICP transactions. +# If access logging is enabled, a single line is logged for every +# matching HTTP or ICP request. The recommended directive formats are: +# +# access_log : [option ...] [acl acl ...] +# access_log none [acl acl ...] +# +# The following directive format is accepted but may be deprecated: +# access_log : [ [acl acl ...]] +# +# In most cases, the first ACL name must not contain the '=' character +# and should not be equal to an existing logformat name. You can always +# start with an 'all' ACL to work around those restrictions. +# +# Will log to the specified module:place using the specified format (which +# must be defined in a logformat directive) those entries which match +# ALL the acl's specified (which must be defined in acl clauses). +# If no acl is specified, all requests will be logged to this destination. +# +# ===== Available options for the recommended directive format ===== +# +# logformat=name Names log line format (either built-in or +# defined by a logformat directive). Defaults +# to 'squid'. +# +# buffer-size=64KB Defines approximate buffering limit for log +# records (see buffered_logs). Squid should not +# keep more than the specified size and, hence, +# should flush records before the buffer becomes +# full to avoid overflows under normal +# conditions (the exact flushing algorithm is +# module-dependent though). The on-error option +# controls overflow handling. +# +# on-error=die|drop Defines action on unrecoverable errors. The +# 'drop' action ignores (i.e., does not log) +# affected log records. The default 'die' action +# kills the affected worker. The drop action +# support has not been tested for modules other +# than tcp. +# +# ===== Modules Currently available ===== +# +# none Do not log any requests matching these ACL. +# Do not specify Place or logformat name. +# +# stdio Write each log line to disk immediately at the completion of +# each request. +# Place: the filename and path to be written. +# +# daemon Very similar to stdio. But instead of writing to disk the log +# line is passed to a daemon helper for asychronous handling instead. +# Place: varies depending on the daemon. +# +# log_file_daemon Place: the file name and path to be written. +# +# syslog To log each request via syslog facility. +# Place: The syslog facility and priority level for these entries. +# Place Format: facility.priority +# +# where facility could be any of: +# authpriv, daemon, local0 ... local7 or user. +# +# And priority could be any of: +# err, warning, notice, info, debug. +# +# udp To send each log line as text data to a UDP receiver. +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# tcp To send each log line as text data to a TCP receiver. +# Lines may be accumulated before sending (see buffered_logs). +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# Default: +# access_log daemon:/var/log/squid/access.log squid +#Default: +# access_log daemon:/var/log/squid/access.log squid + +# TAG: icap_log +# ICAP log files record ICAP transaction summaries, one line per +# transaction. +# +# The icap_log option format is: +# icap_log [ [acl acl ...]] +# icap_log none [acl acl ...]] +# +# Please see access_log option documentation for details. The two +# kinds of logs share the overall configuration approach and many +# features. +# +# ICAP processing of a single HTTP message or transaction may +# require multiple ICAP transactions. In such cases, multiple +# ICAP transaction log lines will correspond to a single access +# log line. +# +# ICAP log supports many access.log logformat %codes. In ICAP context, +# HTTP message-related %codes are applied to the HTTP message embedded +# in an ICAP message. Logformat "%http::>..." codes are used for HTTP +# messages embedded in ICAP requests while "%http::<..." codes are used +# for HTTP messages embedded in ICAP responses. For example: +# +# http::>h To-be-adapted HTTP message headers sent by Squid to +# the ICAP service. For REQMOD transactions, these are +# HTTP request headers. For RESPMOD, these are HTTP +# response headers, but Squid currently cannot log them +# (i.e., %http::>h will expand to "-" for RESPMOD). +# +# http::st The total size of the ICAP request sent to the ICAP +# server (ICAP headers + ICAP body), including chunking +# metadata (if any). +# +# icap::h ICAP request header(s). Similar to >h. +# +# icap::A %icap::to/%03icap::Hs %icap::\n - logfile data +# R\n - rotate file +# T\n - truncate file +# O\n - reopen file +# F\n - flush file +# r\n - set rotate count to +# b\n - 1 = buffer output, 0 = don't buffer output +# +# No responses is expected. +#Default: +# logfile_daemon /usr/lib/squid/log_file_daemon + +# TAG: stats_collection allow|deny acl acl... +# This options allows you to control which requests gets accounted +# in performance counters. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow logging for all transactions. + +# TAG: cache_store_log +# Logs the activities of the storage manager. Shows which +# objects are ejected from the cache, and which objects are +# saved and for how long. +# There are not really utilities to analyze this data, so you can safely +# disable it (the default). +# +# Store log uses modular logging outputs. See access_log for the list +# of modules supported. +# +# Example: +# cache_store_log stdio:/var/log/squid/store.log +# cache_store_log daemon:/var/log/squid/store.log +#Default: +# none + +# TAG: cache_swap_state +# Location for the cache "swap.state" file. This index file holds +# the metadata of objects saved on disk. It is used to rebuild +# the cache during startup. Normally this file resides in each +# 'cache_dir' directory, but you may specify an alternate +# pathname here. Note you must give a full filename, not just +# a directory. Since this is the index for the whole object +# list you CANNOT periodically rotate it! +# +# If %s can be used in the file name it will be replaced with a +# a representation of the cache_dir name where each / is replaced +# with '.'. This is needed to allow adding/removing cache_dir +# lines when cache_swap_log is being used. +# +# If have more than one 'cache_dir', and %s is not used in the name +# these swap logs will have names such as: +# +# cache_swap_log.00 +# cache_swap_log.01 +# cache_swap_log.02 +# +# The numbered extension (which is added automatically) +# corresponds to the order of the 'cache_dir' lines in this +# configuration file. If you change the order of the 'cache_dir' +# lines in this file, these index files will NOT correspond to +# the correct 'cache_dir' entry (unless you manually rename +# them). We recommend you do NOT use this option. It is +# better to keep these index files in each 'cache_dir' directory. +#Default: +# Store the journal inside its cache_dir + +# TAG: logfile_rotate +# Specifies the number of logfile rotations to make when you +# type 'squid -k rotate'. The default is 10, which will rotate +# with extensions 0 through 9. Setting logfile_rotate to 0 will +# disable the file name rotation, but the logfiles are still closed +# and re-opened. This will enable you to rename the logfiles +# yourself just before sending the rotate signal. +# +# Note, the 'squid -k rotate' command normally sends a USR1 +# signal to the running squid process. In certain situations +# (e.g. on Linux with Async I/O), USR1 is used for other +# purposes, so -k rotate uses another signal. It is best to get +# in the habit of using 'squid -k rotate' instead of 'kill -USR1 +# '. +# +# Note, from Squid-3.1 this option is only a default for cache.log, +# that log can be rotated separately by using debug_options. +# +# Note2, for Debian/Linux the default of logfile_rotate is +# zero, since it includes external logfile-rotation methods. +#Default: +# logfile_rotate 0 + +# TAG: mime_table +# Path to Squid's icon configuration file. +# +# You shouldn't need to change this, but the default file contains +# examples and formatting information if you do. +#Default: +# mime_table /usr/share/squid/mime.conf + +# TAG: log_mime_hdrs on|off +# The Cache can record both the request and the response MIME +# headers for each HTTP transaction. The headers are encoded +# safely and will appear as two bracketed fields at the end of +# the access log (for either the native or httpd-emulated log +# formats). To enable this logging set log_mime_hdrs to 'on'. +#Default: +# log_mime_hdrs off + +# TAG: pid_filename +# A filename to write the process-id to. To disable, enter "none". +#Default: +# pid_filename /var/run/squid.pid + +# TAG: client_netmask +# A netmask for client addresses in logfiles and cachemgr output. +# Change this to protect the privacy of your cache clients. +# A netmask of 255.255.255.0 will log all IP's in that range with +# the last digit set to '0'. +#Default: +# Log full client IP address + +# TAG: strip_query_terms +# By default, Squid strips query terms from requested URLs before +# logging. This protects your user's privacy and reduces log size. +# +# When investigating HIT/MISS or other caching behaviour you +# will need to disable this to see the full URL used by Squid. +#Default: +# strip_query_terms on + +# TAG: buffered_logs on|off +# Whether to write/send access_log records ASAP or accumulate them and +# then write/send them in larger chunks. Buffering may improve +# performance because it decreases the number of I/Os. However, +# buffering increases the delay before log records become available to +# the final recipient (e.g., a disk file or logging daemon) and, +# hence, increases the risk of log records loss. +# +# Note that even when buffered_logs are off, Squid may have to buffer +# records if it cannot write/send them immediately due to pending I/Os +# (e.g., the I/O writing the previous log record) or connectivity loss. +# +# Currently honored by 'daemon' and 'tcp' access_log modules only. +#Default: +# buffered_logs off + +# TAG: netdb_filename +# Where Squid stores it's netdb journal. +# When enabled this journal preserves netdb state between restarts. +# +# To disable, enter "none". +#Default: +# netdb_filename stdio:/var/log/squid/netdb.state + +# OPTIONS FOR TROUBLESHOOTING +# ----------------------------------------------------------------------------- + +# TAG: cache_log +# Squid administrative logging file. +# +# This is where general information about Squid behavior goes. You can +# increase the amount of data logged to this file and how often it is +# rotated with "debug_options" +#Default: +# cache_log /var/log/squid/cache.log + +# TAG: debug_options +# Logging options are set as section,level where each source file +# is assigned a unique section. Lower levels result in less +# output, Full debugging (level 9) can result in a very large +# log file, so be careful. +# +# The magic word "ALL" sets debugging levels for all sections. +# The default is to run with "ALL,1" to record important warnings. +# +# The rotate=N option can be used to keep more or less of these logs +# than would otherwise be kept by logfile_rotate. +# For most uses a single log should be enough to monitor current +# events affecting Squid. +#Default: +# Log all critical and important messages. + +# TAG: coredump_dir +# By default Squid leaves core files in the directory from where +# it was started. If you set 'coredump_dir' to a directory +# that exists, Squid will chdir() to that directory at startup +# and coredump files will be left there. +# +#Default: +# Use the directory from where Squid was started. +# + +# Leave coredumps in the first cache dir +coredump_dir /var/spool/squid + +# OPTIONS FOR FTP GATEWAYING +# ----------------------------------------------------------------------------- + +# TAG: ftp_user +# If you want the anonymous login password to be more informative +# (and enable the use of picky FTP servers), set this to something +# reasonable for your domain, like wwwuser@somewhere.net +# +# The reason why this is domainless by default is the +# request can be made on the behalf of a user in any domain, +# depending on how the cache is used. +# Some FTP server also validate the email address is valid +# (for example perl.com). +#Default: +# ftp_user Squid@ + +# TAG: ftp_passive +# If your firewall does not allow Squid to use passive +# connections, turn off this option. +# +# Use of ftp_epsv_all option requires this to be ON. +#Default: +# ftp_passive on + +# TAG: ftp_epsv_all +# FTP Protocol extensions permit the use of a special "EPSV ALL" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator, as the EPRT command will never be used and therefore, +# translation of the data portion of the segments will never be needed. +# +# When a client only expects to do two-way FTP transfers this may be +# useful. +# If squid finds that it must do a three-way FTP transfer after issuing +# an EPSV ALL command, the FTP session will fail. +# +# If you have any doubts about this option do not use it. +# Squid will nicely attempt all other connection methods. +# +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# ftp_epsv_all off + +# TAG: ftp_epsv +# FTP Protocol extensions permit the use of a special "EPSV" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator using EPSV, as the EPRT command will never be used +# and therefore, translation of the data portion of the segments +# will never be needed. +# +# EPSV is often required to interoperate with FTP servers on IPv6 +# networks. On the other hand, it may break some IPv4 servers. +# +# By default, EPSV may try EPSV with any FTP server. To fine tune +# that decision, you may restrict EPSV to certain clients or servers +# using ACLs: +# +# ftp_epsv allow|deny al1 acl2 ... +# +# WARNING: Disabling EPSV may cause problems with external NAT and IPv6. +# +# Only fast ACLs are supported. +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# none + +# TAG: ftp_eprt +# FTP Protocol extensions permit the use of a special "EPRT" command. +# +# This extension provides a protocol neutral alternative to the +# IPv4-only PORT command. When supported it enables active FTP data +# channels over IPv6 and efficient NAT handling. +# +# Turning this OFF will prevent EPRT being attempted and will skip +# straight to using PORT for IPv4 servers. +# +# Some devices are known to not handle this extension correctly and +# may result in crashes. Devices which suport EPRT enough to fail +# cleanly will result in Squid attempting PORT anyway. This directive +# should only be disabled when EPRT results in device failures. +# +# WARNING: Doing so will convert Squid back to the old behavior with all +# the related problems with external NAT devices/layers and IPv4-only FTP. +#Default: +# ftp_eprt on + +# TAG: ftp_sanitycheck +# For security and data integrity reasons Squid by default performs +# sanity checks of the addresses of FTP data connections ensure the +# data connection is to the requested server. If you need to allow +# FTP connections to servers using another IP address for the data +# connection turn this off. +#Default: +# ftp_sanitycheck on + +# TAG: ftp_telnet_protocol +# The FTP protocol is officially defined to use the telnet protocol +# as transport channel for the control connection. However, many +# implementations are broken and does not respect this aspect of +# the FTP protocol. +# +# If you have trouble accessing files with ASCII code 255 in the +# path or similar problems involving this ASCII code you can +# try setting this directive to off. If that helps, report to the +# operator of the FTP server in question that their FTP server +# is broken and does not follow the FTP standard. +#Default: +# ftp_telnet_protocol on + +# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS +# ----------------------------------------------------------------------------- + +# TAG: diskd_program +# Specify the location of the diskd executable. +# Note this is only useful if you have compiled in +# diskd as one of the store io modules. +#Default: +# diskd_program /usr/lib/squid/diskd + +# TAG: unlinkd_program +# Specify the location of the executable for file deletion process. +#Default: +# unlinkd_program /usr/lib/squid/unlinkd + +# TAG: pinger_program +# Specify the location of the executable for the pinger process. +#Default: +# pinger_program /usr/lib/squid/pinger + +# TAG: pinger_enable +# Control whether the pinger is active at run-time. +# Enables turning ICMP pinger on and off with a simple +# squid -k reconfigure. +#Default: +# pinger_enable on + +# OPTIONS FOR URL REWRITING +# ----------------------------------------------------------------------------- + +# TAG: url_rewrite_program +# Specify the location of the executable URL rewriter to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the rewriter will receive on line with the format +# +# [channel-ID ] URL [ extras] +# +# See url_rewrite_extras on how to send "extras" with optional values to +# the helper. +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK status=30N url="..." +# Redirect the URL to the one supplied in 'url='. +# 'status=' is optional and contains the status code to send +# the client in Squids HTTP response. It must be one of the +# HTTP redirect status codes: 301, 302, 303, 307, 308. +# When no status is given Squid will use 302. +# +# OK rewrite-url="..." +# Rewrite the URL to the one supplied in 'rewrite-url='. +# The new URL is fetched directly by Squid and returned to +# the client as the response to its request. +# +# OK +# When neither of url= and rewrite-url= are sent Squid does +# not change the URL. +# +# ERR +# Do not change the URL. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. The 'message=' key name is +# reserved for delivering a log message. +# +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# The TAG is treated as a regular annotation but persists across +# future requests on the client connection rather than just the +# current request. A helper may update the TAG during subsequent +# requests be returning a new kv-pair. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# WARNING: URL re-writing ability should be avoided whenever possible. +# Use the URL redirect form of response instead. +# +# Re-write creates a difference in the state held by the client +# and server. Possibly causing confusion when the server response +# contains snippets of its view state. Embeded URLs, response +# and content Location headers, etc. are not re-written by this +# interface. +# +# By default, a URL rewriter is not used. +#Default: +# none + +# TAG: url_rewrite_children +# The maximum number of redirector processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# URLs, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each redirector helper can handle in +# parallel. Defaults to 0 which indicates the redirector +# is a old-style single threaded redirector. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# url_rewrite_children 20 startup=0 idle=1 concurrency=0 + +# TAG: url_rewrite_host_header +# To preserve same-origin security policies in browsers and +# prevent Host: header forgery by redirectors Squid rewrites +# any Host: header in redirected requests. +# +# If you are running an accelerator this may not be a wanted +# effect of a redirector. This directive enables you disable +# Host: alteration in reverse-proxy traffic. +# +# WARNING: Entries are cached on the result of the URL rewriting +# process, so be careful if you have domain-virtual hosts. +# +# WARNING: Squid and other software verifies the URL and Host +# are matching, so be careful not to relay through other proxies +# or inspecting firewalls with this disabled. +#Default: +# url_rewrite_host_header on + +# TAG: url_rewrite_access +# If defined, this access list specifies which requests are +# sent to the redirector processes. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: url_rewrite_bypass +# When this is 'on', a request will not go through the +# redirector if all the helpers are busy. If this is 'off' +# and the redirector queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# redirectors. You should only enable this if the redirectors +# are not critical to your caching system. If you use +# redirectors for access control, and you enable this option, +# users may have access to pages they should not +# be allowed to request. +#Default: +# url_rewrite_bypass off + +# TAG: url_rewrite_extras +# Specifies a string to be append to request line format for the +# rewriter helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# url_rewrite_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# OPTIONS FOR STORE ID +# ----------------------------------------------------------------------------- + +# TAG: store_id_program +# Specify the location of the executable StoreID helper to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the helper will receive one line with the format +# +# [channel-ID ] URL [ extras] +# +# +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK store-id="..." +# Use the StoreID supplied in 'store-id='. +# +# ERR +# The default is to use HTTP request URL as the store ID. +# +# BH +# An internal error occured in the helper, preventing +# a result being identified. +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation for this +# kv-pair +# +# Helper programs should be prepared to receive and possibly ignore +# additional whitespace-separated tokens on each input line. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# NOTE: when using StoreID refresh_pattern will apply to the StoreID +# returned from the helper and not the URL. +# +# WARNING: Wrong StoreID value returned by a careless helper may result +# in the wrong cached response returned to the user. +# +# By default, a StoreID helper is not used. +#Default: +# none + +# TAG: store_id_extras +# Specifies a string to be append to request line format for the +# StoreId helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# TAG: store_id_children +# The maximum number of StoreID helper processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# requests, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each storeID helper can handle in +# parallel. Defaults to 0 which indicates the helper +# is a old-style single threaded program. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# store_id_children 20 startup=0 idle=1 concurrency=0 + +# TAG: store_id_access +# If defined, this access list specifies which requests are +# sent to the StoreID processes. By default all requests +# are sent. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: store_id_bypass +# When this is 'on', a request will not go through the +# helper if all helpers are busy. If this is 'off' +# and the helper queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# helpers. You should only enable this if the helperss +# are not critical to your caching system. If you use +# helpers for critical caching components, and you enable this +# option, users may not get objects from cache. +#Default: +# store_id_bypass on + +# OPTIONS FOR TUNING THE CACHE +# ----------------------------------------------------------------------------- + +# TAG: cache +# Requests denied by this directive will not be served from the cache +# and their responses will not be stored in the cache. This directive +# has no effect on other transactions and on already cached responses. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# This and the two other similar caching directives listed below are +# checked at different transaction processing stages, have different +# access to response information, affect different cache operations, +# and differ in slow ACLs support: +# +# * cache: Checked before Squid makes a hit/miss determination. +# No access to reply information! +# Denies both serving a hit and storing a miss. +# Supports both fast and slow ACLs. +# * send_hit: Checked after a hit was detected. +# Has access to reply (hit) information. +# Denies serving a hit only. +# Supports fast ACLs only. +# * store_miss: Checked before storing a cachable miss. +# Has access to reply (miss) information. +# Denies storing a miss only. +# Supports fast ACLs only. +# +# If you are not sure which of the three directives to use, apply the +# following decision logic: +# +# * If your ACL(s) are of slow type _and_ need response info, redesign. +# Squid does not support that particular combination at this time. +# Otherwise: +# * If your directive ACL(s) are of slow type, use "cache"; and/or +# * if your directive ACL(s) need no response info, use "cache". +# Otherwise: +# * If you do not want the response cached, use store_miss; and/or +# * if you do not want a hit on a cached response, use send_hit. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: send_hit +# Responses denied by this directive will not be served from the cache +# (but may still be cached, see store_miss). This directive has no +# effect on the responses it allows and on the cached objects. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. +# +# Unlike the "cache" directive, send_hit only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# For example: +# +# # apply custom Store ID mapping to some URLs +# acl MapMe dstdomain .c.example.com +# store_id_program ... +# store_id_access allow MapMe +# +# # but prevent caching of special responses +# # such as 302 redirects that cause StoreID loops +# acl Ordinary http_status 200-299 +# store_miss deny MapMe !Ordinary +# +# # and do not serve any previously stored special responses +# # from the cache (in case they were already cached before +# # the above store_miss rule was in effect). +# send_hit deny MapMe !Ordinary +#Default: +# By default, this directive is unused and has no effect. + +# TAG: store_miss +# Responses denied by this directive will not be cached (but may still +# be served from the cache, see send_hit). This directive has no +# effect on the responses it allows and on the already cached responses. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. See the +# send_hit directive for a usage example. +# +# Unlike the "cache" directive, store_miss only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: max_stale time-units +# This option puts an upper limit on how stale content Squid +# will serve from the cache if cache validation fails. +# Can be overriden by the refresh_pattern max-stale option. +#Default: +# max_stale 1 week + +# TAG: refresh_pattern +# usage: refresh_pattern [-i] regex min percent max [options] +# +# By default, regular expressions are CASE-SENSITIVE. To make +# them case-insensitive, use the -i option. +# +# 'Min' is the time (in minutes) an object without an explicit +# expiry time should be considered fresh. The recommended +# value is 0, any higher values may cause dynamic applications +# to be erroneously cached unless the application designer +# has taken the appropriate actions. +# +# 'Percent' is a percentage of the objects age (time since last +# modification age) an object without explicit expiry time +# will be considered fresh. +# +# 'Max' is an upper limit on how long objects without an explicit +# expiry time will be considered fresh. The value is also used +# to form Cache-Control: max-age header for a request sent from +# Squid to origin/parent. +# +# options: override-expire +# override-lastmod +# reload-into-ims +# ignore-reload +# ignore-no-store +# ignore-must-revalidate +# ignore-private +# ignore-auth +# max-stale=NN +# refresh-ims +# store-stale +# +# override-expire enforces min age even if the server +# sent an explicit expiry time (e.g., with the +# Expires: header or Cache-Control: max-age). Doing this +# VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# Note: override-expire does not enforce staleness - it only extends +# freshness / min. If the server returns a Expires time which +# is longer than your max time, Squid will still consider +# the object fresh for that period of time. +# +# override-lastmod enforces min age even on objects +# that were modified recently. +# +# reload-into-ims changes a client no-cache or ``reload'' +# request for a cached entry into a conditional request using +# If-Modified-Since and/or If-None-Match headers, provided the +# cached entry has a Last-Modified and/or a strong ETag header. +# Doing this VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# ignore-reload ignores a client no-cache or ``reload'' +# header. Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which +# it causes. +# +# ignore-no-store ignores any ``Cache-control: no-store'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-must-revalidate ignores any ``Cache-Control: must-revalidate`` +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-private ignores any ``Cache-control: private'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-auth caches responses to requests with authorization, +# as if the originserver had sent ``Cache-control: public'' +# in the response header. Doing this VIOLATES the HTTP standard. +# Enabling this feature could make you liable for problems which +# it causes. +# +# refresh-ims causes squid to contact the origin server +# when a client issues an If-Modified-Since request. This +# ensures that the client will receive an updated version +# if one is available. +# +# store-stale stores responses even if they don't have explicit +# freshness or a validator (i.e., Last-Modified or an ETag) +# present, or if they're already stale. By default, Squid will +# not cache such responses because they usually can't be +# reused. Note that such responses will be stale by default. +# +# max-stale=NN provide a maximum staleness factor. Squid won't +# serve objects more stale than this even if it failed to +# validate the object. Default: use the max_stale global limit. +# +# Basically a cached object is: +# +# FRESH if expire > now, else STALE +# STALE if age > max +# FRESH if lm-factor < percent, else STALE +# FRESH if age < min +# else STALE +# +# The refresh_pattern lines are checked in the order listed here. +# The first entry which matches is used. If none of the entries +# match the default will be used. +# +# Note, you must uncomment all the default lines if you want +# to change one. The default setting is only active if none is +# used. +# +# + +# +# Add any of your own refresh_pattern entries above these. +# +refresh_pattern ^ftp: 1440 20% 10080 +refresh_pattern ^gopher: 1440 0% 1440 +refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 +refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 +# example lin deb packages +#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600 +refresh_pattern . 0 20% 4320 + +# TAG: quick_abort_min (KB) +#Default: +# quick_abort_min 16 KB + +# TAG: quick_abort_max (KB) +#Default: +# quick_abort_max 16 KB + +# TAG: quick_abort_pct (percent) +# The cache by default continues downloading aborted requests +# which are almost completed (less than 16 KB remaining). This +# may be undesirable on slow (e.g. SLIP) links and/or very busy +# caches. Impatient users may tie up file descriptors and +# bandwidth by repeatedly requesting and immediately aborting +# downloads. +# +# When the user aborts a request, Squid will check the +# quick_abort values to the amount of data transferred until +# then. +# +# If the transfer has less than 'quick_abort_min' KB remaining, +# it will finish the retrieval. +# +# If the transfer has more than 'quick_abort_max' KB remaining, +# it will abort the retrieval. +# +# If more than 'quick_abort_pct' of the transfer has completed, +# it will finish the retrieval. +# +# If you do not want any retrieval to continue after the client +# has aborted, set both 'quick_abort_min' and 'quick_abort_max' +# to '0 KB'. +# +# If you want retrievals to always continue if they are being +# cached set 'quick_abort_min' to '-1 KB'. +#Default: +# quick_abort_pct 95 + +# TAG: read_ahead_gap buffer-size +# The amount of data the cache will buffer ahead of what has been +# sent to the client when retrieving an object from another server. +#Default: +# read_ahead_gap 16 KB + +# TAG: negative_ttl time-units +# Set the Default Time-to-Live (TTL) for failed requests. +# Certain types of failures (such as "connection refused" and +# "404 Not Found") are able to be negatively-cached for a short time. +# Modern web servers should provide Expires: header, however if they +# do not this can provide a minimum TTL. +# The default is not to cache errors with unknown expiry details. +# +# Note that this is different from negative caching of DNS lookups. +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +#Default: +# negative_ttl 0 seconds + +# TAG: positive_dns_ttl time-units +# Upper limit on how long Squid will cache positive DNS responses. +# Default is 6 hours (360 minutes). This directive must be set +# larger than negative_dns_ttl. +#Default: +# positive_dns_ttl 6 hours + +# TAG: negative_dns_ttl time-units +# Time-to-Live (TTL) for negative caching of failed DNS lookups. +# This also sets the lower cache limit on positive lookups. +# Minimum value is 1 second, and it is not recommendable to go +# much below 10 seconds. +#Default: +# negative_dns_ttl 1 minutes + +# TAG: range_offset_limit size [acl acl...] +# usage: (size) [units] [[!]aclname] +# +# Sets an upper limit on how far (number of bytes) into the file +# a Range request may be to cause Squid to prefetch the whole file. +# If beyond this limit, Squid forwards the Range request as it is and +# the result is NOT cached. +# +# This is to stop a far ahead range request (lets say start at 17MB) +# from making Squid fetch the whole object up to that point before +# sending anything to the client. +# +# Multiple range_offset_limit lines may be specified, and they will +# be searched from top to bottom on each request until a match is found. +# The first match found will be used. If no line matches a request, the +# default limit of 0 bytes will be used. +# +# 'size' is the limit specified as a number of units. +# +# 'units' specifies whether to use bytes, KB, MB, etc. +# If no units are specified bytes are assumed. +# +# A size of 0 causes Squid to never fetch more than the +# client requested. (default) +# +# A size of 'none' causes Squid to always fetch the object from the +# beginning so it may cache the result. (2.0 style) +# +# 'aclname' is the name of a defined ACL. +# +# NP: Using 'none' as the byte value here will override any quick_abort settings +# that may otherwise apply to the range request. The range request will +# be fully fetched from start to finish regardless of the client +# actions. This affects bandwidth usage. +#Default: +# none + +# TAG: minimum_expiry_time (seconds) +# The minimum caching time according to (Expires - Date) +# headers Squid honors if the object can't be revalidated. +# The default is 60 seconds. +# +# In reverse proxy environments it might be desirable to honor +# shorter object lifetimes. It is most likely better to make +# your server return a meaningful Last-Modified header however. +# +# In ESI environments where page fragments often have short +# lifetimes, this will often be best set to 0. +#Default: +# minimum_expiry_time 60 seconds + +# TAG: store_avg_object_size (bytes) +# Average object size, used to estimate number of objects your +# cache can hold. The default is 13 KB. +# +# This is used to pre-seed the cache index memory allocation to +# reduce expensive reallocate operations while handling clients +# traffic. Too-large values may result in memory allocation during +# peak traffic, too-small values will result in wasted memory. +# +# Check the cache manager 'info' report metrics for the real +# object sizes seen by your Squid before tuning this. +#Default: +# store_avg_object_size 13 KB + +# TAG: store_objects_per_bucket +# Target number of objects per bucket in the store hash table. +# Lowering this value increases the total number of buckets and +# also the storage maintenance rate. The default is 20. +#Default: +# store_objects_per_bucket 20 + +# HTTP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: request_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a request. +# Request headers are usually relatively small (about 512 bytes). +# Placing a limit on the request header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# request_header_max_size 64 KB + +# TAG: reply_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a reply. +# Reply headers are usually relatively small (about 512 bytes). +# Placing a limit on the reply header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# reply_header_max_size 64 KB + +# TAG: request_body_max_size (bytes) +# This specifies the maximum size for an HTTP request body. +# In other words, the maximum size of a PUT/POST request. +# A user who attempts to send a request with a body larger +# than this limit receives an "Invalid Request" error message. +# If you set this parameter to a zero (the default), there will +# be no limit imposed. +# +# See also client_request_buffer_max_size for an alternative +# limitation on client uploads which can be configured. +#Default: +# No limit. + +# TAG: client_request_buffer_max_size (bytes) +# This specifies the maximum buffer size of a client request. +# It prevents squid eating too much memory when somebody uploads +# a large file. +#Default: +# client_request_buffer_max_size 512 KB + +# TAG: broken_posts +# A list of ACL elements which, if matched, causes Squid to send +# an extra CRLF pair after the body of a PUT/POST request. +# +# Some HTTP servers has broken implementations of PUT/POST, +# and rely on an extra CRLF pair sent by some WWW clients. +# +# Quote from RFC2616 section 4.1 on this matter: +# +# Note: certain buggy HTTP/1.0 client implementations generate an +# extra CRLF's after a POST request. To restate what is explicitly +# forbidden by the BNF, an HTTP/1.1 client must not preface or follow +# a request with an extra CRLF. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# acl buggy_server url_regex ^http://.... +# broken_posts allow buggy_server +#Default: +# Obey RFC 2616. + +# TAG: adaptation_uses_indirect_client on|off +# Controls whether the indirect client IP address (instead of the direct +# client IP address) is passed to adaptation services. +# +# See also: follow_x_forwarded_for adaptation_send_client_ip +#Default: +# adaptation_uses_indirect_client on + +# TAG: via on|off +# If set (default), Squid will include a Via header in requests and +# replies as required by RFC2616. +#Default: +# via on + +# TAG: ie_refresh on|off +# Microsoft Internet Explorer up until version 5.5 Service +# Pack 1 has an issue with transparent proxies, wherein it +# is impossible to force a refresh. Turning this on provides +# a partial fix to the problem, by causing all IMS-REFRESH +# requests from older IE versions to check the origin server +# for fresh content. This reduces hit ratio by some amount +# (~10% in my experience), but allows users to actually get +# fresh content when they want it. Note because Squid +# cannot tell if the user is using 5.5 or 5.5SP1, the behavior +# of 5.5 is unchanged from old versions of Squid (i.e. a +# forced refresh is impossible). Newer versions of IE will, +# hopefully, continue to have the new behavior and will be +# handled based on that assumption. This option defaults to +# the old Squid behavior, which is better for hit ratios but +# worse for clients using IE, if they need to be able to +# force fresh content. +#Default: +# ie_refresh off + +# TAG: vary_ignore_expire on|off +# Many HTTP servers supporting Vary gives such objects +# immediate expiry time with no cache-control header +# when requested by a HTTP/1.0 client. This option +# enables Squid to ignore such expiry times until +# HTTP/1.1 is fully implemented. +# +# WARNING: If turned on this may eventually cause some +# varying objects not intended for caching to get cached. +#Default: +# vary_ignore_expire off + +# TAG: request_entities +# Squid defaults to deny GET and HEAD requests with request entities, +# as the meaning of such requests are undefined in the HTTP standard +# even if not explicitly forbidden. +# +# Set this directive to on if you have clients which insists +# on sending request entities in GET or HEAD requests. But be warned +# that there is server software (both proxies and web servers) which +# can fail to properly process this kind of request which may make you +# vulnerable to cache pollution attacks if enabled. +#Default: +# request_entities off + +# TAG: request_header_access +# Usage: request_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option replaces the old 'anonymize_headers' and the +# older 'http_anonymizer' option with something that is much +# more configurable. A list of ACLs for each header name allows +# removal of specific header fields under specific conditions. +# +# This option only applies to outgoing HTTP request headers (i.e., +# headers sent by Squid to the next HTTP hop such as a cache peer +# or an origin server). The option has no effect during cache hit +# detection. The equivalent adaptation vectoring point in ICAP +# terminology is post-cache REQMOD. +# +# The option is applied to individual outgoing request header +# fields. For each request header field F, Squid uses the first +# qualifying sets of request_header_access rules: +# +# 1. Rules with header_name equal to F's name. +# 2. Rules with header_name 'Other', provided F's name is not +# on the hard-coded list of commonly used HTTP header names. +# 3. Rules with header_name 'All'. +# +# Within that qualifying rule set, rule ACLs are checked as usual. +# If ACLs of an "allow" rule match, the header field is allowed to +# go through as is. If ACLs of a "deny" rule match, the header is +# removed and request_header_replace is then checked to identify +# if the removed header has a replacement. If no rules within the +# set have matching ACLs, the header field is left as is. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# request_header_access From deny all +# request_header_access Referer deny all +# request_header_access User-Agent deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# request_header_access Authorization allow all +# request_header_access Proxy-Authorization allow all +# request_header_access Cache-Control allow all +# request_header_access Content-Length allow all +# request_header_access Content-Type allow all +# request_header_access Date allow all +# request_header_access Host allow all +# request_header_access If-Modified-Since allow all +# request_header_access Pragma allow all +# request_header_access Accept allow all +# request_header_access Accept-Charset allow all +# request_header_access Accept-Encoding allow all +# request_header_access Accept-Language allow all +# request_header_access Connection allow all +# request_header_access All deny all +# +# HTTP reply headers are controlled with the reply_header_access directive. +# +# By default, all headers are allowed (no anonymizing is performed). +#Default: +# No limits. + +# TAG: reply_header_access +# Usage: reply_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option only applies to reply headers, i.e., from the +# server to the client. +# +# This is the same as request_header_access, but in the other +# direction. Please see request_header_access for detailed +# documentation. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# reply_header_access Server deny all +# reply_header_access WWW-Authenticate deny all +# reply_header_access Link deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# reply_header_access Allow allow all +# reply_header_access WWW-Authenticate allow all +# reply_header_access Proxy-Authenticate allow all +# reply_header_access Cache-Control allow all +# reply_header_access Content-Encoding allow all +# reply_header_access Content-Length allow all +# reply_header_access Content-Type allow all +# reply_header_access Date allow all +# reply_header_access Expires allow all +# reply_header_access Last-Modified allow all +# reply_header_access Location allow all +# reply_header_access Pragma allow all +# reply_header_access Content-Language allow all +# reply_header_access Retry-After allow all +# reply_header_access Title allow all +# reply_header_access Content-Disposition allow all +# reply_header_access Connection allow all +# reply_header_access All deny all +# +# HTTP request headers are controlled with the request_header_access directive. +# +# By default, all headers are allowed (no anonymizing is +# performed). +#Default: +# No limits. + +# TAG: request_header_replace +# Usage: request_header_replace header_name message +# Example: request_header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit) +# +# This option allows you to change the contents of headers +# denied with request_header_access above, by replacing them +# with some fixed string. +# +# This only applies to request headers, not reply headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: reply_header_replace +# Usage: reply_header_replace header_name message +# Example: reply_header_replace Server Foo/1.0 +# +# This option allows you to change the contents of headers +# denied with reply_header_access above, by replacing them +# with some fixed string. +# +# This only applies to reply headers, not request headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: request_header_add +# Usage: request_header_add field-name field-value acl1 [acl2] ... +# Example: request_header_add X-Client-CA "CA=%ssl::>cert_issuer" all +# +# This option adds header fields to outgoing HTTP requests (i.e., +# request headers sent by Squid to the next HTTP hop such as a +# cache peer or an origin server). The option has no effect during +# cache hit detection. The equivalent adaptation vectoring point +# in ICAP terminology is post-cache REQMOD. +# +# Field-name is a token specifying an HTTP header name. If a +# standard HTTP header name is used, Squid does not check whether +# the new header conflicts with any existing headers or violates +# HTTP rules. If the request to be modified already contains a +# field with the same name, the old field is preserved but the +# header field values are not merged. +# +# Field-value is either a token or a quoted string. If quoted +# string format is used, then the surrounding quotes are removed +# while escape sequences and %macros are processed. +# +# In theory, all of the logformat codes can be used as %macros. +# However, unlike logging (which happens at the very end of +# transaction lifetime), the transaction may not yet have enough +# information to expand a macro when the new header value is needed. +# And some information may already be available to Squid but not yet +# committed where the macro expansion code can access it (report +# such instances!). The macro will be expanded into a single dash +# ('-') in such cases. Not all macros have been tested. +# +# One or more Squid ACLs may be specified to restrict header +# injection to matching requests. As always in squid.conf, all +# ACLs in an option ACL list must be satisfied for the insertion +# to happen. The request_header_add option supports fast ACLs +# only. +#Default: +# none + +# TAG: note +# This option used to log custom information about the master +# transaction. For example, an admin may configure Squid to log +# which "user group" the transaction belongs to, where "user group" +# will be determined based on a set of ACLs and not [just] +# authentication information. +# Values of key/value pairs can be logged using %{key}note macros: +# +# note key value acl ... +# logformat myFormat ... %{key}note ... +#Default: +# none + +# TAG: relaxed_header_parser on|off|warn +# In the default "on" setting Squid accepts certain forms +# of non-compliant HTTP messages where it is unambiguous +# what the sending application intended even if the message +# is not correctly formatted. The messages is then normalized +# to the correct form when forwarded by Squid. +# +# If set to "warn" then a warning will be emitted in cache.log +# each time such HTTP error is encountered. +# +# If set to "off" then such HTTP errors will cause the request +# or response to be rejected. +#Default: +# relaxed_header_parser on + +# TAG: collapsed_forwarding (on|off) +# When enabled, instead of forwarding each concurrent request for +# the same URL, Squid just sends the first of them. The other, so +# called "collapsed" requests, wait for the response to the first +# request and, if it happens to be cachable, use that response. +# Here, "concurrent requests" means "received after the first +# request headers were parsed and before the corresponding response +# headers were parsed". +# +# This feature is disabled by default: enabling collapsed +# forwarding needlessly delays forwarding requests that look +# cachable (when they are collapsed) but then need to be forwarded +# individually anyway because they end up being for uncachable +# content. However, in some cases, such as acceleration of highly +# cachable content with periodic or grouped expiration times, the +# gains from collapsing [large volumes of simultaneous refresh +# requests] outweigh losses from such delays. +# +# Squid collapses two kinds of requests: regular client requests +# received on one of the listening ports and internal "cache +# revalidation" requests which are triggered by those regular +# requests hitting a stale cached object. Revalidation collapsing +# is currently disabled for Squid instances containing SMP-aware +# disk or memory caches and for Vary-controlled cached objects. +#Default: +# collapsed_forwarding off + +# TIMEOUTS +# ----------------------------------------------------------------------------- + +# TAG: forward_timeout time-units +# This parameter specifies how long Squid should at most attempt in +# finding a forwarding path for the request before giving up. +#Default: +# forward_timeout 4 minutes + +# TAG: connect_timeout time-units +# This parameter specifies how long to wait for the TCP connect to +# the requested server or peer to complete before Squid should +# attempt to find another path where to forward the request. +#Default: +# connect_timeout 1 minute + +# TAG: peer_connect_timeout time-units +# This parameter specifies how long to wait for a pending TCP +# connection to a peer cache. The default is 30 seconds. You +# may also set different timeout values for individual neighbors +# with the 'connect-timeout' option on a 'cache_peer' line. +#Default: +# peer_connect_timeout 30 seconds + +# TAG: read_timeout time-units +# Applied on peer server connections. +# +# After each successful read(), the timeout will be extended by this +# amount. If no data is read again after this amount of time, +# the request is aborted and logged with ERR_READ_TIMEOUT. +# +# The default is 15 minutes. +#Default: +# read_timeout 15 minutes + +# TAG: write_timeout time-units +# This timeout is tracked for all connections that have data +# available for writing and are waiting for the socket to become +# ready. After each successful write, the timeout is extended by +# the configured amount. If Squid has data to write but the +# connection is not ready for the configured duration, the +# transaction associated with the connection is terminated. The +# default is 15 minutes. +#Default: +# write_timeout 15 minutes + +# TAG: request_timeout +# How long to wait for complete HTTP request headers after initial +# connection establishment. +#Default: +# request_timeout 5 minutes + +# TAG: client_idle_pconn_timeout +# How long to wait for the next HTTP request on a persistent +# client connection after the previous request completes. +#Default: +# client_idle_pconn_timeout 2 minutes + +# TAG: ftp_client_idle_timeout +# How long to wait for an FTP request on a connection to Squid ftp_port. +# Many FTP clients do not deal with idle connection closures well, +# necessitating a longer default timeout than client_idle_pconn_timeout +# used for incoming HTTP requests. +#Default: +# ftp_client_idle_timeout 30 minutes + +# TAG: client_lifetime time-units +# The maximum amount of time a client (browser) is allowed to +# remain connected to the cache process. This protects the Cache +# from having a lot of sockets (and hence file descriptors) tied up +# in a CLOSE_WAIT state from remote clients that go away without +# properly shutting down (either because of a network failure or +# because of a poor client implementation). The default is one +# day, 1440 minutes. +# +# NOTE: The default value is intended to be much larger than any +# client would ever need to be connected to your cache. You +# should probably change client_lifetime only as a last resort. +# If you seem to have many client connections tying up +# filedescriptors, we recommend first tuning the read_timeout, +# request_timeout, persistent_request_timeout and quick_abort values. +#Default: +# client_lifetime 1 day + +# TAG: half_closed_clients +# Some clients may shutdown the sending side of their TCP +# connections, while leaving their receiving sides open. Sometimes, +# Squid can not tell the difference between a half-closed and a +# fully-closed TCP connection. +# +# By default, Squid will immediately close client connections when +# read(2) returns "no more data to read." +# +# Change this option to 'on' and Squid will keep open connections +# until a read(2) or write(2) on the socket returns an error. +# This may show some benefits for reverse proxies. But if not +# it is recommended to leave OFF. +#Default: +# half_closed_clients off + +# TAG: server_idle_pconn_timeout +# Timeout for idle persistent connections to servers and other +# proxies. +#Default: +# server_idle_pconn_timeout 1 minute + +# TAG: ident_timeout +# Maximum time to wait for IDENT lookups to complete. +# +# If this is too high, and you enabled IDENT lookups from untrusted +# users, you might be susceptible to denial-of-service by having +# many ident requests going at once. +#Default: +# ident_timeout 10 seconds + +# TAG: shutdown_lifetime time-units +# When SIGTERM or SIGHUP is received, the cache is put into +# "shutdown pending" mode until all active sockets are closed. +# This value is the lifetime to set for all open descriptors +# during shutdown mode. Any active clients after this many +# seconds will receive a 'timeout' message. +#Default: +# shutdown_lifetime 30 seconds + +# ADMINISTRATIVE PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: cache_mgr +# Email-address of local cache manager who will receive +# mail if the cache dies. The default is "webmaster". +#Default: +# cache_mgr webmaster + +# TAG: mail_from +# From: email-address for mail sent when the cache dies. +# The default is to use 'squid@unique_hostname'. +# +# See also: unique_hostname directive. +#Default: +# none + +# TAG: mail_program +# Email program used to send mail if the cache dies. +# The default is "mail". The specified program must comply +# with the standard Unix mail syntax: +# mail-program recipient < mailfile +# +# Optional command line options can be specified. +#Default: +# mail_program mail + +# TAG: cache_effective_user +# If you start Squid as root, it will change its effective/real +# UID/GID to the user specified below. The default is to change +# to UID of proxy. +# see also; cache_effective_group +#Default: +# cache_effective_user proxy + +# TAG: cache_effective_group +# Squid sets the GID to the effective user's default group ID +# (taken from the password file) and supplementary group list +# from the groups membership. +# +# If you want Squid to run with a specific GID regardless of +# the group memberships of the effective user then set this +# to the group (or GID) you want Squid to run as. When set +# all other group privileges of the effective user are ignored +# and only this GID is effective. If Squid is not started as +# root the user starting Squid MUST be member of the specified +# group. +# +# This option is not recommended by the Squid Team. +# Our preference is for administrators to configure a secure +# user account for squid with UID/GID matching system policies. +#Default: +# Use system group memberships of the cache_effective_user account + +# TAG: httpd_suppress_version_string on|off +# Suppress Squid version string info in HTTP headers and HTML error pages. +#Default: +# httpd_suppress_version_string off + +# TAG: visible_hostname +# If you want to present a special hostname in error messages, etc, +# define this. Otherwise, the return value of gethostname() +# will be used. If you have multiple caches in a cluster and +# get errors about IP-forwarding you must set them to have individual +# names with this setting. +#Default: +# Automatically detect the system host name + +# TAG: unique_hostname +# If you want to have multiple machines with the same +# 'visible_hostname' you must give each machine a different +# 'unique_hostname' so forwarding loops can be detected. +#Default: +# Copy the value from visible_hostname + +# TAG: hostname_aliases +# A list of other DNS names your cache has. +#Default: +# none + +# TAG: umask +# Minimum umask which should be enforced while the proxy +# is running, in addition to the umask set at startup. +# +# For a traditional octal representation of umasks, start +# your value with 0. +#Default: +# umask 027 + +# OPTIONS FOR THE CACHE REGISTRATION SERVICE +# ----------------------------------------------------------------------------- +# +# This section contains parameters for the (optional) cache +# announcement service. This service is provided to help +# cache administrators locate one another in order to join or +# create cache hierarchies. +# +# An 'announcement' message is sent (via UDP) to the registration +# service by Squid. By default, the announcement message is NOT +# SENT unless you enable it with 'announce_period' below. +# +# The announcement message includes your hostname, plus the +# following information from this configuration file: +# +# http_port +# icp_port +# cache_mgr +# +# All current information is processed regularly and made +# available on the Web at http://www.ircache.net/Cache/Tracker/. + +# TAG: announce_period +# This is how frequently to send cache announcements. +# +# To enable announcing your cache, just set an announce period. +# +# Example: +# announce_period 1 day +#Default: +# Announcement messages disabled. + +# TAG: announce_host +# Set the hostname where announce registration messages will be sent. +# +# See also announce_port and announce_file +#Default: +# announce_host tracker.ircache.net + +# TAG: announce_file +# The contents of this file will be included in the announce +# registration messages. +#Default: +# none + +# TAG: announce_port +# Set the port where announce registration messages will be sent. +# +# See also announce_host and announce_file +#Default: +# announce_port 3131 + +# HTTPD-ACCELERATOR OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: httpd_accel_surrogate_id +# Surrogates (http://www.esi.org/architecture_spec_1.0.html) +# need an identification token to allow control targeting. Because +# a farm of surrogates may all perform the same tasks, they may share +# an identification token. +#Default: +# visible_hostname is used if no specific ID is set. + +# TAG: http_accel_surrogate_remote on|off +# Remote surrogates (such as those in a CDN) honour the header +# "Surrogate-Control: no-store-remote". +# +# Set this to on to have squid behave as a remote surrogate. +#Default: +# http_accel_surrogate_remote off + +# TAG: esi_parser libxml2|expat|custom +# ESI markup is not strictly XML compatible. The custom ESI parser +# will give higher performance, but cannot handle non ASCII character +# encodings. +#Default: +# esi_parser custom + +# DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: delay_pools +# This represents the number of delay pools to be used. For example, +# if you have one class 2 delay pool and one class 3 delays pool, you +# have a total of 2 delay pools. +# +# See also delay_parameters, delay_class, delay_access for pool +# configuration details. +#Default: +# delay_pools 0 + +# TAG: delay_class +# This defines the class of each delay pool. There must be exactly one +# delay_class line for each delay pool. For example, to define two +# delay pools, one of class 2 and one of class 3, the settings above +# and here would be: +# +# Example: +# delay_pools 4 # 4 delay pools +# delay_class 1 2 # pool 1 is a class 2 pool +# delay_class 2 3 # pool 2 is a class 3 pool +# delay_class 3 4 # pool 3 is a class 4 pool +# delay_class 4 5 # pool 4 is a class 5 pool +# +# The delay pool classes are: +# +# class 1 Everything is limited by a single aggregate +# bucket. +# +# class 2 Everything is limited by a single aggregate +# bucket as well as an "individual" bucket chosen +# from bits 25 through 32 of the IPv4 address. +# +# class 3 Everything is limited by a single aggregate +# bucket as well as a "network" bucket chosen +# from bits 17 through 24 of the IP address and a +# "individual" bucket chosen from bits 17 through +# 32 of the IPv4 address. +# +# class 4 Everything in a class 3 delay pool, with an +# additional limit on a per user basis. This +# only takes effect if the username is established +# in advance - by forcing authentication in your +# http_access rules. +# +# class 5 Requests are grouped according their tag (see +# external_acl's tag= reply). +# +# +# Each pool also requires a delay_parameters directive to configure the pool size +# and speed limits used whenever the pool is applied to a request. Along with +# a set of delay_access directives to determine when it is used. +# +# NOTE: If an IP address is a.b.c.d +# -> bits 25 through 32 are "d" +# -> bits 17 through 24 are "c" +# -> bits 17 through 32 are "c * 256 + d" +# +# NOTE-2: Due to the use of bitmasks in class 2,3,4 pools they only apply to +# IPv4 traffic. Class 1 and 5 pools may be used with IPv6 traffic. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also delay_parameters and delay_access. +#Default: +# none + +# TAG: delay_access +# This is used to determine which delay pool a request falls into. +# +# delay_access is sorted per pool and the matching starts with pool 1, +# then pool 2, ..., and finally pool N. The first delay pool where the +# request is allowed is selected for the request. If it does not allow +# the request to any pool then the request is not delayed (default). +# +# For example, if you want some_big_clients in delay +# pool 1 and lotsa_little_clients in delay pool 2: +# +# delay_access 1 allow some_big_clients +# delay_access 1 deny all +# delay_access 2 allow lotsa_little_clients +# delay_access 2 deny all +# delay_access 3 allow authenticated_clients +# +# See also delay_parameters and delay_class. +# +#Default: +# Deny using the pool, unless allow rules exist in squid.conf for the pool. + +# TAG: delay_parameters +# This defines the parameters for a delay pool. Each delay pool has +# a number of "buckets" associated with it, as explained in the +# description of delay_class. +# +# For a class 1 delay pool, the syntax is: +# delay_class pool 1 +# delay_parameters pool aggregate +# +# For a class 2 delay pool: +# delay_class pool 2 +# delay_parameters pool aggregate individual +# +# For a class 3 delay pool: +# delay_class pool 3 +# delay_parameters pool aggregate network individual +# +# For a class 4 delay pool: +# delay_class pool 4 +# delay_parameters pool aggregate network individual user +# +# For a class 5 delay pool: +# delay_class pool 5 +# delay_parameters pool tagrate +# +# The option variables are: +# +# pool a pool number - ie, a number between 1 and the +# number specified in delay_pools as used in +# delay_class lines. +# +# aggregate the speed limit parameters for the aggregate bucket +# (class 1, 2, 3). +# +# individual the speed limit parameters for the individual +# buckets (class 2, 3). +# +# network the speed limit parameters for the network buckets +# (class 3). +# +# user the speed limit parameters for the user buckets +# (class 4). +# +# tagrate the speed limit parameters for the tag buckets +# (class 5). +# +# A pair of delay parameters is written restore/maximum, where restore is +# the number of bytes (not bits - modem and network speeds are usually +# quoted in bits) per second placed into the bucket, and maximum is the +# maximum number of bytes which can be in the bucket at any time. +# +# There must be one delay_parameters line for each delay pool. +# +# +# For example, if delay pool number 1 is a class 2 delay pool as in the +# above example, and is being used to strictly limit each host to 64Kbit/sec +# (plus overheads), with no overall limit, the line is: +# +# delay_parameters 1 none 8000/8000 +# +# Note that 8 x 8K Byte/sec -> 64K bit/sec. +# +# Note that the word 'none' is used to represent no limit. +# +# +# And, if delay pool number 2 is a class 3 delay pool as in the above +# example, and you want to limit it to a total of 256Kbit/sec (strict limit) +# with each 8-bit network permitted 64Kbit/sec (strict limit) and each +# individual host permitted 4800bit/sec with a bucket maximum size of 64Kbits +# to permit a decent web page to be downloaded at a decent speed +# (if the network is not being limited due to overuse) but slow down +# large downloads more significantly: +# +# delay_parameters 2 32000/32000 8000/8000 600/8000 +# +# Note that 8 x 32K Byte/sec -> 256K bit/sec. +# 8 x 8K Byte/sec -> 64K bit/sec. +# 8 x 600 Byte/sec -> 4800 bit/sec. +# +# +# Finally, for a class 4 delay pool as in the example - each user will +# be limited to 128Kbits/sec no matter how many workstations they are logged into.: +# +# delay_parameters 4 32000/32000 8000/8000 600/64000 16000/16000 +# +# +# See also delay_class and delay_access. +# +#Default: +# none + +# TAG: delay_initial_bucket_level (percent, 0-100) +# The initial bucket percentage is used to determine how much is put +# in each bucket when squid starts, is reconfigured, or first notices +# a host accessing it (in class 2 and class 3, individual hosts and +# networks only have buckets associated with them once they have been +# "seen" by squid). +#Default: +# delay_initial_bucket_level 50 + +# CLIENT DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: client_delay_pools +# This option specifies the number of client delay pools used. It must +# preceed other client_delay_* options. +# +# Example: +# client_delay_pools 2 +# +# See also client_delay_parameters and client_delay_access. +#Default: +# client_delay_pools 0 + +# TAG: client_delay_initial_bucket_level (percent, 0-no_limit) +# This option determines the initial bucket size as a percentage of +# max_bucket_size from client_delay_parameters. Buckets are created +# at the time of the "first" connection from the matching IP. Idle +# buckets are periodically deleted up. +# +# You can specify more than 100 percent but note that such "oversized" +# buckets are not refilled until their size goes down to max_bucket_size +# from client_delay_parameters. +# +# Example: +# client_delay_initial_bucket_level 50 +#Default: +# client_delay_initial_bucket_level 50 + +# TAG: client_delay_parameters +# +# This option configures client-side bandwidth limits using the +# following format: +# +# client_delay_parameters pool speed_limit max_bucket_size +# +# pool is an integer ID used for client_delay_access matching. +# +# speed_limit is bytes added to the bucket per second. +# +# max_bucket_size is the maximum size of a bucket, enforced after any +# speed_limit additions. +# +# Please see the delay_parameters option for more information and +# examples. +# +# Example: +# client_delay_parameters 1 1024 2048 +# client_delay_parameters 2 51200 16384 +# +# See also client_delay_access. +# +#Default: +# none + +# TAG: client_delay_access +# This option determines the client-side delay pool for the +# request: +# +# client_delay_access pool_ID allow|deny acl_name +# +# All client_delay_access options are checked in their pool ID +# order, starting with pool 1. The first checked pool with allowed +# request is selected for the request. If no ACL matches or there +# are no client_delay_access options, the request bandwidth is not +# limited. +# +# The ACL-selected pool is then used to find the +# client_delay_parameters for the request. Client-side pools are +# not used to aggregate clients. Clients are always aggregated +# based on their source IP addresses (one bucket per source IP). +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Additionally, only the client TCP connection details are available. +# ACLs testing HTTP properties will not work. +# +# Please see delay_access for more examples. +# +# Example: +# client_delay_access 1 allow low_rate_network +# client_delay_access 2 allow vips_network +# +# +# See also client_delay_parameters and client_delay_pools. +#Default: +# Deny use of the pool, unless allow rules exist in squid.conf for the pool. + +# WCCPv1 AND WCCPv2 CONFIGURATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: wccp_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCP disabled. + +# TAG: wccp2_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCPv2 disabled. + +# TAG: wccp_version +# This directive is only relevant if you need to set up WCCP(v1) +# to some very old and end-of-life Cisco routers. In all other +# setups it must be left unset or at the default setting. +# It defines an internal version in the WCCP(v1) protocol, +# with version 4 being the officially documented protocol. +# +# According to some users, Cisco IOS 11.2 and earlier only +# support WCCP version 3. If you're using that or an earlier +# version of IOS, you may need to change this value to 3, otherwise +# do not specify this parameter. +#Default: +# wccp_version 4 + +# TAG: wccp2_rebuild_wait +# If this is enabled Squid will wait for the cache dir rebuild to finish +# before sending the first wccp2 HereIAm packet +#Default: +# wccp2_rebuild_wait on + +# TAG: wccp2_forwarding_method +# WCCP2 allows the setting of forwarding methods between the +# router/switch and the cache. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment method. +#Default: +# wccp2_forwarding_method gre + +# TAG: wccp2_return_method +# WCCP2 allows the setting of return methods between the +# router/switch and the cache for packets that the cache +# decides not to handle. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment. +# +# If the "ip wccp redirect exclude in" command has been +# enabled on the cache interface, then it is still safe for +# the proxy server to use a l2 redirect method even if this +# option is set to GRE. +#Default: +# wccp2_return_method gre + +# TAG: wccp2_assignment_method +# WCCP2 allows the setting of methods to assign the WCCP hash +# Valid values are as follows: +# +# hash - Hash assignment +# mask - Mask assignment +# +# As a general rule, cisco routers support the hash assignment method +# and cisco switches support the mask assignment method. +#Default: +# wccp2_assignment_method hash + +# TAG: wccp2_service +# WCCP2 allows for multiple traffic services. There are two +# types: "standard" and "dynamic". The standard type defines +# one service id - http (id 0). The dynamic service ids can be from +# 51 to 255 inclusive. In order to use a dynamic service id +# one must define the type of traffic to be redirected; this is done +# using the wccp2_service_info option. +# +# The "standard" type does not require a wccp2_service_info option, +# just specifying the service id will suffice. +# +# MD5 service authentication can be enabled by adding +# "password=" to the end of this service declaration. +# +# Examples: +# +# wccp2_service standard 0 # for the 'web-cache' standard service +# wccp2_service dynamic 80 # a dynamic service type which will be +# # fleshed out with subsequent options. +# wccp2_service standard 0 password=foo +#Default: +# Use the 'web-cache' standard service. + +# TAG: wccp2_service_info +# Dynamic WCCPv2 services require further information to define the +# traffic you wish to have diverted. +# +# The format is: +# +# wccp2_service_info protocol= flags=,.. +# priority= ports=,.. +# +# The relevant WCCPv2 flags: +# + src_ip_hash, dst_ip_hash +# + source_port_hash, dst_port_hash +# + src_ip_alt_hash, dst_ip_alt_hash +# + src_port_alt_hash, dst_port_alt_hash +# + ports_source +# +# The port list can be one to eight entries. +# +# Example: +# +# wccp2_service_info 80 protocol=tcp flags=src_ip_hash,ports_source +# priority=240 ports=80 +# +# Note: the service id must have been defined by a previous +# 'wccp2_service dynamic ' entry. +#Default: +# none + +# TAG: wccp2_weight +# Each cache server gets assigned a set of the destination +# hash proportional to their weight. +#Default: +# wccp2_weight 10000 + +# TAG: wccp_address +# Use this option if you require WCCPv2 to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# TAG: wccp2_address +# Use this option if you require WCCP to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# PERSISTENT CONNECTION HANDLING +# ----------------------------------------------------------------------------- +# +# Also see "pconn_timeout" in the TIMEOUTS section + +# TAG: client_persistent_connections +# Persistent connection support for clients. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with clients. +#Default: +# client_persistent_connections on + +# TAG: server_persistent_connections +# Persistent connection support for servers. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with servers. +#Default: +# server_persistent_connections on + +# TAG: persistent_connection_after_error +# With this directive the use of persistent connections after +# HTTP errors can be disabled. Useful if you have clients +# who fail to handle errors on persistent connections proper. +#Default: +# persistent_connection_after_error on + +# TAG: detect_broken_pconn +# Some servers have been found to incorrectly signal the use +# of HTTP/1.0 persistent connections even on replies not +# compatible, causing significant delays. This server problem +# has mostly been seen on redirects. +# +# By enabling this directive Squid attempts to detect such +# broken replies and automatically assume the reply is finished +# after 10 seconds timeout. +#Default: +# detect_broken_pconn off + +# CACHE DIGEST OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: digest_generation +# This controls whether the server will generate a Cache Digest +# of its contents. By default, Cache Digest generation is +# enabled if Squid is compiled with --enable-cache-digests defined. +#Default: +# digest_generation on + +# TAG: digest_bits_per_entry +# This is the number of bits of the server's Cache Digest which +# will be associated with the Digest entry for a given HTTP +# Method and URL (public key) combination. The default is 5. +#Default: +# digest_bits_per_entry 5 + +# TAG: digest_rebuild_period (seconds) +# This is the wait time between Cache Digest rebuilds. +#Default: +# digest_rebuild_period 1 hour + +# TAG: digest_rewrite_period (seconds) +# This is the wait time between Cache Digest writes to +# disk. +#Default: +# digest_rewrite_period 1 hour + +# TAG: digest_swapout_chunk_size (bytes) +# This is the number of bytes of the Cache Digest to write to +# disk at a time. It defaults to 4096 bytes (4KB), the Squid +# default swap page. +#Default: +# digest_swapout_chunk_size 4096 bytes + +# TAG: digest_rebuild_chunk_percentage (percent, 0-100) +# This is the percentage of the Cache Digest to be scanned at a +# time. By default it is set to 10% of the Cache Digest. +#Default: +# digest_rebuild_chunk_percentage 10 + +# SNMP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: snmp_port +# The port number where Squid listens for SNMP requests. To enable +# SNMP support set this to a suitable port number. Port number +# 3401 is often used for the Squid SNMP agent. By default it's +# set to "0" (disabled) +# +# Example: +# snmp_port 3401 +#Default: +# SNMP disabled. + +# TAG: snmp_access +# Allowing or denying access to the SNMP port. +# +# All access to the agent is denied by default. +# usage: +# +# snmp_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# snmp_access allow snmppublic localhost +# snmp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: snmp_incoming_address +# Just like 'udp_incoming_address', but for the SNMP port. +# +# snmp_incoming_address is used for the SNMP socket receiving +# messages from SNMP agents. +# +# The default snmp_incoming_address is to listen on all +# available network interfaces. +#Default: +# Accept SNMP packets from all machine interfaces. + +# TAG: snmp_outgoing_address +# Just like 'udp_outgoing_address', but for the SNMP port. +# +# snmp_outgoing_address is used for SNMP packets returned to SNMP +# agents. +# +# If snmp_outgoing_address is not set it will use the same socket +# as snmp_incoming_address. Only change this if you want to have +# SNMP replies sent using another address than where this Squid +# listens for SNMP queries. +# +# NOTE, snmp_incoming_address and snmp_outgoing_address can not have +# the same value since they both use the same port. +#Default: +# Use snmp_incoming_address or an address selected by the operating system. + +# ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icp_port +# The port number where Squid sends and receives ICP queries to +# and from neighbor caches. The standard UDP port for ICP is 3130. +# +# Example: +# icp_port 3130 +#Default: +# ICP disabled. + +# TAG: htcp_port +# The port number where Squid sends and receives HTCP queries to +# and from neighbor caches. To turn it on you want to set it to +# 4827. +# +# Example: +# htcp_port 4827 +#Default: +# HTCP disabled. + +# TAG: log_icp_queries on|off +# If set, ICP queries are logged to access.log. You may wish +# do disable this if your ICP load is VERY high to speed things +# up or to simplify log analysis. +#Default: +# log_icp_queries on + +# TAG: udp_incoming_address +# udp_incoming_address is used for UDP packets received from other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Only change this if you want to have all UDP queries received on +# a specific interface/address. +# +# NOTE: udp_incoming_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_outgoing_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Accept packets from all machine interfaces. + +# TAG: udp_outgoing_address +# udp_outgoing_address is used for UDP packets sent out to other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Instead it will use the same socket as udp_incoming_address. +# Only change this if you want to have UDP queries sent using another +# address than where this Squid listens for UDP queries from other +# caches. +# +# NOTE: udp_outgoing_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_incoming_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Use udp_incoming_address or an address selected by the operating system. + +# TAG: icp_hit_stale on|off +# If you want to return ICP_HIT for stale cache objects, set this +# option to 'on'. If you have sibling relationships with caches +# in other administrative domains, this should be 'off'. If you only +# have sibling relationships with caches under your control, +# it is probably okay to set this to 'on'. +# If set to 'on', your siblings should use the option "allow-miss" +# on their cache_peer lines for connecting to you. +#Default: +# icp_hit_stale off + +# TAG: minimum_direct_hops +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many hops away. +#Default: +# minimum_direct_hops 4 + +# TAG: minimum_direct_rtt (msec) +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many rtt milliseconds away. +#Default: +# minimum_direct_rtt 400 + +# TAG: netdb_low +# The low water mark for the ICMP measurement database. +# +# Note: high watermark controlled by netdb_high directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_low 900 + +# TAG: netdb_high +# The high water mark for the ICMP measurement database. +# +# Note: low watermark controlled by netdb_low directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_high 1000 + +# TAG: netdb_ping_period +# The minimum period for measuring a site. There will be at +# least this much delay between successive pings to the same +# network. The default is five minutes. +#Default: +# netdb_ping_period 5 minutes + +# TAG: query_icmp on|off +# If you want to ask your peers to include ICMP data in their ICP +# replies, enable this option. +# +# If your peer has configured Squid (during compilation) with +# '--enable-icmp' that peer will send ICMP pings to origin server +# sites of the URLs it receives. If you enable this option the +# ICP replies from that peer will include the ICMP data (if available). +# Then, when choosing a parent cache, Squid will choose the parent with +# the minimal RTT to the origin server. When this happens, the +# hierarchy field of the access.log will be +# "CLOSEST_PARENT_MISS". This option is off by default. +#Default: +# query_icmp off + +# TAG: test_reachability on|off +# When this is 'on', ICP MISS replies will be ICP_MISS_NOFETCH +# instead of ICP_MISS if the target host is NOT in the ICMP +# database, or has a zero RTT. +#Default: +# test_reachability off + +# TAG: icp_query_timeout (msec) +# Normally Squid will automatically determine an optimal ICP +# query timeout value based on the round-trip-time of recent ICP +# queries. If you want to override the value determined by +# Squid, set this 'icp_query_timeout' to a non-zero value. This +# value is specified in MILLISECONDS, so, to use a 2-second +# timeout (the old default), you would write: +# +# icp_query_timeout 2000 +#Default: +# Dynamic detection. + +# TAG: maximum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very large values (say 5 seconds). +# Use this option to put an upper limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# maximum_icp_query_timeout 2000 + +# TAG: minimum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very small timeouts, even lower than +# the normal latency variance on your link due to traffic. +# Use this option to put an lower limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# minimum_icp_query_timeout 5 + +# TAG: background_ping_rate time-units +# Controls how often the ICP pings are sent to siblings that +# have background-ping set. +#Default: +# background_ping_rate 10 seconds + +# MULTICAST ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: mcast_groups +# This tag specifies a list of multicast groups which your server +# should join to receive multicasted ICP queries. +# +# NOTE! Be very careful what you put here! Be sure you +# understand the difference between an ICP _query_ and an ICP +# _reply_. This option is to be set only if you want to RECEIVE +# multicast queries. Do NOT set this option to SEND multicast +# ICP (use cache_peer for that). ICP replies are always sent via +# unicast, so this option does not affect whether or not you will +# receive replies from multicast group members. +# +# You must be very careful to NOT use a multicast address which +# is already in use by another group of caches. +# +# If you are unsure about multicast, please read the Multicast +# chapter in the Squid FAQ (http://www.squid-cache.org/FAQ/). +# +# Usage: mcast_groups 239.128.16.128 224.0.1.20 +# +# By default, Squid doesn't listen on any multicast groups. +#Default: +# none + +# TAG: mcast_miss_addr +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# If you enable this option, every "cache miss" URL will +# be sent out on the specified multicast address. +# +# Do not enable this option unless you are are absolutely +# certain you understand what you are doing. +#Default: +# disabled. + +# TAG: mcast_miss_ttl +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the time-to-live value for packets multicasted +# when multicasting off cache miss URLs is enabled. By +# default this is set to 'site scope', i.e. 16. +#Default: +# mcast_miss_ttl 16 + +# TAG: mcast_miss_port +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the port number to be used in conjunction with +# 'mcast_miss_addr'. +#Default: +# mcast_miss_port 3135 + +# TAG: mcast_miss_encode_key +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# The URLs that are sent in the multicast miss stream are +# encrypted. This is the encryption key. +#Default: +# mcast_miss_encode_key XXXXXXXXXXXXXXXX + +# TAG: mcast_icp_query_timeout (msec) +# For multicast peers, Squid regularly sends out ICP "probes" to +# count how many other peers are listening on the given multicast +# address. This value specifies how long Squid should wait to +# count all the replies. The default is 2000 msec, or 2 +# seconds. +#Default: +# mcast_icp_query_timeout 2000 + +# INTERNAL ICON OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icon_directory +# Where the icons are stored. These are normally kept in +# /usr/share/squid/icons +#Default: +# icon_directory /usr/share/squid/icons + +# TAG: global_internal_static +# This directive controls is Squid should intercept all requests for +# /squid-internal-static/ no matter which host the URL is requesting +# (default on setting), or if nothing special should be done for +# such URLs (off setting). The purpose of this directive is to make +# icons etc work better in complex cache hierarchies where it may +# not always be possible for all corners in the cache mesh to reach +# the server generating a directory listing. +#Default: +# global_internal_static on + +# TAG: short_icon_urls +# If this is enabled Squid will use short URLs for icons. +# If disabled it will revert to the old behavior of including +# it's own name and port in the URL. +# +# If you run a complex cache hierarchy with a mix of Squid and +# other proxies you may need to disable this directive. +#Default: +# short_icon_urls on + +# ERROR PAGE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: error_directory +# If you wish to create your own versions of the default +# error files to customize them to suit your company copy +# the error/template files to another directory and point +# this tag at them. +# +# WARNING: This option will disable multi-language support +# on error pages if used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are making translations for a +# language that Squid does not currently provide please consider +# contributing your translation back to the project. +# http://wiki.squid-cache.org/Translations +# +# The squid developers working on translations are happy to supply drop-in +# translated error files in exchange for any new language contributions. +#Default: +# Send error pages in the clients preferred language + +# TAG: error_default_language +# Set the default language which squid will send error pages in +# if no existing translation matches the clients language +# preferences. +# +# If unset (default) generic English will be used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are interested in making +# translations for any language see the squid wiki for details. +# http://wiki.squid-cache.org/Translations +#Default: +# Generate English language pages. + +# TAG: error_log_languages +# Log to cache.log what languages users are attempting to +# auto-negotiate for translations. +# +# Successful negotiations are not logged. Only failures +# have meaning to indicate that Squid may need an upgrade +# of its error page translations. +#Default: +# error_log_languages on + +# TAG: err_page_stylesheet +# CSS Stylesheet to pattern the display of Squid default error pages. +# +# For information on CSS see http://www.w3.org/Style/CSS/ +#Default: +# err_page_stylesheet /etc/squid/errorpage.css + +# TAG: err_html_text +# HTML text to include in error messages. Make this a "mailto" +# URL to your admin address, or maybe just a link to your +# organizations Web page. +# +# To include this in your error messages, you must rewrite +# the error template files (found in the "errors" directory). +# Wherever you want the 'err_html_text' line to appear, +# insert a %L tag in the error template file. +#Default: +# none + +# TAG: email_err_data on|off +# If enabled, information about the occurred error will be +# included in the mailto links of the ERR pages (if %W is set) +# so that the email body contains the data. +# Syntax is %w +#Default: +# email_err_data on + +# TAG: deny_info +# Usage: deny_info err_page_name acl +# or deny_info http://... acl +# or deny_info TCP_RESET acl +# +# This can be used to return a ERR_ page for requests which +# do not pass the 'http_access' rules. Squid remembers the last +# acl it evaluated in http_access, and if a 'deny_info' line exists +# for that ACL Squid returns a corresponding error page. +# +# The acl is typically the last acl on the http_access deny line which +# denied access. The exceptions to this rule are: +# - When Squid needs to request authentication credentials. It's then +# the first authentication related acl encountered +# - When none of the http_access lines matches. It's then the last +# acl processed on the last http_access line. +# - When the decision to deny access was made by an adaptation service, +# the acl name is the corresponding eCAP or ICAP service_name. +# +# NP: If providing your own custom error pages with error_directory +# you may also specify them by your custom file name: +# Example: deny_info ERR_CUSTOM_ACCESS_DENIED bad_guys +# +# By defaut Squid will send "403 Forbidden". A different 4xx or 5xx +# may be specified by prefixing the file name with the code and a colon. +# e.g. 404:ERR_CUSTOM_ACCESS_DENIED +# +# Alternatively you can tell Squid to reset the TCP connection +# by specifying TCP_RESET. +# +# Or you can specify an error URL or URL pattern. The browsers will +# get redirected to the specified URL after formatting tags have +# been replaced. Redirect will be done with 302 or 307 according to +# HTTP/1.1 specs. A different 3xx code may be specified by prefixing +# the URL. e.g. 303:http://example.com/ +# +# URL FORMAT TAGS: +# %a - username (if available. Password NOT included) +# %B - FTP path URL +# %e - Error number +# %E - Error description +# %h - Squid hostname +# %H - Request domain name +# %i - Client IP Address +# %M - Request Method +# %o - Message result from external ACL helper +# %p - Request Port number +# %P - Request Protocol name +# %R - Request URL path +# %T - Timestamp in RFC 1123 format +# %U - Full canonical URL from client +# (HTTPS URLs terminate with *) +# %u - Full canonical URL from client +# %w - Admin email from squid.conf +# %x - Error name +# %% - Literal percent (%) code +# +#Default: +# none + +# OPTIONS INFLUENCING REQUEST FORWARDING +# ----------------------------------------------------------------------------- + +# TAG: nonhierarchical_direct +# By default, Squid will send any non-hierarchical requests +# (not cacheable request type) direct to origin servers. +# +# When this is set to "off", Squid will prefer to send these +# requests to parents. +# +# Note that in most configurations, by turning this off you will only +# add latency to these request without any improvement in global hit +# ratio. +# +# This option only sets a preference. If the parent is unavailable a +# direct connection to the origin server may still be attempted. To +# completely prevent direct connections use never_direct. +#Default: +# nonhierarchical_direct on + +# TAG: prefer_direct +# Normally Squid tries to use parents for most requests. If you for some +# reason like it to first try going direct and only use a parent if +# going direct fails set this to on. +# +# By combining nonhierarchical_direct off and prefer_direct on you +# can set up Squid to use a parent as a backup path if going direct +# fails. +# +# Note: If you want Squid to use parents for all requests see +# the never_direct directive. prefer_direct only modifies how Squid +# acts on cacheable requests. +#Default: +# prefer_direct off + +# TAG: cache_miss_revalidate on|off +# RFC 7232 defines a conditional request mechanism to prevent +# response objects being unnecessarily transferred over the network. +# If that mechanism is used by the client and a cache MISS occurs +# it can prevent new cache entries being created. +# +# This option determines whether Squid on cache MISS will pass the +# client revalidation request to the server or tries to fetch new +# content for caching. It can be useful while the cache is mostly +# empty to more quickly have the cache populated by generating +# non-conditional GETs. +# +# When set to 'on' (default), Squid will pass all client If-* headers +# to the server. This permits server responses without a cacheable +# payload to be delivered and on MISS no new cache entry is created. +# +# When set to 'off' and if the request is cacheable, Squid will +# remove the clients If-Modified-Since and If-None-Match headers from +# the request sent to the server. This requests a 200 status response +# from the server to create a new cache entry with. +#Default: +# cache_miss_revalidate on + +# TAG: always_direct +# Usage: always_direct allow|deny [!]aclname ... +# +# Here you can use ACL elements to specify requests which should +# ALWAYS be forwarded by Squid to the origin servers without using +# any peers. For example, to always directly forward requests for +# local servers ignoring any parents or siblings you may have use +# something like: +# +# acl local-servers dstdomain my.domain.net +# always_direct allow local-servers +# +# To always forward FTP requests directly, use +# +# acl FTP proto FTP +# always_direct allow FTP +# +# NOTE: There is a similar, but opposite option named +# 'never_direct'. You need to be aware that "always_direct deny +# foo" is NOT the same thing as "never_direct allow foo". You +# may need to use a deny rule to exclude a more-specific case of +# some other rule. Example: +# +# acl local-external dstdomain external.foo.net +# acl local-servers dstdomain .foo.net +# always_direct deny local-external +# always_direct allow local-servers +# +# NOTE: If your goal is to make the client forward the request +# directly to the origin server bypassing Squid then this needs +# to be done in the client configuration. Squid configuration +# can only tell Squid how Squid should fetch the object. +# +# NOTE: This directive is not related to caching. The replies +# is cached as usual even if you use always_direct. To not cache +# the replies see the 'cache' directive. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Prevent any cache_peer being used for this request. + +# TAG: never_direct +# Usage: never_direct allow|deny [!]aclname ... +# +# never_direct is the opposite of always_direct. Please read +# the description for always_direct if you have not already. +# +# With 'never_direct' you can use ACL elements to specify +# requests which should NEVER be forwarded directly to origin +# servers. For example, to force the use of a proxy for all +# requests, except those in your local domain use something like: +# +# acl local-servers dstdomain .foo.net +# never_direct deny local-servers +# never_direct allow all +# +# or if Squid is inside a firewall and there are local intranet +# servers inside the firewall use something like: +# +# acl local-intranet dstdomain .foo.net +# acl local-external dstdomain external.foo.net +# always_direct deny local-external +# always_direct allow local-intranet +# never_direct allow all +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow DNS results to be used for this request. + +# ADVANCED NETWORKING OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: incoming_udp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_udp_average 6 + +# TAG: incoming_tcp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_tcp_average 4 + +# TAG: incoming_dns_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_dns_average 4 + +# TAG: min_udp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_udp_poll_cnt 8 + +# TAG: min_dns_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_dns_poll_cnt 8 + +# TAG: min_tcp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_tcp_poll_cnt 8 + +# TAG: accept_filter +# FreeBSD: +# +# The name of an accept(2) filter to install on Squid's +# listen socket(s). This feature is perhaps specific to +# FreeBSD and requires support in the kernel. +# +# The 'httpready' filter delays delivering new connections +# to Squid until a full HTTP request has been received. +# See the accf_http(9) man page for details. +# +# The 'dataready' filter delays delivering new connections +# to Squid until there is some data to process. +# See the accf_dataready(9) man page for details. +# +# Linux: +# +# The 'data' filter delays delivering of new connections +# to Squid until there is some data to process by TCP_ACCEPT_DEFER. +# You may optionally specify a number of seconds to wait by +# 'data=N' where N is the number of seconds. Defaults to 30 +# if not specified. See the tcp(7) man page for details. +#EXAMPLE: +## FreeBSD +#accept_filter httpready +## Linux +#accept_filter data +#Default: +# none + +# TAG: client_ip_max_connections +# Set an absolute limit on the number of connections a single +# client IP can use. Any more than this and Squid will begin to drop +# new connections from the client until it closes some links. +# +# Note that this is a global limit. It affects all HTTP, HTCP, Gopher and FTP +# connections from the client. For finer control use the ACL access controls. +# +# Requires client_db to be enabled (the default). +# +# WARNING: This may noticably slow down traffic received via external proxies +# or NAT devices and cause them to rebound error messages back to their clients. +#Default: +# No limit. + +# TAG: tcp_recv_bufsize (bytes) +# Size of receive buffer to set for TCP sockets. Probably just +# as easy to change your kernel's default. +# Omit from squid.conf to use the default buffer size. +#Default: +# Use operating system TCP defaults. + +# ICAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icap_enable on|off +# If you want to enable the ICAP module support, set this to on. +#Default: +# icap_enable off + +# TAG: icap_connect_timeout +# This parameter specifies how long to wait for the TCP connect to +# the requested ICAP server to complete before giving up and either +# terminating the HTTP transaction or bypassing the failure. +# +# The default for optional services is peer_connect_timeout. +# The default for essential services is connect_timeout. +# If this option is explicitly set, its value applies to all services. +#Default: +# none + +# TAG: icap_io_timeout time-units +# This parameter specifies how long to wait for an I/O activity on +# an established, active ICAP connection before giving up and +# either terminating the HTTP transaction or bypassing the +# failure. +#Default: +# Use read_timeout. + +# TAG: icap_service_failure_limit limit [in memory-depth time-units] +# The limit specifies the number of failures that Squid tolerates +# when establishing a new TCP connection with an ICAP service. If +# the number of failures exceeds the limit, the ICAP service is +# not used for new ICAP requests until it is time to refresh its +# OPTIONS. +# +# A negative value disables the limit. Without the limit, an ICAP +# service will not be considered down due to connectivity failures +# between ICAP OPTIONS requests. +# +# Squid forgets ICAP service failures older than the specified +# value of memory-depth. The memory fading algorithm +# is approximate because Squid does not remember individual +# errors but groups them instead, splitting the option +# value into ten time slots of equal length. +# +# When memory-depth is 0 and by default this option has no +# effect on service failure expiration. +# +# Squid always forgets failures when updating service settings +# using an ICAP OPTIONS transaction, regardless of this option +# setting. +# +# For example, +# # suspend service usage after 10 failures in 5 seconds: +# icap_service_failure_limit 10 in 5 seconds +#Default: +# icap_service_failure_limit 10 + +# TAG: icap_service_revival_delay +# The delay specifies the number of seconds to wait after an ICAP +# OPTIONS request failure before requesting the options again. The +# failed ICAP service is considered "down" until fresh OPTIONS are +# fetched. +# +# The actual delay cannot be smaller than the hardcoded minimum +# delay of 30 seconds. +#Default: +# icap_service_revival_delay 180 + +# TAG: icap_preview_enable on|off +# The ICAP Preview feature allows the ICAP server to handle the +# HTTP message by looking only at the beginning of the message body +# or even without receiving the body at all. In some environments, +# previews greatly speedup ICAP processing. +# +# During an ICAP OPTIONS transaction, the server may tell Squid what +# HTTP messages should be previewed and how big the preview should be. +# Squid will not use Preview if the server did not request one. +# +# To disable ICAP Preview for all ICAP services, regardless of +# individual ICAP server OPTIONS responses, set this option to "off". +#Example: +#icap_preview_enable off +#Default: +# icap_preview_enable on + +# TAG: icap_preview_size +# The default size of preview data to be sent to the ICAP server. +# This value might be overwritten on a per server basis by OPTIONS requests. +#Default: +# No preview sent. + +# TAG: icap_206_enable on|off +# 206 (Partial Content) responses is an ICAP extension that allows the +# ICAP agents to optionally combine adapted and original HTTP message +# content. The decision to combine is postponed until the end of the +# ICAP response. Squid supports Partial Content extension by default. +# +# Activation of the Partial Content extension is negotiated with each +# ICAP service during OPTIONS exchange. Most ICAP servers should handle +# negotation correctly even if they do not support the extension, but +# some might fail. To disable Partial Content support for all ICAP +# services and to avoid any negotiation, set this option to "off". +# +# Example: +# icap_206_enable off +#Default: +# icap_206_enable on + +# TAG: icap_default_options_ttl +# The default TTL value for ICAP OPTIONS responses that don't have +# an Options-TTL header. +#Default: +# icap_default_options_ttl 60 + +# TAG: icap_persistent_connections on|off +# Whether or not Squid should use persistent connections to +# an ICAP server. +#Default: +# icap_persistent_connections on + +# TAG: adaptation_send_client_ip on|off +# If enabled, Squid shares HTTP client IP information with adaptation +# services. For ICAP, Squid adds the X-Client-IP header to ICAP requests. +# For eCAP, Squid sets the libecap::metaClientIp transaction option. +# +# See also: adaptation_uses_indirect_client +#Default: +# adaptation_send_client_ip off + +# TAG: adaptation_send_username on|off +# This sends authenticated HTTP client username (if available) to +# the adaptation service. +# +# For ICAP, the username value is encoded based on the +# icap_client_username_encode option and is sent using the header +# specified by the icap_client_username_header option. +#Default: +# adaptation_send_username off + +# TAG: icap_client_username_header +# ICAP request header name to use for adaptation_send_username. +#Default: +# icap_client_username_header X-Client-Username + +# TAG: icap_client_username_encode on|off +# Whether to base64 encode the authenticated client username. +#Default: +# icap_client_username_encode off + +# TAG: icap_service +# Defines a single ICAP service using the following format: +# +# icap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# ICAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: icap://servername:port/servicepath +# ICAP server and service location. +# +# ICAP does not allow a single service to handle both REQMOD and RESPMOD +# transactions. Squid does not enforce that requirement. You can specify +# services with the same service_url and different vectoring_points. You +# can even specify multiple identical services as long as their +# service_names differ. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. ICAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the ICAP service is treated as +# optional. If the service cannot be reached or malfunctions, +# Squid will try to ignore any errors and process the message as +# if the service was not enabled. No all ICAP errors can be +# bypassed. If set to 0, the ICAP service is treated as +# essential and all ICAP errors will result in an error page +# returned to the HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the ICAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. The services +# are specified using the X-Next-Services ICAP response header +# value, formatted as a comma-separated list of service names. +# Each named service should be configured in squid.conf. Other +# services are ignored. An empty X-Next-Services value results +# in an empty plan which ends the current adaptation. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default: the ICAP X-Next-Services +# response header is ignored. +# +# ipv6=on|off +# Only has effect on split-stack systems. The default on those systems +# is to use IPv4-only connections. When set to 'on' this option will +# make Squid use IPv6-only connections to contact this ICAP service. +# +# on-overload=block|bypass|wait|force +# If the service Max-Connections limit has been reached, do +# one of the following for each new ICAP transaction: +# * block: send an HTTP error response to the client +# * bypass: ignore the "over-connected" ICAP service +# * wait: wait (in a FIFO queue) for an ICAP connection slot +# * force: proceed, ignoring the Max-Connections limit +# +# In SMP mode with N workers, each worker assumes the service +# connection limit is Max-Connections/N, even though not all +# workers may use a given service. +# +# The default value is "bypass" if service is bypassable, +# otherwise it is set to "wait". +# +# +# max-conn=number +# Use the given number as the Max-Connections limit, regardless +# of the Max-Connections value given by the service, if any. +# +# Older icap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +#Example: +#icap_service svcBlocker reqmod_precache icap://icap1.mydomain.net:1344/reqmod bypass=0 +#icap_service svcLogger reqmod_precache icap://icap2.mydomain.net:1344/respmod routing=on +#Default: +# none + +# TAG: icap_class +# This deprecated option was documented to define an ICAP service +# chain, even though it actually defined a set of similar, redundant +# services, and the chains were not supported. +# +# To define a set of redundant services, please use the +# adaptation_service_set directive. For service chains, use +# adaptation_service_chain. +#Default: +# none + +# TAG: icap_access +# This option is deprecated. Please use adaptation_access, which +# has the same ICAP functionality, but comes with better +# documentation, and eCAP support. +#Default: +# none + +# eCAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ecap_enable on|off +# Controls whether eCAP support is enabled. +#Default: +# ecap_enable off + +# TAG: ecap_service +# Defines a single eCAP service +# +# ecap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# eCAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: ecap://vendor/service_name?custom&cgi=style¶meters=optional +# Squid uses the eCAP service URI to match this configuration +# line with one of the dynamically loaded services. Each loaded +# eCAP service must have a unique URI. Obtain the right URI from +# the service provider. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. eCAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the eCAP service is treated as optional. +# If the service cannot be reached or malfunctions, Squid will try +# to ignore any errors and process the message as if the service +# was not enabled. No all eCAP errors can be bypassed. +# If set to 'off' or '0', the eCAP service is treated as essential +# and all eCAP errors will result in an error page returned to the +# HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the eCAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default. +# +# Older ecap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +# +#Example: +#ecap_service s1 reqmod_precache ecap://filters.R.us/leakDetector?on_error=block bypass=off +#ecap_service s2 respmod_precache ecap://filters.R.us/virusFilter config=/etc/vf.cfg bypass=on +#Default: +# none + +# TAG: loadable_modules +# Instructs Squid to load the specified dynamic module(s) or activate +# preloaded module(s). +#Example: +#loadable_modules /usr/lib/MinimalAdapter.so +#Default: +# none + +# MESSAGE ADAPTATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: adaptation_service_set +# +# Configures an ordered set of similar, redundant services. This is +# useful when hot standby or backup adaptation servers are available. +# +# adaptation_service_set set_name service_name1 service_name2 ... +# +# The named services are used in the set declaration order. The first +# applicable adaptation service from the set is used first. The next +# applicable service is tried if and only if the transaction with the +# previous service fails and the message waiting to be adapted is still +# intact. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the set. A broken service is a down optional service. +# +# The services in a set must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# If all services in a set are optional then adaptation failures are +# bypassable. If all services in the set are essential, then a +# transaction failure with one service may still be retried using +# another service from the set, but when all services fail, the master +# transaction fails as well. +# +# A set may contain a mix of optional and essential services, but that +# is likely to lead to surprising results because broken services become +# ignored (see above), making previously bypassable failures fatal. +# Technically, it is the bypassability of the last failed service that +# matters. +# +# See also: adaptation_access adaptation_service_chain +# +#Example: +#adaptation_service_set svcBlocker urlFilterPrimary urlFilterBackup +#adaptation service_set svcLogger loggerLocal loggerRemote +#Default: +# none + +# TAG: adaptation_service_chain +# +# Configures a list of complementary services that will be applied +# one-by-one, forming an adaptation chain or pipeline. This is useful +# when Squid must perform different adaptations on the same message. +# +# adaptation_service_chain chain_name service_name1 svc_name2 ... +# +# The named services are used in the chain declaration order. The first +# applicable adaptation service from the chain is used first. The next +# applicable service is applied to the successful adaptation results of +# the previous service in the chain. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the chain. A broken service is a down optional service. +# +# Request satisfaction terminates the adaptation chain because Squid +# does not currently allow declaration of RESPMOD services at the +# "reqmod_precache" vectoring point (see icap_service or ecap_service). +# +# The services in a chain must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# A chain may contain a mix of optional and essential services. If an +# essential adaptation fails (or the failure cannot be bypassed for +# other reasons), the master transaction fails. Otherwise, the failure +# is bypassed as if the failed adaptation service was not in the chain. +# +# See also: adaptation_access adaptation_service_set +# +#Example: +#adaptation_service_chain svcRequest requestLogger urlFilter leakDetector +#Default: +# none + +# TAG: adaptation_access +# Sends an HTTP transaction to an ICAP or eCAP adaptation service. +# +# adaptation_access service_name allow|deny [!]aclname... +# adaptation_access set_name allow|deny [!]aclname... +# +# At each supported vectoring point, the adaptation_access +# statements are processed in the order they appear in this +# configuration file. Statements pointing to the following services +# are ignored (i.e., skipped without checking their ACL): +# +# - services serving different vectoring points +# - "broken-but-bypassable" services +# - "up" services configured to ignore such transactions +# (e.g., based on the ICAP Transfer-Ignore header). +# +# When a set_name is used, all services in the set are checked +# using the same rules, to find the first applicable one. See +# adaptation_service_set for details. +# +# If an access list is checked and there is a match, the +# processing stops: For an "allow" rule, the corresponding +# adaptation service is used for the transaction. For a "deny" +# rule, no adaptation service is activated. +# +# It is currently not possible to apply more than one adaptation +# service at the same vectoring point to the same HTTP transaction. +# +# See also: icap_service and ecap_service +# +#Example: +#adaptation_access service_1 allow all +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: adaptation_service_iteration_limit +# Limits the number of iterations allowed when applying adaptation +# services to a message. If your longest adaptation set or chain +# may have more than 16 services, increase the limit beyond its +# default value of 16. If detecting infinite iteration loops sooner +# is critical, make the iteration limit match the actual number +# of services in your longest adaptation set or chain. +# +# Infinite adaptation loops are most likely with routing services. +# +# See also: icap_service routing=1 +#Default: +# adaptation_service_iteration_limit 16 + +# TAG: adaptation_masterx_shared_names +# For each master transaction (i.e., the HTTP request and response +# sequence, including all related ICAP and eCAP exchanges), Squid +# maintains a table of metadata. The table entries are (name, value) +# pairs shared among eCAP and ICAP exchanges. The table is destroyed +# with the master transaction. +# +# This option specifies the table entry names that Squid must accept +# from and forward to the adaptation transactions. +# +# An ICAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by returning an ICAP header field with a name +# specified in adaptation_masterx_shared_names. +# +# An eCAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by implementing the libecap::visitEachOption() API +# to provide an option with a name specified in +# adaptation_masterx_shared_names. +# +# Squid will store and forward the set entry to subsequent adaptation +# transactions within the same master transaction scope. +# +# Only one shared entry name is supported at this time. +# +#Example: +## share authentication information among ICAP services +#adaptation_masterx_shared_names X-Subscriber-ID +#Default: +# none + +# TAG: adaptation_meta +# This option allows Squid administrator to add custom ICAP request +# headers or eCAP options to Squid ICAP requests or eCAP transactions. +# Use it to pass custom authentication tokens and other +# transaction-state related meta information to an ICAP/eCAP service. +# +# The addition of a meta header is ACL-driven: +# adaptation_meta name value [!]aclname ... +# +# Processing for a given header name stops after the first ACL list match. +# Thus, it is impossible to add two headers with the same name. If no ACL +# lists match for a given header name, no such header is added. For +# example: +# +# # do not debug transactions except for those that need debugging +# adaptation_meta X-Debug 1 needs_debugging +# +# # log all transactions except for those that must remain secret +# adaptation_meta X-Log 1 !keep_secret +# +# # mark transactions from users in the "G 1" group +# adaptation_meta X-Authenticated-Groups "G 1" authed_as_G1 +# +# The "value" parameter may be a regular squid.conf token or a "double +# quoted string". Within the quoted string, use backslash (\) to escape +# any character, which is currently only useful for escaping backslashes +# and double quotes. For example, +# "this string has one backslash (\\) and two \"quotes\"" +# +# Used adaptation_meta header values may be logged via %note +# logformat code. If multiple adaptation_meta headers with the same name +# are used during master transaction lifetime, the header values are +# logged in the order they were used and duplicate values are ignored +# (only the first repeated value will be logged). +#Default: +# none + +# TAG: icap_retry +# This ACL determines which retriable ICAP transactions are +# retried. Transactions that received a complete ICAP response +# and did not have to consume or produce HTTP bodies to receive +# that response are usually retriable. +# +# icap_retry allow|deny [!]aclname ... +# +# Squid automatically retries some ICAP I/O timeouts and errors +# due to persistent connection race conditions. +# +# See also: icap_retry_limit +#Default: +# icap_retry deny all + +# TAG: icap_retry_limit +# Limits the number of retries allowed. +# +# Communication errors due to persistent connection race +# conditions are unavoidable, automatically retried, and do not +# count against this limit. +# +# See also: icap_retry +#Default: +# No retries are allowed. + +# DNS OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: check_hostnames +# For security and stability reasons Squid can check +# hostnames for Internet standard RFC compliance. If you want +# Squid to perform these checks turn this directive on. +#Default: +# check_hostnames off + +# TAG: allow_underscore +# Underscore characters is not strictly allowed in Internet hostnames +# but nevertheless used by many sites. Set this to off if you want +# Squid to be strict about the standard. +# This check is performed only when check_hostnames is set to on. +#Default: +# allow_underscore on + +# TAG: dns_retransmit_interval +# Initial retransmit interval for DNS queries. The interval is +# doubled each time all configured DNS servers have been tried. +#Default: +# dns_retransmit_interval 5 seconds + +# TAG: dns_timeout +# DNS Query timeout. If no response is received to a DNS query +# within this time all DNS servers for the queried domain +# are assumed to be unavailable. +#Default: +# dns_timeout 30 seconds + +# TAG: dns_packet_max +# Maximum number of bytes packet size to advertise via EDNS. +# Set to "none" to disable EDNS large packet support. +# +# For legacy reasons DNS UDP replies will default to 512 bytes which +# is too small for many responses. EDNS provides a means for Squid to +# negotiate receiving larger responses back immediately without having +# to failover with repeat requests. Responses larger than this limit +# will retain the old behaviour of failover to TCP DNS. +# +# Squid has no real fixed limit internally, but allowing packet sizes +# over 1500 bytes requires network jumbogram support and is usually not +# necessary. +# +# WARNING: The RFC also indicates that some older resolvers will reply +# with failure of the whole request if the extension is added. Some +# resolvers have already been identified which will reply with mangled +# EDNS response on occasion. Usually in response to many-KB jumbogram +# sizes being advertised by Squid. +# Squid will currently treat these both as an unable-to-resolve domain +# even if it would be resolvable without EDNS. +#Default: +# EDNS disabled + +# TAG: dns_defnames on|off +# Normally the RES_DEFNAMES resolver option is disabled +# (see res_init(3)). This prevents caches in a hierarchy +# from interpreting single-component hostnames locally. To allow +# Squid to handle single-component names, enable this option. +#Default: +# Search for single-label domain names is disabled. + +# TAG: dns_multicast_local on|off +# When set to on, Squid sends multicast DNS lookups on the local +# network for domains ending in .local and .arpa. +# This enables local servers and devices to be contacted in an +# ad-hoc or zero-configuration network environment. +#Default: +# Search for .local and .arpa names is disabled. + +# TAG: dns_nameservers +# Use this if you want to specify a list of DNS name servers +# (IP addresses) to use instead of those given in your +# /etc/resolv.conf file. +# +# On Windows platforms, if no value is specified here or in +# the /etc/resolv.conf file, the list of DNS name servers are +# taken from the Windows registry, both static and dynamic DHCP +# configurations are supported. +# +# Example: dns_nameservers 10.0.0.1 192.172.0.4 +#Default: +# Use operating system definitions + +# TAG: hosts_file +# Location of the host-local IP name-address associations +# database. Most Operating Systems have such a file on different +# default locations: +# - Un*X & Linux: /etc/hosts +# - Windows NT/2000: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\winnt) +# - Windows XP/2003: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\windows) +# - Windows 9x/Me: %windir%\hosts +# (%windir% value is usually c:\windows) +# - Cygwin: /etc/hosts +# +# The file contains newline-separated definitions, in the +# form ip_address_in_dotted_form name [name ...] names are +# whitespace-separated. Lines beginning with an hash (#) +# character are comments. +# +# The file is checked at startup and upon configuration. +# If set to 'none', it won't be checked. +# If append_domain is used, that domain will be added to +# domain-local (i.e. not containing any dot character) host +# definitions. +#Default: +# hosts_file /etc/hosts + +# TAG: append_domain +# Appends local domain name to hostnames without any dots in +# them. append_domain must begin with a period. +# +# Be warned there are now Internet names with no dots in +# them using only top-domain names, so setting this may +# cause some Internet sites to become unavailable. +# +#Example: +# append_domain .yourdomain.com +#Default: +# Use operating system definitions + +# TAG: ignore_unknown_nameservers +# By default Squid checks that DNS responses are received +# from the same IP addresses they are sent to. If they +# don't match, Squid ignores the response and writes a warning +# message to cache.log. You can allow responses from unknown +# nameservers by setting this option to 'off'. +#Default: +# ignore_unknown_nameservers on + +# TAG: dns_v4_first +# With the IPv6 Internet being as fast or faster than IPv4 Internet +# for most networks Squid prefers to contact websites over IPv6. +# +# This option reverses the order of preference to make Squid contact +# dual-stack websites over IPv4 first. Squid will still perform both +# IPv6 and IPv4 DNS lookups before connecting. +# +# WARNING: +# This option will restrict the situations under which IPv6 +# connectivity is used (and tested), potentially hiding network +# problems which would otherwise be detected and warned about. +#Default: +# dns_v4_first off + +# TAG: ipcache_size (number of entries) +# Maximum number of DNS IP cache entries. +#Default: +# ipcache_size 1024 + +# TAG: ipcache_low (percent) +#Default: +# ipcache_low 90 + +# TAG: ipcache_high (percent) +# The size, low-, and high-water marks for the IP cache. +#Default: +# ipcache_high 95 + +# TAG: fqdncache_size (number of entries) +# Maximum number of FQDN cache entries. +#Default: +# fqdncache_size 1024 + +# MISCELLANEOUS +# ----------------------------------------------------------------------------- + +# TAG: configuration_includes_quoted_values on|off +# If set, Squid will recognize each "quoted string" after a configuration +# directive as a single parameter. The quotes are stripped before the +# parameter value is interpreted or used. +# See "Values with spaces, quotes, and other special characters" +# section for more details. +#Default: +# configuration_includes_quoted_values off + +# TAG: memory_pools on|off +# If set, Squid will keep pools of allocated (but unused) memory +# available for future use. If memory is a premium on your +# system and you believe your malloc library outperforms Squid +# routines, disable this. +#Default: +# memory_pools on + +# TAG: memory_pools_limit (bytes) +# Used only with memory_pools on: +# memory_pools_limit 50 MB +# +# If set to a non-zero value, Squid will keep at most the specified +# limit of allocated (but unused) memory in memory pools. All free() +# requests that exceed this limit will be handled by your malloc +# library. Squid does not pre-allocate any memory, just safe-keeps +# objects that otherwise would be free()d. Thus, it is safe to set +# memory_pools_limit to a reasonably high value even if your +# configuration will use less memory. +# +# If set to none, Squid will keep all memory it can. That is, there +# will be no limit on the total amount of memory used for safe-keeping. +# +# To disable memory allocation optimization, do not set +# memory_pools_limit to 0 or none. Set memory_pools to "off" instead. +# +# An overhead for maintaining memory pools is not taken into account +# when the limit is checked. This overhead is close to four bytes per +# object kept. However, pools may actually _save_ memory because of +# reduced memory thrashing in your malloc library. +#Default: +# memory_pools_limit 5 MB + +# TAG: forwarded_for on|off|transparent|truncate|delete +# If set to "on", Squid will append your client's IP address +# in the HTTP requests it forwards. By default it looks like: +# +# X-Forwarded-For: 192.1.2.3 +# +# If set to "off", it will appear as +# +# X-Forwarded-For: unknown +# +# If set to "transparent", Squid will not alter the +# X-Forwarded-For header in any way. +# +# If set to "delete", Squid will delete the entire +# X-Forwarded-For header. +# +# If set to "truncate", Squid will remove all existing +# X-Forwarded-For entries, and place the client IP as the sole entry. +#Default: +# forwarded_for on + +# TAG: cachemgr_passwd +# Specify passwords for cachemgr operations. +# +# Usage: cachemgr_passwd password action action ... +# +# Some valid actions are (see cache manager menu for a full list): +# 5min +# 60min +# asndb +# authenticator +# cbdata +# client_list +# comm_incoming +# config * +# counters +# delay +# digest_stats +# dns +# events +# filedescriptors +# fqdncache +# histograms +# http_headers +# info +# io +# ipcache +# mem +# menu +# netdb +# non_peers +# objects +# offline_toggle * +# pconn +# peer_select +# reconfigure * +# redirector +# refresh +# server_list +# shutdown * +# store_digest +# storedir +# utilization +# via_headers +# vm_objects +# +# * Indicates actions which will not be performed without a +# valid password, others can be performed if not listed here. +# +# To disable an action, set the password to "disable". +# To allow performing an action without a password, set the +# password to "none". +# +# Use the keyword "all" to set the same password for all actions. +# +#Example: +# cachemgr_passwd secret shutdown +# cachemgr_passwd lesssssssecret info stats/objects +# cachemgr_passwd disable all +#Default: +# No password. Actions which require password are denied. + +# TAG: client_db on|off +# If you want to disable collecting per-client statistics, +# turn off client_db here. +#Default: +# client_db on + +# TAG: refresh_all_ims on|off +# When you enable this option, squid will always check +# the origin server for an update when a client sends an +# If-Modified-Since request. Many browsers use IMS +# requests when the user requests a reload, and this +# ensures those clients receive the latest version. +# +# By default (off), squid may return a Not Modified response +# based on the age of the cached version. +#Default: +# refresh_all_ims off + +# TAG: reload_into_ims on|off +# When you enable this option, client no-cache or ``reload'' +# requests will be changed to If-Modified-Since requests. +# Doing this VIOLATES the HTTP standard. Enabling this +# feature could make you liable for problems which it +# causes. +# +# see also refresh_pattern for a more selective approach. +#Default: +# reload_into_ims off + +# TAG: connect_retries +# This sets the maximum number of connection attempts made for each +# TCP connection. The connect_retries attempts must all still +# complete within the connection timeout period. +# +# The default is not to re-try if the first connection attempt fails. +# The (not recommended) maximum is 10 tries. +# +# A warning message will be generated if it is set to a too-high +# value and the configured value will be over-ridden. +# +# Note: These re-tries are in addition to forward_max_tries +# which limit how many different addresses may be tried to find +# a useful server. +#Default: +# Do not retry failed connections. + +# TAG: retry_on_error +# If set to ON Squid will automatically retry requests when +# receiving an error response with status 403 (Forbidden), +# 500 (Internal Error), 501 or 503 (Service not available). +# Status 502 and 504 (Gateway errors) are always retried. +# +# This is mainly useful if you are in a complex cache hierarchy to +# work around access control errors. +# +# NOTE: This retry will attempt to find another working destination. +# Which is different from the server which just failed. +#Default: +# retry_on_error off + +# TAG: as_whois_server +# WHOIS server to query for AS numbers. NOTE: AS numbers are +# queried only when Squid starts up, not for every request. +#Default: +# as_whois_server whois.ra.net + +# TAG: offline_mode +# Enable this option and Squid will never try to validate cached +# objects. +#Default: +# offline_mode off + +# TAG: uri_whitespace +# What to do with requests that have whitespace characters in the +# URI. Options: +# +# strip: The whitespace characters are stripped out of the URL. +# This is the behavior recommended by RFC2396 and RFC3986 +# for tolerant handling of generic URI. +# NOTE: This is one difference between generic URI and HTTP URLs. +# +# deny: The request is denied. The user receives an "Invalid +# Request" message. +# This is the behaviour recommended by RFC2616 for safe +# handling of HTTP request URL. +# +# allow: The request is allowed and the URI is not changed. The +# whitespace characters remain in the URI. Note the +# whitespace is passed to redirector processes if they +# are in use. +# Note this may be considered a violation of RFC2616 +# request parsing where whitespace is prohibited in the +# URL field. +# +# encode: The request is allowed and the whitespace characters are +# encoded according to RFC1738. +# +# chop: The request is allowed and the URI is chopped at the +# first whitespace. +# +# +# NOTE the current Squid implementation of encode and chop violates +# RFC2616 by not using a 301 redirect after altering the URL. +#Default: +# uri_whitespace strip + +# TAG: chroot +# Specifies a directory where Squid should do a chroot() while +# initializing. This also causes Squid to fully drop root +# privileges after initializing. This means, for example, if you +# use a HTTP port less than 1024 and try to reconfigure, you may +# get an error saying that Squid can not open the port. +#Default: +# none + +# TAG: balance_on_multiple_ip +# Modern IP resolvers in squid sort lookup results by preferred access. +# By default squid will use these IP in order and only rotates to +# the next listed when the most preffered fails. +# +# Some load balancing servers based on round robin DNS have been +# found not to preserve user session state across requests +# to different IP addresses. +# +# Enabling this directive Squid rotates IP's per request. +#Default: +# balance_on_multiple_ip off + +# TAG: pipeline_prefetch +# HTTP clients may send a pipeline of 1+N requests to Squid using a +# single connection, without waiting for Squid to respond to the first +# of those requests. This option limits the number of concurrent +# requests Squid will try to handle in parallel. If set to N, Squid +# will try to receive and process up to 1+N requests on the same +# connection concurrently. +# +# Defaults to 0 (off) for bandwidth management and access logging +# reasons. +# +# NOTE: pipelining requires persistent connections to clients. +# +# WARNING: pipelining breaks NTLM and Negotiate/Kerberos authentication. +#Default: +# Do not pre-parse pipelined requests. + +# TAG: high_response_time_warning (msec) +# If the one-minute median response time exceeds this value, +# Squid prints a WARNING with debug level 0 to get the +# administrators attention. The value is in milliseconds. +#Default: +# disabled. + +# TAG: high_page_fault_warning +# If the one-minute average page fault rate exceeds this +# value, Squid prints a WARNING with debug level 0 to get +# the administrators attention. The value is in page faults +# per second. +#Default: +# disabled. + +# TAG: high_memory_warning +# Note: This option is only available if Squid is rebuilt with the +# GNU Malloc with mstats() +# +# If the memory usage (as determined by gnumalloc, if available and used) +# exceeds this amount, Squid prints a WARNING with debug level 0 to get +# the administrators attention. +#Default: +# disabled. + +# TAG: sleep_after_fork (microseconds) +# When this is set to a non-zero value, the main Squid process +# sleeps the specified number of microseconds after a fork() +# system call. This sleep may help the situation where your +# system reports fork() failures due to lack of (virtual) +# memory. Note, however, if you have a lot of child +# processes, these sleep delays will add up and your +# Squid will not service requests for some amount of time +# until all the child processes have been started. +# On Windows value less then 1000 (1 milliseconds) are +# rounded to 1000. +#Default: +# sleep_after_fork 0 + +# TAG: windows_ipaddrchangemonitor on|off +# Note: This option is only available if Squid is rebuilt with the +# MS Windows +# +# On Windows Squid by default will monitor IP address changes and will +# reconfigure itself after any detected event. This is very useful for +# proxies connected to internet with dial-up interfaces. +# In some cases (a Proxy server acting as VPN gateway is one) it could be +# desiderable to disable this behaviour setting this to 'off'. +# Note: after changing this, Squid service must be restarted. +#Default: +# windows_ipaddrchangemonitor on + +# TAG: eui_lookup +# Whether to lookup the EUI or MAC address of a connected client. +#Default: +# eui_lookup on + +# TAG: max_filedescriptors +# Reduce the maximum number of filedescriptors supported below +# the usual operating system defaults. +# +# Remove from squid.conf to inherit the current ulimit setting. +# +# Note: Changing this requires a restart of Squid. Also +# not all I/O types supports large values (eg on Windows). +#Default: +# Use operating system limits set by ulimit. + diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile new file mode 100644 index 0000000000..dafba7640a --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile @@ -0,0 +1,29 @@ +#@# vim: set filetype=dockerfile: +# Code taken from: https://github.com/hinata/nginx-forward-proxy + +FROM ubuntu/squid +LABEL maintainer "Larry Osterman" + +ENV NGINX_VERSION 1.23.1 + +## +# dependent packages for docker build +## + +WORKDIR /tmp + +RUN apt-get -y update + +## +# application deployment +## + +WORKDIR / + +COPY ./squid.conf /etc/squid/squid.conf + +EXPOSE 3128 + +STOPSIGNAL SIGTERM + +ENTRYPOINT squid -f /etc/squid/squid.conf && sleep 10 && tail -f /var/log/squid/access.log diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy/squid.conf b/sdk/core/azure-core/test/ut/proxy_tests/localproxy/squid.conf new file mode 100644 index 0000000000..14917c74e5 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy/squid.conf @@ -0,0 +1,7991 @@ +# WELCOME TO SQUID 3.5.27 +# ---------------------------- +# +# This is the documentation for the Squid configuration file. +# This documentation can also be found online at: +# http://www.squid-cache.org/Doc/config/ +# +# You may wish to look at the Squid home page and wiki for the +# FAQ and other documentation: +# http://www.squid-cache.org/ +# http://wiki.squid-cache.org/SquidFaq +# http://wiki.squid-cache.org/ConfigExamples +# +# This documentation shows what the defaults for various directives +# happen to be. If you don't need to change the default, you should +# leave the line out of your squid.conf in most cases. +# +# In some cases "none" refers to no default setting at all, +# while in other cases it refers to the value of the option +# - the comments for that keyword indicate if this is the case. +# + +# Configuration options can be included using the "include" directive. +# Include takes a list of files to include. Quoting and wildcards are +# supported. +# +# For example, +# +# include /path/to/included/file/squid.acl.config +# +# Includes can be nested up to a hard-coded depth of 16 levels. +# This arbitrary restriction is to prevent recursive include references +# from causing Squid entering an infinite loop whilst trying to load +# configuration files. +# +# Values with byte units +# +# Squid accepts size units on some size related directives. All +# such directives are documented with a default value displaying +# a unit. +# +# Units accepted by Squid are: +# bytes - byte +# KB - Kilobyte (1024 bytes) +# MB - Megabyte +# GB - Gigabyte +# +# Values with spaces, quotes, and other special characters +# +# Squid supports directive parameters with spaces, quotes, and other +# special characters. Surround such parameters with "double quotes". Use +# the configuration_includes_quoted_values directive to enable or +# disable that support. +# +# Squid supports reading configuration option parameters from external +# files using the syntax: +# parameters("/path/filename") +# For example: +# acl whitelist dstdomain parameters("/etc/squid/whitelist.txt") +# +# Conditional configuration +# +# If-statements can be used to make configuration directives +# depend on conditions: +# +# if +# ... regular configuration directives ... +# [else +# ... regular configuration directives ...] +# endif +# +# The else part is optional. The keywords "if", "else", and "endif" +# must be typed on their own lines, as if they were regular +# configuration directives. +# +# NOTE: An else-if condition is not supported. +# +# These individual conditions types are supported: +# +# true +# Always evaluates to true. +# false +# Always evaluates to false. +# = +# Equality comparison of two integer numbers. +# +# +# SMP-Related Macros +# +# The following SMP-related preprocessor macros can be used. +# +# ${process_name} expands to the current Squid process "name" +# (e.g., squid1, squid2, or cache1). +# +# ${process_number} expands to the current Squid process +# identifier, which is an integer number (e.g., 1, 2, 3) unique +# across all Squid processes of the current service instance. +# +# ${service_name} expands into the current Squid service instance +# name identifier which is provided by -n on the command line. +# + +# TAG: broken_vary_encoding +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: cache_vary +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: error_map +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: external_refresh_check +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: location_rewrite_program +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: refresh_stale_hit +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: hierarchy_stoplist +# Remove this line. Use always_direct or cache_peer_access ACLs instead if you need to prevent cache_peer use. +#Default: +# none + +# TAG: log_access +# Remove this line. Use acls with access_log directives to control access logging +#Default: +# none + +# TAG: log_icap +# Remove this line. Use acls with icap_log directives to control icap logging +#Default: +# none + +# TAG: ignore_ims_on_miss +# Remove this line. The HTTP/1.1 feature is now configured by 'cache_miss_revalidate'. +#Default: +# none + +# TAG: chunked_request_body_max_size +# Remove this line. Squid is now HTTP/1.1 compliant. +#Default: +# none + +# TAG: dns_v4_fallback +# Remove this line. Squid performs a 'Happy Eyeballs' algorithm, the 'fallback' algorithm is no longer relevant. +#Default: +# none + +# TAG: emulate_httpd_log +# Replace this with an access_log directive using the format 'common' or 'combined'. +#Default: +# none + +# TAG: forward_log +# Use a regular access.log with ACL limiting it to MISS events. +#Default: +# none + +# TAG: ftp_list_width +# Remove this line. Configure FTP page display using the CSS controls in errorpages.css instead. +#Default: +# none + +# TAG: ignore_expect_100 +# Remove this line. The HTTP/1.1 feature is now fully supported by default. +#Default: +# none + +# TAG: log_fqdn +# Remove this option from your config. To log FQDN use %>A in the log format. +#Default: +# none + +# TAG: log_ip_on_direct +# Remove this option from your config. To log server or peer names use % +##auth_param negotiate children 20 startup=0 idle=1 +##auth_param negotiate keep_alive on +## +##auth_param digest program +##auth_param digest children 20 startup=0 idle=1 +##auth_param digest realm Squid proxy-caching web server +##auth_param digest nonce_garbage_interval 5 minutes +##auth_param digest nonce_max_duration 30 minutes +##auth_param digest nonce_max_count 50 +## +##auth_param ntlm program +##auth_param ntlm children 20 startup=0 idle=1 +##auth_param ntlm keep_alive on +## +##auth_param basic program +##auth_param basic children 5 startup=5 idle=1 +##auth_param basic realm Squid proxy-caching web server +##auth_param basic credentialsttl 2 hours +#Default: +# none + +# TAG: authenticate_cache_garbage_interval +# The time period between garbage collection across the username cache. +# This is a trade-off between memory utilization (long intervals - say +# 2 days) and CPU (short intervals - say 1 minute). Only change if you +# have good reason to. +#Default: +# authenticate_cache_garbage_interval 1 hour + +# TAG: authenticate_ttl +# The time a user & their credentials stay in the logged in +# user cache since their last request. When the garbage +# interval passes, all user credentials that have passed their +# TTL are removed from memory. +#Default: +# authenticate_ttl 1 hour + +# TAG: authenticate_ip_ttl +# If you use proxy authentication and the 'max_user_ip' ACL, +# this directive controls how long Squid remembers the IP +# addresses associated with each user. Use a small value +# (e.g., 60 seconds) if your users might change addresses +# quickly, as is the case with dialup. You might be safe +# using a larger value (e.g., 2 hours) in a corporate LAN +# environment with relatively static address assignments. +#Default: +# authenticate_ip_ttl 1 second + +# ACCESS CONTROLS +# ----------------------------------------------------------------------------- + +# TAG: external_acl_type +# This option defines external acl classes using a helper program +# to look up the status +# +# external_acl_type name [options] FORMAT.. /path/to/helper [helper arguments..] +# +# Options: +# +# ttl=n TTL in seconds for cached results (defaults to 3600 +# for 1 hour) +# +# negative_ttl=n +# TTL for cached negative lookups (default same +# as ttl) +# +# grace=n Percentage remaining of TTL where a refresh of a +# cached entry should be initiated without needing to +# wait for a new reply. (default is for no grace period) +# +# cache=n The maximum number of entries in the result cache. The +# default limit is 262144 entries. Each cache entry usually +# consumes at least 256 bytes. Squid currently does not remove +# expired cache entries until the limit is reached, so a proxy +# will sooner or later reach the limit. The expanded FORMAT +# value is used as the cache key, so if the details in FORMAT +# are highly variable, a larger cache may be needed to produce +# reduction in helper load. +# +# children-max=n +# Maximum number of acl helper processes spawned to service +# external acl lookups of this type. (default 5) +# +# children-startup=n +# Minimum number of acl helper processes to spawn during +# startup and reconfigure to service external acl lookups +# of this type. (default 0) +# +# children-idle=n +# Number of acl helper processes to keep ahead of traffic +# loads. Squid will spawn this many at once whenever load +# rises above the capabilities of existing processes. +# Up to the value of children-max. (default 1) +# +# concurrency=n concurrency level per process. Only used with helpers +# capable of processing more than one query at a time. +# +# protocol=2.5 Compatibility mode for Squid-2.5 external acl helpers. +# +# ipv4 / ipv6 IP protocol used to communicate with this helper. +# The default is to auto-detect IPv6 and use it when available. +# +# +# FORMAT specifications +# +# %LOGIN Authenticated user login name +# %un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul or %LOGIN +# - user name sent by an external ACL, like %EXT_USER +# - SSL client name, like %us in logformat +# - ident user name, like %ui in logformat +# %EXT_USER Username from previous external acl +# %EXT_LOG Log details from previous external acl +# %EXT_TAG Tag from previous external acl +# %IDENT Ident user name +# %SRC Client IP +# %SRCPORT Client source port +# %URI Requested URI +# %DST Requested host +# %PROTO Requested URL scheme +# %PORT Requested port +# %PATH Requested URL path +# %METHOD Request method +# %MYADDR Squid interface address +# %MYPORT Squid http_port number +# %PATH Requested URL-path (including query-string if any) +# %USER_CERT SSL User certificate in PEM format +# %USER_CERTCHAIN SSL User certificate chain in PEM format +# %USER_CERT_xx SSL User certificate subject attribute xx +# %USER_CA_CERT_xx SSL User certificate issuer attribute xx +# %ssl::>sni SSL client SNI sent to Squid +# %ssl::{Header} HTTP request header "Header" +# %>{Hdr:member} +# HTTP request header "Hdr" list member "member" +# %>{Hdr:;member} +# HTTP request header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %<{Header} HTTP reply header "Header" +# %<{Hdr:member} +# HTTP reply header "Hdr" list member "member" +# %<{Hdr:;member} +# HTTP reply header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %ACL The name of the ACL being tested. +# %DATA The ACL arguments. If not used then any arguments +# is automatically added at the end of the line +# sent to the helper. +# NOTE: this will encode the arguments as one token, +# whereas the default will pass each separately. +# +# %% The percent sign. Useful for helpers which need +# an unchanging input format. +# +# +# General request syntax: +# +# [channel-ID] FORMAT-values [acl-values ...] +# +# +# FORMAT-values consists of transaction details expanded with +# whitespace separation per the config file FORMAT specification +# using the FORMAT macros listed above. +# +# acl-values consists of any string specified in the referencing +# config 'acl ... external' line. see the "acl external" directive. +# +# Request values sent to the helper are URL escaped to protect +# each value in requests against whitespaces. +# +# If using protocol=2.5 then the request sent to the helper is not +# URL escaped to protect against whitespace. +# +# NOTE: protocol=3.0 is deprecated as no longer necessary. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# +# The helper receives lines expanded per the above format specification +# and for each input line returns 1 line starting with OK/ERR/BH result +# code and optionally followed by additional keywords with more details. +# +# +# General result syntax: +# +# [channel-ID] result keyword=value ... +# +# Result consists of one of the codes: +# +# OK +# the ACL test produced a match. +# +# ERR +# the ACL test does not produce a match. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. +# +# The meaning of 'a match' is determined by your squid.conf +# access control configuration. See the Squid wiki for details. +# +# Defined keywords: +# +# user= The users name (login) +# +# password= The users password (for login= cache_peer option) +# +# message= Message describing the reason for this response. +# Available as %o in error pages. +# Useful on (ERR and BH results). +# +# tag= Apply a tag to a request. Only sets a tag once, +# does not alter existing tags. +# +# log= String to be logged in access.log. Available as +# %ea in logformat specifications. +# +# clt_conn_tag= Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation +# for this kv-pair. +# +# Any keywords may be sent on any response whether OK, ERR or BH. +# +# All response keyword values need to be a single token with URL +# escaping, or enclosed in double quotes (") and escaped using \ on +# any double quotes or \ characters within the value. The wrapping +# double quotes are removed before the value is interpreted by Squid. +# \r and \n are also replace by CR and LF. +# +# Some example key values: +# +# user=John%20Smith +# user="John Smith" +# user="J. \"Bob\" Smith" +#Default: +# none + +# TAG: acl +# Defining an Access List +# +# Every access list definition must begin with an aclname and acltype, +# followed by either type-specific arguments or a quoted filename that +# they are read from. +# +# acl aclname acltype argument ... +# acl aclname acltype "file" ... +# +# When using "file", the file should contain one item per line. +# +# Some acl types supports options which changes their default behaviour. +# The available options are: +# +# -i,+i By default, regular expressions are CASE-SENSITIVE. To make them +# case-insensitive, use the -i option. To return case-sensitive +# use the +i option between patterns, or make a new ACL line +# without -i. +# +# -n Disable lookups and address type conversions. If lookup or +# conversion is required because the parameter type (IP or +# domain name) does not match the message address type (domain +# name or IP), then the ACL would immediately declare a mismatch +# without any warnings or lookups. +# +# -- Used to stop processing all options, in the case the first acl +# value has '-' character as first character (for example the '-' +# is a valid domain name) +# +# Some acl types require suspending the current request in order +# to access some external data source. +# Those which do are marked with the tag [slow], those which +# don't are marked as [fast]. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl +# for further information +# +# ***** ACL TYPES AVAILABLE ***** +# +# acl aclname src ip-address/mask ... # clients IP address [fast] +# acl aclname src addr1-addr2/mask ... # range of addresses [fast] +# acl aclname dst [-n] ip-address/mask ... # URL host's IP address [slow] +# acl aclname localip ip-address/mask ... # IP address the client connected to [fast] +# +# acl aclname arp mac-address ... (xx:xx:xx:xx:xx:xx notation) +# # [fast] +# # The 'arp' ACL code is not portable to all operating systems. +# # It works on Linux, Solaris, Windows, FreeBSD, and some other +# # BSD variants. +# # +# # NOTE: Squid can only determine the MAC/EUI address for IPv4 +# # clients that are on the same subnet. If the client is on a +# # different subnet, then Squid cannot find out its address. +# # +# # NOTE 2: IPv6 protocol does not contain ARP. MAC/EUI is either +# # encoded directly in the IPv6 address or not available. +# +# acl aclname srcdomain .foo.com ... +# # reverse lookup, from client IP [slow] +# acl aclname dstdomain [-n] .foo.com ... +# # Destination server from URL [fast] +# acl aclname srcdom_regex [-i] \.foo\.com ... +# # regex matching client name [slow] +# acl aclname dstdom_regex [-n] [-i] \.foo\.com ... +# # regex matching server [fast] +# # +# # For dstdomain and dstdom_regex a reverse lookup is tried if a IP +# # based URL is used and no match is found. The name "none" is used +# # if the reverse lookup fails. +# +# acl aclname src_as number ... +# acl aclname dst_as number ... +# # [fast] +# # Except for access control, AS numbers can be used for +# # routing of requests to specific caches. Here's an +# # example for routing all requests for AS#1241 and only +# # those to mycache.mydomain.net: +# # acl asexample dst_as 1241 +# # cache_peer_access mycache.mydomain.net allow asexample +# # cache_peer_access mycache_mydomain.net deny all +# +# acl aclname peername myPeer ... +# # [fast] +# # match against a named cache_peer entry +# # set unique name= on cache_peer lines for reliable use. +# +# acl aclname time [day-abbrevs] [h1:m1-h2:m2] +# # [fast] +# # day-abbrevs: +# # S - Sunday +# # M - Monday +# # T - Tuesday +# # W - Wednesday +# # H - Thursday +# # F - Friday +# # A - Saturday +# # h1:m1 must be less than h2:m2 +# +# acl aclname url_regex [-i] ^http:// ... +# # regex matching on whole URL [fast] +# acl aclname urllogin [-i] [^a-zA-Z0-9] ... +# # regex matching on URL login field +# acl aclname urlpath_regex [-i] \.gif$ ... +# # regex matching on URL path [fast] +# +# acl aclname port 80 70 21 0-1024... # destination TCP port [fast] +# # ranges are alloed +# acl aclname localport 3128 ... # TCP port the client connected to [fast] +# # NP: for interception mode this is usually '80' +# +# acl aclname myportname 3128 ... # *_port name [fast] +# +# acl aclname proto HTTP FTP ... # request protocol [fast] +# +# acl aclname method GET POST ... # HTTP request method [fast] +# +# acl aclname http_status 200 301 500- 400-403 ... +# # status code in reply [fast] +# +# acl aclname browser [-i] regexp ... +# # pattern match on User-Agent header (see also req_header below) [fast] +# +# acl aclname referer_regex [-i] regexp ... +# # pattern match on Referer header [fast] +# # Referer is highly unreliable, so use with care +# +# acl aclname ident username ... +# acl aclname ident_regex [-i] pattern ... +# # string match on ident output [slow] +# # use REQUIRED to accept any non-null ident. +# +# acl aclname proxy_auth [-i] username ... +# acl aclname proxy_auth_regex [-i] pattern ... +# # perform http authentication challenge to the client and match against +# # supplied credentials [slow] +# # +# # takes a list of allowed usernames. +# # use REQUIRED to accept any valid username. +# # +# # Will use proxy authentication in forward-proxy scenarios, and plain +# # http authenticaiton in reverse-proxy scenarios +# # +# # NOTE: when a Proxy-Authentication header is sent but it is not +# # needed during ACL checking the username is NOT logged +# # in access.log. +# # +# # NOTE: proxy_auth requires a EXTERNAL authentication program +# # to check username/password combinations (see +# # auth_param directive). +# # +# # NOTE: proxy_auth can't be used in a transparent/intercepting proxy +# # as the browser needs to be configured for using a proxy in order +# # to respond to proxy authentication. +# +# acl aclname snmp_community string ... +# # A community string to limit access to your SNMP Agent [fast] +# # Example: +# # +# # acl snmppublic snmp_community public +# +# acl aclname maxconn number +# # This will be matched when the client's IP address has +# # more than TCP connections established. [fast] +# # NOTE: This only measures direct TCP links so X-Forwarded-For +# # indirect clients are not counted. +# +# acl aclname max_user_ip [-s] number +# # This will be matched when the user attempts to log in from more +# # than different ip addresses. The authenticate_ip_ttl +# # parameter controls the timeout on the ip entries. [fast] +# # If -s is specified the limit is strict, denying browsing +# # from any further IP addresses until the ttl has expired. Without +# # -s Squid will just annoy the user by "randomly" denying requests. +# # (the counter is reset each time the limit is reached and a +# # request is denied) +# # NOTE: in acceleration mode or where there is mesh of child proxies, +# # clients may appear to come from multiple addresses if they are +# # going through proxy farms, so a limit of 1 may cause user problems. +# +# acl aclname random probability +# # Pseudo-randomly match requests. Based on the probability given. +# # Probability may be written as a decimal (0.333), fraction (1/3) +# # or ratio of matches:non-matches (3:5). +# +# acl aclname req_mime_type [-i] mime-type ... +# # regex match against the mime type of the request generated +# # by the client. Can be used to detect file upload or some +# # types HTTP tunneling requests [fast] +# # NOTE: This does NOT match the reply. You cannot use this +# # to match the returned file type. +# +# acl aclname req_header header-name [-i] any\.regex\.here +# # regex match against any of the known request headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACL [fast] +# +# acl aclname rep_mime_type [-i] mime-type ... +# # regex match against the mime type of the reply received by +# # squid. Can be used to detect file download or some +# # types HTTP tunneling requests. [fast] +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname rep_header header-name [-i] any\.regex\.here +# # regex match against any of the known reply headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACLs [fast] +# +# acl aclname external class_name [arguments...] +# # external ACL lookup via a helper class defined by the +# # external_acl_type directive [slow] +# +# acl aclname user_cert attribute values... +# # match against attributes in a user SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ca_cert attribute values... +# # match against attributes a users issuing CA SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ext_user username ... +# acl aclname ext_user_regex [-i] pattern ... +# # string match on username returned by external acl helper [slow] +# # use REQUIRED to accept any non-null user name. +# +# acl aclname tag tagvalue ... +# # string match on tag returned by external acl helper [fast] +# # DEPRECATED. Only the first tag will match with this ACL. +# # Use the 'note' ACL instead for handling multiple tag values. +# +# acl aclname hier_code codename ... +# # string match against squid hierarchy code(s); [fast] +# # e.g., DIRECT, PARENT_HIT, NONE, etc. +# # +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname note name [value ...] +# # match transaction annotation [fast] +# # Without values, matches any annotation with a given name. +# # With value(s), matches any annotation with a given name that +# # also has one of the given values. +# # Names and values are compared using a string equality test. +# # Annotation sources include note and adaptation_meta directives +# # as well as helper and eCAP responses. +# +# acl aclname adaptation_service service ... +# # Matches the name of any icap_service, ecap_service, +# # adaptation_service_set, or adaptation_service_chain that Squid +# # has used (or attempted to use) for the master transaction. +# # This ACL must be defined after the corresponding adaptation +# # service is named in squid.conf. This ACL is usable with +# # adaptation_meta because it starts matching immediately after +# # the service has been selected for adaptation. +# +# acl aclname any-of acl1 acl2 ... +# # match any one of the acls [fast or slow] +# # The first matching ACL stops further ACL evaluation. +# # +# # ACLs from multiple any-of lines with the same name are ORed. +# # For example, A = (a1 or a2) or (a3 or a4) can be written as +# # acl A any-of a1 a2 +# # acl A any-of a3 a4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# acl aclname all-of acl1 acl2 ... +# # match all of the acls [fast or slow] +# # The first mismatching ACL stops further ACL evaluation. +# # +# # ACLs from multiple all-of lines with the same name are ORed. +# # For example, B = (b1 and b2) or (b3 and b4) can be written as +# # acl B all-of b1 b2 +# # acl B all-of b3 b4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# Examples: +# acl macaddress arp 09:00:2b:23:45:67 +# acl myexample dst_as 1241 +# acl password proxy_auth REQUIRED +# acl fileupload req_mime_type -i ^multipart/form-data$ +# acl javascript rep_mime_type -i ^application/x-javascript$ +# +#Default: +# ACLs all, manager, localhost, and to_localhost are predefined. +# +# +# Recommended minimum configuration: +# + +# Example rule allowing access from your local networks. +# Adapt to list your (internal) IP networks from where browsing +# should be allowed +acl localnet src 10.0.0.0/8 # RFC1918 possible internal network +acl localnet src 172.16.0.0/12 # RFC1918 possible internal network +acl localnet src 192.168.0.0/16 # RFC1918 possible internal network +acl localnet src fc00::/7 # RFC 4193 local private network range +acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines +acl localnet src 2001:4898::/48 + + + +acl SSL_ports port 443 +acl Safe_ports port 80 # http +acl Safe_ports port 21 # ftp +acl Safe_ports port 443 # https +acl Safe_ports port 70 # gopher +acl Safe_ports port 210 # wais +acl Safe_ports port 1025-65535 # unregistered ports +acl Safe_ports port 280 # http-mgmt +acl Safe_ports port 488 # gss-http +acl Safe_ports port 591 # filemaker +acl Safe_ports port 777 # multiling http +acl CONNECT method CONNECT + +# TAG: proxy_protocol_access +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address using PROXY protocol. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# This directive is solely for validating new PROXY protocol +# connections received from a port flagged with require-proxy-header. +# It is checked only once after TCP connection setup. +# +# A deny match results in TCP connection closure. +# +# An allow match is required for Squid to permit the corresponding +# TCP connection, before Squid even looks for HTTP request headers. +# If there is an allow match, Squid starts using PROXY header information +# to determine the source address of the connection for all future ACL +# checks, logging, etc. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# all TCP connections to ports with require-proxy-header will be denied + +# TAG: follow_x_forwarded_for +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# PROXY protocol connections are controlled by the proxy_protocol_access +# directive which is checked before this. +# +# If a request reaches us from a source that is allowed by this +# directive, then we trust the information it provides regarding +# the IP of the client it received from (if any). +# +# For the purpose of ACLs used in this directive the src ACL type always +# matches the address we are testing and srcdomain matches its rDNS. +# +# On each HTTP request Squid checks for X-Forwarded-For header fields. +# If found the header values are iterated in reverse order and an allow +# match is required for Squid to continue on to the next value. +# The verification ends when a value receives a deny match, cannot be +# tested, or there are no more values to test. +# NOTE: Squid does not yet follow the Forwarded HTTP header. +# +# The end result of this process is an IP address that we will +# refer to as the indirect client address. This address may +# be treated as the client address for access control, ICAP, delay +# pools and logging, depending on the acl_uses_indirect_client, +# icap_uses_indirect_client, delay_pool_uses_indirect_client, +# log_uses_indirect_client and tproxy_uses_indirect_client options. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# For example: +# +# acl localhost src 127.0.0.1 +# acl my_other_proxy srcdomain .proxy.example.com +# follow_x_forwarded_for allow localhost +# follow_x_forwarded_for allow my_other_proxy +#Default: +# X-Forwarded-For header will be ignored. + +# TAG: acl_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in acl matching. +# +# NOTE: maxconn ACL considers direct TCP links and indirect +# clients will always have zero. So no match. +#Default: +# acl_uses_indirect_client on + +# TAG: delay_pool_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in delay pools. +#Default: +# delay_pool_uses_indirect_client on + +# TAG: log_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in the access log. +#Default: +# log_uses_indirect_client on + +# TAG: tproxy_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address when spoofing the outgoing client. +# +# This has no effect on requests arriving in non-tproxy +# mode ports. +# +# SECURITY WARNING: Usage of this option is dangerous +# and should not be used trivially. Correct configuration +# of follow_x_forwarded_for with a limited set of trusted +# sources is required to prevent abuse of your proxy. +#Default: +# tproxy_uses_indirect_client off + +# TAG: spoof_client_ip +# Control client IP address spoofing of TPROXY traffic based on +# defined access lists. +# +# spoof_client_ip allow|deny [!]aclname ... +# +# If there are no "spoof_client_ip" lines present, the default +# is to "allow" spoofing of any suitable request. +# +# Note that the cache_peer "no-tproxy" option overrides this ACL. +# +# This clause supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow spoofing on all TPROXY traffic. + +# TAG: http_access +# Allowing or Denying access based on defined access lists +# +# To allow or deny a message received on an HTTP, HTTPS, or FTP port: +# http_access allow|deny [!]aclname ... +# +# NOTE on default values: +# +# If there are no "access" lines present, the default is to deny +# the request. +# +# If none of the "access" lines cause a match, the default is the +# opposite of the last line in the list. If the last line was +# deny, the default is allow. Conversely, if the last line +# is allow, the default will be deny. For these reasons, it is a +# good idea to have an "deny all" entry at the end of your access +# lists to avoid potential confusion. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Default: +# Deny, unless rules exist in squid.conf. +# + +# +# Recommended minimum Access Permission configuration: +# +# Deny requests to certain unsafe ports +http_access deny !Safe_ports + +# Deny CONNECT to other than secure SSL ports +http_access deny CONNECT !SSL_ports + +# Only allow cachemgr access from localhost +http_access allow localhost manager +http_access deny manager + +#auth_param negotiate program /usr/lib/squid/negotiate_wrapper_auth --ntlm /usr/bin/ntlm_auth --helper-protocol=gss-spnego --kerberos /usr/lib/squid/negotiate_kerberos_auth +# +#auth_param negotiate children 30 startup=2 idle=1 +#auth_param negotiate keep_alive on + +#acl AuthUsers proxy_auth REQUIRED +#http_access allow AuthUsers + +# We strongly recommend the following be uncommented to protect innocent +# web applications running on the proxy server who think the only +# one who can access services on "localhost" is a local user +#http_access deny to_localhost + +# +# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS +# + +# Example rule allowing access from your local networks. +# Adapt localnet in the ACL section to list your (internal) IP networks +# from where browsing should be allowed +http_access allow localnet +http_access allow localhost + +# And finally deny all other access to this proxy +http_access deny all + +# TAG: adapted_http_access +# Allowing or Denying access based on defined access lists +# +# Essentially identical to http_access, but runs after redirectors +# and ICAP/eCAP adaptation. Allowing access control based on their +# output. +# +# If not set then only http_access is used. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: http_reply_access +# Allow replies to client requests. This is complementary to http_access. +# +# http_reply_access allow|deny [!] aclname ... +# +# NOTE: if there are no access lines present, the default is to allow +# all replies. +# +# If none of the access lines cause a match the opposite of the +# last line will apply. Thus it is good practice to end the rules +# with an "allow all" or "deny all" entry. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: icp_access +# Allowing or Denying access to the ICP port based on defined +# access lists +# +# icp_access allow|deny [!]aclname ... +# +# NOTE: The default if no icp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using ICP. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow ICP queries from local networks only +##icp_access allow localnet +##icp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_access +# Allowing or Denying access to the HTCP port based on defined +# access lists +# +# htcp_access allow|deny [!]aclname ... +# +# See also htcp_clr_access for details on access control for +# cache purge (CLR) HTCP messages. +# +# NOTE: The default if no htcp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using the htcp option. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP queries from local networks only +##htcp_access allow localnet +##htcp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_clr_access +# Allowing or Denying access to purge content using HTCP based +# on defined access lists. +# See htcp_access for details on general HTCP access control. +# +# htcp_clr_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP CLR requests from trusted peers +#acl htcp_clr_peer src 192.0.2.2 2001:DB8::2 +#htcp_clr_access allow htcp_clr_peer +#htcp_clr_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: miss_access +# Determines whether network access is permitted when satisfying a request. +# +# For example; +# to force your neighbors to use you as a sibling instead of +# a parent. +# +# acl localclients src 192.0.2.0/24 2001:DB8::a:0/64 +# miss_access deny !localclients +# miss_access allow all +# +# This means only your local clients are allowed to fetch relayed/MISS +# replies from the network and all other clients can only fetch cached +# objects (HITs). +# +# The default for this setting allows all clients who passed the +# http_access rules to relay via this proxy. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: ident_lookup_access +# A list of ACL elements which, if matched, cause an ident +# (RFC 931) lookup to be performed for this request. For +# example, you might choose to always perform ident lookups +# for your main multi-user Unix boxes, but not for your Macs +# and PCs. By default, ident lookups are not performed for +# any requests. +# +# To enable ident lookups for specific client addresses, you +# can follow this example: +# +# acl ident_aware_hosts src 198.168.1.0/24 +# ident_lookup_access allow ident_aware_hosts +# ident_lookup_access deny all +# +# Only src type ACL checks are fully supported. A srcdomain +# ACL might work at times, but it will not always provide +# the correct result. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Unless rules exist in squid.conf, IDENT is not fetched. + +# TAG: reply_body_max_size size [acl acl...] +# This option specifies the maximum size of a reply body. It can be +# used to prevent users from downloading very large files, such as +# MP3's and movies. When the reply headers are received, the +# reply_body_max_size lines are processed, and the first line where +# all (if any) listed ACLs are true is used as the maximum body size +# for this reply. +# +# This size is checked twice. First when we get the reply headers, +# we check the content-length value. If the content length value exists +# and is larger than the allowed size, the request is denied and the +# user receives an error message that says "the request or reply +# is too large." If there is no content-length, and the reply +# size exceeds this limit, the client's connection is just closed +# and they will receive a partial reply. +# +# WARNING: downstream caches probably can not detect a partial reply +# if there is no content-length header, so they will cache +# partial responses and give them out as hits. You should NOT +# use this option if you have downstream caches. +# +# WARNING: A maximum size smaller than the size of squid's error messages +# will cause an infinite loop and crash squid. Ensure that the smallest +# non-zero value you use is greater that the maximum header size plus +# the size of your largest error page. +# +# If you set this parameter none (the default), there will be +# no limit imposed. +# +# Configuration Format is: +# reply_body_max_size SIZE UNITS [acl ...] +# ie. +# reply_body_max_size 10 MB +# +#Default: +# No limit is applied. + +# NETWORK OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: http_port +# Usage: port [mode] [options] +# hostname:port [mode] [options] +# 1.2.3.4:port [mode] [options] +# +# The socket addresses where Squid will listen for HTTP client +# requests. You may specify multiple socket addresses. +# There are three forms: port alone, hostname with port, and +# IP address with port. If you specify a hostname or IP +# address, Squid binds the socket to that specific +# address. Most likely, you do not need to bind to a specific +# address, so you can use the port number alone. +# +# If you are running Squid in accelerator mode, you +# probably want to listen on port 80 also, or instead. +# +# The -a command line option may be used to specify additional +# port(s) where Squid listens for proxy request. Such ports will +# be plain proxy ports with no options. +# +# You may specify multiple socket addresses on multiple lines. +# +# Modes: +# +# intercept Support for IP-Layer NAT interception delivering +# traffic to this Squid port. +# NP: disables authentication on the port. +# +# tproxy Support Linux TPROXY (or BSD divert-to) with spoofing +# of outgoing connections using the client IP address. +# NP: disables authentication on the port. +# +# accel Accelerator / reverse proxy mode +# +# ssl-bump For each CONNECT request allowed by ssl_bump ACLs, +# establish secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# The ssl_bump option is required to fully enable +# bumping of CONNECT requests. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# Accelerator Mode Options: +# +# defaultsite=domainname +# What to use for the Host: header if it is not present +# in a request. Determines what site (not origin server) +# accelerators should consider the default. +# +# no-vhost Disable using HTTP/1.1 Host header for virtual domain support. +# +# protocol= Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to HTTP/1.1 for http_port and +# HTTPS/1.1 for https_port. +# When an unsupported value is configured Squid will +# produce a FATAL error. +# Values: HTTP or HTTP/1.1, HTTPS or HTTPS/1.1 +# +# vport Virtual host port support. Using the http_port number +# instead of the port passed on Host: headers. +# +# vport=NN Virtual host port support. Using the specified port +# number instead of the port passed on Host: headers. +# +# act-as-origin +# Act as if this Squid is the origin server. +# This currently means generate new Date: and Expires: +# headers on HIT instead of adding Age:. +# +# ignore-cc Ignore request Cache-Control headers. +# +# WARNING: This option violates HTTP specifications if +# used in non-accelerator setups. +# +# allow-direct Allow direct forwarding in accelerator mode. Normally +# accelerated requests are denied direct forwarding as if +# never_direct was used. +# +# WARNING: this option opens accelerator mode to security +# vulnerabilities usually only affecting in interception +# mode. Make sure to protect forwarding with suitable +# http_access rules when using this. +# +# +# SSL Bump Mode Options: +# In addition to these options ssl-bump requires TLS/SSL options. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped CONNECT requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is a CA certificate lifetime of the generated +# certificate equals lifetime of the CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# TLS / SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +# +# cipher= Colon separated list of supported ciphers. +# NOTE: some ciphers such as EDH ciphers depend on +# additional settings. If those settings are +# omitted the ciphers may be silently ignored +# by the OpenSSL library. +# +# options= Various SSL implementation options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# NO_TICKET Disables TLS tickets extension +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# See OpenSSL SSL_CTX_set_options documentation for a +# complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# See OpenSSL documentation for details on how to create the +# DH parameter file. Supported curves for ECDH can be listed +# using the "openssl ecparam -list_curves" command. +# WARNING: EDH and EECDH ciphers will be silently disabled if +# this option is not set. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# Other Options: +# +# connection-auth[=on|off] +# use connection-auth=off to tell Squid to prevent +# forwarding Microsoft connection oriented authentication +# (NTLM, Negotiate and Kerberos) +# +# disable-pmtu-discovery= +# Control Path-MTU discovery usage: +# off lets OS decide on what to do (default). +# transparent disable PMTU discovery when transparent +# support is enabled. +# always disable always PMTU discovery. +# +# In many setups of transparently intercepting proxies +# Path-MTU discovery can not work on traffic towards the +# clients. This is the case when the intercepting device +# does not fully track connections and fails to forward +# ICMP must fragment messages to the cache server. If you +# have such setup and experience that certain clients +# sporadically hang or never complete requests set +# disable-pmtu-discovery option to 'transparent'. +# +# name= Specifies a internal name for the port. Defaults to +# the port specification (port or addr:port) +# +# tcpkeepalive[=idle,interval,timeout] +# Enable TCP keepalive probes of idle connections. +# In seconds; idle is the initial time before TCP starts +# probing the connection, interval how often to probe, and +# timeout the time before giving up. +# +# require-proxy-header +# Require PROXY protocol version 1 or 2 connections. +# The proxy_protocol_access is required to whitelist +# downstream proxies which can be trusted. +# +# If you run Squid on a dual-homed machine with an internal +# and an external interface we recommend you to specify the +# internal address:port in http_port. This way Squid will only be +# visible on the internal address. +# +# + +# Squid normally listens to port 3128 +http_port 3128 + +# TAG: https_port +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Usage: [ip:]port cert=certificate.pem [key=key.pem] [mode] [options...] +# +# The socket address where Squid will listen for client requests made +# over TLS or SSL connections. Commonly referred to as HTTPS. +# +# This is most useful for situations where you are running squid in +# accelerator mode and you want to do the SSL work at the accelerator level. +# +# You may specify multiple socket addresses on multiple lines, +# each with their own SSL certificate and/or options. +# +# Modes: +# +# accel Accelerator / reverse proxy mode +# +# intercept Support for IP-Layer interception of +# outgoing requests without browser settings. +# NP: disables authentication and IPv6 on the port. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# ssl-bump For each intercepted connection allowed by ssl_bump +# ACLs, establish a secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# An "ssl_bump server-first" match is required to +# fully enable bumping of intercepted SSL connections. +# +# Requires tproxy or intercept. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# See http_port for a list of generic options +# +# +# SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1 only +# +# cipher= Colon separated list of supported ciphers. +# +# options= Various SSL engine options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1 +# +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# See src/ssl_support.c or OpenSSL SSL_CTX_set_options +# documentation for a complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped SSL requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is CA certificate life time of generated +# certificate equals lifetime of CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# See http_port for a list of available options. +#Default: +# none + +# TAG: ftp_port +# Enables Native FTP proxy by specifying the socket address where Squid +# listens for FTP client requests. See http_port directive for various +# ways to specify the listening address and mode. +# +# Usage: ftp_port address [mode] [options] +# +# WARNING: This is a new, experimental, complex feature that has seen +# limited production exposure. Some Squid modules (e.g., caching) do not +# currently work with native FTP proxying, and many features have not +# even been tested for compatibility. Test well before deploying! +# +# Native FTP proxying differs substantially from proxying HTTP requests +# with ftp:// URIs because Squid works as an FTP server and receives +# actual FTP commands (rather than HTTP requests with FTP URLs). +# +# Native FTP commands accepted at ftp_port are internally converted or +# wrapped into HTTP-like messages. The same happens to Native FTP +# responses received from FTP origin servers. Those HTTP-like messages +# are shoveled through regular access control and adaptation layers +# between the FTP client and the FTP origin server. This allows Squid to +# examine, adapt, block, and log FTP exchanges. Squid reuses most HTTP +# mechanisms when shoveling wrapped FTP messages. For example, +# http_access and adaptation_access directives are used. +# +# Modes: +# +# intercept Same as http_port intercept. The FTP origin address is +# determined based on the intended destination of the +# intercepted connection. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# By default (i.e., without an explicit mode option), Squid extracts the +# FTP origin address from the login@origin parameter of the FTP USER +# command. Many popular FTP clients support such native FTP proxying. +# +# Options: +# +# name=token Specifies an internal name for the port. Defaults to +# the port address. Usable with myportname ACL. +# +# ftp-track-dirs +# Enables tracking of FTP directories by injecting extra +# PWD commands and adjusting Request-URI (in wrapping +# HTTP requests) to reflect the current FTP server +# directory. Tracking is disabled by default. +# +# protocol=FTP Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to FTP. No other accepted +# values have been tested with. An unsupported value +# results in a FATAL error. Accepted values are FTP, +# HTTP (or HTTP/1.1), and HTTPS (or HTTPS/1.1). +# +# Other http_port modes and options that are not specific to HTTP and +# HTTPS may also work. +#Default: +# none + +# TAG: tcp_outgoing_tos +# Allows you to select a TOS/Diffserv value for packets outgoing +# on the server side, based on an ACL. +# +# tcp_outgoing_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_tos 0x00 normal_service_net +# tcp_outgoing_tos 0x20 good_service_net +# +# TOS/DSCP values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_tos +# Allows you to select a TOS/DSCP value for packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_tos 0x00 normal_service_net +# clientside_tos 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any TOS values set here +# will be overwritten by TOS values in qos_flows. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +#Default: +# none + +# TAG: tcp_outgoing_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to outgoing packets +# on the server side, based on an ACL. +# +# tcp_outgoing_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_mark 0x00 normal_service_net +# tcp_outgoing_mark 0x20 good_service_net +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_mark 0x00 normal_service_net +# clientside_mark 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any mark values set here +# will be overwritten by mark values in qos_flows. +#Default: +# none + +# TAG: qos_flows +# Allows you to select a TOS/DSCP value to mark outgoing +# connections to the client, based on where the reply was sourced. +# For platforms using netfilter, allows you to set a netfilter mark +# value instead of, or in addition to, a TOS value. +# +# By default this functionality is disabled. To enable it with the default +# settings simply use "qos_flows mark" or "qos_flows tos". Default +# settings will result in the netfilter mark or TOS value being copied +# from the upstream connection to the client. Note that it is the connection +# CONNMARK value not the packet MARK value that is copied. +# +# It is not currently possible to copy the mark or TOS value from the +# client to the upstream connection request. +# +# TOS values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Mark values can be any unsigned 32-bit integer value. +# +# This setting is configured by setting the following values: +# +# tos|mark Whether to set TOS or netfilter mark values +# +# local-hit=0xFF Value to mark local cache hits. +# +# sibling-hit=0xFF Value to mark hits from sibling peers. +# +# parent-hit=0xFF Value to mark hits from parent peers. +# +# miss=0xFF[/mask] Value to mark cache misses. Takes precedence +# over the preserve-miss feature (see below), unless +# mask is specified, in which case only the bits +# specified in the mask are written. +# +# The TOS variant of the following features are only possible on Linux +# and require your kernel to be patched with the TOS preserving ZPH +# patch, available from http://zph.bratcheda.org +# No patch is needed to preserve the netfilter mark, which will work +# with all variants of netfilter. +# +# disable-preserve-miss +# This option disables the preservation of the TOS or netfilter +# mark. By default, the existing TOS or netfilter mark value of +# the response coming from the remote server will be retained +# and masked with miss-mark. +# NOTE: in the case of a netfilter mark, the mark must be set on +# the connection (using the CONNMARK target) not on the packet +# (MARK target). +# +# miss-mask=0xFF +# Allows you to mask certain bits in the TOS or mark value +# received from the remote server, before copying the value to +# the TOS sent towards clients. +# Default for tos: 0xFF (TOS from server is not changed). +# Default for mark: 0xFFFFFFFF (mark from server is not changed). +# +# All of these features require the --enable-zph-qos compilation flag +# (enabled by default). Netfilter marking also requires the +# libnetfilter_conntrack libraries (--with-netfilter-conntrack) and +# libcap 2.09+ (--with-libcap). +# +#Default: +# none + +# TAG: tcp_outgoing_address +# Allows you to map requests to different outgoing IP addresses +# based on the username or source address of the user making +# the request. +# +# tcp_outgoing_address ipaddr [[!]aclname] ... +# +# For example; +# Forwarding clients with dedicated IPs for certain subnets. +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.2.0/24 +# +# tcp_outgoing_address 2001:db8::c001 good_service_net +# tcp_outgoing_address 10.1.0.2 good_service_net +# +# tcp_outgoing_address 2001:db8::beef normal_service_net +# tcp_outgoing_address 10.1.0.1 normal_service_net +# +# tcp_outgoing_address 2001:db8::1 +# tcp_outgoing_address 10.1.0.3 +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Squid will add an implicit IP version test to each line. +# Requests going to IPv4 websites will use the outgoing 10.1.0.* addresses. +# Requests going to IPv6 websites will use the outgoing 2001:db8:* addresses. +# +# +# NOTE: The use of this directive using client dependent ACLs is +# incompatible with the use of server side persistent connections. To +# ensure correct results it is best to set server_persistent_connections +# to off when using this directive in such configurations. +# +# NOTE: The use of this directive to set a local IP on outgoing TCP links +# is incompatible with using TPROXY to set client IP out outbound TCP links. +# When needing to contact peers use the no-tproxy cache_peer option and the +# client_dst_passthru directive re-enable normal forwarding such as this. +# +#Default: +# Address selection is performed by the operating system. + +# TAG: host_verify_strict +# Regardless of this option setting, when dealing with intercepted +# traffic, Squid always verifies that the destination IP address matches +# the Host header domain or IP (called 'authority form URL'). +# +# This enforcement is performed to satisfy a MUST-level requirement in +# RFC 2616 section 14.23: "The Host field value MUST represent the naming +# authority of the origin server or gateway given by the original URL". +# +# When set to ON: +# Squid always responds with an HTTP 409 (Conflict) error +# page and logs a security warning if there is no match. +# +# Squid verifies that the destination IP address matches +# the Host header for forward-proxy and reverse-proxy traffic +# as well. For those traffic types, Squid also enables the +# following checks, comparing the corresponding Host header +# and Request-URI components: +# +# * The host names (domain or IP) must be identical, +# but valueless or missing Host header disables all checks. +# For the two host names to match, both must be either IP +# or FQDN. +# +# * Port numbers must be identical, but if a port is missing +# the scheme-default port is assumed. +# +# +# When set to OFF (the default): +# Squid allows suspicious requests to continue but logs a +# security warning and blocks caching of the response. +# +# * Forward-proxy traffic is not checked at all. +# +# * Reverse-proxy traffic is not checked at all. +# +# * Intercepted traffic which passes verification is handled +# according to client_dst_passthru. +# +# * Intercepted requests which fail verification are sent +# to the client original destination instead of DIRECT. +# This overrides 'client_dst_passthru off'. +# +# For now suspicious intercepted CONNECT requests are always +# responded to with an HTTP 409 (Conflict) error page. +# +# +# SECURITY NOTE: +# +# As described in CVE-2009-0801 when the Host: header alone is used +# to determine the destination of a request it becomes trivial for +# malicious scripts on remote websites to bypass browser same-origin +# security policy and sandboxing protections. +# +# The cause of this is that such applets are allowed to perform their +# own HTTP stack, in which case the same-origin policy of the browser +# sandbox only verifies that the applet tries to contact the same IP +# as from where it was loaded at the IP level. The Host: header may +# be different from the connected IP and approved origin. +# +#Default: +# host_verify_strict off + +# TAG: client_dst_passthru +# With NAT or TPROXY intercepted traffic Squid may pass the request +# directly to the original client destination IP or seek a faster +# source using the HTTP Host header. +# +# Using Host to locate alternative servers can provide faster +# connectivity with a range of failure recovery options. +# But can also lead to connectivity trouble when the client and +# server are attempting stateful interactions unaware of the proxy. +# +# This option (on by default) prevents alternative DNS entries being +# located to send intercepted traffic DIRECT to an origin server. +# The clients original destination IP and port will be used instead. +# +# Regardless of this option setting, when dealing with intercepted +# traffic Squid will verify the Host: header and any traffic which +# fails Host verification will be treated as if this option were ON. +# +# see host_verify_strict for details on the verification process. +#Default: +# client_dst_passthru on + +# SSL OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ssl_unclean_shutdown +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Some browsers (especially MSIE) bugs out on SSL shutdown +# messages. +#Default: +# ssl_unclean_shutdown off + +# TAG: ssl_engine +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The OpenSSL engine to use. You will need to set this if you +# would like to use hardware SSL acceleration for example. +#Default: +# none + +# TAG: sslproxy_client_certificate +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Certificate to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_client_key +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Key to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_version +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL version level to use when proxying https:// URLs +# +# The versions of SSL/TLS supported: +# +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +#Default: +# automatic SSL/TLS version negotiation + +# TAG: sslproxy_options +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Colon (:) or comma (,) separated list of SSL implementation options +# to use when proxying https:// URLs +# +# The most important being: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using temporary/ephemeral +# DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds suggested as "harmless" +# by OpenSSL. Be warned that this may reduce SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# complete list of possible options. +# +# WARNING: This directive takes a single token. If a space is used +# the value(s) after that space are SILENTLY IGNORED. +#Default: +# none + +# TAG: sslproxy_cipher +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL cipher list to use when proxying https:// URLs +# +# Colon separated list of supported ciphers. +#Default: +# none + +# TAG: sslproxy_cafile +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# file containing CA certificates to use when verifying server +# certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_capath +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# directory containing CA certificates to use when verifying +# server certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_session_ttl +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the timeout value for SSL sessions +#Default: +# sslproxy_session_ttl 300 + +# TAG: sslproxy_session_cache_size +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the cache size to use for ssl session +#Default: +# sslproxy_session_cache_size 2 MB + +# TAG: sslproxy_foreign_intermediate_certs +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Many origin servers fail to send their full server certificate +# chain for verification, assuming the client already has or can +# easily locate any missing intermediate certificates. +# +# Squid uses the certificates from the specified file to fill in +# these missing chains when trying to validate origin server +# certificate chains. +# +# The file is expected to contain zero or more PEM-encoded +# intermediate certificates. These certificates are not treated +# as trusted root certificates, and any self-signed certificate in +# this file will be ignored. +#Default: +# none + +# TAG: sslproxy_cert_sign_hash +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the hashing algorithm to use when signing generated certificates. +# Valid algorithm names depend on the OpenSSL library used. The following +# names are usually available: sha1, sha256, sha512, and md5. Please see +# your OpenSSL library manual for the available hashes. By default, Squids +# that support this option use sha256 hashes. +# +# Squid does not forcefully purge cached certificates that were generated +# with an algorithm other than the currently configured one. They remain +# in the cache, subject to the regular cache eviction policy, and become +# useful if the algorithm changes again. +#Default: +# none + +# TAG: ssl_bump +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# This option is consulted when a CONNECT request is received on +# an http_port (or a new connection is intercepted at an +# https_port), provided that port was configured with an ssl-bump +# flag. The subsequent data on the connection is either treated as +# HTTPS and decrypted OR tunneled at TCP level without decryption, +# depending on the first matching bumping "action". +# +# ssl_bump [!]acl ... +# +# The following bumping actions are currently supported: +# +# splice +# Become a TCP tunnel without decrypting proxied traffic. +# This is the default action. +# +# bump +# When used on step SslBump1, establishes a secure connection +# with the client first, then connect to the server. +# When used on step SslBump2 or SslBump3, establishes a secure +# connection with the server and, using a mimicked server +# certificate, with the client. +# +# peek +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of splicing the +# connection. Peeking at the server certificate (during step 2) +# usually precludes bumping of the connection at step 3. +# +# stare +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of bumping the +# connection. Staring at the server certificate (during step 2) +# usually precludes splicing of the connection at step 3. +# +# terminate +# Close client and server connections. +# +# Backward compatibility actions available at step SslBump1: +# +# client-first +# Bump the connection. Establish a secure connection with the +# client first, then connect to the server. This old mode does +# not allow Squid to mimic server SSL certificate and does not +# work with intercepted SSL connections. +# +# server-first +# Bump the connection. Establish a secure connection with the +# server first, then establish a secure connection with the +# client, using a mimicked server certificate. Works with both +# CONNECT requests and intercepted SSL connections, but does +# not allow to make decisions based on SSL handshake info. +# +# peek-and-splice +# Decide whether to bump or splice the connection based on +# client-to-squid and server-to-squid SSL hello messages. +# XXX: Remove. +# +# none +# Same as the "splice" action. +# +# All ssl_bump rules are evaluated at each of the supported bumping +# steps. Rules with actions that are impossible at the current step are +# ignored. The first matching ssl_bump action wins and is applied at the +# end of the current step. If no rules match, the splice action is used. +# See the at_step ACL for a list of the supported SslBump steps. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also: http_port ssl-bump, https_port ssl-bump, and acl at_step. +# +# +# # Example: Bump all TLS connections except those originating from +# # localhost or those going to example.com. +# +# acl broken_sites ssl::server_name .example.com +# ssl_bump splice localhost +# ssl_bump splice broken_sites +# ssl_bump bump all +#Default: +# Become a TCP tunnel without decrypting proxied traffic. + +# TAG: sslproxy_flags +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Various flags modifying the use of SSL while proxying https:// URLs: +# DONT_VERIFY_PEER Accept certificates that fail verification. +# For refined control, see sslproxy_cert_error. +# NO_DEFAULT_CA Don't use the default CA list built in +# to OpenSSL. +#Default: +# none + +# TAG: sslproxy_cert_error +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Use this ACL to bypass server certificate validation errors. +# +# For example, the following lines will bypass all validation errors +# when talking to servers for example.com. All other +# validation errors will result in ERR_SECURE_CONNECT_FAIL error. +# +# acl BrokenButTrustedServers dstdomain example.com +# sslproxy_cert_error allow BrokenButTrustedServers +# sslproxy_cert_error deny all +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Using slow acl types may result in server crashes +# +# Without this option, all server certificate validation errors +# terminate the transaction to protect Squid and the client. +# +# SQUID_X509_V_ERR_INFINITE_VALIDATION error cannot be bypassed +# but should not happen unless your OpenSSL library is buggy. +# +# SECURITY WARNING: +# Bypassing validation errors is dangerous because an +# error usually implies that the server cannot be trusted +# and the connection may be insecure. +# +# See also: sslproxy_flags and DONT_VERIFY_PEER. +#Default: +# Server certificate errors terminate the transaction. + +# TAG: sslproxy_cert_sign +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_sign acl ... +# +# The following certificate signing algorithms are supported: +# +# signTrusted +# Sign using the configured CA certificate which is usually +# placed in and trusted by end-user browsers. This is the +# default for trusted origin server certificates. +# +# signUntrusted +# Sign to guarantee an X509_V_ERR_CERT_UNTRUSTED browser error. +# This is the default for untrusted origin server certificates +# that are not self-signed (see ssl::certUntrusted). +# +# signSelf +# Sign using a self-signed certificate with the right CN to +# generate a X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT error in the +# browser. This is the default for self-signed origin server +# certificates (see ssl::certSelfSigned). +# +# This clause only supports fast acl types. +# +# When sslproxy_cert_sign acl(s) match, Squid uses the corresponding +# signing algorithm to generate the certificate and ignores all +# subsequent sslproxy_cert_sign options (the first match wins). If no +# acl(s) match, the default signing algorithm is determined by errors +# detected when obtaining and validating the origin server certificate. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslproxy_cert_adapt +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_adapt acl ... +# +# The following certificate adaptation algorithms are supported: +# +# setValidAfter +# Sets the "Not After" property to the "Not After" property of +# the CA certificate used to sign generated certificates. +# +# setValidBefore +# Sets the "Not Before" property to the "Not Before" property of +# the CA certificate used to sign generated certificates. +# +# setCommonName or setCommonName{CN} +# Sets Subject.CN property to the host name specified as a +# CN parameter or, if no explicit CN parameter was specified, +# extracted from the CONNECT request. It is a misconfiguration +# to use setCommonName without an explicit parameter for +# intercepted or tproxied SSL connections. +# +# This clause only supports fast acl types. +# +# Squid first groups sslproxy_cert_adapt options by adaptation algorithm. +# Within a group, when sslproxy_cert_adapt acl(s) match, Squid uses the +# corresponding adaptation algorithm to generate the certificate and +# ignores all subsequent sslproxy_cert_adapt options in that algorithm's +# group (i.e., the first match wins within each algorithm group). If no +# acl(s) match, the default mimicking action takes place. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslpassword_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify a program used for entering SSL key passphrases +# when using encrypted SSL certificate keys. If not specified +# keys must either be unencrypted, or Squid started with the -N +# option to allow it to query interactively for the passphrase. +# +# The key file name is given as argument to the program allowing +# selection of the right password if you have multiple encrypted +# keys. +#Default: +# none + +# OPTIONS RELATING TO EXTERNAL SSL_CRTD +# ----------------------------------------------------------------------------- + +# TAG: sslcrtd_program +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# Specify the location and options of the executable for ssl_crtd process. +# /usr/lib/squid/ssl_crtd program requires -s and -M parameters +# For more information use: +# /usr/lib/squid/ssl_crtd -h +#Default: +# sslcrtd_program /usr/lib/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB + +# TAG: sslcrtd_children +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# The maximum number of processes spawn to service ssl server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# You must have at least one ssl_crtd process. +#Default: +# sslcrtd_children 32 startup=5 idle=1 + +# TAG: sslcrtvalidator_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify the location and options of the executable for ssl_crt_validator +# process. +# +# Usage: sslcrtvalidator_program [ttl=n] [cache=n] path ... +# +# Options: +# ttl=n TTL in seconds for cached results. The default is 60 secs +# cache=n limit the result cache size. The default value is 2048 +#Default: +# none + +# TAG: sslcrtvalidator_children +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The maximum number of processes spawn to service SSL server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each certificate validator helper can handle in +# parallel. A value of 0 indicates the certficate validator does not +# support concurrency. Defaults to 1. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# a request ID in front of the request/response. The request +# ID from the request must be echoed back with the response +# to that request. +# +# You must have at least one ssl_crt_validator process. +#Default: +# sslcrtvalidator_children 32 startup=5 idle=1 concurrency=1 + +# OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM +# ----------------------------------------------------------------------------- + +# TAG: cache_peer +# To specify other caches in a hierarchy, use the format: +# +# cache_peer hostname type http-port icp-port [options] +# +# For example, +# +# # proxy icp +# # hostname type port port options +# # -------------------- -------- ----- ----- ----------- +# cache_peer parent.foo.net parent 3128 3130 default +# cache_peer sib1.foo.net sibling 3128 3130 proxy-only +# cache_peer sib2.foo.net sibling 3128 3130 proxy-only +# cache_peer example.com parent 80 0 default +# cache_peer cdn.example.com sibling 3128 0 +# +# type: either 'parent', 'sibling', or 'multicast'. +# +# proxy-port: The port number where the peer accept HTTP requests. +# For other Squid proxies this is usually 3128 +# For web servers this is usually 80 +# +# icp-port: Used for querying neighbor caches about objects. +# Set to 0 if the peer does not support ICP or HTCP. +# See ICP and HTCP options below for additional details. +# +# +# ==== ICP OPTIONS ==== +# +# You MUST also set icp_port and icp_access explicitly when using these options. +# The defaults will prevent peer traffic using ICP. +# +# +# no-query Disable ICP queries to this neighbor. +# +# multicast-responder +# Indicates the named peer is a member of a multicast group. +# ICP queries will not be sent directly to the peer, but ICP +# replies will be accepted from it. +# +# closest-only Indicates that, for ICP_OP_MISS replies, we'll only forward +# CLOSEST_PARENT_MISSes and never FIRST_PARENT_MISSes. +# +# background-ping +# To only send ICP queries to this neighbor infrequently. +# This is used to keep the neighbor round trip time updated +# and is usually used in conjunction with weighted-round-robin. +# +# +# ==== HTCP OPTIONS ==== +# +# You MUST also set htcp_port and htcp_access explicitly when using these options. +# The defaults will prevent peer traffic using HTCP. +# +# +# htcp Send HTCP, instead of ICP, queries to the neighbor. +# You probably also want to set the "icp-port" to 4827 +# instead of 3130. This directive accepts a comma separated +# list of options described below. +# +# htcp=oldsquid Send HTCP to old Squid versions (2.5 or earlier). +# +# htcp=no-clr Send HTCP to the neighbor but without +# sending any CLR requests. This cannot be used with +# only-clr. +# +# htcp=only-clr Send HTCP to the neighbor but ONLY CLR requests. +# This cannot be used with no-clr. +# +# htcp=no-purge-clr +# Send HTCP to the neighbor including CLRs but only when +# they do not result from PURGE requests. +# +# htcp=forward-clr +# Forward any HTCP CLR requests this proxy receives to the peer. +# +# +# ==== PEER SELECTION METHODS ==== +# +# The default peer selection method is ICP, with the first responding peer +# being used as source. These options can be used for better load balancing. +# +# +# default This is a parent cache which can be used as a "last-resort" +# if a peer cannot be located by any of the peer-selection methods. +# If specified more than once, only the first is used. +# +# round-robin Load-Balance parents which should be used in a round-robin +# fashion in the absence of any ICP queries. +# weight=N can be used to add bias. +# +# weighted-round-robin +# Load-Balance parents which should be used in a round-robin +# fashion with the frequency of each parent being based on the +# round trip time. Closer parents are used more often. +# Usually used for background-ping parents. +# weight=N can be used to add bias. +# +# carp Load-Balance parents which should be used as a CARP array. +# The requests will be distributed among the parents based on the +# CARP load balancing hash function based on their weight. +# +# userhash Load-balance parents based on the client proxy_auth or ident username. +# +# sourcehash Load-balance parents based on the client source IP. +# +# multicast-siblings +# To be used only for cache peers of type "multicast". +# ALL members of this multicast group have "sibling" +# relationship with it, not "parent". This is to a multicast +# group when the requested object would be fetched only from +# a "parent" cache, anyway. It's useful, e.g., when +# configuring a pool of redundant Squid proxies, being +# members of the same multicast group. +# +# +# ==== PEER SELECTION OPTIONS ==== +# +# weight=N use to affect the selection of a peer during any weighted +# peer-selection mechanisms. +# The weight must be an integer; default is 1, +# larger weights are favored more. +# This option does not affect parent selection if a peering +# protocol is not in use. +# +# basetime=N Specify a base amount to be subtracted from round trip +# times of parents. +# It is subtracted before division by weight in calculating +# which parent to fectch from. If the rtt is less than the +# base time the rtt is set to a minimal value. +# +# ttl=N Specify a TTL to use when sending multicast ICP queries +# to this address. +# Only useful when sending to a multicast group. +# Because we don't accept ICP replies from random +# hosts, you must configure other group members as +# peers with the 'multicast-responder' option. +# +# no-delay To prevent access to this neighbor from influencing the +# delay pools. +# +# digest-url=URL Tell Squid to fetch the cache digest (if digests are +# enabled) for this host from the specified URL rather +# than the Squid default location. +# +# +# ==== CARP OPTIONS ==== +# +# carp-key=key-specification +# use a different key than the full URL to hash against the peer. +# the key-specification is a comma-separated list of the keywords +# scheme, host, port, path, params +# Order is not important. +# +# ==== ACCELERATOR / REVERSE-PROXY OPTIONS ==== +# +# originserver Causes this parent to be contacted as an origin server. +# Meant to be used in accelerator setups when the peer +# is a web server. +# +# forceddomain=name +# Set the Host header of requests forwarded to this peer. +# Useful in accelerator setups where the server (peer) +# expects a certain domain name but clients may request +# others. ie example.com or www.example.com +# +# no-digest Disable request of cache digests. +# +# no-netdb-exchange +# Disables requesting ICMP RTT database (NetDB). +# +# +# ==== AUTHENTICATION OPTIONS ==== +# +# login=user:password +# If this is a personal/workgroup proxy and your parent +# requires proxy authentication. +# +# Note: The string can include URL escapes (i.e. %20 for +# spaces). This also means % must be written as %%. +# +# login=PASSTHRU +# Send login details received from client to this peer. +# Both Proxy- and WWW-Authorization headers are passed +# without alteration to the peer. +# Authentication is not required by Squid for this to work. +# +# Note: This will pass any form of authentication but +# only Basic auth will work through a proxy unless the +# connection-auth options are also used. +# +# login=PASS Send login details received from client to this peer. +# Authentication is not required by this option. +# +# If there are no client-provided authentication headers +# to pass on, but username and password are available +# from an external ACL user= and password= result tags +# they may be sent instead. +# +# Note: To combine this with proxy_auth both proxies must +# share the same user database as HTTP only allows for +# a single login (one for proxy, one for origin server). +# Also be warned this will expose your users proxy +# password to the peer. USE WITH CAUTION +# +# login=*:password +# Send the username to the upstream cache, but with a +# fixed password. This is meant to be used when the peer +# is in another administrative domain, but it is still +# needed to identify each user. +# The star can optionally be followed by some extra +# information which is added to the username. This can +# be used to identify this proxy to the peer, similar to +# the login=username:password option above. +# +# login=NEGOTIATE +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The first principal from the default keytab or defined by +# the environment variable KRB5_KTNAME will be used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# login=NEGOTIATE:principal_name +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The principal principal_name from the default keytab or +# defined by the environment variable KRB5_KTNAME will be +# used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# connection-auth=on|off +# Tell Squid that this peer does or not support Microsoft +# connection oriented authentication, and any such +# challenges received from there should be ignored. +# Default is auto to automatically determine the status +# of the peer. +# +# +# ==== SSL / HTTPS / TLS OPTIONS ==== +# +# ssl Encrypt connections to this peer with SSL/TLS. +# +# sslcert=/path/to/ssl/certificate +# A client SSL certificate to use when connecting to +# this peer. +# +# sslkey=/path/to/ssl/key +# The private SSL key corresponding to sslcert above. +# If 'sslkey' is not specified 'sslcert' is assumed to +# reference a combined file containing both the +# certificate and the key. +# +# Notes: +# +# On Debian/Ubuntu systems a default snakeoil certificate is +# available in /etc/ssl and users can set: +# +# cert=/etc/ssl/certs/ssl-cert-snakeoil.pem +# +# and +# +# key=/etc/ssl/private/ssl-cert-snakeoil.key +# +# for testing. +# +# sslversion=1|2|3|4|5|6 +# The SSL version to use when connecting to this peer +# 1 = automatic (default) +# 2 = SSL v2 only +# 3 = SSL v3 only +# 4 = TLS v1.0 only +# 5 = TLS v1.1 only +# 6 = TLS v1.2 only +# +# sslcipher=... The list of valid SSL ciphers to use when connecting +# to this peer. +# +# ssloptions=... Specify various SSL implementation options: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# more complete list. +# +# sslcafile=... A file containing additional CA certificates to use +# when verifying the peer certificate. +# +# sslcapath=... A directory containing additional CA certificates to +# use when verifying the peer certificate. +# +# sslcrlfile=... A certificate revocation list file to use when +# verifying the peer certificate. +# +# sslflags=... Specify various flags modifying the SSL implementation: +# +# DONT_VERIFY_PEER +# Accept certificates even if they fail to +# verify. +# NO_DEFAULT_CA +# Don't use the default CA list built in +# to OpenSSL. +# DONT_VERIFY_DOMAIN +# Don't verify the peer certificate +# matches the server name +# +# ssldomain= The peer name as advertised in it's certificate. +# Used for verifying the correctness of the received peer +# certificate. If not specified the peer hostname will be +# used. +# +# front-end-https +# Enable the "Front-End-Https: On" header needed when +# using Squid as a SSL frontend in front of Microsoft OWA. +# See MS KB document Q307347 for details on this header. +# If set to auto the header will only be added if the +# request is forwarded as a https:// URL. +# +# +# ==== GENERAL OPTIONS ==== +# +# connect-timeout=N +# A peer-specific connect timeout. +# Also see the peer_connect_timeout directive. +# +# connect-fail-limit=N +# How many times connecting to a peer must fail before +# it is marked as down. Standby connection failures +# count towards this limit. Default is 10. +# +# allow-miss Disable Squid's use of only-if-cached when forwarding +# requests to siblings. This is primarily useful when +# icp_hit_stale is used by the sibling. Excessive use +# of this option may result in forwarding loops. One way +# to prevent peering loops when using this option, is to +# deny cache peer usage on requests from a peer: +# acl fromPeer ... +# cache_peer_access peerName deny fromPeer +# +# max-conn=N Limit the number of concurrent connections the Squid +# may open to this peer, including already opened idle +# and standby connections. There is no peer-specific +# connection limit by default. +# +# A peer exceeding the limit is not used for new +# requests unless a standby connection is available. +# +# max-conn currently works poorly with idle persistent +# connections: When a peer reaches its max-conn limit, +# and there are idle persistent connections to the peer, +# the peer may not be selected because the limiting code +# does not know whether Squid can reuse those idle +# connections. +# +# standby=N Maintain a pool of N "hot standby" connections to an +# UP peer, available for requests when no idle +# persistent connection is available (or safe) to use. +# By default and with zero N, no such pool is maintained. +# N must not exceed the max-conn limit (if any). +# +# At start or after reconfiguration, Squid opens new TCP +# standby connections until there are N connections +# available and then replenishes the standby pool as +# opened connections are used up for requests. A used +# connection never goes back to the standby pool, but +# may go to the regular idle persistent connection pool +# shared by all peers and origin servers. +# +# Squid never opens multiple new standby connections +# concurrently. This one-at-a-time approach minimizes +# flooding-like effect on peers. Furthermore, just a few +# standby connections should be sufficient in most cases +# to supply most new requests with a ready-to-use +# connection. +# +# Standby connections obey server_idle_pconn_timeout. +# For the feature to work as intended, the peer must be +# configured to accept and keep them open longer than +# the idle timeout at the connecting Squid, to minimize +# race conditions typical to idle used persistent +# connections. Default request_timeout and +# server_idle_pconn_timeout values ensure such a +# configuration. +# +# name=xxx Unique name for the peer. +# Required if you have multiple peers on the same host +# but different ports. +# This name can be used in cache_peer_access and similar +# directives to identify the peer. +# Can be used by outgoing access controls through the +# peername ACL type. +# +# no-tproxy Do not use the client-spoof TPROXY support when forwarding +# requests to this peer. Use normal address selection instead. +# This overrides the spoof_client_ip ACL. +# +# proxy-only objects fetched from the peer will not be stored locally. +# +#Default: +# none + +# TAG: cache_peer_domain +# Use to limit the domains for which a neighbor cache will be +# queried. +# +# Usage: +# cache_peer_domain cache-host domain [domain ...] +# cache_peer_domain cache-host !domain +# +# For example, specifying +# +# cache_peer_domain parent.foo.net .edu +# +# has the effect such that UDP query packets are sent to +# 'bigserver' only when the requested object exists on a +# server in the .edu domain. Prefixing the domainname +# with '!' means the cache will be queried for objects +# NOT in that domain. +# +# NOTE: * Any number of domains may be given for a cache-host, +# either on the same or separate lines. +# * When multiple domains are given for a particular +# cache-host, the first matched domain is applied. +# * Cache hosts with no domain restrictions are queried +# for all requests. +# * There are no defaults. +# * There is also a 'cache_peer_access' tag in the ACL +# section. +#Default: +# none + +# TAG: cache_peer_access +# Restricts usage of cache_peer proxies. +# +# Usage: +# cache_peer_access peer-name allow|deny [!]aclname ... +# +# For the required peer-name parameter, use either the value of the +# cache_peer name=value parameter or, if name=value is missing, the +# cache_peer hostname parameter. +# +# This directive narrows down the selection of peering candidates, but +# does not determine the order in which the selected candidates are +# contacted. That order is determined by the peer selection algorithms +# (see PEER SELECTION sections in the cache_peer documentation). +# +# If a deny rule matches, the corresponding peer will not be contacted +# for the current transaction -- Squid will not send ICP queries and +# will not forward HTTP requests to that peer. An allow match leaves +# the corresponding peer in the selection. The first match for a given +# peer wins for that peer. +# +# The relative order of cache_peer_access directives for the same peer +# matters. The relative order of any two cache_peer_access directives +# for different peers does not matter. To ease interpretation, it is a +# good idea to group cache_peer_access directives for the same peer +# together. +# +# A single cache_peer_access directive may be evaluated multiple times +# for a given transaction because individual peer selection algorithms +# may check it independently from each other. These redundant checks +# may be optimized away in future Squid versions. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# No peer usage restrictions. + +# TAG: neighbor_type_domain +# Modify the cache_peer neighbor type when passing requests +# about specific domains to the peer. +# +# Usage: +# neighbor_type_domain neighbor parent|sibling domain domain ... +# +# For example: +# cache_peer foo.example.com parent 3128 3130 +# neighbor_type_domain foo.example.com sibling .au .de +# +# The above configuration treats all requests to foo.example.com as a +# parent proxy unless the request is for a .au or .de ccTLD domain name. +#Default: +# The peer type from cache_peer directive is used for all requests to that peer. + +# TAG: dead_peer_timeout (seconds) +# This controls how long Squid waits to declare a peer cache +# as "dead." If there are no ICP replies received in this +# amount of time, Squid will declare the peer dead and not +# expect to receive any further ICP replies. However, it +# continues to send ICP queries, and will mark the peer as +# alive upon receipt of the first subsequent ICP reply. +# +# This timeout also affects when Squid expects to receive ICP +# replies from peers. If more than 'dead_peer' seconds have +# passed since the last ICP reply was received, Squid will not +# expect to receive an ICP reply on the next query. Thus, if +# your time between requests is greater than this timeout, you +# will see a lot of requests sent DIRECT to origin servers +# instead of to your parents. +#Default: +# dead_peer_timeout 10 seconds + +# TAG: forward_max_tries +# Controls how many different forward paths Squid will try +# before giving up. See also forward_timeout. +# +# NOTE: connect_retries (default: none) can make each of these +# possible forwarding paths be tried multiple times. +#Default: +# forward_max_tries 25 + +# MEMORY CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_mem (bytes) +# NOTE: THIS PARAMETER DOES NOT SPECIFY THE MAXIMUM PROCESS SIZE. +# IT ONLY PLACES A LIMIT ON HOW MUCH ADDITIONAL MEMORY SQUID WILL +# USE AS A MEMORY CACHE OF OBJECTS. SQUID USES MEMORY FOR OTHER +# THINGS AS WELL. SEE THE SQUID FAQ SECTION 8 FOR DETAILS. +# +# 'cache_mem' specifies the ideal amount of memory to be used +# for: +# * In-Transit objects +# * Hot Objects +# * Negative-Cached objects +# +# Data for these objects are stored in 4 KB blocks. This +# parameter specifies the ideal upper limit on the total size of +# 4 KB blocks allocated. In-Transit objects take the highest +# priority. +# +# In-transit objects have priority over the others. When +# additional space is needed for incoming data, negative-cached +# and hot objects will be released. In other words, the +# negative-cached and hot objects will fill up any unused space +# not needed for in-transit objects. +# +# If circumstances require, this limit will be exceeded. +# Specifically, if your incoming request rate requires more than +# 'cache_mem' of memory to hold in-transit objects, Squid will +# exceed this limit to satisfy the new requests. When the load +# decreases, blocks will be freed until the high-water mark is +# reached. Thereafter, blocks will be used to store hot +# objects. +# +# If shared memory caching is enabled, Squid does not use the shared +# cache space for in-transit objects, but they still consume as much +# local memory as they need. For more details about the shared memory +# cache, see memory_cache_shared. +#Default: +# cache_mem 256 MB + +# TAG: maximum_object_size_in_memory (bytes) +# Objects greater than this size will not be attempted to kept in +# the memory cache. This should be set high enough to keep objects +# accessed frequently in memory to improve performance whilst low +# enough to keep larger objects from hoarding cache_mem. +#Default: +# maximum_object_size_in_memory 512 KB + +# TAG: memory_cache_shared on|off +# Controls whether the memory cache is shared among SMP workers. +# +# The shared memory cache is meant to occupy cache_mem bytes and replace +# the non-shared memory cache, although some entities may still be +# cached locally by workers for now (e.g., internal and in-transit +# objects may be served from a local memory cache even if shared memory +# caching is enabled). +# +# By default, the memory cache is shared if and only if all of the +# following conditions are satisfied: Squid runs in SMP mode with +# multiple workers, cache_mem is positive, and Squid environment +# supports required IPC primitives (e.g., POSIX shared memory segments +# and GCC-style atomic operations). +# +# To avoid blocking locks, shared memory uses opportunistic algorithms +# that do not guarantee that every cachable entity that could have been +# shared among SMP workers will actually be shared. +#Default: +# "on" where supported if doing memory caching with multiple SMP workers. + +# TAG: memory_cache_mode +# Controls which objects to keep in the memory cache (cache_mem) +# +# always Keep most recently fetched objects in memory (default) +# +# disk Only disk cache hits are kept in memory, which means +# an object must first be cached on disk and then hit +# a second time before cached in memory. +# +# network Only objects fetched from network is kept in memory +#Default: +# Keep the most recently fetched objects in memory + +# TAG: memory_replacement_policy +# The memory replacement policy parameter determines which +# objects are purged from memory when memory space is needed. +# +# See cache_replacement_policy for details on algorithms. +#Default: +# memory_replacement_policy lru + +# DISK CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_replacement_policy +# The cache replacement policy parameter determines which +# objects are evicted (replaced) when disk space is needed. +# +# lru : Squid's original list based LRU policy +# heap GDSF : Greedy-Dual Size Frequency +# heap LFUDA: Least Frequently Used with Dynamic Aging +# heap LRU : LRU policy implemented using a heap +# +# Applies to any cache_dir lines listed below this directive. +# +# The LRU policies keeps recently referenced objects. +# +# The heap GDSF policy optimizes object hit rate by keeping smaller +# popular objects in cache so it has a better chance of getting a +# hit. It achieves a lower byte hit rate than LFUDA though since +# it evicts larger (possibly popular) objects. +# +# The heap LFUDA policy keeps popular objects in cache regardless of +# their size and thus optimizes byte hit rate at the expense of +# hit rate since one large, popular object will prevent many +# smaller, slightly less popular objects from being cached. +# +# Both policies utilize a dynamic aging mechanism that prevents +# cache pollution that can otherwise occur with frequency-based +# replacement policies. +# +# NOTE: if using the LFUDA replacement policy you should increase +# the value of maximum_object_size above its default of 4 MB to +# to maximize the potential byte hit rate improvement of LFUDA. +# +# For more information about the GDSF and LFUDA cache replacement +# policies see http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html +# and http://fog.hpl.external.hp.com/techreports/98/HPL-98-173.html. +#Default: +# cache_replacement_policy lru + +# TAG: minimum_object_size (bytes) +# Objects smaller than this size will NOT be saved on disk. The +# value is specified in bytes, and the default is 0 KB, which +# means all responses can be stored. +#Default: +# no limit + +# TAG: maximum_object_size (bytes) +# Set the default value for max-size parameter on any cache_dir. +# The value is specified in bytes, and the default is 4 MB. +# +# If you wish to get a high BYTES hit ratio, you should probably +# increase this (one 32 MB object hit counts for 3200 10KB +# hits). +# +# If you wish to increase hit ratio more than you want to +# save bandwidth you should leave this low. +# +# NOTE: if using the LFUDA replacement policy you should increase +# this value to maximize the byte hit rate improvement of LFUDA! +# See cache_replacement_policy for a discussion of this policy. +#Default: +# maximum_object_size 4 MB + +# TAG: cache_dir +# Format: +# cache_dir Type Directory-Name Fs-specific-data [options] +# +# You can specify multiple cache_dir lines to spread the +# cache among different disk partitions. +# +# Type specifies the kind of storage system to use. Only "ufs" +# is built by default. To enable any of the other storage systems +# see the --enable-storeio configure option. +# +# 'Directory' is a top-level directory where cache swap +# files will be stored. If you want to use an entire disk +# for caching, this can be the mount-point directory. +# The directory must exist and be writable by the Squid +# process. Squid will NOT create this directory for you. +# +# In SMP configurations, cache_dir must not precede the workers option +# and should use configuration macros or conditionals to give each +# worker interested in disk caching a dedicated cache directory. +# +# +# ==== The ufs store type ==== +# +# "ufs" is the old well-known Squid storage format that has always +# been there. +# +# Usage: +# cache_dir ufs Directory-Name Mbytes L1 L2 [options] +# +# 'Mbytes' is the amount of disk space (MB) to use under this +# directory. The default is 100 MB. Change this to suit your +# configuration. Do NOT put the size of your disk drive here. +# Instead, if you want Squid to use the entire disk drive, +# subtract 20% and use that value. +# +# 'L1' is the number of first-level subdirectories which +# will be created under the 'Directory'. The default is 16. +# +# 'L2' is the number of second-level subdirectories which +# will be created under each first-level directory. The default +# is 256. +# +# +# ==== The aufs store type ==== +# +# "aufs" uses the same storage format as "ufs", utilizing +# POSIX-threads to avoid blocking the main Squid process on +# disk-I/O. This was formerly known in Squid as async-io. +# +# Usage: +# cache_dir aufs Directory-Name Mbytes L1 L2 [options] +# +# see argument descriptions under ufs above +# +# +# ==== The diskd store type ==== +# +# "diskd" uses the same storage format as "ufs", utilizing a +# separate process to avoid blocking the main Squid process on +# disk-I/O. +# +# Usage: +# cache_dir diskd Directory-Name Mbytes L1 L2 [options] [Q1=n] [Q2=n] +# +# see argument descriptions under ufs above +# +# Q1 specifies the number of unacknowledged I/O requests when Squid +# stops opening new files. If this many messages are in the queues, +# Squid won't open new files. Default is 64 +# +# Q2 specifies the number of unacknowledged messages when Squid +# starts blocking. If this many messages are in the queues, +# Squid blocks until it receives some replies. Default is 72 +# +# When Q1 < Q2 (the default), the cache directory is optimized +# for lower response time at the expense of a decrease in hit +# ratio. If Q1 > Q2, the cache directory is optimized for +# higher hit ratio at the expense of an increase in response +# time. +# +# +# ==== The rock store type ==== +# +# Usage: +# cache_dir rock Directory-Name Mbytes [options] +# +# The Rock Store type is a database-style storage. All cached +# entries are stored in a "database" file, using fixed-size slots. +# A single entry occupies one or more slots. +# +# If possible, Squid using Rock Store creates a dedicated kid +# process called "disker" to avoid blocking Squid worker(s) on disk +# I/O. One disker kid is created for each rock cache_dir. Diskers +# are created only when Squid, running in daemon mode, has support +# for the IpcIo disk I/O module. +# +# swap-timeout=msec: Squid will not start writing a miss to or +# reading a hit from disk if it estimates that the swap operation +# will take more than the specified number of milliseconds. By +# default and when set to zero, disables the disk I/O time limit +# enforcement. Ignored when using blocking I/O module because +# blocking synchronous I/O does not allow Squid to estimate the +# expected swap wait time. +# +# max-swap-rate=swaps/sec: Artificially limits disk access using +# the specified I/O rate limit. Swap out requests that +# would cause the average I/O rate to exceed the limit are +# delayed. Individual swap in requests (i.e., hits or reads) are +# not delayed, but they do contribute to measured swap rate and +# since they are placed in the same FIFO queue as swap out +# requests, they may wait longer if max-swap-rate is smaller. +# This is necessary on file systems that buffer "too +# many" writes and then start blocking Squid and other processes +# while committing those writes to disk. Usually used together +# with swap-timeout to avoid excessive delays and queue overflows +# when disk demand exceeds available disk "bandwidth". By default +# and when set to zero, disables the disk I/O rate limit +# enforcement. Currently supported by IpcIo module only. +# +# slot-size=bytes: The size of a database "record" used for +# storing cached responses. A cached response occupies at least +# one slot and all database I/O is done using individual slots so +# increasing this parameter leads to more disk space waste while +# decreasing it leads to more disk I/O overheads. Should be a +# multiple of your operating system I/O page size. Defaults to +# 16KBytes. A housekeeping header is stored with each slot and +# smaller slot-sizes will be rejected. The header is smaller than +# 100 bytes. +# +# +# ==== COMMON OPTIONS ==== +# +# no-store no new objects should be stored to this cache_dir. +# +# min-size=n the minimum object size in bytes this cache_dir +# will accept. It's used to restrict a cache_dir +# to only store large objects (e.g. AUFS) while +# other stores are optimized for smaller objects +# (e.g. Rock). +# Defaults to 0. +# +# max-size=n the maximum object size in bytes this cache_dir +# supports. +# The value in maximum_object_size directive sets +# the default unless more specific details are +# available (ie a small store capacity). +# +# Note: To make optimal use of the max-size limits you should order +# the cache_dir lines with the smallest max-size value first. +# +#Default: +# No disk cache. Store cache ojects only in memory. +# + +# Uncomment and adjust the following to add a disk cache directory. +#cache_dir ufs /var/spool/squid 100 16 256 + +# TAG: store_dir_select_algorithm +# How Squid selects which cache_dir to use when the response +# object will fit into more than one. +# +# Regardless of which algorithm is used the cache_dir min-size +# and max-size parameters are obeyed. As such they can affect +# the selection algorithm by limiting the set of considered +# cache_dir. +# +# Algorithms: +# +# least-load +# +# This algorithm is suited to caches with similar cache_dir +# sizes and disk speeds. +# +# The disk with the least I/O pending is selected. +# When there are multiple disks with the same I/O load ranking +# the cache_dir with most available capacity is selected. +# +# When a mix of cache_dir sizes are configured the faster disks +# have a naturally lower I/O loading and larger disks have more +# capacity. So space used to store objects and data throughput +# may be very unbalanced towards larger disks. +# +# +# round-robin +# +# This algorithm is suited to caches with unequal cache_dir +# disk sizes. +# +# Each cache_dir is selected in a rotation. The next suitable +# cache_dir is used. +# +# Available cache_dir capacity is only considered in relation +# to whether the object will fit and meets the min-size and +# max-size parameters. +# +# Disk I/O loading is only considered to prevent overload on slow +# disks. This algorithm does not spread objects by size, so any +# I/O loading per-disk may appear very unbalanced and volatile. +# +# If several cache_dirs use similar min-size, max-size, or other +# limits to to reject certain responses, then do not group such +# cache_dir lines together, to avoid round-robin selection bias +# towards the first cache_dir after the group. Instead, interleave +# cache_dir lines from different groups. For example: +# +# store_dir_select_algorithm round-robin +# cache_dir rock /hdd1 ... min-size=100000 +# cache_dir rock /ssd1 ... max-size=99999 +# cache_dir rock /hdd2 ... min-size=100000 +# cache_dir rock /ssd2 ... max-size=99999 +# cache_dir rock /hdd3 ... min-size=100000 +# cache_dir rock /ssd3 ... max-size=99999 +#Default: +# store_dir_select_algorithm least-load + +# TAG: max_open_disk_fds +# To avoid having disk as the I/O bottleneck Squid can optionally +# bypass the on-disk cache if more than this amount of disk file +# descriptors are open. +# +# A value of 0 indicates no limit. +#Default: +# no limit + +# TAG: cache_swap_low (percent, 0-100) +# The low-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above this low-water mark and attempts to maintain utilization +# near the low-water mark. +# +# As swap utilization increases towards the high-water mark set +# by cache_swap_high object eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_high and cache_replacement_policy +#Default: +# cache_swap_low 90 + +# TAG: cache_swap_high (percent, 0-100) +# The high-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above the low-water mark set by cache_swap_low and attempts to +# maintain utilization near the low-water mark. +# +# As swap utilization increases towards this high-water mark object +# eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_low and cache_replacement_policy +#Default: +# cache_swap_high 95 + +# LOGFILE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: logformat +# Usage: +# +# logformat +# +# Defines an access log format. +# +# The is a string with embedded % format codes +# +# % format codes all follow the same basic structure where all but +# the formatcode is optional. Output strings are automatically escaped +# as required according to their context and the output format +# modifiers are usually not needed, but can be specified if an explicit +# output format is desired. +# +# % ["|[|'|#] [-] [[0]width] [{argument}] formatcode +# +# " output in quoted string format +# [ output in squid text log format as used by log_mime_hdrs +# # output in URL quoted format +# ' output as-is +# +# - left aligned +# +# width minimum and/or maximum field width: +# [width_min][.width_max] +# When minimum starts with 0, the field is zero-padded. +# String values exceeding maximum width are truncated. +# +# {arg} argument such as header name etc +# +# Format codes: +# +# % a literal % character +# sn Unique sequence number per log line entry +# err_code The ID of an error response served by Squid or +# a similar internal error identifier. +# err_detail Additional err_code-dependent error information. +# note The annotation specified by the argument. Also +# logs the adaptation meta headers set by the +# adaptation_meta configuration parameter. +# If no argument given all annotations logged. +# The argument may include a separator to use with +# annotation values: +# name[:separator] +# By default, multiple note values are separated with "," +# and multiple notes are separated with "\r\n". +# When logging named notes with %{name}note, the +# explicitly configured separator is used between note +# values. When logging all notes with %note, the +# explicitly configured separator is used between +# individual notes. There is currently no way to +# specify both value and notes separators when logging +# all notes with %note. +# +# Connection related format codes: +# +# >a Client source IP address +# >A Client FQDN +# >p Client source port +# >eui Client source EUI (MAC address, EUI-48 or EUI-64 identifier) +# >la Local IP address the client connected to +# >lp Local port number the client connected to +# >qos Client connection TOS/DSCP value set by Squid +# >nfmark Client connection netfilter mark set by Squid +# +# la Local listening IP address the client connection was connected to. +# lp Local listening port number the client connection was connected to. +# +# . format. +# Currently, Squid considers the master transaction +# started when a complete HTTP request header initiating +# the transaction is received from the client. This is +# the same value that Squid uses to calculate transaction +# response time when logging %tr to access.log. Currently, +# Squid uses millisecond resolution for %tS values, +# similar to the default access.log "current time" field +# (%ts.%03tu). +# +# Access Control related format codes: +# +# et Tag returned by external acl +# ea Log string returned by external acl +# un User name (any available) +# ul User name from authentication +# ue User name from external acl helper +# ui User name from ident +# un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul +# - user name supplied by an external ACL, like %ue +# - SSL client name, like %us +# - ident user name, like %ui +# credentials Client credentials. The exact meaning depends on +# the authentication scheme: For Basic authentication, +# it is the password; for Digest, the realm sent by the +# client; for NTLM and Negotiate, the client challenge +# or client credentials prefixed with "YR " or "KK ". +# +# HTTP related format codes: +# +# REQUEST +# +# [http::]rm Request method (GET/POST etc) +# [http::]>rm Request method from client +# [http::]ru Request URL from client +# [http::]rs Request URL scheme from client +# [http::]rd Request URL domain from client +# [http::]rP Request URL port from client +# [http::]rp Request URL path excluding hostname from client +# [http::]rv Request protocol version from client +# [http::]h Original received request header. +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Accepts optional header field name/value filter +# argument using name[:[separator]element] format. +# [http::]>ha Received request header after adaptation and +# redirection (pre-cache REQMOD vectoring point). +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Optional header name argument as for >h +# +# +# RESPONSE +# +# [http::]Hs HTTP status code sent to the client +# +# [http::]h +# +# [http::]mt MIME content type +# +# +# SIZE COUNTERS +# +# [http::]st Total size of request + reply traffic with client +# [http::]>st Total size of request received from client. +# Excluding chunked encoding bytes. +# [http::]sh Size of request headers received from client +# [http::]sni SSL client SNI sent to Squid. Available only +# after the peek, stare, or splice SSL bumping +# actions. +# +# If ICAP is enabled, the following code becomes available (as +# well as ICAP log codes documented with the icap_log option): +# +# icap::tt Total ICAP processing time for the HTTP +# transaction. The timer ticks when ICAP +# ACLs are checked and when ICAP +# transaction is in progress. +# +# If adaptation is enabled the following three codes become available: +# +# adapt::cert_subject The Subject field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Subject often has spaces. +# +# %ssl::>cert_issuer The Issuer field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Issuer often has spaces. +# +# The default formats available (which do not need re-defining) are: +# +#logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %h" "%{User-Agent}>h" %Ss:%Sh +#logformat referrer %ts.%03tu %>a %{Referer}>h %ru +#logformat useragent %>a [%tl] "%{User-Agent}>h" +# +# NOTE: When the log_mime_hdrs directive is set to ON. +# The squid, common and combined formats have a safely encoded copy +# of the mime headers appended to each line within a pair of brackets. +# +# NOTE: The common and combined formats are not quite true to the Apache definition. +# The logs from Squid contain an extra status and hierarchy code appended. +# +#Default: +# The format definitions squid, common, combined, referrer, useragent are built in. + +# TAG: access_log +# Configures whether and how Squid logs HTTP and ICP transactions. +# If access logging is enabled, a single line is logged for every +# matching HTTP or ICP request. The recommended directive formats are: +# +# access_log : [option ...] [acl acl ...] +# access_log none [acl acl ...] +# +# The following directive format is accepted but may be deprecated: +# access_log : [ [acl acl ...]] +# +# In most cases, the first ACL name must not contain the '=' character +# and should not be equal to an existing logformat name. You can always +# start with an 'all' ACL to work around those restrictions. +# +# Will log to the specified module:place using the specified format (which +# must be defined in a logformat directive) those entries which match +# ALL the acl's specified (which must be defined in acl clauses). +# If no acl is specified, all requests will be logged to this destination. +# +# ===== Available options for the recommended directive format ===== +# +# logformat=name Names log line format (either built-in or +# defined by a logformat directive). Defaults +# to 'squid'. +# +# buffer-size=64KB Defines approximate buffering limit for log +# records (see buffered_logs). Squid should not +# keep more than the specified size and, hence, +# should flush records before the buffer becomes +# full to avoid overflows under normal +# conditions (the exact flushing algorithm is +# module-dependent though). The on-error option +# controls overflow handling. +# +# on-error=die|drop Defines action on unrecoverable errors. The +# 'drop' action ignores (i.e., does not log) +# affected log records. The default 'die' action +# kills the affected worker. The drop action +# support has not been tested for modules other +# than tcp. +# +# ===== Modules Currently available ===== +# +# none Do not log any requests matching these ACL. +# Do not specify Place or logformat name. +# +# stdio Write each log line to disk immediately at the completion of +# each request. +# Place: the filename and path to be written. +# +# daemon Very similar to stdio. But instead of writing to disk the log +# line is passed to a daemon helper for asychronous handling instead. +# Place: varies depending on the daemon. +# +# log_file_daemon Place: the file name and path to be written. +# +# syslog To log each request via syslog facility. +# Place: The syslog facility and priority level for these entries. +# Place Format: facility.priority +# +# where facility could be any of: +# authpriv, daemon, local0 ... local7 or user. +# +# And priority could be any of: +# err, warning, notice, info, debug. +# +# udp To send each log line as text data to a UDP receiver. +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# tcp To send each log line as text data to a TCP receiver. +# Lines may be accumulated before sending (see buffered_logs). +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# Default: +# access_log daemon:/var/log/squid/access.log squid +#Default: +# access_log daemon:/var/log/squid/access.log squid + +# TAG: icap_log +# ICAP log files record ICAP transaction summaries, one line per +# transaction. +# +# The icap_log option format is: +# icap_log [ [acl acl ...]] +# icap_log none [acl acl ...]] +# +# Please see access_log option documentation for details. The two +# kinds of logs share the overall configuration approach and many +# features. +# +# ICAP processing of a single HTTP message or transaction may +# require multiple ICAP transactions. In such cases, multiple +# ICAP transaction log lines will correspond to a single access +# log line. +# +# ICAP log supports many access.log logformat %codes. In ICAP context, +# HTTP message-related %codes are applied to the HTTP message embedded +# in an ICAP message. Logformat "%http::>..." codes are used for HTTP +# messages embedded in ICAP requests while "%http::<..." codes are used +# for HTTP messages embedded in ICAP responses. For example: +# +# http::>h To-be-adapted HTTP message headers sent by Squid to +# the ICAP service. For REQMOD transactions, these are +# HTTP request headers. For RESPMOD, these are HTTP +# response headers, but Squid currently cannot log them +# (i.e., %http::>h will expand to "-" for RESPMOD). +# +# http::st The total size of the ICAP request sent to the ICAP +# server (ICAP headers + ICAP body), including chunking +# metadata (if any). +# +# icap::h ICAP request header(s). Similar to >h. +# +# icap::A %icap::to/%03icap::Hs %icap::\n - logfile data +# R\n - rotate file +# T\n - truncate file +# O\n - reopen file +# F\n - flush file +# r\n - set rotate count to +# b\n - 1 = buffer output, 0 = don't buffer output +# +# No responses is expected. +#Default: +# logfile_daemon /usr/lib/squid/log_file_daemon + +# TAG: stats_collection allow|deny acl acl... +# This options allows you to control which requests gets accounted +# in performance counters. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow logging for all transactions. + +# TAG: cache_store_log +# Logs the activities of the storage manager. Shows which +# objects are ejected from the cache, and which objects are +# saved and for how long. +# There are not really utilities to analyze this data, so you can safely +# disable it (the default). +# +# Store log uses modular logging outputs. See access_log for the list +# of modules supported. +# +# Example: +# cache_store_log stdio:/var/log/squid/store.log +# cache_store_log daemon:/var/log/squid/store.log +#Default: +# none + +# TAG: cache_swap_state +# Location for the cache "swap.state" file. This index file holds +# the metadata of objects saved on disk. It is used to rebuild +# the cache during startup. Normally this file resides in each +# 'cache_dir' directory, but you may specify an alternate +# pathname here. Note you must give a full filename, not just +# a directory. Since this is the index for the whole object +# list you CANNOT periodically rotate it! +# +# If %s can be used in the file name it will be replaced with a +# a representation of the cache_dir name where each / is replaced +# with '.'. This is needed to allow adding/removing cache_dir +# lines when cache_swap_log is being used. +# +# If have more than one 'cache_dir', and %s is not used in the name +# these swap logs will have names such as: +# +# cache_swap_log.00 +# cache_swap_log.01 +# cache_swap_log.02 +# +# The numbered extension (which is added automatically) +# corresponds to the order of the 'cache_dir' lines in this +# configuration file. If you change the order of the 'cache_dir' +# lines in this file, these index files will NOT correspond to +# the correct 'cache_dir' entry (unless you manually rename +# them). We recommend you do NOT use this option. It is +# better to keep these index files in each 'cache_dir' directory. +#Default: +# Store the journal inside its cache_dir + +# TAG: logfile_rotate +# Specifies the number of logfile rotations to make when you +# type 'squid -k rotate'. The default is 10, which will rotate +# with extensions 0 through 9. Setting logfile_rotate to 0 will +# disable the file name rotation, but the logfiles are still closed +# and re-opened. This will enable you to rename the logfiles +# yourself just before sending the rotate signal. +# +# Note, the 'squid -k rotate' command normally sends a USR1 +# signal to the running squid process. In certain situations +# (e.g. on Linux with Async I/O), USR1 is used for other +# purposes, so -k rotate uses another signal. It is best to get +# in the habit of using 'squid -k rotate' instead of 'kill -USR1 +# '. +# +# Note, from Squid-3.1 this option is only a default for cache.log, +# that log can be rotated separately by using debug_options. +# +# Note2, for Debian/Linux the default of logfile_rotate is +# zero, since it includes external logfile-rotation methods. +#Default: +# logfile_rotate 0 + +# TAG: mime_table +# Path to Squid's icon configuration file. +# +# You shouldn't need to change this, but the default file contains +# examples and formatting information if you do. +#Default: +# mime_table /usr/share/squid/mime.conf + +# TAG: log_mime_hdrs on|off +# The Cache can record both the request and the response MIME +# headers for each HTTP transaction. The headers are encoded +# safely and will appear as two bracketed fields at the end of +# the access log (for either the native or httpd-emulated log +# formats). To enable this logging set log_mime_hdrs to 'on'. +#Default: +# log_mime_hdrs off + +# TAG: pid_filename +# A filename to write the process-id to. To disable, enter "none". +#Default: +# pid_filename /var/run/squid.pid + +# TAG: client_netmask +# A netmask for client addresses in logfiles and cachemgr output. +# Change this to protect the privacy of your cache clients. +# A netmask of 255.255.255.0 will log all IP's in that range with +# the last digit set to '0'. +#Default: +# Log full client IP address + +# TAG: strip_query_terms +# By default, Squid strips query terms from requested URLs before +# logging. This protects your user's privacy and reduces log size. +# +# When investigating HIT/MISS or other caching behaviour you +# will need to disable this to see the full URL used by Squid. +#Default: +# strip_query_terms on + +# TAG: buffered_logs on|off +# Whether to write/send access_log records ASAP or accumulate them and +# then write/send them in larger chunks. Buffering may improve +# performance because it decreases the number of I/Os. However, +# buffering increases the delay before log records become available to +# the final recipient (e.g., a disk file or logging daemon) and, +# hence, increases the risk of log records loss. +# +# Note that even when buffered_logs are off, Squid may have to buffer +# records if it cannot write/send them immediately due to pending I/Os +# (e.g., the I/O writing the previous log record) or connectivity loss. +# +# Currently honored by 'daemon' and 'tcp' access_log modules only. +#Default: +# buffered_logs off + +# TAG: netdb_filename +# Where Squid stores it's netdb journal. +# When enabled this journal preserves netdb state between restarts. +# +# To disable, enter "none". +#Default: +# netdb_filename stdio:/var/log/squid/netdb.state + +# OPTIONS FOR TROUBLESHOOTING +# ----------------------------------------------------------------------------- + +# TAG: cache_log +# Squid administrative logging file. +# +# This is where general information about Squid behavior goes. You can +# increase the amount of data logged to this file and how often it is +# rotated with "debug_options" +#Default: +# cache_log /var/log/squid/cache.log + +# TAG: debug_options +# Logging options are set as section,level where each source file +# is assigned a unique section. Lower levels result in less +# output, Full debugging (level 9) can result in a very large +# log file, so be careful. +# +# The magic word "ALL" sets debugging levels for all sections. +# The default is to run with "ALL,1" to record important warnings. +# +# The rotate=N option can be used to keep more or less of these logs +# than would otherwise be kept by logfile_rotate. +# For most uses a single log should be enough to monitor current +# events affecting Squid. +#Default: +# Log all critical and important messages. + +# TAG: coredump_dir +# By default Squid leaves core files in the directory from where +# it was started. If you set 'coredump_dir' to a directory +# that exists, Squid will chdir() to that directory at startup +# and coredump files will be left there. +# +#Default: +# Use the directory from where Squid was started. +# + +# Leave coredumps in the first cache dir +coredump_dir /var/spool/squid + +# OPTIONS FOR FTP GATEWAYING +# ----------------------------------------------------------------------------- + +# TAG: ftp_user +# If you want the anonymous login password to be more informative +# (and enable the use of picky FTP servers), set this to something +# reasonable for your domain, like wwwuser@somewhere.net +# +# The reason why this is domainless by default is the +# request can be made on the behalf of a user in any domain, +# depending on how the cache is used. +# Some FTP server also validate the email address is valid +# (for example perl.com). +#Default: +# ftp_user Squid@ + +# TAG: ftp_passive +# If your firewall does not allow Squid to use passive +# connections, turn off this option. +# +# Use of ftp_epsv_all option requires this to be ON. +#Default: +# ftp_passive on + +# TAG: ftp_epsv_all +# FTP Protocol extensions permit the use of a special "EPSV ALL" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator, as the EPRT command will never be used and therefore, +# translation of the data portion of the segments will never be needed. +# +# When a client only expects to do two-way FTP transfers this may be +# useful. +# If squid finds that it must do a three-way FTP transfer after issuing +# an EPSV ALL command, the FTP session will fail. +# +# If you have any doubts about this option do not use it. +# Squid will nicely attempt all other connection methods. +# +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# ftp_epsv_all off + +# TAG: ftp_epsv +# FTP Protocol extensions permit the use of a special "EPSV" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator using EPSV, as the EPRT command will never be used +# and therefore, translation of the data portion of the segments +# will never be needed. +# +# EPSV is often required to interoperate with FTP servers on IPv6 +# networks. On the other hand, it may break some IPv4 servers. +# +# By default, EPSV may try EPSV with any FTP server. To fine tune +# that decision, you may restrict EPSV to certain clients or servers +# using ACLs: +# +# ftp_epsv allow|deny al1 acl2 ... +# +# WARNING: Disabling EPSV may cause problems with external NAT and IPv6. +# +# Only fast ACLs are supported. +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# none + +# TAG: ftp_eprt +# FTP Protocol extensions permit the use of a special "EPRT" command. +# +# This extension provides a protocol neutral alternative to the +# IPv4-only PORT command. When supported it enables active FTP data +# channels over IPv6 and efficient NAT handling. +# +# Turning this OFF will prevent EPRT being attempted and will skip +# straight to using PORT for IPv4 servers. +# +# Some devices are known to not handle this extension correctly and +# may result in crashes. Devices which suport EPRT enough to fail +# cleanly will result in Squid attempting PORT anyway. This directive +# should only be disabled when EPRT results in device failures. +# +# WARNING: Doing so will convert Squid back to the old behavior with all +# the related problems with external NAT devices/layers and IPv4-only FTP. +#Default: +# ftp_eprt on + +# TAG: ftp_sanitycheck +# For security and data integrity reasons Squid by default performs +# sanity checks of the addresses of FTP data connections ensure the +# data connection is to the requested server. If you need to allow +# FTP connections to servers using another IP address for the data +# connection turn this off. +#Default: +# ftp_sanitycheck on + +# TAG: ftp_telnet_protocol +# The FTP protocol is officially defined to use the telnet protocol +# as transport channel for the control connection. However, many +# implementations are broken and does not respect this aspect of +# the FTP protocol. +# +# If you have trouble accessing files with ASCII code 255 in the +# path or similar problems involving this ASCII code you can +# try setting this directive to off. If that helps, report to the +# operator of the FTP server in question that their FTP server +# is broken and does not follow the FTP standard. +#Default: +# ftp_telnet_protocol on + +# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS +# ----------------------------------------------------------------------------- + +# TAG: diskd_program +# Specify the location of the diskd executable. +# Note this is only useful if you have compiled in +# diskd as one of the store io modules. +#Default: +# diskd_program /usr/lib/squid/diskd + +# TAG: unlinkd_program +# Specify the location of the executable for file deletion process. +#Default: +# unlinkd_program /usr/lib/squid/unlinkd + +# TAG: pinger_program +# Specify the location of the executable for the pinger process. +#Default: +# pinger_program /usr/lib/squid/pinger + +# TAG: pinger_enable +# Control whether the pinger is active at run-time. +# Enables turning ICMP pinger on and off with a simple +# squid -k reconfigure. +#Default: +# pinger_enable on + +# OPTIONS FOR URL REWRITING +# ----------------------------------------------------------------------------- + +# TAG: url_rewrite_program +# Specify the location of the executable URL rewriter to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the rewriter will receive on line with the format +# +# [channel-ID ] URL [ extras] +# +# See url_rewrite_extras on how to send "extras" with optional values to +# the helper. +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK status=30N url="..." +# Redirect the URL to the one supplied in 'url='. +# 'status=' is optional and contains the status code to send +# the client in Squids HTTP response. It must be one of the +# HTTP redirect status codes: 301, 302, 303, 307, 308. +# When no status is given Squid will use 302. +# +# OK rewrite-url="..." +# Rewrite the URL to the one supplied in 'rewrite-url='. +# The new URL is fetched directly by Squid and returned to +# the client as the response to its request. +# +# OK +# When neither of url= and rewrite-url= are sent Squid does +# not change the URL. +# +# ERR +# Do not change the URL. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. The 'message=' key name is +# reserved for delivering a log message. +# +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# The TAG is treated as a regular annotation but persists across +# future requests on the client connection rather than just the +# current request. A helper may update the TAG during subsequent +# requests be returning a new kv-pair. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# WARNING: URL re-writing ability should be avoided whenever possible. +# Use the URL redirect form of response instead. +# +# Re-write creates a difference in the state held by the client +# and server. Possibly causing confusion when the server response +# contains snippets of its view state. Embeded URLs, response +# and content Location headers, etc. are not re-written by this +# interface. +# +# By default, a URL rewriter is not used. +#Default: +# none + +# TAG: url_rewrite_children +# The maximum number of redirector processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# URLs, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each redirector helper can handle in +# parallel. Defaults to 0 which indicates the redirector +# is a old-style single threaded redirector. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# url_rewrite_children 20 startup=0 idle=1 concurrency=0 + +# TAG: url_rewrite_host_header +# To preserve same-origin security policies in browsers and +# prevent Host: header forgery by redirectors Squid rewrites +# any Host: header in redirected requests. +# +# If you are running an accelerator this may not be a wanted +# effect of a redirector. This directive enables you disable +# Host: alteration in reverse-proxy traffic. +# +# WARNING: Entries are cached on the result of the URL rewriting +# process, so be careful if you have domain-virtual hosts. +# +# WARNING: Squid and other software verifies the URL and Host +# are matching, so be careful not to relay through other proxies +# or inspecting firewalls with this disabled. +#Default: +# url_rewrite_host_header on + +# TAG: url_rewrite_access +# If defined, this access list specifies which requests are +# sent to the redirector processes. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: url_rewrite_bypass +# When this is 'on', a request will not go through the +# redirector if all the helpers are busy. If this is 'off' +# and the redirector queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# redirectors. You should only enable this if the redirectors +# are not critical to your caching system. If you use +# redirectors for access control, and you enable this option, +# users may have access to pages they should not +# be allowed to request. +#Default: +# url_rewrite_bypass off + +# TAG: url_rewrite_extras +# Specifies a string to be append to request line format for the +# rewriter helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# url_rewrite_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# OPTIONS FOR STORE ID +# ----------------------------------------------------------------------------- + +# TAG: store_id_program +# Specify the location of the executable StoreID helper to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the helper will receive one line with the format +# +# [channel-ID ] URL [ extras] +# +# +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK store-id="..." +# Use the StoreID supplied in 'store-id='. +# +# ERR +# The default is to use HTTP request URL as the store ID. +# +# BH +# An internal error occured in the helper, preventing +# a result being identified. +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation for this +# kv-pair +# +# Helper programs should be prepared to receive and possibly ignore +# additional whitespace-separated tokens on each input line. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# NOTE: when using StoreID refresh_pattern will apply to the StoreID +# returned from the helper and not the URL. +# +# WARNING: Wrong StoreID value returned by a careless helper may result +# in the wrong cached response returned to the user. +# +# By default, a StoreID helper is not used. +#Default: +# none + +# TAG: store_id_extras +# Specifies a string to be append to request line format for the +# StoreId helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# TAG: store_id_children +# The maximum number of StoreID helper processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# requests, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each storeID helper can handle in +# parallel. Defaults to 0 which indicates the helper +# is a old-style single threaded program. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# store_id_children 20 startup=0 idle=1 concurrency=0 + +# TAG: store_id_access +# If defined, this access list specifies which requests are +# sent to the StoreID processes. By default all requests +# are sent. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: store_id_bypass +# When this is 'on', a request will not go through the +# helper if all helpers are busy. If this is 'off' +# and the helper queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# helpers. You should only enable this if the helperss +# are not critical to your caching system. If you use +# helpers for critical caching components, and you enable this +# option, users may not get objects from cache. +#Default: +# store_id_bypass on + +# OPTIONS FOR TUNING THE CACHE +# ----------------------------------------------------------------------------- + +# TAG: cache +# Requests denied by this directive will not be served from the cache +# and their responses will not be stored in the cache. This directive +# has no effect on other transactions and on already cached responses. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# This and the two other similar caching directives listed below are +# checked at different transaction processing stages, have different +# access to response information, affect different cache operations, +# and differ in slow ACLs support: +# +# * cache: Checked before Squid makes a hit/miss determination. +# No access to reply information! +# Denies both serving a hit and storing a miss. +# Supports both fast and slow ACLs. +# * send_hit: Checked after a hit was detected. +# Has access to reply (hit) information. +# Denies serving a hit only. +# Supports fast ACLs only. +# * store_miss: Checked before storing a cachable miss. +# Has access to reply (miss) information. +# Denies storing a miss only. +# Supports fast ACLs only. +# +# If you are not sure which of the three directives to use, apply the +# following decision logic: +# +# * If your ACL(s) are of slow type _and_ need response info, redesign. +# Squid does not support that particular combination at this time. +# Otherwise: +# * If your directive ACL(s) are of slow type, use "cache"; and/or +# * if your directive ACL(s) need no response info, use "cache". +# Otherwise: +# * If you do not want the response cached, use store_miss; and/or +# * if you do not want a hit on a cached response, use send_hit. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: send_hit +# Responses denied by this directive will not be served from the cache +# (but may still be cached, see store_miss). This directive has no +# effect on the responses it allows and on the cached objects. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. +# +# Unlike the "cache" directive, send_hit only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# For example: +# +# # apply custom Store ID mapping to some URLs +# acl MapMe dstdomain .c.example.com +# store_id_program ... +# store_id_access allow MapMe +# +# # but prevent caching of special responses +# # such as 302 redirects that cause StoreID loops +# acl Ordinary http_status 200-299 +# store_miss deny MapMe !Ordinary +# +# # and do not serve any previously stored special responses +# # from the cache (in case they were already cached before +# # the above store_miss rule was in effect). +# send_hit deny MapMe !Ordinary +#Default: +# By default, this directive is unused and has no effect. + +# TAG: store_miss +# Responses denied by this directive will not be cached (but may still +# be served from the cache, see send_hit). This directive has no +# effect on the responses it allows and on the already cached responses. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. See the +# send_hit directive for a usage example. +# +# Unlike the "cache" directive, store_miss only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: max_stale time-units +# This option puts an upper limit on how stale content Squid +# will serve from the cache if cache validation fails. +# Can be overriden by the refresh_pattern max-stale option. +#Default: +# max_stale 1 week + +# TAG: refresh_pattern +# usage: refresh_pattern [-i] regex min percent max [options] +# +# By default, regular expressions are CASE-SENSITIVE. To make +# them case-insensitive, use the -i option. +# +# 'Min' is the time (in minutes) an object without an explicit +# expiry time should be considered fresh. The recommended +# value is 0, any higher values may cause dynamic applications +# to be erroneously cached unless the application designer +# has taken the appropriate actions. +# +# 'Percent' is a percentage of the objects age (time since last +# modification age) an object without explicit expiry time +# will be considered fresh. +# +# 'Max' is an upper limit on how long objects without an explicit +# expiry time will be considered fresh. The value is also used +# to form Cache-Control: max-age header for a request sent from +# Squid to origin/parent. +# +# options: override-expire +# override-lastmod +# reload-into-ims +# ignore-reload +# ignore-no-store +# ignore-must-revalidate +# ignore-private +# ignore-auth +# max-stale=NN +# refresh-ims +# store-stale +# +# override-expire enforces min age even if the server +# sent an explicit expiry time (e.g., with the +# Expires: header or Cache-Control: max-age). Doing this +# VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# Note: override-expire does not enforce staleness - it only extends +# freshness / min. If the server returns a Expires time which +# is longer than your max time, Squid will still consider +# the object fresh for that period of time. +# +# override-lastmod enforces min age even on objects +# that were modified recently. +# +# reload-into-ims changes a client no-cache or ``reload'' +# request for a cached entry into a conditional request using +# If-Modified-Since and/or If-None-Match headers, provided the +# cached entry has a Last-Modified and/or a strong ETag header. +# Doing this VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# ignore-reload ignores a client no-cache or ``reload'' +# header. Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which +# it causes. +# +# ignore-no-store ignores any ``Cache-control: no-store'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-must-revalidate ignores any ``Cache-Control: must-revalidate`` +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-private ignores any ``Cache-control: private'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-auth caches responses to requests with authorization, +# as if the originserver had sent ``Cache-control: public'' +# in the response header. Doing this VIOLATES the HTTP standard. +# Enabling this feature could make you liable for problems which +# it causes. +# +# refresh-ims causes squid to contact the origin server +# when a client issues an If-Modified-Since request. This +# ensures that the client will receive an updated version +# if one is available. +# +# store-stale stores responses even if they don't have explicit +# freshness or a validator (i.e., Last-Modified or an ETag) +# present, or if they're already stale. By default, Squid will +# not cache such responses because they usually can't be +# reused. Note that such responses will be stale by default. +# +# max-stale=NN provide a maximum staleness factor. Squid won't +# serve objects more stale than this even if it failed to +# validate the object. Default: use the max_stale global limit. +# +# Basically a cached object is: +# +# FRESH if expire > now, else STALE +# STALE if age > max +# FRESH if lm-factor < percent, else STALE +# FRESH if age < min +# else STALE +# +# The refresh_pattern lines are checked in the order listed here. +# The first entry which matches is used. If none of the entries +# match the default will be used. +# +# Note, you must uncomment all the default lines if you want +# to change one. The default setting is only active if none is +# used. +# +# + +# +# Add any of your own refresh_pattern entries above these. +# +refresh_pattern ^ftp: 1440 20% 10080 +refresh_pattern ^gopher: 1440 0% 1440 +refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 +refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 +# example lin deb packages +#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600 +refresh_pattern . 0 20% 4320 + +# TAG: quick_abort_min (KB) +#Default: +# quick_abort_min 16 KB + +# TAG: quick_abort_max (KB) +#Default: +# quick_abort_max 16 KB + +# TAG: quick_abort_pct (percent) +# The cache by default continues downloading aborted requests +# which are almost completed (less than 16 KB remaining). This +# may be undesirable on slow (e.g. SLIP) links and/or very busy +# caches. Impatient users may tie up file descriptors and +# bandwidth by repeatedly requesting and immediately aborting +# downloads. +# +# When the user aborts a request, Squid will check the +# quick_abort values to the amount of data transferred until +# then. +# +# If the transfer has less than 'quick_abort_min' KB remaining, +# it will finish the retrieval. +# +# If the transfer has more than 'quick_abort_max' KB remaining, +# it will abort the retrieval. +# +# If more than 'quick_abort_pct' of the transfer has completed, +# it will finish the retrieval. +# +# If you do not want any retrieval to continue after the client +# has aborted, set both 'quick_abort_min' and 'quick_abort_max' +# to '0 KB'. +# +# If you want retrievals to always continue if they are being +# cached set 'quick_abort_min' to '-1 KB'. +#Default: +# quick_abort_pct 95 + +# TAG: read_ahead_gap buffer-size +# The amount of data the cache will buffer ahead of what has been +# sent to the client when retrieving an object from another server. +#Default: +# read_ahead_gap 16 KB + +# TAG: negative_ttl time-units +# Set the Default Time-to-Live (TTL) for failed requests. +# Certain types of failures (such as "connection refused" and +# "404 Not Found") are able to be negatively-cached for a short time. +# Modern web servers should provide Expires: header, however if they +# do not this can provide a minimum TTL. +# The default is not to cache errors with unknown expiry details. +# +# Note that this is different from negative caching of DNS lookups. +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +#Default: +# negative_ttl 0 seconds + +# TAG: positive_dns_ttl time-units +# Upper limit on how long Squid will cache positive DNS responses. +# Default is 6 hours (360 minutes). This directive must be set +# larger than negative_dns_ttl. +#Default: +# positive_dns_ttl 6 hours + +# TAG: negative_dns_ttl time-units +# Time-to-Live (TTL) for negative caching of failed DNS lookups. +# This also sets the lower cache limit on positive lookups. +# Minimum value is 1 second, and it is not recommendable to go +# much below 10 seconds. +#Default: +# negative_dns_ttl 1 minutes + +# TAG: range_offset_limit size [acl acl...] +# usage: (size) [units] [[!]aclname] +# +# Sets an upper limit on how far (number of bytes) into the file +# a Range request may be to cause Squid to prefetch the whole file. +# If beyond this limit, Squid forwards the Range request as it is and +# the result is NOT cached. +# +# This is to stop a far ahead range request (lets say start at 17MB) +# from making Squid fetch the whole object up to that point before +# sending anything to the client. +# +# Multiple range_offset_limit lines may be specified, and they will +# be searched from top to bottom on each request until a match is found. +# The first match found will be used. If no line matches a request, the +# default limit of 0 bytes will be used. +# +# 'size' is the limit specified as a number of units. +# +# 'units' specifies whether to use bytes, KB, MB, etc. +# If no units are specified bytes are assumed. +# +# A size of 0 causes Squid to never fetch more than the +# client requested. (default) +# +# A size of 'none' causes Squid to always fetch the object from the +# beginning so it may cache the result. (2.0 style) +# +# 'aclname' is the name of a defined ACL. +# +# NP: Using 'none' as the byte value here will override any quick_abort settings +# that may otherwise apply to the range request. The range request will +# be fully fetched from start to finish regardless of the client +# actions. This affects bandwidth usage. +#Default: +# none + +# TAG: minimum_expiry_time (seconds) +# The minimum caching time according to (Expires - Date) +# headers Squid honors if the object can't be revalidated. +# The default is 60 seconds. +# +# In reverse proxy environments it might be desirable to honor +# shorter object lifetimes. It is most likely better to make +# your server return a meaningful Last-Modified header however. +# +# In ESI environments where page fragments often have short +# lifetimes, this will often be best set to 0. +#Default: +# minimum_expiry_time 60 seconds + +# TAG: store_avg_object_size (bytes) +# Average object size, used to estimate number of objects your +# cache can hold. The default is 13 KB. +# +# This is used to pre-seed the cache index memory allocation to +# reduce expensive reallocate operations while handling clients +# traffic. Too-large values may result in memory allocation during +# peak traffic, too-small values will result in wasted memory. +# +# Check the cache manager 'info' report metrics for the real +# object sizes seen by your Squid before tuning this. +#Default: +# store_avg_object_size 13 KB + +# TAG: store_objects_per_bucket +# Target number of objects per bucket in the store hash table. +# Lowering this value increases the total number of buckets and +# also the storage maintenance rate. The default is 20. +#Default: +# store_objects_per_bucket 20 + +# HTTP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: request_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a request. +# Request headers are usually relatively small (about 512 bytes). +# Placing a limit on the request header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# request_header_max_size 64 KB + +# TAG: reply_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a reply. +# Reply headers are usually relatively small (about 512 bytes). +# Placing a limit on the reply header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# reply_header_max_size 64 KB + +# TAG: request_body_max_size (bytes) +# This specifies the maximum size for an HTTP request body. +# In other words, the maximum size of a PUT/POST request. +# A user who attempts to send a request with a body larger +# than this limit receives an "Invalid Request" error message. +# If you set this parameter to a zero (the default), there will +# be no limit imposed. +# +# See also client_request_buffer_max_size for an alternative +# limitation on client uploads which can be configured. +#Default: +# No limit. + +# TAG: client_request_buffer_max_size (bytes) +# This specifies the maximum buffer size of a client request. +# It prevents squid eating too much memory when somebody uploads +# a large file. +#Default: +# client_request_buffer_max_size 512 KB + +# TAG: broken_posts +# A list of ACL elements which, if matched, causes Squid to send +# an extra CRLF pair after the body of a PUT/POST request. +# +# Some HTTP servers has broken implementations of PUT/POST, +# and rely on an extra CRLF pair sent by some WWW clients. +# +# Quote from RFC2616 section 4.1 on this matter: +# +# Note: certain buggy HTTP/1.0 client implementations generate an +# extra CRLF's after a POST request. To restate what is explicitly +# forbidden by the BNF, an HTTP/1.1 client must not preface or follow +# a request with an extra CRLF. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# acl buggy_server url_regex ^http://.... +# broken_posts allow buggy_server +#Default: +# Obey RFC 2616. + +# TAG: adaptation_uses_indirect_client on|off +# Controls whether the indirect client IP address (instead of the direct +# client IP address) is passed to adaptation services. +# +# See also: follow_x_forwarded_for adaptation_send_client_ip +#Default: +# adaptation_uses_indirect_client on + +# TAG: via on|off +# If set (default), Squid will include a Via header in requests and +# replies as required by RFC2616. +#Default: +# via on + +# TAG: ie_refresh on|off +# Microsoft Internet Explorer up until version 5.5 Service +# Pack 1 has an issue with transparent proxies, wherein it +# is impossible to force a refresh. Turning this on provides +# a partial fix to the problem, by causing all IMS-REFRESH +# requests from older IE versions to check the origin server +# for fresh content. This reduces hit ratio by some amount +# (~10% in my experience), but allows users to actually get +# fresh content when they want it. Note because Squid +# cannot tell if the user is using 5.5 or 5.5SP1, the behavior +# of 5.5 is unchanged from old versions of Squid (i.e. a +# forced refresh is impossible). Newer versions of IE will, +# hopefully, continue to have the new behavior and will be +# handled based on that assumption. This option defaults to +# the old Squid behavior, which is better for hit ratios but +# worse for clients using IE, if they need to be able to +# force fresh content. +#Default: +# ie_refresh off + +# TAG: vary_ignore_expire on|off +# Many HTTP servers supporting Vary gives such objects +# immediate expiry time with no cache-control header +# when requested by a HTTP/1.0 client. This option +# enables Squid to ignore such expiry times until +# HTTP/1.1 is fully implemented. +# +# WARNING: If turned on this may eventually cause some +# varying objects not intended for caching to get cached. +#Default: +# vary_ignore_expire off + +# TAG: request_entities +# Squid defaults to deny GET and HEAD requests with request entities, +# as the meaning of such requests are undefined in the HTTP standard +# even if not explicitly forbidden. +# +# Set this directive to on if you have clients which insists +# on sending request entities in GET or HEAD requests. But be warned +# that there is server software (both proxies and web servers) which +# can fail to properly process this kind of request which may make you +# vulnerable to cache pollution attacks if enabled. +#Default: +# request_entities off + +# TAG: request_header_access +# Usage: request_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option replaces the old 'anonymize_headers' and the +# older 'http_anonymizer' option with something that is much +# more configurable. A list of ACLs for each header name allows +# removal of specific header fields under specific conditions. +# +# This option only applies to outgoing HTTP request headers (i.e., +# headers sent by Squid to the next HTTP hop such as a cache peer +# or an origin server). The option has no effect during cache hit +# detection. The equivalent adaptation vectoring point in ICAP +# terminology is post-cache REQMOD. +# +# The option is applied to individual outgoing request header +# fields. For each request header field F, Squid uses the first +# qualifying sets of request_header_access rules: +# +# 1. Rules with header_name equal to F's name. +# 2. Rules with header_name 'Other', provided F's name is not +# on the hard-coded list of commonly used HTTP header names. +# 3. Rules with header_name 'All'. +# +# Within that qualifying rule set, rule ACLs are checked as usual. +# If ACLs of an "allow" rule match, the header field is allowed to +# go through as is. If ACLs of a "deny" rule match, the header is +# removed and request_header_replace is then checked to identify +# if the removed header has a replacement. If no rules within the +# set have matching ACLs, the header field is left as is. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# request_header_access From deny all +# request_header_access Referer deny all +# request_header_access User-Agent deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# request_header_access Authorization allow all +# request_header_access Proxy-Authorization allow all +# request_header_access Cache-Control allow all +# request_header_access Content-Length allow all +# request_header_access Content-Type allow all +# request_header_access Date allow all +# request_header_access Host allow all +# request_header_access If-Modified-Since allow all +# request_header_access Pragma allow all +# request_header_access Accept allow all +# request_header_access Accept-Charset allow all +# request_header_access Accept-Encoding allow all +# request_header_access Accept-Language allow all +# request_header_access Connection allow all +# request_header_access All deny all +# +# HTTP reply headers are controlled with the reply_header_access directive. +# +# By default, all headers are allowed (no anonymizing is performed). +#Default: +# No limits. + +# TAG: reply_header_access +# Usage: reply_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option only applies to reply headers, i.e., from the +# server to the client. +# +# This is the same as request_header_access, but in the other +# direction. Please see request_header_access for detailed +# documentation. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# reply_header_access Server deny all +# reply_header_access WWW-Authenticate deny all +# reply_header_access Link deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# reply_header_access Allow allow all +# reply_header_access WWW-Authenticate allow all +# reply_header_access Proxy-Authenticate allow all +# reply_header_access Cache-Control allow all +# reply_header_access Content-Encoding allow all +# reply_header_access Content-Length allow all +# reply_header_access Content-Type allow all +# reply_header_access Date allow all +# reply_header_access Expires allow all +# reply_header_access Last-Modified allow all +# reply_header_access Location allow all +# reply_header_access Pragma allow all +# reply_header_access Content-Language allow all +# reply_header_access Retry-After allow all +# reply_header_access Title allow all +# reply_header_access Content-Disposition allow all +# reply_header_access Connection allow all +# reply_header_access All deny all +# +# HTTP request headers are controlled with the request_header_access directive. +# +# By default, all headers are allowed (no anonymizing is +# performed). +#Default: +# No limits. + +# TAG: request_header_replace +# Usage: request_header_replace header_name message +# Example: request_header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit) +# +# This option allows you to change the contents of headers +# denied with request_header_access above, by replacing them +# with some fixed string. +# +# This only applies to request headers, not reply headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: reply_header_replace +# Usage: reply_header_replace header_name message +# Example: reply_header_replace Server Foo/1.0 +# +# This option allows you to change the contents of headers +# denied with reply_header_access above, by replacing them +# with some fixed string. +# +# This only applies to reply headers, not request headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: request_header_add +# Usage: request_header_add field-name field-value acl1 [acl2] ... +# Example: request_header_add X-Client-CA "CA=%ssl::>cert_issuer" all +# +# This option adds header fields to outgoing HTTP requests (i.e., +# request headers sent by Squid to the next HTTP hop such as a +# cache peer or an origin server). The option has no effect during +# cache hit detection. The equivalent adaptation vectoring point +# in ICAP terminology is post-cache REQMOD. +# +# Field-name is a token specifying an HTTP header name. If a +# standard HTTP header name is used, Squid does not check whether +# the new header conflicts with any existing headers or violates +# HTTP rules. If the request to be modified already contains a +# field with the same name, the old field is preserved but the +# header field values are not merged. +# +# Field-value is either a token or a quoted string. If quoted +# string format is used, then the surrounding quotes are removed +# while escape sequences and %macros are processed. +# +# In theory, all of the logformat codes can be used as %macros. +# However, unlike logging (which happens at the very end of +# transaction lifetime), the transaction may not yet have enough +# information to expand a macro when the new header value is needed. +# And some information may already be available to Squid but not yet +# committed where the macro expansion code can access it (report +# such instances!). The macro will be expanded into a single dash +# ('-') in such cases. Not all macros have been tested. +# +# One or more Squid ACLs may be specified to restrict header +# injection to matching requests. As always in squid.conf, all +# ACLs in an option ACL list must be satisfied for the insertion +# to happen. The request_header_add option supports fast ACLs +# only. +#Default: +# none + +# TAG: note +# This option used to log custom information about the master +# transaction. For example, an admin may configure Squid to log +# which "user group" the transaction belongs to, where "user group" +# will be determined based on a set of ACLs and not [just] +# authentication information. +# Values of key/value pairs can be logged using %{key}note macros: +# +# note key value acl ... +# logformat myFormat ... %{key}note ... +#Default: +# none + +# TAG: relaxed_header_parser on|off|warn +# In the default "on" setting Squid accepts certain forms +# of non-compliant HTTP messages where it is unambiguous +# what the sending application intended even if the message +# is not correctly formatted. The messages is then normalized +# to the correct form when forwarded by Squid. +# +# If set to "warn" then a warning will be emitted in cache.log +# each time such HTTP error is encountered. +# +# If set to "off" then such HTTP errors will cause the request +# or response to be rejected. +#Default: +# relaxed_header_parser on + +# TAG: collapsed_forwarding (on|off) +# When enabled, instead of forwarding each concurrent request for +# the same URL, Squid just sends the first of them. The other, so +# called "collapsed" requests, wait for the response to the first +# request and, if it happens to be cachable, use that response. +# Here, "concurrent requests" means "received after the first +# request headers were parsed and before the corresponding response +# headers were parsed". +# +# This feature is disabled by default: enabling collapsed +# forwarding needlessly delays forwarding requests that look +# cachable (when they are collapsed) but then need to be forwarded +# individually anyway because they end up being for uncachable +# content. However, in some cases, such as acceleration of highly +# cachable content with periodic or grouped expiration times, the +# gains from collapsing [large volumes of simultaneous refresh +# requests] outweigh losses from such delays. +# +# Squid collapses two kinds of requests: regular client requests +# received on one of the listening ports and internal "cache +# revalidation" requests which are triggered by those regular +# requests hitting a stale cached object. Revalidation collapsing +# is currently disabled for Squid instances containing SMP-aware +# disk or memory caches and for Vary-controlled cached objects. +#Default: +# collapsed_forwarding off + +# TIMEOUTS +# ----------------------------------------------------------------------------- + +# TAG: forward_timeout time-units +# This parameter specifies how long Squid should at most attempt in +# finding a forwarding path for the request before giving up. +#Default: +# forward_timeout 4 minutes + +# TAG: connect_timeout time-units +# This parameter specifies how long to wait for the TCP connect to +# the requested server or peer to complete before Squid should +# attempt to find another path where to forward the request. +#Default: +# connect_timeout 1 minute + +# TAG: peer_connect_timeout time-units +# This parameter specifies how long to wait for a pending TCP +# connection to a peer cache. The default is 30 seconds. You +# may also set different timeout values for individual neighbors +# with the 'connect-timeout' option on a 'cache_peer' line. +#Default: +# peer_connect_timeout 30 seconds + +# TAG: read_timeout time-units +# Applied on peer server connections. +# +# After each successful read(), the timeout will be extended by this +# amount. If no data is read again after this amount of time, +# the request is aborted and logged with ERR_READ_TIMEOUT. +# +# The default is 15 minutes. +#Default: +# read_timeout 15 minutes + +# TAG: write_timeout time-units +# This timeout is tracked for all connections that have data +# available for writing and are waiting for the socket to become +# ready. After each successful write, the timeout is extended by +# the configured amount. If Squid has data to write but the +# connection is not ready for the configured duration, the +# transaction associated with the connection is terminated. The +# default is 15 minutes. +#Default: +# write_timeout 15 minutes + +# TAG: request_timeout +# How long to wait for complete HTTP request headers after initial +# connection establishment. +#Default: +# request_timeout 5 minutes + +# TAG: client_idle_pconn_timeout +# How long to wait for the next HTTP request on a persistent +# client connection after the previous request completes. +#Default: +# client_idle_pconn_timeout 2 minutes + +# TAG: ftp_client_idle_timeout +# How long to wait for an FTP request on a connection to Squid ftp_port. +# Many FTP clients do not deal with idle connection closures well, +# necessitating a longer default timeout than client_idle_pconn_timeout +# used for incoming HTTP requests. +#Default: +# ftp_client_idle_timeout 30 minutes + +# TAG: client_lifetime time-units +# The maximum amount of time a client (browser) is allowed to +# remain connected to the cache process. This protects the Cache +# from having a lot of sockets (and hence file descriptors) tied up +# in a CLOSE_WAIT state from remote clients that go away without +# properly shutting down (either because of a network failure or +# because of a poor client implementation). The default is one +# day, 1440 minutes. +# +# NOTE: The default value is intended to be much larger than any +# client would ever need to be connected to your cache. You +# should probably change client_lifetime only as a last resort. +# If you seem to have many client connections tying up +# filedescriptors, we recommend first tuning the read_timeout, +# request_timeout, persistent_request_timeout and quick_abort values. +#Default: +# client_lifetime 1 day + +# TAG: half_closed_clients +# Some clients may shutdown the sending side of their TCP +# connections, while leaving their receiving sides open. Sometimes, +# Squid can not tell the difference between a half-closed and a +# fully-closed TCP connection. +# +# By default, Squid will immediately close client connections when +# read(2) returns "no more data to read." +# +# Change this option to 'on' and Squid will keep open connections +# until a read(2) or write(2) on the socket returns an error. +# This may show some benefits for reverse proxies. But if not +# it is recommended to leave OFF. +#Default: +# half_closed_clients off + +# TAG: server_idle_pconn_timeout +# Timeout for idle persistent connections to servers and other +# proxies. +#Default: +# server_idle_pconn_timeout 1 minute + +# TAG: ident_timeout +# Maximum time to wait for IDENT lookups to complete. +# +# If this is too high, and you enabled IDENT lookups from untrusted +# users, you might be susceptible to denial-of-service by having +# many ident requests going at once. +#Default: +# ident_timeout 10 seconds + +# TAG: shutdown_lifetime time-units +# When SIGTERM or SIGHUP is received, the cache is put into +# "shutdown pending" mode until all active sockets are closed. +# This value is the lifetime to set for all open descriptors +# during shutdown mode. Any active clients after this many +# seconds will receive a 'timeout' message. +#Default: +# shutdown_lifetime 30 seconds + +# ADMINISTRATIVE PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: cache_mgr +# Email-address of local cache manager who will receive +# mail if the cache dies. The default is "webmaster". +#Default: +# cache_mgr webmaster + +# TAG: mail_from +# From: email-address for mail sent when the cache dies. +# The default is to use 'squid@unique_hostname'. +# +# See also: unique_hostname directive. +#Default: +# none + +# TAG: mail_program +# Email program used to send mail if the cache dies. +# The default is "mail". The specified program must comply +# with the standard Unix mail syntax: +# mail-program recipient < mailfile +# +# Optional command line options can be specified. +#Default: +# mail_program mail + +# TAG: cache_effective_user +# If you start Squid as root, it will change its effective/real +# UID/GID to the user specified below. The default is to change +# to UID of proxy. +# see also; cache_effective_group +#Default: +# cache_effective_user proxy + +# TAG: cache_effective_group +# Squid sets the GID to the effective user's default group ID +# (taken from the password file) and supplementary group list +# from the groups membership. +# +# If you want Squid to run with a specific GID regardless of +# the group memberships of the effective user then set this +# to the group (or GID) you want Squid to run as. When set +# all other group privileges of the effective user are ignored +# and only this GID is effective. If Squid is not started as +# root the user starting Squid MUST be member of the specified +# group. +# +# This option is not recommended by the Squid Team. +# Our preference is for administrators to configure a secure +# user account for squid with UID/GID matching system policies. +#Default: +# Use system group memberships of the cache_effective_user account + +# TAG: httpd_suppress_version_string on|off +# Suppress Squid version string info in HTTP headers and HTML error pages. +#Default: +# httpd_suppress_version_string off + +# TAG: visible_hostname +# If you want to present a special hostname in error messages, etc, +# define this. Otherwise, the return value of gethostname() +# will be used. If you have multiple caches in a cluster and +# get errors about IP-forwarding you must set them to have individual +# names with this setting. +#Default: +# Automatically detect the system host name + +# TAG: unique_hostname +# If you want to have multiple machines with the same +# 'visible_hostname' you must give each machine a different +# 'unique_hostname' so forwarding loops can be detected. +#Default: +# Copy the value from visible_hostname + +# TAG: hostname_aliases +# A list of other DNS names your cache has. +#Default: +# none + +# TAG: umask +# Minimum umask which should be enforced while the proxy +# is running, in addition to the umask set at startup. +# +# For a traditional octal representation of umasks, start +# your value with 0. +#Default: +# umask 027 + +# OPTIONS FOR THE CACHE REGISTRATION SERVICE +# ----------------------------------------------------------------------------- +# +# This section contains parameters for the (optional) cache +# announcement service. This service is provided to help +# cache administrators locate one another in order to join or +# create cache hierarchies. +# +# An 'announcement' message is sent (via UDP) to the registration +# service by Squid. By default, the announcement message is NOT +# SENT unless you enable it with 'announce_period' below. +# +# The announcement message includes your hostname, plus the +# following information from this configuration file: +# +# http_port +# icp_port +# cache_mgr +# +# All current information is processed regularly and made +# available on the Web at http://www.ircache.net/Cache/Tracker/. + +# TAG: announce_period +# This is how frequently to send cache announcements. +# +# To enable announcing your cache, just set an announce period. +# +# Example: +# announce_period 1 day +#Default: +# Announcement messages disabled. + +# TAG: announce_host +# Set the hostname where announce registration messages will be sent. +# +# See also announce_port and announce_file +#Default: +# announce_host tracker.ircache.net + +# TAG: announce_file +# The contents of this file will be included in the announce +# registration messages. +#Default: +# none + +# TAG: announce_port +# Set the port where announce registration messages will be sent. +# +# See also announce_host and announce_file +#Default: +# announce_port 3131 + +# HTTPD-ACCELERATOR OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: httpd_accel_surrogate_id +# Surrogates (http://www.esi.org/architecture_spec_1.0.html) +# need an identification token to allow control targeting. Because +# a farm of surrogates may all perform the same tasks, they may share +# an identification token. +#Default: +# visible_hostname is used if no specific ID is set. + +# TAG: http_accel_surrogate_remote on|off +# Remote surrogates (such as those in a CDN) honour the header +# "Surrogate-Control: no-store-remote". +# +# Set this to on to have squid behave as a remote surrogate. +#Default: +# http_accel_surrogate_remote off + +# TAG: esi_parser libxml2|expat|custom +# ESI markup is not strictly XML compatible. The custom ESI parser +# will give higher performance, but cannot handle non ASCII character +# encodings. +#Default: +# esi_parser custom + +# DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: delay_pools +# This represents the number of delay pools to be used. For example, +# if you have one class 2 delay pool and one class 3 delays pool, you +# have a total of 2 delay pools. +# +# See also delay_parameters, delay_class, delay_access for pool +# configuration details. +#Default: +# delay_pools 0 + +# TAG: delay_class +# This defines the class of each delay pool. There must be exactly one +# delay_class line for each delay pool. For example, to define two +# delay pools, one of class 2 and one of class 3, the settings above +# and here would be: +# +# Example: +# delay_pools 4 # 4 delay pools +# delay_class 1 2 # pool 1 is a class 2 pool +# delay_class 2 3 # pool 2 is a class 3 pool +# delay_class 3 4 # pool 3 is a class 4 pool +# delay_class 4 5 # pool 4 is a class 5 pool +# +# The delay pool classes are: +# +# class 1 Everything is limited by a single aggregate +# bucket. +# +# class 2 Everything is limited by a single aggregate +# bucket as well as an "individual" bucket chosen +# from bits 25 through 32 of the IPv4 address. +# +# class 3 Everything is limited by a single aggregate +# bucket as well as a "network" bucket chosen +# from bits 17 through 24 of the IP address and a +# "individual" bucket chosen from bits 17 through +# 32 of the IPv4 address. +# +# class 4 Everything in a class 3 delay pool, with an +# additional limit on a per user basis. This +# only takes effect if the username is established +# in advance - by forcing authentication in your +# http_access rules. +# +# class 5 Requests are grouped according their tag (see +# external_acl's tag= reply). +# +# +# Each pool also requires a delay_parameters directive to configure the pool size +# and speed limits used whenever the pool is applied to a request. Along with +# a set of delay_access directives to determine when it is used. +# +# NOTE: If an IP address is a.b.c.d +# -> bits 25 through 32 are "d" +# -> bits 17 through 24 are "c" +# -> bits 17 through 32 are "c * 256 + d" +# +# NOTE-2: Due to the use of bitmasks in class 2,3,4 pools they only apply to +# IPv4 traffic. Class 1 and 5 pools may be used with IPv6 traffic. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also delay_parameters and delay_access. +#Default: +# none + +# TAG: delay_access +# This is used to determine which delay pool a request falls into. +# +# delay_access is sorted per pool and the matching starts with pool 1, +# then pool 2, ..., and finally pool N. The first delay pool where the +# request is allowed is selected for the request. If it does not allow +# the request to any pool then the request is not delayed (default). +# +# For example, if you want some_big_clients in delay +# pool 1 and lotsa_little_clients in delay pool 2: +# +# delay_access 1 allow some_big_clients +# delay_access 1 deny all +# delay_access 2 allow lotsa_little_clients +# delay_access 2 deny all +# delay_access 3 allow authenticated_clients +# +# See also delay_parameters and delay_class. +# +#Default: +# Deny using the pool, unless allow rules exist in squid.conf for the pool. + +# TAG: delay_parameters +# This defines the parameters for a delay pool. Each delay pool has +# a number of "buckets" associated with it, as explained in the +# description of delay_class. +# +# For a class 1 delay pool, the syntax is: +# delay_class pool 1 +# delay_parameters pool aggregate +# +# For a class 2 delay pool: +# delay_class pool 2 +# delay_parameters pool aggregate individual +# +# For a class 3 delay pool: +# delay_class pool 3 +# delay_parameters pool aggregate network individual +# +# For a class 4 delay pool: +# delay_class pool 4 +# delay_parameters pool aggregate network individual user +# +# For a class 5 delay pool: +# delay_class pool 5 +# delay_parameters pool tagrate +# +# The option variables are: +# +# pool a pool number - ie, a number between 1 and the +# number specified in delay_pools as used in +# delay_class lines. +# +# aggregate the speed limit parameters for the aggregate bucket +# (class 1, 2, 3). +# +# individual the speed limit parameters for the individual +# buckets (class 2, 3). +# +# network the speed limit parameters for the network buckets +# (class 3). +# +# user the speed limit parameters for the user buckets +# (class 4). +# +# tagrate the speed limit parameters for the tag buckets +# (class 5). +# +# A pair of delay parameters is written restore/maximum, where restore is +# the number of bytes (not bits - modem and network speeds are usually +# quoted in bits) per second placed into the bucket, and maximum is the +# maximum number of bytes which can be in the bucket at any time. +# +# There must be one delay_parameters line for each delay pool. +# +# +# For example, if delay pool number 1 is a class 2 delay pool as in the +# above example, and is being used to strictly limit each host to 64Kbit/sec +# (plus overheads), with no overall limit, the line is: +# +# delay_parameters 1 none 8000/8000 +# +# Note that 8 x 8K Byte/sec -> 64K bit/sec. +# +# Note that the word 'none' is used to represent no limit. +# +# +# And, if delay pool number 2 is a class 3 delay pool as in the above +# example, and you want to limit it to a total of 256Kbit/sec (strict limit) +# with each 8-bit network permitted 64Kbit/sec (strict limit) and each +# individual host permitted 4800bit/sec with a bucket maximum size of 64Kbits +# to permit a decent web page to be downloaded at a decent speed +# (if the network is not being limited due to overuse) but slow down +# large downloads more significantly: +# +# delay_parameters 2 32000/32000 8000/8000 600/8000 +# +# Note that 8 x 32K Byte/sec -> 256K bit/sec. +# 8 x 8K Byte/sec -> 64K bit/sec. +# 8 x 600 Byte/sec -> 4800 bit/sec. +# +# +# Finally, for a class 4 delay pool as in the example - each user will +# be limited to 128Kbits/sec no matter how many workstations they are logged into.: +# +# delay_parameters 4 32000/32000 8000/8000 600/64000 16000/16000 +# +# +# See also delay_class and delay_access. +# +#Default: +# none + +# TAG: delay_initial_bucket_level (percent, 0-100) +# The initial bucket percentage is used to determine how much is put +# in each bucket when squid starts, is reconfigured, or first notices +# a host accessing it (in class 2 and class 3, individual hosts and +# networks only have buckets associated with them once they have been +# "seen" by squid). +#Default: +# delay_initial_bucket_level 50 + +# CLIENT DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: client_delay_pools +# This option specifies the number of client delay pools used. It must +# preceed other client_delay_* options. +# +# Example: +# client_delay_pools 2 +# +# See also client_delay_parameters and client_delay_access. +#Default: +# client_delay_pools 0 + +# TAG: client_delay_initial_bucket_level (percent, 0-no_limit) +# This option determines the initial bucket size as a percentage of +# max_bucket_size from client_delay_parameters. Buckets are created +# at the time of the "first" connection from the matching IP. Idle +# buckets are periodically deleted up. +# +# You can specify more than 100 percent but note that such "oversized" +# buckets are not refilled until their size goes down to max_bucket_size +# from client_delay_parameters. +# +# Example: +# client_delay_initial_bucket_level 50 +#Default: +# client_delay_initial_bucket_level 50 + +# TAG: client_delay_parameters +# +# This option configures client-side bandwidth limits using the +# following format: +# +# client_delay_parameters pool speed_limit max_bucket_size +# +# pool is an integer ID used for client_delay_access matching. +# +# speed_limit is bytes added to the bucket per second. +# +# max_bucket_size is the maximum size of a bucket, enforced after any +# speed_limit additions. +# +# Please see the delay_parameters option for more information and +# examples. +# +# Example: +# client_delay_parameters 1 1024 2048 +# client_delay_parameters 2 51200 16384 +# +# See also client_delay_access. +# +#Default: +# none + +# TAG: client_delay_access +# This option determines the client-side delay pool for the +# request: +# +# client_delay_access pool_ID allow|deny acl_name +# +# All client_delay_access options are checked in their pool ID +# order, starting with pool 1. The first checked pool with allowed +# request is selected for the request. If no ACL matches or there +# are no client_delay_access options, the request bandwidth is not +# limited. +# +# The ACL-selected pool is then used to find the +# client_delay_parameters for the request. Client-side pools are +# not used to aggregate clients. Clients are always aggregated +# based on their source IP addresses (one bucket per source IP). +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Additionally, only the client TCP connection details are available. +# ACLs testing HTTP properties will not work. +# +# Please see delay_access for more examples. +# +# Example: +# client_delay_access 1 allow low_rate_network +# client_delay_access 2 allow vips_network +# +# +# See also client_delay_parameters and client_delay_pools. +#Default: +# Deny use of the pool, unless allow rules exist in squid.conf for the pool. + +# WCCPv1 AND WCCPv2 CONFIGURATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: wccp_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCP disabled. + +# TAG: wccp2_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCPv2 disabled. + +# TAG: wccp_version +# This directive is only relevant if you need to set up WCCP(v1) +# to some very old and end-of-life Cisco routers. In all other +# setups it must be left unset or at the default setting. +# It defines an internal version in the WCCP(v1) protocol, +# with version 4 being the officially documented protocol. +# +# According to some users, Cisco IOS 11.2 and earlier only +# support WCCP version 3. If you're using that or an earlier +# version of IOS, you may need to change this value to 3, otherwise +# do not specify this parameter. +#Default: +# wccp_version 4 + +# TAG: wccp2_rebuild_wait +# If this is enabled Squid will wait for the cache dir rebuild to finish +# before sending the first wccp2 HereIAm packet +#Default: +# wccp2_rebuild_wait on + +# TAG: wccp2_forwarding_method +# WCCP2 allows the setting of forwarding methods between the +# router/switch and the cache. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment method. +#Default: +# wccp2_forwarding_method gre + +# TAG: wccp2_return_method +# WCCP2 allows the setting of return methods between the +# router/switch and the cache for packets that the cache +# decides not to handle. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment. +# +# If the "ip wccp redirect exclude in" command has been +# enabled on the cache interface, then it is still safe for +# the proxy server to use a l2 redirect method even if this +# option is set to GRE. +#Default: +# wccp2_return_method gre + +# TAG: wccp2_assignment_method +# WCCP2 allows the setting of methods to assign the WCCP hash +# Valid values are as follows: +# +# hash - Hash assignment +# mask - Mask assignment +# +# As a general rule, cisco routers support the hash assignment method +# and cisco switches support the mask assignment method. +#Default: +# wccp2_assignment_method hash + +# TAG: wccp2_service +# WCCP2 allows for multiple traffic services. There are two +# types: "standard" and "dynamic". The standard type defines +# one service id - http (id 0). The dynamic service ids can be from +# 51 to 255 inclusive. In order to use a dynamic service id +# one must define the type of traffic to be redirected; this is done +# using the wccp2_service_info option. +# +# The "standard" type does not require a wccp2_service_info option, +# just specifying the service id will suffice. +# +# MD5 service authentication can be enabled by adding +# "password=" to the end of this service declaration. +# +# Examples: +# +# wccp2_service standard 0 # for the 'web-cache' standard service +# wccp2_service dynamic 80 # a dynamic service type which will be +# # fleshed out with subsequent options. +# wccp2_service standard 0 password=foo +#Default: +# Use the 'web-cache' standard service. + +# TAG: wccp2_service_info +# Dynamic WCCPv2 services require further information to define the +# traffic you wish to have diverted. +# +# The format is: +# +# wccp2_service_info protocol= flags=,.. +# priority= ports=,.. +# +# The relevant WCCPv2 flags: +# + src_ip_hash, dst_ip_hash +# + source_port_hash, dst_port_hash +# + src_ip_alt_hash, dst_ip_alt_hash +# + src_port_alt_hash, dst_port_alt_hash +# + ports_source +# +# The port list can be one to eight entries. +# +# Example: +# +# wccp2_service_info 80 protocol=tcp flags=src_ip_hash,ports_source +# priority=240 ports=80 +# +# Note: the service id must have been defined by a previous +# 'wccp2_service dynamic ' entry. +#Default: +# none + +# TAG: wccp2_weight +# Each cache server gets assigned a set of the destination +# hash proportional to their weight. +#Default: +# wccp2_weight 10000 + +# TAG: wccp_address +# Use this option if you require WCCPv2 to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# TAG: wccp2_address +# Use this option if you require WCCP to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# PERSISTENT CONNECTION HANDLING +# ----------------------------------------------------------------------------- +# +# Also see "pconn_timeout" in the TIMEOUTS section + +# TAG: client_persistent_connections +# Persistent connection support for clients. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with clients. +#Default: +# client_persistent_connections on + +# TAG: server_persistent_connections +# Persistent connection support for servers. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with servers. +#Default: +# server_persistent_connections on + +# TAG: persistent_connection_after_error +# With this directive the use of persistent connections after +# HTTP errors can be disabled. Useful if you have clients +# who fail to handle errors on persistent connections proper. +#Default: +# persistent_connection_after_error on + +# TAG: detect_broken_pconn +# Some servers have been found to incorrectly signal the use +# of HTTP/1.0 persistent connections even on replies not +# compatible, causing significant delays. This server problem +# has mostly been seen on redirects. +# +# By enabling this directive Squid attempts to detect such +# broken replies and automatically assume the reply is finished +# after 10 seconds timeout. +#Default: +# detect_broken_pconn off + +# CACHE DIGEST OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: digest_generation +# This controls whether the server will generate a Cache Digest +# of its contents. By default, Cache Digest generation is +# enabled if Squid is compiled with --enable-cache-digests defined. +#Default: +# digest_generation on + +# TAG: digest_bits_per_entry +# This is the number of bits of the server's Cache Digest which +# will be associated with the Digest entry for a given HTTP +# Method and URL (public key) combination. The default is 5. +#Default: +# digest_bits_per_entry 5 + +# TAG: digest_rebuild_period (seconds) +# This is the wait time between Cache Digest rebuilds. +#Default: +# digest_rebuild_period 1 hour + +# TAG: digest_rewrite_period (seconds) +# This is the wait time between Cache Digest writes to +# disk. +#Default: +# digest_rewrite_period 1 hour + +# TAG: digest_swapout_chunk_size (bytes) +# This is the number of bytes of the Cache Digest to write to +# disk at a time. It defaults to 4096 bytes (4KB), the Squid +# default swap page. +#Default: +# digest_swapout_chunk_size 4096 bytes + +# TAG: digest_rebuild_chunk_percentage (percent, 0-100) +# This is the percentage of the Cache Digest to be scanned at a +# time. By default it is set to 10% of the Cache Digest. +#Default: +# digest_rebuild_chunk_percentage 10 + +# SNMP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: snmp_port +# The port number where Squid listens for SNMP requests. To enable +# SNMP support set this to a suitable port number. Port number +# 3401 is often used for the Squid SNMP agent. By default it's +# set to "0" (disabled) +# +# Example: +# snmp_port 3401 +#Default: +# SNMP disabled. + +# TAG: snmp_access +# Allowing or denying access to the SNMP port. +# +# All access to the agent is denied by default. +# usage: +# +# snmp_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# snmp_access allow snmppublic localhost +# snmp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: snmp_incoming_address +# Just like 'udp_incoming_address', but for the SNMP port. +# +# snmp_incoming_address is used for the SNMP socket receiving +# messages from SNMP agents. +# +# The default snmp_incoming_address is to listen on all +# available network interfaces. +#Default: +# Accept SNMP packets from all machine interfaces. + +# TAG: snmp_outgoing_address +# Just like 'udp_outgoing_address', but for the SNMP port. +# +# snmp_outgoing_address is used for SNMP packets returned to SNMP +# agents. +# +# If snmp_outgoing_address is not set it will use the same socket +# as snmp_incoming_address. Only change this if you want to have +# SNMP replies sent using another address than where this Squid +# listens for SNMP queries. +# +# NOTE, snmp_incoming_address and snmp_outgoing_address can not have +# the same value since they both use the same port. +#Default: +# Use snmp_incoming_address or an address selected by the operating system. + +# ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icp_port +# The port number where Squid sends and receives ICP queries to +# and from neighbor caches. The standard UDP port for ICP is 3130. +# +# Example: +# icp_port 3130 +#Default: +# ICP disabled. + +# TAG: htcp_port +# The port number where Squid sends and receives HTCP queries to +# and from neighbor caches. To turn it on you want to set it to +# 4827. +# +# Example: +# htcp_port 4827 +#Default: +# HTCP disabled. + +# TAG: log_icp_queries on|off +# If set, ICP queries are logged to access.log. You may wish +# do disable this if your ICP load is VERY high to speed things +# up or to simplify log analysis. +#Default: +# log_icp_queries on + +# TAG: udp_incoming_address +# udp_incoming_address is used for UDP packets received from other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Only change this if you want to have all UDP queries received on +# a specific interface/address. +# +# NOTE: udp_incoming_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_outgoing_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Accept packets from all machine interfaces. + +# TAG: udp_outgoing_address +# udp_outgoing_address is used for UDP packets sent out to other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Instead it will use the same socket as udp_incoming_address. +# Only change this if you want to have UDP queries sent using another +# address than where this Squid listens for UDP queries from other +# caches. +# +# NOTE: udp_outgoing_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_incoming_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Use udp_incoming_address or an address selected by the operating system. + +# TAG: icp_hit_stale on|off +# If you want to return ICP_HIT for stale cache objects, set this +# option to 'on'. If you have sibling relationships with caches +# in other administrative domains, this should be 'off'. If you only +# have sibling relationships with caches under your control, +# it is probably okay to set this to 'on'. +# If set to 'on', your siblings should use the option "allow-miss" +# on their cache_peer lines for connecting to you. +#Default: +# icp_hit_stale off + +# TAG: minimum_direct_hops +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many hops away. +#Default: +# minimum_direct_hops 4 + +# TAG: minimum_direct_rtt (msec) +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many rtt milliseconds away. +#Default: +# minimum_direct_rtt 400 + +# TAG: netdb_low +# The low water mark for the ICMP measurement database. +# +# Note: high watermark controlled by netdb_high directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_low 900 + +# TAG: netdb_high +# The high water mark for the ICMP measurement database. +# +# Note: low watermark controlled by netdb_low directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_high 1000 + +# TAG: netdb_ping_period +# The minimum period for measuring a site. There will be at +# least this much delay between successive pings to the same +# network. The default is five minutes. +#Default: +# netdb_ping_period 5 minutes + +# TAG: query_icmp on|off +# If you want to ask your peers to include ICMP data in their ICP +# replies, enable this option. +# +# If your peer has configured Squid (during compilation) with +# '--enable-icmp' that peer will send ICMP pings to origin server +# sites of the URLs it receives. If you enable this option the +# ICP replies from that peer will include the ICMP data (if available). +# Then, when choosing a parent cache, Squid will choose the parent with +# the minimal RTT to the origin server. When this happens, the +# hierarchy field of the access.log will be +# "CLOSEST_PARENT_MISS". This option is off by default. +#Default: +# query_icmp off + +# TAG: test_reachability on|off +# When this is 'on', ICP MISS replies will be ICP_MISS_NOFETCH +# instead of ICP_MISS if the target host is NOT in the ICMP +# database, or has a zero RTT. +#Default: +# test_reachability off + +# TAG: icp_query_timeout (msec) +# Normally Squid will automatically determine an optimal ICP +# query timeout value based on the round-trip-time of recent ICP +# queries. If you want to override the value determined by +# Squid, set this 'icp_query_timeout' to a non-zero value. This +# value is specified in MILLISECONDS, so, to use a 2-second +# timeout (the old default), you would write: +# +# icp_query_timeout 2000 +#Default: +# Dynamic detection. + +# TAG: maximum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very large values (say 5 seconds). +# Use this option to put an upper limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# maximum_icp_query_timeout 2000 + +# TAG: minimum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very small timeouts, even lower than +# the normal latency variance on your link due to traffic. +# Use this option to put an lower limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# minimum_icp_query_timeout 5 + +# TAG: background_ping_rate time-units +# Controls how often the ICP pings are sent to siblings that +# have background-ping set. +#Default: +# background_ping_rate 10 seconds + +# MULTICAST ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: mcast_groups +# This tag specifies a list of multicast groups which your server +# should join to receive multicasted ICP queries. +# +# NOTE! Be very careful what you put here! Be sure you +# understand the difference between an ICP _query_ and an ICP +# _reply_. This option is to be set only if you want to RECEIVE +# multicast queries. Do NOT set this option to SEND multicast +# ICP (use cache_peer for that). ICP replies are always sent via +# unicast, so this option does not affect whether or not you will +# receive replies from multicast group members. +# +# You must be very careful to NOT use a multicast address which +# is already in use by another group of caches. +# +# If you are unsure about multicast, please read the Multicast +# chapter in the Squid FAQ (http://www.squid-cache.org/FAQ/). +# +# Usage: mcast_groups 239.128.16.128 224.0.1.20 +# +# By default, Squid doesn't listen on any multicast groups. +#Default: +# none + +# TAG: mcast_miss_addr +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# If you enable this option, every "cache miss" URL will +# be sent out on the specified multicast address. +# +# Do not enable this option unless you are are absolutely +# certain you understand what you are doing. +#Default: +# disabled. + +# TAG: mcast_miss_ttl +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the time-to-live value for packets multicasted +# when multicasting off cache miss URLs is enabled. By +# default this is set to 'site scope', i.e. 16. +#Default: +# mcast_miss_ttl 16 + +# TAG: mcast_miss_port +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the port number to be used in conjunction with +# 'mcast_miss_addr'. +#Default: +# mcast_miss_port 3135 + +# TAG: mcast_miss_encode_key +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# The URLs that are sent in the multicast miss stream are +# encrypted. This is the encryption key. +#Default: +# mcast_miss_encode_key XXXXXXXXXXXXXXXX + +# TAG: mcast_icp_query_timeout (msec) +# For multicast peers, Squid regularly sends out ICP "probes" to +# count how many other peers are listening on the given multicast +# address. This value specifies how long Squid should wait to +# count all the replies. The default is 2000 msec, or 2 +# seconds. +#Default: +# mcast_icp_query_timeout 2000 + +# INTERNAL ICON OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icon_directory +# Where the icons are stored. These are normally kept in +# /usr/share/squid/icons +#Default: +# icon_directory /usr/share/squid/icons + +# TAG: global_internal_static +# This directive controls is Squid should intercept all requests for +# /squid-internal-static/ no matter which host the URL is requesting +# (default on setting), or if nothing special should be done for +# such URLs (off setting). The purpose of this directive is to make +# icons etc work better in complex cache hierarchies where it may +# not always be possible for all corners in the cache mesh to reach +# the server generating a directory listing. +#Default: +# global_internal_static on + +# TAG: short_icon_urls +# If this is enabled Squid will use short URLs for icons. +# If disabled it will revert to the old behavior of including +# it's own name and port in the URL. +# +# If you run a complex cache hierarchy with a mix of Squid and +# other proxies you may need to disable this directive. +#Default: +# short_icon_urls on + +# ERROR PAGE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: error_directory +# If you wish to create your own versions of the default +# error files to customize them to suit your company copy +# the error/template files to another directory and point +# this tag at them. +# +# WARNING: This option will disable multi-language support +# on error pages if used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are making translations for a +# language that Squid does not currently provide please consider +# contributing your translation back to the project. +# http://wiki.squid-cache.org/Translations +# +# The squid developers working on translations are happy to supply drop-in +# translated error files in exchange for any new language contributions. +#Default: +# Send error pages in the clients preferred language + +# TAG: error_default_language +# Set the default language which squid will send error pages in +# if no existing translation matches the clients language +# preferences. +# +# If unset (default) generic English will be used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are interested in making +# translations for any language see the squid wiki for details. +# http://wiki.squid-cache.org/Translations +#Default: +# Generate English language pages. + +# TAG: error_log_languages +# Log to cache.log what languages users are attempting to +# auto-negotiate for translations. +# +# Successful negotiations are not logged. Only failures +# have meaning to indicate that Squid may need an upgrade +# of its error page translations. +#Default: +# error_log_languages on + +# TAG: err_page_stylesheet +# CSS Stylesheet to pattern the display of Squid default error pages. +# +# For information on CSS see http://www.w3.org/Style/CSS/ +#Default: +# err_page_stylesheet /etc/squid/errorpage.css + +# TAG: err_html_text +# HTML text to include in error messages. Make this a "mailto" +# URL to your admin address, or maybe just a link to your +# organizations Web page. +# +# To include this in your error messages, you must rewrite +# the error template files (found in the "errors" directory). +# Wherever you want the 'err_html_text' line to appear, +# insert a %L tag in the error template file. +#Default: +# none + +# TAG: email_err_data on|off +# If enabled, information about the occurred error will be +# included in the mailto links of the ERR pages (if %W is set) +# so that the email body contains the data. +# Syntax is %w +#Default: +# email_err_data on + +# TAG: deny_info +# Usage: deny_info err_page_name acl +# or deny_info http://... acl +# or deny_info TCP_RESET acl +# +# This can be used to return a ERR_ page for requests which +# do not pass the 'http_access' rules. Squid remembers the last +# acl it evaluated in http_access, and if a 'deny_info' line exists +# for that ACL Squid returns a corresponding error page. +# +# The acl is typically the last acl on the http_access deny line which +# denied access. The exceptions to this rule are: +# - When Squid needs to request authentication credentials. It's then +# the first authentication related acl encountered +# - When none of the http_access lines matches. It's then the last +# acl processed on the last http_access line. +# - When the decision to deny access was made by an adaptation service, +# the acl name is the corresponding eCAP or ICAP service_name. +# +# NP: If providing your own custom error pages with error_directory +# you may also specify them by your custom file name: +# Example: deny_info ERR_CUSTOM_ACCESS_DENIED bad_guys +# +# By defaut Squid will send "403 Forbidden". A different 4xx or 5xx +# may be specified by prefixing the file name with the code and a colon. +# e.g. 404:ERR_CUSTOM_ACCESS_DENIED +# +# Alternatively you can tell Squid to reset the TCP connection +# by specifying TCP_RESET. +# +# Or you can specify an error URL or URL pattern. The browsers will +# get redirected to the specified URL after formatting tags have +# been replaced. Redirect will be done with 302 or 307 according to +# HTTP/1.1 specs. A different 3xx code may be specified by prefixing +# the URL. e.g. 303:http://example.com/ +# +# URL FORMAT TAGS: +# %a - username (if available. Password NOT included) +# %B - FTP path URL +# %e - Error number +# %E - Error description +# %h - Squid hostname +# %H - Request domain name +# %i - Client IP Address +# %M - Request Method +# %o - Message result from external ACL helper +# %p - Request Port number +# %P - Request Protocol name +# %R - Request URL path +# %T - Timestamp in RFC 1123 format +# %U - Full canonical URL from client +# (HTTPS URLs terminate with *) +# %u - Full canonical URL from client +# %w - Admin email from squid.conf +# %x - Error name +# %% - Literal percent (%) code +# +#Default: +# none + +# OPTIONS INFLUENCING REQUEST FORWARDING +# ----------------------------------------------------------------------------- + +# TAG: nonhierarchical_direct +# By default, Squid will send any non-hierarchical requests +# (not cacheable request type) direct to origin servers. +# +# When this is set to "off", Squid will prefer to send these +# requests to parents. +# +# Note that in most configurations, by turning this off you will only +# add latency to these request without any improvement in global hit +# ratio. +# +# This option only sets a preference. If the parent is unavailable a +# direct connection to the origin server may still be attempted. To +# completely prevent direct connections use never_direct. +#Default: +# nonhierarchical_direct on + +# TAG: prefer_direct +# Normally Squid tries to use parents for most requests. If you for some +# reason like it to first try going direct and only use a parent if +# going direct fails set this to on. +# +# By combining nonhierarchical_direct off and prefer_direct on you +# can set up Squid to use a parent as a backup path if going direct +# fails. +# +# Note: If you want Squid to use parents for all requests see +# the never_direct directive. prefer_direct only modifies how Squid +# acts on cacheable requests. +#Default: +# prefer_direct off + +# TAG: cache_miss_revalidate on|off +# RFC 7232 defines a conditional request mechanism to prevent +# response objects being unnecessarily transferred over the network. +# If that mechanism is used by the client and a cache MISS occurs +# it can prevent new cache entries being created. +# +# This option determines whether Squid on cache MISS will pass the +# client revalidation request to the server or tries to fetch new +# content for caching. It can be useful while the cache is mostly +# empty to more quickly have the cache populated by generating +# non-conditional GETs. +# +# When set to 'on' (default), Squid will pass all client If-* headers +# to the server. This permits server responses without a cacheable +# payload to be delivered and on MISS no new cache entry is created. +# +# When set to 'off' and if the request is cacheable, Squid will +# remove the clients If-Modified-Since and If-None-Match headers from +# the request sent to the server. This requests a 200 status response +# from the server to create a new cache entry with. +#Default: +# cache_miss_revalidate on + +# TAG: always_direct +# Usage: always_direct allow|deny [!]aclname ... +# +# Here you can use ACL elements to specify requests which should +# ALWAYS be forwarded by Squid to the origin servers without using +# any peers. For example, to always directly forward requests for +# local servers ignoring any parents or siblings you may have use +# something like: +# +# acl local-servers dstdomain my.domain.net +# always_direct allow local-servers +# +# To always forward FTP requests directly, use +# +# acl FTP proto FTP +# always_direct allow FTP +# +# NOTE: There is a similar, but opposite option named +# 'never_direct'. You need to be aware that "always_direct deny +# foo" is NOT the same thing as "never_direct allow foo". You +# may need to use a deny rule to exclude a more-specific case of +# some other rule. Example: +# +# acl local-external dstdomain external.foo.net +# acl local-servers dstdomain .foo.net +# always_direct deny local-external +# always_direct allow local-servers +# +# NOTE: If your goal is to make the client forward the request +# directly to the origin server bypassing Squid then this needs +# to be done in the client configuration. Squid configuration +# can only tell Squid how Squid should fetch the object. +# +# NOTE: This directive is not related to caching. The replies +# is cached as usual even if you use always_direct. To not cache +# the replies see the 'cache' directive. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Prevent any cache_peer being used for this request. + +# TAG: never_direct +# Usage: never_direct allow|deny [!]aclname ... +# +# never_direct is the opposite of always_direct. Please read +# the description for always_direct if you have not already. +# +# With 'never_direct' you can use ACL elements to specify +# requests which should NEVER be forwarded directly to origin +# servers. For example, to force the use of a proxy for all +# requests, except those in your local domain use something like: +# +# acl local-servers dstdomain .foo.net +# never_direct deny local-servers +# never_direct allow all +# +# or if Squid is inside a firewall and there are local intranet +# servers inside the firewall use something like: +# +# acl local-intranet dstdomain .foo.net +# acl local-external dstdomain external.foo.net +# always_direct deny local-external +# always_direct allow local-intranet +# never_direct allow all +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow DNS results to be used for this request. + +# ADVANCED NETWORKING OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: incoming_udp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_udp_average 6 + +# TAG: incoming_tcp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_tcp_average 4 + +# TAG: incoming_dns_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_dns_average 4 + +# TAG: min_udp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_udp_poll_cnt 8 + +# TAG: min_dns_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_dns_poll_cnt 8 + +# TAG: min_tcp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_tcp_poll_cnt 8 + +# TAG: accept_filter +# FreeBSD: +# +# The name of an accept(2) filter to install on Squid's +# listen socket(s). This feature is perhaps specific to +# FreeBSD and requires support in the kernel. +# +# The 'httpready' filter delays delivering new connections +# to Squid until a full HTTP request has been received. +# See the accf_http(9) man page for details. +# +# The 'dataready' filter delays delivering new connections +# to Squid until there is some data to process. +# See the accf_dataready(9) man page for details. +# +# Linux: +# +# The 'data' filter delays delivering of new connections +# to Squid until there is some data to process by TCP_ACCEPT_DEFER. +# You may optionally specify a number of seconds to wait by +# 'data=N' where N is the number of seconds. Defaults to 30 +# if not specified. See the tcp(7) man page for details. +#EXAMPLE: +## FreeBSD +#accept_filter httpready +## Linux +#accept_filter data +#Default: +# none + +# TAG: client_ip_max_connections +# Set an absolute limit on the number of connections a single +# client IP can use. Any more than this and Squid will begin to drop +# new connections from the client until it closes some links. +# +# Note that this is a global limit. It affects all HTTP, HTCP, Gopher and FTP +# connections from the client. For finer control use the ACL access controls. +# +# Requires client_db to be enabled (the default). +# +# WARNING: This may noticably slow down traffic received via external proxies +# or NAT devices and cause them to rebound error messages back to their clients. +#Default: +# No limit. + +# TAG: tcp_recv_bufsize (bytes) +# Size of receive buffer to set for TCP sockets. Probably just +# as easy to change your kernel's default. +# Omit from squid.conf to use the default buffer size. +#Default: +# Use operating system TCP defaults. + +# ICAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icap_enable on|off +# If you want to enable the ICAP module support, set this to on. +#Default: +# icap_enable off + +# TAG: icap_connect_timeout +# This parameter specifies how long to wait for the TCP connect to +# the requested ICAP server to complete before giving up and either +# terminating the HTTP transaction or bypassing the failure. +# +# The default for optional services is peer_connect_timeout. +# The default for essential services is connect_timeout. +# If this option is explicitly set, its value applies to all services. +#Default: +# none + +# TAG: icap_io_timeout time-units +# This parameter specifies how long to wait for an I/O activity on +# an established, active ICAP connection before giving up and +# either terminating the HTTP transaction or bypassing the +# failure. +#Default: +# Use read_timeout. + +# TAG: icap_service_failure_limit limit [in memory-depth time-units] +# The limit specifies the number of failures that Squid tolerates +# when establishing a new TCP connection with an ICAP service. If +# the number of failures exceeds the limit, the ICAP service is +# not used for new ICAP requests until it is time to refresh its +# OPTIONS. +# +# A negative value disables the limit. Without the limit, an ICAP +# service will not be considered down due to connectivity failures +# between ICAP OPTIONS requests. +# +# Squid forgets ICAP service failures older than the specified +# value of memory-depth. The memory fading algorithm +# is approximate because Squid does not remember individual +# errors but groups them instead, splitting the option +# value into ten time slots of equal length. +# +# When memory-depth is 0 and by default this option has no +# effect on service failure expiration. +# +# Squid always forgets failures when updating service settings +# using an ICAP OPTIONS transaction, regardless of this option +# setting. +# +# For example, +# # suspend service usage after 10 failures in 5 seconds: +# icap_service_failure_limit 10 in 5 seconds +#Default: +# icap_service_failure_limit 10 + +# TAG: icap_service_revival_delay +# The delay specifies the number of seconds to wait after an ICAP +# OPTIONS request failure before requesting the options again. The +# failed ICAP service is considered "down" until fresh OPTIONS are +# fetched. +# +# The actual delay cannot be smaller than the hardcoded minimum +# delay of 30 seconds. +#Default: +# icap_service_revival_delay 180 + +# TAG: icap_preview_enable on|off +# The ICAP Preview feature allows the ICAP server to handle the +# HTTP message by looking only at the beginning of the message body +# or even without receiving the body at all. In some environments, +# previews greatly speedup ICAP processing. +# +# During an ICAP OPTIONS transaction, the server may tell Squid what +# HTTP messages should be previewed and how big the preview should be. +# Squid will not use Preview if the server did not request one. +# +# To disable ICAP Preview for all ICAP services, regardless of +# individual ICAP server OPTIONS responses, set this option to "off". +#Example: +#icap_preview_enable off +#Default: +# icap_preview_enable on + +# TAG: icap_preview_size +# The default size of preview data to be sent to the ICAP server. +# This value might be overwritten on a per server basis by OPTIONS requests. +#Default: +# No preview sent. + +# TAG: icap_206_enable on|off +# 206 (Partial Content) responses is an ICAP extension that allows the +# ICAP agents to optionally combine adapted and original HTTP message +# content. The decision to combine is postponed until the end of the +# ICAP response. Squid supports Partial Content extension by default. +# +# Activation of the Partial Content extension is negotiated with each +# ICAP service during OPTIONS exchange. Most ICAP servers should handle +# negotation correctly even if they do not support the extension, but +# some might fail. To disable Partial Content support for all ICAP +# services and to avoid any negotiation, set this option to "off". +# +# Example: +# icap_206_enable off +#Default: +# icap_206_enable on + +# TAG: icap_default_options_ttl +# The default TTL value for ICAP OPTIONS responses that don't have +# an Options-TTL header. +#Default: +# icap_default_options_ttl 60 + +# TAG: icap_persistent_connections on|off +# Whether or not Squid should use persistent connections to +# an ICAP server. +#Default: +# icap_persistent_connections on + +# TAG: adaptation_send_client_ip on|off +# If enabled, Squid shares HTTP client IP information with adaptation +# services. For ICAP, Squid adds the X-Client-IP header to ICAP requests. +# For eCAP, Squid sets the libecap::metaClientIp transaction option. +# +# See also: adaptation_uses_indirect_client +#Default: +# adaptation_send_client_ip off + +# TAG: adaptation_send_username on|off +# This sends authenticated HTTP client username (if available) to +# the adaptation service. +# +# For ICAP, the username value is encoded based on the +# icap_client_username_encode option and is sent using the header +# specified by the icap_client_username_header option. +#Default: +# adaptation_send_username off + +# TAG: icap_client_username_header +# ICAP request header name to use for adaptation_send_username. +#Default: +# icap_client_username_header X-Client-Username + +# TAG: icap_client_username_encode on|off +# Whether to base64 encode the authenticated client username. +#Default: +# icap_client_username_encode off + +# TAG: icap_service +# Defines a single ICAP service using the following format: +# +# icap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# ICAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: icap://servername:port/servicepath +# ICAP server and service location. +# +# ICAP does not allow a single service to handle both REQMOD and RESPMOD +# transactions. Squid does not enforce that requirement. You can specify +# services with the same service_url and different vectoring_points. You +# can even specify multiple identical services as long as their +# service_names differ. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. ICAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the ICAP service is treated as +# optional. If the service cannot be reached or malfunctions, +# Squid will try to ignore any errors and process the message as +# if the service was not enabled. No all ICAP errors can be +# bypassed. If set to 0, the ICAP service is treated as +# essential and all ICAP errors will result in an error page +# returned to the HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the ICAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. The services +# are specified using the X-Next-Services ICAP response header +# value, formatted as a comma-separated list of service names. +# Each named service should be configured in squid.conf. Other +# services are ignored. An empty X-Next-Services value results +# in an empty plan which ends the current adaptation. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default: the ICAP X-Next-Services +# response header is ignored. +# +# ipv6=on|off +# Only has effect on split-stack systems. The default on those systems +# is to use IPv4-only connections. When set to 'on' this option will +# make Squid use IPv6-only connections to contact this ICAP service. +# +# on-overload=block|bypass|wait|force +# If the service Max-Connections limit has been reached, do +# one of the following for each new ICAP transaction: +# * block: send an HTTP error response to the client +# * bypass: ignore the "over-connected" ICAP service +# * wait: wait (in a FIFO queue) for an ICAP connection slot +# * force: proceed, ignoring the Max-Connections limit +# +# In SMP mode with N workers, each worker assumes the service +# connection limit is Max-Connections/N, even though not all +# workers may use a given service. +# +# The default value is "bypass" if service is bypassable, +# otherwise it is set to "wait". +# +# +# max-conn=number +# Use the given number as the Max-Connections limit, regardless +# of the Max-Connections value given by the service, if any. +# +# Older icap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +#Example: +#icap_service svcBlocker reqmod_precache icap://icap1.mydomain.net:1344/reqmod bypass=0 +#icap_service svcLogger reqmod_precache icap://icap2.mydomain.net:1344/respmod routing=on +#Default: +# none + +# TAG: icap_class +# This deprecated option was documented to define an ICAP service +# chain, even though it actually defined a set of similar, redundant +# services, and the chains were not supported. +# +# To define a set of redundant services, please use the +# adaptation_service_set directive. For service chains, use +# adaptation_service_chain. +#Default: +# none + +# TAG: icap_access +# This option is deprecated. Please use adaptation_access, which +# has the same ICAP functionality, but comes with better +# documentation, and eCAP support. +#Default: +# none + +# eCAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ecap_enable on|off +# Controls whether eCAP support is enabled. +#Default: +# ecap_enable off + +# TAG: ecap_service +# Defines a single eCAP service +# +# ecap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# eCAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: ecap://vendor/service_name?custom&cgi=style¶meters=optional +# Squid uses the eCAP service URI to match this configuration +# line with one of the dynamically loaded services. Each loaded +# eCAP service must have a unique URI. Obtain the right URI from +# the service provider. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. eCAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the eCAP service is treated as optional. +# If the service cannot be reached or malfunctions, Squid will try +# to ignore any errors and process the message as if the service +# was not enabled. No all eCAP errors can be bypassed. +# If set to 'off' or '0', the eCAP service is treated as essential +# and all eCAP errors will result in an error page returned to the +# HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the eCAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default. +# +# Older ecap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +# +#Example: +#ecap_service s1 reqmod_precache ecap://filters.R.us/leakDetector?on_error=block bypass=off +#ecap_service s2 respmod_precache ecap://filters.R.us/virusFilter config=/etc/vf.cfg bypass=on +#Default: +# none + +# TAG: loadable_modules +# Instructs Squid to load the specified dynamic module(s) or activate +# preloaded module(s). +#Example: +#loadable_modules /usr/lib/MinimalAdapter.so +#Default: +# none + +# MESSAGE ADAPTATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: adaptation_service_set +# +# Configures an ordered set of similar, redundant services. This is +# useful when hot standby or backup adaptation servers are available. +# +# adaptation_service_set set_name service_name1 service_name2 ... +# +# The named services are used in the set declaration order. The first +# applicable adaptation service from the set is used first. The next +# applicable service is tried if and only if the transaction with the +# previous service fails and the message waiting to be adapted is still +# intact. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the set. A broken service is a down optional service. +# +# The services in a set must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# If all services in a set are optional then adaptation failures are +# bypassable. If all services in the set are essential, then a +# transaction failure with one service may still be retried using +# another service from the set, but when all services fail, the master +# transaction fails as well. +# +# A set may contain a mix of optional and essential services, but that +# is likely to lead to surprising results because broken services become +# ignored (see above), making previously bypassable failures fatal. +# Technically, it is the bypassability of the last failed service that +# matters. +# +# See also: adaptation_access adaptation_service_chain +# +#Example: +#adaptation_service_set svcBlocker urlFilterPrimary urlFilterBackup +#adaptation service_set svcLogger loggerLocal loggerRemote +#Default: +# none + +# TAG: adaptation_service_chain +# +# Configures a list of complementary services that will be applied +# one-by-one, forming an adaptation chain or pipeline. This is useful +# when Squid must perform different adaptations on the same message. +# +# adaptation_service_chain chain_name service_name1 svc_name2 ... +# +# The named services are used in the chain declaration order. The first +# applicable adaptation service from the chain is used first. The next +# applicable service is applied to the successful adaptation results of +# the previous service in the chain. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the chain. A broken service is a down optional service. +# +# Request satisfaction terminates the adaptation chain because Squid +# does not currently allow declaration of RESPMOD services at the +# "reqmod_precache" vectoring point (see icap_service or ecap_service). +# +# The services in a chain must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# A chain may contain a mix of optional and essential services. If an +# essential adaptation fails (or the failure cannot be bypassed for +# other reasons), the master transaction fails. Otherwise, the failure +# is bypassed as if the failed adaptation service was not in the chain. +# +# See also: adaptation_access adaptation_service_set +# +#Example: +#adaptation_service_chain svcRequest requestLogger urlFilter leakDetector +#Default: +# none + +# TAG: adaptation_access +# Sends an HTTP transaction to an ICAP or eCAP adaptation service. +# +# adaptation_access service_name allow|deny [!]aclname... +# adaptation_access set_name allow|deny [!]aclname... +# +# At each supported vectoring point, the adaptation_access +# statements are processed in the order they appear in this +# configuration file. Statements pointing to the following services +# are ignored (i.e., skipped without checking their ACL): +# +# - services serving different vectoring points +# - "broken-but-bypassable" services +# - "up" services configured to ignore such transactions +# (e.g., based on the ICAP Transfer-Ignore header). +# +# When a set_name is used, all services in the set are checked +# using the same rules, to find the first applicable one. See +# adaptation_service_set for details. +# +# If an access list is checked and there is a match, the +# processing stops: For an "allow" rule, the corresponding +# adaptation service is used for the transaction. For a "deny" +# rule, no adaptation service is activated. +# +# It is currently not possible to apply more than one adaptation +# service at the same vectoring point to the same HTTP transaction. +# +# See also: icap_service and ecap_service +# +#Example: +#adaptation_access service_1 allow all +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: adaptation_service_iteration_limit +# Limits the number of iterations allowed when applying adaptation +# services to a message. If your longest adaptation set or chain +# may have more than 16 services, increase the limit beyond its +# default value of 16. If detecting infinite iteration loops sooner +# is critical, make the iteration limit match the actual number +# of services in your longest adaptation set or chain. +# +# Infinite adaptation loops are most likely with routing services. +# +# See also: icap_service routing=1 +#Default: +# adaptation_service_iteration_limit 16 + +# TAG: adaptation_masterx_shared_names +# For each master transaction (i.e., the HTTP request and response +# sequence, including all related ICAP and eCAP exchanges), Squid +# maintains a table of metadata. The table entries are (name, value) +# pairs shared among eCAP and ICAP exchanges. The table is destroyed +# with the master transaction. +# +# This option specifies the table entry names that Squid must accept +# from and forward to the adaptation transactions. +# +# An ICAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by returning an ICAP header field with a name +# specified in adaptation_masterx_shared_names. +# +# An eCAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by implementing the libecap::visitEachOption() API +# to provide an option with a name specified in +# adaptation_masterx_shared_names. +# +# Squid will store and forward the set entry to subsequent adaptation +# transactions within the same master transaction scope. +# +# Only one shared entry name is supported at this time. +# +#Example: +## share authentication information among ICAP services +#adaptation_masterx_shared_names X-Subscriber-ID +#Default: +# none + +# TAG: adaptation_meta +# This option allows Squid administrator to add custom ICAP request +# headers or eCAP options to Squid ICAP requests or eCAP transactions. +# Use it to pass custom authentication tokens and other +# transaction-state related meta information to an ICAP/eCAP service. +# +# The addition of a meta header is ACL-driven: +# adaptation_meta name value [!]aclname ... +# +# Processing for a given header name stops after the first ACL list match. +# Thus, it is impossible to add two headers with the same name. If no ACL +# lists match for a given header name, no such header is added. For +# example: +# +# # do not debug transactions except for those that need debugging +# adaptation_meta X-Debug 1 needs_debugging +# +# # log all transactions except for those that must remain secret +# adaptation_meta X-Log 1 !keep_secret +# +# # mark transactions from users in the "G 1" group +# adaptation_meta X-Authenticated-Groups "G 1" authed_as_G1 +# +# The "value" parameter may be a regular squid.conf token or a "double +# quoted string". Within the quoted string, use backslash (\) to escape +# any character, which is currently only useful for escaping backslashes +# and double quotes. For example, +# "this string has one backslash (\\) and two \"quotes\"" +# +# Used adaptation_meta header values may be logged via %note +# logformat code. If multiple adaptation_meta headers with the same name +# are used during master transaction lifetime, the header values are +# logged in the order they were used and duplicate values are ignored +# (only the first repeated value will be logged). +#Default: +# none + +# TAG: icap_retry +# This ACL determines which retriable ICAP transactions are +# retried. Transactions that received a complete ICAP response +# and did not have to consume or produce HTTP bodies to receive +# that response are usually retriable. +# +# icap_retry allow|deny [!]aclname ... +# +# Squid automatically retries some ICAP I/O timeouts and errors +# due to persistent connection race conditions. +# +# See also: icap_retry_limit +#Default: +# icap_retry deny all + +# TAG: icap_retry_limit +# Limits the number of retries allowed. +# +# Communication errors due to persistent connection race +# conditions are unavoidable, automatically retried, and do not +# count against this limit. +# +# See also: icap_retry +#Default: +# No retries are allowed. + +# DNS OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: check_hostnames +# For security and stability reasons Squid can check +# hostnames for Internet standard RFC compliance. If you want +# Squid to perform these checks turn this directive on. +#Default: +# check_hostnames off + +# TAG: allow_underscore +# Underscore characters is not strictly allowed in Internet hostnames +# but nevertheless used by many sites. Set this to off if you want +# Squid to be strict about the standard. +# This check is performed only when check_hostnames is set to on. +#Default: +# allow_underscore on + +# TAG: dns_retransmit_interval +# Initial retransmit interval for DNS queries. The interval is +# doubled each time all configured DNS servers have been tried. +#Default: +# dns_retransmit_interval 5 seconds + +# TAG: dns_timeout +# DNS Query timeout. If no response is received to a DNS query +# within this time all DNS servers for the queried domain +# are assumed to be unavailable. +#Default: +# dns_timeout 30 seconds + +# TAG: dns_packet_max +# Maximum number of bytes packet size to advertise via EDNS. +# Set to "none" to disable EDNS large packet support. +# +# For legacy reasons DNS UDP replies will default to 512 bytes which +# is too small for many responses. EDNS provides a means for Squid to +# negotiate receiving larger responses back immediately without having +# to failover with repeat requests. Responses larger than this limit +# will retain the old behaviour of failover to TCP DNS. +# +# Squid has no real fixed limit internally, but allowing packet sizes +# over 1500 bytes requires network jumbogram support and is usually not +# necessary. +# +# WARNING: The RFC also indicates that some older resolvers will reply +# with failure of the whole request if the extension is added. Some +# resolvers have already been identified which will reply with mangled +# EDNS response on occasion. Usually in response to many-KB jumbogram +# sizes being advertised by Squid. +# Squid will currently treat these both as an unable-to-resolve domain +# even if it would be resolvable without EDNS. +#Default: +# EDNS disabled + +# TAG: dns_defnames on|off +# Normally the RES_DEFNAMES resolver option is disabled +# (see res_init(3)). This prevents caches in a hierarchy +# from interpreting single-component hostnames locally. To allow +# Squid to handle single-component names, enable this option. +#Default: +# Search for single-label domain names is disabled. + +# TAG: dns_multicast_local on|off +# When set to on, Squid sends multicast DNS lookups on the local +# network for domains ending in .local and .arpa. +# This enables local servers and devices to be contacted in an +# ad-hoc or zero-configuration network environment. +#Default: +# Search for .local and .arpa names is disabled. + +# TAG: dns_nameservers +# Use this if you want to specify a list of DNS name servers +# (IP addresses) to use instead of those given in your +# /etc/resolv.conf file. +# +# On Windows platforms, if no value is specified here or in +# the /etc/resolv.conf file, the list of DNS name servers are +# taken from the Windows registry, both static and dynamic DHCP +# configurations are supported. +# +# Example: dns_nameservers 10.0.0.1 192.172.0.4 +#Default: +# Use operating system definitions + +# TAG: hosts_file +# Location of the host-local IP name-address associations +# database. Most Operating Systems have such a file on different +# default locations: +# - Un*X & Linux: /etc/hosts +# - Windows NT/2000: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\winnt) +# - Windows XP/2003: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\windows) +# - Windows 9x/Me: %windir%\hosts +# (%windir% value is usually c:\windows) +# - Cygwin: /etc/hosts +# +# The file contains newline-separated definitions, in the +# form ip_address_in_dotted_form name [name ...] names are +# whitespace-separated. Lines beginning with an hash (#) +# character are comments. +# +# The file is checked at startup and upon configuration. +# If set to 'none', it won't be checked. +# If append_domain is used, that domain will be added to +# domain-local (i.e. not containing any dot character) host +# definitions. +#Default: +# hosts_file /etc/hosts + +# TAG: append_domain +# Appends local domain name to hostnames without any dots in +# them. append_domain must begin with a period. +# +# Be warned there are now Internet names with no dots in +# them using only top-domain names, so setting this may +# cause some Internet sites to become unavailable. +# +#Example: +# append_domain .yourdomain.com +#Default: +# Use operating system definitions + +# TAG: ignore_unknown_nameservers +# By default Squid checks that DNS responses are received +# from the same IP addresses they are sent to. If they +# don't match, Squid ignores the response and writes a warning +# message to cache.log. You can allow responses from unknown +# nameservers by setting this option to 'off'. +#Default: +# ignore_unknown_nameservers on + +# TAG: dns_v4_first +# With the IPv6 Internet being as fast or faster than IPv4 Internet +# for most networks Squid prefers to contact websites over IPv6. +# +# This option reverses the order of preference to make Squid contact +# dual-stack websites over IPv4 first. Squid will still perform both +# IPv6 and IPv4 DNS lookups before connecting. +# +# WARNING: +# This option will restrict the situations under which IPv6 +# connectivity is used (and tested), potentially hiding network +# problems which would otherwise be detected and warned about. +#Default: +# dns_v4_first off + +# TAG: ipcache_size (number of entries) +# Maximum number of DNS IP cache entries. +#Default: +# ipcache_size 1024 + +# TAG: ipcache_low (percent) +#Default: +# ipcache_low 90 + +# TAG: ipcache_high (percent) +# The size, low-, and high-water marks for the IP cache. +#Default: +# ipcache_high 95 + +# TAG: fqdncache_size (number of entries) +# Maximum number of FQDN cache entries. +#Default: +# fqdncache_size 1024 + +# MISCELLANEOUS +# ----------------------------------------------------------------------------- + +# TAG: configuration_includes_quoted_values on|off +# If set, Squid will recognize each "quoted string" after a configuration +# directive as a single parameter. The quotes are stripped before the +# parameter value is interpreted or used. +# See "Values with spaces, quotes, and other special characters" +# section for more details. +#Default: +# configuration_includes_quoted_values off + +# TAG: memory_pools on|off +# If set, Squid will keep pools of allocated (but unused) memory +# available for future use. If memory is a premium on your +# system and you believe your malloc library outperforms Squid +# routines, disable this. +#Default: +# memory_pools on + +# TAG: memory_pools_limit (bytes) +# Used only with memory_pools on: +# memory_pools_limit 50 MB +# +# If set to a non-zero value, Squid will keep at most the specified +# limit of allocated (but unused) memory in memory pools. All free() +# requests that exceed this limit will be handled by your malloc +# library. Squid does not pre-allocate any memory, just safe-keeps +# objects that otherwise would be free()d. Thus, it is safe to set +# memory_pools_limit to a reasonably high value even if your +# configuration will use less memory. +# +# If set to none, Squid will keep all memory it can. That is, there +# will be no limit on the total amount of memory used for safe-keeping. +# +# To disable memory allocation optimization, do not set +# memory_pools_limit to 0 or none. Set memory_pools to "off" instead. +# +# An overhead for maintaining memory pools is not taken into account +# when the limit is checked. This overhead is close to four bytes per +# object kept. However, pools may actually _save_ memory because of +# reduced memory thrashing in your malloc library. +#Default: +# memory_pools_limit 5 MB + +# TAG: forwarded_for on|off|transparent|truncate|delete +# If set to "on", Squid will append your client's IP address +# in the HTTP requests it forwards. By default it looks like: +# +# X-Forwarded-For: 192.1.2.3 +# +# If set to "off", it will appear as +# +# X-Forwarded-For: unknown +# +# If set to "transparent", Squid will not alter the +# X-Forwarded-For header in any way. +# +# If set to "delete", Squid will delete the entire +# X-Forwarded-For header. +# +# If set to "truncate", Squid will remove all existing +# X-Forwarded-For entries, and place the client IP as the sole entry. +#Default: +# forwarded_for on + +# TAG: cachemgr_passwd +# Specify passwords for cachemgr operations. +# +# Usage: cachemgr_passwd password action action ... +# +# Some valid actions are (see cache manager menu for a full list): +# 5min +# 60min +# asndb +# authenticator +# cbdata +# client_list +# comm_incoming +# config * +# counters +# delay +# digest_stats +# dns +# events +# filedescriptors +# fqdncache +# histograms +# http_headers +# info +# io +# ipcache +# mem +# menu +# netdb +# non_peers +# objects +# offline_toggle * +# pconn +# peer_select +# reconfigure * +# redirector +# refresh +# server_list +# shutdown * +# store_digest +# storedir +# utilization +# via_headers +# vm_objects +# +# * Indicates actions which will not be performed without a +# valid password, others can be performed if not listed here. +# +# To disable an action, set the password to "disable". +# To allow performing an action without a password, set the +# password to "none". +# +# Use the keyword "all" to set the same password for all actions. +# +#Example: +# cachemgr_passwd secret shutdown +# cachemgr_passwd lesssssssecret info stats/objects +# cachemgr_passwd disable all +#Default: +# No password. Actions which require password are denied. + +# TAG: client_db on|off +# If you want to disable collecting per-client statistics, +# turn off client_db here. +#Default: +# client_db on + +# TAG: refresh_all_ims on|off +# When you enable this option, squid will always check +# the origin server for an update when a client sends an +# If-Modified-Since request. Many browsers use IMS +# requests when the user requests a reload, and this +# ensures those clients receive the latest version. +# +# By default (off), squid may return a Not Modified response +# based on the age of the cached version. +#Default: +# refresh_all_ims off + +# TAG: reload_into_ims on|off +# When you enable this option, client no-cache or ``reload'' +# requests will be changed to If-Modified-Since requests. +# Doing this VIOLATES the HTTP standard. Enabling this +# feature could make you liable for problems which it +# causes. +# +# see also refresh_pattern for a more selective approach. +#Default: +# reload_into_ims off + +# TAG: connect_retries +# This sets the maximum number of connection attempts made for each +# TCP connection. The connect_retries attempts must all still +# complete within the connection timeout period. +# +# The default is not to re-try if the first connection attempt fails. +# The (not recommended) maximum is 10 tries. +# +# A warning message will be generated if it is set to a too-high +# value and the configured value will be over-ridden. +# +# Note: These re-tries are in addition to forward_max_tries +# which limit how many different addresses may be tried to find +# a useful server. +#Default: +# Do not retry failed connections. + +# TAG: retry_on_error +# If set to ON Squid will automatically retry requests when +# receiving an error response with status 403 (Forbidden), +# 500 (Internal Error), 501 or 503 (Service not available). +# Status 502 and 504 (Gateway errors) are always retried. +# +# This is mainly useful if you are in a complex cache hierarchy to +# work around access control errors. +# +# NOTE: This retry will attempt to find another working destination. +# Which is different from the server which just failed. +#Default: +# retry_on_error off + +# TAG: as_whois_server +# WHOIS server to query for AS numbers. NOTE: AS numbers are +# queried only when Squid starts up, not for every request. +#Default: +# as_whois_server whois.ra.net + +# TAG: offline_mode +# Enable this option and Squid will never try to validate cached +# objects. +#Default: +# offline_mode off + +# TAG: uri_whitespace +# What to do with requests that have whitespace characters in the +# URI. Options: +# +# strip: The whitespace characters are stripped out of the URL. +# This is the behavior recommended by RFC2396 and RFC3986 +# for tolerant handling of generic URI. +# NOTE: This is one difference between generic URI and HTTP URLs. +# +# deny: The request is denied. The user receives an "Invalid +# Request" message. +# This is the behaviour recommended by RFC2616 for safe +# handling of HTTP request URL. +# +# allow: The request is allowed and the URI is not changed. The +# whitespace characters remain in the URI. Note the +# whitespace is passed to redirector processes if they +# are in use. +# Note this may be considered a violation of RFC2616 +# request parsing where whitespace is prohibited in the +# URL field. +# +# encode: The request is allowed and the whitespace characters are +# encoded according to RFC1738. +# +# chop: The request is allowed and the URI is chopped at the +# first whitespace. +# +# +# NOTE the current Squid implementation of encode and chop violates +# RFC2616 by not using a 301 redirect after altering the URL. +#Default: +# uri_whitespace strip + +# TAG: chroot +# Specifies a directory where Squid should do a chroot() while +# initializing. This also causes Squid to fully drop root +# privileges after initializing. This means, for example, if you +# use a HTTP port less than 1024 and try to reconfigure, you may +# get an error saying that Squid can not open the port. +#Default: +# none + +# TAG: balance_on_multiple_ip +# Modern IP resolvers in squid sort lookup results by preferred access. +# By default squid will use these IP in order and only rotates to +# the next listed when the most preffered fails. +# +# Some load balancing servers based on round robin DNS have been +# found not to preserve user session state across requests +# to different IP addresses. +# +# Enabling this directive Squid rotates IP's per request. +#Default: +# balance_on_multiple_ip off + +# TAG: pipeline_prefetch +# HTTP clients may send a pipeline of 1+N requests to Squid using a +# single connection, without waiting for Squid to respond to the first +# of those requests. This option limits the number of concurrent +# requests Squid will try to handle in parallel. If set to N, Squid +# will try to receive and process up to 1+N requests on the same +# connection concurrently. +# +# Defaults to 0 (off) for bandwidth management and access logging +# reasons. +# +# NOTE: pipelining requires persistent connections to clients. +# +# WARNING: pipelining breaks NTLM and Negotiate/Kerberos authentication. +#Default: +# Do not pre-parse pipelined requests. + +# TAG: high_response_time_warning (msec) +# If the one-minute median response time exceeds this value, +# Squid prints a WARNING with debug level 0 to get the +# administrators attention. The value is in milliseconds. +#Default: +# disabled. + +# TAG: high_page_fault_warning +# If the one-minute average page fault rate exceeds this +# value, Squid prints a WARNING with debug level 0 to get +# the administrators attention. The value is in page faults +# per second. +#Default: +# disabled. + +# TAG: high_memory_warning +# Note: This option is only available if Squid is rebuilt with the +# GNU Malloc with mstats() +# +# If the memory usage (as determined by gnumalloc, if available and used) +# exceeds this amount, Squid prints a WARNING with debug level 0 to get +# the administrators attention. +#Default: +# disabled. + +# TAG: sleep_after_fork (microseconds) +# When this is set to a non-zero value, the main Squid process +# sleeps the specified number of microseconds after a fork() +# system call. This sleep may help the situation where your +# system reports fork() failures due to lack of (virtual) +# memory. Note, however, if you have a lot of child +# processes, these sleep delays will add up and your +# Squid will not service requests for some amount of time +# until all the child processes have been started. +# On Windows value less then 1000 (1 milliseconds) are +# rounded to 1000. +#Default: +# sleep_after_fork 0 + +# TAG: windows_ipaddrchangemonitor on|off +# Note: This option is only available if Squid is rebuilt with the +# MS Windows +# +# On Windows Squid by default will monitor IP address changes and will +# reconfigure itself after any detected event. This is very useful for +# proxies connected to internet with dial-up interfaces. +# In some cases (a Proxy server acting as VPN gateway is one) it could be +# desiderable to disable this behaviour setting this to 'off'. +# Note: after changing this, Squid service must be restarted. +#Default: +# windows_ipaddrchangemonitor on + +# TAG: eui_lookup +# Whether to lookup the EUI or MAC address of a connected client. +#Default: +# eui_lookup on + +# TAG: max_filedescriptors +# Reduce the maximum number of filedescriptors supported below +# the usual operating system defaults. +# +# Remove from squid.conf to inherit the current ulimit setting. +# +# Note: Changing this requires a restart of Squid. Also +# not all I/O types supports large values (eg on Windows). +#Default: +# Use operating system limits set by ulimit. + diff --git a/sdk/core/azure-core/test/ut/proxy_tests/readme.md b/sdk/core/azure-core/test/ut/proxy_tests/readme.md new file mode 100644 index 0000000000..0e23b8764b --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/readme.md @@ -0,0 +1,593 @@ +--- +# cspell:words gunicorn Nlcjpw userx Nlcng dvcm passwordx userc +--- + +# Create squid proxy docker container + +Running the proxy tests requires two docker containers, one hosting an anonymous squid proxy, the other hosting an authenticated squid proxy. + +This container is derived from the ubuntu/squid container on dockerhub. This container is maintained by the Ubuntu team and has +a current version of Ubuntu in it, with a version of squid built to match. + +## Building the container + +There are 4 docker images configured for testing proxy tests: + +- Anonymous Squid Proxy to be run on localhost. +- Authenticated Squid Proxy to be run on localhost. +- Anonymous Squid Proxy to be run as an Azure Container Instance (used for live tests). +- Authenticated Squid Proxy to be run as an Azure Container Instance (used for live tests). + +To create the local anonymous docker container execute the following command (tested in powershell, should work in all shells): + +```powershell +cd sdk\core\azure-core\test\ut\proxy_tests\proxy +docker build -t squid-local . +``` + +To create the local authenticated docker container execute the following command (tested in powershell, should work in all shells): + +```powershell + +cd sdk\core\azure-core\test\ut\proxy_tests\proxy.passwd +docker build -t squid-local-passwd . +``` + +Alternatively, the powershell script `builddocker.ps1` located in the sdk\core\azure-core\test\ut\proxy_tests directory can be used to build all 4 docker images. + +| Image Purpose | Image Name | Notes | +| ------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| squid-local | Localhost Anonymous Proxy | +| squid-local.passwd | Localhost Authenticated Proxy | One user supported "user", password "password" | +| squid-remote | Azure Container Instance Anonymous Proxy | Proxy only works for resources on the azuresdkforcpp.azurewebsites.net domain. | +| squid-remote.passwd | Azure Container Instance Authenticated Proxy | Proxy only works for resources on the azuresdkforcpp.azurewebsites.net domain. One user supported "user", password "password" | + +## Executing the containers + +There are two squid proxy configuration files used, one which supports anonymous proxy access, the other +which supports basic authentication. + +### Executing the anonymous proxy + +The anonymous proxy configuration is found in the `proxy` subdirectory, the authenticated proxy is in `proxy.passwd`. +To start the anonymous proxy, execute the following command: + +```powershell + docker run --rm -d -p 3128:3128 squid-local +``` + +This will launch the anonymous proxy running on port 3128. + +### Executing the authenticated proxy + +To start the authenticated proxy, execute the following command: + +```powershell +docker run --rm -d -p 3129:3129 squid-local-passwd +``` + +This will launch the anonymous proxy running on port 3129. + +Alternatively, the `runproxy.ps1` script will start the proxies on localhost. + +### Deploying the proxy in azure container instances + +To deploy the proxy in an azure container instance, the new-testresource.ps1 script: + +```powershell +..\..\eng\common\TestResources\New-TestResources.ps1 -ServiceDirectory core +2:03:00 PM - BaseName was not set. Using default base name 'larryocore' +2:03:00 PM - Attempting to select subscription 'Azure SDK Developer Playground (faa080af-c1d8-40ad-9cce-e1a450ca5b57)' +2:03:04 PM - Using subscription 'Azure SDK Developer Playground (faa080af-c1d8-40ad-9cce-e1a450ca5b57)' +WARNING: Any clean-up scripts running against subscription 'faa080af-c1d8-40ad-9cce-e1a450ca5b57' may delete resource group 'rg-larryocore' after 120 hours. +2:03:05 PM - Creating resource group 'rg-larryocore' in location 'westus' + +2:03:09 PM - TestApplicationId was not specified; creating a new service principal in subscription 'faa080af-c1d8-40ad-9cce-e1a450ca5b57' +WARNING: Assigning role 'Owner' over scope '/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-larryocore' to the new service principal. +2:03:49 PM - Created service principal. AppId: '881c20cc-53d4-4b0b-945e-85753c19b215' ObjectId: '0b157efa-8eca-41a8-a624-88d9f735a9e8' +2:03:49 PM - Deployment template C:\Users\LARRYO~1.RED\AppData\Local\Temp\test-resources.94748e36-e777-4928-b69a-d8d3378acecf.compiled.json from G:\Az\LarryO\azure-sdk-for-cpp\sdk\core\test-resources.bicep to resource group rg-larryocore +2:04:46 PM - Persist the following environment variables based on your detected shell (PowerShell): + +${env:ANONYMOUSCONTAINERIPV4ADDRESS} = '20.245.175.58' +${env:AUTHENTICATEDCONTAINERIPV4ADDRESS} = '20.253.174.195' + +``` + +## Testing the proxies + +To verify that the anonymous proxies work, you can execute the following command: + +```powershell +sdk\core\azure-core\test\ut\proxy_tests\verify_proxy.ps1 +``` + +This will verify the running proxy - if the environment variables set by `New-TestResources` are set, it will use that instance, +otherwise it will attempt to verify the proxy running on localhost. + +The following sections describe how to manually test the proxy. + +### Anonymous Proxy + +#### CURL Access + +To verify that the anonymous proxy is working using CURL, you can execute the following command. It instructs CURL to retrieve the contents using the proxy running on localhost at port 3128. + +```powershell +curl -v https://azuresdkforcpp.azurewebsites.net/get -x http://127.0.0.1:3128/ +``` + +This should result in something similar to the following + +```powershell +* Trying 127.0.0.1:3128... +* Connected to 127.0.0.1 (127.0.0.1) port 3128 (#0) +* allocate connect buffer +* Establish HTTP proxy tunnel to azuresdkforcpp.azurewebsites.net:443 +> CONNECT azuresdkforcpp.azurewebsites.net:443 HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net:443 +> User-Agent: curl/7.83.1 +> Proxy-Connection: Keep-Alive +> +< HTTP/1.1 200 Connection established +< +* Proxy replied 200 to CONNECT request +* CONNECT phase completed +* schannel: disabled automatic use of client certificate +* ALPN: offers http/1.1 +* ALPN: server accepted http/1.1 +> GET /get HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net +> User-Agent: curl/7.83.1 +> Accept: */* +> +* Mark bundle as not supporting multiuse +< HTTP/1.1 200 OK +< Content-Length: 917 +< Content-Type: application/json +< Date: Thu, 04 Aug 2022 18:03:29 GMT +< Server: gunicorn/19.9.0 +< Access-Control-Allow-Credentials: true +< Access-Control-Allow-Origin: * +< +{ + "args": {}, + "headers": { + "Accept": "*/*", + "Client-Ip": "71.197.167.179:49347", + "Disguised-Host": "azuresdkforcpp.azurewebsites.net", + "Host": "azuresdkforcpp.azurewebsites.net", + "Max-Forwards": "10", + "User-Agent": "curl/7.83.1", + "Was-Default-Hostname": "azuresdkforcpp.azurewebsites.net", + "X-Appservice-Proto": "https", + "X-Arr-Log-Id": "02467793-daf0-4663-9a89-fd076e5d5c83", + "X-Arr-Ssl": "2048|256|CN=Microsoft Azure TLS Issuing CA 01, O=Microsoft Corporation, C=US|CN=*.azurewebsites.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US", + "X-Client-Ip": "71.197.167.179", + "X-Client-Port": "49347", + "X-Forwarded-Tlsversion": "1.2", + "X-Original-Url": "/get", + "X-Site-Deployment-Id": "azuresdkforcpp", + "X-Waws-Unencoded-Url": "/get" + }, + "origin": "71.197.167.179:49347", + "url": "https://azuresdkforcpp.azurewebsites.net/get" +} +* Connection #0 to host 127.0.0.1 left intact +``` + +#### WinHTTP Access + +To test accessing the anonymous proxy using WinHTTP, from a Windows machine, enter the following: + +```powershell +Invoke-WebRequest -Uri https://azuresdkforcpp.azurewebsites.net/get -Proxy http://127.0.0.1:3128 +``` + +This assumes that the Powershell `Invoke-WebRequest` command is built on the `System.Net.Http.HttpClient` object, which (on Windows) is backed by WinHTTP. + +The `Invoke-WebRequest` command should return something like the following: + +```powershell +StatusCode : 200 +StatusDescription : OK +Content : { + "args": {}, + "headers": { + "Client-Ip": "67.183.134.44:51480", + "Disguised-Host": "azuresdkforcpp.azurewebsites.net", + "Host": "azuresdkforcpp.azurewebsites.net", + "Max-Forwards":... +RawContent : HTTP/1.1 200 OK + Date: Fri, 12 Aug 2022 21:36:52 GMT + Server: gunicorn/19.9.0 + Access-Control-Allow-Credentials: true + Access-Control-Allow-Origin: * + Content-Length: 964 + Content-Type: application/js… +Headers : {[Date, System.String[]], [Server, System.String[]], [Access-Control-Allow-Credentials, + System.String[]], [Access-Control-Allow-Origin, System.String[]]...} +Images : {} +InputFields : {} +Links : {} +RawContentLength : 964 +RelationLink : {} +``` + +### Authenticated proxy + +#### CURL access + +Invoke the following command: + +```powershell +curl -U user:password -v http://azuresdkforcpp.azurewebsites.net/get -x http://127.0.0.1:3129/ +``` + +If the proxy is successfully connected, it should result in something like: + +```powershell +* Trying 127.0.0.1:3129... +* Connected to 127.0.0.1 (127.0.0.1) port 3129 (#0) +* Proxy auth using Basic with user 'user' +> GET http://azuresdkforcpp.azurewebsites.net/get HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net +> Proxy-Authorization: Basic dXNlcjpwYXNzd29yZA== +> User-Agent: curl/7.83.1 +> Accept: */* +> Proxy-Connection: Keep-Alive +> +* Mark bundle as not supporting multiuse +< HTTP/1.1 200 OK +< Content-Length: 725 +< Content-Type: application/json +< Date: Thu, 04 Aug 2022 19:20:04 GMT +< Server: gunicorn/19.9.0 +< Access-Control-Allow-Credentials: true +< Access-Control-Allow-Origin: * +< X-Cache: MISS from 65d2e3c7997a +< X-Cache-Lookup: MISS from 65d2e3c7997a:3129 +< Via: 1.1 65d2e3c7997a (squid/3.5.27) +< Connection: keep-alive +< +{ + "args": {}, + "headers": { + "Accept": "*/*", + "Cache-Control": "max-age=259200", + "Client-Ip": "71.197.167.179:51795", + "Disguised-Host": "azuresdkforcpp.azurewebsites.net", + "Host": "azuresdkforcpp.azurewebsites.net", + "Max-Forwards": "10", + "User-Agent": "curl/7.83.1", + "Was-Default-Hostname": "azuresdkforcpp.azurewebsites.net", + "X-Arr-Log-Id": "7e68e5d2-15bc-4f73-9424-ec19b5bd7d15", + "X-Client-Ip": "71.197.167.179", + "X-Client-Port": "51795", + "X-Original-Url": "/get", + "X-Site-Deployment-Id": "azuresdkforcpp", + "X-Waws-Unencoded-Url": "/get" + }, + "origin": "172.17.0.1, 71.197.167.179:51795", + "url": "http://azuresdkforcpp.azurewebsites.net/get" +} +* Connection #0 to host 127.0.0.1 left intact +``` + +If you attempt an unauthenticated connection to the server: + +```bash + curl -v http://azuresdkforcpp.azurewebsites.net/get -x http://127.0.0.1:3129/ +``` + +This should result in something like: + +```bash +* Trying 127.0.0.1:3129... +* Connected to 127.0.0.1 (127.0.0.1) port 3129 (#0) +> GET http://azuresdkforcpp.azurewebsites.net/get HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net +> User-Agent: curl/7.83.1 +> Accept: */* +> Proxy-Connection: Keep-Alive +> +* Mark bundle as not supporting multiuse +< HTTP/1.1 407 Proxy Authentication Required +< Server: squid/3.5.27 +< Mime-Version: 1.0 +< Date: Thu, 04 Aug 2022 19:19:52 GMT +< Content-Type: text/html;charset=utf-8 +< Content-Length: 3635 +< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 +< Vary: Accept-Language +< Content-Language: en +< Proxy-Authenticate: Basic realm="Squid proxy-caching web server" +< X-Cache: MISS from 65d2e3c7997a +< X-Cache-Lookup: NONE from 65d2e3c7997a:3129 +< Via: 1.1 65d2e3c7997a (squid/3.5.27) +< Connection: keep-alive +``` + +Similarly, if you attempt the wrong username/password combination: + +```bash + curl -v http://azuresdkforcpp.azurewebsites.net/get -x http://127.0.0.1:3129/ +``` + +you should see: + +```powershell +* Trying 127.0.0.1:3129... +* Connected to 127.0.0.1 (127.0.0.1) port 3129 (#0) +* Proxy auth using Basic with user 'userx' +> GET http://azuresdkforcpp.azurewebsites.net/get HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net +> Proxy-Authorization: Basic dXNlcng6cGFzc3dvcmQ= +> User-Agent: curl/7.83.1 +> Accept: */* +> Proxy-Connection: Keep-Alive +> +* Mark bundle as not supporting multiuse +< HTTP/1.1 407 Proxy Authentication Required +< Server: squid/3.5.27 +< Mime-Version: 1.0 +< Date: Thu, 04 Aug 2022 19:19:57 GMT +< Content-Type: text/html;charset=utf-8 +< Content-Length: 3737 +< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 +< Vary: Accept-Language +< Content-Language: en +* Authentication problem. Ignoring this. +< Proxy-Authenticate: Basic realm="Squid proxy-caching web server" +< X-Cache: MISS from 65d2e3c7997a +< X-Cache-Lookup: NONE from 65d2e3c7997a:3129 +< Via: 1.1 65d2e3c7997a (squid/3.5.27) +< Connection: keep-alive +``` + +Over HTTPS, the results are slightly different: +Correctly authenticated: + +Request: + +```powershell +curl -v https://azuresdkforcpp.azurewebsites.net/get -x http://127.0.0.1:3129/ -U user:password +``` + +Response: + +```powershell +* Trying 127.0.0.1:3129... +* Connected to 127.0.0.1 (127.0.0.1) port 3129 (#0) +* allocate connect buffer +* Establish HTTP proxy tunnel to azuresdkforcpp.azurewebsites.net:443 +* Proxy auth using Basic with user 'user' +> CONNECT azuresdkforcpp.azurewebsites.net:443 HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net:443 +> Proxy-Authorization: Basic dXNlcjpwYXNzd29yZA== +> User-Agent: curl/7.83.1 +> Proxy-Connection: Keep-Alive +> +< HTTP/1.1 200 Connection established +< +* Proxy replied 200 to CONNECT request +* CONNECT phase completed +* schannel: disabled automatic use of client certificate +* ALPN: offers http/1.1 +* ALPN: server accepted http/1.1 +> GET /get HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net +> User-Agent: curl/7.83.1 +> Accept: */* +> +* Mark bundle as not supporting multiuse +< HTTP/1.1 200 OK +< Content-Length: 917 +< Content-Type: application/json +< Date: Thu, 04 Aug 2022 20:16:16 GMT +< Server: gunicorn/19.9.0 +< Access-Control-Allow-Credentials: true +< Access-Control-Allow-Origin: * +< +{ + "args": {}, + "headers": { + "Accept": "*/*", + "Client-Ip": "71.197.167.179:52904", + "Disguised-Host": "azuresdkforcpp.azurewebsites.net", + "Host": "azuresdkforcpp.azurewebsites.net", + "Max-Forwards": "10", + "User-Agent": "curl/7.83.1", + "Was-Default-Hostname": "azuresdkforcpp.azurewebsites.net", + "X-Appservice-Proto": "https", + "X-Arr-Log-Id": "ca2264b0-ff29-43a6-8297-ef8952270fac", + "X-Arr-Ssl": "2048|256|CN=Microsoft Azure TLS Issuing CA 01, O=Microsoft Corporation, C=US|CN=*.azurewebsites.net, O=Microsoft Corporation, L=Redmond, S=WA, C=US", + "X-Client-Ip": "71.197.167.179", + "X-Client-Port": "52904", + "X-Forwarded-Tlsversion": "1.2", + "X-Original-Url": "/get", + "X-Site-Deployment-Id": "azuresdkforcpp", + "X-Waws-Unencoded-Url": "/get" + }, + "origin": "71.197.167.179:52904", + "url": "https://azuresdkforcpp.azurewebsites.net/get" +} +* Connection #0 to host 127.0.0.1 left intact +``` + +Unauthenticated: + +Request: + +```powershell +curl -v https://azuresdkforcpp.azurewebsites.net/get -x http://127.0.0.1:3129/ +``` + +Response: + +```bash +* Trying 127.0.0.1:3129... +* Connected to 127.0.0.1 (127.0.0.1) port 3129 (#0) +* allocate connect buffer +* Establish HTTP proxy tunnel to azuresdkforcpp.azurewebsites.net:443 +> CONNECT azuresdkforcpp.azurewebsites.net:443 HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net:443 +> User-Agent: curl/7.83.1 +> Proxy-Connection: Keep-Alive +> +< HTTP/1.1 407 Proxy Authentication Required +< Server: squid/3.5.27 +< Mime-Version: 1.0 +< Date: Thu, 04 Aug 2022 20:15:02 GMT +< Content-Type: text/html;charset=utf-8 +< Content-Length: 3616 +< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 +< Vary: Accept-Language +< Content-Language: en +< Proxy-Authenticate: Basic realm="Squid proxy-caching web server" +< X-Cache: MISS from 65d2e3c7997a +< X-Cache-Lookup: NONE from 65d2e3c7997a:3129 +< Via: 1.1 65d2e3c7997a (squid/3.5.27) +< Connection: keep-alive +< +* Ignore 3616 bytes of response-body +* Received HTTP code 407 from proxy after CONNECT +* CONNECT phase completed +* Closing connection 0 +curl: (56) Received HTTP code 407 from proxy after CONNECT +``` + +Invalid Password: + +```bash +curl -v https://azuresdkforcpp.azurewebsites.net/get -x http://127.0.0.1:3129/ -U user:passwordx +``` + +Response: + +```sh +* Trying 127.0.0.1:3129... +* Connected to 127.0.0.1 (127.0.0.1) port 3129 (#0) +* allocate connect buffer +* Establish HTTP proxy tunnel to azuresdkforcpp.azurewebsites.net:443 +* Proxy auth using Basic with user 'user' +> CONNECT azuresdkforcpp.azurewebsites.net:443 HTTP/1.1 +> Host: azuresdkforcpp.azurewebsites.net:443 +> Proxy-Authorization: Basic dXNlcjpwYXNzd29yZHg= +> User-Agent: curl/7.83.1 +> Proxy-Connection: Keep-Alive +> +< HTTP/1.1 407 Proxy Authentication Required +< Server: squid/3.5.27 +< Mime-Version: 1.0 +< Date: Thu, 04 Aug 2022 20:16:54 GMT +< Content-Type: text/html;charset=utf-8 +< Content-Length: 3718 +< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 +< Vary: Accept-Language +< Content-Language: en +< Proxy-Authenticate: Basic realm="Squid proxy-caching web server" +* Authentication problem. Ignoring this. +< X-Cache: MISS from 65d2e3c7997a +< X-Cache-Lookup: NONE from 65d2e3c7997a:3129 +< Via: 1.1 65d2e3c7997a (squid/3.5.27) +< Connection: keep-alive +< +* Received HTTP code 407 from proxy after CONNECT +* CONNECT phase completed +* Closing connection 0 +curl: (56) Received HTTP code 407 from proxy after CONNECT +``` + +#### WinHTTP access + +```powershell +Invoke-WebRequest -Uri http://azuresdkforcpp.azurewebsites.net/get -Proxy http://127.0.0.1:3129 -ProxyCredential user +``` + +HTTPS Connections: + +Using `InvokeWebRequest`, this time with the proxy: + +```powershell +Invoke-WebRequest -Uri https://azuresdkforcpp.azurewebsites.net/get -Proxy http://127.0.0.1:3129 -ProxyCredential user +``` + +you should get something like: + +```powershell +StatusCode : 200 +StatusDescription : OK +Content : { + "args": {}, + "headers": { + "Client-Ip": "71.197.167.179:52995", + "Disguised-Host": "azuresdkforcpp.azurewebsites.net", + "Host": "azuresdkforcpp.azurewebsites.net", + "Max-Forwards"... +RawContent : HTTP/1.1 200 OK + Date: Thu, 04 Aug 2022 20:19:13 GMT + Server: gunicorn/19.9.0 + Access-Control-Allow-Credentials: true + Access-Control-Allow-Origin: * + Content-Length: 967 + Content-Type: application/js� +Headers : {[Date, System.String[]], [Server, System.String[]], [Access-Control-Allow-Credentials, + System.String[]], [Access-Control-Allow-Origin, System.String[]]...} +Images : {} +InputFields : {} +Links : {} +RawContentLength : 967 +RelationLink : {} +``` + +For cases where authorization fails you should get something like: +Request: + +```powershell + Invoke-WebRequest -Uri http://azuresdkforcpp.azurewebsites.net/get -Proxy http://127.0.0.1:3129 -ProxyCredential userc +``` + +Response: + +```powershell +Invoke-WebRequest: +ERROR: Cache Access Denied +ERROR +Cache Access Denied. +The following error was encountered while trying to retrieve the URL: http://azuresdkforcpp.azurewebsites.net/get +Cache Access Denied. +Sorry, you are not currently allowed to request http://azuresdkforcpp.azurewebsites.net/get from this cache until you have authenticated yourself. +Please contact the cache administrator if you have difficulties authenticating yourself. + +Generated Thu, 04 Aug 2022 20:23:48 GMT by 65d2e3c7997a (squid/3.5.27) +``` + +And on HTTPS: +For cases where authorization fails you should get something like: +Request: + +```powershell + Invoke-WebRequest -Uri https://azuresdkforcpp.azurewebsites.net/get -Proxy http://127.0.0.1:3129 -ProxyCredential userc +``` + +Response: + +```powershell + +Invoke-WebRequest: +ERROR: Cache Access Denied +ERROR +Cache Access Denied. +The following error was encountered while trying to retrieve the URL: http://azuresdkforcpp.azurewebsites.net/get +Cache Access Denied. +Sorry, you are not currently allowed to request http://azuresdkforcpp.azurewebsites.net/get from this cache until you have authenticated yourself. +Please contact the cache administrator if you have difficulties authenticating yourself. + +Generated Thu, 04 Aug 2022 20:23:48 GMT by 65d2e3c7997a (squid/3.5.27) +``` + +Result in: + +```powershell +Invoke-WebRequest: The proxy tunnel request to proxy 'http://127.0.0.1:3129/' failed with status code '407'." +``` diff --git a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile new file mode 100644 index 0000000000..4bfef7bd1d --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile @@ -0,0 +1,30 @@ +#@# vim: set filetype=dockerfile: +# Code taken from: https://github.com/hinata/nginx-forward-proxy + +FROM ubuntu/squid +LABEL maintainer "Larry Osterman" + +ENV NGINX_VERSION 1.23.1 + +## +# dependent packages for docker build +## + +WORKDIR /tmp + +RUN apt-get -y update + +## +# application deployment +## + +WORKDIR / + +COPY ./squid.conf /etc/squid/squid.conf +COPY ./proxypasswd /etc/squid/passwords + +EXPOSE 3129 + +STOPSIGNAL SIGTERM + +ENTRYPOINT squid -f /etc/squid/squid.conf && sleep 10 && tail -f /var/log/squid/access.log diff --git a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/proxypasswd b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/proxypasswd new file mode 100644 index 0000000000..f9648a4a64 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/proxypasswd @@ -0,0 +1 @@ +user:$apr1$z0tE.mEW$6OXoAgyTD5vBkM5ON3R9h/ diff --git a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/squid.conf b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/squid.conf new file mode 100644 index 0000000000..829a14c093 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/squid.conf @@ -0,0 +1,7999 @@ +# WELCOME TO SQUID 3.5.27 +# ---------------------------- +# +# This is the documentation for the Squid configuration file. +# This documentation can also be found online at: +# http://www.squid-cache.org/Doc/config/ +# +# You may wish to look at the Squid home page and wiki for the +# FAQ and other documentation: +# http://www.squid-cache.org/ +# http://wiki.squid-cache.org/SquidFaq +# http://wiki.squid-cache.org/ConfigExamples +# +# This documentation shows what the defaults for various directives +# happen to be. If you don't need to change the default, you should +# leave the line out of your squid.conf in most cases. +# +# In some cases "none" refers to no default setting at all, +# while in other cases it refers to the value of the option +# - the comments for that keyword indicate if this is the case. +# + +# Configuration options can be included using the "include" directive. +# Include takes a list of files to include. Quoting and wildcards are +# supported. +# +# For example, +# +# include /path/to/included/file/squid.acl.config +# +# Includes can be nested up to a hard-coded depth of 16 levels. +# This arbitrary restriction is to prevent recursive include references +# from causing Squid entering an infinite loop whilst trying to load +# configuration files. +# +# Values with byte units +# +# Squid accepts size units on some size related directives. All +# such directives are documented with a default value displaying +# a unit. +# +# Units accepted by Squid are: +# bytes - byte +# KB - Kilobyte (1024 bytes) +# MB - Megabyte +# GB - Gigabyte +# +# Values with spaces, quotes, and other special characters +# +# Squid supports directive parameters with spaces, quotes, and other +# special characters. Surround such parameters with "double quotes". Use +# the configuration_includes_quoted_values directive to enable or +# disable that support. +# +# Squid supports reading configuration option parameters from external +# files using the syntax: +# parameters("/path/filename") +# For example: +# acl whitelist dstdomain parameters("/etc/squid/whitelist.txt") +# +# Conditional configuration +# +# If-statements can be used to make configuration directives +# depend on conditions: +# +# if +# ... regular configuration directives ... +# [else +# ... regular configuration directives ...] +# endif +# +# The else part is optional. The keywords "if", "else", and "endif" +# must be typed on their own lines, as if they were regular +# configuration directives. +# +# NOTE: An else-if condition is not supported. +# +# These individual conditions types are supported: +# +# true +# Always evaluates to true. +# false +# Always evaluates to false. +# = +# Equality comparison of two integer numbers. +# +# +# SMP-Related Macros +# +# The following SMP-related preprocessor macros can be used. +# +# ${process_name} expands to the current Squid process "name" +# (e.g., squid1, squid2, or cache1). +# +# ${process_number} expands to the current Squid process +# identifier, which is an integer number (e.g., 1, 2, 3) unique +# across all Squid processes of the current service instance. +# +# ${service_name} expands into the current Squid service instance +# name identifier which is provided by -n on the command line. +# + +# TAG: broken_vary_encoding +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: cache_vary +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: error_map +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: external_refresh_check +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: location_rewrite_program +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: refresh_stale_hit +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: hierarchy_stoplist +# Remove this line. Use always_direct or cache_peer_access ACLs instead if you need to prevent cache_peer use. +#Default: +# none + +# TAG: log_access +# Remove this line. Use acls with access_log directives to control access logging +#Default: +# none + +# TAG: log_icap +# Remove this line. Use acls with icap_log directives to control icap logging +#Default: +# none + +# TAG: ignore_ims_on_miss +# Remove this line. The HTTP/1.1 feature is now configured by 'cache_miss_revalidate'. +#Default: +# none + +# TAG: chunked_request_body_max_size +# Remove this line. Squid is now HTTP/1.1 compliant. +#Default: +# none + +# TAG: dns_v4_fallback +# Remove this line. Squid performs a 'Happy Eyeballs' algorithm, the 'fallback' algorithm is no longer relevant. +#Default: +# none + +# TAG: emulate_httpd_log +# Replace this with an access_log directive using the format 'common' or 'combined'. +#Default: +# none + +# TAG: forward_log +# Use a regular access.log with ACL limiting it to MISS events. +#Default: +# none + +# TAG: ftp_list_width +# Remove this line. Configure FTP page display using the CSS controls in errorpages.css instead. +#Default: +# none + +# TAG: ignore_expect_100 +# Remove this line. The HTTP/1.1 feature is now fully supported by default. +#Default: +# none + +# TAG: log_fqdn +# Remove this option from your config. To log FQDN use %>A in the log format. +#Default: +# none + +# TAG: log_ip_on_direct +# Remove this option from your config. To log server or peer names use % +##auth_param negotiate children 20 startup=0 idle=1 +##auth_param negotiate keep_alive on +## +##auth_param digest program +##auth_param digest children 20 startup=0 idle=1 +##auth_param digest realm Squid proxy-caching web server +##auth_param digest nonce_garbage_interval 5 minutes +##auth_param digest nonce_max_duration 30 minutes +##auth_param digest nonce_max_count 50 +## +##auth_param ntlm program +##auth_param ntlm children 20 startup=0 idle=1 +##auth_param ntlm keep_alive on +## +auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords +auth_param basic children 5 startup=5 idle=1 +auth_param basic realm Squid proxy-caching web server +auth_param basic credentialsttl 2 hours +#Default: +# none + +# TAG: authenticate_cache_garbage_interval +# The time period between garbage collection across the username cache. +# This is a trade-off between memory utilization (long intervals - say +# 2 days) and CPU (short intervals - say 1 minute). Only change if you +# have good reason to. +#Default: +# authenticate_cache_garbage_interval 1 hour + +# TAG: authenticate_ttl +# The time a user & their credentials stay in the logged in +# user cache since their last request. When the garbage +# interval passes, all user credentials that have passed their +# TTL are removed from memory. +#Default: +# authenticate_ttl 1 hour + +# TAG: authenticate_ip_ttl +# If you use proxy authentication and the 'max_user_ip' ACL, +# this directive controls how long Squid remembers the IP +# addresses associated with each user. Use a small value +# (e.g., 60 seconds) if your users might change addresses +# quickly, as is the case with dialup. You might be safe +# using a larger value (e.g., 2 hours) in a corporate LAN +# environment with relatively static address assignments. +#Default: +# authenticate_ip_ttl 1 second + +# ACCESS CONTROLS +# ----------------------------------------------------------------------------- + +# TAG: external_acl_type +# This option defines external acl classes using a helper program +# to look up the status +# +# external_acl_type name [options] FORMAT.. /path/to/helper [helper arguments..] +# +# Options: +# +# ttl=n TTL in seconds for cached results (defaults to 3600 +# for 1 hour) +# +# negative_ttl=n +# TTL for cached negative lookups (default same +# as ttl) +# +# grace=n Percentage remaining of TTL where a refresh of a +# cached entry should be initiated without needing to +# wait for a new reply. (default is for no grace period) +# +# cache=n The maximum number of entries in the result cache. The +# default limit is 262144 entries. Each cache entry usually +# consumes at least 256 bytes. Squid currently does not remove +# expired cache entries until the limit is reached, so a proxy +# will sooner or later reach the limit. The expanded FORMAT +# value is used as the cache key, so if the details in FORMAT +# are highly variable, a larger cache may be needed to produce +# reduction in helper load. +# +# children-max=n +# Maximum number of acl helper processes spawned to service +# external acl lookups of this type. (default 5) +# +# children-startup=n +# Minimum number of acl helper processes to spawn during +# startup and reconfigure to service external acl lookups +# of this type. (default 0) +# +# children-idle=n +# Number of acl helper processes to keep ahead of traffic +# loads. Squid will spawn this many at once whenever load +# rises above the capabilities of existing processes. +# Up to the value of children-max. (default 1) +# +# concurrency=n concurrency level per process. Only used with helpers +# capable of processing more than one query at a time. +# +# protocol=2.5 Compatibility mode for Squid-2.5 external acl helpers. +# +# ipv4 / ipv6 IP protocol used to communicate with this helper. +# The default is to auto-detect IPv6 and use it when available. +# +# +# FORMAT specifications +# +# %LOGIN Authenticated user login name +# %un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul or %LOGIN +# - user name sent by an external ACL, like %EXT_USER +# - SSL client name, like %us in logformat +# - ident user name, like %ui in logformat +# %EXT_USER Username from previous external acl +# %EXT_LOG Log details from previous external acl +# %EXT_TAG Tag from previous external acl +# %IDENT Ident user name +# %SRC Client IP +# %SRCPORT Client source port +# %URI Requested URI +# %DST Requested host +# %PROTO Requested URL scheme +# %PORT Requested port +# %PATH Requested URL path +# %METHOD Request method +# %MYADDR Squid interface address +# %MYPORT Squid http_port number +# %PATH Requested URL-path (including query-string if any) +# %USER_CERT SSL User certificate in PEM format +# %USER_CERTCHAIN SSL User certificate chain in PEM format +# %USER_CERT_xx SSL User certificate subject attribute xx +# %USER_CA_CERT_xx SSL User certificate issuer attribute xx +# %ssl::>sni SSL client SNI sent to Squid +# %ssl::{Header} HTTP request header "Header" +# %>{Hdr:member} +# HTTP request header "Hdr" list member "member" +# %>{Hdr:;member} +# HTTP request header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %<{Header} HTTP reply header "Header" +# %<{Hdr:member} +# HTTP reply header "Hdr" list member "member" +# %<{Hdr:;member} +# HTTP reply header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %ACL The name of the ACL being tested. +# %DATA The ACL arguments. If not used then any arguments +# is automatically added at the end of the line +# sent to the helper. +# NOTE: this will encode the arguments as one token, +# whereas the default will pass each separately. +# +# %% The percent sign. Useful for helpers which need +# an unchanging input format. +# +# +# General request syntax: +# +# [channel-ID] FORMAT-values [acl-values ...] +# +# +# FORMAT-values consists of transaction details expanded with +# whitespace separation per the config file FORMAT specification +# using the FORMAT macros listed above. +# +# acl-values consists of any string specified in the referencing +# config 'acl ... external' line. see the "acl external" directive. +# +# Request values sent to the helper are URL escaped to protect +# each value in requests against whitespaces. +# +# If using protocol=2.5 then the request sent to the helper is not +# URL escaped to protect against whitespace. +# +# NOTE: protocol=3.0 is deprecated as no longer necessary. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# +# The helper receives lines expanded per the above format specification +# and for each input line returns 1 line starting with OK/ERR/BH result +# code and optionally followed by additional keywords with more details. +# +# +# General result syntax: +# +# [channel-ID] result keyword=value ... +# +# Result consists of one of the codes: +# +# OK +# the ACL test produced a match. +# +# ERR +# the ACL test does not produce a match. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. +# +# The meaning of 'a match' is determined by your squid.conf +# access control configuration. See the Squid wiki for details. +# +# Defined keywords: +# +# user= The users name (login) +# +# password= The users password (for login= cache_peer option) +# +# message= Message describing the reason for this response. +# Available as %o in error pages. +# Useful on (ERR and BH results). +# +# tag= Apply a tag to a request. Only sets a tag once, +# does not alter existing tags. +# +# log= String to be logged in access.log. Available as +# %ea in logformat specifications. +# +# clt_conn_tag= Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation +# for this kv-pair. +# +# Any keywords may be sent on any response whether OK, ERR or BH. +# +# All response keyword values need to be a single token with URL +# escaping, or enclosed in double quotes (") and escaped using \ on +# any double quotes or \ characters within the value. The wrapping +# double quotes are removed before the value is interpreted by Squid. +# \r and \n are also replace by CR and LF. +# +# Some example key values: +# +# user=John%20Smith +# user="John Smith" +# user="J. \"Bob\" Smith" +#Default: +# none + +# TAG: acl +# Defining an Access List +# +# Every access list definition must begin with an aclname and acltype, +# followed by either type-specific arguments or a quoted filename that +# they are read from. +# +# acl aclname acltype argument ... +# acl aclname acltype "file" ... +# +# When using "file", the file should contain one item per line. +# +# Some acl types supports options which changes their default behaviour. +# The available options are: +# +# -i,+i By default, regular expressions are CASE-SENSITIVE. To make them +# case-insensitive, use the -i option. To return case-sensitive +# use the +i option between patterns, or make a new ACL line +# without -i. +# +# -n Disable lookups and address type conversions. If lookup or +# conversion is required because the parameter type (IP or +# domain name) does not match the message address type (domain +# name or IP), then the ACL would immediately declare a mismatch +# without any warnings or lookups. +# +# -- Used to stop processing all options, in the case the first acl +# value has '-' character as first character (for example the '-' +# is a valid domain name) +# +# Some acl types require suspending the current request in order +# to access some external data source. +# Those which do are marked with the tag [slow], those which +# don't are marked as [fast]. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl +# for further information +# +# ***** ACL TYPES AVAILABLE ***** +# +# acl aclname src ip-address/mask ... # clients IP address [fast] +# acl aclname src addr1-addr2/mask ... # range of addresses [fast] +# acl aclname dst [-n] ip-address/mask ... # URL host's IP address [slow] +# acl aclname localip ip-address/mask ... # IP address the client connected to [fast] +# +# acl aclname arp mac-address ... (xx:xx:xx:xx:xx:xx notation) +# # [fast] +# # The 'arp' ACL code is not portable to all operating systems. +# # It works on Linux, Solaris, Windows, FreeBSD, and some other +# # BSD variants. +# # +# # NOTE: Squid can only determine the MAC/EUI address for IPv4 +# # clients that are on the same subnet. If the client is on a +# # different subnet, then Squid cannot find out its address. +# # +# # NOTE 2: IPv6 protocol does not contain ARP. MAC/EUI is either +# # encoded directly in the IPv6 address or not available. +# +# acl aclname srcdomain .foo.com ... +# # reverse lookup, from client IP [slow] +# acl aclname dstdomain [-n] .foo.com ... +# # Destination server from URL [fast] +# acl aclname srcdom_regex [-i] \.foo\.com ... +# # regex matching client name [slow] +# acl aclname dstdom_regex [-n] [-i] \.foo\.com ... +# # regex matching server [fast] +# # +# # For dstdomain and dstdom_regex a reverse lookup is tried if a IP +# # based URL is used and no match is found. The name "none" is used +# # if the reverse lookup fails. +# +# acl aclname src_as number ... +# acl aclname dst_as number ... +# # [fast] +# # Except for access control, AS numbers can be used for +# # routing of requests to specific caches. Here's an +# # example for routing all requests for AS#1241 and only +# # those to mycache.mydomain.net: +# # acl asexample dst_as 1241 +# # cache_peer_access mycache.mydomain.net allow asexample +# # cache_peer_access mycache_mydomain.net deny all +# +# acl aclname peername myPeer ... +# # [fast] +# # match against a named cache_peer entry +# # set unique name= on cache_peer lines for reliable use. +# +# acl aclname time [day-abbrevs] [h1:m1-h2:m2] +# # [fast] +# # day-abbrevs: +# # S - Sunday +# # M - Monday +# # T - Tuesday +# # W - Wednesday +# # H - Thursday +# # F - Friday +# # A - Saturday +# # h1:m1 must be less than h2:m2 +# +# acl aclname url_regex [-i] ^http:// ... +# # regex matching on whole URL [fast] +# acl aclname urllogin [-i] [^a-zA-Z0-9] ... +# # regex matching on URL login field +# acl aclname urlpath_regex [-i] \.gif$ ... +# # regex matching on URL path [fast] +# +# acl aclname port 80 70 21 0-1024... # destination TCP port [fast] +# # ranges are alloed +# acl aclname localport 3128 ... # TCP port the client connected to [fast] +# # NP: for interception mode this is usually '80' +# +# acl aclname myportname 3128 ... # *_port name [fast] +# +# acl aclname proto HTTP FTP ... # request protocol [fast] +# +# acl aclname method GET POST ... # HTTP request method [fast] +# +# acl aclname http_status 200 301 500- 400-403 ... +# # status code in reply [fast] +# +# acl aclname browser [-i] regexp ... +# # pattern match on User-Agent header (see also req_header below) [fast] +# +# acl aclname referer_regex [-i] regexp ... +# # pattern match on Referer header [fast] +# # Referer is highly unreliable, so use with care +# +# acl aclname ident username ... +# acl aclname ident_regex [-i] pattern ... +# # string match on ident output [slow] +# # use REQUIRED to accept any non-null ident. +# +# acl aclname proxy_auth [-i] username ... +# acl aclname proxy_auth_regex [-i] pattern ... +# # perform http authentication challenge to the client and match against +# # supplied credentials [slow] +# # +# # takes a list of allowed usernames. +# # use REQUIRED to accept any valid username. +# # +# # Will use proxy authentication in forward-proxy scenarios, and plain +# # http authenticaiton in reverse-proxy scenarios +# # +# # NOTE: when a Proxy-Authentication header is sent but it is not +# # needed during ACL checking the username is NOT logged +# # in access.log. +# # +# # NOTE: proxy_auth requires a EXTERNAL authentication program +# # to check username/password combinations (see +# # auth_param directive). +# # +# # NOTE: proxy_auth can't be used in a transparent/intercepting proxy +# # as the browser needs to be configured for using a proxy in order +# # to respond to proxy authentication. +# +# acl aclname snmp_community string ... +# # A community string to limit access to your SNMP Agent [fast] +# # Example: +# # +# # acl snmppublic snmp_community public +# +# acl aclname maxconn number +# # This will be matched when the client's IP address has +# # more than TCP connections established. [fast] +# # NOTE: This only measures direct TCP links so X-Forwarded-For +# # indirect clients are not counted. +# +# acl aclname max_user_ip [-s] number +# # This will be matched when the user attempts to log in from more +# # than different ip addresses. The authenticate_ip_ttl +# # parameter controls the timeout on the ip entries. [fast] +# # If -s is specified the limit is strict, denying browsing +# # from any further IP addresses until the ttl has expired. Without +# # -s Squid will just annoy the user by "randomly" denying requests. +# # (the counter is reset each time the limit is reached and a +# # request is denied) +# # NOTE: in acceleration mode or where there is mesh of child proxies, +# # clients may appear to come from multiple addresses if they are +# # going through proxy farms, so a limit of 1 may cause user problems. +# +# acl aclname random probability +# # Pseudo-randomly match requests. Based on the probability given. +# # Probability may be written as a decimal (0.333), fraction (1/3) +# # or ratio of matches:non-matches (3:5). +# +# acl aclname req_mime_type [-i] mime-type ... +# # regex match against the mime type of the request generated +# # by the client. Can be used to detect file upload or some +# # types HTTP tunneling requests [fast] +# # NOTE: This does NOT match the reply. You cannot use this +# # to match the returned file type. +# +# acl aclname req_header header-name [-i] any\.regex\.here +# # regex match against any of the known request headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACL [fast] +# +# acl aclname rep_mime_type [-i] mime-type ... +# # regex match against the mime type of the reply received by +# # squid. Can be used to detect file download or some +# # types HTTP tunneling requests. [fast] +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname rep_header header-name [-i] any\.regex\.here +# # regex match against any of the known reply headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACLs [fast] +# +# acl aclname external class_name [arguments...] +# # external ACL lookup via a helper class defined by the +# # external_acl_type directive [slow] +# +# acl aclname user_cert attribute values... +# # match against attributes in a user SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ca_cert attribute values... +# # match against attributes a users issuing CA SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ext_user username ... +# acl aclname ext_user_regex [-i] pattern ... +# # string match on username returned by external acl helper [slow] +# # use REQUIRED to accept any non-null user name. +# +# acl aclname tag tagvalue ... +# # string match on tag returned by external acl helper [fast] +# # DEPRECATED. Only the first tag will match with this ACL. +# # Use the 'note' ACL instead for handling multiple tag values. +# +# acl aclname hier_code codename ... +# # string match against squid hierarchy code(s); [fast] +# # e.g., DIRECT, PARENT_HIT, NONE, etc. +# # +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname note name [value ...] +# # match transaction annotation [fast] +# # Without values, matches any annotation with a given name. +# # With value(s), matches any annotation with a given name that +# # also has one of the given values. +# # Names and values are compared using a string equality test. +# # Annotation sources include note and adaptation_meta directives +# # as well as helper and eCAP responses. +# +# acl aclname adaptation_service service ... +# # Matches the name of any icap_service, ecap_service, +# # adaptation_service_set, or adaptation_service_chain that Squid +# # has used (or attempted to use) for the master transaction. +# # This ACL must be defined after the corresponding adaptation +# # service is named in squid.conf. This ACL is usable with +# # adaptation_meta because it starts matching immediately after +# # the service has been selected for adaptation. +# +# acl aclname any-of acl1 acl2 ... +# # match any one of the acls [fast or slow] +# # The first matching ACL stops further ACL evaluation. +# # +# # ACLs from multiple any-of lines with the same name are ORed. +# # For example, A = (a1 or a2) or (a3 or a4) can be written as +# # acl A any-of a1 a2 +# # acl A any-of a3 a4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# acl aclname all-of acl1 acl2 ... +# # match all of the acls [fast or slow] +# # The first mismatching ACL stops further ACL evaluation. +# # +# # ACLs from multiple all-of lines with the same name are ORed. +# # For example, B = (b1 and b2) or (b3 and b4) can be written as +# # acl B all-of b1 b2 +# # acl B all-of b3 b4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# Examples: +# acl macaddress arp 09:00:2b:23:45:67 +# acl myexample dst_as 1241 +# acl password proxy_auth REQUIRED +# acl fileupload req_mime_type -i ^multipart/form-data$ +# acl javascript rep_mime_type -i ^application/x-javascript$ +# +#Default: +# ACLs all, manager, localhost, and to_localhost are predefined. +# +# +# Recommended minimum configuration: +# + +# Example rule allowing access from your local networks. +# Adapt to list your (internal) IP networks from where browsing +# should be allowed +acl localnet src 10.0.0.0/8 # RFC1918 possible internal network +acl localnet src 172.16.0.0/12 # RFC1918 possible internal network +acl localnet src 192.168.0.0/16 # RFC1918 possible internal network +acl localnet src fc00::/7 # RFC 4193 local private network range +acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines +acl localnet src 2001:4898::/48 + + + +acl SSL_ports port 443 +acl Safe_ports port 80 # http +acl Safe_ports port 21 # ftp +acl Safe_ports port 443 # https +acl Safe_ports port 70 # gopher +acl Safe_ports port 210 # wais +acl Safe_ports port 1025-65535 # unregistered ports +acl Safe_ports port 280 # http-mgmt +acl Safe_ports port 488 # gss-http +acl Safe_ports port 591 # filemaker +acl Safe_ports port 777 # multiling http +acl CONNECT method CONNECT +# Enable blocking all websites other than azuresdkforcpp.azurewebsites.net. +acl cpptestserver dstdomain azuresdkforcpp.azurewebsites.net + +# TAG: proxy_protocol_access +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address using PROXY protocol. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# This directive is solely for validating new PROXY protocol +# connections received from a port flagged with require-proxy-header. +# It is checked only once after TCP connection setup. +# +# A deny match results in TCP connection closure. +# +# An allow match is required for Squid to permit the corresponding +# TCP connection, before Squid even looks for HTTP request headers. +# If there is an allow match, Squid starts using PROXY header information +# to determine the source address of the connection for all future ACL +# checks, logging, etc. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# all TCP connections to ports with require-proxy-header will be denied + +# TAG: follow_x_forwarded_for +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# PROXY protocol connections are controlled by the proxy_protocol_access +# directive which is checked before this. +# +# If a request reaches us from a source that is allowed by this +# directive, then we trust the information it provides regarding +# the IP of the client it received from (if any). +# +# For the purpose of ACLs used in this directive the src ACL type always +# matches the address we are testing and srcdomain matches its rDNS. +# +# On each HTTP request Squid checks for X-Forwarded-For header fields. +# If found the header values are iterated in reverse order and an allow +# match is required for Squid to continue on to the next value. +# The verification ends when a value receives a deny match, cannot be +# tested, or there are no more values to test. +# NOTE: Squid does not yet follow the Forwarded HTTP header. +# +# The end result of this process is an IP address that we will +# refer to as the indirect client address. This address may +# be treated as the client address for access control, ICAP, delay +# pools and logging, depending on the acl_uses_indirect_client, +# icap_uses_indirect_client, delay_pool_uses_indirect_client, +# log_uses_indirect_client and tproxy_uses_indirect_client options. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# For example: +# +# acl localhost src 127.0.0.1 +# acl my_other_proxy srcdomain .proxy.example.com +# follow_x_forwarded_for allow localhost +# follow_x_forwarded_for allow my_other_proxy +#Default: +# X-Forwarded-For header will be ignored. + +# TAG: acl_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in acl matching. +# +# NOTE: maxconn ACL considers direct TCP links and indirect +# clients will always have zero. So no match. +#Default: +# acl_uses_indirect_client on + +# TAG: delay_pool_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in delay pools. +#Default: +# delay_pool_uses_indirect_client on + +# TAG: log_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in the access log. +#Default: +# log_uses_indirect_client on + +# TAG: tproxy_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address when spoofing the outgoing client. +# +# This has no effect on requests arriving in non-tproxy +# mode ports. +# +# SECURITY WARNING: Usage of this option is dangerous +# and should not be used trivially. Correct configuration +# of follow_x_forwarded_for with a limited set of trusted +# sources is required to prevent abuse of your proxy. +#Default: +# tproxy_uses_indirect_client off + +# TAG: spoof_client_ip +# Control client IP address spoofing of TPROXY traffic based on +# defined access lists. +# +# spoof_client_ip allow|deny [!]aclname ... +# +# If there are no "spoof_client_ip" lines present, the default +# is to "allow" spoofing of any suitable request. +# +# Note that the cache_peer "no-tproxy" option overrides this ACL. +# +# This clause supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow spoofing on all TPROXY traffic. + +# TAG: http_access +# Allowing or Denying access based on defined access lists +# +# To allow or deny a message received on an HTTP, HTTPS, or FTP port: +# http_access allow|deny [!]aclname ... +# +# NOTE on default values: +# +# If there are no "access" lines present, the default is to deny +# the request. +# +# If none of the "access" lines cause a match, the default is the +# opposite of the last line in the list. If the last line was +# deny, the default is allow. Conversely, if the last line +# is allow, the default will be deny. For these reasons, it is a +# good idea to have an "deny all" entry at the end of your access +# lists to avoid potential confusion. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Default: +# Deny, unless rules exist in squid.conf. +# + +# +# Recommended minimum Access Permission configuration: +# +# Deny requests to certain unsafe ports +http_access deny !Safe_ports + +# Deny CONNECT to other than secure SSL ports +http_access deny CONNECT !SSL_ports + +# Only allow cachemgr access from localhost +http_access allow localhost manager +http_access deny manager + +#auth_param negotiate program /usr/lib/squid/negotiate_wrapper_auth --ntlm /usr/bin/ntlm_auth --helper-protocol=gss-spnego --kerberos /usr/lib/squid/negotiate_kerberos_auth +# +#auth_param negotiate children 30 startup=2 idle=1 +#auth_param negotiate keep_alive on + +acl AuthUsers proxy_auth REQUIRED +http_access allow AuthUsers + +# We strongly recommend the following be uncommented to protect innocent +# web applications running on the proxy server who think the only +# one who can access services on "localhost" is a local user +#http_access deny to_localhost + +# +# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS +# + +# Deny access to all servers that aren't the CPP team's test server. +http_access deny !cpptestserver + +# Example rule allowing access from your local networks. +# Adapt localnet in the ACL section to list your (internal) IP networks +# from where browsing should be allowed +http_access allow localnet +http_access allow localhost + +# Allow all access to the proxy. +http_access allow all + +# And finally deny all other access to this proxy +http_access deny all + +# TAG: adapted_http_access +# Allowing or Denying access based on defined access lists +# +# Essentially identical to http_access, but runs after redirectors +# and ICAP/eCAP adaptation. Allowing access control based on their +# output. +# +# If not set then only http_access is used. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: http_reply_access +# Allow replies to client requests. This is complementary to http_access. +# +# http_reply_access allow|deny [!] aclname ... +# +# NOTE: if there are no access lines present, the default is to allow +# all replies. +# +# If none of the access lines cause a match the opposite of the +# last line will apply. Thus it is good practice to end the rules +# with an "allow all" or "deny all" entry. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: icp_access +# Allowing or Denying access to the ICP port based on defined +# access lists +# +# icp_access allow|deny [!]aclname ... +# +# NOTE: The default if no icp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using ICP. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow ICP queries from local networks only +##icp_access allow localnet +##icp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_access +# Allowing or Denying access to the HTCP port based on defined +# access lists +# +# htcp_access allow|deny [!]aclname ... +# +# See also htcp_clr_access for details on access control for +# cache purge (CLR) HTCP messages. +# +# NOTE: The default if no htcp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using the htcp option. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP queries from local networks only +##htcp_access allow localnet +##htcp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_clr_access +# Allowing or Denying access to purge content using HTCP based +# on defined access lists. +# See htcp_access for details on general HTCP access control. +# +# htcp_clr_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP CLR requests from trusted peers +#acl htcp_clr_peer src 192.0.2.2 2001:DB8::2 +#htcp_clr_access allow htcp_clr_peer +#htcp_clr_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: miss_access +# Determines whether network access is permitted when satisfying a request. +# +# For example; +# to force your neighbors to use you as a sibling instead of +# a parent. +# +# acl localclients src 192.0.2.0/24 2001:DB8::a:0/64 +# miss_access deny !localclients +# miss_access allow all +# +# This means only your local clients are allowed to fetch relayed/MISS +# replies from the network and all other clients can only fetch cached +# objects (HITs). +# +# The default for this setting allows all clients who passed the +# http_access rules to relay via this proxy. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: ident_lookup_access +# A list of ACL elements which, if matched, cause an ident +# (RFC 931) lookup to be performed for this request. For +# example, you might choose to always perform ident lookups +# for your main multi-user Unix boxes, but not for your Macs +# and PCs. By default, ident lookups are not performed for +# any requests. +# +# To enable ident lookups for specific client addresses, you +# can follow this example: +# +# acl ident_aware_hosts src 198.168.1.0/24 +# ident_lookup_access allow ident_aware_hosts +# ident_lookup_access deny all +# +# Only src type ACL checks are fully supported. A srcdomain +# ACL might work at times, but it will not always provide +# the correct result. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Unless rules exist in squid.conf, IDENT is not fetched. + +# TAG: reply_body_max_size size [acl acl...] +# This option specifies the maximum size of a reply body. It can be +# used to prevent users from downloading very large files, such as +# MP3's and movies. When the reply headers are received, the +# reply_body_max_size lines are processed, and the first line where +# all (if any) listed ACLs are true is used as the maximum body size +# for this reply. +# +# This size is checked twice. First when we get the reply headers, +# we check the content-length value. If the content length value exists +# and is larger than the allowed size, the request is denied and the +# user receives an error message that says "the request or reply +# is too large." If there is no content-length, and the reply +# size exceeds this limit, the client's connection is just closed +# and they will receive a partial reply. +# +# WARNING: downstream caches probably can not detect a partial reply +# if there is no content-length header, so they will cache +# partial responses and give them out as hits. You should NOT +# use this option if you have downstream caches. +# +# WARNING: A maximum size smaller than the size of squid's error messages +# will cause an infinite loop and crash squid. Ensure that the smallest +# non-zero value you use is greater that the maximum header size plus +# the size of your largest error page. +# +# If you set this parameter none (the default), there will be +# no limit imposed. +# +# Configuration Format is: +# reply_body_max_size SIZE UNITS [acl ...] +# ie. +# reply_body_max_size 10 MB +# +#Default: +# No limit is applied. + +# NETWORK OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: http_port +# Usage: port [mode] [options] +# hostname:port [mode] [options] +# 1.2.3.4:port [mode] [options] +# +# The socket addresses where Squid will listen for HTTP client +# requests. You may specify multiple socket addresses. +# There are three forms: port alone, hostname with port, and +# IP address with port. If you specify a hostname or IP +# address, Squid binds the socket to that specific +# address. Most likely, you do not need to bind to a specific +# address, so you can use the port number alone. +# +# If you are running Squid in accelerator mode, you +# probably want to listen on port 80 also, or instead. +# +# The -a command line option may be used to specify additional +# port(s) where Squid listens for proxy request. Such ports will +# be plain proxy ports with no options. +# +# You may specify multiple socket addresses on multiple lines. +# +# Modes: +# +# intercept Support for IP-Layer NAT interception delivering +# traffic to this Squid port. +# NP: disables authentication on the port. +# +# tproxy Support Linux TPROXY (or BSD divert-to) with spoofing +# of outgoing connections using the client IP address. +# NP: disables authentication on the port. +# +# accel Accelerator / reverse proxy mode +# +# ssl-bump For each CONNECT request allowed by ssl_bump ACLs, +# establish secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# The ssl_bump option is required to fully enable +# bumping of CONNECT requests. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# Accelerator Mode Options: +# +# defaultsite=domainname +# What to use for the Host: header if it is not present +# in a request. Determines what site (not origin server) +# accelerators should consider the default. +# +# no-vhost Disable using HTTP/1.1 Host header for virtual domain support. +# +# protocol= Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to HTTP/1.1 for http_port and +# HTTPS/1.1 for https_port. +# When an unsupported value is configured Squid will +# produce a FATAL error. +# Values: HTTP or HTTP/1.1, HTTPS or HTTPS/1.1 +# +# vport Virtual host port support. Using the http_port number +# instead of the port passed on Host: headers. +# +# vport=NN Virtual host port support. Using the specified port +# number instead of the port passed on Host: headers. +# +# act-as-origin +# Act as if this Squid is the origin server. +# This currently means generate new Date: and Expires: +# headers on HIT instead of adding Age:. +# +# ignore-cc Ignore request Cache-Control headers. +# +# WARNING: This option violates HTTP specifications if +# used in non-accelerator setups. +# +# allow-direct Allow direct forwarding in accelerator mode. Normally +# accelerated requests are denied direct forwarding as if +# never_direct was used. +# +# WARNING: this option opens accelerator mode to security +# vulnerabilities usually only affecting in interception +# mode. Make sure to protect forwarding with suitable +# http_access rules when using this. +# +# +# SSL Bump Mode Options: +# In addition to these options ssl-bump requires TLS/SSL options. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped CONNECT requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is a CA certificate lifetime of the generated +# certificate equals lifetime of the CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# TLS / SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +# +# cipher= Colon separated list of supported ciphers. +# NOTE: some ciphers such as EDH ciphers depend on +# additional settings. If those settings are +# omitted the ciphers may be silently ignored +# by the OpenSSL library. +# +# options= Various SSL implementation options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# NO_TICKET Disables TLS tickets extension +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# See OpenSSL SSL_CTX_set_options documentation for a +# complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# See OpenSSL documentation for details on how to create the +# DH parameter file. Supported curves for ECDH can be listed +# using the "openssl ecparam -list_curves" command. +# WARNING: EDH and EECDH ciphers will be silently disabled if +# this option is not set. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# Other Options: +# +# connection-auth[=on|off] +# use connection-auth=off to tell Squid to prevent +# forwarding Microsoft connection oriented authentication +# (NTLM, Negotiate and Kerberos) +# +# disable-pmtu-discovery= +# Control Path-MTU discovery usage: +# off lets OS decide on what to do (default). +# transparent disable PMTU discovery when transparent +# support is enabled. +# always disable always PMTU discovery. +# +# In many setups of transparently intercepting proxies +# Path-MTU discovery can not work on traffic towards the +# clients. This is the case when the intercepting device +# does not fully track connections and fails to forward +# ICMP must fragment messages to the cache server. If you +# have such setup and experience that certain clients +# sporadically hang or never complete requests set +# disable-pmtu-discovery option to 'transparent'. +# +# name= Specifies a internal name for the port. Defaults to +# the port specification (port or addr:port) +# +# tcpkeepalive[=idle,interval,timeout] +# Enable TCP keepalive probes of idle connections. +# In seconds; idle is the initial time before TCP starts +# probing the connection, interval how often to probe, and +# timeout the time before giving up. +# +# require-proxy-header +# Require PROXY protocol version 1 or 2 connections. +# The proxy_protocol_access is required to whitelist +# downstream proxies which can be trusted. +# +# If you run Squid on a dual-homed machine with an internal +# and an external interface we recommend you to specify the +# internal address:port in http_port. This way Squid will only be +# visible on the internal address. +# +# + +# Squid normally listens to port 3128 +http_port 3129 + +# TAG: https_port +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Usage: [ip:]port cert=certificate.pem [key=key.pem] [mode] [options...] +# +# The socket address where Squid will listen for client requests made +# over TLS or SSL connections. Commonly referred to as HTTPS. +# +# This is most useful for situations where you are running squid in +# accelerator mode and you want to do the SSL work at the accelerator level. +# +# You may specify multiple socket addresses on multiple lines, +# each with their own SSL certificate and/or options. +# +# Modes: +# +# accel Accelerator / reverse proxy mode +# +# intercept Support for IP-Layer interception of +# outgoing requests without browser settings. +# NP: disables authentication and IPv6 on the port. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# ssl-bump For each intercepted connection allowed by ssl_bump +# ACLs, establish a secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# An "ssl_bump server-first" match is required to +# fully enable bumping of intercepted SSL connections. +# +# Requires tproxy or intercept. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# See http_port for a list of generic options +# +# +# SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1 only +# +# cipher= Colon separated list of supported ciphers. +# +# options= Various SSL engine options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1 +# +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# See src/ssl_support.c or OpenSSL SSL_CTX_set_options +# documentation for a complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped SSL requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is CA certificate life time of generated +# certificate equals lifetime of CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# See http_port for a list of available options. +#Default: +# none + +# TAG: ftp_port +# Enables Native FTP proxy by specifying the socket address where Squid +# listens for FTP client requests. See http_port directive for various +# ways to specify the listening address and mode. +# +# Usage: ftp_port address [mode] [options] +# +# WARNING: This is a new, experimental, complex feature that has seen +# limited production exposure. Some Squid modules (e.g., caching) do not +# currently work with native FTP proxying, and many features have not +# even been tested for compatibility. Test well before deploying! +# +# Native FTP proxying differs substantially from proxying HTTP requests +# with ftp:// URIs because Squid works as an FTP server and receives +# actual FTP commands (rather than HTTP requests with FTP URLs). +# +# Native FTP commands accepted at ftp_port are internally converted or +# wrapped into HTTP-like messages. The same happens to Native FTP +# responses received from FTP origin servers. Those HTTP-like messages +# are shoveled through regular access control and adaptation layers +# between the FTP client and the FTP origin server. This allows Squid to +# examine, adapt, block, and log FTP exchanges. Squid reuses most HTTP +# mechanisms when shoveling wrapped FTP messages. For example, +# http_access and adaptation_access directives are used. +# +# Modes: +# +# intercept Same as http_port intercept. The FTP origin address is +# determined based on the intended destination of the +# intercepted connection. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# By default (i.e., without an explicit mode option), Squid extracts the +# FTP origin address from the login@origin parameter of the FTP USER +# command. Many popular FTP clients support such native FTP proxying. +# +# Options: +# +# name=token Specifies an internal name for the port. Defaults to +# the port address. Usable with myportname ACL. +# +# ftp-track-dirs +# Enables tracking of FTP directories by injecting extra +# PWD commands and adjusting Request-URI (in wrapping +# HTTP requests) to reflect the current FTP server +# directory. Tracking is disabled by default. +# +# protocol=FTP Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to FTP. No other accepted +# values have been tested with. An unsupported value +# results in a FATAL error. Accepted values are FTP, +# HTTP (or HTTP/1.1), and HTTPS (or HTTPS/1.1). +# +# Other http_port modes and options that are not specific to HTTP and +# HTTPS may also work. +#Default: +# none + +# TAG: tcp_outgoing_tos +# Allows you to select a TOS/Diffserv value for packets outgoing +# on the server side, based on an ACL. +# +# tcp_outgoing_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_tos 0x00 normal_service_net +# tcp_outgoing_tos 0x20 good_service_net +# +# TOS/DSCP values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_tos +# Allows you to select a TOS/DSCP value for packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_tos 0x00 normal_service_net +# clientside_tos 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any TOS values set here +# will be overwritten by TOS values in qos_flows. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +#Default: +# none + +# TAG: tcp_outgoing_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to outgoing packets +# on the server side, based on an ACL. +# +# tcp_outgoing_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_mark 0x00 normal_service_net +# tcp_outgoing_mark 0x20 good_service_net +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_mark 0x00 normal_service_net +# clientside_mark 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any mark values set here +# will be overwritten by mark values in qos_flows. +#Default: +# none + +# TAG: qos_flows +# Allows you to select a TOS/DSCP value to mark outgoing +# connections to the client, based on where the reply was sourced. +# For platforms using netfilter, allows you to set a netfilter mark +# value instead of, or in addition to, a TOS value. +# +# By default this functionality is disabled. To enable it with the default +# settings simply use "qos_flows mark" or "qos_flows tos". Default +# settings will result in the netfilter mark or TOS value being copied +# from the upstream connection to the client. Note that it is the connection +# CONNMARK value not the packet MARK value that is copied. +# +# It is not currently possible to copy the mark or TOS value from the +# client to the upstream connection request. +# +# TOS values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Mark values can be any unsigned 32-bit integer value. +# +# This setting is configured by setting the following values: +# +# tos|mark Whether to set TOS or netfilter mark values +# +# local-hit=0xFF Value to mark local cache hits. +# +# sibling-hit=0xFF Value to mark hits from sibling peers. +# +# parent-hit=0xFF Value to mark hits from parent peers. +# +# miss=0xFF[/mask] Value to mark cache misses. Takes precedence +# over the preserve-miss feature (see below), unless +# mask is specified, in which case only the bits +# specified in the mask are written. +# +# The TOS variant of the following features are only possible on Linux +# and require your kernel to be patched with the TOS preserving ZPH +# patch, available from http://zph.bratcheda.org +# No patch is needed to preserve the netfilter mark, which will work +# with all variants of netfilter. +# +# disable-preserve-miss +# This option disables the preservation of the TOS or netfilter +# mark. By default, the existing TOS or netfilter mark value of +# the response coming from the remote server will be retained +# and masked with miss-mark. +# NOTE: in the case of a netfilter mark, the mark must be set on +# the connection (using the CONNMARK target) not on the packet +# (MARK target). +# +# miss-mask=0xFF +# Allows you to mask certain bits in the TOS or mark value +# received from the remote server, before copying the value to +# the TOS sent towards clients. +# Default for tos: 0xFF (TOS from server is not changed). +# Default for mark: 0xFFFFFFFF (mark from server is not changed). +# +# All of these features require the --enable-zph-qos compilation flag +# (enabled by default). Netfilter marking also requires the +# libnetfilter_conntrack libraries (--with-netfilter-conntrack) and +# libcap 2.09+ (--with-libcap). +# +#Default: +# none + +# TAG: tcp_outgoing_address +# Allows you to map requests to different outgoing IP addresses +# based on the username or source address of the user making +# the request. +# +# tcp_outgoing_address ipaddr [[!]aclname] ... +# +# For example; +# Forwarding clients with dedicated IPs for certain subnets. +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.2.0/24 +# +# tcp_outgoing_address 2001:db8::c001 good_service_net +# tcp_outgoing_address 10.1.0.2 good_service_net +# +# tcp_outgoing_address 2001:db8::beef normal_service_net +# tcp_outgoing_address 10.1.0.1 normal_service_net +# +# tcp_outgoing_address 2001:db8::1 +# tcp_outgoing_address 10.1.0.3 +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Squid will add an implicit IP version test to each line. +# Requests going to IPv4 websites will use the outgoing 10.1.0.* addresses. +# Requests going to IPv6 websites will use the outgoing 2001:db8:* addresses. +# +# +# NOTE: The use of this directive using client dependent ACLs is +# incompatible with the use of server side persistent connections. To +# ensure correct results it is best to set server_persistent_connections +# to off when using this directive in such configurations. +# +# NOTE: The use of this directive to set a local IP on outgoing TCP links +# is incompatible with using TPROXY to set client IP out outbound TCP links. +# When needing to contact peers use the no-tproxy cache_peer option and the +# client_dst_passthru directive re-enable normal forwarding such as this. +# +#Default: +# Address selection is performed by the operating system. + +# TAG: host_verify_strict +# Regardless of this option setting, when dealing with intercepted +# traffic, Squid always verifies that the destination IP address matches +# the Host header domain or IP (called 'authority form URL'). +# +# This enforcement is performed to satisfy a MUST-level requirement in +# RFC 2616 section 14.23: "The Host field value MUST represent the naming +# authority of the origin server or gateway given by the original URL". +# +# When set to ON: +# Squid always responds with an HTTP 409 (Conflict) error +# page and logs a security warning if there is no match. +# +# Squid verifies that the destination IP address matches +# the Host header for forward-proxy and reverse-proxy traffic +# as well. For those traffic types, Squid also enables the +# following checks, comparing the corresponding Host header +# and Request-URI components: +# +# * The host names (domain or IP) must be identical, +# but valueless or missing Host header disables all checks. +# For the two host names to match, both must be either IP +# or FQDN. +# +# * Port numbers must be identical, but if a port is missing +# the scheme-default port is assumed. +# +# +# When set to OFF (the default): +# Squid allows suspicious requests to continue but logs a +# security warning and blocks caching of the response. +# +# * Forward-proxy traffic is not checked at all. +# +# * Reverse-proxy traffic is not checked at all. +# +# * Intercepted traffic which passes verification is handled +# according to client_dst_passthru. +# +# * Intercepted requests which fail verification are sent +# to the client original destination instead of DIRECT. +# This overrides 'client_dst_passthru off'. +# +# For now suspicious intercepted CONNECT requests are always +# responded to with an HTTP 409 (Conflict) error page. +# +# +# SECURITY NOTE: +# +# As described in CVE-2009-0801 when the Host: header alone is used +# to determine the destination of a request it becomes trivial for +# malicious scripts on remote websites to bypass browser same-origin +# security policy and sandboxing protections. +# +# The cause of this is that such applets are allowed to perform their +# own HTTP stack, in which case the same-origin policy of the browser +# sandbox only verifies that the applet tries to contact the same IP +# as from where it was loaded at the IP level. The Host: header may +# be different from the connected IP and approved origin. +# +#Default: +# host_verify_strict off + +# TAG: client_dst_passthru +# With NAT or TPROXY intercepted traffic Squid may pass the request +# directly to the original client destination IP or seek a faster +# source using the HTTP Host header. +# +# Using Host to locate alternative servers can provide faster +# connectivity with a range of failure recovery options. +# But can also lead to connectivity trouble when the client and +# server are attempting stateful interactions unaware of the proxy. +# +# This option (on by default) prevents alternative DNS entries being +# located to send intercepted traffic DIRECT to an origin server. +# The clients original destination IP and port will be used instead. +# +# Regardless of this option setting, when dealing with intercepted +# traffic Squid will verify the Host: header and any traffic which +# fails Host verification will be treated as if this option were ON. +# +# see host_verify_strict for details on the verification process. +#Default: +# client_dst_passthru on + +# SSL OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ssl_unclean_shutdown +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Some browsers (especially MSIE) bugs out on SSL shutdown +# messages. +#Default: +# ssl_unclean_shutdown off + +# TAG: ssl_engine +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The OpenSSL engine to use. You will need to set this if you +# would like to use hardware SSL acceleration for example. +#Default: +# none + +# TAG: sslproxy_client_certificate +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Certificate to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_client_key +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Key to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_version +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL version level to use when proxying https:// URLs +# +# The versions of SSL/TLS supported: +# +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +#Default: +# automatic SSL/TLS version negotiation + +# TAG: sslproxy_options +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Colon (:) or comma (,) separated list of SSL implementation options +# to use when proxying https:// URLs +# +# The most important being: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using temporary/ephemeral +# DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds suggested as "harmless" +# by OpenSSL. Be warned that this may reduce SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# complete list of possible options. +# +# WARNING: This directive takes a single token. If a space is used +# the value(s) after that space are SILENTLY IGNORED. +#Default: +# none + +# TAG: sslproxy_cipher +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL cipher list to use when proxying https:// URLs +# +# Colon separated list of supported ciphers. +#Default: +# none + +# TAG: sslproxy_cafile +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# file containing CA certificates to use when verifying server +# certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_capath +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# directory containing CA certificates to use when verifying +# server certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_session_ttl +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the timeout value for SSL sessions +#Default: +# sslproxy_session_ttl 300 + +# TAG: sslproxy_session_cache_size +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the cache size to use for ssl session +#Default: +# sslproxy_session_cache_size 2 MB + +# TAG: sslproxy_foreign_intermediate_certs +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Many origin servers fail to send their full server certificate +# chain for verification, assuming the client already has or can +# easily locate any missing intermediate certificates. +# +# Squid uses the certificates from the specified file to fill in +# these missing chains when trying to validate origin server +# certificate chains. +# +# The file is expected to contain zero or more PEM-encoded +# intermediate certificates. These certificates are not treated +# as trusted root certificates, and any self-signed certificate in +# this file will be ignored. +#Default: +# none + +# TAG: sslproxy_cert_sign_hash +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the hashing algorithm to use when signing generated certificates. +# Valid algorithm names depend on the OpenSSL library used. The following +# names are usually available: sha1, sha256, sha512, and md5. Please see +# your OpenSSL library manual for the available hashes. By default, Squids +# that support this option use sha256 hashes. +# +# Squid does not forcefully purge cached certificates that were generated +# with an algorithm other than the currently configured one. They remain +# in the cache, subject to the regular cache eviction policy, and become +# useful if the algorithm changes again. +#Default: +# none + +# TAG: ssl_bump +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# This option is consulted when a CONNECT request is received on +# an http_port (or a new connection is intercepted at an +# https_port), provided that port was configured with an ssl-bump +# flag. The subsequent data on the connection is either treated as +# HTTPS and decrypted OR tunneled at TCP level without decryption, +# depending on the first matching bumping "action". +# +# ssl_bump [!]acl ... +# +# The following bumping actions are currently supported: +# +# splice +# Become a TCP tunnel without decrypting proxied traffic. +# This is the default action. +# +# bump +# When used on step SslBump1, establishes a secure connection +# with the client first, then connect to the server. +# When used on step SslBump2 or SslBump3, establishes a secure +# connection with the server and, using a mimicked server +# certificate, with the client. +# +# peek +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of splicing the +# connection. Peeking at the server certificate (during step 2) +# usually precludes bumping of the connection at step 3. +# +# stare +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of bumping the +# connection. Staring at the server certificate (during step 2) +# usually precludes splicing of the connection at step 3. +# +# terminate +# Close client and server connections. +# +# Backward compatibility actions available at step SslBump1: +# +# client-first +# Bump the connection. Establish a secure connection with the +# client first, then connect to the server. This old mode does +# not allow Squid to mimic server SSL certificate and does not +# work with intercepted SSL connections. +# +# server-first +# Bump the connection. Establish a secure connection with the +# server first, then establish a secure connection with the +# client, using a mimicked server certificate. Works with both +# CONNECT requests and intercepted SSL connections, but does +# not allow to make decisions based on SSL handshake info. +# +# peek-and-splice +# Decide whether to bump or splice the connection based on +# client-to-squid and server-to-squid SSL hello messages. +# XXX: Remove. +# +# none +# Same as the "splice" action. +# +# All ssl_bump rules are evaluated at each of the supported bumping +# steps. Rules with actions that are impossible at the current step are +# ignored. The first matching ssl_bump action wins and is applied at the +# end of the current step. If no rules match, the splice action is used. +# See the at_step ACL for a list of the supported SslBump steps. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also: http_port ssl-bump, https_port ssl-bump, and acl at_step. +# +# +# # Example: Bump all TLS connections except those originating from +# # localhost or those going to example.com. +# +# acl broken_sites ssl::server_name .example.com +# ssl_bump splice localhost +# ssl_bump splice broken_sites +# ssl_bump bump all +#Default: +# Become a TCP tunnel without decrypting proxied traffic. + +# TAG: sslproxy_flags +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Various flags modifying the use of SSL while proxying https:// URLs: +# DONT_VERIFY_PEER Accept certificates that fail verification. +# For refined control, see sslproxy_cert_error. +# NO_DEFAULT_CA Don't use the default CA list built in +# to OpenSSL. +#Default: +# none + +# TAG: sslproxy_cert_error +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Use this ACL to bypass server certificate validation errors. +# +# For example, the following lines will bypass all validation errors +# when talking to servers for example.com. All other +# validation errors will result in ERR_SECURE_CONNECT_FAIL error. +# +# acl BrokenButTrustedServers dstdomain example.com +# sslproxy_cert_error allow BrokenButTrustedServers +# sslproxy_cert_error deny all +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Using slow acl types may result in server crashes +# +# Without this option, all server certificate validation errors +# terminate the transaction to protect Squid and the client. +# +# SQUID_X509_V_ERR_INFINITE_VALIDATION error cannot be bypassed +# but should not happen unless your OpenSSL library is buggy. +# +# SECURITY WARNING: +# Bypassing validation errors is dangerous because an +# error usually implies that the server cannot be trusted +# and the connection may be insecure. +# +# See also: sslproxy_flags and DONT_VERIFY_PEER. +#Default: +# Server certificate errors terminate the transaction. + +# TAG: sslproxy_cert_sign +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_sign acl ... +# +# The following certificate signing algorithms are supported: +# +# signTrusted +# Sign using the configured CA certificate which is usually +# placed in and trusted by end-user browsers. This is the +# default for trusted origin server certificates. +# +# signUntrusted +# Sign to guarantee an X509_V_ERR_CERT_UNTRUSTED browser error. +# This is the default for untrusted origin server certificates +# that are not self-signed (see ssl::certUntrusted). +# +# signSelf +# Sign using a self-signed certificate with the right CN to +# generate a X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT error in the +# browser. This is the default for self-signed origin server +# certificates (see ssl::certSelfSigned). +# +# This clause only supports fast acl types. +# +# When sslproxy_cert_sign acl(s) match, Squid uses the corresponding +# signing algorithm to generate the certificate and ignores all +# subsequent sslproxy_cert_sign options (the first match wins). If no +# acl(s) match, the default signing algorithm is determined by errors +# detected when obtaining and validating the origin server certificate. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslproxy_cert_adapt +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_adapt acl ... +# +# The following certificate adaptation algorithms are supported: +# +# setValidAfter +# Sets the "Not After" property to the "Not After" property of +# the CA certificate used to sign generated certificates. +# +# setValidBefore +# Sets the "Not Before" property to the "Not Before" property of +# the CA certificate used to sign generated certificates. +# +# setCommonName or setCommonName{CN} +# Sets Subject.CN property to the host name specified as a +# CN parameter or, if no explicit CN parameter was specified, +# extracted from the CONNECT request. It is a misconfiguration +# to use setCommonName without an explicit parameter for +# intercepted or tproxied SSL connections. +# +# This clause only supports fast acl types. +# +# Squid first groups sslproxy_cert_adapt options by adaptation algorithm. +# Within a group, when sslproxy_cert_adapt acl(s) match, Squid uses the +# corresponding adaptation algorithm to generate the certificate and +# ignores all subsequent sslproxy_cert_adapt options in that algorithm's +# group (i.e., the first match wins within each algorithm group). If no +# acl(s) match, the default mimicking action takes place. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslpassword_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify a program used for entering SSL key passphrases +# when using encrypted SSL certificate keys. If not specified +# keys must either be unencrypted, or Squid started with the -N +# option to allow it to query interactively for the passphrase. +# +# The key file name is given as argument to the program allowing +# selection of the right password if you have multiple encrypted +# keys. +#Default: +# none + +# OPTIONS RELATING TO EXTERNAL SSL_CRTD +# ----------------------------------------------------------------------------- + +# TAG: sslcrtd_program +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# Specify the location and options of the executable for ssl_crtd process. +# /usr/lib/squid/ssl_crtd program requires -s and -M parameters +# For more information use: +# /usr/lib/squid/ssl_crtd -h +#Default: +# sslcrtd_program /usr/lib/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB + +# TAG: sslcrtd_children +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# The maximum number of processes spawn to service ssl server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# You must have at least one ssl_crtd process. +#Default: +# sslcrtd_children 32 startup=5 idle=1 + +# TAG: sslcrtvalidator_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify the location and options of the executable for ssl_crt_validator +# process. +# +# Usage: sslcrtvalidator_program [ttl=n] [cache=n] path ... +# +# Options: +# ttl=n TTL in seconds for cached results. The default is 60 secs +# cache=n limit the result cache size. The default value is 2048 +#Default: +# none + +# TAG: sslcrtvalidator_children +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The maximum number of processes spawn to service SSL server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each certificate validator helper can handle in +# parallel. A value of 0 indicates the certficate validator does not +# support concurrency. Defaults to 1. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# a request ID in front of the request/response. The request +# ID from the request must be echoed back with the response +# to that request. +# +# You must have at least one ssl_crt_validator process. +#Default: +# sslcrtvalidator_children 32 startup=5 idle=1 concurrency=1 + +# OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM +# ----------------------------------------------------------------------------- + +# TAG: cache_peer +# To specify other caches in a hierarchy, use the format: +# +# cache_peer hostname type http-port icp-port [options] +# +# For example, +# +# # proxy icp +# # hostname type port port options +# # -------------------- -------- ----- ----- ----------- +# cache_peer parent.foo.net parent 3128 3130 default +# cache_peer sib1.foo.net sibling 3128 3130 proxy-only +# cache_peer sib2.foo.net sibling 3128 3130 proxy-only +# cache_peer example.com parent 80 0 default +# cache_peer cdn.example.com sibling 3128 0 +# +# type: either 'parent', 'sibling', or 'multicast'. +# +# proxy-port: The port number where the peer accept HTTP requests. +# For other Squid proxies this is usually 3128 +# For web servers this is usually 80 +# +# icp-port: Used for querying neighbor caches about objects. +# Set to 0 if the peer does not support ICP or HTCP. +# See ICP and HTCP options below for additional details. +# +# +# ==== ICP OPTIONS ==== +# +# You MUST also set icp_port and icp_access explicitly when using these options. +# The defaults will prevent peer traffic using ICP. +# +# +# no-query Disable ICP queries to this neighbor. +# +# multicast-responder +# Indicates the named peer is a member of a multicast group. +# ICP queries will not be sent directly to the peer, but ICP +# replies will be accepted from it. +# +# closest-only Indicates that, for ICP_OP_MISS replies, we'll only forward +# CLOSEST_PARENT_MISSes and never FIRST_PARENT_MISSes. +# +# background-ping +# To only send ICP queries to this neighbor infrequently. +# This is used to keep the neighbor round trip time updated +# and is usually used in conjunction with weighted-round-robin. +# +# +# ==== HTCP OPTIONS ==== +# +# You MUST also set htcp_port and htcp_access explicitly when using these options. +# The defaults will prevent peer traffic using HTCP. +# +# +# htcp Send HTCP, instead of ICP, queries to the neighbor. +# You probably also want to set the "icp-port" to 4827 +# instead of 3130. This directive accepts a comma separated +# list of options described below. +# +# htcp=oldsquid Send HTCP to old Squid versions (2.5 or earlier). +# +# htcp=no-clr Send HTCP to the neighbor but without +# sending any CLR requests. This cannot be used with +# only-clr. +# +# htcp=only-clr Send HTCP to the neighbor but ONLY CLR requests. +# This cannot be used with no-clr. +# +# htcp=no-purge-clr +# Send HTCP to the neighbor including CLRs but only when +# they do not result from PURGE requests. +# +# htcp=forward-clr +# Forward any HTCP CLR requests this proxy receives to the peer. +# +# +# ==== PEER SELECTION METHODS ==== +# +# The default peer selection method is ICP, with the first responding peer +# being used as source. These options can be used for better load balancing. +# +# +# default This is a parent cache which can be used as a "last-resort" +# if a peer cannot be located by any of the peer-selection methods. +# If specified more than once, only the first is used. +# +# round-robin Load-Balance parents which should be used in a round-robin +# fashion in the absence of any ICP queries. +# weight=N can be used to add bias. +# +# weighted-round-robin +# Load-Balance parents which should be used in a round-robin +# fashion with the frequency of each parent being based on the +# round trip time. Closer parents are used more often. +# Usually used for background-ping parents. +# weight=N can be used to add bias. +# +# carp Load-Balance parents which should be used as a CARP array. +# The requests will be distributed among the parents based on the +# CARP load balancing hash function based on their weight. +# +# userhash Load-balance parents based on the client proxy_auth or ident username. +# +# sourcehash Load-balance parents based on the client source IP. +# +# multicast-siblings +# To be used only for cache peers of type "multicast". +# ALL members of this multicast group have "sibling" +# relationship with it, not "parent". This is to a multicast +# group when the requested object would be fetched only from +# a "parent" cache, anyway. It's useful, e.g., when +# configuring a pool of redundant Squid proxies, being +# members of the same multicast group. +# +# +# ==== PEER SELECTION OPTIONS ==== +# +# weight=N use to affect the selection of a peer during any weighted +# peer-selection mechanisms. +# The weight must be an integer; default is 1, +# larger weights are favored more. +# This option does not affect parent selection if a peering +# protocol is not in use. +# +# basetime=N Specify a base amount to be subtracted from round trip +# times of parents. +# It is subtracted before division by weight in calculating +# which parent to fectch from. If the rtt is less than the +# base time the rtt is set to a minimal value. +# +# ttl=N Specify a TTL to use when sending multicast ICP queries +# to this address. +# Only useful when sending to a multicast group. +# Because we don't accept ICP replies from random +# hosts, you must configure other group members as +# peers with the 'multicast-responder' option. +# +# no-delay To prevent access to this neighbor from influencing the +# delay pools. +# +# digest-url=URL Tell Squid to fetch the cache digest (if digests are +# enabled) for this host from the specified URL rather +# than the Squid default location. +# +# +# ==== CARP OPTIONS ==== +# +# carp-key=key-specification +# use a different key than the full URL to hash against the peer. +# the key-specification is a comma-separated list of the keywords +# scheme, host, port, path, params +# Order is not important. +# +# ==== ACCELERATOR / REVERSE-PROXY OPTIONS ==== +# +# originserver Causes this parent to be contacted as an origin server. +# Meant to be used in accelerator setups when the peer +# is a web server. +# +# forceddomain=name +# Set the Host header of requests forwarded to this peer. +# Useful in accelerator setups where the server (peer) +# expects a certain domain name but clients may request +# others. ie example.com or www.example.com +# +# no-digest Disable request of cache digests. +# +# no-netdb-exchange +# Disables requesting ICMP RTT database (NetDB). +# +# +# ==== AUTHENTICATION OPTIONS ==== +# +# login=user:password +# If this is a personal/workgroup proxy and your parent +# requires proxy authentication. +# +# Note: The string can include URL escapes (i.e. %20 for +# spaces). This also means % must be written as %%. +# +# login=PASSTHRU +# Send login details received from client to this peer. +# Both Proxy- and WWW-Authorization headers are passed +# without alteration to the peer. +# Authentication is not required by Squid for this to work. +# +# Note: This will pass any form of authentication but +# only Basic auth will work through a proxy unless the +# connection-auth options are also used. +# +# login=PASS Send login details received from client to this peer. +# Authentication is not required by this option. +# +# If there are no client-provided authentication headers +# to pass on, but username and password are available +# from an external ACL user= and password= result tags +# they may be sent instead. +# +# Note: To combine this with proxy_auth both proxies must +# share the same user database as HTTP only allows for +# a single login (one for proxy, one for origin server). +# Also be warned this will expose your users proxy +# password to the peer. USE WITH CAUTION +# +# login=*:password +# Send the username to the upstream cache, but with a +# fixed password. This is meant to be used when the peer +# is in another administrative domain, but it is still +# needed to identify each user. +# The star can optionally be followed by some extra +# information which is added to the username. This can +# be used to identify this proxy to the peer, similar to +# the login=username:password option above. +# +# login=NEGOTIATE +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The first principal from the default keytab or defined by +# the environment variable KRB5_KTNAME will be used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# login=NEGOTIATE:principal_name +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The principal principal_name from the default keytab or +# defined by the environment variable KRB5_KTNAME will be +# used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# connection-auth=on|off +# Tell Squid that this peer does or not support Microsoft +# connection oriented authentication, and any such +# challenges received from there should be ignored. +# Default is auto to automatically determine the status +# of the peer. +# +# +# ==== SSL / HTTPS / TLS OPTIONS ==== +# +# ssl Encrypt connections to this peer with SSL/TLS. +# +# sslcert=/path/to/ssl/certificate +# A client SSL certificate to use when connecting to +# this peer. +# +# sslkey=/path/to/ssl/key +# The private SSL key corresponding to sslcert above. +# If 'sslkey' is not specified 'sslcert' is assumed to +# reference a combined file containing both the +# certificate and the key. +# +# Notes: +# +# On Debian/Ubuntu systems a default snakeoil certificate is +# available in /etc/ssl and users can set: +# +# cert=/etc/ssl/certs/ssl-cert-snakeoil.pem +# +# and +# +# key=/etc/ssl/private/ssl-cert-snakeoil.key +# +# for testing. +# +# sslversion=1|2|3|4|5|6 +# The SSL version to use when connecting to this peer +# 1 = automatic (default) +# 2 = SSL v2 only +# 3 = SSL v3 only +# 4 = TLS v1.0 only +# 5 = TLS v1.1 only +# 6 = TLS v1.2 only +# +# sslcipher=... The list of valid SSL ciphers to use when connecting +# to this peer. +# +# ssloptions=... Specify various SSL implementation options: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# more complete list. +# +# sslcafile=... A file containing additional CA certificates to use +# when verifying the peer certificate. +# +# sslcapath=... A directory containing additional CA certificates to +# use when verifying the peer certificate. +# +# sslcrlfile=... A certificate revocation list file to use when +# verifying the peer certificate. +# +# sslflags=... Specify various flags modifying the SSL implementation: +# +# DONT_VERIFY_PEER +# Accept certificates even if they fail to +# verify. +# NO_DEFAULT_CA +# Don't use the default CA list built in +# to OpenSSL. +# DONT_VERIFY_DOMAIN +# Don't verify the peer certificate +# matches the server name +# +# ssldomain= The peer name as advertised in it's certificate. +# Used for verifying the correctness of the received peer +# certificate. If not specified the peer hostname will be +# used. +# +# front-end-https +# Enable the "Front-End-Https: On" header needed when +# using Squid as a SSL frontend in front of Microsoft OWA. +# See MS KB document Q307347 for details on this header. +# If set to auto the header will only be added if the +# request is forwarded as a https:// URL. +# +# +# ==== GENERAL OPTIONS ==== +# +# connect-timeout=N +# A peer-specific connect timeout. +# Also see the peer_connect_timeout directive. +# +# connect-fail-limit=N +# How many times connecting to a peer must fail before +# it is marked as down. Standby connection failures +# count towards this limit. Default is 10. +# +# allow-miss Disable Squid's use of only-if-cached when forwarding +# requests to siblings. This is primarily useful when +# icp_hit_stale is used by the sibling. Excessive use +# of this option may result in forwarding loops. One way +# to prevent peering loops when using this option, is to +# deny cache peer usage on requests from a peer: +# acl fromPeer ... +# cache_peer_access peerName deny fromPeer +# +# max-conn=N Limit the number of concurrent connections the Squid +# may open to this peer, including already opened idle +# and standby connections. There is no peer-specific +# connection limit by default. +# +# A peer exceeding the limit is not used for new +# requests unless a standby connection is available. +# +# max-conn currently works poorly with idle persistent +# connections: When a peer reaches its max-conn limit, +# and there are idle persistent connections to the peer, +# the peer may not be selected because the limiting code +# does not know whether Squid can reuse those idle +# connections. +# +# standby=N Maintain a pool of N "hot standby" connections to an +# UP peer, available for requests when no idle +# persistent connection is available (or safe) to use. +# By default and with zero N, no such pool is maintained. +# N must not exceed the max-conn limit (if any). +# +# At start or after reconfiguration, Squid opens new TCP +# standby connections until there are N connections +# available and then replenishes the standby pool as +# opened connections are used up for requests. A used +# connection never goes back to the standby pool, but +# may go to the regular idle persistent connection pool +# shared by all peers and origin servers. +# +# Squid never opens multiple new standby connections +# concurrently. This one-at-a-time approach minimizes +# flooding-like effect on peers. Furthermore, just a few +# standby connections should be sufficient in most cases +# to supply most new requests with a ready-to-use +# connection. +# +# Standby connections obey server_idle_pconn_timeout. +# For the feature to work as intended, the peer must be +# configured to accept and keep them open longer than +# the idle timeout at the connecting Squid, to minimize +# race conditions typical to idle used persistent +# connections. Default request_timeout and +# server_idle_pconn_timeout values ensure such a +# configuration. +# +# name=xxx Unique name for the peer. +# Required if you have multiple peers on the same host +# but different ports. +# This name can be used in cache_peer_access and similar +# directives to identify the peer. +# Can be used by outgoing access controls through the +# peername ACL type. +# +# no-tproxy Do not use the client-spoof TPROXY support when forwarding +# requests to this peer. Use normal address selection instead. +# This overrides the spoof_client_ip ACL. +# +# proxy-only objects fetched from the peer will not be stored locally. +# +#Default: +# none + +# TAG: cache_peer_domain +# Use to limit the domains for which a neighbor cache will be +# queried. +# +# Usage: +# cache_peer_domain cache-host domain [domain ...] +# cache_peer_domain cache-host !domain +# +# For example, specifying +# +# cache_peer_domain parent.foo.net .edu +# +# has the effect such that UDP query packets are sent to +# 'bigserver' only when the requested object exists on a +# server in the .edu domain. Prefixing the domainname +# with '!' means the cache will be queried for objects +# NOT in that domain. +# +# NOTE: * Any number of domains may be given for a cache-host, +# either on the same or separate lines. +# * When multiple domains are given for a particular +# cache-host, the first matched domain is applied. +# * Cache hosts with no domain restrictions are queried +# for all requests. +# * There are no defaults. +# * There is also a 'cache_peer_access' tag in the ACL +# section. +#Default: +# none + +# TAG: cache_peer_access +# Restricts usage of cache_peer proxies. +# +# Usage: +# cache_peer_access peer-name allow|deny [!]aclname ... +# +# For the required peer-name parameter, use either the value of the +# cache_peer name=value parameter or, if name=value is missing, the +# cache_peer hostname parameter. +# +# This directive narrows down the selection of peering candidates, but +# does not determine the order in which the selected candidates are +# contacted. That order is determined by the peer selection algorithms +# (see PEER SELECTION sections in the cache_peer documentation). +# +# If a deny rule matches, the corresponding peer will not be contacted +# for the current transaction -- Squid will not send ICP queries and +# will not forward HTTP requests to that peer. An allow match leaves +# the corresponding peer in the selection. The first match for a given +# peer wins for that peer. +# +# The relative order of cache_peer_access directives for the same peer +# matters. The relative order of any two cache_peer_access directives +# for different peers does not matter. To ease interpretation, it is a +# good idea to group cache_peer_access directives for the same peer +# together. +# +# A single cache_peer_access directive may be evaluated multiple times +# for a given transaction because individual peer selection algorithms +# may check it independently from each other. These redundant checks +# may be optimized away in future Squid versions. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# No peer usage restrictions. + +# TAG: neighbor_type_domain +# Modify the cache_peer neighbor type when passing requests +# about specific domains to the peer. +# +# Usage: +# neighbor_type_domain neighbor parent|sibling domain domain ... +# +# For example: +# cache_peer foo.example.com parent 3128 3130 +# neighbor_type_domain foo.example.com sibling .au .de +# +# The above configuration treats all requests to foo.example.com as a +# parent proxy unless the request is for a .au or .de ccTLD domain name. +#Default: +# The peer type from cache_peer directive is used for all requests to that peer. + +# TAG: dead_peer_timeout (seconds) +# This controls how long Squid waits to declare a peer cache +# as "dead." If there are no ICP replies received in this +# amount of time, Squid will declare the peer dead and not +# expect to receive any further ICP replies. However, it +# continues to send ICP queries, and will mark the peer as +# alive upon receipt of the first subsequent ICP reply. +# +# This timeout also affects when Squid expects to receive ICP +# replies from peers. If more than 'dead_peer' seconds have +# passed since the last ICP reply was received, Squid will not +# expect to receive an ICP reply on the next query. Thus, if +# your time between requests is greater than this timeout, you +# will see a lot of requests sent DIRECT to origin servers +# instead of to your parents. +#Default: +# dead_peer_timeout 10 seconds + +# TAG: forward_max_tries +# Controls how many different forward paths Squid will try +# before giving up. See also forward_timeout. +# +# NOTE: connect_retries (default: none) can make each of these +# possible forwarding paths be tried multiple times. +#Default: +# forward_max_tries 25 + +# MEMORY CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_mem (bytes) +# NOTE: THIS PARAMETER DOES NOT SPECIFY THE MAXIMUM PROCESS SIZE. +# IT ONLY PLACES A LIMIT ON HOW MUCH ADDITIONAL MEMORY SQUID WILL +# USE AS A MEMORY CACHE OF OBJECTS. SQUID USES MEMORY FOR OTHER +# THINGS AS WELL. SEE THE SQUID FAQ SECTION 8 FOR DETAILS. +# +# 'cache_mem' specifies the ideal amount of memory to be used +# for: +# * In-Transit objects +# * Hot Objects +# * Negative-Cached objects +# +# Data for these objects are stored in 4 KB blocks. This +# parameter specifies the ideal upper limit on the total size of +# 4 KB blocks allocated. In-Transit objects take the highest +# priority. +# +# In-transit objects have priority over the others. When +# additional space is needed for incoming data, negative-cached +# and hot objects will be released. In other words, the +# negative-cached and hot objects will fill up any unused space +# not needed for in-transit objects. +# +# If circumstances require, this limit will be exceeded. +# Specifically, if your incoming request rate requires more than +# 'cache_mem' of memory to hold in-transit objects, Squid will +# exceed this limit to satisfy the new requests. When the load +# decreases, blocks will be freed until the high-water mark is +# reached. Thereafter, blocks will be used to store hot +# objects. +# +# If shared memory caching is enabled, Squid does not use the shared +# cache space for in-transit objects, but they still consume as much +# local memory as they need. For more details about the shared memory +# cache, see memory_cache_shared. +#Default: +# cache_mem 256 MB + +# TAG: maximum_object_size_in_memory (bytes) +# Objects greater than this size will not be attempted to kept in +# the memory cache. This should be set high enough to keep objects +# accessed frequently in memory to improve performance whilst low +# enough to keep larger objects from hoarding cache_mem. +#Default: +# maximum_object_size_in_memory 512 KB + +# TAG: memory_cache_shared on|off +# Controls whether the memory cache is shared among SMP workers. +# +# The shared memory cache is meant to occupy cache_mem bytes and replace +# the non-shared memory cache, although some entities may still be +# cached locally by workers for now (e.g., internal and in-transit +# objects may be served from a local memory cache even if shared memory +# caching is enabled). +# +# By default, the memory cache is shared if and only if all of the +# following conditions are satisfied: Squid runs in SMP mode with +# multiple workers, cache_mem is positive, and Squid environment +# supports required IPC primitives (e.g., POSIX shared memory segments +# and GCC-style atomic operations). +# +# To avoid blocking locks, shared memory uses opportunistic algorithms +# that do not guarantee that every cachable entity that could have been +# shared among SMP workers will actually be shared. +#Default: +# "on" where supported if doing memory caching with multiple SMP workers. + +# TAG: memory_cache_mode +# Controls which objects to keep in the memory cache (cache_mem) +# +# always Keep most recently fetched objects in memory (default) +# +# disk Only disk cache hits are kept in memory, which means +# an object must first be cached on disk and then hit +# a second time before cached in memory. +# +# network Only objects fetched from network is kept in memory +#Default: +# Keep the most recently fetched objects in memory + +# TAG: memory_replacement_policy +# The memory replacement policy parameter determines which +# objects are purged from memory when memory space is needed. +# +# See cache_replacement_policy for details on algorithms. +#Default: +# memory_replacement_policy lru + +# DISK CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_replacement_policy +# The cache replacement policy parameter determines which +# objects are evicted (replaced) when disk space is needed. +# +# lru : Squid's original list based LRU policy +# heap GDSF : Greedy-Dual Size Frequency +# heap LFUDA: Least Frequently Used with Dynamic Aging +# heap LRU : LRU policy implemented using a heap +# +# Applies to any cache_dir lines listed below this directive. +# +# The LRU policies keeps recently referenced objects. +# +# The heap GDSF policy optimizes object hit rate by keeping smaller +# popular objects in cache so it has a better chance of getting a +# hit. It achieves a lower byte hit rate than LFUDA though since +# it evicts larger (possibly popular) objects. +# +# The heap LFUDA policy keeps popular objects in cache regardless of +# their size and thus optimizes byte hit rate at the expense of +# hit rate since one large, popular object will prevent many +# smaller, slightly less popular objects from being cached. +# +# Both policies utilize a dynamic aging mechanism that prevents +# cache pollution that can otherwise occur with frequency-based +# replacement policies. +# +# NOTE: if using the LFUDA replacement policy you should increase +# the value of maximum_object_size above its default of 4 MB to +# to maximize the potential byte hit rate improvement of LFUDA. +# +# For more information about the GDSF and LFUDA cache replacement +# policies see http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html +# and http://fog.hpl.external.hp.com/techreports/98/HPL-98-173.html. +#Default: +# cache_replacement_policy lru + +# TAG: minimum_object_size (bytes) +# Objects smaller than this size will NOT be saved on disk. The +# value is specified in bytes, and the default is 0 KB, which +# means all responses can be stored. +#Default: +# no limit + +# TAG: maximum_object_size (bytes) +# Set the default value for max-size parameter on any cache_dir. +# The value is specified in bytes, and the default is 4 MB. +# +# If you wish to get a high BYTES hit ratio, you should probably +# increase this (one 32 MB object hit counts for 3200 10KB +# hits). +# +# If you wish to increase hit ratio more than you want to +# save bandwidth you should leave this low. +# +# NOTE: if using the LFUDA replacement policy you should increase +# this value to maximize the byte hit rate improvement of LFUDA! +# See cache_replacement_policy for a discussion of this policy. +#Default: +# maximum_object_size 4 MB + +# TAG: cache_dir +# Format: +# cache_dir Type Directory-Name Fs-specific-data [options] +# +# You can specify multiple cache_dir lines to spread the +# cache among different disk partitions. +# +# Type specifies the kind of storage system to use. Only "ufs" +# is built by default. To enable any of the other storage systems +# see the --enable-storeio configure option. +# +# 'Directory' is a top-level directory where cache swap +# files will be stored. If you want to use an entire disk +# for caching, this can be the mount-point directory. +# The directory must exist and be writable by the Squid +# process. Squid will NOT create this directory for you. +# +# In SMP configurations, cache_dir must not precede the workers option +# and should use configuration macros or conditionals to give each +# worker interested in disk caching a dedicated cache directory. +# +# +# ==== The ufs store type ==== +# +# "ufs" is the old well-known Squid storage format that has always +# been there. +# +# Usage: +# cache_dir ufs Directory-Name Mbytes L1 L2 [options] +# +# 'Mbytes' is the amount of disk space (MB) to use under this +# directory. The default is 100 MB. Change this to suit your +# configuration. Do NOT put the size of your disk drive here. +# Instead, if you want Squid to use the entire disk drive, +# subtract 20% and use that value. +# +# 'L1' is the number of first-level subdirectories which +# will be created under the 'Directory'. The default is 16. +# +# 'L2' is the number of second-level subdirectories which +# will be created under each first-level directory. The default +# is 256. +# +# +# ==== The aufs store type ==== +# +# "aufs" uses the same storage format as "ufs", utilizing +# POSIX-threads to avoid blocking the main Squid process on +# disk-I/O. This was formerly known in Squid as async-io. +# +# Usage: +# cache_dir aufs Directory-Name Mbytes L1 L2 [options] +# +# see argument descriptions under ufs above +# +# +# ==== The diskd store type ==== +# +# "diskd" uses the same storage format as "ufs", utilizing a +# separate process to avoid blocking the main Squid process on +# disk-I/O. +# +# Usage: +# cache_dir diskd Directory-Name Mbytes L1 L2 [options] [Q1=n] [Q2=n] +# +# see argument descriptions under ufs above +# +# Q1 specifies the number of unacknowledged I/O requests when Squid +# stops opening new files. If this many messages are in the queues, +# Squid won't open new files. Default is 64 +# +# Q2 specifies the number of unacknowledged messages when Squid +# starts blocking. If this many messages are in the queues, +# Squid blocks until it receives some replies. Default is 72 +# +# When Q1 < Q2 (the default), the cache directory is optimized +# for lower response time at the expense of a decrease in hit +# ratio. If Q1 > Q2, the cache directory is optimized for +# higher hit ratio at the expense of an increase in response +# time. +# +# +# ==== The rock store type ==== +# +# Usage: +# cache_dir rock Directory-Name Mbytes [options] +# +# The Rock Store type is a database-style storage. All cached +# entries are stored in a "database" file, using fixed-size slots. +# A single entry occupies one or more slots. +# +# If possible, Squid using Rock Store creates a dedicated kid +# process called "disker" to avoid blocking Squid worker(s) on disk +# I/O. One disker kid is created for each rock cache_dir. Diskers +# are created only when Squid, running in daemon mode, has support +# for the IpcIo disk I/O module. +# +# swap-timeout=msec: Squid will not start writing a miss to or +# reading a hit from disk if it estimates that the swap operation +# will take more than the specified number of milliseconds. By +# default and when set to zero, disables the disk I/O time limit +# enforcement. Ignored when using blocking I/O module because +# blocking synchronous I/O does not allow Squid to estimate the +# expected swap wait time. +# +# max-swap-rate=swaps/sec: Artificially limits disk access using +# the specified I/O rate limit. Swap out requests that +# would cause the average I/O rate to exceed the limit are +# delayed. Individual swap in requests (i.e., hits or reads) are +# not delayed, but they do contribute to measured swap rate and +# since they are placed in the same FIFO queue as swap out +# requests, they may wait longer if max-swap-rate is smaller. +# This is necessary on file systems that buffer "too +# many" writes and then start blocking Squid and other processes +# while committing those writes to disk. Usually used together +# with swap-timeout to avoid excessive delays and queue overflows +# when disk demand exceeds available disk "bandwidth". By default +# and when set to zero, disables the disk I/O rate limit +# enforcement. Currently supported by IpcIo module only. +# +# slot-size=bytes: The size of a database "record" used for +# storing cached responses. A cached response occupies at least +# one slot and all database I/O is done using individual slots so +# increasing this parameter leads to more disk space waste while +# decreasing it leads to more disk I/O overheads. Should be a +# multiple of your operating system I/O page size. Defaults to +# 16KBytes. A housekeeping header is stored with each slot and +# smaller slot-sizes will be rejected. The header is smaller than +# 100 bytes. +# +# +# ==== COMMON OPTIONS ==== +# +# no-store no new objects should be stored to this cache_dir. +# +# min-size=n the minimum object size in bytes this cache_dir +# will accept. It's used to restrict a cache_dir +# to only store large objects (e.g. AUFS) while +# other stores are optimized for smaller objects +# (e.g. Rock). +# Defaults to 0. +# +# max-size=n the maximum object size in bytes this cache_dir +# supports. +# The value in maximum_object_size directive sets +# the default unless more specific details are +# available (ie a small store capacity). +# +# Note: To make optimal use of the max-size limits you should order +# the cache_dir lines with the smallest max-size value first. +# +#Default: +# No disk cache. Store cache ojects only in memory. +# + +# Uncomment and adjust the following to add a disk cache directory. +#cache_dir ufs /var/spool/squid 100 16 256 + +# TAG: store_dir_select_algorithm +# How Squid selects which cache_dir to use when the response +# object will fit into more than one. +# +# Regardless of which algorithm is used the cache_dir min-size +# and max-size parameters are obeyed. As such they can affect +# the selection algorithm by limiting the set of considered +# cache_dir. +# +# Algorithms: +# +# least-load +# +# This algorithm is suited to caches with similar cache_dir +# sizes and disk speeds. +# +# The disk with the least I/O pending is selected. +# When there are multiple disks with the same I/O load ranking +# the cache_dir with most available capacity is selected. +# +# When a mix of cache_dir sizes are configured the faster disks +# have a naturally lower I/O loading and larger disks have more +# capacity. So space used to store objects and data throughput +# may be very unbalanced towards larger disks. +# +# +# round-robin +# +# This algorithm is suited to caches with unequal cache_dir +# disk sizes. +# +# Each cache_dir is selected in a rotation. The next suitable +# cache_dir is used. +# +# Available cache_dir capacity is only considered in relation +# to whether the object will fit and meets the min-size and +# max-size parameters. +# +# Disk I/O loading is only considered to prevent overload on slow +# disks. This algorithm does not spread objects by size, so any +# I/O loading per-disk may appear very unbalanced and volatile. +# +# If several cache_dirs use similar min-size, max-size, or other +# limits to to reject certain responses, then do not group such +# cache_dir lines together, to avoid round-robin selection bias +# towards the first cache_dir after the group. Instead, interleave +# cache_dir lines from different groups. For example: +# +# store_dir_select_algorithm round-robin +# cache_dir rock /hdd1 ... min-size=100000 +# cache_dir rock /ssd1 ... max-size=99999 +# cache_dir rock /hdd2 ... min-size=100000 +# cache_dir rock /ssd2 ... max-size=99999 +# cache_dir rock /hdd3 ... min-size=100000 +# cache_dir rock /ssd3 ... max-size=99999 +#Default: +# store_dir_select_algorithm least-load + +# TAG: max_open_disk_fds +# To avoid having disk as the I/O bottleneck Squid can optionally +# bypass the on-disk cache if more than this amount of disk file +# descriptors are open. +# +# A value of 0 indicates no limit. +#Default: +# no limit + +# TAG: cache_swap_low (percent, 0-100) +# The low-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above this low-water mark and attempts to maintain utilization +# near the low-water mark. +# +# As swap utilization increases towards the high-water mark set +# by cache_swap_high object eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_high and cache_replacement_policy +#Default: +# cache_swap_low 90 + +# TAG: cache_swap_high (percent, 0-100) +# The high-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above the low-water mark set by cache_swap_low and attempts to +# maintain utilization near the low-water mark. +# +# As swap utilization increases towards this high-water mark object +# eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_low and cache_replacement_policy +#Default: +# cache_swap_high 95 + +# LOGFILE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: logformat +# Usage: +# +# logformat +# +# Defines an access log format. +# +# The is a string with embedded % format codes +# +# % format codes all follow the same basic structure where all but +# the formatcode is optional. Output strings are automatically escaped +# as required according to their context and the output format +# modifiers are usually not needed, but can be specified if an explicit +# output format is desired. +# +# % ["|[|'|#] [-] [[0]width] [{argument}] formatcode +# +# " output in quoted string format +# [ output in squid text log format as used by log_mime_hdrs +# # output in URL quoted format +# ' output as-is +# +# - left aligned +# +# width minimum and/or maximum field width: +# [width_min][.width_max] +# When minimum starts with 0, the field is zero-padded. +# String values exceeding maximum width are truncated. +# +# {arg} argument such as header name etc +# +# Format codes: +# +# % a literal % character +# sn Unique sequence number per log line entry +# err_code The ID of an error response served by Squid or +# a similar internal error identifier. +# err_detail Additional err_code-dependent error information. +# note The annotation specified by the argument. Also +# logs the adaptation meta headers set by the +# adaptation_meta configuration parameter. +# If no argument given all annotations logged. +# The argument may include a separator to use with +# annotation values: +# name[:separator] +# By default, multiple note values are separated with "," +# and multiple notes are separated with "\r\n". +# When logging named notes with %{name}note, the +# explicitly configured separator is used between note +# values. When logging all notes with %note, the +# explicitly configured separator is used between +# individual notes. There is currently no way to +# specify both value and notes separators when logging +# all notes with %note. +# +# Connection related format codes: +# +# >a Client source IP address +# >A Client FQDN +# >p Client source port +# >eui Client source EUI (MAC address, EUI-48 or EUI-64 identifier) +# >la Local IP address the client connected to +# >lp Local port number the client connected to +# >qos Client connection TOS/DSCP value set by Squid +# >nfmark Client connection netfilter mark set by Squid +# +# la Local listening IP address the client connection was connected to. +# lp Local listening port number the client connection was connected to. +# +# . format. +# Currently, Squid considers the master transaction +# started when a complete HTTP request header initiating +# the transaction is received from the client. This is +# the same value that Squid uses to calculate transaction +# response time when logging %tr to access.log. Currently, +# Squid uses millisecond resolution for %tS values, +# similar to the default access.log "current time" field +# (%ts.%03tu). +# +# Access Control related format codes: +# +# et Tag returned by external acl +# ea Log string returned by external acl +# un User name (any available) +# ul User name from authentication +# ue User name from external acl helper +# ui User name from ident +# un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul +# - user name supplied by an external ACL, like %ue +# - SSL client name, like %us +# - ident user name, like %ui +# credentials Client credentials. The exact meaning depends on +# the authentication scheme: For Basic authentication, +# it is the password; for Digest, the realm sent by the +# client; for NTLM and Negotiate, the client challenge +# or client credentials prefixed with "YR " or "KK ". +# +# HTTP related format codes: +# +# REQUEST +# +# [http::]rm Request method (GET/POST etc) +# [http::]>rm Request method from client +# [http::]ru Request URL from client +# [http::]rs Request URL scheme from client +# [http::]rd Request URL domain from client +# [http::]rP Request URL port from client +# [http::]rp Request URL path excluding hostname from client +# [http::]rv Request protocol version from client +# [http::]h Original received request header. +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Accepts optional header field name/value filter +# argument using name[:[separator]element] format. +# [http::]>ha Received request header after adaptation and +# redirection (pre-cache REQMOD vectoring point). +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Optional header name argument as for >h +# +# +# RESPONSE +# +# [http::]Hs HTTP status code sent to the client +# +# [http::]h +# +# [http::]mt MIME content type +# +# +# SIZE COUNTERS +# +# [http::]st Total size of request + reply traffic with client +# [http::]>st Total size of request received from client. +# Excluding chunked encoding bytes. +# [http::]sh Size of request headers received from client +# [http::]sni SSL client SNI sent to Squid. Available only +# after the peek, stare, or splice SSL bumping +# actions. +# +# If ICAP is enabled, the following code becomes available (as +# well as ICAP log codes documented with the icap_log option): +# +# icap::tt Total ICAP processing time for the HTTP +# transaction. The timer ticks when ICAP +# ACLs are checked and when ICAP +# transaction is in progress. +# +# If adaptation is enabled the following three codes become available: +# +# adapt::cert_subject The Subject field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Subject often has spaces. +# +# %ssl::>cert_issuer The Issuer field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Issuer often has spaces. +# +# The default formats available (which do not need re-defining) are: +# +#logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %h" "%{User-Agent}>h" %Ss:%Sh +#logformat referrer %ts.%03tu %>a %{Referer}>h %ru +#logformat useragent %>a [%tl] "%{User-Agent}>h" +# +# NOTE: When the log_mime_hdrs directive is set to ON. +# The squid, common and combined formats have a safely encoded copy +# of the mime headers appended to each line within a pair of brackets. +# +# NOTE: The common and combined formats are not quite true to the Apache definition. +# The logs from Squid contain an extra status and hierarchy code appended. +# +#Default: +# The format definitions squid, common, combined, referrer, useragent are built in. + +# TAG: access_log +# Configures whether and how Squid logs HTTP and ICP transactions. +# If access logging is enabled, a single line is logged for every +# matching HTTP or ICP request. The recommended directive formats are: +# +# access_log : [option ...] [acl acl ...] +# access_log none [acl acl ...] +# +# The following directive format is accepted but may be deprecated: +# access_log : [ [acl acl ...]] +# +# In most cases, the first ACL name must not contain the '=' character +# and should not be equal to an existing logformat name. You can always +# start with an 'all' ACL to work around those restrictions. +# +# Will log to the specified module:place using the specified format (which +# must be defined in a logformat directive) those entries which match +# ALL the acl's specified (which must be defined in acl clauses). +# If no acl is specified, all requests will be logged to this destination. +# +# ===== Available options for the recommended directive format ===== +# +# logformat=name Names log line format (either built-in or +# defined by a logformat directive). Defaults +# to 'squid'. +# +# buffer-size=64KB Defines approximate buffering limit for log +# records (see buffered_logs). Squid should not +# keep more than the specified size and, hence, +# should flush records before the buffer becomes +# full to avoid overflows under normal +# conditions (the exact flushing algorithm is +# module-dependent though). The on-error option +# controls overflow handling. +# +# on-error=die|drop Defines action on unrecoverable errors. The +# 'drop' action ignores (i.e., does not log) +# affected log records. The default 'die' action +# kills the affected worker. The drop action +# support has not been tested for modules other +# than tcp. +# +# ===== Modules Currently available ===== +# +# none Do not log any requests matching these ACL. +# Do not specify Place or logformat name. +# +# stdio Write each log line to disk immediately at the completion of +# each request. +# Place: the filename and path to be written. +# +# daemon Very similar to stdio. But instead of writing to disk the log +# line is passed to a daemon helper for asychronous handling instead. +# Place: varies depending on the daemon. +# +# log_file_daemon Place: the file name and path to be written. +# +# syslog To log each request via syslog facility. +# Place: The syslog facility and priority level for these entries. +# Place Format: facility.priority +# +# where facility could be any of: +# authpriv, daemon, local0 ... local7 or user. +# +# And priority could be any of: +# err, warning, notice, info, debug. +# +# udp To send each log line as text data to a UDP receiver. +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# tcp To send each log line as text data to a TCP receiver. +# Lines may be accumulated before sending (see buffered_logs). +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# Default: +# access_log daemon:/var/log/squid/access.log squid +#Default: +# access_log daemon:/var/log/squid/access.log squid + +# TAG: icap_log +# ICAP log files record ICAP transaction summaries, one line per +# transaction. +# +# The icap_log option format is: +# icap_log [ [acl acl ...]] +# icap_log none [acl acl ...]] +# +# Please see access_log option documentation for details. The two +# kinds of logs share the overall configuration approach and many +# features. +# +# ICAP processing of a single HTTP message or transaction may +# require multiple ICAP transactions. In such cases, multiple +# ICAP transaction log lines will correspond to a single access +# log line. +# +# ICAP log supports many access.log logformat %codes. In ICAP context, +# HTTP message-related %codes are applied to the HTTP message embedded +# in an ICAP message. Logformat "%http::>..." codes are used for HTTP +# messages embedded in ICAP requests while "%http::<..." codes are used +# for HTTP messages embedded in ICAP responses. For example: +# +# http::>h To-be-adapted HTTP message headers sent by Squid to +# the ICAP service. For REQMOD transactions, these are +# HTTP request headers. For RESPMOD, these are HTTP +# response headers, but Squid currently cannot log them +# (i.e., %http::>h will expand to "-" for RESPMOD). +# +# http::st The total size of the ICAP request sent to the ICAP +# server (ICAP headers + ICAP body), including chunking +# metadata (if any). +# +# icap::h ICAP request header(s). Similar to >h. +# +# icap::A %icap::to/%03icap::Hs %icap::\n - logfile data +# R\n - rotate file +# T\n - truncate file +# O\n - reopen file +# F\n - flush file +# r\n - set rotate count to +# b\n - 1 = buffer output, 0 = don't buffer output +# +# No responses is expected. +#Default: +# logfile_daemon /usr/lib/squid/log_file_daemon + +# TAG: stats_collection allow|deny acl acl... +# This options allows you to control which requests gets accounted +# in performance counters. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow logging for all transactions. + +# TAG: cache_store_log +# Logs the activities of the storage manager. Shows which +# objects are ejected from the cache, and which objects are +# saved and for how long. +# There are not really utilities to analyze this data, so you can safely +# disable it (the default). +# +# Store log uses modular logging outputs. See access_log for the list +# of modules supported. +# +# Example: +# cache_store_log stdio:/var/log/squid/store.log +# cache_store_log daemon:/var/log/squid/store.log +#Default: +# none + +# TAG: cache_swap_state +# Location for the cache "swap.state" file. This index file holds +# the metadata of objects saved on disk. It is used to rebuild +# the cache during startup. Normally this file resides in each +# 'cache_dir' directory, but you may specify an alternate +# pathname here. Note you must give a full filename, not just +# a directory. Since this is the index for the whole object +# list you CANNOT periodically rotate it! +# +# If %s can be used in the file name it will be replaced with a +# a representation of the cache_dir name where each / is replaced +# with '.'. This is needed to allow adding/removing cache_dir +# lines when cache_swap_log is being used. +# +# If have more than one 'cache_dir', and %s is not used in the name +# these swap logs will have names such as: +# +# cache_swap_log.00 +# cache_swap_log.01 +# cache_swap_log.02 +# +# The numbered extension (which is added automatically) +# corresponds to the order of the 'cache_dir' lines in this +# configuration file. If you change the order of the 'cache_dir' +# lines in this file, these index files will NOT correspond to +# the correct 'cache_dir' entry (unless you manually rename +# them). We recommend you do NOT use this option. It is +# better to keep these index files in each 'cache_dir' directory. +#Default: +# Store the journal inside its cache_dir + +# TAG: logfile_rotate +# Specifies the number of logfile rotations to make when you +# type 'squid -k rotate'. The default is 10, which will rotate +# with extensions 0 through 9. Setting logfile_rotate to 0 will +# disable the file name rotation, but the logfiles are still closed +# and re-opened. This will enable you to rename the logfiles +# yourself just before sending the rotate signal. +# +# Note, the 'squid -k rotate' command normally sends a USR1 +# signal to the running squid process. In certain situations +# (e.g. on Linux with Async I/O), USR1 is used for other +# purposes, so -k rotate uses another signal. It is best to get +# in the habit of using 'squid -k rotate' instead of 'kill -USR1 +# '. +# +# Note, from Squid-3.1 this option is only a default for cache.log, +# that log can be rotated separately by using debug_options. +# +# Note2, for Debian/Linux the default of logfile_rotate is +# zero, since it includes external logfile-rotation methods. +#Default: +# logfile_rotate 0 + +# TAG: mime_table +# Path to Squid's icon configuration file. +# +# You shouldn't need to change this, but the default file contains +# examples and formatting information if you do. +#Default: +# mime_table /usr/share/squid/mime.conf + +# TAG: log_mime_hdrs on|off +# The Cache can record both the request and the response MIME +# headers for each HTTP transaction. The headers are encoded +# safely and will appear as two bracketed fields at the end of +# the access log (for either the native or httpd-emulated log +# formats). To enable this logging set log_mime_hdrs to 'on'. +#Default: +# log_mime_hdrs off + +# TAG: pid_filename +# A filename to write the process-id to. To disable, enter "none". +#Default: +# pid_filename /var/run/squid.pid + +# TAG: client_netmask +# A netmask for client addresses in logfiles and cachemgr output. +# Change this to protect the privacy of your cache clients. +# A netmask of 255.255.255.0 will log all IP's in that range with +# the last digit set to '0'. +#Default: +# Log full client IP address + +# TAG: strip_query_terms +# By default, Squid strips query terms from requested URLs before +# logging. This protects your user's privacy and reduces log size. +# +# When investigating HIT/MISS or other caching behaviour you +# will need to disable this to see the full URL used by Squid. +#Default: +# strip_query_terms on + +# TAG: buffered_logs on|off +# Whether to write/send access_log records ASAP or accumulate them and +# then write/send them in larger chunks. Buffering may improve +# performance because it decreases the number of I/Os. However, +# buffering increases the delay before log records become available to +# the final recipient (e.g., a disk file or logging daemon) and, +# hence, increases the risk of log records loss. +# +# Note that even when buffered_logs are off, Squid may have to buffer +# records if it cannot write/send them immediately due to pending I/Os +# (e.g., the I/O writing the previous log record) or connectivity loss. +# +# Currently honored by 'daemon' and 'tcp' access_log modules only. +#Default: +# buffered_logs off + +# TAG: netdb_filename +# Where Squid stores it's netdb journal. +# When enabled this journal preserves netdb state between restarts. +# +# To disable, enter "none". +#Default: +# netdb_filename stdio:/var/log/squid/netdb.state + +# OPTIONS FOR TROUBLESHOOTING +# ----------------------------------------------------------------------------- + +# TAG: cache_log +# Squid administrative logging file. +# +# This is where general information about Squid behavior goes. You can +# increase the amount of data logged to this file and how often it is +# rotated with "debug_options" +#Default: +# cache_log /var/log/squid/cache.log + +# TAG: debug_options +# Logging options are set as section,level where each source file +# is assigned a unique section. Lower levels result in less +# output, Full debugging (level 9) can result in a very large +# log file, so be careful. +# +# The magic word "ALL" sets debugging levels for all sections. +# The default is to run with "ALL,1" to record important warnings. +# +# The rotate=N option can be used to keep more or less of these logs +# than would otherwise be kept by logfile_rotate. +# For most uses a single log should be enough to monitor current +# events affecting Squid. +#Default: +# Log all critical and important messages. + +# TAG: coredump_dir +# By default Squid leaves core files in the directory from where +# it was started. If you set 'coredump_dir' to a directory +# that exists, Squid will chdir() to that directory at startup +# and coredump files will be left there. +# +#Default: +# Use the directory from where Squid was started. +# + +# Leave coredumps in the first cache dir +coredump_dir /var/spool/squid + +# OPTIONS FOR FTP GATEWAYING +# ----------------------------------------------------------------------------- + +# TAG: ftp_user +# If you want the anonymous login password to be more informative +# (and enable the use of picky FTP servers), set this to something +# reasonable for your domain, like wwwuser@somewhere.net +# +# The reason why this is domainless by default is the +# request can be made on the behalf of a user in any domain, +# depending on how the cache is used. +# Some FTP server also validate the email address is valid +# (for example perl.com). +#Default: +# ftp_user Squid@ + +# TAG: ftp_passive +# If your firewall does not allow Squid to use passive +# connections, turn off this option. +# +# Use of ftp_epsv_all option requires this to be ON. +#Default: +# ftp_passive on + +# TAG: ftp_epsv_all +# FTP Protocol extensions permit the use of a special "EPSV ALL" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator, as the EPRT command will never be used and therefore, +# translation of the data portion of the segments will never be needed. +# +# When a client only expects to do two-way FTP transfers this may be +# useful. +# If squid finds that it must do a three-way FTP transfer after issuing +# an EPSV ALL command, the FTP session will fail. +# +# If you have any doubts about this option do not use it. +# Squid will nicely attempt all other connection methods. +# +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# ftp_epsv_all off + +# TAG: ftp_epsv +# FTP Protocol extensions permit the use of a special "EPSV" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator using EPSV, as the EPRT command will never be used +# and therefore, translation of the data portion of the segments +# will never be needed. +# +# EPSV is often required to interoperate with FTP servers on IPv6 +# networks. On the other hand, it may break some IPv4 servers. +# +# By default, EPSV may try EPSV with any FTP server. To fine tune +# that decision, you may restrict EPSV to certain clients or servers +# using ACLs: +# +# ftp_epsv allow|deny al1 acl2 ... +# +# WARNING: Disabling EPSV may cause problems with external NAT and IPv6. +# +# Only fast ACLs are supported. +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# none + +# TAG: ftp_eprt +# FTP Protocol extensions permit the use of a special "EPRT" command. +# +# This extension provides a protocol neutral alternative to the +# IPv4-only PORT command. When supported it enables active FTP data +# channels over IPv6 and efficient NAT handling. +# +# Turning this OFF will prevent EPRT being attempted and will skip +# straight to using PORT for IPv4 servers. +# +# Some devices are known to not handle this extension correctly and +# may result in crashes. Devices which suport EPRT enough to fail +# cleanly will result in Squid attempting PORT anyway. This directive +# should only be disabled when EPRT results in device failures. +# +# WARNING: Doing so will convert Squid back to the old behavior with all +# the related problems with external NAT devices/layers and IPv4-only FTP. +#Default: +# ftp_eprt on + +# TAG: ftp_sanitycheck +# For security and data integrity reasons Squid by default performs +# sanity checks of the addresses of FTP data connections ensure the +# data connection is to the requested server. If you need to allow +# FTP connections to servers using another IP address for the data +# connection turn this off. +#Default: +# ftp_sanitycheck on + +# TAG: ftp_telnet_protocol +# The FTP protocol is officially defined to use the telnet protocol +# as transport channel for the control connection. However, many +# implementations are broken and does not respect this aspect of +# the FTP protocol. +# +# If you have trouble accessing files with ASCII code 255 in the +# path or similar problems involving this ASCII code you can +# try setting this directive to off. If that helps, report to the +# operator of the FTP server in question that their FTP server +# is broken and does not follow the FTP standard. +#Default: +# ftp_telnet_protocol on + +# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS +# ----------------------------------------------------------------------------- + +# TAG: diskd_program +# Specify the location of the diskd executable. +# Note this is only useful if you have compiled in +# diskd as one of the store io modules. +#Default: +# diskd_program /usr/lib/squid/diskd + +# TAG: unlinkd_program +# Specify the location of the executable for file deletion process. +#Default: +# unlinkd_program /usr/lib/squid/unlinkd + +# TAG: pinger_program +# Specify the location of the executable for the pinger process. +#Default: +# pinger_program /usr/lib/squid/pinger + +# TAG: pinger_enable +# Control whether the pinger is active at run-time. +# Enables turning ICMP pinger on and off with a simple +# squid -k reconfigure. +#Default: +# pinger_enable on + +# OPTIONS FOR URL REWRITING +# ----------------------------------------------------------------------------- + +# TAG: url_rewrite_program +# Specify the location of the executable URL rewriter to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the rewriter will receive on line with the format +# +# [channel-ID ] URL [ extras] +# +# See url_rewrite_extras on how to send "extras" with optional values to +# the helper. +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK status=30N url="..." +# Redirect the URL to the one supplied in 'url='. +# 'status=' is optional and contains the status code to send +# the client in Squids HTTP response. It must be one of the +# HTTP redirect status codes: 301, 302, 303, 307, 308. +# When no status is given Squid will use 302. +# +# OK rewrite-url="..." +# Rewrite the URL to the one supplied in 'rewrite-url='. +# The new URL is fetched directly by Squid and returned to +# the client as the response to its request. +# +# OK +# When neither of url= and rewrite-url= are sent Squid does +# not change the URL. +# +# ERR +# Do not change the URL. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. The 'message=' key name is +# reserved for delivering a log message. +# +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# The TAG is treated as a regular annotation but persists across +# future requests on the client connection rather than just the +# current request. A helper may update the TAG during subsequent +# requests be returning a new kv-pair. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# WARNING: URL re-writing ability should be avoided whenever possible. +# Use the URL redirect form of response instead. +# +# Re-write creates a difference in the state held by the client +# and server. Possibly causing confusion when the server response +# contains snippets of its view state. Embeded URLs, response +# and content Location headers, etc. are not re-written by this +# interface. +# +# By default, a URL rewriter is not used. +#Default: +# none + +# TAG: url_rewrite_children +# The maximum number of redirector processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# URLs, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each redirector helper can handle in +# parallel. Defaults to 0 which indicates the redirector +# is a old-style single threaded redirector. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# url_rewrite_children 20 startup=0 idle=1 concurrency=0 + +# TAG: url_rewrite_host_header +# To preserve same-origin security policies in browsers and +# prevent Host: header forgery by redirectors Squid rewrites +# any Host: header in redirected requests. +# +# If you are running an accelerator this may not be a wanted +# effect of a redirector. This directive enables you disable +# Host: alteration in reverse-proxy traffic. +# +# WARNING: Entries are cached on the result of the URL rewriting +# process, so be careful if you have domain-virtual hosts. +# +# WARNING: Squid and other software verifies the URL and Host +# are matching, so be careful not to relay through other proxies +# or inspecting firewalls with this disabled. +#Default: +# url_rewrite_host_header on + +# TAG: url_rewrite_access +# If defined, this access list specifies which requests are +# sent to the redirector processes. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: url_rewrite_bypass +# When this is 'on', a request will not go through the +# redirector if all the helpers are busy. If this is 'off' +# and the redirector queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# redirectors. You should only enable this if the redirectors +# are not critical to your caching system. If you use +# redirectors for access control, and you enable this option, +# users may have access to pages they should not +# be allowed to request. +#Default: +# url_rewrite_bypass off + +# TAG: url_rewrite_extras +# Specifies a string to be append to request line format for the +# rewriter helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# url_rewrite_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# OPTIONS FOR STORE ID +# ----------------------------------------------------------------------------- + +# TAG: store_id_program +# Specify the location of the executable StoreID helper to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the helper will receive one line with the format +# +# [channel-ID ] URL [ extras] +# +# +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK store-id="..." +# Use the StoreID supplied in 'store-id='. +# +# ERR +# The default is to use HTTP request URL as the store ID. +# +# BH +# An internal error occured in the helper, preventing +# a result being identified. +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation for this +# kv-pair +# +# Helper programs should be prepared to receive and possibly ignore +# additional whitespace-separated tokens on each input line. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# NOTE: when using StoreID refresh_pattern will apply to the StoreID +# returned from the helper and not the URL. +# +# WARNING: Wrong StoreID value returned by a careless helper may result +# in the wrong cached response returned to the user. +# +# By default, a StoreID helper is not used. +#Default: +# none + +# TAG: store_id_extras +# Specifies a string to be append to request line format for the +# StoreId helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# TAG: store_id_children +# The maximum number of StoreID helper processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# requests, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each storeID helper can handle in +# parallel. Defaults to 0 which indicates the helper +# is a old-style single threaded program. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# store_id_children 20 startup=0 idle=1 concurrency=0 + +# TAG: store_id_access +# If defined, this access list specifies which requests are +# sent to the StoreID processes. By default all requests +# are sent. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: store_id_bypass +# When this is 'on', a request will not go through the +# helper if all helpers are busy. If this is 'off' +# and the helper queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# helpers. You should only enable this if the helperss +# are not critical to your caching system. If you use +# helpers for critical caching components, and you enable this +# option, users may not get objects from cache. +#Default: +# store_id_bypass on + +# OPTIONS FOR TUNING THE CACHE +# ----------------------------------------------------------------------------- + +# TAG: cache +# Requests denied by this directive will not be served from the cache +# and their responses will not be stored in the cache. This directive +# has no effect on other transactions and on already cached responses. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# This and the two other similar caching directives listed below are +# checked at different transaction processing stages, have different +# access to response information, affect different cache operations, +# and differ in slow ACLs support: +# +# * cache: Checked before Squid makes a hit/miss determination. +# No access to reply information! +# Denies both serving a hit and storing a miss. +# Supports both fast and slow ACLs. +# * send_hit: Checked after a hit was detected. +# Has access to reply (hit) information. +# Denies serving a hit only. +# Supports fast ACLs only. +# * store_miss: Checked before storing a cachable miss. +# Has access to reply (miss) information. +# Denies storing a miss only. +# Supports fast ACLs only. +# +# If you are not sure which of the three directives to use, apply the +# following decision logic: +# +# * If your ACL(s) are of slow type _and_ need response info, redesign. +# Squid does not support that particular combination at this time. +# Otherwise: +# * If your directive ACL(s) are of slow type, use "cache"; and/or +# * if your directive ACL(s) need no response info, use "cache". +# Otherwise: +# * If you do not want the response cached, use store_miss; and/or +# * if you do not want a hit on a cached response, use send_hit. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: send_hit +# Responses denied by this directive will not be served from the cache +# (but may still be cached, see store_miss). This directive has no +# effect on the responses it allows and on the cached objects. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. +# +# Unlike the "cache" directive, send_hit only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# For example: +# +# # apply custom Store ID mapping to some URLs +# acl MapMe dstdomain .c.example.com +# store_id_program ... +# store_id_access allow MapMe +# +# # but prevent caching of special responses +# # such as 302 redirects that cause StoreID loops +# acl Ordinary http_status 200-299 +# store_miss deny MapMe !Ordinary +# +# # and do not serve any previously stored special responses +# # from the cache (in case they were already cached before +# # the above store_miss rule was in effect). +# send_hit deny MapMe !Ordinary +#Default: +# By default, this directive is unused and has no effect. + +# TAG: store_miss +# Responses denied by this directive will not be cached (but may still +# be served from the cache, see send_hit). This directive has no +# effect on the responses it allows and on the already cached responses. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. See the +# send_hit directive for a usage example. +# +# Unlike the "cache" directive, store_miss only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: max_stale time-units +# This option puts an upper limit on how stale content Squid +# will serve from the cache if cache validation fails. +# Can be overriden by the refresh_pattern max-stale option. +#Default: +# max_stale 1 week + +# TAG: refresh_pattern +# usage: refresh_pattern [-i] regex min percent max [options] +# +# By default, regular expressions are CASE-SENSITIVE. To make +# them case-insensitive, use the -i option. +# +# 'Min' is the time (in minutes) an object without an explicit +# expiry time should be considered fresh. The recommended +# value is 0, any higher values may cause dynamic applications +# to be erroneously cached unless the application designer +# has taken the appropriate actions. +# +# 'Percent' is a percentage of the objects age (time since last +# modification age) an object without explicit expiry time +# will be considered fresh. +# +# 'Max' is an upper limit on how long objects without an explicit +# expiry time will be considered fresh. The value is also used +# to form Cache-Control: max-age header for a request sent from +# Squid to origin/parent. +# +# options: override-expire +# override-lastmod +# reload-into-ims +# ignore-reload +# ignore-no-store +# ignore-must-revalidate +# ignore-private +# ignore-auth +# max-stale=NN +# refresh-ims +# store-stale +# +# override-expire enforces min age even if the server +# sent an explicit expiry time (e.g., with the +# Expires: header or Cache-Control: max-age). Doing this +# VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# Note: override-expire does not enforce staleness - it only extends +# freshness / min. If the server returns a Expires time which +# is longer than your max time, Squid will still consider +# the object fresh for that period of time. +# +# override-lastmod enforces min age even on objects +# that were modified recently. +# +# reload-into-ims changes a client no-cache or ``reload'' +# request for a cached entry into a conditional request using +# If-Modified-Since and/or If-None-Match headers, provided the +# cached entry has a Last-Modified and/or a strong ETag header. +# Doing this VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# ignore-reload ignores a client no-cache or ``reload'' +# header. Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which +# it causes. +# +# ignore-no-store ignores any ``Cache-control: no-store'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-must-revalidate ignores any ``Cache-Control: must-revalidate`` +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-private ignores any ``Cache-control: private'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-auth caches responses to requests with authorization, +# as if the originserver had sent ``Cache-control: public'' +# in the response header. Doing this VIOLATES the HTTP standard. +# Enabling this feature could make you liable for problems which +# it causes. +# +# refresh-ims causes squid to contact the origin server +# when a client issues an If-Modified-Since request. This +# ensures that the client will receive an updated version +# if one is available. +# +# store-stale stores responses even if they don't have explicit +# freshness or a validator (i.e., Last-Modified or an ETag) +# present, or if they're already stale. By default, Squid will +# not cache such responses because they usually can't be +# reused. Note that such responses will be stale by default. +# +# max-stale=NN provide a maximum staleness factor. Squid won't +# serve objects more stale than this even if it failed to +# validate the object. Default: use the max_stale global limit. +# +# Basically a cached object is: +# +# FRESH if expire > now, else STALE +# STALE if age > max +# FRESH if lm-factor < percent, else STALE +# FRESH if age < min +# else STALE +# +# The refresh_pattern lines are checked in the order listed here. +# The first entry which matches is used. If none of the entries +# match the default will be used. +# +# Note, you must uncomment all the default lines if you want +# to change one. The default setting is only active if none is +# used. +# +# + +# +# Add any of your own refresh_pattern entries above these. +# +refresh_pattern ^ftp: 1440 20% 10080 +refresh_pattern ^gopher: 1440 0% 1440 +refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 +refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 +# example lin deb packages +#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600 +refresh_pattern . 0 20% 4320 + +# TAG: quick_abort_min (KB) +#Default: +# quick_abort_min 16 KB + +# TAG: quick_abort_max (KB) +#Default: +# quick_abort_max 16 KB + +# TAG: quick_abort_pct (percent) +# The cache by default continues downloading aborted requests +# which are almost completed (less than 16 KB remaining). This +# may be undesirable on slow (e.g. SLIP) links and/or very busy +# caches. Impatient users may tie up file descriptors and +# bandwidth by repeatedly requesting and immediately aborting +# downloads. +# +# When the user aborts a request, Squid will check the +# quick_abort values to the amount of data transferred until +# then. +# +# If the transfer has less than 'quick_abort_min' KB remaining, +# it will finish the retrieval. +# +# If the transfer has more than 'quick_abort_max' KB remaining, +# it will abort the retrieval. +# +# If more than 'quick_abort_pct' of the transfer has completed, +# it will finish the retrieval. +# +# If you do not want any retrieval to continue after the client +# has aborted, set both 'quick_abort_min' and 'quick_abort_max' +# to '0 KB'. +# +# If you want retrievals to always continue if they are being +# cached set 'quick_abort_min' to '-1 KB'. +#Default: +# quick_abort_pct 95 + +# TAG: read_ahead_gap buffer-size +# The amount of data the cache will buffer ahead of what has been +# sent to the client when retrieving an object from another server. +#Default: +# read_ahead_gap 16 KB + +# TAG: negative_ttl time-units +# Set the Default Time-to-Live (TTL) for failed requests. +# Certain types of failures (such as "connection refused" and +# "404 Not Found") are able to be negatively-cached for a short time. +# Modern web servers should provide Expires: header, however if they +# do not this can provide a minimum TTL. +# The default is not to cache errors with unknown expiry details. +# +# Note that this is different from negative caching of DNS lookups. +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +#Default: +# negative_ttl 0 seconds + +# TAG: positive_dns_ttl time-units +# Upper limit on how long Squid will cache positive DNS responses. +# Default is 6 hours (360 minutes). This directive must be set +# larger than negative_dns_ttl. +#Default: +# positive_dns_ttl 6 hours + +# TAG: negative_dns_ttl time-units +# Time-to-Live (TTL) for negative caching of failed DNS lookups. +# This also sets the lower cache limit on positive lookups. +# Minimum value is 1 second, and it is not recommendable to go +# much below 10 seconds. +#Default: +# negative_dns_ttl 1 minutes + +# TAG: range_offset_limit size [acl acl...] +# usage: (size) [units] [[!]aclname] +# +# Sets an upper limit on how far (number of bytes) into the file +# a Range request may be to cause Squid to prefetch the whole file. +# If beyond this limit, Squid forwards the Range request as it is and +# the result is NOT cached. +# +# This is to stop a far ahead range request (lets say start at 17MB) +# from making Squid fetch the whole object up to that point before +# sending anything to the client. +# +# Multiple range_offset_limit lines may be specified, and they will +# be searched from top to bottom on each request until a match is found. +# The first match found will be used. If no line matches a request, the +# default limit of 0 bytes will be used. +# +# 'size' is the limit specified as a number of units. +# +# 'units' specifies whether to use bytes, KB, MB, etc. +# If no units are specified bytes are assumed. +# +# A size of 0 causes Squid to never fetch more than the +# client requested. (default) +# +# A size of 'none' causes Squid to always fetch the object from the +# beginning so it may cache the result. (2.0 style) +# +# 'aclname' is the name of a defined ACL. +# +# NP: Using 'none' as the byte value here will override any quick_abort settings +# that may otherwise apply to the range request. The range request will +# be fully fetched from start to finish regardless of the client +# actions. This affects bandwidth usage. +#Default: +# none + +# TAG: minimum_expiry_time (seconds) +# The minimum caching time according to (Expires - Date) +# headers Squid honors if the object can't be revalidated. +# The default is 60 seconds. +# +# In reverse proxy environments it might be desirable to honor +# shorter object lifetimes. It is most likely better to make +# your server return a meaningful Last-Modified header however. +# +# In ESI environments where page fragments often have short +# lifetimes, this will often be best set to 0. +#Default: +# minimum_expiry_time 60 seconds + +# TAG: store_avg_object_size (bytes) +# Average object size, used to estimate number of objects your +# cache can hold. The default is 13 KB. +# +# This is used to pre-seed the cache index memory allocation to +# reduce expensive reallocate operations while handling clients +# traffic. Too-large values may result in memory allocation during +# peak traffic, too-small values will result in wasted memory. +# +# Check the cache manager 'info' report metrics for the real +# object sizes seen by your Squid before tuning this. +#Default: +# store_avg_object_size 13 KB + +# TAG: store_objects_per_bucket +# Target number of objects per bucket in the store hash table. +# Lowering this value increases the total number of buckets and +# also the storage maintenance rate. The default is 20. +#Default: +# store_objects_per_bucket 20 + +# HTTP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: request_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a request. +# Request headers are usually relatively small (about 512 bytes). +# Placing a limit on the request header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# request_header_max_size 64 KB + +# TAG: reply_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a reply. +# Reply headers are usually relatively small (about 512 bytes). +# Placing a limit on the reply header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# reply_header_max_size 64 KB + +# TAG: request_body_max_size (bytes) +# This specifies the maximum size for an HTTP request body. +# In other words, the maximum size of a PUT/POST request. +# A user who attempts to send a request with a body larger +# than this limit receives an "Invalid Request" error message. +# If you set this parameter to a zero (the default), there will +# be no limit imposed. +# +# See also client_request_buffer_max_size for an alternative +# limitation on client uploads which can be configured. +#Default: +# No limit. + +# TAG: client_request_buffer_max_size (bytes) +# This specifies the maximum buffer size of a client request. +# It prevents squid eating too much memory when somebody uploads +# a large file. +#Default: +# client_request_buffer_max_size 512 KB + +# TAG: broken_posts +# A list of ACL elements which, if matched, causes Squid to send +# an extra CRLF pair after the body of a PUT/POST request. +# +# Some HTTP servers has broken implementations of PUT/POST, +# and rely on an extra CRLF pair sent by some WWW clients. +# +# Quote from RFC2616 section 4.1 on this matter: +# +# Note: certain buggy HTTP/1.0 client implementations generate an +# extra CRLF's after a POST request. To restate what is explicitly +# forbidden by the BNF, an HTTP/1.1 client must not preface or follow +# a request with an extra CRLF. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# acl buggy_server url_regex ^http://.... +# broken_posts allow buggy_server +#Default: +# Obey RFC 2616. + +# TAG: adaptation_uses_indirect_client on|off +# Controls whether the indirect client IP address (instead of the direct +# client IP address) is passed to adaptation services. +# +# See also: follow_x_forwarded_for adaptation_send_client_ip +#Default: +# adaptation_uses_indirect_client on + +# TAG: via on|off +# If set (default), Squid will include a Via header in requests and +# replies as required by RFC2616. +#Default: +# via on + +# TAG: ie_refresh on|off +# Microsoft Internet Explorer up until version 5.5 Service +# Pack 1 has an issue with transparent proxies, wherein it +# is impossible to force a refresh. Turning this on provides +# a partial fix to the problem, by causing all IMS-REFRESH +# requests from older IE versions to check the origin server +# for fresh content. This reduces hit ratio by some amount +# (~10% in my experience), but allows users to actually get +# fresh content when they want it. Note because Squid +# cannot tell if the user is using 5.5 or 5.5SP1, the behavior +# of 5.5 is unchanged from old versions of Squid (i.e. a +# forced refresh is impossible). Newer versions of IE will, +# hopefully, continue to have the new behavior and will be +# handled based on that assumption. This option defaults to +# the old Squid behavior, which is better for hit ratios but +# worse for clients using IE, if they need to be able to +# force fresh content. +#Default: +# ie_refresh off + +# TAG: vary_ignore_expire on|off +# Many HTTP servers supporting Vary gives such objects +# immediate expiry time with no cache-control header +# when requested by a HTTP/1.0 client. This option +# enables Squid to ignore such expiry times until +# HTTP/1.1 is fully implemented. +# +# WARNING: If turned on this may eventually cause some +# varying objects not intended for caching to get cached. +#Default: +# vary_ignore_expire off + +# TAG: request_entities +# Squid defaults to deny GET and HEAD requests with request entities, +# as the meaning of such requests are undefined in the HTTP standard +# even if not explicitly forbidden. +# +# Set this directive to on if you have clients which insists +# on sending request entities in GET or HEAD requests. But be warned +# that there is server software (both proxies and web servers) which +# can fail to properly process this kind of request which may make you +# vulnerable to cache pollution attacks if enabled. +#Default: +# request_entities off + +# TAG: request_header_access +# Usage: request_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option replaces the old 'anonymize_headers' and the +# older 'http_anonymizer' option with something that is much +# more configurable. A list of ACLs for each header name allows +# removal of specific header fields under specific conditions. +# +# This option only applies to outgoing HTTP request headers (i.e., +# headers sent by Squid to the next HTTP hop such as a cache peer +# or an origin server). The option has no effect during cache hit +# detection. The equivalent adaptation vectoring point in ICAP +# terminology is post-cache REQMOD. +# +# The option is applied to individual outgoing request header +# fields. For each request header field F, Squid uses the first +# qualifying sets of request_header_access rules: +# +# 1. Rules with header_name equal to F's name. +# 2. Rules with header_name 'Other', provided F's name is not +# on the hard-coded list of commonly used HTTP header names. +# 3. Rules with header_name 'All'. +# +# Within that qualifying rule set, rule ACLs are checked as usual. +# If ACLs of an "allow" rule match, the header field is allowed to +# go through as is. If ACLs of a "deny" rule match, the header is +# removed and request_header_replace is then checked to identify +# if the removed header has a replacement. If no rules within the +# set have matching ACLs, the header field is left as is. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# request_header_access From deny all +# request_header_access Referer deny all +# request_header_access User-Agent deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# request_header_access Authorization allow all +# request_header_access Proxy-Authorization allow all +# request_header_access Cache-Control allow all +# request_header_access Content-Length allow all +# request_header_access Content-Type allow all +# request_header_access Date allow all +# request_header_access Host allow all +# request_header_access If-Modified-Since allow all +# request_header_access Pragma allow all +# request_header_access Accept allow all +# request_header_access Accept-Charset allow all +# request_header_access Accept-Encoding allow all +# request_header_access Accept-Language allow all +# request_header_access Connection allow all +# request_header_access All deny all +# +# HTTP reply headers are controlled with the reply_header_access directive. +# +# By default, all headers are allowed (no anonymizing is performed). +#Default: +# No limits. + +# TAG: reply_header_access +# Usage: reply_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option only applies to reply headers, i.e., from the +# server to the client. +# +# This is the same as request_header_access, but in the other +# direction. Please see request_header_access for detailed +# documentation. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# reply_header_access Server deny all +# reply_header_access WWW-Authenticate deny all +# reply_header_access Link deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# reply_header_access Allow allow all +# reply_header_access WWW-Authenticate allow all +# reply_header_access Proxy-Authenticate allow all +# reply_header_access Cache-Control allow all +# reply_header_access Content-Encoding allow all +# reply_header_access Content-Length allow all +# reply_header_access Content-Type allow all +# reply_header_access Date allow all +# reply_header_access Expires allow all +# reply_header_access Last-Modified allow all +# reply_header_access Location allow all +# reply_header_access Pragma allow all +# reply_header_access Content-Language allow all +# reply_header_access Retry-After allow all +# reply_header_access Title allow all +# reply_header_access Content-Disposition allow all +# reply_header_access Connection allow all +# reply_header_access All deny all +# +# HTTP request headers are controlled with the request_header_access directive. +# +# By default, all headers are allowed (no anonymizing is +# performed). +#Default: +# No limits. + +# TAG: request_header_replace +# Usage: request_header_replace header_name message +# Example: request_header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit) +# +# This option allows you to change the contents of headers +# denied with request_header_access above, by replacing them +# with some fixed string. +# +# This only applies to request headers, not reply headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: reply_header_replace +# Usage: reply_header_replace header_name message +# Example: reply_header_replace Server Foo/1.0 +# +# This option allows you to change the contents of headers +# denied with reply_header_access above, by replacing them +# with some fixed string. +# +# This only applies to reply headers, not request headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: request_header_add +# Usage: request_header_add field-name field-value acl1 [acl2] ... +# Example: request_header_add X-Client-CA "CA=%ssl::>cert_issuer" all +# +# This option adds header fields to outgoing HTTP requests (i.e., +# request headers sent by Squid to the next HTTP hop such as a +# cache peer or an origin server). The option has no effect during +# cache hit detection. The equivalent adaptation vectoring point +# in ICAP terminology is post-cache REQMOD. +# +# Field-name is a token specifying an HTTP header name. If a +# standard HTTP header name is used, Squid does not check whether +# the new header conflicts with any existing headers or violates +# HTTP rules. If the request to be modified already contains a +# field with the same name, the old field is preserved but the +# header field values are not merged. +# +# Field-value is either a token or a quoted string. If quoted +# string format is used, then the surrounding quotes are removed +# while escape sequences and %macros are processed. +# +# In theory, all of the logformat codes can be used as %macros. +# However, unlike logging (which happens at the very end of +# transaction lifetime), the transaction may not yet have enough +# information to expand a macro when the new header value is needed. +# And some information may already be available to Squid but not yet +# committed where the macro expansion code can access it (report +# such instances!). The macro will be expanded into a single dash +# ('-') in such cases. Not all macros have been tested. +# +# One or more Squid ACLs may be specified to restrict header +# injection to matching requests. As always in squid.conf, all +# ACLs in an option ACL list must be satisfied for the insertion +# to happen. The request_header_add option supports fast ACLs +# only. +#Default: +# none + +# TAG: note +# This option used to log custom information about the master +# transaction. For example, an admin may configure Squid to log +# which "user group" the transaction belongs to, where "user group" +# will be determined based on a set of ACLs and not [just] +# authentication information. +# Values of key/value pairs can be logged using %{key}note macros: +# +# note key value acl ... +# logformat myFormat ... %{key}note ... +#Default: +# none + +# TAG: relaxed_header_parser on|off|warn +# In the default "on" setting Squid accepts certain forms +# of non-compliant HTTP messages where it is unambiguous +# what the sending application intended even if the message +# is not correctly formatted. The messages is then normalized +# to the correct form when forwarded by Squid. +# +# If set to "warn" then a warning will be emitted in cache.log +# each time such HTTP error is encountered. +# +# If set to "off" then such HTTP errors will cause the request +# or response to be rejected. +#Default: +# relaxed_header_parser on + +# TAG: collapsed_forwarding (on|off) +# When enabled, instead of forwarding each concurrent request for +# the same URL, Squid just sends the first of them. The other, so +# called "collapsed" requests, wait for the response to the first +# request and, if it happens to be cachable, use that response. +# Here, "concurrent requests" means "received after the first +# request headers were parsed and before the corresponding response +# headers were parsed". +# +# This feature is disabled by default: enabling collapsed +# forwarding needlessly delays forwarding requests that look +# cachable (when they are collapsed) but then need to be forwarded +# individually anyway because they end up being for uncachable +# content. However, in some cases, such as acceleration of highly +# cachable content with periodic or grouped expiration times, the +# gains from collapsing [large volumes of simultaneous refresh +# requests] outweigh losses from such delays. +# +# Squid collapses two kinds of requests: regular client requests +# received on one of the listening ports and internal "cache +# revalidation" requests which are triggered by those regular +# requests hitting a stale cached object. Revalidation collapsing +# is currently disabled for Squid instances containing SMP-aware +# disk or memory caches and for Vary-controlled cached objects. +#Default: +# collapsed_forwarding off + +# TIMEOUTS +# ----------------------------------------------------------------------------- + +# TAG: forward_timeout time-units +# This parameter specifies how long Squid should at most attempt in +# finding a forwarding path for the request before giving up. +#Default: +# forward_timeout 4 minutes + +# TAG: connect_timeout time-units +# This parameter specifies how long to wait for the TCP connect to +# the requested server or peer to complete before Squid should +# attempt to find another path where to forward the request. +#Default: +# connect_timeout 1 minute + +# TAG: peer_connect_timeout time-units +# This parameter specifies how long to wait for a pending TCP +# connection to a peer cache. The default is 30 seconds. You +# may also set different timeout values for individual neighbors +# with the 'connect-timeout' option on a 'cache_peer' line. +#Default: +# peer_connect_timeout 30 seconds + +# TAG: read_timeout time-units +# Applied on peer server connections. +# +# After each successful read(), the timeout will be extended by this +# amount. If no data is read again after this amount of time, +# the request is aborted and logged with ERR_READ_TIMEOUT. +# +# The default is 15 minutes. +#Default: +# read_timeout 15 minutes + +# TAG: write_timeout time-units +# This timeout is tracked for all connections that have data +# available for writing and are waiting for the socket to become +# ready. After each successful write, the timeout is extended by +# the configured amount. If Squid has data to write but the +# connection is not ready for the configured duration, the +# transaction associated with the connection is terminated. The +# default is 15 minutes. +#Default: +# write_timeout 15 minutes + +# TAG: request_timeout +# How long to wait for complete HTTP request headers after initial +# connection establishment. +#Default: +# request_timeout 5 minutes + +# TAG: client_idle_pconn_timeout +# How long to wait for the next HTTP request on a persistent +# client connection after the previous request completes. +#Default: +# client_idle_pconn_timeout 2 minutes + +# TAG: ftp_client_idle_timeout +# How long to wait for an FTP request on a connection to Squid ftp_port. +# Many FTP clients do not deal with idle connection closures well, +# necessitating a longer default timeout than client_idle_pconn_timeout +# used for incoming HTTP requests. +#Default: +# ftp_client_idle_timeout 30 minutes + +# TAG: client_lifetime time-units +# The maximum amount of time a client (browser) is allowed to +# remain connected to the cache process. This protects the Cache +# from having a lot of sockets (and hence file descriptors) tied up +# in a CLOSE_WAIT state from remote clients that go away without +# properly shutting down (either because of a network failure or +# because of a poor client implementation). The default is one +# day, 1440 minutes. +# +# NOTE: The default value is intended to be much larger than any +# client would ever need to be connected to your cache. You +# should probably change client_lifetime only as a last resort. +# If you seem to have many client connections tying up +# filedescriptors, we recommend first tuning the read_timeout, +# request_timeout, persistent_request_timeout and quick_abort values. +#Default: +# client_lifetime 1 day + +# TAG: half_closed_clients +# Some clients may shutdown the sending side of their TCP +# connections, while leaving their receiving sides open. Sometimes, +# Squid can not tell the difference between a half-closed and a +# fully-closed TCP connection. +# +# By default, Squid will immediately close client connections when +# read(2) returns "no more data to read." +# +# Change this option to 'on' and Squid will keep open connections +# until a read(2) or write(2) on the socket returns an error. +# This may show some benefits for reverse proxies. But if not +# it is recommended to leave OFF. +#Default: +# half_closed_clients off + +# TAG: server_idle_pconn_timeout +# Timeout for idle persistent connections to servers and other +# proxies. +#Default: +# server_idle_pconn_timeout 1 minute + +# TAG: ident_timeout +# Maximum time to wait for IDENT lookups to complete. +# +# If this is too high, and you enabled IDENT lookups from untrusted +# users, you might be susceptible to denial-of-service by having +# many ident requests going at once. +#Default: +# ident_timeout 10 seconds + +# TAG: shutdown_lifetime time-units +# When SIGTERM or SIGHUP is received, the cache is put into +# "shutdown pending" mode until all active sockets are closed. +# This value is the lifetime to set for all open descriptors +# during shutdown mode. Any active clients after this many +# seconds will receive a 'timeout' message. +#Default: +# shutdown_lifetime 30 seconds + +# ADMINISTRATIVE PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: cache_mgr +# Email-address of local cache manager who will receive +# mail if the cache dies. The default is "webmaster". +#Default: +# cache_mgr webmaster + +# TAG: mail_from +# From: email-address for mail sent when the cache dies. +# The default is to use 'squid@unique_hostname'. +# +# See also: unique_hostname directive. +#Default: +# none + +# TAG: mail_program +# Email program used to send mail if the cache dies. +# The default is "mail". The specified program must comply +# with the standard Unix mail syntax: +# mail-program recipient < mailfile +# +# Optional command line options can be specified. +#Default: +# mail_program mail + +# TAG: cache_effective_user +# If you start Squid as root, it will change its effective/real +# UID/GID to the user specified below. The default is to change +# to UID of proxy. +# see also; cache_effective_group +#Default: +# cache_effective_user proxy + +# TAG: cache_effective_group +# Squid sets the GID to the effective user's default group ID +# (taken from the password file) and supplementary group list +# from the groups membership. +# +# If you want Squid to run with a specific GID regardless of +# the group memberships of the effective user then set this +# to the group (or GID) you want Squid to run as. When set +# all other group privileges of the effective user are ignored +# and only this GID is effective. If Squid is not started as +# root the user starting Squid MUST be member of the specified +# group. +# +# This option is not recommended by the Squid Team. +# Our preference is for administrators to configure a secure +# user account for squid with UID/GID matching system policies. +#Default: +# Use system group memberships of the cache_effective_user account + +# TAG: httpd_suppress_version_string on|off +# Suppress Squid version string info in HTTP headers and HTML error pages. +#Default: +# httpd_suppress_version_string off + +# TAG: visible_hostname +# If you want to present a special hostname in error messages, etc, +# define this. Otherwise, the return value of gethostname() +# will be used. If you have multiple caches in a cluster and +# get errors about IP-forwarding you must set them to have individual +# names with this setting. +#Default: +# Automatically detect the system host name + +# TAG: unique_hostname +# If you want to have multiple machines with the same +# 'visible_hostname' you must give each machine a different +# 'unique_hostname' so forwarding loops can be detected. +#Default: +# Copy the value from visible_hostname + +# TAG: hostname_aliases +# A list of other DNS names your cache has. +#Default: +# none + +# TAG: umask +# Minimum umask which should be enforced while the proxy +# is running, in addition to the umask set at startup. +# +# For a traditional octal representation of umasks, start +# your value with 0. +#Default: +# umask 027 + +# OPTIONS FOR THE CACHE REGISTRATION SERVICE +# ----------------------------------------------------------------------------- +# +# This section contains parameters for the (optional) cache +# announcement service. This service is provided to help +# cache administrators locate one another in order to join or +# create cache hierarchies. +# +# An 'announcement' message is sent (via UDP) to the registration +# service by Squid. By default, the announcement message is NOT +# SENT unless you enable it with 'announce_period' below. +# +# The announcement message includes your hostname, plus the +# following information from this configuration file: +# +# http_port +# icp_port +# cache_mgr +# +# All current information is processed regularly and made +# available on the Web at http://www.ircache.net/Cache/Tracker/. + +# TAG: announce_period +# This is how frequently to send cache announcements. +# +# To enable announcing your cache, just set an announce period. +# +# Example: +# announce_period 1 day +#Default: +# Announcement messages disabled. + +# TAG: announce_host +# Set the hostname where announce registration messages will be sent. +# +# See also announce_port and announce_file +#Default: +# announce_host tracker.ircache.net + +# TAG: announce_file +# The contents of this file will be included in the announce +# registration messages. +#Default: +# none + +# TAG: announce_port +# Set the port where announce registration messages will be sent. +# +# See also announce_host and announce_file +#Default: +# announce_port 3131 + +# HTTPD-ACCELERATOR OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: httpd_accel_surrogate_id +# Surrogates (http://www.esi.org/architecture_spec_1.0.html) +# need an identification token to allow control targeting. Because +# a farm of surrogates may all perform the same tasks, they may share +# an identification token. +#Default: +# visible_hostname is used if no specific ID is set. + +# TAG: http_accel_surrogate_remote on|off +# Remote surrogates (such as those in a CDN) honour the header +# "Surrogate-Control: no-store-remote". +# +# Set this to on to have squid behave as a remote surrogate. +#Default: +# http_accel_surrogate_remote off + +# TAG: esi_parser libxml2|expat|custom +# ESI markup is not strictly XML compatible. The custom ESI parser +# will give higher performance, but cannot handle non ASCII character +# encodings. +#Default: +# esi_parser custom + +# DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: delay_pools +# This represents the number of delay pools to be used. For example, +# if you have one class 2 delay pool and one class 3 delays pool, you +# have a total of 2 delay pools. +# +# See also delay_parameters, delay_class, delay_access for pool +# configuration details. +#Default: +# delay_pools 0 + +# TAG: delay_class +# This defines the class of each delay pool. There must be exactly one +# delay_class line for each delay pool. For example, to define two +# delay pools, one of class 2 and one of class 3, the settings above +# and here would be: +# +# Example: +# delay_pools 4 # 4 delay pools +# delay_class 1 2 # pool 1 is a class 2 pool +# delay_class 2 3 # pool 2 is a class 3 pool +# delay_class 3 4 # pool 3 is a class 4 pool +# delay_class 4 5 # pool 4 is a class 5 pool +# +# The delay pool classes are: +# +# class 1 Everything is limited by a single aggregate +# bucket. +# +# class 2 Everything is limited by a single aggregate +# bucket as well as an "individual" bucket chosen +# from bits 25 through 32 of the IPv4 address. +# +# class 3 Everything is limited by a single aggregate +# bucket as well as a "network" bucket chosen +# from bits 17 through 24 of the IP address and a +# "individual" bucket chosen from bits 17 through +# 32 of the IPv4 address. +# +# class 4 Everything in a class 3 delay pool, with an +# additional limit on a per user basis. This +# only takes effect if the username is established +# in advance - by forcing authentication in your +# http_access rules. +# +# class 5 Requests are grouped according their tag (see +# external_acl's tag= reply). +# +# +# Each pool also requires a delay_parameters directive to configure the pool size +# and speed limits used whenever the pool is applied to a request. Along with +# a set of delay_access directives to determine when it is used. +# +# NOTE: If an IP address is a.b.c.d +# -> bits 25 through 32 are "d" +# -> bits 17 through 24 are "c" +# -> bits 17 through 32 are "c * 256 + d" +# +# NOTE-2: Due to the use of bitmasks in class 2,3,4 pools they only apply to +# IPv4 traffic. Class 1 and 5 pools may be used with IPv6 traffic. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also delay_parameters and delay_access. +#Default: +# none + +# TAG: delay_access +# This is used to determine which delay pool a request falls into. +# +# delay_access is sorted per pool and the matching starts with pool 1, +# then pool 2, ..., and finally pool N. The first delay pool where the +# request is allowed is selected for the request. If it does not allow +# the request to any pool then the request is not delayed (default). +# +# For example, if you want some_big_clients in delay +# pool 1 and lotsa_little_clients in delay pool 2: +# +# delay_access 1 allow some_big_clients +# delay_access 1 deny all +# delay_access 2 allow lotsa_little_clients +# delay_access 2 deny all +# delay_access 3 allow authenticated_clients +# +# See also delay_parameters and delay_class. +# +#Default: +# Deny using the pool, unless allow rules exist in squid.conf for the pool. + +# TAG: delay_parameters +# This defines the parameters for a delay pool. Each delay pool has +# a number of "buckets" associated with it, as explained in the +# description of delay_class. +# +# For a class 1 delay pool, the syntax is: +# delay_class pool 1 +# delay_parameters pool aggregate +# +# For a class 2 delay pool: +# delay_class pool 2 +# delay_parameters pool aggregate individual +# +# For a class 3 delay pool: +# delay_class pool 3 +# delay_parameters pool aggregate network individual +# +# For a class 4 delay pool: +# delay_class pool 4 +# delay_parameters pool aggregate network individual user +# +# For a class 5 delay pool: +# delay_class pool 5 +# delay_parameters pool tagrate +# +# The option variables are: +# +# pool a pool number - ie, a number between 1 and the +# number specified in delay_pools as used in +# delay_class lines. +# +# aggregate the speed limit parameters for the aggregate bucket +# (class 1, 2, 3). +# +# individual the speed limit parameters for the individual +# buckets (class 2, 3). +# +# network the speed limit parameters for the network buckets +# (class 3). +# +# user the speed limit parameters for the user buckets +# (class 4). +# +# tagrate the speed limit parameters for the tag buckets +# (class 5). +# +# A pair of delay parameters is written restore/maximum, where restore is +# the number of bytes (not bits - modem and network speeds are usually +# quoted in bits) per second placed into the bucket, and maximum is the +# maximum number of bytes which can be in the bucket at any time. +# +# There must be one delay_parameters line for each delay pool. +# +# +# For example, if delay pool number 1 is a class 2 delay pool as in the +# above example, and is being used to strictly limit each host to 64Kbit/sec +# (plus overheads), with no overall limit, the line is: +# +# delay_parameters 1 none 8000/8000 +# +# Note that 8 x 8K Byte/sec -> 64K bit/sec. +# +# Note that the word 'none' is used to represent no limit. +# +# +# And, if delay pool number 2 is a class 3 delay pool as in the above +# example, and you want to limit it to a total of 256Kbit/sec (strict limit) +# with each 8-bit network permitted 64Kbit/sec (strict limit) and each +# individual host permitted 4800bit/sec with a bucket maximum size of 64Kbits +# to permit a decent web page to be downloaded at a decent speed +# (if the network is not being limited due to overuse) but slow down +# large downloads more significantly: +# +# delay_parameters 2 32000/32000 8000/8000 600/8000 +# +# Note that 8 x 32K Byte/sec -> 256K bit/sec. +# 8 x 8K Byte/sec -> 64K bit/sec. +# 8 x 600 Byte/sec -> 4800 bit/sec. +# +# +# Finally, for a class 4 delay pool as in the example - each user will +# be limited to 128Kbits/sec no matter how many workstations they are logged into.: +# +# delay_parameters 4 32000/32000 8000/8000 600/64000 16000/16000 +# +# +# See also delay_class and delay_access. +# +#Default: +# none + +# TAG: delay_initial_bucket_level (percent, 0-100) +# The initial bucket percentage is used to determine how much is put +# in each bucket when squid starts, is reconfigured, or first notices +# a host accessing it (in class 2 and class 3, individual hosts and +# networks only have buckets associated with them once they have been +# "seen" by squid). +#Default: +# delay_initial_bucket_level 50 + +# CLIENT DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: client_delay_pools +# This option specifies the number of client delay pools used. It must +# preceed other client_delay_* options. +# +# Example: +# client_delay_pools 2 +# +# See also client_delay_parameters and client_delay_access. +#Default: +# client_delay_pools 0 + +# TAG: client_delay_initial_bucket_level (percent, 0-no_limit) +# This option determines the initial bucket size as a percentage of +# max_bucket_size from client_delay_parameters. Buckets are created +# at the time of the "first" connection from the matching IP. Idle +# buckets are periodically deleted up. +# +# You can specify more than 100 percent but note that such "oversized" +# buckets are not refilled until their size goes down to max_bucket_size +# from client_delay_parameters. +# +# Example: +# client_delay_initial_bucket_level 50 +#Default: +# client_delay_initial_bucket_level 50 + +# TAG: client_delay_parameters +# +# This option configures client-side bandwidth limits using the +# following format: +# +# client_delay_parameters pool speed_limit max_bucket_size +# +# pool is an integer ID used for client_delay_access matching. +# +# speed_limit is bytes added to the bucket per second. +# +# max_bucket_size is the maximum size of a bucket, enforced after any +# speed_limit additions. +# +# Please see the delay_parameters option for more information and +# examples. +# +# Example: +# client_delay_parameters 1 1024 2048 +# client_delay_parameters 2 51200 16384 +# +# See also client_delay_access. +# +#Default: +# none + +# TAG: client_delay_access +# This option determines the client-side delay pool for the +# request: +# +# client_delay_access pool_ID allow|deny acl_name +# +# All client_delay_access options are checked in their pool ID +# order, starting with pool 1. The first checked pool with allowed +# request is selected for the request. If no ACL matches or there +# are no client_delay_access options, the request bandwidth is not +# limited. +# +# The ACL-selected pool is then used to find the +# client_delay_parameters for the request. Client-side pools are +# not used to aggregate clients. Clients are always aggregated +# based on their source IP addresses (one bucket per source IP). +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Additionally, only the client TCP connection details are available. +# ACLs testing HTTP properties will not work. +# +# Please see delay_access for more examples. +# +# Example: +# client_delay_access 1 allow low_rate_network +# client_delay_access 2 allow vips_network +# +# +# See also client_delay_parameters and client_delay_pools. +#Default: +# Deny use of the pool, unless allow rules exist in squid.conf for the pool. + +# WCCPv1 AND WCCPv2 CONFIGURATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: wccp_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCP disabled. + +# TAG: wccp2_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCPv2 disabled. + +# TAG: wccp_version +# This directive is only relevant if you need to set up WCCP(v1) +# to some very old and end-of-life Cisco routers. In all other +# setups it must be left unset or at the default setting. +# It defines an internal version in the WCCP(v1) protocol, +# with version 4 being the officially documented protocol. +# +# According to some users, Cisco IOS 11.2 and earlier only +# support WCCP version 3. If you're using that or an earlier +# version of IOS, you may need to change this value to 3, otherwise +# do not specify this parameter. +#Default: +# wccp_version 4 + +# TAG: wccp2_rebuild_wait +# If this is enabled Squid will wait for the cache dir rebuild to finish +# before sending the first wccp2 HereIAm packet +#Default: +# wccp2_rebuild_wait on + +# TAG: wccp2_forwarding_method +# WCCP2 allows the setting of forwarding methods between the +# router/switch and the cache. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment method. +#Default: +# wccp2_forwarding_method gre + +# TAG: wccp2_return_method +# WCCP2 allows the setting of return methods between the +# router/switch and the cache for packets that the cache +# decides not to handle. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment. +# +# If the "ip wccp redirect exclude in" command has been +# enabled on the cache interface, then it is still safe for +# the proxy server to use a l2 redirect method even if this +# option is set to GRE. +#Default: +# wccp2_return_method gre + +# TAG: wccp2_assignment_method +# WCCP2 allows the setting of methods to assign the WCCP hash +# Valid values are as follows: +# +# hash - Hash assignment +# mask - Mask assignment +# +# As a general rule, cisco routers support the hash assignment method +# and cisco switches support the mask assignment method. +#Default: +# wccp2_assignment_method hash + +# TAG: wccp2_service +# WCCP2 allows for multiple traffic services. There are two +# types: "standard" and "dynamic". The standard type defines +# one service id - http (id 0). The dynamic service ids can be from +# 51 to 255 inclusive. In order to use a dynamic service id +# one must define the type of traffic to be redirected; this is done +# using the wccp2_service_info option. +# +# The "standard" type does not require a wccp2_service_info option, +# just specifying the service id will suffice. +# +# MD5 service authentication can be enabled by adding +# "password=" to the end of this service declaration. +# +# Examples: +# +# wccp2_service standard 0 # for the 'web-cache' standard service +# wccp2_service dynamic 80 # a dynamic service type which will be +# # fleshed out with subsequent options. +# wccp2_service standard 0 password=foo +#Default: +# Use the 'web-cache' standard service. + +# TAG: wccp2_service_info +# Dynamic WCCPv2 services require further information to define the +# traffic you wish to have diverted. +# +# The format is: +# +# wccp2_service_info protocol= flags=,.. +# priority= ports=,.. +# +# The relevant WCCPv2 flags: +# + src_ip_hash, dst_ip_hash +# + source_port_hash, dst_port_hash +# + src_ip_alt_hash, dst_ip_alt_hash +# + src_port_alt_hash, dst_port_alt_hash +# + ports_source +# +# The port list can be one to eight entries. +# +# Example: +# +# wccp2_service_info 80 protocol=tcp flags=src_ip_hash,ports_source +# priority=240 ports=80 +# +# Note: the service id must have been defined by a previous +# 'wccp2_service dynamic ' entry. +#Default: +# none + +# TAG: wccp2_weight +# Each cache server gets assigned a set of the destination +# hash proportional to their weight. +#Default: +# wccp2_weight 10000 + +# TAG: wccp_address +# Use this option if you require WCCPv2 to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# TAG: wccp2_address +# Use this option if you require WCCP to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# PERSISTENT CONNECTION HANDLING +# ----------------------------------------------------------------------------- +# +# Also see "pconn_timeout" in the TIMEOUTS section + +# TAG: client_persistent_connections +# Persistent connection support for clients. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with clients. +#Default: +# client_persistent_connections on + +# TAG: server_persistent_connections +# Persistent connection support for servers. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with servers. +#Default: +# server_persistent_connections on + +# TAG: persistent_connection_after_error +# With this directive the use of persistent connections after +# HTTP errors can be disabled. Useful if you have clients +# who fail to handle errors on persistent connections proper. +#Default: +# persistent_connection_after_error on + +# TAG: detect_broken_pconn +# Some servers have been found to incorrectly signal the use +# of HTTP/1.0 persistent connections even on replies not +# compatible, causing significant delays. This server problem +# has mostly been seen on redirects. +# +# By enabling this directive Squid attempts to detect such +# broken replies and automatically assume the reply is finished +# after 10 seconds timeout. +#Default: +# detect_broken_pconn off + +# CACHE DIGEST OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: digest_generation +# This controls whether the server will generate a Cache Digest +# of its contents. By default, Cache Digest generation is +# enabled if Squid is compiled with --enable-cache-digests defined. +#Default: +# digest_generation on + +# TAG: digest_bits_per_entry +# This is the number of bits of the server's Cache Digest which +# will be associated with the Digest entry for a given HTTP +# Method and URL (public key) combination. The default is 5. +#Default: +# digest_bits_per_entry 5 + +# TAG: digest_rebuild_period (seconds) +# This is the wait time between Cache Digest rebuilds. +#Default: +# digest_rebuild_period 1 hour + +# TAG: digest_rewrite_period (seconds) +# This is the wait time between Cache Digest writes to +# disk. +#Default: +# digest_rewrite_period 1 hour + +# TAG: digest_swapout_chunk_size (bytes) +# This is the number of bytes of the Cache Digest to write to +# disk at a time. It defaults to 4096 bytes (4KB), the Squid +# default swap page. +#Default: +# digest_swapout_chunk_size 4096 bytes + +# TAG: digest_rebuild_chunk_percentage (percent, 0-100) +# This is the percentage of the Cache Digest to be scanned at a +# time. By default it is set to 10% of the Cache Digest. +#Default: +# digest_rebuild_chunk_percentage 10 + +# SNMP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: snmp_port +# The port number where Squid listens for SNMP requests. To enable +# SNMP support set this to a suitable port number. Port number +# 3401 is often used for the Squid SNMP agent. By default it's +# set to "0" (disabled) +# +# Example: +# snmp_port 3401 +#Default: +# SNMP disabled. + +# TAG: snmp_access +# Allowing or denying access to the SNMP port. +# +# All access to the agent is denied by default. +# usage: +# +# snmp_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# snmp_access allow snmppublic localhost +# snmp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: snmp_incoming_address +# Just like 'udp_incoming_address', but for the SNMP port. +# +# snmp_incoming_address is used for the SNMP socket receiving +# messages from SNMP agents. +# +# The default snmp_incoming_address is to listen on all +# available network interfaces. +#Default: +# Accept SNMP packets from all machine interfaces. + +# TAG: snmp_outgoing_address +# Just like 'udp_outgoing_address', but for the SNMP port. +# +# snmp_outgoing_address is used for SNMP packets returned to SNMP +# agents. +# +# If snmp_outgoing_address is not set it will use the same socket +# as snmp_incoming_address. Only change this if you want to have +# SNMP replies sent using another address than where this Squid +# listens for SNMP queries. +# +# NOTE, snmp_incoming_address and snmp_outgoing_address can not have +# the same value since they both use the same port. +#Default: +# Use snmp_incoming_address or an address selected by the operating system. + +# ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icp_port +# The port number where Squid sends and receives ICP queries to +# and from neighbor caches. The standard UDP port for ICP is 3130. +# +# Example: +# icp_port 3130 +#Default: +# ICP disabled. + +# TAG: htcp_port +# The port number where Squid sends and receives HTCP queries to +# and from neighbor caches. To turn it on you want to set it to +# 4827. +# +# Example: +# htcp_port 4827 +#Default: +# HTCP disabled. + +# TAG: log_icp_queries on|off +# If set, ICP queries are logged to access.log. You may wish +# do disable this if your ICP load is VERY high to speed things +# up or to simplify log analysis. +#Default: +# log_icp_queries on + +# TAG: udp_incoming_address +# udp_incoming_address is used for UDP packets received from other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Only change this if you want to have all UDP queries received on +# a specific interface/address. +# +# NOTE: udp_incoming_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_outgoing_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Accept packets from all machine interfaces. + +# TAG: udp_outgoing_address +# udp_outgoing_address is used for UDP packets sent out to other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Instead it will use the same socket as udp_incoming_address. +# Only change this if you want to have UDP queries sent using another +# address than where this Squid listens for UDP queries from other +# caches. +# +# NOTE: udp_outgoing_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_incoming_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Use udp_incoming_address or an address selected by the operating system. + +# TAG: icp_hit_stale on|off +# If you want to return ICP_HIT for stale cache objects, set this +# option to 'on'. If you have sibling relationships with caches +# in other administrative domains, this should be 'off'. If you only +# have sibling relationships with caches under your control, +# it is probably okay to set this to 'on'. +# If set to 'on', your siblings should use the option "allow-miss" +# on their cache_peer lines for connecting to you. +#Default: +# icp_hit_stale off + +# TAG: minimum_direct_hops +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many hops away. +#Default: +# minimum_direct_hops 4 + +# TAG: minimum_direct_rtt (msec) +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many rtt milliseconds away. +#Default: +# minimum_direct_rtt 400 + +# TAG: netdb_low +# The low water mark for the ICMP measurement database. +# +# Note: high watermark controlled by netdb_high directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_low 900 + +# TAG: netdb_high +# The high water mark for the ICMP measurement database. +# +# Note: low watermark controlled by netdb_low directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_high 1000 + +# TAG: netdb_ping_period +# The minimum period for measuring a site. There will be at +# least this much delay between successive pings to the same +# network. The default is five minutes. +#Default: +# netdb_ping_period 5 minutes + +# TAG: query_icmp on|off +# If you want to ask your peers to include ICMP data in their ICP +# replies, enable this option. +# +# If your peer has configured Squid (during compilation) with +# '--enable-icmp' that peer will send ICMP pings to origin server +# sites of the URLs it receives. If you enable this option the +# ICP replies from that peer will include the ICMP data (if available). +# Then, when choosing a parent cache, Squid will choose the parent with +# the minimal RTT to the origin server. When this happens, the +# hierarchy field of the access.log will be +# "CLOSEST_PARENT_MISS". This option is off by default. +#Default: +# query_icmp off + +# TAG: test_reachability on|off +# When this is 'on', ICP MISS replies will be ICP_MISS_NOFETCH +# instead of ICP_MISS if the target host is NOT in the ICMP +# database, or has a zero RTT. +#Default: +# test_reachability off + +# TAG: icp_query_timeout (msec) +# Normally Squid will automatically determine an optimal ICP +# query timeout value based on the round-trip-time of recent ICP +# queries. If you want to override the value determined by +# Squid, set this 'icp_query_timeout' to a non-zero value. This +# value is specified in MILLISECONDS, so, to use a 2-second +# timeout (the old default), you would write: +# +# icp_query_timeout 2000 +#Default: +# Dynamic detection. + +# TAG: maximum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very large values (say 5 seconds). +# Use this option to put an upper limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# maximum_icp_query_timeout 2000 + +# TAG: minimum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very small timeouts, even lower than +# the normal latency variance on your link due to traffic. +# Use this option to put an lower limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# minimum_icp_query_timeout 5 + +# TAG: background_ping_rate time-units +# Controls how often the ICP pings are sent to siblings that +# have background-ping set. +#Default: +# background_ping_rate 10 seconds + +# MULTICAST ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: mcast_groups +# This tag specifies a list of multicast groups which your server +# should join to receive multicasted ICP queries. +# +# NOTE! Be very careful what you put here! Be sure you +# understand the difference between an ICP _query_ and an ICP +# _reply_. This option is to be set only if you want to RECEIVE +# multicast queries. Do NOT set this option to SEND multicast +# ICP (use cache_peer for that). ICP replies are always sent via +# unicast, so this option does not affect whether or not you will +# receive replies from multicast group members. +# +# You must be very careful to NOT use a multicast address which +# is already in use by another group of caches. +# +# If you are unsure about multicast, please read the Multicast +# chapter in the Squid FAQ (http://www.squid-cache.org/FAQ/). +# +# Usage: mcast_groups 239.128.16.128 224.0.1.20 +# +# By default, Squid doesn't listen on any multicast groups. +#Default: +# none + +# TAG: mcast_miss_addr +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# If you enable this option, every "cache miss" URL will +# be sent out on the specified multicast address. +# +# Do not enable this option unless you are are absolutely +# certain you understand what you are doing. +#Default: +# disabled. + +# TAG: mcast_miss_ttl +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the time-to-live value for packets multicasted +# when multicasting off cache miss URLs is enabled. By +# default this is set to 'site scope', i.e. 16. +#Default: +# mcast_miss_ttl 16 + +# TAG: mcast_miss_port +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the port number to be used in conjunction with +# 'mcast_miss_addr'. +#Default: +# mcast_miss_port 3135 + +# TAG: mcast_miss_encode_key +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# The URLs that are sent in the multicast miss stream are +# encrypted. This is the encryption key. +#Default: +# mcast_miss_encode_key XXXXXXXXXXXXXXXX + +# TAG: mcast_icp_query_timeout (msec) +# For multicast peers, Squid regularly sends out ICP "probes" to +# count how many other peers are listening on the given multicast +# address. This value specifies how long Squid should wait to +# count all the replies. The default is 2000 msec, or 2 +# seconds. +#Default: +# mcast_icp_query_timeout 2000 + +# INTERNAL ICON OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icon_directory +# Where the icons are stored. These are normally kept in +# /usr/share/squid/icons +#Default: +# icon_directory /usr/share/squid/icons + +# TAG: global_internal_static +# This directive controls is Squid should intercept all requests for +# /squid-internal-static/ no matter which host the URL is requesting +# (default on setting), or if nothing special should be done for +# such URLs (off setting). The purpose of this directive is to make +# icons etc work better in complex cache hierarchies where it may +# not always be possible for all corners in the cache mesh to reach +# the server generating a directory listing. +#Default: +# global_internal_static on + +# TAG: short_icon_urls +# If this is enabled Squid will use short URLs for icons. +# If disabled it will revert to the old behavior of including +# it's own name and port in the URL. +# +# If you run a complex cache hierarchy with a mix of Squid and +# other proxies you may need to disable this directive. +#Default: +# short_icon_urls on + +# ERROR PAGE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: error_directory +# If you wish to create your own versions of the default +# error files to customize them to suit your company copy +# the error/template files to another directory and point +# this tag at them. +# +# WARNING: This option will disable multi-language support +# on error pages if used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are making translations for a +# language that Squid does not currently provide please consider +# contributing your translation back to the project. +# http://wiki.squid-cache.org/Translations +# +# The squid developers working on translations are happy to supply drop-in +# translated error files in exchange for any new language contributions. +#Default: +# Send error pages in the clients preferred language + +# TAG: error_default_language +# Set the default language which squid will send error pages in +# if no existing translation matches the clients language +# preferences. +# +# If unset (default) generic English will be used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are interested in making +# translations for any language see the squid wiki for details. +# http://wiki.squid-cache.org/Translations +#Default: +# Generate English language pages. + +# TAG: error_log_languages +# Log to cache.log what languages users are attempting to +# auto-negotiate for translations. +# +# Successful negotiations are not logged. Only failures +# have meaning to indicate that Squid may need an upgrade +# of its error page translations. +#Default: +# error_log_languages on + +# TAG: err_page_stylesheet +# CSS Stylesheet to pattern the display of Squid default error pages. +# +# For information on CSS see http://www.w3.org/Style/CSS/ +#Default: +# err_page_stylesheet /etc/squid/errorpage.css + +# TAG: err_html_text +# HTML text to include in error messages. Make this a "mailto" +# URL to your admin address, or maybe just a link to your +# organizations Web page. +# +# To include this in your error messages, you must rewrite +# the error template files (found in the "errors" directory). +# Wherever you want the 'err_html_text' line to appear, +# insert a %L tag in the error template file. +#Default: +# none + +# TAG: email_err_data on|off +# If enabled, information about the occurred error will be +# included in the mailto links of the ERR pages (if %W is set) +# so that the email body contains the data. +# Syntax is %w +#Default: +# email_err_data on + +# TAG: deny_info +# Usage: deny_info err_page_name acl +# or deny_info http://... acl +# or deny_info TCP_RESET acl +# +# This can be used to return a ERR_ page for requests which +# do not pass the 'http_access' rules. Squid remembers the last +# acl it evaluated in http_access, and if a 'deny_info' line exists +# for that ACL Squid returns a corresponding error page. +# +# The acl is typically the last acl on the http_access deny line which +# denied access. The exceptions to this rule are: +# - When Squid needs to request authentication credentials. It's then +# the first authentication related acl encountered +# - When none of the http_access lines matches. It's then the last +# acl processed on the last http_access line. +# - When the decision to deny access was made by an adaptation service, +# the acl name is the corresponding eCAP or ICAP service_name. +# +# NP: If providing your own custom error pages with error_directory +# you may also specify them by your custom file name: +# Example: deny_info ERR_CUSTOM_ACCESS_DENIED bad_guys +# +# By defaut Squid will send "403 Forbidden". A different 4xx or 5xx +# may be specified by prefixing the file name with the code and a colon. +# e.g. 404:ERR_CUSTOM_ACCESS_DENIED +# +# Alternatively you can tell Squid to reset the TCP connection +# by specifying TCP_RESET. +# +# Or you can specify an error URL or URL pattern. The browsers will +# get redirected to the specified URL after formatting tags have +# been replaced. Redirect will be done with 302 or 307 according to +# HTTP/1.1 specs. A different 3xx code may be specified by prefixing +# the URL. e.g. 303:http://example.com/ +# +# URL FORMAT TAGS: +# %a - username (if available. Password NOT included) +# %B - FTP path URL +# %e - Error number +# %E - Error description +# %h - Squid hostname +# %H - Request domain name +# %i - Client IP Address +# %M - Request Method +# %o - Message result from external ACL helper +# %p - Request Port number +# %P - Request Protocol name +# %R - Request URL path +# %T - Timestamp in RFC 1123 format +# %U - Full canonical URL from client +# (HTTPS URLs terminate with *) +# %u - Full canonical URL from client +# %w - Admin email from squid.conf +# %x - Error name +# %% - Literal percent (%) code +# +#Default: +# none + +# OPTIONS INFLUENCING REQUEST FORWARDING +# ----------------------------------------------------------------------------- + +# TAG: nonhierarchical_direct +# By default, Squid will send any non-hierarchical requests +# (not cacheable request type) direct to origin servers. +# +# When this is set to "off", Squid will prefer to send these +# requests to parents. +# +# Note that in most configurations, by turning this off you will only +# add latency to these request without any improvement in global hit +# ratio. +# +# This option only sets a preference. If the parent is unavailable a +# direct connection to the origin server may still be attempted. To +# completely prevent direct connections use never_direct. +#Default: +# nonhierarchical_direct on + +# TAG: prefer_direct +# Normally Squid tries to use parents for most requests. If you for some +# reason like it to first try going direct and only use a parent if +# going direct fails set this to on. +# +# By combining nonhierarchical_direct off and prefer_direct on you +# can set up Squid to use a parent as a backup path if going direct +# fails. +# +# Note: If you want Squid to use parents for all requests see +# the never_direct directive. prefer_direct only modifies how Squid +# acts on cacheable requests. +#Default: +# prefer_direct off + +# TAG: cache_miss_revalidate on|off +# RFC 7232 defines a conditional request mechanism to prevent +# response objects being unnecessarily transferred over the network. +# If that mechanism is used by the client and a cache MISS occurs +# it can prevent new cache entries being created. +# +# This option determines whether Squid on cache MISS will pass the +# client revalidation request to the server or tries to fetch new +# content for caching. It can be useful while the cache is mostly +# empty to more quickly have the cache populated by generating +# non-conditional GETs. +# +# When set to 'on' (default), Squid will pass all client If-* headers +# to the server. This permits server responses without a cacheable +# payload to be delivered and on MISS no new cache entry is created. +# +# When set to 'off' and if the request is cacheable, Squid will +# remove the clients If-Modified-Since and If-None-Match headers from +# the request sent to the server. This requests a 200 status response +# from the server to create a new cache entry with. +#Default: +# cache_miss_revalidate on + +# TAG: always_direct +# Usage: always_direct allow|deny [!]aclname ... +# +# Here you can use ACL elements to specify requests which should +# ALWAYS be forwarded by Squid to the origin servers without using +# any peers. For example, to always directly forward requests for +# local servers ignoring any parents or siblings you may have use +# something like: +# +# acl local-servers dstdomain my.domain.net +# always_direct allow local-servers +# +# To always forward FTP requests directly, use +# +# acl FTP proto FTP +# always_direct allow FTP +# +# NOTE: There is a similar, but opposite option named +# 'never_direct'. You need to be aware that "always_direct deny +# foo" is NOT the same thing as "never_direct allow foo". You +# may need to use a deny rule to exclude a more-specific case of +# some other rule. Example: +# +# acl local-external dstdomain external.foo.net +# acl local-servers dstdomain .foo.net +# always_direct deny local-external +# always_direct allow local-servers +# +# NOTE: If your goal is to make the client forward the request +# directly to the origin server bypassing Squid then this needs +# to be done in the client configuration. Squid configuration +# can only tell Squid how Squid should fetch the object. +# +# NOTE: This directive is not related to caching. The replies +# is cached as usual even if you use always_direct. To not cache +# the replies see the 'cache' directive. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Prevent any cache_peer being used for this request. + +# TAG: never_direct +# Usage: never_direct allow|deny [!]aclname ... +# +# never_direct is the opposite of always_direct. Please read +# the description for always_direct if you have not already. +# +# With 'never_direct' you can use ACL elements to specify +# requests which should NEVER be forwarded directly to origin +# servers. For example, to force the use of a proxy for all +# requests, except those in your local domain use something like: +# +# acl local-servers dstdomain .foo.net +# never_direct deny local-servers +# never_direct allow all +# +# or if Squid is inside a firewall and there are local intranet +# servers inside the firewall use something like: +# +# acl local-intranet dstdomain .foo.net +# acl local-external dstdomain external.foo.net +# always_direct deny local-external +# always_direct allow local-intranet +# never_direct allow all +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow DNS results to be used for this request. + +# ADVANCED NETWORKING OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: incoming_udp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_udp_average 6 + +# TAG: incoming_tcp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_tcp_average 4 + +# TAG: incoming_dns_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_dns_average 4 + +# TAG: min_udp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_udp_poll_cnt 8 + +# TAG: min_dns_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_dns_poll_cnt 8 + +# TAG: min_tcp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_tcp_poll_cnt 8 + +# TAG: accept_filter +# FreeBSD: +# +# The name of an accept(2) filter to install on Squid's +# listen socket(s). This feature is perhaps specific to +# FreeBSD and requires support in the kernel. +# +# The 'httpready' filter delays delivering new connections +# to Squid until a full HTTP request has been received. +# See the accf_http(9) man page for details. +# +# The 'dataready' filter delays delivering new connections +# to Squid until there is some data to process. +# See the accf_dataready(9) man page for details. +# +# Linux: +# +# The 'data' filter delays delivering of new connections +# to Squid until there is some data to process by TCP_ACCEPT_DEFER. +# You may optionally specify a number of seconds to wait by +# 'data=N' where N is the number of seconds. Defaults to 30 +# if not specified. See the tcp(7) man page for details. +#EXAMPLE: +## FreeBSD +#accept_filter httpready +## Linux +#accept_filter data +#Default: +# none + +# TAG: client_ip_max_connections +# Set an absolute limit on the number of connections a single +# client IP can use. Any more than this and Squid will begin to drop +# new connections from the client until it closes some links. +# +# Note that this is a global limit. It affects all HTTP, HTCP, Gopher and FTP +# connections from the client. For finer control use the ACL access controls. +# +# Requires client_db to be enabled (the default). +# +# WARNING: This may noticably slow down traffic received via external proxies +# or NAT devices and cause them to rebound error messages back to their clients. +#Default: +# No limit. + +# TAG: tcp_recv_bufsize (bytes) +# Size of receive buffer to set for TCP sockets. Probably just +# as easy to change your kernel's default. +# Omit from squid.conf to use the default buffer size. +#Default: +# Use operating system TCP defaults. + +# ICAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icap_enable on|off +# If you want to enable the ICAP module support, set this to on. +#Default: +# icap_enable off + +# TAG: icap_connect_timeout +# This parameter specifies how long to wait for the TCP connect to +# the requested ICAP server to complete before giving up and either +# terminating the HTTP transaction or bypassing the failure. +# +# The default for optional services is peer_connect_timeout. +# The default for essential services is connect_timeout. +# If this option is explicitly set, its value applies to all services. +#Default: +# none + +# TAG: icap_io_timeout time-units +# This parameter specifies how long to wait for an I/O activity on +# an established, active ICAP connection before giving up and +# either terminating the HTTP transaction or bypassing the +# failure. +#Default: +# Use read_timeout. + +# TAG: icap_service_failure_limit limit [in memory-depth time-units] +# The limit specifies the number of failures that Squid tolerates +# when establishing a new TCP connection with an ICAP service. If +# the number of failures exceeds the limit, the ICAP service is +# not used for new ICAP requests until it is time to refresh its +# OPTIONS. +# +# A negative value disables the limit. Without the limit, an ICAP +# service will not be considered down due to connectivity failures +# between ICAP OPTIONS requests. +# +# Squid forgets ICAP service failures older than the specified +# value of memory-depth. The memory fading algorithm +# is approximate because Squid does not remember individual +# errors but groups them instead, splitting the option +# value into ten time slots of equal length. +# +# When memory-depth is 0 and by default this option has no +# effect on service failure expiration. +# +# Squid always forgets failures when updating service settings +# using an ICAP OPTIONS transaction, regardless of this option +# setting. +# +# For example, +# # suspend service usage after 10 failures in 5 seconds: +# icap_service_failure_limit 10 in 5 seconds +#Default: +# icap_service_failure_limit 10 + +# TAG: icap_service_revival_delay +# The delay specifies the number of seconds to wait after an ICAP +# OPTIONS request failure before requesting the options again. The +# failed ICAP service is considered "down" until fresh OPTIONS are +# fetched. +# +# The actual delay cannot be smaller than the hardcoded minimum +# delay of 30 seconds. +#Default: +# icap_service_revival_delay 180 + +# TAG: icap_preview_enable on|off +# The ICAP Preview feature allows the ICAP server to handle the +# HTTP message by looking only at the beginning of the message body +# or even without receiving the body at all. In some environments, +# previews greatly speedup ICAP processing. +# +# During an ICAP OPTIONS transaction, the server may tell Squid what +# HTTP messages should be previewed and how big the preview should be. +# Squid will not use Preview if the server did not request one. +# +# To disable ICAP Preview for all ICAP services, regardless of +# individual ICAP server OPTIONS responses, set this option to "off". +#Example: +#icap_preview_enable off +#Default: +# icap_preview_enable on + +# TAG: icap_preview_size +# The default size of preview data to be sent to the ICAP server. +# This value might be overwritten on a per server basis by OPTIONS requests. +#Default: +# No preview sent. + +# TAG: icap_206_enable on|off +# 206 (Partial Content) responses is an ICAP extension that allows the +# ICAP agents to optionally combine adapted and original HTTP message +# content. The decision to combine is postponed until the end of the +# ICAP response. Squid supports Partial Content extension by default. +# +# Activation of the Partial Content extension is negotiated with each +# ICAP service during OPTIONS exchange. Most ICAP servers should handle +# negotation correctly even if they do not support the extension, but +# some might fail. To disable Partial Content support for all ICAP +# services and to avoid any negotiation, set this option to "off". +# +# Example: +# icap_206_enable off +#Default: +# icap_206_enable on + +# TAG: icap_default_options_ttl +# The default TTL value for ICAP OPTIONS responses that don't have +# an Options-TTL header. +#Default: +# icap_default_options_ttl 60 + +# TAG: icap_persistent_connections on|off +# Whether or not Squid should use persistent connections to +# an ICAP server. +#Default: +# icap_persistent_connections on + +# TAG: adaptation_send_client_ip on|off +# If enabled, Squid shares HTTP client IP information with adaptation +# services. For ICAP, Squid adds the X-Client-IP header to ICAP requests. +# For eCAP, Squid sets the libecap::metaClientIp transaction option. +# +# See also: adaptation_uses_indirect_client +#Default: +# adaptation_send_client_ip off + +# TAG: adaptation_send_username on|off +# This sends authenticated HTTP client username (if available) to +# the adaptation service. +# +# For ICAP, the username value is encoded based on the +# icap_client_username_encode option and is sent using the header +# specified by the icap_client_username_header option. +#Default: +# adaptation_send_username off + +# TAG: icap_client_username_header +# ICAP request header name to use for adaptation_send_username. +#Default: +# icap_client_username_header X-Client-Username + +# TAG: icap_client_username_encode on|off +# Whether to base64 encode the authenticated client username. +#Default: +# icap_client_username_encode off + +# TAG: icap_service +# Defines a single ICAP service using the following format: +# +# icap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# ICAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: icap://servername:port/servicepath +# ICAP server and service location. +# +# ICAP does not allow a single service to handle both REQMOD and RESPMOD +# transactions. Squid does not enforce that requirement. You can specify +# services with the same service_url and different vectoring_points. You +# can even specify multiple identical services as long as their +# service_names differ. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. ICAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the ICAP service is treated as +# optional. If the service cannot be reached or malfunctions, +# Squid will try to ignore any errors and process the message as +# if the service was not enabled. No all ICAP errors can be +# bypassed. If set to 0, the ICAP service is treated as +# essential and all ICAP errors will result in an error page +# returned to the HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the ICAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. The services +# are specified using the X-Next-Services ICAP response header +# value, formatted as a comma-separated list of service names. +# Each named service should be configured in squid.conf. Other +# services are ignored. An empty X-Next-Services value results +# in an empty plan which ends the current adaptation. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default: the ICAP X-Next-Services +# response header is ignored. +# +# ipv6=on|off +# Only has effect on split-stack systems. The default on those systems +# is to use IPv4-only connections. When set to 'on' this option will +# make Squid use IPv6-only connections to contact this ICAP service. +# +# on-overload=block|bypass|wait|force +# If the service Max-Connections limit has been reached, do +# one of the following for each new ICAP transaction: +# * block: send an HTTP error response to the client +# * bypass: ignore the "over-connected" ICAP service +# * wait: wait (in a FIFO queue) for an ICAP connection slot +# * force: proceed, ignoring the Max-Connections limit +# +# In SMP mode with N workers, each worker assumes the service +# connection limit is Max-Connections/N, even though not all +# workers may use a given service. +# +# The default value is "bypass" if service is bypassable, +# otherwise it is set to "wait". +# +# +# max-conn=number +# Use the given number as the Max-Connections limit, regardless +# of the Max-Connections value given by the service, if any. +# +# Older icap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +#Example: +#icap_service svcBlocker reqmod_precache icap://icap1.mydomain.net:1344/reqmod bypass=0 +#icap_service svcLogger reqmod_precache icap://icap2.mydomain.net:1344/respmod routing=on +#Default: +# none + +# TAG: icap_class +# This deprecated option was documented to define an ICAP service +# chain, even though it actually defined a set of similar, redundant +# services, and the chains were not supported. +# +# To define a set of redundant services, please use the +# adaptation_service_set directive. For service chains, use +# adaptation_service_chain. +#Default: +# none + +# TAG: icap_access +# This option is deprecated. Please use adaptation_access, which +# has the same ICAP functionality, but comes with better +# documentation, and eCAP support. +#Default: +# none + +# eCAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ecap_enable on|off +# Controls whether eCAP support is enabled. +#Default: +# ecap_enable off + +# TAG: ecap_service +# Defines a single eCAP service +# +# ecap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# eCAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: ecap://vendor/service_name?custom&cgi=style¶meters=optional +# Squid uses the eCAP service URI to match this configuration +# line with one of the dynamically loaded services. Each loaded +# eCAP service must have a unique URI. Obtain the right URI from +# the service provider. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. eCAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the eCAP service is treated as optional. +# If the service cannot be reached or malfunctions, Squid will try +# to ignore any errors and process the message as if the service +# was not enabled. No all eCAP errors can be bypassed. +# If set to 'off' or '0', the eCAP service is treated as essential +# and all eCAP errors will result in an error page returned to the +# HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the eCAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default. +# +# Older ecap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +# +#Example: +#ecap_service s1 reqmod_precache ecap://filters.R.us/leakDetector?on_error=block bypass=off +#ecap_service s2 respmod_precache ecap://filters.R.us/virusFilter config=/etc/vf.cfg bypass=on +#Default: +# none + +# TAG: loadable_modules +# Instructs Squid to load the specified dynamic module(s) or activate +# preloaded module(s). +#Example: +#loadable_modules /usr/lib/MinimalAdapter.so +#Default: +# none + +# MESSAGE ADAPTATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: adaptation_service_set +# +# Configures an ordered set of similar, redundant services. This is +# useful when hot standby or backup adaptation servers are available. +# +# adaptation_service_set set_name service_name1 service_name2 ... +# +# The named services are used in the set declaration order. The first +# applicable adaptation service from the set is used first. The next +# applicable service is tried if and only if the transaction with the +# previous service fails and the message waiting to be adapted is still +# intact. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the set. A broken service is a down optional service. +# +# The services in a set must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# If all services in a set are optional then adaptation failures are +# bypassable. If all services in the set are essential, then a +# transaction failure with one service may still be retried using +# another service from the set, but when all services fail, the master +# transaction fails as well. +# +# A set may contain a mix of optional and essential services, but that +# is likely to lead to surprising results because broken services become +# ignored (see above), making previously bypassable failures fatal. +# Technically, it is the bypassability of the last failed service that +# matters. +# +# See also: adaptation_access adaptation_service_chain +# +#Example: +#adaptation_service_set svcBlocker urlFilterPrimary urlFilterBackup +#adaptation service_set svcLogger loggerLocal loggerRemote +#Default: +# none + +# TAG: adaptation_service_chain +# +# Configures a list of complementary services that will be applied +# one-by-one, forming an adaptation chain or pipeline. This is useful +# when Squid must perform different adaptations on the same message. +# +# adaptation_service_chain chain_name service_name1 svc_name2 ... +# +# The named services are used in the chain declaration order. The first +# applicable adaptation service from the chain is used first. The next +# applicable service is applied to the successful adaptation results of +# the previous service in the chain. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the chain. A broken service is a down optional service. +# +# Request satisfaction terminates the adaptation chain because Squid +# does not currently allow declaration of RESPMOD services at the +# "reqmod_precache" vectoring point (see icap_service or ecap_service). +# +# The services in a chain must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# A chain may contain a mix of optional and essential services. If an +# essential adaptation fails (or the failure cannot be bypassed for +# other reasons), the master transaction fails. Otherwise, the failure +# is bypassed as if the failed adaptation service was not in the chain. +# +# See also: adaptation_access adaptation_service_set +# +#Example: +#adaptation_service_chain svcRequest requestLogger urlFilter leakDetector +#Default: +# none + +# TAG: adaptation_access +# Sends an HTTP transaction to an ICAP or eCAP adaptation service. +# +# adaptation_access service_name allow|deny [!]aclname... +# adaptation_access set_name allow|deny [!]aclname... +# +# At each supported vectoring point, the adaptation_access +# statements are processed in the order they appear in this +# configuration file. Statements pointing to the following services +# are ignored (i.e., skipped without checking their ACL): +# +# - services serving different vectoring points +# - "broken-but-bypassable" services +# - "up" services configured to ignore such transactions +# (e.g., based on the ICAP Transfer-Ignore header). +# +# When a set_name is used, all services in the set are checked +# using the same rules, to find the first applicable one. See +# adaptation_service_set for details. +# +# If an access list is checked and there is a match, the +# processing stops: For an "allow" rule, the corresponding +# adaptation service is used for the transaction. For a "deny" +# rule, no adaptation service is activated. +# +# It is currently not possible to apply more than one adaptation +# service at the same vectoring point to the same HTTP transaction. +# +# See also: icap_service and ecap_service +# +#Example: +#adaptation_access service_1 allow all +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: adaptation_service_iteration_limit +# Limits the number of iterations allowed when applying adaptation +# services to a message. If your longest adaptation set or chain +# may have more than 16 services, increase the limit beyond its +# default value of 16. If detecting infinite iteration loops sooner +# is critical, make the iteration limit match the actual number +# of services in your longest adaptation set or chain. +# +# Infinite adaptation loops are most likely with routing services. +# +# See also: icap_service routing=1 +#Default: +# adaptation_service_iteration_limit 16 + +# TAG: adaptation_masterx_shared_names +# For each master transaction (i.e., the HTTP request and response +# sequence, including all related ICAP and eCAP exchanges), Squid +# maintains a table of metadata. The table entries are (name, value) +# pairs shared among eCAP and ICAP exchanges. The table is destroyed +# with the master transaction. +# +# This option specifies the table entry names that Squid must accept +# from and forward to the adaptation transactions. +# +# An ICAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by returning an ICAP header field with a name +# specified in adaptation_masterx_shared_names. +# +# An eCAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by implementing the libecap::visitEachOption() API +# to provide an option with a name specified in +# adaptation_masterx_shared_names. +# +# Squid will store and forward the set entry to subsequent adaptation +# transactions within the same master transaction scope. +# +# Only one shared entry name is supported at this time. +# +#Example: +## share authentication information among ICAP services +#adaptation_masterx_shared_names X-Subscriber-ID +#Default: +# none + +# TAG: adaptation_meta +# This option allows Squid administrator to add custom ICAP request +# headers or eCAP options to Squid ICAP requests or eCAP transactions. +# Use it to pass custom authentication tokens and other +# transaction-state related meta information to an ICAP/eCAP service. +# +# The addition of a meta header is ACL-driven: +# adaptation_meta name value [!]aclname ... +# +# Processing for a given header name stops after the first ACL list match. +# Thus, it is impossible to add two headers with the same name. If no ACL +# lists match for a given header name, no such header is added. For +# example: +# +# # do not debug transactions except for those that need debugging +# adaptation_meta X-Debug 1 needs_debugging +# +# # log all transactions except for those that must remain secret +# adaptation_meta X-Log 1 !keep_secret +# +# # mark transactions from users in the "G 1" group +# adaptation_meta X-Authenticated-Groups "G 1" authed_as_G1 +# +# The "value" parameter may be a regular squid.conf token or a "double +# quoted string". Within the quoted string, use backslash (\) to escape +# any character, which is currently only useful for escaping backslashes +# and double quotes. For example, +# "this string has one backslash (\\) and two \"quotes\"" +# +# Used adaptation_meta header values may be logged via %note +# logformat code. If multiple adaptation_meta headers with the same name +# are used during master transaction lifetime, the header values are +# logged in the order they were used and duplicate values are ignored +# (only the first repeated value will be logged). +#Default: +# none + +# TAG: icap_retry +# This ACL determines which retriable ICAP transactions are +# retried. Transactions that received a complete ICAP response +# and did not have to consume or produce HTTP bodies to receive +# that response are usually retriable. +# +# icap_retry allow|deny [!]aclname ... +# +# Squid automatically retries some ICAP I/O timeouts and errors +# due to persistent connection race conditions. +# +# See also: icap_retry_limit +#Default: +# icap_retry deny all + +# TAG: icap_retry_limit +# Limits the number of retries allowed. +# +# Communication errors due to persistent connection race +# conditions are unavoidable, automatically retried, and do not +# count against this limit. +# +# See also: icap_retry +#Default: +# No retries are allowed. + +# DNS OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: check_hostnames +# For security and stability reasons Squid can check +# hostnames for Internet standard RFC compliance. If you want +# Squid to perform these checks turn this directive on. +#Default: +# check_hostnames off + +# TAG: allow_underscore +# Underscore characters is not strictly allowed in Internet hostnames +# but nevertheless used by many sites. Set this to off if you want +# Squid to be strict about the standard. +# This check is performed only when check_hostnames is set to on. +#Default: +# allow_underscore on + +# TAG: dns_retransmit_interval +# Initial retransmit interval for DNS queries. The interval is +# doubled each time all configured DNS servers have been tried. +#Default: +# dns_retransmit_interval 5 seconds + +# TAG: dns_timeout +# DNS Query timeout. If no response is received to a DNS query +# within this time all DNS servers for the queried domain +# are assumed to be unavailable. +#Default: +# dns_timeout 30 seconds + +# TAG: dns_packet_max +# Maximum number of bytes packet size to advertise via EDNS. +# Set to "none" to disable EDNS large packet support. +# +# For legacy reasons DNS UDP replies will default to 512 bytes which +# is too small for many responses. EDNS provides a means for Squid to +# negotiate receiving larger responses back immediately without having +# to failover with repeat requests. Responses larger than this limit +# will retain the old behaviour of failover to TCP DNS. +# +# Squid has no real fixed limit internally, but allowing packet sizes +# over 1500 bytes requires network jumbogram support and is usually not +# necessary. +# +# WARNING: The RFC also indicates that some older resolvers will reply +# with failure of the whole request if the extension is added. Some +# resolvers have already been identified which will reply with mangled +# EDNS response on occasion. Usually in response to many-KB jumbogram +# sizes being advertised by Squid. +# Squid will currently treat these both as an unable-to-resolve domain +# even if it would be resolvable without EDNS. +#Default: +# EDNS disabled + +# TAG: dns_defnames on|off +# Normally the RES_DEFNAMES resolver option is disabled +# (see res_init(3)). This prevents caches in a hierarchy +# from interpreting single-component hostnames locally. To allow +# Squid to handle single-component names, enable this option. +#Default: +# Search for single-label domain names is disabled. + +# TAG: dns_multicast_local on|off +# When set to on, Squid sends multicast DNS lookups on the local +# network for domains ending in .local and .arpa. +# This enables local servers and devices to be contacted in an +# ad-hoc or zero-configuration network environment. +#Default: +# Search for .local and .arpa names is disabled. + +# TAG: dns_nameservers +# Use this if you want to specify a list of DNS name servers +# (IP addresses) to use instead of those given in your +# /etc/resolv.conf file. +# +# On Windows platforms, if no value is specified here or in +# the /etc/resolv.conf file, the list of DNS name servers are +# taken from the Windows registry, both static and dynamic DHCP +# configurations are supported. +# +# Example: dns_nameservers 10.0.0.1 192.172.0.4 +#Default: +# Use operating system definitions + +# TAG: hosts_file +# Location of the host-local IP name-address associations +# database. Most Operating Systems have such a file on different +# default locations: +# - Un*X & Linux: /etc/hosts +# - Windows NT/2000: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\winnt) +# - Windows XP/2003: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\windows) +# - Windows 9x/Me: %windir%\hosts +# (%windir% value is usually c:\windows) +# - Cygwin: /etc/hosts +# +# The file contains newline-separated definitions, in the +# form ip_address_in_dotted_form name [name ...] names are +# whitespace-separated. Lines beginning with an hash (#) +# character are comments. +# +# The file is checked at startup and upon configuration. +# If set to 'none', it won't be checked. +# If append_domain is used, that domain will be added to +# domain-local (i.e. not containing any dot character) host +# definitions. +#Default: +# hosts_file /etc/hosts + +# TAG: append_domain +# Appends local domain name to hostnames without any dots in +# them. append_domain must begin with a period. +# +# Be warned there are now Internet names with no dots in +# them using only top-domain names, so setting this may +# cause some Internet sites to become unavailable. +# +#Example: +# append_domain .yourdomain.com +#Default: +# Use operating system definitions + +# TAG: ignore_unknown_nameservers +# By default Squid checks that DNS responses are received +# from the same IP addresses they are sent to. If they +# don't match, Squid ignores the response and writes a warning +# message to cache.log. You can allow responses from unknown +# nameservers by setting this option to 'off'. +#Default: +# ignore_unknown_nameservers on + +# TAG: dns_v4_first +# With the IPv6 Internet being as fast or faster than IPv4 Internet +# for most networks Squid prefers to contact websites over IPv6. +# +# This option reverses the order of preference to make Squid contact +# dual-stack websites over IPv4 first. Squid will still perform both +# IPv6 and IPv4 DNS lookups before connecting. +# +# WARNING: +# This option will restrict the situations under which IPv6 +# connectivity is used (and tested), potentially hiding network +# problems which would otherwise be detected and warned about. +#Default: +# dns_v4_first off + +# TAG: ipcache_size (number of entries) +# Maximum number of DNS IP cache entries. +#Default: +# ipcache_size 1024 + +# TAG: ipcache_low (percent) +#Default: +# ipcache_low 90 + +# TAG: ipcache_high (percent) +# The size, low-, and high-water marks for the IP cache. +#Default: +# ipcache_high 95 + +# TAG: fqdncache_size (number of entries) +# Maximum number of FQDN cache entries. +#Default: +# fqdncache_size 1024 + +# MISCELLANEOUS +# ----------------------------------------------------------------------------- + +# TAG: configuration_includes_quoted_values on|off +# If set, Squid will recognize each "quoted string" after a configuration +# directive as a single parameter. The quotes are stripped before the +# parameter value is interpreted or used. +# See "Values with spaces, quotes, and other special characters" +# section for more details. +#Default: +# configuration_includes_quoted_values off + +# TAG: memory_pools on|off +# If set, Squid will keep pools of allocated (but unused) memory +# available for future use. If memory is a premium on your +# system and you believe your malloc library outperforms Squid +# routines, disable this. +#Default: +# memory_pools on + +# TAG: memory_pools_limit (bytes) +# Used only with memory_pools on: +# memory_pools_limit 50 MB +# +# If set to a non-zero value, Squid will keep at most the specified +# limit of allocated (but unused) memory in memory pools. All free() +# requests that exceed this limit will be handled by your malloc +# library. Squid does not pre-allocate any memory, just safe-keeps +# objects that otherwise would be free()d. Thus, it is safe to set +# memory_pools_limit to a reasonably high value even if your +# configuration will use less memory. +# +# If set to none, Squid will keep all memory it can. That is, there +# will be no limit on the total amount of memory used for safe-keeping. +# +# To disable memory allocation optimization, do not set +# memory_pools_limit to 0 or none. Set memory_pools to "off" instead. +# +# An overhead for maintaining memory pools is not taken into account +# when the limit is checked. This overhead is close to four bytes per +# object kept. However, pools may actually _save_ memory because of +# reduced memory thrashing in your malloc library. +#Default: +# memory_pools_limit 5 MB + +# TAG: forwarded_for on|off|transparent|truncate|delete +# If set to "on", Squid will append your client's IP address +# in the HTTP requests it forwards. By default it looks like: +# +# X-Forwarded-For: 192.1.2.3 +# +# If set to "off", it will appear as +# +# X-Forwarded-For: unknown +# +# If set to "transparent", Squid will not alter the +# X-Forwarded-For header in any way. +# +# If set to "delete", Squid will delete the entire +# X-Forwarded-For header. +# +# If set to "truncate", Squid will remove all existing +# X-Forwarded-For entries, and place the client IP as the sole entry. +#Default: +# forwarded_for on + +# TAG: cachemgr_passwd +# Specify passwords for cachemgr operations. +# +# Usage: cachemgr_passwd password action action ... +# +# Some valid actions are (see cache manager menu for a full list): +# 5min +# 60min +# asndb +# authenticator +# cbdata +# client_list +# comm_incoming +# config * +# counters +# delay +# digest_stats +# dns +# events +# filedescriptors +# fqdncache +# histograms +# http_headers +# info +# io +# ipcache +# mem +# menu +# netdb +# non_peers +# objects +# offline_toggle * +# pconn +# peer_select +# reconfigure * +# redirector +# refresh +# server_list +# shutdown * +# store_digest +# storedir +# utilization +# via_headers +# vm_objects +# +# * Indicates actions which will not be performed without a +# valid password, others can be performed if not listed here. +# +# To disable an action, set the password to "disable". +# To allow performing an action without a password, set the +# password to "none". +# +# Use the keyword "all" to set the same password for all actions. +# +#Example: +# cachemgr_passwd secret shutdown +# cachemgr_passwd lesssssssecret info stats/objects +# cachemgr_passwd disable all +#Default: +# No password. Actions which require password are denied. + +# TAG: client_db on|off +# If you want to disable collecting per-client statistics, +# turn off client_db here. +#Default: +# client_db on + +# TAG: refresh_all_ims on|off +# When you enable this option, squid will always check +# the origin server for an update when a client sends an +# If-Modified-Since request. Many browsers use IMS +# requests when the user requests a reload, and this +# ensures those clients receive the latest version. +# +# By default (off), squid may return a Not Modified response +# based on the age of the cached version. +#Default: +# refresh_all_ims off + +# TAG: reload_into_ims on|off +# When you enable this option, client no-cache or ``reload'' +# requests will be changed to If-Modified-Since requests. +# Doing this VIOLATES the HTTP standard. Enabling this +# feature could make you liable for problems which it +# causes. +# +# see also refresh_pattern for a more selective approach. +#Default: +# reload_into_ims off + +# TAG: connect_retries +# This sets the maximum number of connection attempts made for each +# TCP connection. The connect_retries attempts must all still +# complete within the connection timeout period. +# +# The default is not to re-try if the first connection attempt fails. +# The (not recommended) maximum is 10 tries. +# +# A warning message will be generated if it is set to a too-high +# value and the configured value will be over-ridden. +# +# Note: These re-tries are in addition to forward_max_tries +# which limit how many different addresses may be tried to find +# a useful server. +#Default: +# Do not retry failed connections. + +# TAG: retry_on_error +# If set to ON Squid will automatically retry requests when +# receiving an error response with status 403 (Forbidden), +# 500 (Internal Error), 501 or 503 (Service not available). +# Status 502 and 504 (Gateway errors) are always retried. +# +# This is mainly useful if you are in a complex cache hierarchy to +# work around access control errors. +# +# NOTE: This retry will attempt to find another working destination. +# Which is different from the server which just failed. +#Default: +# retry_on_error off + +# TAG: as_whois_server +# WHOIS server to query for AS numbers. NOTE: AS numbers are +# queried only when Squid starts up, not for every request. +#Default: +# as_whois_server whois.ra.net + +# TAG: offline_mode +# Enable this option and Squid will never try to validate cached +# objects. +#Default: +# offline_mode off + +# TAG: uri_whitespace +# What to do with requests that have whitespace characters in the +# URI. Options: +# +# strip: The whitespace characters are stripped out of the URL. +# This is the behavior recommended by RFC2396 and RFC3986 +# for tolerant handling of generic URI. +# NOTE: This is one difference between generic URI and HTTP URLs. +# +# deny: The request is denied. The user receives an "Invalid +# Request" message. +# This is the behaviour recommended by RFC2616 for safe +# handling of HTTP request URL. +# +# allow: The request is allowed and the URI is not changed. The +# whitespace characters remain in the URI. Note the +# whitespace is passed to redirector processes if they +# are in use. +# Note this may be considered a violation of RFC2616 +# request parsing where whitespace is prohibited in the +# URL field. +# +# encode: The request is allowed and the whitespace characters are +# encoded according to RFC1738. +# +# chop: The request is allowed and the URI is chopped at the +# first whitespace. +# +# +# NOTE the current Squid implementation of encode and chop violates +# RFC2616 by not using a 301 redirect after altering the URL. +#Default: +# uri_whitespace strip + +# TAG: chroot +# Specifies a directory where Squid should do a chroot() while +# initializing. This also causes Squid to fully drop root +# privileges after initializing. This means, for example, if you +# use a HTTP port less than 1024 and try to reconfigure, you may +# get an error saying that Squid can not open the port. +#Default: +# none + +# TAG: balance_on_multiple_ip +# Modern IP resolvers in squid sort lookup results by preferred access. +# By default squid will use these IP in order and only rotates to +# the next listed when the most preffered fails. +# +# Some load balancing servers based on round robin DNS have been +# found not to preserve user session state across requests +# to different IP addresses. +# +# Enabling this directive Squid rotates IP's per request. +#Default: +# balance_on_multiple_ip off + +# TAG: pipeline_prefetch +# HTTP clients may send a pipeline of 1+N requests to Squid using a +# single connection, without waiting for Squid to respond to the first +# of those requests. This option limits the number of concurrent +# requests Squid will try to handle in parallel. If set to N, Squid +# will try to receive and process up to 1+N requests on the same +# connection concurrently. +# +# Defaults to 0 (off) for bandwidth management and access logging +# reasons. +# +# NOTE: pipelining requires persistent connections to clients. +# +# WARNING: pipelining breaks NTLM and Negotiate/Kerberos authentication. +#Default: +# Do not pre-parse pipelined requests. + +# TAG: high_response_time_warning (msec) +# If the one-minute median response time exceeds this value, +# Squid prints a WARNING with debug level 0 to get the +# administrators attention. The value is in milliseconds. +#Default: +# disabled. + +# TAG: high_page_fault_warning +# If the one-minute average page fault rate exceeds this +# value, Squid prints a WARNING with debug level 0 to get +# the administrators attention. The value is in page faults +# per second. +#Default: +# disabled. + +# TAG: high_memory_warning +# Note: This option is only available if Squid is rebuilt with the +# GNU Malloc with mstats() +# +# If the memory usage (as determined by gnumalloc, if available and used) +# exceeds this amount, Squid prints a WARNING with debug level 0 to get +# the administrators attention. +#Default: +# disabled. + +# TAG: sleep_after_fork (microseconds) +# When this is set to a non-zero value, the main Squid process +# sleeps the specified number of microseconds after a fork() +# system call. This sleep may help the situation where your +# system reports fork() failures due to lack of (virtual) +# memory. Note, however, if you have a lot of child +# processes, these sleep delays will add up and your +# Squid will not service requests for some amount of time +# until all the child processes have been started. +# On Windows value less then 1000 (1 milliseconds) are +# rounded to 1000. +#Default: +# sleep_after_fork 0 + +# TAG: windows_ipaddrchangemonitor on|off +# Note: This option is only available if Squid is rebuilt with the +# MS Windows +# +# On Windows Squid by default will monitor IP address changes and will +# reconfigure itself after any detected event. This is very useful for +# proxies connected to internet with dial-up interfaces. +# In some cases (a Proxy server acting as VPN gateway is one) it could be +# desiderable to disable this behaviour setting this to 'off'. +# Note: after changing this, Squid service must be restarted. +#Default: +# windows_ipaddrchangemonitor on + +# TAG: eui_lookup +# Whether to lookup the EUI or MAC address of a connected client. +#Default: +# eui_lookup on + +# TAG: max_filedescriptors +# Reduce the maximum number of filedescriptors supported below +# the usual operating system defaults. +# +# Remove from squid.conf to inherit the current ulimit setting. +# +# Note: Changing this requires a restart of Squid. Also +# not all I/O types supports large values (eg on Windows). +#Default: +# Use operating system limits set by ulimit. + diff --git a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile new file mode 100644 index 0000000000..dafba7640a --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile @@ -0,0 +1,29 @@ +#@# vim: set filetype=dockerfile: +# Code taken from: https://github.com/hinata/nginx-forward-proxy + +FROM ubuntu/squid +LABEL maintainer "Larry Osterman" + +ENV NGINX_VERSION 1.23.1 + +## +# dependent packages for docker build +## + +WORKDIR /tmp + +RUN apt-get -y update + +## +# application deployment +## + +WORKDIR / + +COPY ./squid.conf /etc/squid/squid.conf + +EXPOSE 3128 + +STOPSIGNAL SIGTERM + +ENTRYPOINT squid -f /etc/squid/squid.conf && sleep 10 && tail -f /var/log/squid/access.log diff --git a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/squid.conf b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/squid.conf new file mode 100644 index 0000000000..c576a6aa17 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/squid.conf @@ -0,0 +1,8001 @@ +# WELCOME TO SQUID 3.5.27 +# ---------------------------- +# +# This is the documentation for the Squid configuration file. +# This documentation can also be found online at: +# http://www.squid-cache.org/Doc/config/ +# +# You may wish to look at the Squid home page and wiki for the +# FAQ and other documentation: +# http://www.squid-cache.org/ +# http://wiki.squid-cache.org/SquidFaq +# http://wiki.squid-cache.org/ConfigExamples +# +# This documentation shows what the defaults for various directives +# happen to be. If you don't need to change the default, you should +# leave the line out of your squid.conf in most cases. +# +# In some cases "none" refers to no default setting at all, +# while in other cases it refers to the value of the option +# - the comments for that keyword indicate if this is the case. +# + +# Configuration options can be included using the "include" directive. +# Include takes a list of files to include. Quoting and wildcards are +# supported. +# +# For example, +# +# include /path/to/included/file/squid.acl.config +# +# Includes can be nested up to a hard-coded depth of 16 levels. +# This arbitrary restriction is to prevent recursive include references +# from causing Squid entering an infinite loop whilst trying to load +# configuration files. +# +# Values with byte units +# +# Squid accepts size units on some size related directives. All +# such directives are documented with a default value displaying +# a unit. +# +# Units accepted by Squid are: +# bytes - byte +# KB - Kilobyte (1024 bytes) +# MB - Megabyte +# GB - Gigabyte +# +# Values with spaces, quotes, and other special characters +# +# Squid supports directive parameters with spaces, quotes, and other +# special characters. Surround such parameters with "double quotes". Use +# the configuration_includes_quoted_values directive to enable or +# disable that support. +# +# Squid supports reading configuration option parameters from external +# files using the syntax: +# parameters("/path/filename") +# For example: +# acl whitelist dstdomain parameters("/etc/squid/whitelist.txt") +# +# Conditional configuration +# +# If-statements can be used to make configuration directives +# depend on conditions: +# +# if +# ... regular configuration directives ... +# [else +# ... regular configuration directives ...] +# endif +# +# The else part is optional. The keywords "if", "else", and "endif" +# must be typed on their own lines, as if they were regular +# configuration directives. +# +# NOTE: An else-if condition is not supported. +# +# These individual conditions types are supported: +# +# true +# Always evaluates to true. +# false +# Always evaluates to false. +# = +# Equality comparison of two integer numbers. +# +# +# SMP-Related Macros +# +# The following SMP-related preprocessor macros can be used. +# +# ${process_name} expands to the current Squid process "name" +# (e.g., squid1, squid2, or cache1). +# +# ${process_number} expands to the current Squid process +# identifier, which is an integer number (e.g., 1, 2, 3) unique +# across all Squid processes of the current service instance. +# +# ${service_name} expands into the current Squid service instance +# name identifier which is provided by -n on the command line. +# + +# TAG: broken_vary_encoding +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: cache_vary +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: error_map +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: external_refresh_check +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: location_rewrite_program +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: refresh_stale_hit +# This option is not yet supported by Squid-3. +#Default: +# none + +# TAG: hierarchy_stoplist +# Remove this line. Use always_direct or cache_peer_access ACLs instead if you need to prevent cache_peer use. +#Default: +# none + +# TAG: log_access +# Remove this line. Use acls with access_log directives to control access logging +#Default: +# none + +# TAG: log_icap +# Remove this line. Use acls with icap_log directives to control icap logging +#Default: +# none + +# TAG: ignore_ims_on_miss +# Remove this line. The HTTP/1.1 feature is now configured by 'cache_miss_revalidate'. +#Default: +# none + +# TAG: chunked_request_body_max_size +# Remove this line. Squid is now HTTP/1.1 compliant. +#Default: +# none + +# TAG: dns_v4_fallback +# Remove this line. Squid performs a 'Happy Eyeballs' algorithm, the 'fallback' algorithm is no longer relevant. +#Default: +# none + +# TAG: emulate_httpd_log +# Replace this with an access_log directive using the format 'common' or 'combined'. +#Default: +# none + +# TAG: forward_log +# Use a regular access.log with ACL limiting it to MISS events. +#Default: +# none + +# TAG: ftp_list_width +# Remove this line. Configure FTP page display using the CSS controls in errorpages.css instead. +#Default: +# none + +# TAG: ignore_expect_100 +# Remove this line. The HTTP/1.1 feature is now fully supported by default. +#Default: +# none + +# TAG: log_fqdn +# Remove this option from your config. To log FQDN use %>A in the log format. +#Default: +# none + +# TAG: log_ip_on_direct +# Remove this option from your config. To log server or peer names use % +##auth_param negotiate children 20 startup=0 idle=1 +##auth_param negotiate keep_alive on +## +##auth_param digest program +##auth_param digest children 20 startup=0 idle=1 +##auth_param digest realm Squid proxy-caching web server +##auth_param digest nonce_garbage_interval 5 minutes +##auth_param digest nonce_max_duration 30 minutes +##auth_param digest nonce_max_count 50 +## +##auth_param ntlm program +##auth_param ntlm children 20 startup=0 idle=1 +##auth_param ntlm keep_alive on +## +##auth_param basic program +##auth_param basic children 5 startup=5 idle=1 +##auth_param basic realm Squid proxy-caching web server +##auth_param basic credentialsttl 2 hours +#Default: +# none + +# TAG: authenticate_cache_garbage_interval +# The time period between garbage collection across the username cache. +# This is a trade-off between memory utilization (long intervals - say +# 2 days) and CPU (short intervals - say 1 minute). Only change if you +# have good reason to. +#Default: +# authenticate_cache_garbage_interval 1 hour + +# TAG: authenticate_ttl +# The time a user & their credentials stay in the logged in +# user cache since their last request. When the garbage +# interval passes, all user credentials that have passed their +# TTL are removed from memory. +#Default: +# authenticate_ttl 1 hour + +# TAG: authenticate_ip_ttl +# If you use proxy authentication and the 'max_user_ip' ACL, +# this directive controls how long Squid remembers the IP +# addresses associated with each user. Use a small value +# (e.g., 60 seconds) if your users might change addresses +# quickly, as is the case with dialup. You might be safe +# using a larger value (e.g., 2 hours) in a corporate LAN +# environment with relatively static address assignments. +#Default: +# authenticate_ip_ttl 1 second + +# ACCESS CONTROLS +# ----------------------------------------------------------------------------- + +# TAG: external_acl_type +# This option defines external acl classes using a helper program +# to look up the status +# +# external_acl_type name [options] FORMAT.. /path/to/helper [helper arguments..] +# +# Options: +# +# ttl=n TTL in seconds for cached results (defaults to 3600 +# for 1 hour) +# +# negative_ttl=n +# TTL for cached negative lookups (default same +# as ttl) +# +# grace=n Percentage remaining of TTL where a refresh of a +# cached entry should be initiated without needing to +# wait for a new reply. (default is for no grace period) +# +# cache=n The maximum number of entries in the result cache. The +# default limit is 262144 entries. Each cache entry usually +# consumes at least 256 bytes. Squid currently does not remove +# expired cache entries until the limit is reached, so a proxy +# will sooner or later reach the limit. The expanded FORMAT +# value is used as the cache key, so if the details in FORMAT +# are highly variable, a larger cache may be needed to produce +# reduction in helper load. +# +# children-max=n +# Maximum number of acl helper processes spawned to service +# external acl lookups of this type. (default 5) +# +# children-startup=n +# Minimum number of acl helper processes to spawn during +# startup and reconfigure to service external acl lookups +# of this type. (default 0) +# +# children-idle=n +# Number of acl helper processes to keep ahead of traffic +# loads. Squid will spawn this many at once whenever load +# rises above the capabilities of existing processes. +# Up to the value of children-max. (default 1) +# +# concurrency=n concurrency level per process. Only used with helpers +# capable of processing more than one query at a time. +# +# protocol=2.5 Compatibility mode for Squid-2.5 external acl helpers. +# +# ipv4 / ipv6 IP protocol used to communicate with this helper. +# The default is to auto-detect IPv6 and use it when available. +# +# +# FORMAT specifications +# +# %LOGIN Authenticated user login name +# %un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul or %LOGIN +# - user name sent by an external ACL, like %EXT_USER +# - SSL client name, like %us in logformat +# - ident user name, like %ui in logformat +# %EXT_USER Username from previous external acl +# %EXT_LOG Log details from previous external acl +# %EXT_TAG Tag from previous external acl +# %IDENT Ident user name +# %SRC Client IP +# %SRCPORT Client source port +# %URI Requested URI +# %DST Requested host +# %PROTO Requested URL scheme +# %PORT Requested port +# %PATH Requested URL path +# %METHOD Request method +# %MYADDR Squid interface address +# %MYPORT Squid http_port number +# %PATH Requested URL-path (including query-string if any) +# %USER_CERT SSL User certificate in PEM format +# %USER_CERTCHAIN SSL User certificate chain in PEM format +# %USER_CERT_xx SSL User certificate subject attribute xx +# %USER_CA_CERT_xx SSL User certificate issuer attribute xx +# %ssl::>sni SSL client SNI sent to Squid +# %ssl::{Header} HTTP request header "Header" +# %>{Hdr:member} +# HTTP request header "Hdr" list member "member" +# %>{Hdr:;member} +# HTTP request header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %<{Header} HTTP reply header "Header" +# %<{Hdr:member} +# HTTP reply header "Hdr" list member "member" +# %<{Hdr:;member} +# HTTP reply header list member using ; as +# list separator. ; can be any non-alphanumeric +# character. +# +# %ACL The name of the ACL being tested. +# %DATA The ACL arguments. If not used then any arguments +# is automatically added at the end of the line +# sent to the helper. +# NOTE: this will encode the arguments as one token, +# whereas the default will pass each separately. +# +# %% The percent sign. Useful for helpers which need +# an unchanging input format. +# +# +# General request syntax: +# +# [channel-ID] FORMAT-values [acl-values ...] +# +# +# FORMAT-values consists of transaction details expanded with +# whitespace separation per the config file FORMAT specification +# using the FORMAT macros listed above. +# +# acl-values consists of any string specified in the referencing +# config 'acl ... external' line. see the "acl external" directive. +# +# Request values sent to the helper are URL escaped to protect +# each value in requests against whitespaces. +# +# If using protocol=2.5 then the request sent to the helper is not +# URL escaped to protect against whitespace. +# +# NOTE: protocol=3.0 is deprecated as no longer necessary. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# +# The helper receives lines expanded per the above format specification +# and for each input line returns 1 line starting with OK/ERR/BH result +# code and optionally followed by additional keywords with more details. +# +# +# General result syntax: +# +# [channel-ID] result keyword=value ... +# +# Result consists of one of the codes: +# +# OK +# the ACL test produced a match. +# +# ERR +# the ACL test does not produce a match. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. +# +# The meaning of 'a match' is determined by your squid.conf +# access control configuration. See the Squid wiki for details. +# +# Defined keywords: +# +# user= The users name (login) +# +# password= The users password (for login= cache_peer option) +# +# message= Message describing the reason for this response. +# Available as %o in error pages. +# Useful on (ERR and BH results). +# +# tag= Apply a tag to a request. Only sets a tag once, +# does not alter existing tags. +# +# log= String to be logged in access.log. Available as +# %ea in logformat specifications. +# +# clt_conn_tag= Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation +# for this kv-pair. +# +# Any keywords may be sent on any response whether OK, ERR or BH. +# +# All response keyword values need to be a single token with URL +# escaping, or enclosed in double quotes (") and escaped using \ on +# any double quotes or \ characters within the value. The wrapping +# double quotes are removed before the value is interpreted by Squid. +# \r and \n are also replace by CR and LF. +# +# Some example key values: +# +# user=John%20Smith +# user="John Smith" +# user="J. \"Bob\" Smith" +#Default: +# none + +# TAG: acl +# Defining an Access List +# +# Every access list definition must begin with an aclname and acltype, +# followed by either type-specific arguments or a quoted filename that +# they are read from. +# +# acl aclname acltype argument ... +# acl aclname acltype "file" ... +# +# When using "file", the file should contain one item per line. +# +# Some acl types supports options which changes their default behaviour. +# The available options are: +# +# -i,+i By default, regular expressions are CASE-SENSITIVE. To make them +# case-insensitive, use the -i option. To return case-sensitive +# use the +i option between patterns, or make a new ACL line +# without -i. +# +# -n Disable lookups and address type conversions. If lookup or +# conversion is required because the parameter type (IP or +# domain name) does not match the message address type (domain +# name or IP), then the ACL would immediately declare a mismatch +# without any warnings or lookups. +# +# -- Used to stop processing all options, in the case the first acl +# value has '-' character as first character (for example the '-' +# is a valid domain name) +# +# Some acl types require suspending the current request in order +# to access some external data source. +# Those which do are marked with the tag [slow], those which +# don't are marked as [fast]. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl +# for further information +# +# ***** ACL TYPES AVAILABLE ***** +# +# acl aclname src ip-address/mask ... # clients IP address [fast] +# acl aclname src addr1-addr2/mask ... # range of addresses [fast] +# acl aclname dst [-n] ip-address/mask ... # URL host's IP address [slow] +# acl aclname localip ip-address/mask ... # IP address the client connected to [fast] +# +# acl aclname arp mac-address ... (xx:xx:xx:xx:xx:xx notation) +# # [fast] +# # The 'arp' ACL code is not portable to all operating systems. +# # It works on Linux, Solaris, Windows, FreeBSD, and some other +# # BSD variants. +# # +# # NOTE: Squid can only determine the MAC/EUI address for IPv4 +# # clients that are on the same subnet. If the client is on a +# # different subnet, then Squid cannot find out its address. +# # +# # NOTE 2: IPv6 protocol does not contain ARP. MAC/EUI is either +# # encoded directly in the IPv6 address or not available. +# +# acl aclname srcdomain .foo.com ... +# # reverse lookup, from client IP [slow] +# acl aclname dstdomain [-n] .foo.com ... +# # Destination server from URL [fast] +# acl aclname srcdom_regex [-i] \.foo\.com ... +# # regex matching client name [slow] +# acl aclname dstdom_regex [-n] [-i] \.foo\.com ... +# # regex matching server [fast] +# # +# # For dstdomain and dstdom_regex a reverse lookup is tried if a IP +# # based URL is used and no match is found. The name "none" is used +# # if the reverse lookup fails. +# +# acl aclname src_as number ... +# acl aclname dst_as number ... +# # [fast] +# # Except for access control, AS numbers can be used for +# # routing of requests to specific caches. Here's an +# # example for routing all requests for AS#1241 and only +# # those to mycache.mydomain.net: +# # acl asexample dst_as 1241 +# # cache_peer_access mycache.mydomain.net allow asexample +# # cache_peer_access mycache_mydomain.net deny all +# +# acl aclname peername myPeer ... +# # [fast] +# # match against a named cache_peer entry +# # set unique name= on cache_peer lines for reliable use. +# +# acl aclname time [day-abbrevs] [h1:m1-h2:m2] +# # [fast] +# # day-abbrevs: +# # S - Sunday +# # M - Monday +# # T - Tuesday +# # W - Wednesday +# # H - Thursday +# # F - Friday +# # A - Saturday +# # h1:m1 must be less than h2:m2 +# +# acl aclname url_regex [-i] ^http:// ... +# # regex matching on whole URL [fast] +# acl aclname urllogin [-i] [^a-zA-Z0-9] ... +# # regex matching on URL login field +# acl aclname urlpath_regex [-i] \.gif$ ... +# # regex matching on URL path [fast] +# +# acl aclname port 80 70 21 0-1024... # destination TCP port [fast] +# # ranges are alloed +# acl aclname localport 3128 ... # TCP port the client connected to [fast] +# # NP: for interception mode this is usually '80' +# +# acl aclname myportname 3128 ... # *_port name [fast] +# +# acl aclname proto HTTP FTP ... # request protocol [fast] +# +# acl aclname method GET POST ... # HTTP request method [fast] +# +# acl aclname http_status 200 301 500- 400-403 ... +# # status code in reply [fast] +# +# acl aclname browser [-i] regexp ... +# # pattern match on User-Agent header (see also req_header below) [fast] +# +# acl aclname referer_regex [-i] regexp ... +# # pattern match on Referer header [fast] +# # Referer is highly unreliable, so use with care +# +# acl aclname ident username ... +# acl aclname ident_regex [-i] pattern ... +# # string match on ident output [slow] +# # use REQUIRED to accept any non-null ident. +# +# acl aclname proxy_auth [-i] username ... +# acl aclname proxy_auth_regex [-i] pattern ... +# # perform http authentication challenge to the client and match against +# # supplied credentials [slow] +# # +# # takes a list of allowed usernames. +# # use REQUIRED to accept any valid username. +# # +# # Will use proxy authentication in forward-proxy scenarios, and plain +# # http authenticaiton in reverse-proxy scenarios +# # +# # NOTE: when a Proxy-Authentication header is sent but it is not +# # needed during ACL checking the username is NOT logged +# # in access.log. +# # +# # NOTE: proxy_auth requires a EXTERNAL authentication program +# # to check username/password combinations (see +# # auth_param directive). +# # +# # NOTE: proxy_auth can't be used in a transparent/intercepting proxy +# # as the browser needs to be configured for using a proxy in order +# # to respond to proxy authentication. +# +# acl aclname snmp_community string ... +# # A community string to limit access to your SNMP Agent [fast] +# # Example: +# # +# # acl snmppublic snmp_community public +# +# acl aclname maxconn number +# # This will be matched when the client's IP address has +# # more than TCP connections established. [fast] +# # NOTE: This only measures direct TCP links so X-Forwarded-For +# # indirect clients are not counted. +# +# acl aclname max_user_ip [-s] number +# # This will be matched when the user attempts to log in from more +# # than different ip addresses. The authenticate_ip_ttl +# # parameter controls the timeout on the ip entries. [fast] +# # If -s is specified the limit is strict, denying browsing +# # from any further IP addresses until the ttl has expired. Without +# # -s Squid will just annoy the user by "randomly" denying requests. +# # (the counter is reset each time the limit is reached and a +# # request is denied) +# # NOTE: in acceleration mode or where there is mesh of child proxies, +# # clients may appear to come from multiple addresses if they are +# # going through proxy farms, so a limit of 1 may cause user problems. +# +# acl aclname random probability +# # Pseudo-randomly match requests. Based on the probability given. +# # Probability may be written as a decimal (0.333), fraction (1/3) +# # or ratio of matches:non-matches (3:5). +# +# acl aclname req_mime_type [-i] mime-type ... +# # regex match against the mime type of the request generated +# # by the client. Can be used to detect file upload or some +# # types HTTP tunneling requests [fast] +# # NOTE: This does NOT match the reply. You cannot use this +# # to match the returned file type. +# +# acl aclname req_header header-name [-i] any\.regex\.here +# # regex match against any of the known request headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACL [fast] +# +# acl aclname rep_mime_type [-i] mime-type ... +# # regex match against the mime type of the reply received by +# # squid. Can be used to detect file download or some +# # types HTTP tunneling requests. [fast] +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname rep_header header-name [-i] any\.regex\.here +# # regex match against any of the known reply headers. May be +# # thought of as a superset of "browser", "referer" and "mime-type" +# # ACLs [fast] +# +# acl aclname external class_name [arguments...] +# # external ACL lookup via a helper class defined by the +# # external_acl_type directive [slow] +# +# acl aclname user_cert attribute values... +# # match against attributes in a user SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ca_cert attribute values... +# # match against attributes a users issuing CA SSL certificate +# # attribute is one of DN/C/O/CN/L/ST or a numerical OID [fast] +# +# acl aclname ext_user username ... +# acl aclname ext_user_regex [-i] pattern ... +# # string match on username returned by external acl helper [slow] +# # use REQUIRED to accept any non-null user name. +# +# acl aclname tag tagvalue ... +# # string match on tag returned by external acl helper [fast] +# # DEPRECATED. Only the first tag will match with this ACL. +# # Use the 'note' ACL instead for handling multiple tag values. +# +# acl aclname hier_code codename ... +# # string match against squid hierarchy code(s); [fast] +# # e.g., DIRECT, PARENT_HIT, NONE, etc. +# # +# # NOTE: This has no effect in http_access rules. It only has +# # effect in rules that affect the reply data stream such as +# # http_reply_access. +# +# acl aclname note name [value ...] +# # match transaction annotation [fast] +# # Without values, matches any annotation with a given name. +# # With value(s), matches any annotation with a given name that +# # also has one of the given values. +# # Names and values are compared using a string equality test. +# # Annotation sources include note and adaptation_meta directives +# # as well as helper and eCAP responses. +# +# acl aclname adaptation_service service ... +# # Matches the name of any icap_service, ecap_service, +# # adaptation_service_set, or adaptation_service_chain that Squid +# # has used (or attempted to use) for the master transaction. +# # This ACL must be defined after the corresponding adaptation +# # service is named in squid.conf. This ACL is usable with +# # adaptation_meta because it starts matching immediately after +# # the service has been selected for adaptation. +# +# acl aclname any-of acl1 acl2 ... +# # match any one of the acls [fast or slow] +# # The first matching ACL stops further ACL evaluation. +# # +# # ACLs from multiple any-of lines with the same name are ORed. +# # For example, A = (a1 or a2) or (a3 or a4) can be written as +# # acl A any-of a1 a2 +# # acl A any-of a3 a4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# acl aclname all-of acl1 acl2 ... +# # match all of the acls [fast or slow] +# # The first mismatching ACL stops further ACL evaluation. +# # +# # ACLs from multiple all-of lines with the same name are ORed. +# # For example, B = (b1 and b2) or (b3 and b4) can be written as +# # acl B all-of b1 b2 +# # acl B all-of b3 b4 +# # +# # This group ACL is fast if all evaluated ACLs in the group are fast +# # and slow otherwise. +# +# Examples: +# acl macaddress arp 09:00:2b:23:45:67 +# acl myexample dst_as 1241 +# acl password proxy_auth REQUIRED +# acl fileupload req_mime_type -i ^multipart/form-data$ +# acl javascript rep_mime_type -i ^application/x-javascript$ +# +#Default: +# ACLs all, manager, localhost, and to_localhost are predefined. +# +# +# Recommended minimum configuration: +# + +# Example rule allowing access from your local networks. +# Adapt to list your (internal) IP networks from where browsing +# should be allowed +acl localnet src 10.0.0.0/8 # RFC1918 possible internal network +acl localnet src 172.16.0.0/12 # RFC1918 possible internal network +acl localnet src 192.168.0.0/16 # RFC1918 possible internal network +acl localnet src fc00::/7 # RFC 4193 local private network range +acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines +acl localnet src 2001:4898::/48 + + + +acl SSL_ports port 443 +acl Safe_ports port 80 # http +acl Safe_ports port 21 # ftp +acl Safe_ports port 443 # https +acl Safe_ports port 70 # gopher +acl Safe_ports port 210 # wais +acl Safe_ports port 1025-65535 # unregistered ports +acl Safe_ports port 280 # http-mgmt +acl Safe_ports port 488 # gss-http +acl Safe_ports port 591 # filemaker +acl Safe_ports port 777 # multiling http +acl CONNECT method CONNECT +# Enable blocking all websites other than azuresdkforcpp.azurewebsites.net. +acl cpptestserver dstdomain azuresdkforcpp.azurewebsites.net + +# TAG: proxy_protocol_access +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address using PROXY protocol. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# This directive is solely for validating new PROXY protocol +# connections received from a port flagged with require-proxy-header. +# It is checked only once after TCP connection setup. +# +# A deny match results in TCP connection closure. +# +# An allow match is required for Squid to permit the corresponding +# TCP connection, before Squid even looks for HTTP request headers. +# If there is an allow match, Squid starts using PROXY header information +# to determine the source address of the connection for all future ACL +# checks, logging, etc. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# all TCP connections to ports with require-proxy-header will be denied + +# TAG: follow_x_forwarded_for +# Determine which client proxies can be trusted to provide correct +# information regarding real client IP address. +# +# Requests may pass through a chain of several other proxies +# before reaching us. The original source details may by sent in: +# * HTTP message Forwarded header, or +# * HTTP message X-Forwarded-For header, or +# * PROXY protocol connection header. +# +# PROXY protocol connections are controlled by the proxy_protocol_access +# directive which is checked before this. +# +# If a request reaches us from a source that is allowed by this +# directive, then we trust the information it provides regarding +# the IP of the client it received from (if any). +# +# For the purpose of ACLs used in this directive the src ACL type always +# matches the address we are testing and srcdomain matches its rDNS. +# +# On each HTTP request Squid checks for X-Forwarded-For header fields. +# If found the header values are iterated in reverse order and an allow +# match is required for Squid to continue on to the next value. +# The verification ends when a value receives a deny match, cannot be +# tested, or there are no more values to test. +# NOTE: Squid does not yet follow the Forwarded HTTP header. +# +# The end result of this process is an IP address that we will +# refer to as the indirect client address. This address may +# be treated as the client address for access control, ICAP, delay +# pools and logging, depending on the acl_uses_indirect_client, +# icap_uses_indirect_client, delay_pool_uses_indirect_client, +# log_uses_indirect_client and tproxy_uses_indirect_client options. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# SECURITY CONSIDERATIONS: +# +# Any host from which we accept client IP details can place +# incorrect information in the relevant header, and Squid +# will use the incorrect information as if it were the +# source address of the request. This may enable remote +# hosts to bypass any access control restrictions that are +# based on the client's source addresses. +# +# For example: +# +# acl localhost src 127.0.0.1 +# acl my_other_proxy srcdomain .proxy.example.com +# follow_x_forwarded_for allow localhost +# follow_x_forwarded_for allow my_other_proxy +#Default: +# X-Forwarded-For header will be ignored. + +# TAG: acl_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in acl matching. +# +# NOTE: maxconn ACL considers direct TCP links and indirect +# clients will always have zero. So no match. +#Default: +# acl_uses_indirect_client on + +# TAG: delay_pool_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in delay pools. +#Default: +# delay_pool_uses_indirect_client on + +# TAG: log_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address in the access log. +#Default: +# log_uses_indirect_client on + +# TAG: tproxy_uses_indirect_client on|off +# Controls whether the indirect client address +# (see follow_x_forwarded_for) is used instead of the +# direct client address when spoofing the outgoing client. +# +# This has no effect on requests arriving in non-tproxy +# mode ports. +# +# SECURITY WARNING: Usage of this option is dangerous +# and should not be used trivially. Correct configuration +# of follow_x_forwarded_for with a limited set of trusted +# sources is required to prevent abuse of your proxy. +#Default: +# tproxy_uses_indirect_client off + +# TAG: spoof_client_ip +# Control client IP address spoofing of TPROXY traffic based on +# defined access lists. +# +# spoof_client_ip allow|deny [!]aclname ... +# +# If there are no "spoof_client_ip" lines present, the default +# is to "allow" spoofing of any suitable request. +# +# Note that the cache_peer "no-tproxy" option overrides this ACL. +# +# This clause supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow spoofing on all TPROXY traffic. + +# TAG: http_access +# Allowing or Denying access based on defined access lists +# +# To allow or deny a message received on an HTTP, HTTPS, or FTP port: +# http_access allow|deny [!]aclname ... +# +# NOTE on default values: +# +# If there are no "access" lines present, the default is to deny +# the request. +# +# If none of the "access" lines cause a match, the default is the +# opposite of the last line in the list. If the last line was +# deny, the default is allow. Conversely, if the last line +# is allow, the default will be deny. For these reasons, it is a +# good idea to have an "deny all" entry at the end of your access +# lists to avoid potential confusion. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Default: +# Deny, unless rules exist in squid.conf. +# + +# +# Recommended minimum Access Permission configuration: +# +# Deny requests to certain unsafe ports +http_access deny !Safe_ports + +# Deny CONNECT to other than secure SSL ports +http_access deny CONNECT !SSL_ports + +# Only allow cachemgr access from localhost +http_access allow localhost manager +http_access deny manager + +#auth_param negotiate program /usr/lib/squid/negotiate_wrapper_auth --ntlm /usr/bin/ntlm_auth --helper-protocol=gss-spnego --kerberos /usr/lib/squid/negotiate_kerberos_auth +# +#auth_param negotiate children 30 startup=2 idle=1 +#auth_param negotiate keep_alive on + +#acl AuthUsers proxy_auth REQUIRED +#http_access allow AuthUsers + +# We strongly recommend the following be uncommented to protect innocent +# web applications running on the proxy server who think the only +# one who can access services on "localhost" is a local user +#http_access deny to_localhost + +# +# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS +# + +# Deny access to all servers that aren't the CPP team's test server. +http_access deny !cpptestserver + +# Example rule allowing access from your local networks. +# Adapt localnet in the ACL section to list your (internal) IP networks +# from where browsing should be allowed + +http_access allow localnet +http_access allow localhost + +# Allow all other access to this proxy +http_access allow all + +# And finally deny all other access to this proxy +http_access deny all + +# TAG: adapted_http_access +# Allowing or Denying access based on defined access lists +# +# Essentially identical to http_access, but runs after redirectors +# and ICAP/eCAP adaptation. Allowing access control based on their +# output. +# +# If not set then only http_access is used. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: http_reply_access +# Allow replies to client requests. This is complementary to http_access. +# +# http_reply_access allow|deny [!] aclname ... +# +# NOTE: if there are no access lines present, the default is to allow +# all replies. +# +# If none of the access lines cause a match the opposite of the +# last line will apply. Thus it is good practice to end the rules +# with an "allow all" or "deny all" entry. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: icp_access +# Allowing or Denying access to the ICP port based on defined +# access lists +# +# icp_access allow|deny [!]aclname ... +# +# NOTE: The default if no icp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using ICP. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow ICP queries from local networks only +##icp_access allow localnet +##icp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_access +# Allowing or Denying access to the HTCP port based on defined +# access lists +# +# htcp_access allow|deny [!]aclname ... +# +# See also htcp_clr_access for details on access control for +# cache purge (CLR) HTCP messages. +# +# NOTE: The default if no htcp_access lines are present is to +# deny all traffic. This default may cause problems with peers +# using the htcp option. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP queries from local networks only +##htcp_access allow localnet +##htcp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: htcp_clr_access +# Allowing or Denying access to purge content using HTCP based +# on defined access lists. +# See htcp_access for details on general HTCP access control. +# +# htcp_clr_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +## Allow HTCP CLR requests from trusted peers +#acl htcp_clr_peer src 192.0.2.2 2001:DB8::2 +#htcp_clr_access allow htcp_clr_peer +#htcp_clr_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: miss_access +# Determines whether network access is permitted when satisfying a request. +# +# For example; +# to force your neighbors to use you as a sibling instead of +# a parent. +# +# acl localclients src 192.0.2.0/24 2001:DB8::a:0/64 +# miss_access deny !localclients +# miss_access allow all +# +# This means only your local clients are allowed to fetch relayed/MISS +# replies from the network and all other clients can only fetch cached +# objects (HITs). +# +# The default for this setting allows all clients who passed the +# http_access rules to relay via this proxy. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: ident_lookup_access +# A list of ACL elements which, if matched, cause an ident +# (RFC 931) lookup to be performed for this request. For +# example, you might choose to always perform ident lookups +# for your main multi-user Unix boxes, but not for your Macs +# and PCs. By default, ident lookups are not performed for +# any requests. +# +# To enable ident lookups for specific client addresses, you +# can follow this example: +# +# acl ident_aware_hosts src 198.168.1.0/24 +# ident_lookup_access allow ident_aware_hosts +# ident_lookup_access deny all +# +# Only src type ACL checks are fully supported. A srcdomain +# ACL might work at times, but it will not always provide +# the correct result. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Unless rules exist in squid.conf, IDENT is not fetched. + +# TAG: reply_body_max_size size [acl acl...] +# This option specifies the maximum size of a reply body. It can be +# used to prevent users from downloading very large files, such as +# MP3's and movies. When the reply headers are received, the +# reply_body_max_size lines are processed, and the first line where +# all (if any) listed ACLs are true is used as the maximum body size +# for this reply. +# +# This size is checked twice. First when we get the reply headers, +# we check the content-length value. If the content length value exists +# and is larger than the allowed size, the request is denied and the +# user receives an error message that says "the request or reply +# is too large." If there is no content-length, and the reply +# size exceeds this limit, the client's connection is just closed +# and they will receive a partial reply. +# +# WARNING: downstream caches probably can not detect a partial reply +# if there is no content-length header, so they will cache +# partial responses and give them out as hits. You should NOT +# use this option if you have downstream caches. +# +# WARNING: A maximum size smaller than the size of squid's error messages +# will cause an infinite loop and crash squid. Ensure that the smallest +# non-zero value you use is greater that the maximum header size plus +# the size of your largest error page. +# +# If you set this parameter none (the default), there will be +# no limit imposed. +# +# Configuration Format is: +# reply_body_max_size SIZE UNITS [acl ...] +# ie. +# reply_body_max_size 10 MB +# +#Default: +# No limit is applied. + +# NETWORK OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: http_port +# Usage: port [mode] [options] +# hostname:port [mode] [options] +# 1.2.3.4:port [mode] [options] +# +# The socket addresses where Squid will listen for HTTP client +# requests. You may specify multiple socket addresses. +# There are three forms: port alone, hostname with port, and +# IP address with port. If you specify a hostname or IP +# address, Squid binds the socket to that specific +# address. Most likely, you do not need to bind to a specific +# address, so you can use the port number alone. +# +# If you are running Squid in accelerator mode, you +# probably want to listen on port 80 also, or instead. +# +# The -a command line option may be used to specify additional +# port(s) where Squid listens for proxy request. Such ports will +# be plain proxy ports with no options. +# +# You may specify multiple socket addresses on multiple lines. +# +# Modes: +# +# intercept Support for IP-Layer NAT interception delivering +# traffic to this Squid port. +# NP: disables authentication on the port. +# +# tproxy Support Linux TPROXY (or BSD divert-to) with spoofing +# of outgoing connections using the client IP address. +# NP: disables authentication on the port. +# +# accel Accelerator / reverse proxy mode +# +# ssl-bump For each CONNECT request allowed by ssl_bump ACLs, +# establish secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# The ssl_bump option is required to fully enable +# bumping of CONNECT requests. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# Accelerator Mode Options: +# +# defaultsite=domainname +# What to use for the Host: header if it is not present +# in a request. Determines what site (not origin server) +# accelerators should consider the default. +# +# no-vhost Disable using HTTP/1.1 Host header for virtual domain support. +# +# protocol= Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to HTTP/1.1 for http_port and +# HTTPS/1.1 for https_port. +# When an unsupported value is configured Squid will +# produce a FATAL error. +# Values: HTTP or HTTP/1.1, HTTPS or HTTPS/1.1 +# +# vport Virtual host port support. Using the http_port number +# instead of the port passed on Host: headers. +# +# vport=NN Virtual host port support. Using the specified port +# number instead of the port passed on Host: headers. +# +# act-as-origin +# Act as if this Squid is the origin server. +# This currently means generate new Date: and Expires: +# headers on HIT instead of adding Age:. +# +# ignore-cc Ignore request Cache-Control headers. +# +# WARNING: This option violates HTTP specifications if +# used in non-accelerator setups. +# +# allow-direct Allow direct forwarding in accelerator mode. Normally +# accelerated requests are denied direct forwarding as if +# never_direct was used. +# +# WARNING: this option opens accelerator mode to security +# vulnerabilities usually only affecting in interception +# mode. Make sure to protect forwarding with suitable +# http_access rules when using this. +# +# +# SSL Bump Mode Options: +# In addition to these options ssl-bump requires TLS/SSL options. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped CONNECT requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is a CA certificate lifetime of the generated +# certificate equals lifetime of the CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# TLS / SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +# +# cipher= Colon separated list of supported ciphers. +# NOTE: some ciphers such as EDH ciphers depend on +# additional settings. If those settings are +# omitted the ciphers may be silently ignored +# by the OpenSSL library. +# +# options= Various SSL implementation options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# NO_TICKET Disables TLS tickets extension +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# See OpenSSL SSL_CTX_set_options documentation for a +# complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# See OpenSSL documentation for details on how to create the +# DH parameter file. Supported curves for ECDH can be listed +# using the "openssl ecparam -list_curves" command. +# WARNING: EDH and EECDH ciphers will be silently disabled if +# this option is not set. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# Other Options: +# +# connection-auth[=on|off] +# use connection-auth=off to tell Squid to prevent +# forwarding Microsoft connection oriented authentication +# (NTLM, Negotiate and Kerberos) +# +# disable-pmtu-discovery= +# Control Path-MTU discovery usage: +# off lets OS decide on what to do (default). +# transparent disable PMTU discovery when transparent +# support is enabled. +# always disable always PMTU discovery. +# +# In many setups of transparently intercepting proxies +# Path-MTU discovery can not work on traffic towards the +# clients. This is the case when the intercepting device +# does not fully track connections and fails to forward +# ICMP must fragment messages to the cache server. If you +# have such setup and experience that certain clients +# sporadically hang or never complete requests set +# disable-pmtu-discovery option to 'transparent'. +# +# name= Specifies a internal name for the port. Defaults to +# the port specification (port or addr:port) +# +# tcpkeepalive[=idle,interval,timeout] +# Enable TCP keepalive probes of idle connections. +# In seconds; idle is the initial time before TCP starts +# probing the connection, interval how often to probe, and +# timeout the time before giving up. +# +# require-proxy-header +# Require PROXY protocol version 1 or 2 connections. +# The proxy_protocol_access is required to whitelist +# downstream proxies which can be trusted. +# +# If you run Squid on a dual-homed machine with an internal +# and an external interface we recommend you to specify the +# internal address:port in http_port. This way Squid will only be +# visible on the internal address. +# +# + +# Squid normally listens to port 3128 +http_port 3128 + +# TAG: https_port +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Usage: [ip:]port cert=certificate.pem [key=key.pem] [mode] [options...] +# +# The socket address where Squid will listen for client requests made +# over TLS or SSL connections. Commonly referred to as HTTPS. +# +# This is most useful for situations where you are running squid in +# accelerator mode and you want to do the SSL work at the accelerator level. +# +# You may specify multiple socket addresses on multiple lines, +# each with their own SSL certificate and/or options. +# +# Modes: +# +# accel Accelerator / reverse proxy mode +# +# intercept Support for IP-Layer interception of +# outgoing requests without browser settings. +# NP: disables authentication and IPv6 on the port. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# ssl-bump For each intercepted connection allowed by ssl_bump +# ACLs, establish a secure connection with the client and with +# the server, decrypt HTTPS messages as they pass through +# Squid, and treat them as unencrypted HTTP messages, +# becoming the man-in-the-middle. +# +# An "ssl_bump server-first" match is required to +# fully enable bumping of intercepted SSL connections. +# +# Requires tproxy or intercept. +# +# Omitting the mode flag causes default forward proxy mode to be used. +# +# +# See http_port for a list of generic options +# +# +# SSL Options: +# +# cert= Path to SSL certificate (PEM format). +# +# key= Path to SSL private key file (PEM format) +# if not specified, the certificate file is +# assumed to be a combined certificate and +# key file. +# +# version= The version of SSL/TLS supported +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1 only +# +# cipher= Colon separated list of supported ciphers. +# +# options= Various SSL engine options. The most important +# being: +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1 +# +# SINGLE_DH_USE Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# SINGLE_ECDH_USE +# Enable ephemeral ECDH key exchange. +# The adopted curve should be specified +# using the tls-dh option. +# +# See src/ssl_support.c or OpenSSL SSL_CTX_set_options +# documentation for a complete list of options. +# +# clientca= File containing the list of CAs to use when +# requesting a client certificate. +# +# cafile= File containing additional CA certificates to +# use when verifying client certificates. If unset +# clientca will be used. +# +# capath= Directory containing additional CA certificates +# and CRL lists to use when verifying client certificates. +# +# crlfile= File of additional CRL lists to use when verifying +# the client certificate, in addition to CRLs stored in +# the capath. Implies VERIFY_CRL flag below. +# +# tls-dh=[curve:]file +# File containing DH parameters for temporary/ephemeral DH key +# exchanges, optionally prefixed by a curve for ephemeral ECDH +# key exchanges. +# +# sslflags= Various flags modifying the use of SSL: +# DELAYED_AUTH +# Don't request client certificates +# immediately, but wait until acl processing +# requires a certificate (not yet implemented). +# NO_DEFAULT_CA +# Don't use the default CA lists built in +# to OpenSSL. +# NO_SESSION_REUSE +# Don't allow for session reuse. Each connection +# will result in a new SSL session. +# VERIFY_CRL +# Verify CRL lists when accepting client +# certificates. +# VERIFY_CRL_ALL +# Verify CRL lists for all certificates in the +# client certificate chain. +# +# sslcontext= SSL session ID context identifier. +# +# generate-host-certificates[=] +# Dynamically create SSL server certificates for the +# destination hosts of bumped SSL requests.When +# enabled, the cert and key options are used to sign +# generated certificates. Otherwise generated +# certificate will be selfsigned. +# If there is CA certificate life time of generated +# certificate equals lifetime of CA certificate. If +# generated certificate is selfsigned lifetime is three +# years. +# This option is disabled by default. See the ssl-bump +# option above for more information. +# +# dynamic_cert_mem_cache_size=SIZE +# Approximate total RAM size spent on cached generated +# certificates. If set to zero, caching is disabled. +# +# See http_port for a list of available options. +#Default: +# none + +# TAG: ftp_port +# Enables Native FTP proxy by specifying the socket address where Squid +# listens for FTP client requests. See http_port directive for various +# ways to specify the listening address and mode. +# +# Usage: ftp_port address [mode] [options] +# +# WARNING: This is a new, experimental, complex feature that has seen +# limited production exposure. Some Squid modules (e.g., caching) do not +# currently work with native FTP proxying, and many features have not +# even been tested for compatibility. Test well before deploying! +# +# Native FTP proxying differs substantially from proxying HTTP requests +# with ftp:// URIs because Squid works as an FTP server and receives +# actual FTP commands (rather than HTTP requests with FTP URLs). +# +# Native FTP commands accepted at ftp_port are internally converted or +# wrapped into HTTP-like messages. The same happens to Native FTP +# responses received from FTP origin servers. Those HTTP-like messages +# are shoveled through regular access control and adaptation layers +# between the FTP client and the FTP origin server. This allows Squid to +# examine, adapt, block, and log FTP exchanges. Squid reuses most HTTP +# mechanisms when shoveling wrapped FTP messages. For example, +# http_access and adaptation_access directives are used. +# +# Modes: +# +# intercept Same as http_port intercept. The FTP origin address is +# determined based on the intended destination of the +# intercepted connection. +# +# tproxy Support Linux TPROXY for spoofing outgoing +# connections using the client IP address. +# NP: disables authentication and maybe IPv6 on the port. +# +# By default (i.e., without an explicit mode option), Squid extracts the +# FTP origin address from the login@origin parameter of the FTP USER +# command. Many popular FTP clients support such native FTP proxying. +# +# Options: +# +# name=token Specifies an internal name for the port. Defaults to +# the port address. Usable with myportname ACL. +# +# ftp-track-dirs +# Enables tracking of FTP directories by injecting extra +# PWD commands and adjusting Request-URI (in wrapping +# HTTP requests) to reflect the current FTP server +# directory. Tracking is disabled by default. +# +# protocol=FTP Protocol to reconstruct accelerated and intercepted +# requests with. Defaults to FTP. No other accepted +# values have been tested with. An unsupported value +# results in a FATAL error. Accepted values are FTP, +# HTTP (or HTTP/1.1), and HTTPS (or HTTPS/1.1). +# +# Other http_port modes and options that are not specific to HTTP and +# HTTPS may also work. +#Default: +# none + +# TAG: tcp_outgoing_tos +# Allows you to select a TOS/Diffserv value for packets outgoing +# on the server side, based on an ACL. +# +# tcp_outgoing_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_tos 0x00 normal_service_net +# tcp_outgoing_tos 0x20 good_service_net +# +# TOS/DSCP values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_tos +# Allows you to select a TOS/DSCP value for packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_tos ds-field [!]aclname ... +# +# Example where normal_service_net uses the TOS value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_tos 0x00 normal_service_net +# clientside_tos 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any TOS values set here +# will be overwritten by TOS values in qos_flows. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or +# "default" to use whatever default your host has. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +#Default: +# none + +# TAG: tcp_outgoing_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to outgoing packets +# on the server side, based on an ACL. +# +# tcp_outgoing_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# tcp_outgoing_mark 0x00 normal_service_net +# tcp_outgoing_mark 0x20 good_service_net +# +# Only fast ACLs are supported. +#Default: +# none + +# TAG: clientside_mark +# Note: This option is only available if Squid is rebuilt with the +# Packet MARK (Linux) +# +# Allows you to apply a Netfilter mark value to packets being transmitted +# on the client-side, based on an ACL. +# +# clientside_mark mark-value [!]aclname ... +# +# Example where normal_service_net uses the mark value 0x00 +# and good_service_net uses 0x20 +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.1.0/24 +# clientside_mark 0x00 normal_service_net +# clientside_mark 0x20 good_service_net +# +# Note: This feature is incompatible with qos_flows. Any mark values set here +# will be overwritten by mark values in qos_flows. +#Default: +# none + +# TAG: qos_flows +# Allows you to select a TOS/DSCP value to mark outgoing +# connections to the client, based on where the reply was sourced. +# For platforms using netfilter, allows you to set a netfilter mark +# value instead of, or in addition to, a TOS value. +# +# By default this functionality is disabled. To enable it with the default +# settings simply use "qos_flows mark" or "qos_flows tos". Default +# settings will result in the netfilter mark or TOS value being copied +# from the upstream connection to the client. Note that it is the connection +# CONNMARK value not the packet MARK value that is copied. +# +# It is not currently possible to copy the mark or TOS value from the +# client to the upstream connection request. +# +# TOS values really only have local significance - so you should +# know what you're specifying. For more information, see RFC2474, +# RFC2475, and RFC3260. +# +# The TOS/DSCP byte must be exactly that - a octet value 0 - 255. +# Note that only multiples of 4 are usable as the two rightmost bits have +# been redefined for use by ECN (RFC 3168 section 23.1). +# The squid parser will enforce this by masking away the ECN bits. +# +# Mark values can be any unsigned 32-bit integer value. +# +# This setting is configured by setting the following values: +# +# tos|mark Whether to set TOS or netfilter mark values +# +# local-hit=0xFF Value to mark local cache hits. +# +# sibling-hit=0xFF Value to mark hits from sibling peers. +# +# parent-hit=0xFF Value to mark hits from parent peers. +# +# miss=0xFF[/mask] Value to mark cache misses. Takes precedence +# over the preserve-miss feature (see below), unless +# mask is specified, in which case only the bits +# specified in the mask are written. +# +# The TOS variant of the following features are only possible on Linux +# and require your kernel to be patched with the TOS preserving ZPH +# patch, available from http://zph.bratcheda.org +# No patch is needed to preserve the netfilter mark, which will work +# with all variants of netfilter. +# +# disable-preserve-miss +# This option disables the preservation of the TOS or netfilter +# mark. By default, the existing TOS or netfilter mark value of +# the response coming from the remote server will be retained +# and masked with miss-mark. +# NOTE: in the case of a netfilter mark, the mark must be set on +# the connection (using the CONNMARK target) not on the packet +# (MARK target). +# +# miss-mask=0xFF +# Allows you to mask certain bits in the TOS or mark value +# received from the remote server, before copying the value to +# the TOS sent towards clients. +# Default for tos: 0xFF (TOS from server is not changed). +# Default for mark: 0xFFFFFFFF (mark from server is not changed). +# +# All of these features require the --enable-zph-qos compilation flag +# (enabled by default). Netfilter marking also requires the +# libnetfilter_conntrack libraries (--with-netfilter-conntrack) and +# libcap 2.09+ (--with-libcap). +# +#Default: +# none + +# TAG: tcp_outgoing_address +# Allows you to map requests to different outgoing IP addresses +# based on the username or source address of the user making +# the request. +# +# tcp_outgoing_address ipaddr [[!]aclname] ... +# +# For example; +# Forwarding clients with dedicated IPs for certain subnets. +# +# acl normal_service_net src 10.0.0.0/24 +# acl good_service_net src 10.0.2.0/24 +# +# tcp_outgoing_address 2001:db8::c001 good_service_net +# tcp_outgoing_address 10.1.0.2 good_service_net +# +# tcp_outgoing_address 2001:db8::beef normal_service_net +# tcp_outgoing_address 10.1.0.1 normal_service_net +# +# tcp_outgoing_address 2001:db8::1 +# tcp_outgoing_address 10.1.0.3 +# +# Processing proceeds in the order specified, and stops at first fully +# matching line. +# +# Squid will add an implicit IP version test to each line. +# Requests going to IPv4 websites will use the outgoing 10.1.0.* addresses. +# Requests going to IPv6 websites will use the outgoing 2001:db8:* addresses. +# +# +# NOTE: The use of this directive using client dependent ACLs is +# incompatible with the use of server side persistent connections. To +# ensure correct results it is best to set server_persistent_connections +# to off when using this directive in such configurations. +# +# NOTE: The use of this directive to set a local IP on outgoing TCP links +# is incompatible with using TPROXY to set client IP out outbound TCP links. +# When needing to contact peers use the no-tproxy cache_peer option and the +# client_dst_passthru directive re-enable normal forwarding such as this. +# +#Default: +# Address selection is performed by the operating system. + +# TAG: host_verify_strict +# Regardless of this option setting, when dealing with intercepted +# traffic, Squid always verifies that the destination IP address matches +# the Host header domain or IP (called 'authority form URL'). +# +# This enforcement is performed to satisfy a MUST-level requirement in +# RFC 2616 section 14.23: "The Host field value MUST represent the naming +# authority of the origin server or gateway given by the original URL". +# +# When set to ON: +# Squid always responds with an HTTP 409 (Conflict) error +# page and logs a security warning if there is no match. +# +# Squid verifies that the destination IP address matches +# the Host header for forward-proxy and reverse-proxy traffic +# as well. For those traffic types, Squid also enables the +# following checks, comparing the corresponding Host header +# and Request-URI components: +# +# * The host names (domain or IP) must be identical, +# but valueless or missing Host header disables all checks. +# For the two host names to match, both must be either IP +# or FQDN. +# +# * Port numbers must be identical, but if a port is missing +# the scheme-default port is assumed. +# +# +# When set to OFF (the default): +# Squid allows suspicious requests to continue but logs a +# security warning and blocks caching of the response. +# +# * Forward-proxy traffic is not checked at all. +# +# * Reverse-proxy traffic is not checked at all. +# +# * Intercepted traffic which passes verification is handled +# according to client_dst_passthru. +# +# * Intercepted requests which fail verification are sent +# to the client original destination instead of DIRECT. +# This overrides 'client_dst_passthru off'. +# +# For now suspicious intercepted CONNECT requests are always +# responded to with an HTTP 409 (Conflict) error page. +# +# +# SECURITY NOTE: +# +# As described in CVE-2009-0801 when the Host: header alone is used +# to determine the destination of a request it becomes trivial for +# malicious scripts on remote websites to bypass browser same-origin +# security policy and sandboxing protections. +# +# The cause of this is that such applets are allowed to perform their +# own HTTP stack, in which case the same-origin policy of the browser +# sandbox only verifies that the applet tries to contact the same IP +# as from where it was loaded at the IP level. The Host: header may +# be different from the connected IP and approved origin. +# +#Default: +# host_verify_strict off + +# TAG: client_dst_passthru +# With NAT or TPROXY intercepted traffic Squid may pass the request +# directly to the original client destination IP or seek a faster +# source using the HTTP Host header. +# +# Using Host to locate alternative servers can provide faster +# connectivity with a range of failure recovery options. +# But can also lead to connectivity trouble when the client and +# server are attempting stateful interactions unaware of the proxy. +# +# This option (on by default) prevents alternative DNS entries being +# located to send intercepted traffic DIRECT to an origin server. +# The clients original destination IP and port will be used instead. +# +# Regardless of this option setting, when dealing with intercepted +# traffic Squid will verify the Host: header and any traffic which +# fails Host verification will be treated as if this option were ON. +# +# see host_verify_strict for details on the verification process. +#Default: +# client_dst_passthru on + +# SSL OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ssl_unclean_shutdown +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Some browsers (especially MSIE) bugs out on SSL shutdown +# messages. +#Default: +# ssl_unclean_shutdown off + +# TAG: ssl_engine +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The OpenSSL engine to use. You will need to set this if you +# would like to use hardware SSL acceleration for example. +#Default: +# none + +# TAG: sslproxy_client_certificate +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Certificate to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_client_key +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Client SSL Key to use when proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_version +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL version level to use when proxying https:// URLs +# +# The versions of SSL/TLS supported: +# +# 1 automatic (default) +# 2 SSLv2 only +# 3 SSLv3 only +# 4 TLSv1.0 only +# 5 TLSv1.1 only +# 6 TLSv1.2 only +#Default: +# automatic SSL/TLS version negotiation + +# TAG: sslproxy_options +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Colon (:) or comma (,) separated list of SSL implementation options +# to use when proxying https:// URLs +# +# The most important being: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using temporary/ephemeral +# DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds suggested as "harmless" +# by OpenSSL. Be warned that this may reduce SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# complete list of possible options. +# +# WARNING: This directive takes a single token. If a space is used +# the value(s) after that space are SILENTLY IGNORED. +#Default: +# none + +# TAG: sslproxy_cipher +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# SSL cipher list to use when proxying https:// URLs +# +# Colon separated list of supported ciphers. +#Default: +# none + +# TAG: sslproxy_cafile +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# file containing CA certificates to use when verifying server +# certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_capath +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# directory containing CA certificates to use when verifying +# server certificates while proxying https:// URLs +#Default: +# none + +# TAG: sslproxy_session_ttl +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the timeout value for SSL sessions +#Default: +# sslproxy_session_ttl 300 + +# TAG: sslproxy_session_cache_size +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the cache size to use for ssl session +#Default: +# sslproxy_session_cache_size 2 MB + +# TAG: sslproxy_foreign_intermediate_certs +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Many origin servers fail to send their full server certificate +# chain for verification, assuming the client already has or can +# easily locate any missing intermediate certificates. +# +# Squid uses the certificates from the specified file to fill in +# these missing chains when trying to validate origin server +# certificate chains. +# +# The file is expected to contain zero or more PEM-encoded +# intermediate certificates. These certificates are not treated +# as trusted root certificates, and any self-signed certificate in +# this file will be ignored. +#Default: +# none + +# TAG: sslproxy_cert_sign_hash +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Sets the hashing algorithm to use when signing generated certificates. +# Valid algorithm names depend on the OpenSSL library used. The following +# names are usually available: sha1, sha256, sha512, and md5. Please see +# your OpenSSL library manual for the available hashes. By default, Squids +# that support this option use sha256 hashes. +# +# Squid does not forcefully purge cached certificates that were generated +# with an algorithm other than the currently configured one. They remain +# in the cache, subject to the regular cache eviction policy, and become +# useful if the algorithm changes again. +#Default: +# none + +# TAG: ssl_bump +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# This option is consulted when a CONNECT request is received on +# an http_port (or a new connection is intercepted at an +# https_port), provided that port was configured with an ssl-bump +# flag. The subsequent data on the connection is either treated as +# HTTPS and decrypted OR tunneled at TCP level without decryption, +# depending on the first matching bumping "action". +# +# ssl_bump [!]acl ... +# +# The following bumping actions are currently supported: +# +# splice +# Become a TCP tunnel without decrypting proxied traffic. +# This is the default action. +# +# bump +# When used on step SslBump1, establishes a secure connection +# with the client first, then connect to the server. +# When used on step SslBump2 or SslBump3, establishes a secure +# connection with the server and, using a mimicked server +# certificate, with the client. +# +# peek +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of splicing the +# connection. Peeking at the server certificate (during step 2) +# usually precludes bumping of the connection at step 3. +# +# stare +# Receive client (step SslBump1) or server (step SslBump2) +# certificate while preserving the possibility of bumping the +# connection. Staring at the server certificate (during step 2) +# usually precludes splicing of the connection at step 3. +# +# terminate +# Close client and server connections. +# +# Backward compatibility actions available at step SslBump1: +# +# client-first +# Bump the connection. Establish a secure connection with the +# client first, then connect to the server. This old mode does +# not allow Squid to mimic server SSL certificate and does not +# work with intercepted SSL connections. +# +# server-first +# Bump the connection. Establish a secure connection with the +# server first, then establish a secure connection with the +# client, using a mimicked server certificate. Works with both +# CONNECT requests and intercepted SSL connections, but does +# not allow to make decisions based on SSL handshake info. +# +# peek-and-splice +# Decide whether to bump or splice the connection based on +# client-to-squid and server-to-squid SSL hello messages. +# XXX: Remove. +# +# none +# Same as the "splice" action. +# +# All ssl_bump rules are evaluated at each of the supported bumping +# steps. Rules with actions that are impossible at the current step are +# ignored. The first matching ssl_bump action wins and is applied at the +# end of the current step. If no rules match, the splice action is used. +# See the at_step ACL for a list of the supported SslBump steps. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also: http_port ssl-bump, https_port ssl-bump, and acl at_step. +# +# +# # Example: Bump all TLS connections except those originating from +# # localhost or those going to example.com. +# +# acl broken_sites ssl::server_name .example.com +# ssl_bump splice localhost +# ssl_bump splice broken_sites +# ssl_bump bump all +#Default: +# Become a TCP tunnel without decrypting proxied traffic. + +# TAG: sslproxy_flags +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Various flags modifying the use of SSL while proxying https:// URLs: +# DONT_VERIFY_PEER Accept certificates that fail verification. +# For refined control, see sslproxy_cert_error. +# NO_DEFAULT_CA Don't use the default CA list built in +# to OpenSSL. +#Default: +# none + +# TAG: sslproxy_cert_error +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Use this ACL to bypass server certificate validation errors. +# +# For example, the following lines will bypass all validation errors +# when talking to servers for example.com. All other +# validation errors will result in ERR_SECURE_CONNECT_FAIL error. +# +# acl BrokenButTrustedServers dstdomain example.com +# sslproxy_cert_error allow BrokenButTrustedServers +# sslproxy_cert_error deny all +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Using slow acl types may result in server crashes +# +# Without this option, all server certificate validation errors +# terminate the transaction to protect Squid and the client. +# +# SQUID_X509_V_ERR_INFINITE_VALIDATION error cannot be bypassed +# but should not happen unless your OpenSSL library is buggy. +# +# SECURITY WARNING: +# Bypassing validation errors is dangerous because an +# error usually implies that the server cannot be trusted +# and the connection may be insecure. +# +# See also: sslproxy_flags and DONT_VERIFY_PEER. +#Default: +# Server certificate errors terminate the transaction. + +# TAG: sslproxy_cert_sign +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_sign acl ... +# +# The following certificate signing algorithms are supported: +# +# signTrusted +# Sign using the configured CA certificate which is usually +# placed in and trusted by end-user browsers. This is the +# default for trusted origin server certificates. +# +# signUntrusted +# Sign to guarantee an X509_V_ERR_CERT_UNTRUSTED browser error. +# This is the default for untrusted origin server certificates +# that are not self-signed (see ssl::certUntrusted). +# +# signSelf +# Sign using a self-signed certificate with the right CN to +# generate a X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT error in the +# browser. This is the default for self-signed origin server +# certificates (see ssl::certSelfSigned). +# +# This clause only supports fast acl types. +# +# When sslproxy_cert_sign acl(s) match, Squid uses the corresponding +# signing algorithm to generate the certificate and ignores all +# subsequent sslproxy_cert_sign options (the first match wins). If no +# acl(s) match, the default signing algorithm is determined by errors +# detected when obtaining and validating the origin server certificate. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslproxy_cert_adapt +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# +# sslproxy_cert_adapt acl ... +# +# The following certificate adaptation algorithms are supported: +# +# setValidAfter +# Sets the "Not After" property to the "Not After" property of +# the CA certificate used to sign generated certificates. +# +# setValidBefore +# Sets the "Not Before" property to the "Not Before" property of +# the CA certificate used to sign generated certificates. +# +# setCommonName or setCommonName{CN} +# Sets Subject.CN property to the host name specified as a +# CN parameter or, if no explicit CN parameter was specified, +# extracted from the CONNECT request. It is a misconfiguration +# to use setCommonName without an explicit parameter for +# intercepted or tproxied SSL connections. +# +# This clause only supports fast acl types. +# +# Squid first groups sslproxy_cert_adapt options by adaptation algorithm. +# Within a group, when sslproxy_cert_adapt acl(s) match, Squid uses the +# corresponding adaptation algorithm to generate the certificate and +# ignores all subsequent sslproxy_cert_adapt options in that algorithm's +# group (i.e., the first match wins within each algorithm group). If no +# acl(s) match, the default mimicking action takes place. +# +# WARNING: SQUID_X509_V_ERR_DOMAIN_MISMATCH and ssl:certDomainMismatch can +# be used with sslproxy_cert_adapt, but if and only if Squid is bumping a +# CONNECT request that carries a domain name. In all other cases (CONNECT +# to an IP address or an intercepted SSL connection), Squid cannot detect +# the domain mismatch at certificate generation time when +# bump-server-first is used. +#Default: +# none + +# TAG: sslpassword_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify a program used for entering SSL key passphrases +# when using encrypted SSL certificate keys. If not specified +# keys must either be unencrypted, or Squid started with the -N +# option to allow it to query interactively for the passphrase. +# +# The key file name is given as argument to the program allowing +# selection of the right password if you have multiple encrypted +# keys. +#Default: +# none + +# OPTIONS RELATING TO EXTERNAL SSL_CRTD +# ----------------------------------------------------------------------------- + +# TAG: sslcrtd_program +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# Specify the location and options of the executable for ssl_crtd process. +# /usr/lib/squid/ssl_crtd program requires -s and -M parameters +# For more information use: +# /usr/lib/squid/ssl_crtd -h +#Default: +# sslcrtd_program /usr/lib/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB + +# TAG: sslcrtd_children +# Note: This option is only available if Squid is rebuilt with the +# --enable-ssl-crtd +# +# The maximum number of processes spawn to service ssl server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# You must have at least one ssl_crtd process. +#Default: +# sslcrtd_children 32 startup=5 idle=1 + +# TAG: sslcrtvalidator_program +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# Specify the location and options of the executable for ssl_crt_validator +# process. +# +# Usage: sslcrtvalidator_program [ttl=n] [cache=n] path ... +# +# Options: +# ttl=n TTL in seconds for cached results. The default is 60 secs +# cache=n limit the result cache size. The default value is 2048 +#Default: +# none + +# TAG: sslcrtvalidator_children +# Note: This option is only available if Squid is rebuilt with the +# --with-openssl +# +# The maximum number of processes spawn to service SSL server. +# The maximum this may be safely set to is 32. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup=N +# +# Sets the minimum number of processes to spawn when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few children temporary slows Squid under load while it +# tries to spawn enough additional processes to cope with traffic. +# +# idle=N +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each certificate validator helper can handle in +# parallel. A value of 0 indicates the certficate validator does not +# support concurrency. Defaults to 1. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# a request ID in front of the request/response. The request +# ID from the request must be echoed back with the response +# to that request. +# +# You must have at least one ssl_crt_validator process. +#Default: +# sslcrtvalidator_children 32 startup=5 idle=1 concurrency=1 + +# OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM +# ----------------------------------------------------------------------------- + +# TAG: cache_peer +# To specify other caches in a hierarchy, use the format: +# +# cache_peer hostname type http-port icp-port [options] +# +# For example, +# +# # proxy icp +# # hostname type port port options +# # -------------------- -------- ----- ----- ----------- +# cache_peer parent.foo.net parent 3128 3130 default +# cache_peer sib1.foo.net sibling 3128 3130 proxy-only +# cache_peer sib2.foo.net sibling 3128 3130 proxy-only +# cache_peer example.com parent 80 0 default +# cache_peer cdn.example.com sibling 3128 0 +# +# type: either 'parent', 'sibling', or 'multicast'. +# +# proxy-port: The port number where the peer accept HTTP requests. +# For other Squid proxies this is usually 3128 +# For web servers this is usually 80 +# +# icp-port: Used for querying neighbor caches about objects. +# Set to 0 if the peer does not support ICP or HTCP. +# See ICP and HTCP options below for additional details. +# +# +# ==== ICP OPTIONS ==== +# +# You MUST also set icp_port and icp_access explicitly when using these options. +# The defaults will prevent peer traffic using ICP. +# +# +# no-query Disable ICP queries to this neighbor. +# +# multicast-responder +# Indicates the named peer is a member of a multicast group. +# ICP queries will not be sent directly to the peer, but ICP +# replies will be accepted from it. +# +# closest-only Indicates that, for ICP_OP_MISS replies, we'll only forward +# CLOSEST_PARENT_MISSes and never FIRST_PARENT_MISSes. +# +# background-ping +# To only send ICP queries to this neighbor infrequently. +# This is used to keep the neighbor round trip time updated +# and is usually used in conjunction with weighted-round-robin. +# +# +# ==== HTCP OPTIONS ==== +# +# You MUST also set htcp_port and htcp_access explicitly when using these options. +# The defaults will prevent peer traffic using HTCP. +# +# +# htcp Send HTCP, instead of ICP, queries to the neighbor. +# You probably also want to set the "icp-port" to 4827 +# instead of 3130. This directive accepts a comma separated +# list of options described below. +# +# htcp=oldsquid Send HTCP to old Squid versions (2.5 or earlier). +# +# htcp=no-clr Send HTCP to the neighbor but without +# sending any CLR requests. This cannot be used with +# only-clr. +# +# htcp=only-clr Send HTCP to the neighbor but ONLY CLR requests. +# This cannot be used with no-clr. +# +# htcp=no-purge-clr +# Send HTCP to the neighbor including CLRs but only when +# they do not result from PURGE requests. +# +# htcp=forward-clr +# Forward any HTCP CLR requests this proxy receives to the peer. +# +# +# ==== PEER SELECTION METHODS ==== +# +# The default peer selection method is ICP, with the first responding peer +# being used as source. These options can be used for better load balancing. +# +# +# default This is a parent cache which can be used as a "last-resort" +# if a peer cannot be located by any of the peer-selection methods. +# If specified more than once, only the first is used. +# +# round-robin Load-Balance parents which should be used in a round-robin +# fashion in the absence of any ICP queries. +# weight=N can be used to add bias. +# +# weighted-round-robin +# Load-Balance parents which should be used in a round-robin +# fashion with the frequency of each parent being based on the +# round trip time. Closer parents are used more often. +# Usually used for background-ping parents. +# weight=N can be used to add bias. +# +# carp Load-Balance parents which should be used as a CARP array. +# The requests will be distributed among the parents based on the +# CARP load balancing hash function based on their weight. +# +# userhash Load-balance parents based on the client proxy_auth or ident username. +# +# sourcehash Load-balance parents based on the client source IP. +# +# multicast-siblings +# To be used only for cache peers of type "multicast". +# ALL members of this multicast group have "sibling" +# relationship with it, not "parent". This is to a multicast +# group when the requested object would be fetched only from +# a "parent" cache, anyway. It's useful, e.g., when +# configuring a pool of redundant Squid proxies, being +# members of the same multicast group. +# +# +# ==== PEER SELECTION OPTIONS ==== +# +# weight=N use to affect the selection of a peer during any weighted +# peer-selection mechanisms. +# The weight must be an integer; default is 1, +# larger weights are favored more. +# This option does not affect parent selection if a peering +# protocol is not in use. +# +# basetime=N Specify a base amount to be subtracted from round trip +# times of parents. +# It is subtracted before division by weight in calculating +# which parent to fectch from. If the rtt is less than the +# base time the rtt is set to a minimal value. +# +# ttl=N Specify a TTL to use when sending multicast ICP queries +# to this address. +# Only useful when sending to a multicast group. +# Because we don't accept ICP replies from random +# hosts, you must configure other group members as +# peers with the 'multicast-responder' option. +# +# no-delay To prevent access to this neighbor from influencing the +# delay pools. +# +# digest-url=URL Tell Squid to fetch the cache digest (if digests are +# enabled) for this host from the specified URL rather +# than the Squid default location. +# +# +# ==== CARP OPTIONS ==== +# +# carp-key=key-specification +# use a different key than the full URL to hash against the peer. +# the key-specification is a comma-separated list of the keywords +# scheme, host, port, path, params +# Order is not important. +# +# ==== ACCELERATOR / REVERSE-PROXY OPTIONS ==== +# +# originserver Causes this parent to be contacted as an origin server. +# Meant to be used in accelerator setups when the peer +# is a web server. +# +# forceddomain=name +# Set the Host header of requests forwarded to this peer. +# Useful in accelerator setups where the server (peer) +# expects a certain domain name but clients may request +# others. ie example.com or www.example.com +# +# no-digest Disable request of cache digests. +# +# no-netdb-exchange +# Disables requesting ICMP RTT database (NetDB). +# +# +# ==== AUTHENTICATION OPTIONS ==== +# +# login=user:password +# If this is a personal/workgroup proxy and your parent +# requires proxy authentication. +# +# Note: The string can include URL escapes (i.e. %20 for +# spaces). This also means % must be written as %%. +# +# login=PASSTHRU +# Send login details received from client to this peer. +# Both Proxy- and WWW-Authorization headers are passed +# without alteration to the peer. +# Authentication is not required by Squid for this to work. +# +# Note: This will pass any form of authentication but +# only Basic auth will work through a proxy unless the +# connection-auth options are also used. +# +# login=PASS Send login details received from client to this peer. +# Authentication is not required by this option. +# +# If there are no client-provided authentication headers +# to pass on, but username and password are available +# from an external ACL user= and password= result tags +# they may be sent instead. +# +# Note: To combine this with proxy_auth both proxies must +# share the same user database as HTTP only allows for +# a single login (one for proxy, one for origin server). +# Also be warned this will expose your users proxy +# password to the peer. USE WITH CAUTION +# +# login=*:password +# Send the username to the upstream cache, but with a +# fixed password. This is meant to be used when the peer +# is in another administrative domain, but it is still +# needed to identify each user. +# The star can optionally be followed by some extra +# information which is added to the username. This can +# be used to identify this proxy to the peer, similar to +# the login=username:password option above. +# +# login=NEGOTIATE +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The first principal from the default keytab or defined by +# the environment variable KRB5_KTNAME will be used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# login=NEGOTIATE:principal_name +# If this is a personal/workgroup proxy and your parent +# requires a secure proxy authentication. +# The principal principal_name from the default keytab or +# defined by the environment variable KRB5_KTNAME will be +# used. +# +# WARNING: The connection may transmit requests from multiple +# clients. Negotiate often assumes end-to-end authentication +# and a single-client. Which is not strictly true here. +# +# connection-auth=on|off +# Tell Squid that this peer does or not support Microsoft +# connection oriented authentication, and any such +# challenges received from there should be ignored. +# Default is auto to automatically determine the status +# of the peer. +# +# +# ==== SSL / HTTPS / TLS OPTIONS ==== +# +# ssl Encrypt connections to this peer with SSL/TLS. +# +# sslcert=/path/to/ssl/certificate +# A client SSL certificate to use when connecting to +# this peer. +# +# sslkey=/path/to/ssl/key +# The private SSL key corresponding to sslcert above. +# If 'sslkey' is not specified 'sslcert' is assumed to +# reference a combined file containing both the +# certificate and the key. +# +# Notes: +# +# On Debian/Ubuntu systems a default snakeoil certificate is +# available in /etc/ssl and users can set: +# +# cert=/etc/ssl/certs/ssl-cert-snakeoil.pem +# +# and +# +# key=/etc/ssl/private/ssl-cert-snakeoil.key +# +# for testing. +# +# sslversion=1|2|3|4|5|6 +# The SSL version to use when connecting to this peer +# 1 = automatic (default) +# 2 = SSL v2 only +# 3 = SSL v3 only +# 4 = TLS v1.0 only +# 5 = TLS v1.1 only +# 6 = TLS v1.2 only +# +# sslcipher=... The list of valid SSL ciphers to use when connecting +# to this peer. +# +# ssloptions=... Specify various SSL implementation options: +# +# NO_SSLv2 Disallow the use of SSLv2 +# NO_SSLv3 Disallow the use of SSLv3 +# NO_TLSv1 Disallow the use of TLSv1.0 +# NO_TLSv1_1 Disallow the use of TLSv1.1 +# NO_TLSv1_2 Disallow the use of TLSv1.2 +# +# SINGLE_DH_USE +# Always create a new key when using +# temporary/ephemeral DH key exchanges +# +# NO_TICKET +# Disable use of RFC5077 session tickets. Some servers +# may have problems understanding the TLS extension due +# to ambiguous specification in RFC4507. +# +# ALL Enable various bug workarounds +# suggested as "harmless" by OpenSSL +# Be warned that this reduces SSL/TLS +# strength to some attacks. +# +# See the OpenSSL SSL_CTX_set_options documentation for a +# more complete list. +# +# sslcafile=... A file containing additional CA certificates to use +# when verifying the peer certificate. +# +# sslcapath=... A directory containing additional CA certificates to +# use when verifying the peer certificate. +# +# sslcrlfile=... A certificate revocation list file to use when +# verifying the peer certificate. +# +# sslflags=... Specify various flags modifying the SSL implementation: +# +# DONT_VERIFY_PEER +# Accept certificates even if they fail to +# verify. +# NO_DEFAULT_CA +# Don't use the default CA list built in +# to OpenSSL. +# DONT_VERIFY_DOMAIN +# Don't verify the peer certificate +# matches the server name +# +# ssldomain= The peer name as advertised in it's certificate. +# Used for verifying the correctness of the received peer +# certificate. If not specified the peer hostname will be +# used. +# +# front-end-https +# Enable the "Front-End-Https: On" header needed when +# using Squid as a SSL frontend in front of Microsoft OWA. +# See MS KB document Q307347 for details on this header. +# If set to auto the header will only be added if the +# request is forwarded as a https:// URL. +# +# +# ==== GENERAL OPTIONS ==== +# +# connect-timeout=N +# A peer-specific connect timeout. +# Also see the peer_connect_timeout directive. +# +# connect-fail-limit=N +# How many times connecting to a peer must fail before +# it is marked as down. Standby connection failures +# count towards this limit. Default is 10. +# +# allow-miss Disable Squid's use of only-if-cached when forwarding +# requests to siblings. This is primarily useful when +# icp_hit_stale is used by the sibling. Excessive use +# of this option may result in forwarding loops. One way +# to prevent peering loops when using this option, is to +# deny cache peer usage on requests from a peer: +# acl fromPeer ... +# cache_peer_access peerName deny fromPeer +# +# max-conn=N Limit the number of concurrent connections the Squid +# may open to this peer, including already opened idle +# and standby connections. There is no peer-specific +# connection limit by default. +# +# A peer exceeding the limit is not used for new +# requests unless a standby connection is available. +# +# max-conn currently works poorly with idle persistent +# connections: When a peer reaches its max-conn limit, +# and there are idle persistent connections to the peer, +# the peer may not be selected because the limiting code +# does not know whether Squid can reuse those idle +# connections. +# +# standby=N Maintain a pool of N "hot standby" connections to an +# UP peer, available for requests when no idle +# persistent connection is available (or safe) to use. +# By default and with zero N, no such pool is maintained. +# N must not exceed the max-conn limit (if any). +# +# At start or after reconfiguration, Squid opens new TCP +# standby connections until there are N connections +# available and then replenishes the standby pool as +# opened connections are used up for requests. A used +# connection never goes back to the standby pool, but +# may go to the regular idle persistent connection pool +# shared by all peers and origin servers. +# +# Squid never opens multiple new standby connections +# concurrently. This one-at-a-time approach minimizes +# flooding-like effect on peers. Furthermore, just a few +# standby connections should be sufficient in most cases +# to supply most new requests with a ready-to-use +# connection. +# +# Standby connections obey server_idle_pconn_timeout. +# For the feature to work as intended, the peer must be +# configured to accept and keep them open longer than +# the idle timeout at the connecting Squid, to minimize +# race conditions typical to idle used persistent +# connections. Default request_timeout and +# server_idle_pconn_timeout values ensure such a +# configuration. +# +# name=xxx Unique name for the peer. +# Required if you have multiple peers on the same host +# but different ports. +# This name can be used in cache_peer_access and similar +# directives to identify the peer. +# Can be used by outgoing access controls through the +# peername ACL type. +# +# no-tproxy Do not use the client-spoof TPROXY support when forwarding +# requests to this peer. Use normal address selection instead. +# This overrides the spoof_client_ip ACL. +# +# proxy-only objects fetched from the peer will not be stored locally. +# +#Default: +# none + +# TAG: cache_peer_domain +# Use to limit the domains for which a neighbor cache will be +# queried. +# +# Usage: +# cache_peer_domain cache-host domain [domain ...] +# cache_peer_domain cache-host !domain +# +# For example, specifying +# +# cache_peer_domain parent.foo.net .edu +# +# has the effect such that UDP query packets are sent to +# 'bigserver' only when the requested object exists on a +# server in the .edu domain. Prefixing the domainname +# with '!' means the cache will be queried for objects +# NOT in that domain. +# +# NOTE: * Any number of domains may be given for a cache-host, +# either on the same or separate lines. +# * When multiple domains are given for a particular +# cache-host, the first matched domain is applied. +# * Cache hosts with no domain restrictions are queried +# for all requests. +# * There are no defaults. +# * There is also a 'cache_peer_access' tag in the ACL +# section. +#Default: +# none + +# TAG: cache_peer_access +# Restricts usage of cache_peer proxies. +# +# Usage: +# cache_peer_access peer-name allow|deny [!]aclname ... +# +# For the required peer-name parameter, use either the value of the +# cache_peer name=value parameter or, if name=value is missing, the +# cache_peer hostname parameter. +# +# This directive narrows down the selection of peering candidates, but +# does not determine the order in which the selected candidates are +# contacted. That order is determined by the peer selection algorithms +# (see PEER SELECTION sections in the cache_peer documentation). +# +# If a deny rule matches, the corresponding peer will not be contacted +# for the current transaction -- Squid will not send ICP queries and +# will not forward HTTP requests to that peer. An allow match leaves +# the corresponding peer in the selection. The first match for a given +# peer wins for that peer. +# +# The relative order of cache_peer_access directives for the same peer +# matters. The relative order of any two cache_peer_access directives +# for different peers does not matter. To ease interpretation, it is a +# good idea to group cache_peer_access directives for the same peer +# together. +# +# A single cache_peer_access directive may be evaluated multiple times +# for a given transaction because individual peer selection algorithms +# may check it independently from each other. These redundant checks +# may be optimized away in future Squid versions. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# No peer usage restrictions. + +# TAG: neighbor_type_domain +# Modify the cache_peer neighbor type when passing requests +# about specific domains to the peer. +# +# Usage: +# neighbor_type_domain neighbor parent|sibling domain domain ... +# +# For example: +# cache_peer foo.example.com parent 3128 3130 +# neighbor_type_domain foo.example.com sibling .au .de +# +# The above configuration treats all requests to foo.example.com as a +# parent proxy unless the request is for a .au or .de ccTLD domain name. +#Default: +# The peer type from cache_peer directive is used for all requests to that peer. + +# TAG: dead_peer_timeout (seconds) +# This controls how long Squid waits to declare a peer cache +# as "dead." If there are no ICP replies received in this +# amount of time, Squid will declare the peer dead and not +# expect to receive any further ICP replies. However, it +# continues to send ICP queries, and will mark the peer as +# alive upon receipt of the first subsequent ICP reply. +# +# This timeout also affects when Squid expects to receive ICP +# replies from peers. If more than 'dead_peer' seconds have +# passed since the last ICP reply was received, Squid will not +# expect to receive an ICP reply on the next query. Thus, if +# your time between requests is greater than this timeout, you +# will see a lot of requests sent DIRECT to origin servers +# instead of to your parents. +#Default: +# dead_peer_timeout 10 seconds + +# TAG: forward_max_tries +# Controls how many different forward paths Squid will try +# before giving up. See also forward_timeout. +# +# NOTE: connect_retries (default: none) can make each of these +# possible forwarding paths be tried multiple times. +#Default: +# forward_max_tries 25 + +# MEMORY CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_mem (bytes) +# NOTE: THIS PARAMETER DOES NOT SPECIFY THE MAXIMUM PROCESS SIZE. +# IT ONLY PLACES A LIMIT ON HOW MUCH ADDITIONAL MEMORY SQUID WILL +# USE AS A MEMORY CACHE OF OBJECTS. SQUID USES MEMORY FOR OTHER +# THINGS AS WELL. SEE THE SQUID FAQ SECTION 8 FOR DETAILS. +# +# 'cache_mem' specifies the ideal amount of memory to be used +# for: +# * In-Transit objects +# * Hot Objects +# * Negative-Cached objects +# +# Data for these objects are stored in 4 KB blocks. This +# parameter specifies the ideal upper limit on the total size of +# 4 KB blocks allocated. In-Transit objects take the highest +# priority. +# +# In-transit objects have priority over the others. When +# additional space is needed for incoming data, negative-cached +# and hot objects will be released. In other words, the +# negative-cached and hot objects will fill up any unused space +# not needed for in-transit objects. +# +# If circumstances require, this limit will be exceeded. +# Specifically, if your incoming request rate requires more than +# 'cache_mem' of memory to hold in-transit objects, Squid will +# exceed this limit to satisfy the new requests. When the load +# decreases, blocks will be freed until the high-water mark is +# reached. Thereafter, blocks will be used to store hot +# objects. +# +# If shared memory caching is enabled, Squid does not use the shared +# cache space for in-transit objects, but they still consume as much +# local memory as they need. For more details about the shared memory +# cache, see memory_cache_shared. +#Default: +# cache_mem 256 MB + +# TAG: maximum_object_size_in_memory (bytes) +# Objects greater than this size will not be attempted to kept in +# the memory cache. This should be set high enough to keep objects +# accessed frequently in memory to improve performance whilst low +# enough to keep larger objects from hoarding cache_mem. +#Default: +# maximum_object_size_in_memory 512 KB + +# TAG: memory_cache_shared on|off +# Controls whether the memory cache is shared among SMP workers. +# +# The shared memory cache is meant to occupy cache_mem bytes and replace +# the non-shared memory cache, although some entities may still be +# cached locally by workers for now (e.g., internal and in-transit +# objects may be served from a local memory cache even if shared memory +# caching is enabled). +# +# By default, the memory cache is shared if and only if all of the +# following conditions are satisfied: Squid runs in SMP mode with +# multiple workers, cache_mem is positive, and Squid environment +# supports required IPC primitives (e.g., POSIX shared memory segments +# and GCC-style atomic operations). +# +# To avoid blocking locks, shared memory uses opportunistic algorithms +# that do not guarantee that every cachable entity that could have been +# shared among SMP workers will actually be shared. +#Default: +# "on" where supported if doing memory caching with multiple SMP workers. + +# TAG: memory_cache_mode +# Controls which objects to keep in the memory cache (cache_mem) +# +# always Keep most recently fetched objects in memory (default) +# +# disk Only disk cache hits are kept in memory, which means +# an object must first be cached on disk and then hit +# a second time before cached in memory. +# +# network Only objects fetched from network is kept in memory +#Default: +# Keep the most recently fetched objects in memory + +# TAG: memory_replacement_policy +# The memory replacement policy parameter determines which +# objects are purged from memory when memory space is needed. +# +# See cache_replacement_policy for details on algorithms. +#Default: +# memory_replacement_policy lru + +# DISK CACHE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: cache_replacement_policy +# The cache replacement policy parameter determines which +# objects are evicted (replaced) when disk space is needed. +# +# lru : Squid's original list based LRU policy +# heap GDSF : Greedy-Dual Size Frequency +# heap LFUDA: Least Frequently Used with Dynamic Aging +# heap LRU : LRU policy implemented using a heap +# +# Applies to any cache_dir lines listed below this directive. +# +# The LRU policies keeps recently referenced objects. +# +# The heap GDSF policy optimizes object hit rate by keeping smaller +# popular objects in cache so it has a better chance of getting a +# hit. It achieves a lower byte hit rate than LFUDA though since +# it evicts larger (possibly popular) objects. +# +# The heap LFUDA policy keeps popular objects in cache regardless of +# their size and thus optimizes byte hit rate at the expense of +# hit rate since one large, popular object will prevent many +# smaller, slightly less popular objects from being cached. +# +# Both policies utilize a dynamic aging mechanism that prevents +# cache pollution that can otherwise occur with frequency-based +# replacement policies. +# +# NOTE: if using the LFUDA replacement policy you should increase +# the value of maximum_object_size above its default of 4 MB to +# to maximize the potential byte hit rate improvement of LFUDA. +# +# For more information about the GDSF and LFUDA cache replacement +# policies see http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html +# and http://fog.hpl.external.hp.com/techreports/98/HPL-98-173.html. +#Default: +# cache_replacement_policy lru + +# TAG: minimum_object_size (bytes) +# Objects smaller than this size will NOT be saved on disk. The +# value is specified in bytes, and the default is 0 KB, which +# means all responses can be stored. +#Default: +# no limit + +# TAG: maximum_object_size (bytes) +# Set the default value for max-size parameter on any cache_dir. +# The value is specified in bytes, and the default is 4 MB. +# +# If you wish to get a high BYTES hit ratio, you should probably +# increase this (one 32 MB object hit counts for 3200 10KB +# hits). +# +# If you wish to increase hit ratio more than you want to +# save bandwidth you should leave this low. +# +# NOTE: if using the LFUDA replacement policy you should increase +# this value to maximize the byte hit rate improvement of LFUDA! +# See cache_replacement_policy for a discussion of this policy. +#Default: +# maximum_object_size 4 MB + +# TAG: cache_dir +# Format: +# cache_dir Type Directory-Name Fs-specific-data [options] +# +# You can specify multiple cache_dir lines to spread the +# cache among different disk partitions. +# +# Type specifies the kind of storage system to use. Only "ufs" +# is built by default. To enable any of the other storage systems +# see the --enable-storeio configure option. +# +# 'Directory' is a top-level directory where cache swap +# files will be stored. If you want to use an entire disk +# for caching, this can be the mount-point directory. +# The directory must exist and be writable by the Squid +# process. Squid will NOT create this directory for you. +# +# In SMP configurations, cache_dir must not precede the workers option +# and should use configuration macros or conditionals to give each +# worker interested in disk caching a dedicated cache directory. +# +# +# ==== The ufs store type ==== +# +# "ufs" is the old well-known Squid storage format that has always +# been there. +# +# Usage: +# cache_dir ufs Directory-Name Mbytes L1 L2 [options] +# +# 'Mbytes' is the amount of disk space (MB) to use under this +# directory. The default is 100 MB. Change this to suit your +# configuration. Do NOT put the size of your disk drive here. +# Instead, if you want Squid to use the entire disk drive, +# subtract 20% and use that value. +# +# 'L1' is the number of first-level subdirectories which +# will be created under the 'Directory'. The default is 16. +# +# 'L2' is the number of second-level subdirectories which +# will be created under each first-level directory. The default +# is 256. +# +# +# ==== The aufs store type ==== +# +# "aufs" uses the same storage format as "ufs", utilizing +# POSIX-threads to avoid blocking the main Squid process on +# disk-I/O. This was formerly known in Squid as async-io. +# +# Usage: +# cache_dir aufs Directory-Name Mbytes L1 L2 [options] +# +# see argument descriptions under ufs above +# +# +# ==== The diskd store type ==== +# +# "diskd" uses the same storage format as "ufs", utilizing a +# separate process to avoid blocking the main Squid process on +# disk-I/O. +# +# Usage: +# cache_dir diskd Directory-Name Mbytes L1 L2 [options] [Q1=n] [Q2=n] +# +# see argument descriptions under ufs above +# +# Q1 specifies the number of unacknowledged I/O requests when Squid +# stops opening new files. If this many messages are in the queues, +# Squid won't open new files. Default is 64 +# +# Q2 specifies the number of unacknowledged messages when Squid +# starts blocking. If this many messages are in the queues, +# Squid blocks until it receives some replies. Default is 72 +# +# When Q1 < Q2 (the default), the cache directory is optimized +# for lower response time at the expense of a decrease in hit +# ratio. If Q1 > Q2, the cache directory is optimized for +# higher hit ratio at the expense of an increase in response +# time. +# +# +# ==== The rock store type ==== +# +# Usage: +# cache_dir rock Directory-Name Mbytes [options] +# +# The Rock Store type is a database-style storage. All cached +# entries are stored in a "database" file, using fixed-size slots. +# A single entry occupies one or more slots. +# +# If possible, Squid using Rock Store creates a dedicated kid +# process called "disker" to avoid blocking Squid worker(s) on disk +# I/O. One disker kid is created for each rock cache_dir. Diskers +# are created only when Squid, running in daemon mode, has support +# for the IpcIo disk I/O module. +# +# swap-timeout=msec: Squid will not start writing a miss to or +# reading a hit from disk if it estimates that the swap operation +# will take more than the specified number of milliseconds. By +# default and when set to zero, disables the disk I/O time limit +# enforcement. Ignored when using blocking I/O module because +# blocking synchronous I/O does not allow Squid to estimate the +# expected swap wait time. +# +# max-swap-rate=swaps/sec: Artificially limits disk access using +# the specified I/O rate limit. Swap out requests that +# would cause the average I/O rate to exceed the limit are +# delayed. Individual swap in requests (i.e., hits or reads) are +# not delayed, but they do contribute to measured swap rate and +# since they are placed in the same FIFO queue as swap out +# requests, they may wait longer if max-swap-rate is smaller. +# This is necessary on file systems that buffer "too +# many" writes and then start blocking Squid and other processes +# while committing those writes to disk. Usually used together +# with swap-timeout to avoid excessive delays and queue overflows +# when disk demand exceeds available disk "bandwidth". By default +# and when set to zero, disables the disk I/O rate limit +# enforcement. Currently supported by IpcIo module only. +# +# slot-size=bytes: The size of a database "record" used for +# storing cached responses. A cached response occupies at least +# one slot and all database I/O is done using individual slots so +# increasing this parameter leads to more disk space waste while +# decreasing it leads to more disk I/O overheads. Should be a +# multiple of your operating system I/O page size. Defaults to +# 16KBytes. A housekeeping header is stored with each slot and +# smaller slot-sizes will be rejected. The header is smaller than +# 100 bytes. +# +# +# ==== COMMON OPTIONS ==== +# +# no-store no new objects should be stored to this cache_dir. +# +# min-size=n the minimum object size in bytes this cache_dir +# will accept. It's used to restrict a cache_dir +# to only store large objects (e.g. AUFS) while +# other stores are optimized for smaller objects +# (e.g. Rock). +# Defaults to 0. +# +# max-size=n the maximum object size in bytes this cache_dir +# supports. +# The value in maximum_object_size directive sets +# the default unless more specific details are +# available (ie a small store capacity). +# +# Note: To make optimal use of the max-size limits you should order +# the cache_dir lines with the smallest max-size value first. +# +#Default: +# No disk cache. Store cache ojects only in memory. +# + +# Uncomment and adjust the following to add a disk cache directory. +#cache_dir ufs /var/spool/squid 100 16 256 + +# TAG: store_dir_select_algorithm +# How Squid selects which cache_dir to use when the response +# object will fit into more than one. +# +# Regardless of which algorithm is used the cache_dir min-size +# and max-size parameters are obeyed. As such they can affect +# the selection algorithm by limiting the set of considered +# cache_dir. +# +# Algorithms: +# +# least-load +# +# This algorithm is suited to caches with similar cache_dir +# sizes and disk speeds. +# +# The disk with the least I/O pending is selected. +# When there are multiple disks with the same I/O load ranking +# the cache_dir with most available capacity is selected. +# +# When a mix of cache_dir sizes are configured the faster disks +# have a naturally lower I/O loading and larger disks have more +# capacity. So space used to store objects and data throughput +# may be very unbalanced towards larger disks. +# +# +# round-robin +# +# This algorithm is suited to caches with unequal cache_dir +# disk sizes. +# +# Each cache_dir is selected in a rotation. The next suitable +# cache_dir is used. +# +# Available cache_dir capacity is only considered in relation +# to whether the object will fit and meets the min-size and +# max-size parameters. +# +# Disk I/O loading is only considered to prevent overload on slow +# disks. This algorithm does not spread objects by size, so any +# I/O loading per-disk may appear very unbalanced and volatile. +# +# If several cache_dirs use similar min-size, max-size, or other +# limits to to reject certain responses, then do not group such +# cache_dir lines together, to avoid round-robin selection bias +# towards the first cache_dir after the group. Instead, interleave +# cache_dir lines from different groups. For example: +# +# store_dir_select_algorithm round-robin +# cache_dir rock /hdd1 ... min-size=100000 +# cache_dir rock /ssd1 ... max-size=99999 +# cache_dir rock /hdd2 ... min-size=100000 +# cache_dir rock /ssd2 ... max-size=99999 +# cache_dir rock /hdd3 ... min-size=100000 +# cache_dir rock /ssd3 ... max-size=99999 +#Default: +# store_dir_select_algorithm least-load + +# TAG: max_open_disk_fds +# To avoid having disk as the I/O bottleneck Squid can optionally +# bypass the on-disk cache if more than this amount of disk file +# descriptors are open. +# +# A value of 0 indicates no limit. +#Default: +# no limit + +# TAG: cache_swap_low (percent, 0-100) +# The low-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above this low-water mark and attempts to maintain utilization +# near the low-water mark. +# +# As swap utilization increases towards the high-water mark set +# by cache_swap_high object eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_high and cache_replacement_policy +#Default: +# cache_swap_low 90 + +# TAG: cache_swap_high (percent, 0-100) +# The high-water mark for AUFS/UFS/diskd cache object eviction by +# the cache_replacement_policy algorithm. +# +# Removal begins when the swap (disk) usage of a cache_dir is +# above the low-water mark set by cache_swap_low and attempts to +# maintain utilization near the low-water mark. +# +# As swap utilization increases towards this high-water mark object +# eviction becomes more agressive. +# +# The value difference in percentages between low- and high-water +# marks represent an eviction rate of 300 objects per second and +# the rate continues to scale in agressiveness by multiples of +# this above the high-water mark. +# +# Defaults are 90% and 95%. If you have a large cache, 5% could be +# hundreds of MB. If this is the case you may wish to set these +# numbers closer together. +# +# See also cache_swap_low and cache_replacement_policy +#Default: +# cache_swap_high 95 + +# LOGFILE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: logformat +# Usage: +# +# logformat +# +# Defines an access log format. +# +# The is a string with embedded % format codes +# +# % format codes all follow the same basic structure where all but +# the formatcode is optional. Output strings are automatically escaped +# as required according to their context and the output format +# modifiers are usually not needed, but can be specified if an explicit +# output format is desired. +# +# % ["|[|'|#] [-] [[0]width] [{argument}] formatcode +# +# " output in quoted string format +# [ output in squid text log format as used by log_mime_hdrs +# # output in URL quoted format +# ' output as-is +# +# - left aligned +# +# width minimum and/or maximum field width: +# [width_min][.width_max] +# When minimum starts with 0, the field is zero-padded. +# String values exceeding maximum width are truncated. +# +# {arg} argument such as header name etc +# +# Format codes: +# +# % a literal % character +# sn Unique sequence number per log line entry +# err_code The ID of an error response served by Squid or +# a similar internal error identifier. +# err_detail Additional err_code-dependent error information. +# note The annotation specified by the argument. Also +# logs the adaptation meta headers set by the +# adaptation_meta configuration parameter. +# If no argument given all annotations logged. +# The argument may include a separator to use with +# annotation values: +# name[:separator] +# By default, multiple note values are separated with "," +# and multiple notes are separated with "\r\n". +# When logging named notes with %{name}note, the +# explicitly configured separator is used between note +# values. When logging all notes with %note, the +# explicitly configured separator is used between +# individual notes. There is currently no way to +# specify both value and notes separators when logging +# all notes with %note. +# +# Connection related format codes: +# +# >a Client source IP address +# >A Client FQDN +# >p Client source port +# >eui Client source EUI (MAC address, EUI-48 or EUI-64 identifier) +# >la Local IP address the client connected to +# >lp Local port number the client connected to +# >qos Client connection TOS/DSCP value set by Squid +# >nfmark Client connection netfilter mark set by Squid +# +# la Local listening IP address the client connection was connected to. +# lp Local listening port number the client connection was connected to. +# +# . format. +# Currently, Squid considers the master transaction +# started when a complete HTTP request header initiating +# the transaction is received from the client. This is +# the same value that Squid uses to calculate transaction +# response time when logging %tr to access.log. Currently, +# Squid uses millisecond resolution for %tS values, +# similar to the default access.log "current time" field +# (%ts.%03tu). +# +# Access Control related format codes: +# +# et Tag returned by external acl +# ea Log string returned by external acl +# un User name (any available) +# ul User name from authentication +# ue User name from external acl helper +# ui User name from ident +# un A user name. Expands to the first available name +# from the following list of information sources: +# - authenticated user name, like %ul +# - user name supplied by an external ACL, like %ue +# - SSL client name, like %us +# - ident user name, like %ui +# credentials Client credentials. The exact meaning depends on +# the authentication scheme: For Basic authentication, +# it is the password; for Digest, the realm sent by the +# client; for NTLM and Negotiate, the client challenge +# or client credentials prefixed with "YR " or "KK ". +# +# HTTP related format codes: +# +# REQUEST +# +# [http::]rm Request method (GET/POST etc) +# [http::]>rm Request method from client +# [http::]ru Request URL from client +# [http::]rs Request URL scheme from client +# [http::]rd Request URL domain from client +# [http::]rP Request URL port from client +# [http::]rp Request URL path excluding hostname from client +# [http::]rv Request protocol version from client +# [http::]h Original received request header. +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Accepts optional header field name/value filter +# argument using name[:[separator]element] format. +# [http::]>ha Received request header after adaptation and +# redirection (pre-cache REQMOD vectoring point). +# Usually differs from the request header sent by +# Squid, although most fields are often preserved. +# Optional header name argument as for >h +# +# +# RESPONSE +# +# [http::]Hs HTTP status code sent to the client +# +# [http::]h +# +# [http::]mt MIME content type +# +# +# SIZE COUNTERS +# +# [http::]st Total size of request + reply traffic with client +# [http::]>st Total size of request received from client. +# Excluding chunked encoding bytes. +# [http::]sh Size of request headers received from client +# [http::]sni SSL client SNI sent to Squid. Available only +# after the peek, stare, or splice SSL bumping +# actions. +# +# If ICAP is enabled, the following code becomes available (as +# well as ICAP log codes documented with the icap_log option): +# +# icap::tt Total ICAP processing time for the HTTP +# transaction. The timer ticks when ICAP +# ACLs are checked and when ICAP +# transaction is in progress. +# +# If adaptation is enabled the following three codes become available: +# +# adapt::cert_subject The Subject field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Subject often has spaces. +# +# %ssl::>cert_issuer The Issuer field of the received client +# SSL certificate or a dash ('-') if Squid has +# received an invalid/malformed certificate or +# no certificate at all. Consider encoding the +# logged value because Issuer often has spaces. +# +# The default formats available (which do not need re-defining) are: +# +#logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %a %[ui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %h" "%{User-Agent}>h" %Ss:%Sh +#logformat referrer %ts.%03tu %>a %{Referer}>h %ru +#logformat useragent %>a [%tl] "%{User-Agent}>h" +# +# NOTE: When the log_mime_hdrs directive is set to ON. +# The squid, common and combined formats have a safely encoded copy +# of the mime headers appended to each line within a pair of brackets. +# +# NOTE: The common and combined formats are not quite true to the Apache definition. +# The logs from Squid contain an extra status and hierarchy code appended. +# +#Default: +# The format definitions squid, common, combined, referrer, useragent are built in. + +# TAG: access_log +# Configures whether and how Squid logs HTTP and ICP transactions. +# If access logging is enabled, a single line is logged for every +# matching HTTP or ICP request. The recommended directive formats are: +# +# access_log : [option ...] [acl acl ...] +# access_log none [acl acl ...] +# +# The following directive format is accepted but may be deprecated: +# access_log : [ [acl acl ...]] +# +# In most cases, the first ACL name must not contain the '=' character +# and should not be equal to an existing logformat name. You can always +# start with an 'all' ACL to work around those restrictions. +# +# Will log to the specified module:place using the specified format (which +# must be defined in a logformat directive) those entries which match +# ALL the acl's specified (which must be defined in acl clauses). +# If no acl is specified, all requests will be logged to this destination. +# +# ===== Available options for the recommended directive format ===== +# +# logformat=name Names log line format (either built-in or +# defined by a logformat directive). Defaults +# to 'squid'. +# +# buffer-size=64KB Defines approximate buffering limit for log +# records (see buffered_logs). Squid should not +# keep more than the specified size and, hence, +# should flush records before the buffer becomes +# full to avoid overflows under normal +# conditions (the exact flushing algorithm is +# module-dependent though). The on-error option +# controls overflow handling. +# +# on-error=die|drop Defines action on unrecoverable errors. The +# 'drop' action ignores (i.e., does not log) +# affected log records. The default 'die' action +# kills the affected worker. The drop action +# support has not been tested for modules other +# than tcp. +# +# ===== Modules Currently available ===== +# +# none Do not log any requests matching these ACL. +# Do not specify Place or logformat name. +# +# stdio Write each log line to disk immediately at the completion of +# each request. +# Place: the filename and path to be written. +# +# daemon Very similar to stdio. But instead of writing to disk the log +# line is passed to a daemon helper for asychronous handling instead. +# Place: varies depending on the daemon. +# +# log_file_daemon Place: the file name and path to be written. +# +# syslog To log each request via syslog facility. +# Place: The syslog facility and priority level for these entries. +# Place Format: facility.priority +# +# where facility could be any of: +# authpriv, daemon, local0 ... local7 or user. +# +# And priority could be any of: +# err, warning, notice, info, debug. +# +# udp To send each log line as text data to a UDP receiver. +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# tcp To send each log line as text data to a TCP receiver. +# Lines may be accumulated before sending (see buffered_logs). +# Place: The destination host name or IP and port. +# Place Format: //host:port +# +# Default: +# access_log daemon:/var/log/squid/access.log squid +#Default: +# access_log daemon:/var/log/squid/access.log squid + +# TAG: icap_log +# ICAP log files record ICAP transaction summaries, one line per +# transaction. +# +# The icap_log option format is: +# icap_log [ [acl acl ...]] +# icap_log none [acl acl ...]] +# +# Please see access_log option documentation for details. The two +# kinds of logs share the overall configuration approach and many +# features. +# +# ICAP processing of a single HTTP message or transaction may +# require multiple ICAP transactions. In such cases, multiple +# ICAP transaction log lines will correspond to a single access +# log line. +# +# ICAP log supports many access.log logformat %codes. In ICAP context, +# HTTP message-related %codes are applied to the HTTP message embedded +# in an ICAP message. Logformat "%http::>..." codes are used for HTTP +# messages embedded in ICAP requests while "%http::<..." codes are used +# for HTTP messages embedded in ICAP responses. For example: +# +# http::>h To-be-adapted HTTP message headers sent by Squid to +# the ICAP service. For REQMOD transactions, these are +# HTTP request headers. For RESPMOD, these are HTTP +# response headers, but Squid currently cannot log them +# (i.e., %http::>h will expand to "-" for RESPMOD). +# +# http::st The total size of the ICAP request sent to the ICAP +# server (ICAP headers + ICAP body), including chunking +# metadata (if any). +# +# icap::h ICAP request header(s). Similar to >h. +# +# icap::A %icap::to/%03icap::Hs %icap::\n - logfile data +# R\n - rotate file +# T\n - truncate file +# O\n - reopen file +# F\n - flush file +# r\n - set rotate count to +# b\n - 1 = buffer output, 0 = don't buffer output +# +# No responses is expected. +#Default: +# logfile_daemon /usr/lib/squid/log_file_daemon + +# TAG: stats_collection allow|deny acl acl... +# This options allows you to control which requests gets accounted +# in performance counters. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow logging for all transactions. + +# TAG: cache_store_log +# Logs the activities of the storage manager. Shows which +# objects are ejected from the cache, and which objects are +# saved and for how long. +# There are not really utilities to analyze this data, so you can safely +# disable it (the default). +# +# Store log uses modular logging outputs. See access_log for the list +# of modules supported. +# +# Example: +# cache_store_log stdio:/var/log/squid/store.log +# cache_store_log daemon:/var/log/squid/store.log +#Default: +# none + +# TAG: cache_swap_state +# Location for the cache "swap.state" file. This index file holds +# the metadata of objects saved on disk. It is used to rebuild +# the cache during startup. Normally this file resides in each +# 'cache_dir' directory, but you may specify an alternate +# pathname here. Note you must give a full filename, not just +# a directory. Since this is the index for the whole object +# list you CANNOT periodically rotate it! +# +# If %s can be used in the file name it will be replaced with a +# a representation of the cache_dir name where each / is replaced +# with '.'. This is needed to allow adding/removing cache_dir +# lines when cache_swap_log is being used. +# +# If have more than one 'cache_dir', and %s is not used in the name +# these swap logs will have names such as: +# +# cache_swap_log.00 +# cache_swap_log.01 +# cache_swap_log.02 +# +# The numbered extension (which is added automatically) +# corresponds to the order of the 'cache_dir' lines in this +# configuration file. If you change the order of the 'cache_dir' +# lines in this file, these index files will NOT correspond to +# the correct 'cache_dir' entry (unless you manually rename +# them). We recommend you do NOT use this option. It is +# better to keep these index files in each 'cache_dir' directory. +#Default: +# Store the journal inside its cache_dir + +# TAG: logfile_rotate +# Specifies the number of logfile rotations to make when you +# type 'squid -k rotate'. The default is 10, which will rotate +# with extensions 0 through 9. Setting logfile_rotate to 0 will +# disable the file name rotation, but the logfiles are still closed +# and re-opened. This will enable you to rename the logfiles +# yourself just before sending the rotate signal. +# +# Note, the 'squid -k rotate' command normally sends a USR1 +# signal to the running squid process. In certain situations +# (e.g. on Linux with Async I/O), USR1 is used for other +# purposes, so -k rotate uses another signal. It is best to get +# in the habit of using 'squid -k rotate' instead of 'kill -USR1 +# '. +# +# Note, from Squid-3.1 this option is only a default for cache.log, +# that log can be rotated separately by using debug_options. +# +# Note2, for Debian/Linux the default of logfile_rotate is +# zero, since it includes external logfile-rotation methods. +#Default: +# logfile_rotate 0 + +# TAG: mime_table +# Path to Squid's icon configuration file. +# +# You shouldn't need to change this, but the default file contains +# examples and formatting information if you do. +#Default: +# mime_table /usr/share/squid/mime.conf + +# TAG: log_mime_hdrs on|off +# The Cache can record both the request and the response MIME +# headers for each HTTP transaction. The headers are encoded +# safely and will appear as two bracketed fields at the end of +# the access log (for either the native or httpd-emulated log +# formats). To enable this logging set log_mime_hdrs to 'on'. +#Default: +# log_mime_hdrs off + +# TAG: pid_filename +# A filename to write the process-id to. To disable, enter "none". +#Default: +# pid_filename /var/run/squid.pid + +# TAG: client_netmask +# A netmask for client addresses in logfiles and cachemgr output. +# Change this to protect the privacy of your cache clients. +# A netmask of 255.255.255.0 will log all IP's in that range with +# the last digit set to '0'. +#Default: +# Log full client IP address + +# TAG: strip_query_terms +# By default, Squid strips query terms from requested URLs before +# logging. This protects your user's privacy and reduces log size. +# +# When investigating HIT/MISS or other caching behaviour you +# will need to disable this to see the full URL used by Squid. +#Default: +# strip_query_terms on + +# TAG: buffered_logs on|off +# Whether to write/send access_log records ASAP or accumulate them and +# then write/send them in larger chunks. Buffering may improve +# performance because it decreases the number of I/Os. However, +# buffering increases the delay before log records become available to +# the final recipient (e.g., a disk file or logging daemon) and, +# hence, increases the risk of log records loss. +# +# Note that even when buffered_logs are off, Squid may have to buffer +# records if it cannot write/send them immediately due to pending I/Os +# (e.g., the I/O writing the previous log record) or connectivity loss. +# +# Currently honored by 'daemon' and 'tcp' access_log modules only. +#Default: +# buffered_logs off + +# TAG: netdb_filename +# Where Squid stores it's netdb journal. +# When enabled this journal preserves netdb state between restarts. +# +# To disable, enter "none". +#Default: +# netdb_filename stdio:/var/log/squid/netdb.state + +# OPTIONS FOR TROUBLESHOOTING +# ----------------------------------------------------------------------------- + +# TAG: cache_log +# Squid administrative logging file. +# +# This is where general information about Squid behavior goes. You can +# increase the amount of data logged to this file and how often it is +# rotated with "debug_options" +#Default: +# cache_log /var/log/squid/cache.log + +# TAG: debug_options +# Logging options are set as section,level where each source file +# is assigned a unique section. Lower levels result in less +# output, Full debugging (level 9) can result in a very large +# log file, so be careful. +# +# The magic word "ALL" sets debugging levels for all sections. +# The default is to run with "ALL,1" to record important warnings. +# +# The rotate=N option can be used to keep more or less of these logs +# than would otherwise be kept by logfile_rotate. +# For most uses a single log should be enough to monitor current +# events affecting Squid. +#Default: +# Log all critical and important messages. +debug_options ALL,1 33,2 28,9 + +# TAG: coredump_dir +# By default Squid leaves core files in the directory from where +# it was started. If you set 'coredump_dir' to a directory +# that exists, Squid will chdir() to that directory at startup +# and coredump files will be left there. +# +#Default: +# Use the directory from where Squid was started. +# + +# Leave coredumps in the first cache dir +coredump_dir /var/spool/squid + +# OPTIONS FOR FTP GATEWAYING +# ----------------------------------------------------------------------------- + +# TAG: ftp_user +# If you want the anonymous login password to be more informative +# (and enable the use of picky FTP servers), set this to something +# reasonable for your domain, like wwwuser@somewhere.net +# +# The reason why this is domainless by default is the +# request can be made on the behalf of a user in any domain, +# depending on how the cache is used. +# Some FTP server also validate the email address is valid +# (for example perl.com). +#Default: +# ftp_user Squid@ + +# TAG: ftp_passive +# If your firewall does not allow Squid to use passive +# connections, turn off this option. +# +# Use of ftp_epsv_all option requires this to be ON. +#Default: +# ftp_passive on + +# TAG: ftp_epsv_all +# FTP Protocol extensions permit the use of a special "EPSV ALL" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator, as the EPRT command will never be used and therefore, +# translation of the data portion of the segments will never be needed. +# +# When a client only expects to do two-way FTP transfers this may be +# useful. +# If squid finds that it must do a three-way FTP transfer after issuing +# an EPSV ALL command, the FTP session will fail. +# +# If you have any doubts about this option do not use it. +# Squid will nicely attempt all other connection methods. +# +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# ftp_epsv_all off + +# TAG: ftp_epsv +# FTP Protocol extensions permit the use of a special "EPSV" command. +# +# NATs may be able to put the connection on a "fast path" through the +# translator using EPSV, as the EPRT command will never be used +# and therefore, translation of the data portion of the segments +# will never be needed. +# +# EPSV is often required to interoperate with FTP servers on IPv6 +# networks. On the other hand, it may break some IPv4 servers. +# +# By default, EPSV may try EPSV with any FTP server. To fine tune +# that decision, you may restrict EPSV to certain clients or servers +# using ACLs: +# +# ftp_epsv allow|deny al1 acl2 ... +# +# WARNING: Disabling EPSV may cause problems with external NAT and IPv6. +# +# Only fast ACLs are supported. +# Requires ftp_passive to be ON (default) for any effect. +#Default: +# none + +# TAG: ftp_eprt +# FTP Protocol extensions permit the use of a special "EPRT" command. +# +# This extension provides a protocol neutral alternative to the +# IPv4-only PORT command. When supported it enables active FTP data +# channels over IPv6 and efficient NAT handling. +# +# Turning this OFF will prevent EPRT being attempted and will skip +# straight to using PORT for IPv4 servers. +# +# Some devices are known to not handle this extension correctly and +# may result in crashes. Devices which suport EPRT enough to fail +# cleanly will result in Squid attempting PORT anyway. This directive +# should only be disabled when EPRT results in device failures. +# +# WARNING: Doing so will convert Squid back to the old behavior with all +# the related problems with external NAT devices/layers and IPv4-only FTP. +#Default: +# ftp_eprt on + +# TAG: ftp_sanitycheck +# For security and data integrity reasons Squid by default performs +# sanity checks of the addresses of FTP data connections ensure the +# data connection is to the requested server. If you need to allow +# FTP connections to servers using another IP address for the data +# connection turn this off. +#Default: +# ftp_sanitycheck on + +# TAG: ftp_telnet_protocol +# The FTP protocol is officially defined to use the telnet protocol +# as transport channel for the control connection. However, many +# implementations are broken and does not respect this aspect of +# the FTP protocol. +# +# If you have trouble accessing files with ASCII code 255 in the +# path or similar problems involving this ASCII code you can +# try setting this directive to off. If that helps, report to the +# operator of the FTP server in question that their FTP server +# is broken and does not follow the FTP standard. +#Default: +# ftp_telnet_protocol on + +# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS +# ----------------------------------------------------------------------------- + +# TAG: diskd_program +# Specify the location of the diskd executable. +# Note this is only useful if you have compiled in +# diskd as one of the store io modules. +#Default: +# diskd_program /usr/lib/squid/diskd + +# TAG: unlinkd_program +# Specify the location of the executable for file deletion process. +#Default: +# unlinkd_program /usr/lib/squid/unlinkd + +# TAG: pinger_program +# Specify the location of the executable for the pinger process. +#Default: +# pinger_program /usr/lib/squid/pinger + +# TAG: pinger_enable +# Control whether the pinger is active at run-time. +# Enables turning ICMP pinger on and off with a simple +# squid -k reconfigure. +#Default: +# pinger_enable on + +# OPTIONS FOR URL REWRITING +# ----------------------------------------------------------------------------- + +# TAG: url_rewrite_program +# Specify the location of the executable URL rewriter to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the rewriter will receive on line with the format +# +# [channel-ID ] URL [ extras] +# +# See url_rewrite_extras on how to send "extras" with optional values to +# the helper. +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK status=30N url="..." +# Redirect the URL to the one supplied in 'url='. +# 'status=' is optional and contains the status code to send +# the client in Squids HTTP response. It must be one of the +# HTTP redirect status codes: 301, 302, 303, 307, 308. +# When no status is given Squid will use 302. +# +# OK rewrite-url="..." +# Rewrite the URL to the one supplied in 'rewrite-url='. +# The new URL is fetched directly by Squid and returned to +# the client as the response to its request. +# +# OK +# When neither of url= and rewrite-url= are sent Squid does +# not change the URL. +# +# ERR +# Do not change the URL. +# +# BH +# An internal error occurred in the helper, preventing +# a result being identified. The 'message=' key name is +# reserved for delivering a log message. +# +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# The TAG is treated as a regular annotation but persists across +# future requests on the client connection rather than just the +# current request. A helper may update the TAG during subsequent +# requests be returning a new kv-pair. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# WARNING: URL re-writing ability should be avoided whenever possible. +# Use the URL redirect form of response instead. +# +# Re-write creates a difference in the state held by the client +# and server. Possibly causing confusion when the server response +# contains snippets of its view state. Embeded URLs, response +# and content Location headers, etc. are not re-written by this +# interface. +# +# By default, a URL rewriter is not used. +#Default: +# none + +# TAG: url_rewrite_children +# The maximum number of redirector processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# URLs, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each redirector helper can handle in +# parallel. Defaults to 0 which indicates the redirector +# is a old-style single threaded redirector. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# url_rewrite_children 20 startup=0 idle=1 concurrency=0 + +# TAG: url_rewrite_host_header +# To preserve same-origin security policies in browsers and +# prevent Host: header forgery by redirectors Squid rewrites +# any Host: header in redirected requests. +# +# If you are running an accelerator this may not be a wanted +# effect of a redirector. This directive enables you disable +# Host: alteration in reverse-proxy traffic. +# +# WARNING: Entries are cached on the result of the URL rewriting +# process, so be careful if you have domain-virtual hosts. +# +# WARNING: Squid and other software verifies the URL and Host +# are matching, so be careful not to relay through other proxies +# or inspecting firewalls with this disabled. +#Default: +# url_rewrite_host_header on + +# TAG: url_rewrite_access +# If defined, this access list specifies which requests are +# sent to the redirector processes. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: url_rewrite_bypass +# When this is 'on', a request will not go through the +# redirector if all the helpers are busy. If this is 'off' +# and the redirector queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# redirectors. You should only enable this if the redirectors +# are not critical to your caching system. If you use +# redirectors for access control, and you enable this option, +# users may have access to pages they should not +# be allowed to request. +#Default: +# url_rewrite_bypass off + +# TAG: url_rewrite_extras +# Specifies a string to be append to request line format for the +# rewriter helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# url_rewrite_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# OPTIONS FOR STORE ID +# ----------------------------------------------------------------------------- + +# TAG: store_id_program +# Specify the location of the executable StoreID helper to use. +# Since they can perform almost any function there isn't one included. +# +# For each requested URL, the helper will receive one line with the format +# +# [channel-ID ] URL [ extras] +# +# +# After processing the request the helper must reply using the following format: +# +# [channel-ID ] result [ kv-pairs] +# +# The result code can be: +# +# OK store-id="..." +# Use the StoreID supplied in 'store-id='. +# +# ERR +# The default is to use HTTP request URL as the store ID. +# +# BH +# An internal error occured in the helper, preventing +# a result being identified. +# +# In addition to the above kv-pairs Squid also understands the following +# optional kv-pairs received from URL rewriters: +# clt_conn_tag=TAG +# Associates a TAG with the client TCP connection. +# Please see url_rewrite_program related documentation for this +# kv-pair +# +# Helper programs should be prepared to receive and possibly ignore +# additional whitespace-separated tokens on each input line. +# +# When using the concurrency= option the protocol is changed by +# introducing a query channel tag in front of the request/response. +# The query channel tag is a number between 0 and concurrency-1. +# This value must be echoed back unchanged to Squid as the first part +# of the response relating to its request. +# +# NOTE: when using StoreID refresh_pattern will apply to the StoreID +# returned from the helper and not the URL. +# +# WARNING: Wrong StoreID value returned by a careless helper may result +# in the wrong cached response returned to the user. +# +# By default, a StoreID helper is not used. +#Default: +# none + +# TAG: store_id_extras +# Specifies a string to be append to request line format for the +# StoreId helper. "Quoted" format values may contain spaces and +# logformat %macros. In theory, any logformat %macro can be used. +# In practice, a %macro expands as a dash (-) if the helper request is +# sent before the required macro information is available to Squid. +#Default: +# store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp" + +# TAG: store_id_children +# The maximum number of StoreID helper processes to spawn. If you limit +# it too few Squid will have to wait for them to process a backlog of +# requests, slowing it down. If you allow too many they will use RAM +# and other system resources noticably. +# +# The startup= and idle= options allow some measure of skew in your +# tuning. +# +# startup= +# +# Sets a minimum of how many processes are to be spawned when Squid +# starts or reconfigures. When set to zero the first request will +# cause spawning of the first child process to handle it. +# +# Starting too few will cause an initial slowdown in traffic as Squid +# attempts to simultaneously spawn enough processes to cope. +# +# idle= +# +# Sets a minimum of how many processes Squid is to try and keep available +# at all times. When traffic begins to rise above what the existing +# processes can handle this many more will be spawned up to the maximum +# configured. A minimum setting of 1 is required. +# +# concurrency= +# +# The number of requests each storeID helper can handle in +# parallel. Defaults to 0 which indicates the helper +# is a old-style single threaded program. +# +# When this directive is set to a value >= 1 then the protocol +# used to communicate with the helper is modified to include +# an ID in front of the request/response. The ID from the request +# must be echoed back with the response to that request. +#Default: +# store_id_children 20 startup=0 idle=1 concurrency=0 + +# TAG: store_id_access +# If defined, this access list specifies which requests are +# sent to the StoreID processes. By default all requests +# are sent. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: store_id_bypass +# When this is 'on', a request will not go through the +# helper if all helpers are busy. If this is 'off' +# and the helper queue grows too large, Squid will exit +# with a FATAL error and ask you to increase the number of +# helpers. You should only enable this if the helperss +# are not critical to your caching system. If you use +# helpers for critical caching components, and you enable this +# option, users may not get objects from cache. +#Default: +# store_id_bypass on + +# OPTIONS FOR TUNING THE CACHE +# ----------------------------------------------------------------------------- + +# TAG: cache +# Requests denied by this directive will not be served from the cache +# and their responses will not be stored in the cache. This directive +# has no effect on other transactions and on already cached responses. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# This and the two other similar caching directives listed below are +# checked at different transaction processing stages, have different +# access to response information, affect different cache operations, +# and differ in slow ACLs support: +# +# * cache: Checked before Squid makes a hit/miss determination. +# No access to reply information! +# Denies both serving a hit and storing a miss. +# Supports both fast and slow ACLs. +# * send_hit: Checked after a hit was detected. +# Has access to reply (hit) information. +# Denies serving a hit only. +# Supports fast ACLs only. +# * store_miss: Checked before storing a cachable miss. +# Has access to reply (miss) information. +# Denies storing a miss only. +# Supports fast ACLs only. +# +# If you are not sure which of the three directives to use, apply the +# following decision logic: +# +# * If your ACL(s) are of slow type _and_ need response info, redesign. +# Squid does not support that particular combination at this time. +# Otherwise: +# * If your directive ACL(s) are of slow type, use "cache"; and/or +# * if your directive ACL(s) need no response info, use "cache". +# Otherwise: +# * If you do not want the response cached, use store_miss; and/or +# * if you do not want a hit on a cached response, use send_hit. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: send_hit +# Responses denied by this directive will not be served from the cache +# (but may still be cached, see store_miss). This directive has no +# effect on the responses it allows and on the cached objects. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. +# +# Unlike the "cache" directive, send_hit only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# For example: +# +# # apply custom Store ID mapping to some URLs +# acl MapMe dstdomain .c.example.com +# store_id_program ... +# store_id_access allow MapMe +# +# # but prevent caching of special responses +# # such as 302 redirects that cause StoreID loops +# acl Ordinary http_status 200-299 +# store_miss deny MapMe !Ordinary +# +# # and do not serve any previously stored special responses +# # from the cache (in case they were already cached before +# # the above store_miss rule was in effect). +# send_hit deny MapMe !Ordinary +#Default: +# By default, this directive is unused and has no effect. + +# TAG: store_miss +# Responses denied by this directive will not be cached (but may still +# be served from the cache, see send_hit). This directive has no +# effect on the responses it allows and on the already cached responses. +# +# Please see the "cache" directive for a summary of differences among +# store_miss, send_hit, and cache directives. See the +# send_hit directive for a usage example. +# +# Unlike the "cache" directive, store_miss only supports fast acl +# types. See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# By default, this directive is unused and has no effect. + +# TAG: max_stale time-units +# This option puts an upper limit on how stale content Squid +# will serve from the cache if cache validation fails. +# Can be overriden by the refresh_pattern max-stale option. +#Default: +# max_stale 1 week + +# TAG: refresh_pattern +# usage: refresh_pattern [-i] regex min percent max [options] +# +# By default, regular expressions are CASE-SENSITIVE. To make +# them case-insensitive, use the -i option. +# +# 'Min' is the time (in minutes) an object without an explicit +# expiry time should be considered fresh. The recommended +# value is 0, any higher values may cause dynamic applications +# to be erroneously cached unless the application designer +# has taken the appropriate actions. +# +# 'Percent' is a percentage of the objects age (time since last +# modification age) an object without explicit expiry time +# will be considered fresh. +# +# 'Max' is an upper limit on how long objects without an explicit +# expiry time will be considered fresh. The value is also used +# to form Cache-Control: max-age header for a request sent from +# Squid to origin/parent. +# +# options: override-expire +# override-lastmod +# reload-into-ims +# ignore-reload +# ignore-no-store +# ignore-must-revalidate +# ignore-private +# ignore-auth +# max-stale=NN +# refresh-ims +# store-stale +# +# override-expire enforces min age even if the server +# sent an explicit expiry time (e.g., with the +# Expires: header or Cache-Control: max-age). Doing this +# VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# Note: override-expire does not enforce staleness - it only extends +# freshness / min. If the server returns a Expires time which +# is longer than your max time, Squid will still consider +# the object fresh for that period of time. +# +# override-lastmod enforces min age even on objects +# that were modified recently. +# +# reload-into-ims changes a client no-cache or ``reload'' +# request for a cached entry into a conditional request using +# If-Modified-Since and/or If-None-Match headers, provided the +# cached entry has a Last-Modified and/or a strong ETag header. +# Doing this VIOLATES the HTTP standard. Enabling this feature +# could make you liable for problems which it causes. +# +# ignore-reload ignores a client no-cache or ``reload'' +# header. Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which +# it causes. +# +# ignore-no-store ignores any ``Cache-control: no-store'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-must-revalidate ignores any ``Cache-Control: must-revalidate`` +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-private ignores any ``Cache-control: private'' +# headers received from a server. Doing this VIOLATES +# the HTTP standard. Enabling this feature could make you +# liable for problems which it causes. +# +# ignore-auth caches responses to requests with authorization, +# as if the originserver had sent ``Cache-control: public'' +# in the response header. Doing this VIOLATES the HTTP standard. +# Enabling this feature could make you liable for problems which +# it causes. +# +# refresh-ims causes squid to contact the origin server +# when a client issues an If-Modified-Since request. This +# ensures that the client will receive an updated version +# if one is available. +# +# store-stale stores responses even if they don't have explicit +# freshness or a validator (i.e., Last-Modified or an ETag) +# present, or if they're already stale. By default, Squid will +# not cache such responses because they usually can't be +# reused. Note that such responses will be stale by default. +# +# max-stale=NN provide a maximum staleness factor. Squid won't +# serve objects more stale than this even if it failed to +# validate the object. Default: use the max_stale global limit. +# +# Basically a cached object is: +# +# FRESH if expire > now, else STALE +# STALE if age > max +# FRESH if lm-factor < percent, else STALE +# FRESH if age < min +# else STALE +# +# The refresh_pattern lines are checked in the order listed here. +# The first entry which matches is used. If none of the entries +# match the default will be used. +# +# Note, you must uncomment all the default lines if you want +# to change one. The default setting is only active if none is +# used. +# +# + +# +# Add any of your own refresh_pattern entries above these. +# +refresh_pattern ^ftp: 1440 20% 10080 +refresh_pattern ^gopher: 1440 0% 1440 +refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 +refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 +# example lin deb packages +#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600 +refresh_pattern . 0 20% 4320 + +# TAG: quick_abort_min (KB) +#Default: +# quick_abort_min 16 KB + +# TAG: quick_abort_max (KB) +#Default: +# quick_abort_max 16 KB + +# TAG: quick_abort_pct (percent) +# The cache by default continues downloading aborted requests +# which are almost completed (less than 16 KB remaining). This +# may be undesirable on slow (e.g. SLIP) links and/or very busy +# caches. Impatient users may tie up file descriptors and +# bandwidth by repeatedly requesting and immediately aborting +# downloads. +# +# When the user aborts a request, Squid will check the +# quick_abort values to the amount of data transferred until +# then. +# +# If the transfer has less than 'quick_abort_min' KB remaining, +# it will finish the retrieval. +# +# If the transfer has more than 'quick_abort_max' KB remaining, +# it will abort the retrieval. +# +# If more than 'quick_abort_pct' of the transfer has completed, +# it will finish the retrieval. +# +# If you do not want any retrieval to continue after the client +# has aborted, set both 'quick_abort_min' and 'quick_abort_max' +# to '0 KB'. +# +# If you want retrievals to always continue if they are being +# cached set 'quick_abort_min' to '-1 KB'. +#Default: +# quick_abort_pct 95 + +# TAG: read_ahead_gap buffer-size +# The amount of data the cache will buffer ahead of what has been +# sent to the client when retrieving an object from another server. +#Default: +# read_ahead_gap 16 KB + +# TAG: negative_ttl time-units +# Set the Default Time-to-Live (TTL) for failed requests. +# Certain types of failures (such as "connection refused" and +# "404 Not Found") are able to be negatively-cached for a short time. +# Modern web servers should provide Expires: header, however if they +# do not this can provide a minimum TTL. +# The default is not to cache errors with unknown expiry details. +# +# Note that this is different from negative caching of DNS lookups. +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +#Default: +# negative_ttl 0 seconds + +# TAG: positive_dns_ttl time-units +# Upper limit on how long Squid will cache positive DNS responses. +# Default is 6 hours (360 minutes). This directive must be set +# larger than negative_dns_ttl. +#Default: +# positive_dns_ttl 6 hours + +# TAG: negative_dns_ttl time-units +# Time-to-Live (TTL) for negative caching of failed DNS lookups. +# This also sets the lower cache limit on positive lookups. +# Minimum value is 1 second, and it is not recommendable to go +# much below 10 seconds. +#Default: +# negative_dns_ttl 1 minutes + +# TAG: range_offset_limit size [acl acl...] +# usage: (size) [units] [[!]aclname] +# +# Sets an upper limit on how far (number of bytes) into the file +# a Range request may be to cause Squid to prefetch the whole file. +# If beyond this limit, Squid forwards the Range request as it is and +# the result is NOT cached. +# +# This is to stop a far ahead range request (lets say start at 17MB) +# from making Squid fetch the whole object up to that point before +# sending anything to the client. +# +# Multiple range_offset_limit lines may be specified, and they will +# be searched from top to bottom on each request until a match is found. +# The first match found will be used. If no line matches a request, the +# default limit of 0 bytes will be used. +# +# 'size' is the limit specified as a number of units. +# +# 'units' specifies whether to use bytes, KB, MB, etc. +# If no units are specified bytes are assumed. +# +# A size of 0 causes Squid to never fetch more than the +# client requested. (default) +# +# A size of 'none' causes Squid to always fetch the object from the +# beginning so it may cache the result. (2.0 style) +# +# 'aclname' is the name of a defined ACL. +# +# NP: Using 'none' as the byte value here will override any quick_abort settings +# that may otherwise apply to the range request. The range request will +# be fully fetched from start to finish regardless of the client +# actions. This affects bandwidth usage. +#Default: +# none + +# TAG: minimum_expiry_time (seconds) +# The minimum caching time according to (Expires - Date) +# headers Squid honors if the object can't be revalidated. +# The default is 60 seconds. +# +# In reverse proxy environments it might be desirable to honor +# shorter object lifetimes. It is most likely better to make +# your server return a meaningful Last-Modified header however. +# +# In ESI environments where page fragments often have short +# lifetimes, this will often be best set to 0. +#Default: +# minimum_expiry_time 60 seconds + +# TAG: store_avg_object_size (bytes) +# Average object size, used to estimate number of objects your +# cache can hold. The default is 13 KB. +# +# This is used to pre-seed the cache index memory allocation to +# reduce expensive reallocate operations while handling clients +# traffic. Too-large values may result in memory allocation during +# peak traffic, too-small values will result in wasted memory. +# +# Check the cache manager 'info' report metrics for the real +# object sizes seen by your Squid before tuning this. +#Default: +# store_avg_object_size 13 KB + +# TAG: store_objects_per_bucket +# Target number of objects per bucket in the store hash table. +# Lowering this value increases the total number of buckets and +# also the storage maintenance rate. The default is 20. +#Default: +# store_objects_per_bucket 20 + +# HTTP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: request_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a request. +# Request headers are usually relatively small (about 512 bytes). +# Placing a limit on the request header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# request_header_max_size 64 KB + +# TAG: reply_header_max_size (KB) +# This specifies the maximum size for HTTP headers in a reply. +# Reply headers are usually relatively small (about 512 bytes). +# Placing a limit on the reply header size will catch certain +# bugs (for example with persistent connections) and possibly +# buffer-overflow or denial-of-service attacks. +#Default: +# reply_header_max_size 64 KB + +# TAG: request_body_max_size (bytes) +# This specifies the maximum size for an HTTP request body. +# In other words, the maximum size of a PUT/POST request. +# A user who attempts to send a request with a body larger +# than this limit receives an "Invalid Request" error message. +# If you set this parameter to a zero (the default), there will +# be no limit imposed. +# +# See also client_request_buffer_max_size for an alternative +# limitation on client uploads which can be configured. +#Default: +# No limit. + +# TAG: client_request_buffer_max_size (bytes) +# This specifies the maximum buffer size of a client request. +# It prevents squid eating too much memory when somebody uploads +# a large file. +#Default: +# client_request_buffer_max_size 512 KB + +# TAG: broken_posts +# A list of ACL elements which, if matched, causes Squid to send +# an extra CRLF pair after the body of a PUT/POST request. +# +# Some HTTP servers has broken implementations of PUT/POST, +# and rely on an extra CRLF pair sent by some WWW clients. +# +# Quote from RFC2616 section 4.1 on this matter: +# +# Note: certain buggy HTTP/1.0 client implementations generate an +# extra CRLF's after a POST request. To restate what is explicitly +# forbidden by the BNF, an HTTP/1.1 client must not preface or follow +# a request with an extra CRLF. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# acl buggy_server url_regex ^http://.... +# broken_posts allow buggy_server +#Default: +# Obey RFC 2616. + +# TAG: adaptation_uses_indirect_client on|off +# Controls whether the indirect client IP address (instead of the direct +# client IP address) is passed to adaptation services. +# +# See also: follow_x_forwarded_for adaptation_send_client_ip +#Default: +# adaptation_uses_indirect_client on + +# TAG: via on|off +# If set (default), Squid will include a Via header in requests and +# replies as required by RFC2616. +#Default: +# via on + +# TAG: ie_refresh on|off +# Microsoft Internet Explorer up until version 5.5 Service +# Pack 1 has an issue with transparent proxies, wherein it +# is impossible to force a refresh. Turning this on provides +# a partial fix to the problem, by causing all IMS-REFRESH +# requests from older IE versions to check the origin server +# for fresh content. This reduces hit ratio by some amount +# (~10% in my experience), but allows users to actually get +# fresh content when they want it. Note because Squid +# cannot tell if the user is using 5.5 or 5.5SP1, the behavior +# of 5.5 is unchanged from old versions of Squid (i.e. a +# forced refresh is impossible). Newer versions of IE will, +# hopefully, continue to have the new behavior and will be +# handled based on that assumption. This option defaults to +# the old Squid behavior, which is better for hit ratios but +# worse for clients using IE, if they need to be able to +# force fresh content. +#Default: +# ie_refresh off + +# TAG: vary_ignore_expire on|off +# Many HTTP servers supporting Vary gives such objects +# immediate expiry time with no cache-control header +# when requested by a HTTP/1.0 client. This option +# enables Squid to ignore such expiry times until +# HTTP/1.1 is fully implemented. +# +# WARNING: If turned on this may eventually cause some +# varying objects not intended for caching to get cached. +#Default: +# vary_ignore_expire off + +# TAG: request_entities +# Squid defaults to deny GET and HEAD requests with request entities, +# as the meaning of such requests are undefined in the HTTP standard +# even if not explicitly forbidden. +# +# Set this directive to on if you have clients which insists +# on sending request entities in GET or HEAD requests. But be warned +# that there is server software (both proxies and web servers) which +# can fail to properly process this kind of request which may make you +# vulnerable to cache pollution attacks if enabled. +#Default: +# request_entities off + +# TAG: request_header_access +# Usage: request_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option replaces the old 'anonymize_headers' and the +# older 'http_anonymizer' option with something that is much +# more configurable. A list of ACLs for each header name allows +# removal of specific header fields under specific conditions. +# +# This option only applies to outgoing HTTP request headers (i.e., +# headers sent by Squid to the next HTTP hop such as a cache peer +# or an origin server). The option has no effect during cache hit +# detection. The equivalent adaptation vectoring point in ICAP +# terminology is post-cache REQMOD. +# +# The option is applied to individual outgoing request header +# fields. For each request header field F, Squid uses the first +# qualifying sets of request_header_access rules: +# +# 1. Rules with header_name equal to F's name. +# 2. Rules with header_name 'Other', provided F's name is not +# on the hard-coded list of commonly used HTTP header names. +# 3. Rules with header_name 'All'. +# +# Within that qualifying rule set, rule ACLs are checked as usual. +# If ACLs of an "allow" rule match, the header field is allowed to +# go through as is. If ACLs of a "deny" rule match, the header is +# removed and request_header_replace is then checked to identify +# if the removed header has a replacement. If no rules within the +# set have matching ACLs, the header field is left as is. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# request_header_access From deny all +# request_header_access Referer deny all +# request_header_access User-Agent deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# request_header_access Authorization allow all +# request_header_access Proxy-Authorization allow all +# request_header_access Cache-Control allow all +# request_header_access Content-Length allow all +# request_header_access Content-Type allow all +# request_header_access Date allow all +# request_header_access Host allow all +# request_header_access If-Modified-Since allow all +# request_header_access Pragma allow all +# request_header_access Accept allow all +# request_header_access Accept-Charset allow all +# request_header_access Accept-Encoding allow all +# request_header_access Accept-Language allow all +# request_header_access Connection allow all +# request_header_access All deny all +# +# HTTP reply headers are controlled with the reply_header_access directive. +# +# By default, all headers are allowed (no anonymizing is performed). +#Default: +# No limits. + +# TAG: reply_header_access +# Usage: reply_header_access header_name allow|deny [!]aclname ... +# +# WARNING: Doing this VIOLATES the HTTP standard. Enabling +# this feature could make you liable for problems which it +# causes. +# +# This option only applies to reply headers, i.e., from the +# server to the client. +# +# This is the same as request_header_access, but in the other +# direction. Please see request_header_access for detailed +# documentation. +# +# For example, to achieve the same behavior as the old +# 'http_anonymizer standard' option, you should use: +# +# reply_header_access Server deny all +# reply_header_access WWW-Authenticate deny all +# reply_header_access Link deny all +# +# Or, to reproduce the old 'http_anonymizer paranoid' feature +# you should use: +# +# reply_header_access Allow allow all +# reply_header_access WWW-Authenticate allow all +# reply_header_access Proxy-Authenticate allow all +# reply_header_access Cache-Control allow all +# reply_header_access Content-Encoding allow all +# reply_header_access Content-Length allow all +# reply_header_access Content-Type allow all +# reply_header_access Date allow all +# reply_header_access Expires allow all +# reply_header_access Last-Modified allow all +# reply_header_access Location allow all +# reply_header_access Pragma allow all +# reply_header_access Content-Language allow all +# reply_header_access Retry-After allow all +# reply_header_access Title allow all +# reply_header_access Content-Disposition allow all +# reply_header_access Connection allow all +# reply_header_access All deny all +# +# HTTP request headers are controlled with the request_header_access directive. +# +# By default, all headers are allowed (no anonymizing is +# performed). +#Default: +# No limits. + +# TAG: request_header_replace +# Usage: request_header_replace header_name message +# Example: request_header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit) +# +# This option allows you to change the contents of headers +# denied with request_header_access above, by replacing them +# with some fixed string. +# +# This only applies to request headers, not reply headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: reply_header_replace +# Usage: reply_header_replace header_name message +# Example: reply_header_replace Server Foo/1.0 +# +# This option allows you to change the contents of headers +# denied with reply_header_access above, by replacing them +# with some fixed string. +# +# This only applies to reply headers, not request headers. +# +# By default, headers are removed if denied. +#Default: +# none + +# TAG: request_header_add +# Usage: request_header_add field-name field-value acl1 [acl2] ... +# Example: request_header_add X-Client-CA "CA=%ssl::>cert_issuer" all +# +# This option adds header fields to outgoing HTTP requests (i.e., +# request headers sent by Squid to the next HTTP hop such as a +# cache peer or an origin server). The option has no effect during +# cache hit detection. The equivalent adaptation vectoring point +# in ICAP terminology is post-cache REQMOD. +# +# Field-name is a token specifying an HTTP header name. If a +# standard HTTP header name is used, Squid does not check whether +# the new header conflicts with any existing headers or violates +# HTTP rules. If the request to be modified already contains a +# field with the same name, the old field is preserved but the +# header field values are not merged. +# +# Field-value is either a token or a quoted string. If quoted +# string format is used, then the surrounding quotes are removed +# while escape sequences and %macros are processed. +# +# In theory, all of the logformat codes can be used as %macros. +# However, unlike logging (which happens at the very end of +# transaction lifetime), the transaction may not yet have enough +# information to expand a macro when the new header value is needed. +# And some information may already be available to Squid but not yet +# committed where the macro expansion code can access it (report +# such instances!). The macro will be expanded into a single dash +# ('-') in such cases. Not all macros have been tested. +# +# One or more Squid ACLs may be specified to restrict header +# injection to matching requests. As always in squid.conf, all +# ACLs in an option ACL list must be satisfied for the insertion +# to happen. The request_header_add option supports fast ACLs +# only. +#Default: +# none + +# TAG: note +# This option used to log custom information about the master +# transaction. For example, an admin may configure Squid to log +# which "user group" the transaction belongs to, where "user group" +# will be determined based on a set of ACLs and not [just] +# authentication information. +# Values of key/value pairs can be logged using %{key}note macros: +# +# note key value acl ... +# logformat myFormat ... %{key}note ... +#Default: +# none + +# TAG: relaxed_header_parser on|off|warn +# In the default "on" setting Squid accepts certain forms +# of non-compliant HTTP messages where it is unambiguous +# what the sending application intended even if the message +# is not correctly formatted. The messages is then normalized +# to the correct form when forwarded by Squid. +# +# If set to "warn" then a warning will be emitted in cache.log +# each time such HTTP error is encountered. +# +# If set to "off" then such HTTP errors will cause the request +# or response to be rejected. +#Default: +# relaxed_header_parser on + +# TAG: collapsed_forwarding (on|off) +# When enabled, instead of forwarding each concurrent request for +# the same URL, Squid just sends the first of them. The other, so +# called "collapsed" requests, wait for the response to the first +# request and, if it happens to be cachable, use that response. +# Here, "concurrent requests" means "received after the first +# request headers were parsed and before the corresponding response +# headers were parsed". +# +# This feature is disabled by default: enabling collapsed +# forwarding needlessly delays forwarding requests that look +# cachable (when they are collapsed) but then need to be forwarded +# individually anyway because they end up being for uncachable +# content. However, in some cases, such as acceleration of highly +# cachable content with periodic or grouped expiration times, the +# gains from collapsing [large volumes of simultaneous refresh +# requests] outweigh losses from such delays. +# +# Squid collapses two kinds of requests: regular client requests +# received on one of the listening ports and internal "cache +# revalidation" requests which are triggered by those regular +# requests hitting a stale cached object. Revalidation collapsing +# is currently disabled for Squid instances containing SMP-aware +# disk or memory caches and for Vary-controlled cached objects. +#Default: +# collapsed_forwarding off + +# TIMEOUTS +# ----------------------------------------------------------------------------- + +# TAG: forward_timeout time-units +# This parameter specifies how long Squid should at most attempt in +# finding a forwarding path for the request before giving up. +#Default: +# forward_timeout 4 minutes + +# TAG: connect_timeout time-units +# This parameter specifies how long to wait for the TCP connect to +# the requested server or peer to complete before Squid should +# attempt to find another path where to forward the request. +#Default: +# connect_timeout 1 minute + +# TAG: peer_connect_timeout time-units +# This parameter specifies how long to wait for a pending TCP +# connection to a peer cache. The default is 30 seconds. You +# may also set different timeout values for individual neighbors +# with the 'connect-timeout' option on a 'cache_peer' line. +#Default: +# peer_connect_timeout 30 seconds + +# TAG: read_timeout time-units +# Applied on peer server connections. +# +# After each successful read(), the timeout will be extended by this +# amount. If no data is read again after this amount of time, +# the request is aborted and logged with ERR_READ_TIMEOUT. +# +# The default is 15 minutes. +#Default: +# read_timeout 15 minutes + +# TAG: write_timeout time-units +# This timeout is tracked for all connections that have data +# available for writing and are waiting for the socket to become +# ready. After each successful write, the timeout is extended by +# the configured amount. If Squid has data to write but the +# connection is not ready for the configured duration, the +# transaction associated with the connection is terminated. The +# default is 15 minutes. +#Default: +# write_timeout 15 minutes + +# TAG: request_timeout +# How long to wait for complete HTTP request headers after initial +# connection establishment. +#Default: +# request_timeout 5 minutes + +# TAG: client_idle_pconn_timeout +# How long to wait for the next HTTP request on a persistent +# client connection after the previous request completes. +#Default: +# client_idle_pconn_timeout 2 minutes + +# TAG: ftp_client_idle_timeout +# How long to wait for an FTP request on a connection to Squid ftp_port. +# Many FTP clients do not deal with idle connection closures well, +# necessitating a longer default timeout than client_idle_pconn_timeout +# used for incoming HTTP requests. +#Default: +# ftp_client_idle_timeout 30 minutes + +# TAG: client_lifetime time-units +# The maximum amount of time a client (browser) is allowed to +# remain connected to the cache process. This protects the Cache +# from having a lot of sockets (and hence file descriptors) tied up +# in a CLOSE_WAIT state from remote clients that go away without +# properly shutting down (either because of a network failure or +# because of a poor client implementation). The default is one +# day, 1440 minutes. +# +# NOTE: The default value is intended to be much larger than any +# client would ever need to be connected to your cache. You +# should probably change client_lifetime only as a last resort. +# If you seem to have many client connections tying up +# filedescriptors, we recommend first tuning the read_timeout, +# request_timeout, persistent_request_timeout and quick_abort values. +#Default: +# client_lifetime 1 day + +# TAG: half_closed_clients +# Some clients may shutdown the sending side of their TCP +# connections, while leaving their receiving sides open. Sometimes, +# Squid can not tell the difference between a half-closed and a +# fully-closed TCP connection. +# +# By default, Squid will immediately close client connections when +# read(2) returns "no more data to read." +# +# Change this option to 'on' and Squid will keep open connections +# until a read(2) or write(2) on the socket returns an error. +# This may show some benefits for reverse proxies. But if not +# it is recommended to leave OFF. +#Default: +# half_closed_clients off + +# TAG: server_idle_pconn_timeout +# Timeout for idle persistent connections to servers and other +# proxies. +#Default: +# server_idle_pconn_timeout 1 minute + +# TAG: ident_timeout +# Maximum time to wait for IDENT lookups to complete. +# +# If this is too high, and you enabled IDENT lookups from untrusted +# users, you might be susceptible to denial-of-service by having +# many ident requests going at once. +#Default: +# ident_timeout 10 seconds + +# TAG: shutdown_lifetime time-units +# When SIGTERM or SIGHUP is received, the cache is put into +# "shutdown pending" mode until all active sockets are closed. +# This value is the lifetime to set for all open descriptors +# during shutdown mode. Any active clients after this many +# seconds will receive a 'timeout' message. +#Default: +# shutdown_lifetime 30 seconds + +# ADMINISTRATIVE PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: cache_mgr +# Email-address of local cache manager who will receive +# mail if the cache dies. The default is "webmaster". +#Default: +# cache_mgr webmaster + +# TAG: mail_from +# From: email-address for mail sent when the cache dies. +# The default is to use 'squid@unique_hostname'. +# +# See also: unique_hostname directive. +#Default: +# none + +# TAG: mail_program +# Email program used to send mail if the cache dies. +# The default is "mail". The specified program must comply +# with the standard Unix mail syntax: +# mail-program recipient < mailfile +# +# Optional command line options can be specified. +#Default: +# mail_program mail + +# TAG: cache_effective_user +# If you start Squid as root, it will change its effective/real +# UID/GID to the user specified below. The default is to change +# to UID of proxy. +# see also; cache_effective_group +#Default: +# cache_effective_user proxy + +# TAG: cache_effective_group +# Squid sets the GID to the effective user's default group ID +# (taken from the password file) and supplementary group list +# from the groups membership. +# +# If you want Squid to run with a specific GID regardless of +# the group memberships of the effective user then set this +# to the group (or GID) you want Squid to run as. When set +# all other group privileges of the effective user are ignored +# and only this GID is effective. If Squid is not started as +# root the user starting Squid MUST be member of the specified +# group. +# +# This option is not recommended by the Squid Team. +# Our preference is for administrators to configure a secure +# user account for squid with UID/GID matching system policies. +#Default: +# Use system group memberships of the cache_effective_user account + +# TAG: httpd_suppress_version_string on|off +# Suppress Squid version string info in HTTP headers and HTML error pages. +#Default: +# httpd_suppress_version_string off + +# TAG: visible_hostname +# If you want to present a special hostname in error messages, etc, +# define this. Otherwise, the return value of gethostname() +# will be used. If you have multiple caches in a cluster and +# get errors about IP-forwarding you must set them to have individual +# names with this setting. +#Default: +# Automatically detect the system host name + +# TAG: unique_hostname +# If you want to have multiple machines with the same +# 'visible_hostname' you must give each machine a different +# 'unique_hostname' so forwarding loops can be detected. +#Default: +# Copy the value from visible_hostname + +# TAG: hostname_aliases +# A list of other DNS names your cache has. +#Default: +# none + +# TAG: umask +# Minimum umask which should be enforced while the proxy +# is running, in addition to the umask set at startup. +# +# For a traditional octal representation of umasks, start +# your value with 0. +#Default: +# umask 027 + +# OPTIONS FOR THE CACHE REGISTRATION SERVICE +# ----------------------------------------------------------------------------- +# +# This section contains parameters for the (optional) cache +# announcement service. This service is provided to help +# cache administrators locate one another in order to join or +# create cache hierarchies. +# +# An 'announcement' message is sent (via UDP) to the registration +# service by Squid. By default, the announcement message is NOT +# SENT unless you enable it with 'announce_period' below. +# +# The announcement message includes your hostname, plus the +# following information from this configuration file: +# +# http_port +# icp_port +# cache_mgr +# +# All current information is processed regularly and made +# available on the Web at http://www.ircache.net/Cache/Tracker/. + +# TAG: announce_period +# This is how frequently to send cache announcements. +# +# To enable announcing your cache, just set an announce period. +# +# Example: +# announce_period 1 day +#Default: +# Announcement messages disabled. + +# TAG: announce_host +# Set the hostname where announce registration messages will be sent. +# +# See also announce_port and announce_file +#Default: +# announce_host tracker.ircache.net + +# TAG: announce_file +# The contents of this file will be included in the announce +# registration messages. +#Default: +# none + +# TAG: announce_port +# Set the port where announce registration messages will be sent. +# +# See also announce_host and announce_file +#Default: +# announce_port 3131 + +# HTTPD-ACCELERATOR OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: httpd_accel_surrogate_id +# Surrogates (http://www.esi.org/architecture_spec_1.0.html) +# need an identification token to allow control targeting. Because +# a farm of surrogates may all perform the same tasks, they may share +# an identification token. +#Default: +# visible_hostname is used if no specific ID is set. + +# TAG: http_accel_surrogate_remote on|off +# Remote surrogates (such as those in a CDN) honour the header +# "Surrogate-Control: no-store-remote". +# +# Set this to on to have squid behave as a remote surrogate. +#Default: +# http_accel_surrogate_remote off + +# TAG: esi_parser libxml2|expat|custom +# ESI markup is not strictly XML compatible. The custom ESI parser +# will give higher performance, but cannot handle non ASCII character +# encodings. +#Default: +# esi_parser custom + +# DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: delay_pools +# This represents the number of delay pools to be used. For example, +# if you have one class 2 delay pool and one class 3 delays pool, you +# have a total of 2 delay pools. +# +# See also delay_parameters, delay_class, delay_access for pool +# configuration details. +#Default: +# delay_pools 0 + +# TAG: delay_class +# This defines the class of each delay pool. There must be exactly one +# delay_class line for each delay pool. For example, to define two +# delay pools, one of class 2 and one of class 3, the settings above +# and here would be: +# +# Example: +# delay_pools 4 # 4 delay pools +# delay_class 1 2 # pool 1 is a class 2 pool +# delay_class 2 3 # pool 2 is a class 3 pool +# delay_class 3 4 # pool 3 is a class 4 pool +# delay_class 4 5 # pool 4 is a class 5 pool +# +# The delay pool classes are: +# +# class 1 Everything is limited by a single aggregate +# bucket. +# +# class 2 Everything is limited by a single aggregate +# bucket as well as an "individual" bucket chosen +# from bits 25 through 32 of the IPv4 address. +# +# class 3 Everything is limited by a single aggregate +# bucket as well as a "network" bucket chosen +# from bits 17 through 24 of the IP address and a +# "individual" bucket chosen from bits 17 through +# 32 of the IPv4 address. +# +# class 4 Everything in a class 3 delay pool, with an +# additional limit on a per user basis. This +# only takes effect if the username is established +# in advance - by forcing authentication in your +# http_access rules. +# +# class 5 Requests are grouped according their tag (see +# external_acl's tag= reply). +# +# +# Each pool also requires a delay_parameters directive to configure the pool size +# and speed limits used whenever the pool is applied to a request. Along with +# a set of delay_access directives to determine when it is used. +# +# NOTE: If an IP address is a.b.c.d +# -> bits 25 through 32 are "d" +# -> bits 17 through 24 are "c" +# -> bits 17 through 32 are "c * 256 + d" +# +# NOTE-2: Due to the use of bitmasks in class 2,3,4 pools they only apply to +# IPv4 traffic. Class 1 and 5 pools may be used with IPv6 traffic. +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +# See also delay_parameters and delay_access. +#Default: +# none + +# TAG: delay_access +# This is used to determine which delay pool a request falls into. +# +# delay_access is sorted per pool and the matching starts with pool 1, +# then pool 2, ..., and finally pool N. The first delay pool where the +# request is allowed is selected for the request. If it does not allow +# the request to any pool then the request is not delayed (default). +# +# For example, if you want some_big_clients in delay +# pool 1 and lotsa_little_clients in delay pool 2: +# +# delay_access 1 allow some_big_clients +# delay_access 1 deny all +# delay_access 2 allow lotsa_little_clients +# delay_access 2 deny all +# delay_access 3 allow authenticated_clients +# +# See also delay_parameters and delay_class. +# +#Default: +# Deny using the pool, unless allow rules exist in squid.conf for the pool. + +# TAG: delay_parameters +# This defines the parameters for a delay pool. Each delay pool has +# a number of "buckets" associated with it, as explained in the +# description of delay_class. +# +# For a class 1 delay pool, the syntax is: +# delay_class pool 1 +# delay_parameters pool aggregate +# +# For a class 2 delay pool: +# delay_class pool 2 +# delay_parameters pool aggregate individual +# +# For a class 3 delay pool: +# delay_class pool 3 +# delay_parameters pool aggregate network individual +# +# For a class 4 delay pool: +# delay_class pool 4 +# delay_parameters pool aggregate network individual user +# +# For a class 5 delay pool: +# delay_class pool 5 +# delay_parameters pool tagrate +# +# The option variables are: +# +# pool a pool number - ie, a number between 1 and the +# number specified in delay_pools as used in +# delay_class lines. +# +# aggregate the speed limit parameters for the aggregate bucket +# (class 1, 2, 3). +# +# individual the speed limit parameters for the individual +# buckets (class 2, 3). +# +# network the speed limit parameters for the network buckets +# (class 3). +# +# user the speed limit parameters for the user buckets +# (class 4). +# +# tagrate the speed limit parameters for the tag buckets +# (class 5). +# +# A pair of delay parameters is written restore/maximum, where restore is +# the number of bytes (not bits - modem and network speeds are usually +# quoted in bits) per second placed into the bucket, and maximum is the +# maximum number of bytes which can be in the bucket at any time. +# +# There must be one delay_parameters line for each delay pool. +# +# +# For example, if delay pool number 1 is a class 2 delay pool as in the +# above example, and is being used to strictly limit each host to 64Kbit/sec +# (plus overheads), with no overall limit, the line is: +# +# delay_parameters 1 none 8000/8000 +# +# Note that 8 x 8K Byte/sec -> 64K bit/sec. +# +# Note that the word 'none' is used to represent no limit. +# +# +# And, if delay pool number 2 is a class 3 delay pool as in the above +# example, and you want to limit it to a total of 256Kbit/sec (strict limit) +# with each 8-bit network permitted 64Kbit/sec (strict limit) and each +# individual host permitted 4800bit/sec with a bucket maximum size of 64Kbits +# to permit a decent web page to be downloaded at a decent speed +# (if the network is not being limited due to overuse) but slow down +# large downloads more significantly: +# +# delay_parameters 2 32000/32000 8000/8000 600/8000 +# +# Note that 8 x 32K Byte/sec -> 256K bit/sec. +# 8 x 8K Byte/sec -> 64K bit/sec. +# 8 x 600 Byte/sec -> 4800 bit/sec. +# +# +# Finally, for a class 4 delay pool as in the example - each user will +# be limited to 128Kbits/sec no matter how many workstations they are logged into.: +# +# delay_parameters 4 32000/32000 8000/8000 600/64000 16000/16000 +# +# +# See also delay_class and delay_access. +# +#Default: +# none + +# TAG: delay_initial_bucket_level (percent, 0-100) +# The initial bucket percentage is used to determine how much is put +# in each bucket when squid starts, is reconfigured, or first notices +# a host accessing it (in class 2 and class 3, individual hosts and +# networks only have buckets associated with them once they have been +# "seen" by squid). +#Default: +# delay_initial_bucket_level 50 + +# CLIENT DELAY POOL PARAMETERS +# ----------------------------------------------------------------------------- + +# TAG: client_delay_pools +# This option specifies the number of client delay pools used. It must +# preceed other client_delay_* options. +# +# Example: +# client_delay_pools 2 +# +# See also client_delay_parameters and client_delay_access. +#Default: +# client_delay_pools 0 + +# TAG: client_delay_initial_bucket_level (percent, 0-no_limit) +# This option determines the initial bucket size as a percentage of +# max_bucket_size from client_delay_parameters. Buckets are created +# at the time of the "first" connection from the matching IP. Idle +# buckets are periodically deleted up. +# +# You can specify more than 100 percent but note that such "oversized" +# buckets are not refilled until their size goes down to max_bucket_size +# from client_delay_parameters. +# +# Example: +# client_delay_initial_bucket_level 50 +#Default: +# client_delay_initial_bucket_level 50 + +# TAG: client_delay_parameters +# +# This option configures client-side bandwidth limits using the +# following format: +# +# client_delay_parameters pool speed_limit max_bucket_size +# +# pool is an integer ID used for client_delay_access matching. +# +# speed_limit is bytes added to the bucket per second. +# +# max_bucket_size is the maximum size of a bucket, enforced after any +# speed_limit additions. +# +# Please see the delay_parameters option for more information and +# examples. +# +# Example: +# client_delay_parameters 1 1024 2048 +# client_delay_parameters 2 51200 16384 +# +# See also client_delay_access. +# +#Default: +# none + +# TAG: client_delay_access +# This option determines the client-side delay pool for the +# request: +# +# client_delay_access pool_ID allow|deny acl_name +# +# All client_delay_access options are checked in their pool ID +# order, starting with pool 1. The first checked pool with allowed +# request is selected for the request. If no ACL matches or there +# are no client_delay_access options, the request bandwidth is not +# limited. +# +# The ACL-selected pool is then used to find the +# client_delay_parameters for the request. Client-side pools are +# not used to aggregate clients. Clients are always aggregated +# based on their source IP addresses (one bucket per source IP). +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# Additionally, only the client TCP connection details are available. +# ACLs testing HTTP properties will not work. +# +# Please see delay_access for more examples. +# +# Example: +# client_delay_access 1 allow low_rate_network +# client_delay_access 2 allow vips_network +# +# +# See also client_delay_parameters and client_delay_pools. +#Default: +# Deny use of the pool, unless allow rules exist in squid.conf for the pool. + +# WCCPv1 AND WCCPv2 CONFIGURATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: wccp_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCP disabled. + +# TAG: wccp2_router +# Use this option to define your WCCP ``home'' router for +# Squid. +# +# wccp_router supports a single WCCP(v1) router +# +# wccp2_router supports multiple WCCPv2 routers +# +# only one of the two may be used at the same time and defines +# which version of WCCP to use. +#Default: +# WCCPv2 disabled. + +# TAG: wccp_version +# This directive is only relevant if you need to set up WCCP(v1) +# to some very old and end-of-life Cisco routers. In all other +# setups it must be left unset or at the default setting. +# It defines an internal version in the WCCP(v1) protocol, +# with version 4 being the officially documented protocol. +# +# According to some users, Cisco IOS 11.2 and earlier only +# support WCCP version 3. If you're using that or an earlier +# version of IOS, you may need to change this value to 3, otherwise +# do not specify this parameter. +#Default: +# wccp_version 4 + +# TAG: wccp2_rebuild_wait +# If this is enabled Squid will wait for the cache dir rebuild to finish +# before sending the first wccp2 HereIAm packet +#Default: +# wccp2_rebuild_wait on + +# TAG: wccp2_forwarding_method +# WCCP2 allows the setting of forwarding methods between the +# router/switch and the cache. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment method. +#Default: +# wccp2_forwarding_method gre + +# TAG: wccp2_return_method +# WCCP2 allows the setting of return methods between the +# router/switch and the cache for packets that the cache +# decides not to handle. Valid values are as follows: +# +# gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) +# l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) +# +# Currently (as of IOS 12.4) cisco routers only support GRE. +# Cisco switches only support the L2 redirect assignment. +# +# If the "ip wccp redirect exclude in" command has been +# enabled on the cache interface, then it is still safe for +# the proxy server to use a l2 redirect method even if this +# option is set to GRE. +#Default: +# wccp2_return_method gre + +# TAG: wccp2_assignment_method +# WCCP2 allows the setting of methods to assign the WCCP hash +# Valid values are as follows: +# +# hash - Hash assignment +# mask - Mask assignment +# +# As a general rule, cisco routers support the hash assignment method +# and cisco switches support the mask assignment method. +#Default: +# wccp2_assignment_method hash + +# TAG: wccp2_service +# WCCP2 allows for multiple traffic services. There are two +# types: "standard" and "dynamic". The standard type defines +# one service id - http (id 0). The dynamic service ids can be from +# 51 to 255 inclusive. In order to use a dynamic service id +# one must define the type of traffic to be redirected; this is done +# using the wccp2_service_info option. +# +# The "standard" type does not require a wccp2_service_info option, +# just specifying the service id will suffice. +# +# MD5 service authentication can be enabled by adding +# "password=" to the end of this service declaration. +# +# Examples: +# +# wccp2_service standard 0 # for the 'web-cache' standard service +# wccp2_service dynamic 80 # a dynamic service type which will be +# # fleshed out with subsequent options. +# wccp2_service standard 0 password=foo +#Default: +# Use the 'web-cache' standard service. + +# TAG: wccp2_service_info +# Dynamic WCCPv2 services require further information to define the +# traffic you wish to have diverted. +# +# The format is: +# +# wccp2_service_info protocol= flags=,.. +# priority= ports=,.. +# +# The relevant WCCPv2 flags: +# + src_ip_hash, dst_ip_hash +# + source_port_hash, dst_port_hash +# + src_ip_alt_hash, dst_ip_alt_hash +# + src_port_alt_hash, dst_port_alt_hash +# + ports_source +# +# The port list can be one to eight entries. +# +# Example: +# +# wccp2_service_info 80 protocol=tcp flags=src_ip_hash,ports_source +# priority=240 ports=80 +# +# Note: the service id must have been defined by a previous +# 'wccp2_service dynamic ' entry. +#Default: +# none + +# TAG: wccp2_weight +# Each cache server gets assigned a set of the destination +# hash proportional to their weight. +#Default: +# wccp2_weight 10000 + +# TAG: wccp_address +# Use this option if you require WCCPv2 to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# TAG: wccp2_address +# Use this option if you require WCCP to use a specific +# interface address. +# +# The default behavior is to not bind to any specific address. +#Default: +# Address selected by the operating system. + +# PERSISTENT CONNECTION HANDLING +# ----------------------------------------------------------------------------- +# +# Also see "pconn_timeout" in the TIMEOUTS section + +# TAG: client_persistent_connections +# Persistent connection support for clients. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with clients. +#Default: +# client_persistent_connections on + +# TAG: server_persistent_connections +# Persistent connection support for servers. +# Squid uses persistent connections (when allowed). You can use +# this option to disable persistent connections with servers. +#Default: +# server_persistent_connections on + +# TAG: persistent_connection_after_error +# With this directive the use of persistent connections after +# HTTP errors can be disabled. Useful if you have clients +# who fail to handle errors on persistent connections proper. +#Default: +# persistent_connection_after_error on + +# TAG: detect_broken_pconn +# Some servers have been found to incorrectly signal the use +# of HTTP/1.0 persistent connections even on replies not +# compatible, causing significant delays. This server problem +# has mostly been seen on redirects. +# +# By enabling this directive Squid attempts to detect such +# broken replies and automatically assume the reply is finished +# after 10 seconds timeout. +#Default: +# detect_broken_pconn off + +# CACHE DIGEST OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: digest_generation +# This controls whether the server will generate a Cache Digest +# of its contents. By default, Cache Digest generation is +# enabled if Squid is compiled with --enable-cache-digests defined. +#Default: +# digest_generation on + +# TAG: digest_bits_per_entry +# This is the number of bits of the server's Cache Digest which +# will be associated with the Digest entry for a given HTTP +# Method and URL (public key) combination. The default is 5. +#Default: +# digest_bits_per_entry 5 + +# TAG: digest_rebuild_period (seconds) +# This is the wait time between Cache Digest rebuilds. +#Default: +# digest_rebuild_period 1 hour + +# TAG: digest_rewrite_period (seconds) +# This is the wait time between Cache Digest writes to +# disk. +#Default: +# digest_rewrite_period 1 hour + +# TAG: digest_swapout_chunk_size (bytes) +# This is the number of bytes of the Cache Digest to write to +# disk at a time. It defaults to 4096 bytes (4KB), the Squid +# default swap page. +#Default: +# digest_swapout_chunk_size 4096 bytes + +# TAG: digest_rebuild_chunk_percentage (percent, 0-100) +# This is the percentage of the Cache Digest to be scanned at a +# time. By default it is set to 10% of the Cache Digest. +#Default: +# digest_rebuild_chunk_percentage 10 + +# SNMP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: snmp_port +# The port number where Squid listens for SNMP requests. To enable +# SNMP support set this to a suitable port number. Port number +# 3401 is often used for the Squid SNMP agent. By default it's +# set to "0" (disabled) +# +# Example: +# snmp_port 3401 +#Default: +# SNMP disabled. + +# TAG: snmp_access +# Allowing or denying access to the SNMP port. +# +# All access to the agent is denied by default. +# usage: +# +# snmp_access allow|deny [!]aclname ... +# +# This clause only supports fast acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +# +#Example: +# snmp_access allow snmppublic localhost +# snmp_access deny all +#Default: +# Deny, unless rules exist in squid.conf. + +# TAG: snmp_incoming_address +# Just like 'udp_incoming_address', but for the SNMP port. +# +# snmp_incoming_address is used for the SNMP socket receiving +# messages from SNMP agents. +# +# The default snmp_incoming_address is to listen on all +# available network interfaces. +#Default: +# Accept SNMP packets from all machine interfaces. + +# TAG: snmp_outgoing_address +# Just like 'udp_outgoing_address', but for the SNMP port. +# +# snmp_outgoing_address is used for SNMP packets returned to SNMP +# agents. +# +# If snmp_outgoing_address is not set it will use the same socket +# as snmp_incoming_address. Only change this if you want to have +# SNMP replies sent using another address than where this Squid +# listens for SNMP queries. +# +# NOTE, snmp_incoming_address and snmp_outgoing_address can not have +# the same value since they both use the same port. +#Default: +# Use snmp_incoming_address or an address selected by the operating system. + +# ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icp_port +# The port number where Squid sends and receives ICP queries to +# and from neighbor caches. The standard UDP port for ICP is 3130. +# +# Example: +# icp_port 3130 +#Default: +# ICP disabled. + +# TAG: htcp_port +# The port number where Squid sends and receives HTCP queries to +# and from neighbor caches. To turn it on you want to set it to +# 4827. +# +# Example: +# htcp_port 4827 +#Default: +# HTCP disabled. + +# TAG: log_icp_queries on|off +# If set, ICP queries are logged to access.log. You may wish +# do disable this if your ICP load is VERY high to speed things +# up or to simplify log analysis. +#Default: +# log_icp_queries on + +# TAG: udp_incoming_address +# udp_incoming_address is used for UDP packets received from other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Only change this if you want to have all UDP queries received on +# a specific interface/address. +# +# NOTE: udp_incoming_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_outgoing_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Accept packets from all machine interfaces. + +# TAG: udp_outgoing_address +# udp_outgoing_address is used for UDP packets sent out to other +# caches. +# +# The default behavior is to not bind to any specific address. +# +# Instead it will use the same socket as udp_incoming_address. +# Only change this if you want to have UDP queries sent using another +# address than where this Squid listens for UDP queries from other +# caches. +# +# NOTE: udp_outgoing_address is used by the ICP, HTCP, and DNS +# modules. Altering it will affect all of them in the same manner. +# +# see also; udp_incoming_address +# +# NOTE, udp_incoming_address and udp_outgoing_address can not +# have the same value since they both use the same port. +#Default: +# Use udp_incoming_address or an address selected by the operating system. + +# TAG: icp_hit_stale on|off +# If you want to return ICP_HIT for stale cache objects, set this +# option to 'on'. If you have sibling relationships with caches +# in other administrative domains, this should be 'off'. If you only +# have sibling relationships with caches under your control, +# it is probably okay to set this to 'on'. +# If set to 'on', your siblings should use the option "allow-miss" +# on their cache_peer lines for connecting to you. +#Default: +# icp_hit_stale off + +# TAG: minimum_direct_hops +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many hops away. +#Default: +# minimum_direct_hops 4 + +# TAG: minimum_direct_rtt (msec) +# If using the ICMP pinging stuff, do direct fetches for sites +# which are no more than this many rtt milliseconds away. +#Default: +# minimum_direct_rtt 400 + +# TAG: netdb_low +# The low water mark for the ICMP measurement database. +# +# Note: high watermark controlled by netdb_high directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_low 900 + +# TAG: netdb_high +# The high water mark for the ICMP measurement database. +# +# Note: low watermark controlled by netdb_low directive. +# +# These watermarks are counts, not percents. The defaults are +# (low) 900 and (high) 1000. When the high water mark is +# reached, database entries will be deleted until the low +# mark is reached. +#Default: +# netdb_high 1000 + +# TAG: netdb_ping_period +# The minimum period for measuring a site. There will be at +# least this much delay between successive pings to the same +# network. The default is five minutes. +#Default: +# netdb_ping_period 5 minutes + +# TAG: query_icmp on|off +# If you want to ask your peers to include ICMP data in their ICP +# replies, enable this option. +# +# If your peer has configured Squid (during compilation) with +# '--enable-icmp' that peer will send ICMP pings to origin server +# sites of the URLs it receives. If you enable this option the +# ICP replies from that peer will include the ICMP data (if available). +# Then, when choosing a parent cache, Squid will choose the parent with +# the minimal RTT to the origin server. When this happens, the +# hierarchy field of the access.log will be +# "CLOSEST_PARENT_MISS". This option is off by default. +#Default: +# query_icmp off + +# TAG: test_reachability on|off +# When this is 'on', ICP MISS replies will be ICP_MISS_NOFETCH +# instead of ICP_MISS if the target host is NOT in the ICMP +# database, or has a zero RTT. +#Default: +# test_reachability off + +# TAG: icp_query_timeout (msec) +# Normally Squid will automatically determine an optimal ICP +# query timeout value based on the round-trip-time of recent ICP +# queries. If you want to override the value determined by +# Squid, set this 'icp_query_timeout' to a non-zero value. This +# value is specified in MILLISECONDS, so, to use a 2-second +# timeout (the old default), you would write: +# +# icp_query_timeout 2000 +#Default: +# Dynamic detection. + +# TAG: maximum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very large values (say 5 seconds). +# Use this option to put an upper limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# maximum_icp_query_timeout 2000 + +# TAG: minimum_icp_query_timeout (msec) +# Normally the ICP query timeout is determined dynamically. But +# sometimes it can lead to very small timeouts, even lower than +# the normal latency variance on your link due to traffic. +# Use this option to put an lower limit on the dynamic timeout +# value. Do NOT use this option to always use a fixed (instead +# of a dynamic) timeout value. To set a fixed timeout see the +# 'icp_query_timeout' directive. +#Default: +# minimum_icp_query_timeout 5 + +# TAG: background_ping_rate time-units +# Controls how often the ICP pings are sent to siblings that +# have background-ping set. +#Default: +# background_ping_rate 10 seconds + +# MULTICAST ICP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: mcast_groups +# This tag specifies a list of multicast groups which your server +# should join to receive multicasted ICP queries. +# +# NOTE! Be very careful what you put here! Be sure you +# understand the difference between an ICP _query_ and an ICP +# _reply_. This option is to be set only if you want to RECEIVE +# multicast queries. Do NOT set this option to SEND multicast +# ICP (use cache_peer for that). ICP replies are always sent via +# unicast, so this option does not affect whether or not you will +# receive replies from multicast group members. +# +# You must be very careful to NOT use a multicast address which +# is already in use by another group of caches. +# +# If you are unsure about multicast, please read the Multicast +# chapter in the Squid FAQ (http://www.squid-cache.org/FAQ/). +# +# Usage: mcast_groups 239.128.16.128 224.0.1.20 +# +# By default, Squid doesn't listen on any multicast groups. +#Default: +# none + +# TAG: mcast_miss_addr +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# If you enable this option, every "cache miss" URL will +# be sent out on the specified multicast address. +# +# Do not enable this option unless you are are absolutely +# certain you understand what you are doing. +#Default: +# disabled. + +# TAG: mcast_miss_ttl +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the time-to-live value for packets multicasted +# when multicasting off cache miss URLs is enabled. By +# default this is set to 'site scope', i.e. 16. +#Default: +# mcast_miss_ttl 16 + +# TAG: mcast_miss_port +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# This is the port number to be used in conjunction with +# 'mcast_miss_addr'. +#Default: +# mcast_miss_port 3135 + +# TAG: mcast_miss_encode_key +# Note: This option is only available if Squid is rebuilt with the +# -DMULTICAST_MISS_STREAM define +# +# The URLs that are sent in the multicast miss stream are +# encrypted. This is the encryption key. +#Default: +# mcast_miss_encode_key XXXXXXXXXXXXXXXX + +# TAG: mcast_icp_query_timeout (msec) +# For multicast peers, Squid regularly sends out ICP "probes" to +# count how many other peers are listening on the given multicast +# address. This value specifies how long Squid should wait to +# count all the replies. The default is 2000 msec, or 2 +# seconds. +#Default: +# mcast_icp_query_timeout 2000 + +# INTERNAL ICON OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icon_directory +# Where the icons are stored. These are normally kept in +# /usr/share/squid/icons +#Default: +# icon_directory /usr/share/squid/icons + +# TAG: global_internal_static +# This directive controls is Squid should intercept all requests for +# /squid-internal-static/ no matter which host the URL is requesting +# (default on setting), or if nothing special should be done for +# such URLs (off setting). The purpose of this directive is to make +# icons etc work better in complex cache hierarchies where it may +# not always be possible for all corners in the cache mesh to reach +# the server generating a directory listing. +#Default: +# global_internal_static on + +# TAG: short_icon_urls +# If this is enabled Squid will use short URLs for icons. +# If disabled it will revert to the old behavior of including +# it's own name and port in the URL. +# +# If you run a complex cache hierarchy with a mix of Squid and +# other proxies you may need to disable this directive. +#Default: +# short_icon_urls on + +# ERROR PAGE OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: error_directory +# If you wish to create your own versions of the default +# error files to customize them to suit your company copy +# the error/template files to another directory and point +# this tag at them. +# +# WARNING: This option will disable multi-language support +# on error pages if used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are making translations for a +# language that Squid does not currently provide please consider +# contributing your translation back to the project. +# http://wiki.squid-cache.org/Translations +# +# The squid developers working on translations are happy to supply drop-in +# translated error files in exchange for any new language contributions. +#Default: +# Send error pages in the clients preferred language + +# TAG: error_default_language +# Set the default language which squid will send error pages in +# if no existing translation matches the clients language +# preferences. +# +# If unset (default) generic English will be used. +# +# The squid developers are interested in making squid available in +# a wide variety of languages. If you are interested in making +# translations for any language see the squid wiki for details. +# http://wiki.squid-cache.org/Translations +#Default: +# Generate English language pages. + +# TAG: error_log_languages +# Log to cache.log what languages users are attempting to +# auto-negotiate for translations. +# +# Successful negotiations are not logged. Only failures +# have meaning to indicate that Squid may need an upgrade +# of its error page translations. +#Default: +# error_log_languages on + +# TAG: err_page_stylesheet +# CSS Stylesheet to pattern the display of Squid default error pages. +# +# For information on CSS see http://www.w3.org/Style/CSS/ +#Default: +# err_page_stylesheet /etc/squid/errorpage.css + +# TAG: err_html_text +# HTML text to include in error messages. Make this a "mailto" +# URL to your admin address, or maybe just a link to your +# organizations Web page. +# +# To include this in your error messages, you must rewrite +# the error template files (found in the "errors" directory). +# Wherever you want the 'err_html_text' line to appear, +# insert a %L tag in the error template file. +#Default: +# none + +# TAG: email_err_data on|off +# If enabled, information about the occurred error will be +# included in the mailto links of the ERR pages (if %W is set) +# so that the email body contains the data. +# Syntax is %w +#Default: +# email_err_data on + +# TAG: deny_info +# Usage: deny_info err_page_name acl +# or deny_info http://... acl +# or deny_info TCP_RESET acl +# +# This can be used to return a ERR_ page for requests which +# do not pass the 'http_access' rules. Squid remembers the last +# acl it evaluated in http_access, and if a 'deny_info' line exists +# for that ACL Squid returns a corresponding error page. +# +# The acl is typically the last acl on the http_access deny line which +# denied access. The exceptions to this rule are: +# - When Squid needs to request authentication credentials. It's then +# the first authentication related acl encountered +# - When none of the http_access lines matches. It's then the last +# acl processed on the last http_access line. +# - When the decision to deny access was made by an adaptation service, +# the acl name is the corresponding eCAP or ICAP service_name. +# +# NP: If providing your own custom error pages with error_directory +# you may also specify them by your custom file name: +# Example: deny_info ERR_CUSTOM_ACCESS_DENIED bad_guys +# +# By defaut Squid will send "403 Forbidden". A different 4xx or 5xx +# may be specified by prefixing the file name with the code and a colon. +# e.g. 404:ERR_CUSTOM_ACCESS_DENIED +# +# Alternatively you can tell Squid to reset the TCP connection +# by specifying TCP_RESET. +# +# Or you can specify an error URL or URL pattern. The browsers will +# get redirected to the specified URL after formatting tags have +# been replaced. Redirect will be done with 302 or 307 according to +# HTTP/1.1 specs. A different 3xx code may be specified by prefixing +# the URL. e.g. 303:http://example.com/ +# +# URL FORMAT TAGS: +# %a - username (if available. Password NOT included) +# %B - FTP path URL +# %e - Error number +# %E - Error description +# %h - Squid hostname +# %H - Request domain name +# %i - Client IP Address +# %M - Request Method +# %o - Message result from external ACL helper +# %p - Request Port number +# %P - Request Protocol name +# %R - Request URL path +# %T - Timestamp in RFC 1123 format +# %U - Full canonical URL from client +# (HTTPS URLs terminate with *) +# %u - Full canonical URL from client +# %w - Admin email from squid.conf +# %x - Error name +# %% - Literal percent (%) code +# +#Default: +# none + +# OPTIONS INFLUENCING REQUEST FORWARDING +# ----------------------------------------------------------------------------- + +# TAG: nonhierarchical_direct +# By default, Squid will send any non-hierarchical requests +# (not cacheable request type) direct to origin servers. +# +# When this is set to "off", Squid will prefer to send these +# requests to parents. +# +# Note that in most configurations, by turning this off you will only +# add latency to these request without any improvement in global hit +# ratio. +# +# This option only sets a preference. If the parent is unavailable a +# direct connection to the origin server may still be attempted. To +# completely prevent direct connections use never_direct. +#Default: +# nonhierarchical_direct on + +# TAG: prefer_direct +# Normally Squid tries to use parents for most requests. If you for some +# reason like it to first try going direct and only use a parent if +# going direct fails set this to on. +# +# By combining nonhierarchical_direct off and prefer_direct on you +# can set up Squid to use a parent as a backup path if going direct +# fails. +# +# Note: If you want Squid to use parents for all requests see +# the never_direct directive. prefer_direct only modifies how Squid +# acts on cacheable requests. +#Default: +# prefer_direct off + +# TAG: cache_miss_revalidate on|off +# RFC 7232 defines a conditional request mechanism to prevent +# response objects being unnecessarily transferred over the network. +# If that mechanism is used by the client and a cache MISS occurs +# it can prevent new cache entries being created. +# +# This option determines whether Squid on cache MISS will pass the +# client revalidation request to the server or tries to fetch new +# content for caching. It can be useful while the cache is mostly +# empty to more quickly have the cache populated by generating +# non-conditional GETs. +# +# When set to 'on' (default), Squid will pass all client If-* headers +# to the server. This permits server responses without a cacheable +# payload to be delivered and on MISS no new cache entry is created. +# +# When set to 'off' and if the request is cacheable, Squid will +# remove the clients If-Modified-Since and If-None-Match headers from +# the request sent to the server. This requests a 200 status response +# from the server to create a new cache entry with. +#Default: +# cache_miss_revalidate on + +# TAG: always_direct +# Usage: always_direct allow|deny [!]aclname ... +# +# Here you can use ACL elements to specify requests which should +# ALWAYS be forwarded by Squid to the origin servers without using +# any peers. For example, to always directly forward requests for +# local servers ignoring any parents or siblings you may have use +# something like: +# +# acl local-servers dstdomain my.domain.net +# always_direct allow local-servers +# +# To always forward FTP requests directly, use +# +# acl FTP proto FTP +# always_direct allow FTP +# +# NOTE: There is a similar, but opposite option named +# 'never_direct'. You need to be aware that "always_direct deny +# foo" is NOT the same thing as "never_direct allow foo". You +# may need to use a deny rule to exclude a more-specific case of +# some other rule. Example: +# +# acl local-external dstdomain external.foo.net +# acl local-servers dstdomain .foo.net +# always_direct deny local-external +# always_direct allow local-servers +# +# NOTE: If your goal is to make the client forward the request +# directly to the origin server bypassing Squid then this needs +# to be done in the client configuration. Squid configuration +# can only tell Squid how Squid should fetch the object. +# +# NOTE: This directive is not related to caching. The replies +# is cached as usual even if you use always_direct. To not cache +# the replies see the 'cache' directive. +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Prevent any cache_peer being used for this request. + +# TAG: never_direct +# Usage: never_direct allow|deny [!]aclname ... +# +# never_direct is the opposite of always_direct. Please read +# the description for always_direct if you have not already. +# +# With 'never_direct' you can use ACL elements to specify +# requests which should NEVER be forwarded directly to origin +# servers. For example, to force the use of a proxy for all +# requests, except those in your local domain use something like: +# +# acl local-servers dstdomain .foo.net +# never_direct deny local-servers +# never_direct allow all +# +# or if Squid is inside a firewall and there are local intranet +# servers inside the firewall use something like: +# +# acl local-intranet dstdomain .foo.net +# acl local-external dstdomain external.foo.net +# always_direct deny local-external +# always_direct allow local-intranet +# never_direct allow all +# +# This clause supports both fast and slow acl types. +# See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details. +#Default: +# Allow DNS results to be used for this request. + +# ADVANCED NETWORKING OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: incoming_udp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_udp_average 6 + +# TAG: incoming_tcp_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_tcp_average 4 + +# TAG: incoming_dns_average +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# incoming_dns_average 4 + +# TAG: min_udp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_udp_poll_cnt 8 + +# TAG: min_dns_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_dns_poll_cnt 8 + +# TAG: min_tcp_poll_cnt +# Heavy voodoo here. I can't even believe you are reading this. +# Are you crazy? Don't even think about adjusting these unless +# you understand the algorithms in comm_select.c first! +#Default: +# min_tcp_poll_cnt 8 + +# TAG: accept_filter +# FreeBSD: +# +# The name of an accept(2) filter to install on Squid's +# listen socket(s). This feature is perhaps specific to +# FreeBSD and requires support in the kernel. +# +# The 'httpready' filter delays delivering new connections +# to Squid until a full HTTP request has been received. +# See the accf_http(9) man page for details. +# +# The 'dataready' filter delays delivering new connections +# to Squid until there is some data to process. +# See the accf_dataready(9) man page for details. +# +# Linux: +# +# The 'data' filter delays delivering of new connections +# to Squid until there is some data to process by TCP_ACCEPT_DEFER. +# You may optionally specify a number of seconds to wait by +# 'data=N' where N is the number of seconds. Defaults to 30 +# if not specified. See the tcp(7) man page for details. +#EXAMPLE: +## FreeBSD +#accept_filter httpready +## Linux +#accept_filter data +#Default: +# none + +# TAG: client_ip_max_connections +# Set an absolute limit on the number of connections a single +# client IP can use. Any more than this and Squid will begin to drop +# new connections from the client until it closes some links. +# +# Note that this is a global limit. It affects all HTTP, HTCP, Gopher and FTP +# connections from the client. For finer control use the ACL access controls. +# +# Requires client_db to be enabled (the default). +# +# WARNING: This may noticably slow down traffic received via external proxies +# or NAT devices and cause them to rebound error messages back to their clients. +#Default: +# No limit. + +# TAG: tcp_recv_bufsize (bytes) +# Size of receive buffer to set for TCP sockets. Probably just +# as easy to change your kernel's default. +# Omit from squid.conf to use the default buffer size. +#Default: +# Use operating system TCP defaults. + +# ICAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: icap_enable on|off +# If you want to enable the ICAP module support, set this to on. +#Default: +# icap_enable off + +# TAG: icap_connect_timeout +# This parameter specifies how long to wait for the TCP connect to +# the requested ICAP server to complete before giving up and either +# terminating the HTTP transaction or bypassing the failure. +# +# The default for optional services is peer_connect_timeout. +# The default for essential services is connect_timeout. +# If this option is explicitly set, its value applies to all services. +#Default: +# none + +# TAG: icap_io_timeout time-units +# This parameter specifies how long to wait for an I/O activity on +# an established, active ICAP connection before giving up and +# either terminating the HTTP transaction or bypassing the +# failure. +#Default: +# Use read_timeout. + +# TAG: icap_service_failure_limit limit [in memory-depth time-units] +# The limit specifies the number of failures that Squid tolerates +# when establishing a new TCP connection with an ICAP service. If +# the number of failures exceeds the limit, the ICAP service is +# not used for new ICAP requests until it is time to refresh its +# OPTIONS. +# +# A negative value disables the limit. Without the limit, an ICAP +# service will not be considered down due to connectivity failures +# between ICAP OPTIONS requests. +# +# Squid forgets ICAP service failures older than the specified +# value of memory-depth. The memory fading algorithm +# is approximate because Squid does not remember individual +# errors but groups them instead, splitting the option +# value into ten time slots of equal length. +# +# When memory-depth is 0 and by default this option has no +# effect on service failure expiration. +# +# Squid always forgets failures when updating service settings +# using an ICAP OPTIONS transaction, regardless of this option +# setting. +# +# For example, +# # suspend service usage after 10 failures in 5 seconds: +# icap_service_failure_limit 10 in 5 seconds +#Default: +# icap_service_failure_limit 10 + +# TAG: icap_service_revival_delay +# The delay specifies the number of seconds to wait after an ICAP +# OPTIONS request failure before requesting the options again. The +# failed ICAP service is considered "down" until fresh OPTIONS are +# fetched. +# +# The actual delay cannot be smaller than the hardcoded minimum +# delay of 30 seconds. +#Default: +# icap_service_revival_delay 180 + +# TAG: icap_preview_enable on|off +# The ICAP Preview feature allows the ICAP server to handle the +# HTTP message by looking only at the beginning of the message body +# or even without receiving the body at all. In some environments, +# previews greatly speedup ICAP processing. +# +# During an ICAP OPTIONS transaction, the server may tell Squid what +# HTTP messages should be previewed and how big the preview should be. +# Squid will not use Preview if the server did not request one. +# +# To disable ICAP Preview for all ICAP services, regardless of +# individual ICAP server OPTIONS responses, set this option to "off". +#Example: +#icap_preview_enable off +#Default: +# icap_preview_enable on + +# TAG: icap_preview_size +# The default size of preview data to be sent to the ICAP server. +# This value might be overwritten on a per server basis by OPTIONS requests. +#Default: +# No preview sent. + +# TAG: icap_206_enable on|off +# 206 (Partial Content) responses is an ICAP extension that allows the +# ICAP agents to optionally combine adapted and original HTTP message +# content. The decision to combine is postponed until the end of the +# ICAP response. Squid supports Partial Content extension by default. +# +# Activation of the Partial Content extension is negotiated with each +# ICAP service during OPTIONS exchange. Most ICAP servers should handle +# negotation correctly even if they do not support the extension, but +# some might fail. To disable Partial Content support for all ICAP +# services and to avoid any negotiation, set this option to "off". +# +# Example: +# icap_206_enable off +#Default: +# icap_206_enable on + +# TAG: icap_default_options_ttl +# The default TTL value for ICAP OPTIONS responses that don't have +# an Options-TTL header. +#Default: +# icap_default_options_ttl 60 + +# TAG: icap_persistent_connections on|off +# Whether or not Squid should use persistent connections to +# an ICAP server. +#Default: +# icap_persistent_connections on + +# TAG: adaptation_send_client_ip on|off +# If enabled, Squid shares HTTP client IP information with adaptation +# services. For ICAP, Squid adds the X-Client-IP header to ICAP requests. +# For eCAP, Squid sets the libecap::metaClientIp transaction option. +# +# See also: adaptation_uses_indirect_client +#Default: +# adaptation_send_client_ip off + +# TAG: adaptation_send_username on|off +# This sends authenticated HTTP client username (if available) to +# the adaptation service. +# +# For ICAP, the username value is encoded based on the +# icap_client_username_encode option and is sent using the header +# specified by the icap_client_username_header option. +#Default: +# adaptation_send_username off + +# TAG: icap_client_username_header +# ICAP request header name to use for adaptation_send_username. +#Default: +# icap_client_username_header X-Client-Username + +# TAG: icap_client_username_encode on|off +# Whether to base64 encode the authenticated client username. +#Default: +# icap_client_username_encode off + +# TAG: icap_service +# Defines a single ICAP service using the following format: +# +# icap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# ICAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: icap://servername:port/servicepath +# ICAP server and service location. +# +# ICAP does not allow a single service to handle both REQMOD and RESPMOD +# transactions. Squid does not enforce that requirement. You can specify +# services with the same service_url and different vectoring_points. You +# can even specify multiple identical services as long as their +# service_names differ. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. ICAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the ICAP service is treated as +# optional. If the service cannot be reached or malfunctions, +# Squid will try to ignore any errors and process the message as +# if the service was not enabled. No all ICAP errors can be +# bypassed. If set to 0, the ICAP service is treated as +# essential and all ICAP errors will result in an error page +# returned to the HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the ICAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. The services +# are specified using the X-Next-Services ICAP response header +# value, formatted as a comma-separated list of service names. +# Each named service should be configured in squid.conf. Other +# services are ignored. An empty X-Next-Services value results +# in an empty plan which ends the current adaptation. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default: the ICAP X-Next-Services +# response header is ignored. +# +# ipv6=on|off +# Only has effect on split-stack systems. The default on those systems +# is to use IPv4-only connections. When set to 'on' this option will +# make Squid use IPv6-only connections to contact this ICAP service. +# +# on-overload=block|bypass|wait|force +# If the service Max-Connections limit has been reached, do +# one of the following for each new ICAP transaction: +# * block: send an HTTP error response to the client +# * bypass: ignore the "over-connected" ICAP service +# * wait: wait (in a FIFO queue) for an ICAP connection slot +# * force: proceed, ignoring the Max-Connections limit +# +# In SMP mode with N workers, each worker assumes the service +# connection limit is Max-Connections/N, even though not all +# workers may use a given service. +# +# The default value is "bypass" if service is bypassable, +# otherwise it is set to "wait". +# +# +# max-conn=number +# Use the given number as the Max-Connections limit, regardless +# of the Max-Connections value given by the service, if any. +# +# Older icap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +#Example: +#icap_service svcBlocker reqmod_precache icap://icap1.mydomain.net:1344/reqmod bypass=0 +#icap_service svcLogger reqmod_precache icap://icap2.mydomain.net:1344/respmod routing=on +#Default: +# none + +# TAG: icap_class +# This deprecated option was documented to define an ICAP service +# chain, even though it actually defined a set of similar, redundant +# services, and the chains were not supported. +# +# To define a set of redundant services, please use the +# adaptation_service_set directive. For service chains, use +# adaptation_service_chain. +#Default: +# none + +# TAG: icap_access +# This option is deprecated. Please use adaptation_access, which +# has the same ICAP functionality, but comes with better +# documentation, and eCAP support. +#Default: +# none + +# eCAP OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: ecap_enable on|off +# Controls whether eCAP support is enabled. +#Default: +# ecap_enable off + +# TAG: ecap_service +# Defines a single eCAP service +# +# ecap_service id vectoring_point uri [option ...] +# +# id: ID +# an opaque identifier or name which is used to direct traffic to +# this specific service. Must be unique among all adaptation +# services in squid.conf. +# +# vectoring_point: reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache +# This specifies at which point of transaction processing the +# eCAP service should be activated. *_postcache vectoring points +# are not yet supported. +# +# uri: ecap://vendor/service_name?custom&cgi=style¶meters=optional +# Squid uses the eCAP service URI to match this configuration +# line with one of the dynamically loaded services. Each loaded +# eCAP service must have a unique URI. Obtain the right URI from +# the service provider. +# +# To activate a service, use the adaptation_access directive. To group +# services, use adaptation_service_chain and adaptation_service_set. +# +# Service options are separated by white space. eCAP services support +# the following name=value options: +# +# bypass=on|off|1|0 +# If set to 'on' or '1', the eCAP service is treated as optional. +# If the service cannot be reached or malfunctions, Squid will try +# to ignore any errors and process the message as if the service +# was not enabled. No all eCAP errors can be bypassed. +# If set to 'off' or '0', the eCAP service is treated as essential +# and all eCAP errors will result in an error page returned to the +# HTTP client. +# +# Bypass is off by default: services are treated as essential. +# +# routing=on|off|1|0 +# If set to 'on' or '1', the eCAP service is allowed to +# dynamically change the current message adaptation plan by +# returning a chain of services to be used next. +# +# Dynamic adaptation plan may cross or cover multiple supported +# vectoring points in their natural processing order. +# +# Routing is not allowed by default. +# +# Older ecap_service format without optional named parameters is +# deprecated but supported for backward compatibility. +# +# +#Example: +#ecap_service s1 reqmod_precache ecap://filters.R.us/leakDetector?on_error=block bypass=off +#ecap_service s2 respmod_precache ecap://filters.R.us/virusFilter config=/etc/vf.cfg bypass=on +#Default: +# none + +# TAG: loadable_modules +# Instructs Squid to load the specified dynamic module(s) or activate +# preloaded module(s). +#Example: +#loadable_modules /usr/lib/MinimalAdapter.so +#Default: +# none + +# MESSAGE ADAPTATION OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: adaptation_service_set +# +# Configures an ordered set of similar, redundant services. This is +# useful when hot standby or backup adaptation servers are available. +# +# adaptation_service_set set_name service_name1 service_name2 ... +# +# The named services are used in the set declaration order. The first +# applicable adaptation service from the set is used first. The next +# applicable service is tried if and only if the transaction with the +# previous service fails and the message waiting to be adapted is still +# intact. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the set. A broken service is a down optional service. +# +# The services in a set must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# If all services in a set are optional then adaptation failures are +# bypassable. If all services in the set are essential, then a +# transaction failure with one service may still be retried using +# another service from the set, but when all services fail, the master +# transaction fails as well. +# +# A set may contain a mix of optional and essential services, but that +# is likely to lead to surprising results because broken services become +# ignored (see above), making previously bypassable failures fatal. +# Technically, it is the bypassability of the last failed service that +# matters. +# +# See also: adaptation_access adaptation_service_chain +# +#Example: +#adaptation_service_set svcBlocker urlFilterPrimary urlFilterBackup +#adaptation service_set svcLogger loggerLocal loggerRemote +#Default: +# none + +# TAG: adaptation_service_chain +# +# Configures a list of complementary services that will be applied +# one-by-one, forming an adaptation chain or pipeline. This is useful +# when Squid must perform different adaptations on the same message. +# +# adaptation_service_chain chain_name service_name1 svc_name2 ... +# +# The named services are used in the chain declaration order. The first +# applicable adaptation service from the chain is used first. The next +# applicable service is applied to the successful adaptation results of +# the previous service in the chain. +# +# When adaptation starts, broken services are ignored as if they were +# not a part of the chain. A broken service is a down optional service. +# +# Request satisfaction terminates the adaptation chain because Squid +# does not currently allow declaration of RESPMOD services at the +# "reqmod_precache" vectoring point (see icap_service or ecap_service). +# +# The services in a chain must be attached to the same vectoring point +# (e.g., pre-cache) and use the same adaptation method (e.g., REQMOD). +# +# A chain may contain a mix of optional and essential services. If an +# essential adaptation fails (or the failure cannot be bypassed for +# other reasons), the master transaction fails. Otherwise, the failure +# is bypassed as if the failed adaptation service was not in the chain. +# +# See also: adaptation_access adaptation_service_set +# +#Example: +#adaptation_service_chain svcRequest requestLogger urlFilter leakDetector +#Default: +# none + +# TAG: adaptation_access +# Sends an HTTP transaction to an ICAP or eCAP adaptation service. +# +# adaptation_access service_name allow|deny [!]aclname... +# adaptation_access set_name allow|deny [!]aclname... +# +# At each supported vectoring point, the adaptation_access +# statements are processed in the order they appear in this +# configuration file. Statements pointing to the following services +# are ignored (i.e., skipped without checking their ACL): +# +# - services serving different vectoring points +# - "broken-but-bypassable" services +# - "up" services configured to ignore such transactions +# (e.g., based on the ICAP Transfer-Ignore header). +# +# When a set_name is used, all services in the set are checked +# using the same rules, to find the first applicable one. See +# adaptation_service_set for details. +# +# If an access list is checked and there is a match, the +# processing stops: For an "allow" rule, the corresponding +# adaptation service is used for the transaction. For a "deny" +# rule, no adaptation service is activated. +# +# It is currently not possible to apply more than one adaptation +# service at the same vectoring point to the same HTTP transaction. +# +# See also: icap_service and ecap_service +# +#Example: +#adaptation_access service_1 allow all +#Default: +# Allow, unless rules exist in squid.conf. + +# TAG: adaptation_service_iteration_limit +# Limits the number of iterations allowed when applying adaptation +# services to a message. If your longest adaptation set or chain +# may have more than 16 services, increase the limit beyond its +# default value of 16. If detecting infinite iteration loops sooner +# is critical, make the iteration limit match the actual number +# of services in your longest adaptation set or chain. +# +# Infinite adaptation loops are most likely with routing services. +# +# See also: icap_service routing=1 +#Default: +# adaptation_service_iteration_limit 16 + +# TAG: adaptation_masterx_shared_names +# For each master transaction (i.e., the HTTP request and response +# sequence, including all related ICAP and eCAP exchanges), Squid +# maintains a table of metadata. The table entries are (name, value) +# pairs shared among eCAP and ICAP exchanges. The table is destroyed +# with the master transaction. +# +# This option specifies the table entry names that Squid must accept +# from and forward to the adaptation transactions. +# +# An ICAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by returning an ICAP header field with a name +# specified in adaptation_masterx_shared_names. +# +# An eCAP REQMOD or RESPMOD transaction may set an entry in the +# shared table by implementing the libecap::visitEachOption() API +# to provide an option with a name specified in +# adaptation_masterx_shared_names. +# +# Squid will store and forward the set entry to subsequent adaptation +# transactions within the same master transaction scope. +# +# Only one shared entry name is supported at this time. +# +#Example: +## share authentication information among ICAP services +#adaptation_masterx_shared_names X-Subscriber-ID +#Default: +# none + +# TAG: adaptation_meta +# This option allows Squid administrator to add custom ICAP request +# headers or eCAP options to Squid ICAP requests or eCAP transactions. +# Use it to pass custom authentication tokens and other +# transaction-state related meta information to an ICAP/eCAP service. +# +# The addition of a meta header is ACL-driven: +# adaptation_meta name value [!]aclname ... +# +# Processing for a given header name stops after the first ACL list match. +# Thus, it is impossible to add two headers with the same name. If no ACL +# lists match for a given header name, no such header is added. For +# example: +# +# # do not debug transactions except for those that need debugging +# adaptation_meta X-Debug 1 needs_debugging +# +# # log all transactions except for those that must remain secret +# adaptation_meta X-Log 1 !keep_secret +# +# # mark transactions from users in the "G 1" group +# adaptation_meta X-Authenticated-Groups "G 1" authed_as_G1 +# +# The "value" parameter may be a regular squid.conf token or a "double +# quoted string". Within the quoted string, use backslash (\) to escape +# any character, which is currently only useful for escaping backslashes +# and double quotes. For example, +# "this string has one backslash (\\) and two \"quotes\"" +# +# Used adaptation_meta header values may be logged via %note +# logformat code. If multiple adaptation_meta headers with the same name +# are used during master transaction lifetime, the header values are +# logged in the order they were used and duplicate values are ignored +# (only the first repeated value will be logged). +#Default: +# none + +# TAG: icap_retry +# This ACL determines which retriable ICAP transactions are +# retried. Transactions that received a complete ICAP response +# and did not have to consume or produce HTTP bodies to receive +# that response are usually retriable. +# +# icap_retry allow|deny [!]aclname ... +# +# Squid automatically retries some ICAP I/O timeouts and errors +# due to persistent connection race conditions. +# +# See also: icap_retry_limit +#Default: +# icap_retry deny all + +# TAG: icap_retry_limit +# Limits the number of retries allowed. +# +# Communication errors due to persistent connection race +# conditions are unavoidable, automatically retried, and do not +# count against this limit. +# +# See also: icap_retry +#Default: +# No retries are allowed. + +# DNS OPTIONS +# ----------------------------------------------------------------------------- + +# TAG: check_hostnames +# For security and stability reasons Squid can check +# hostnames for Internet standard RFC compliance. If you want +# Squid to perform these checks turn this directive on. +#Default: +# check_hostnames off + +# TAG: allow_underscore +# Underscore characters is not strictly allowed in Internet hostnames +# but nevertheless used by many sites. Set this to off if you want +# Squid to be strict about the standard. +# This check is performed only when check_hostnames is set to on. +#Default: +# allow_underscore on + +# TAG: dns_retransmit_interval +# Initial retransmit interval for DNS queries. The interval is +# doubled each time all configured DNS servers have been tried. +#Default: +# dns_retransmit_interval 5 seconds + +# TAG: dns_timeout +# DNS Query timeout. If no response is received to a DNS query +# within this time all DNS servers for the queried domain +# are assumed to be unavailable. +#Default: +# dns_timeout 30 seconds + +# TAG: dns_packet_max +# Maximum number of bytes packet size to advertise via EDNS. +# Set to "none" to disable EDNS large packet support. +# +# For legacy reasons DNS UDP replies will default to 512 bytes which +# is too small for many responses. EDNS provides a means for Squid to +# negotiate receiving larger responses back immediately without having +# to failover with repeat requests. Responses larger than this limit +# will retain the old behaviour of failover to TCP DNS. +# +# Squid has no real fixed limit internally, but allowing packet sizes +# over 1500 bytes requires network jumbogram support and is usually not +# necessary. +# +# WARNING: The RFC also indicates that some older resolvers will reply +# with failure of the whole request if the extension is added. Some +# resolvers have already been identified which will reply with mangled +# EDNS response on occasion. Usually in response to many-KB jumbogram +# sizes being advertised by Squid. +# Squid will currently treat these both as an unable-to-resolve domain +# even if it would be resolvable without EDNS. +#Default: +# EDNS disabled + +# TAG: dns_defnames on|off +# Normally the RES_DEFNAMES resolver option is disabled +# (see res_init(3)). This prevents caches in a hierarchy +# from interpreting single-component hostnames locally. To allow +# Squid to handle single-component names, enable this option. +#Default: +# Search for single-label domain names is disabled. + +# TAG: dns_multicast_local on|off +# When set to on, Squid sends multicast DNS lookups on the local +# network for domains ending in .local and .arpa. +# This enables local servers and devices to be contacted in an +# ad-hoc or zero-configuration network environment. +#Default: +# Search for .local and .arpa names is disabled. + +# TAG: dns_nameservers +# Use this if you want to specify a list of DNS name servers +# (IP addresses) to use instead of those given in your +# /etc/resolv.conf file. +# +# On Windows platforms, if no value is specified here or in +# the /etc/resolv.conf file, the list of DNS name servers are +# taken from the Windows registry, both static and dynamic DHCP +# configurations are supported. +# +# Example: dns_nameservers 10.0.0.1 192.172.0.4 +#Default: +# Use operating system definitions + +# TAG: hosts_file +# Location of the host-local IP name-address associations +# database. Most Operating Systems have such a file on different +# default locations: +# - Un*X & Linux: /etc/hosts +# - Windows NT/2000: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\winnt) +# - Windows XP/2003: %SystemRoot%\system32\drivers\etc\hosts +# (%SystemRoot% value install default is c:\windows) +# - Windows 9x/Me: %windir%\hosts +# (%windir% value is usually c:\windows) +# - Cygwin: /etc/hosts +# +# The file contains newline-separated definitions, in the +# form ip_address_in_dotted_form name [name ...] names are +# whitespace-separated. Lines beginning with an hash (#) +# character are comments. +# +# The file is checked at startup and upon configuration. +# If set to 'none', it won't be checked. +# If append_domain is used, that domain will be added to +# domain-local (i.e. not containing any dot character) host +# definitions. +#Default: +# hosts_file /etc/hosts + +# TAG: append_domain +# Appends local domain name to hostnames without any dots in +# them. append_domain must begin with a period. +# +# Be warned there are now Internet names with no dots in +# them using only top-domain names, so setting this may +# cause some Internet sites to become unavailable. +# +#Example: +# append_domain .yourdomain.com +#Default: +# Use operating system definitions + +# TAG: ignore_unknown_nameservers +# By default Squid checks that DNS responses are received +# from the same IP addresses they are sent to. If they +# don't match, Squid ignores the response and writes a warning +# message to cache.log. You can allow responses from unknown +# nameservers by setting this option to 'off'. +#Default: +# ignore_unknown_nameservers on + +# TAG: dns_v4_first +# With the IPv6 Internet being as fast or faster than IPv4 Internet +# for most networks Squid prefers to contact websites over IPv6. +# +# This option reverses the order of preference to make Squid contact +# dual-stack websites over IPv4 first. Squid will still perform both +# IPv6 and IPv4 DNS lookups before connecting. +# +# WARNING: +# This option will restrict the situations under which IPv6 +# connectivity is used (and tested), potentially hiding network +# problems which would otherwise be detected and warned about. +#Default: +# dns_v4_first off + +# TAG: ipcache_size (number of entries) +# Maximum number of DNS IP cache entries. +#Default: +# ipcache_size 1024 + +# TAG: ipcache_low (percent) +#Default: +# ipcache_low 90 + +# TAG: ipcache_high (percent) +# The size, low-, and high-water marks for the IP cache. +#Default: +# ipcache_high 95 + +# TAG: fqdncache_size (number of entries) +# Maximum number of FQDN cache entries. +#Default: +# fqdncache_size 1024 + +# MISCELLANEOUS +# ----------------------------------------------------------------------------- + +# TAG: configuration_includes_quoted_values on|off +# If set, Squid will recognize each "quoted string" after a configuration +# directive as a single parameter. The quotes are stripped before the +# parameter value is interpreted or used. +# See "Values with spaces, quotes, and other special characters" +# section for more details. +#Default: +# configuration_includes_quoted_values off + +# TAG: memory_pools on|off +# If set, Squid will keep pools of allocated (but unused) memory +# available for future use. If memory is a premium on your +# system and you believe your malloc library outperforms Squid +# routines, disable this. +#Default: +# memory_pools on + +# TAG: memory_pools_limit (bytes) +# Used only with memory_pools on: +# memory_pools_limit 50 MB +# +# If set to a non-zero value, Squid will keep at most the specified +# limit of allocated (but unused) memory in memory pools. All free() +# requests that exceed this limit will be handled by your malloc +# library. Squid does not pre-allocate any memory, just safe-keeps +# objects that otherwise would be free()d. Thus, it is safe to set +# memory_pools_limit to a reasonably high value even if your +# configuration will use less memory. +# +# If set to none, Squid will keep all memory it can. That is, there +# will be no limit on the total amount of memory used for safe-keeping. +# +# To disable memory allocation optimization, do not set +# memory_pools_limit to 0 or none. Set memory_pools to "off" instead. +# +# An overhead for maintaining memory pools is not taken into account +# when the limit is checked. This overhead is close to four bytes per +# object kept. However, pools may actually _save_ memory because of +# reduced memory thrashing in your malloc library. +#Default: +# memory_pools_limit 5 MB + +# TAG: forwarded_for on|off|transparent|truncate|delete +# If set to "on", Squid will append your client's IP address +# in the HTTP requests it forwards. By default it looks like: +# +# X-Forwarded-For: 192.1.2.3 +# +# If set to "off", it will appear as +# +# X-Forwarded-For: unknown +# +# If set to "transparent", Squid will not alter the +# X-Forwarded-For header in any way. +# +# If set to "delete", Squid will delete the entire +# X-Forwarded-For header. +# +# If set to "truncate", Squid will remove all existing +# X-Forwarded-For entries, and place the client IP as the sole entry. +#Default: +# forwarded_for on + +# TAG: cachemgr_passwd +# Specify passwords for cachemgr operations. +# +# Usage: cachemgr_passwd password action action ... +# +# Some valid actions are (see cache manager menu for a full list): +# 5min +# 60min +# asndb +# authenticator +# cbdata +# client_list +# comm_incoming +# config * +# counters +# delay +# digest_stats +# dns +# events +# filedescriptors +# fqdncache +# histograms +# http_headers +# info +# io +# ipcache +# mem +# menu +# netdb +# non_peers +# objects +# offline_toggle * +# pconn +# peer_select +# reconfigure * +# redirector +# refresh +# server_list +# shutdown * +# store_digest +# storedir +# utilization +# via_headers +# vm_objects +# +# * Indicates actions which will not be performed without a +# valid password, others can be performed if not listed here. +# +# To disable an action, set the password to "disable". +# To allow performing an action without a password, set the +# password to "none". +# +# Use the keyword "all" to set the same password for all actions. +# +#Example: +# cachemgr_passwd secret shutdown +# cachemgr_passwd lesssssssecret info stats/objects +# cachemgr_passwd disable all +#Default: +# No password. Actions which require password are denied. + +# TAG: client_db on|off +# If you want to disable collecting per-client statistics, +# turn off client_db here. +#Default: +# client_db on + +# TAG: refresh_all_ims on|off +# When you enable this option, squid will always check +# the origin server for an update when a client sends an +# If-Modified-Since request. Many browsers use IMS +# requests when the user requests a reload, and this +# ensures those clients receive the latest version. +# +# By default (off), squid may return a Not Modified response +# based on the age of the cached version. +#Default: +# refresh_all_ims off + +# TAG: reload_into_ims on|off +# When you enable this option, client no-cache or ``reload'' +# requests will be changed to If-Modified-Since requests. +# Doing this VIOLATES the HTTP standard. Enabling this +# feature could make you liable for problems which it +# causes. +# +# see also refresh_pattern for a more selective approach. +#Default: +# reload_into_ims off + +# TAG: connect_retries +# This sets the maximum number of connection attempts made for each +# TCP connection. The connect_retries attempts must all still +# complete within the connection timeout period. +# +# The default is not to re-try if the first connection attempt fails. +# The (not recommended) maximum is 10 tries. +# +# A warning message will be generated if it is set to a too-high +# value and the configured value will be over-ridden. +# +# Note: These re-tries are in addition to forward_max_tries +# which limit how many different addresses may be tried to find +# a useful server. +#Default: +# Do not retry failed connections. + +# TAG: retry_on_error +# If set to ON Squid will automatically retry requests when +# receiving an error response with status 403 (Forbidden), +# 500 (Internal Error), 501 or 503 (Service not available). +# Status 502 and 504 (Gateway errors) are always retried. +# +# This is mainly useful if you are in a complex cache hierarchy to +# work around access control errors. +# +# NOTE: This retry will attempt to find another working destination. +# Which is different from the server which just failed. +#Default: +# retry_on_error off + +# TAG: as_whois_server +# WHOIS server to query for AS numbers. NOTE: AS numbers are +# queried only when Squid starts up, not for every request. +#Default: +# as_whois_server whois.ra.net + +# TAG: offline_mode +# Enable this option and Squid will never try to validate cached +# objects. +#Default: +# offline_mode off + +# TAG: uri_whitespace +# What to do with requests that have whitespace characters in the +# URI. Options: +# +# strip: The whitespace characters are stripped out of the URL. +# This is the behavior recommended by RFC2396 and RFC3986 +# for tolerant handling of generic URI. +# NOTE: This is one difference between generic URI and HTTP URLs. +# +# deny: The request is denied. The user receives an "Invalid +# Request" message. +# This is the behaviour recommended by RFC2616 for safe +# handling of HTTP request URL. +# +# allow: The request is allowed and the URI is not changed. The +# whitespace characters remain in the URI. Note the +# whitespace is passed to redirector processes if they +# are in use. +# Note this may be considered a violation of RFC2616 +# request parsing where whitespace is prohibited in the +# URL field. +# +# encode: The request is allowed and the whitespace characters are +# encoded according to RFC1738. +# +# chop: The request is allowed and the URI is chopped at the +# first whitespace. +# +# +# NOTE the current Squid implementation of encode and chop violates +# RFC2616 by not using a 301 redirect after altering the URL. +#Default: +# uri_whitespace strip + +# TAG: chroot +# Specifies a directory where Squid should do a chroot() while +# initializing. This also causes Squid to fully drop root +# privileges after initializing. This means, for example, if you +# use a HTTP port less than 1024 and try to reconfigure, you may +# get an error saying that Squid can not open the port. +#Default: +# none + +# TAG: balance_on_multiple_ip +# Modern IP resolvers in squid sort lookup results by preferred access. +# By default squid will use these IP in order and only rotates to +# the next listed when the most preffered fails. +# +# Some load balancing servers based on round robin DNS have been +# found not to preserve user session state across requests +# to different IP addresses. +# +# Enabling this directive Squid rotates IP's per request. +#Default: +# balance_on_multiple_ip off + +# TAG: pipeline_prefetch +# HTTP clients may send a pipeline of 1+N requests to Squid using a +# single connection, without waiting for Squid to respond to the first +# of those requests. This option limits the number of concurrent +# requests Squid will try to handle in parallel. If set to N, Squid +# will try to receive and process up to 1+N requests on the same +# connection concurrently. +# +# Defaults to 0 (off) for bandwidth management and access logging +# reasons. +# +# NOTE: pipelining requires persistent connections to clients. +# +# WARNING: pipelining breaks NTLM and Negotiate/Kerberos authentication. +#Default: +# Do not pre-parse pipelined requests. + +# TAG: high_response_time_warning (msec) +# If the one-minute median response time exceeds this value, +# Squid prints a WARNING with debug level 0 to get the +# administrators attention. The value is in milliseconds. +#Default: +# disabled. + +# TAG: high_page_fault_warning +# If the one-minute average page fault rate exceeds this +# value, Squid prints a WARNING with debug level 0 to get +# the administrators attention. The value is in page faults +# per second. +#Default: +# disabled. + +# TAG: high_memory_warning +# Note: This option is only available if Squid is rebuilt with the +# GNU Malloc with mstats() +# +# If the memory usage (as determined by gnumalloc, if available and used) +# exceeds this amount, Squid prints a WARNING with debug level 0 to get +# the administrators attention. +#Default: +# disabled. + +# TAG: sleep_after_fork (microseconds) +# When this is set to a non-zero value, the main Squid process +# sleeps the specified number of microseconds after a fork() +# system call. This sleep may help the situation where your +# system reports fork() failures due to lack of (virtual) +# memory. Note, however, if you have a lot of child +# processes, these sleep delays will add up and your +# Squid will not service requests for some amount of time +# until all the child processes have been started. +# On Windows value less then 1000 (1 milliseconds) are +# rounded to 1000. +#Default: +# sleep_after_fork 0 + +# TAG: windows_ipaddrchangemonitor on|off +# Note: This option is only available if Squid is rebuilt with the +# MS Windows +# +# On Windows Squid by default will monitor IP address changes and will +# reconfigure itself after any detected event. This is very useful for +# proxies connected to internet with dial-up interfaces. +# In some cases (a Proxy server acting as VPN gateway is one) it could be +# desiderable to disable this behaviour setting this to 'off'. +# Note: after changing this, Squid service must be restarted. +#Default: +# windows_ipaddrchangemonitor on + +# TAG: eui_lookup +# Whether to lookup the EUI or MAC address of a connected client. +#Default: +# eui_lookup on + +# TAG: max_filedescriptors +# Reduce the maximum number of filedescriptors supported below +# the usual operating system defaults. +# +# Remove from squid.conf to inherit the current ulimit setting. +# +# Note: Changing this requires a restart of Squid. Also +# not all I/O types supports large values (eg on Windows). +#Default: +# Use operating system limits set by ulimit. + diff --git a/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 new file mode 100644 index 0000000000..bb2db511d6 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 @@ -0,0 +1,2 @@ +docker run --rm -d -p 3128:3128 squid-local +docker run --rm -d -p 3129:3129 squid-local.passwd diff --git a/sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 new file mode 100644 index 0000000000..1ac3d7b826 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 @@ -0,0 +1,48 @@ +Write-Host 'EnvVar: ' $env:ANONYMOUSCONTAINERIPV4ADDRESS +Write-Host 'EnvVar: ' $env:AUTHENTICATEDCONTAINERIPV4ADDRESS +if ($env:ANONYMOUSCONTAINERIPV4ADDRESS -ne $null) { + $proxyServer='http://'+$env:ANONYMOUSCONTAINERIPV4ADDRESS+':3128' +} +else +{ + $proxyServer='http://127.0.0.1:3128' +} +if ($env:AUTHENTICATEDCONTAINERIPV4ADDRESS -ne $null) { + $proxyAuthServer='http://'+$env:AUTHENTICATEDCONTAINERIPV4ADDRESS+':3129' +} +else +{ + $proxyAuthServer='http://127.0.0.1:3129' +} + +Write-Host 'Proxy server: ' $proxyServer +Write-Host 'Authenticated Proxy server: ' $proxyAuthServer + +curl -v https://azuresdkforcpp.azurewebsites.net/get -x $proxyServer +if ($? -eq $false) { + Write-Error "Failed to connect to unauthenticated proxy for HTTPS" +} +curl -v http://azuresdkforcpp.azurewebsites.net/get -x $proxyServer +if ($? -eq $false) { + Write-Error "Failed to connect to unauthenticated proxy for HTTP" +} + +curl -v https://azuresdkforcpp.azurewebsites.net/get -x $proxyAuthServer -U user:password +if ($? -eq $false) { + Write-Error "Failed to connect to authenticated proxy for HTTPS" +} +curl -v http://azuresdkforcpp.azurewebsites.net/get -x $proxyAuthServer -U user:password +if ($? -eq $false) { + Write-Error "Failed to connect to authenticated proxy for HTTP" +} + +Invoke-WebRequest -Uri https://azuresdkforcpp.azurewebsites.net/get -Proxy $proxyServer +Invoke-WebRequest -Uri http://azuresdkforcpp.azurewebsites.net/get -Proxy $proxyServer + +[string]$proxyUser="user" +[string]$proxyPassword="password" +[secureString]$securePassword= ConvertTo-SecureString $proxyPassword -AsPlainText -Force +[pscredential]$proxyCredential= New-Object System.Management.Automation.PSCredential($proxyUser, $securePassword) + +Invoke-WebRequest -Uri https://azuresdkforcpp.azurewebsites.net/get -Proxy $proxyAuthServer -ProxyCredential $proxyCredential +Invoke-WebRequest -Uri http://azuresdkforcpp.azurewebsites.net/get -Proxy $proxyAuthServer -ProxyCredential $proxyCredential diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp new file mode 100644 index 0000000000..3c8977de20 --- /dev/null +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +#include "azure/core/context.hpp" +#include "azure/core/http/curl_transport.hpp" +#include "azure/core/http/policies/policy.hpp" +#include "azure/core/internal/environment.hpp" +#include "azure/core/internal/http/pipeline.hpp" +#include "azure/core/internal/json/json.hpp" +#include "azure/core/platform.hpp" +#include "azure/core/response.hpp" +#include +#include +#include +#include + +namespace Azure { namespace Core { namespace Test { + namespace { + constexpr static const char AzureSdkHttpbinServerSchema[] = "https"; + constexpr static const char AzureSdkHttpbinHost[] = "azuresdkforcpp.azurewebsites.net"; + } // namespace + class TransportAdapterOptions : public ::testing::Test { + + public: + enum class TestMode + { + UNKNOWN, + RECORD, + LIVE, + PLAYBACK, + }; + struct AzureSdkHttpbinServer final + { + inline static std::string Get() + { + return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost) + + "/get"; + } + inline static std::string Headers() + { + return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost) + + "/headers"; + } + inline static std::string WithPort() + { + return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost) + + ":443/get"; + } + inline static std::string Put() + { + return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost) + + "/put"; + } + inline static std::string Delete() + { + return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost) + + "/delete"; + } + inline static std::string Patch() + { + return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost) + + "/patch"; + } + inline static std::string Host() { return std::string(AzureSdkHttpbinHost); } + inline static std::string Schema() { return std::string(AzureSdkHttpbinServerSchema); } + }; + + static Azure::Core::Http::_internal::HttpPipeline CreateHttpPipeline( + Azure::Core::Http::Policies::TransportOptions const& options); + + static void CheckBodyFromBuffer( + Azure::Core::Http::RawResponse& response, + int64_t size, + std::string expectedBody = std::string("")); + + static void VerifyIsProxiedResponse( + std::unique_ptr const& response, + std::string const& expectedOrigin); + + static std::string GetIpAddressFromHttpBinServer( + std::unique_ptr const& response); + + static void CheckBodyFromStream( + Azure::Core::Http::RawResponse& response, + int64_t size, + std::string expectedBody = std::string("")); + + static void checkResponseCode( + Azure::Core::Http::HttpStatusCode code, + Azure::Core::Http::HttpStatusCode expectedCode = Azure::Core::Http::HttpStatusCode::Ok); + + std::string HttpProxyServer() + { +#if defined(CODE_COVERAGE) + return "http://127.0.0.1:3128"; +#else + std::string anonymousServer{ + Azure::Core::_internal::Environment::GetVariable("ANONYMOUSCONTAINERIPV4ADDRESS")}; + if (anonymousServer.empty()) + { + anonymousServer = "127.0.0.1"; + } + + return "http://" + anonymousServer + ":3128"; +#endif + } + std::string HttpProxyServerWithPassword() + { +#if defined(CODE_COVERAGE) + return "http://127.0.0.1:3129"; +#else + std::string authenticatedServer{ + Azure::Core::_internal::Environment::GetVariable("AUTHENTICATEDCONTAINERIPV4ADDRESS")}; + if (authenticatedServer.empty()) + { + authenticatedServer = "127.0.0.1"; + } + return "http://" + authenticatedServer + ":3129"; +#endif + } + + protected: + // Create + virtual void SetUp() override {} + + TestMode GetTestMode() + { + auto value = Azure::Core::_internal::Environment::GetVariable("AZURE_TEST_MODE"); + GTEST_LOG_(INFO) << "Azure Test Mode: " << value; + if (value.empty()) + { + GTEST_LOG_(INFO) << "Assume Live Test"; + + return TestMode::LIVE; + } + + if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( + value, "RECORD")) + { + GTEST_LOG_(INFO) << "TestMode:: Record."; + return TestMode::RECORD; + } + else if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( + value, "PLAYBACK")) + { + GTEST_LOG_(INFO) << "TestMode:: Playback."; + return TestMode::PLAYBACK; + } + else if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( + value, "LIVE")) + { + GTEST_LOG_(INFO) << "TestMode:: Live."; + return TestMode::LIVE; + } + + // unexpected variable value + throw std::runtime_error("Invalid environment variable: " + value); + } + }; + + void TransportAdapterOptions::checkResponseCode( + Azure::Core::Http::HttpStatusCode code, + Azure::Core::Http::HttpStatusCode expectedCode) + { + EXPECT_PRED2( + [](Azure::Core::Http::HttpStatusCode a, Azure::Core::Http::HttpStatusCode b) { + return a == b; + }, + code, + expectedCode); + } + + void TransportAdapterOptions::CheckBodyFromBuffer( + Azure::Core::Http::RawResponse& response, + int64_t size, + std::string expectedBody) + { + auto body = response.ExtractBodyStream(); + EXPECT_EQ(body, nullptr); + std::vector bodyVector = response.GetBody(); + int64_t bodySize = bodyVector.size(); + + if (size > 0) + { // only for known body size + EXPECT_EQ(bodySize, size); + } + + if (expectedBody.size() > 0) + { + auto bodyString = std::string(bodyVector.begin(), bodyVector.end()); + EXPECT_STREQ(expectedBody.data(), bodyString.data()); + } + } + + void TransportAdapterOptions::CheckBodyFromStream( + Azure::Core::Http::RawResponse& response, + int64_t size, + std::string expectedBody) + { + auto body = response.ExtractBodyStream(); + EXPECT_NE(body, nullptr); + + std::vector bodyVector = body->ReadToEnd(Azure::Core::Context::ApplicationContext); + int64_t bodySize = body->Length(); + EXPECT_EQ(bodySize, size); + bodySize = bodyVector.size(); + + if (size > 0) + { // only for known body size + EXPECT_EQ(bodyVector.size(), static_cast(size)); + } + + if (expectedBody.size() > 0) + { + auto bodyString = std::string(bodyVector.begin(), bodyVector.end()); + EXPECT_STREQ(expectedBody.data(), bodyString.data()); + } + } + + std::string TransportAdapterOptions::GetIpAddressFromHttpBinServer( + std::unique_ptr const& response) + { + Azure::Core::Json::_internal::json jsonResponse + = Azure::Core::Json::_internal::json::parse(response->GetBody()); + EXPECT_TRUE(jsonResponse.contains("origin")); + EXPECT_TRUE(jsonResponse["origin"].is_string()); + return jsonResponse["origin"].get(); + } + void TransportAdapterOptions::VerifyIsProxiedResponse( + std::unique_ptr const& response, + std::string const& expectedOrigin) + { + std::string ipaddress = GetIpAddressFromHttpBinServer(response); + EXPECT_NE(expectedOrigin, ipaddress); + } + + Azure::Core::Http::_internal::HttpPipeline TransportAdapterOptions::CreateHttpPipeline( + Azure::Core::Http::Policies::TransportOptions const& transportOptions) + { + std::vector> pipelinePolicies; + pipelinePolicies.push_back( + std::make_unique( + transportOptions)); + + return Azure::Core::Http::_internal::HttpPipeline{pipelinePolicies}; + } + + using namespace Azure::Core::Http::_internal; + using namespace Azure::Core::Http::Policies::_internal; + +#if defined(CODE_COVERAGE) +#else +#endif + + // constexpr char SocksProxyServer[] = "socks://98.162.96.41:4145"; + TEST_F(TransportAdapterOptions, SimpleProxyTests_LIVEONLY_) + { + // will skip test under some cased where test can't run (usually LIVE only tests) +#if !defined(CODE_COVERAGE) + if (GetTestMode() != TestMode::LIVE) + { + GTEST_LOG_(INFO) << "Skipping live only test."; + GTEST_SKIP(); + } + else + { + GTEST_LOG_(INFO) << "Running live only test."; + } +#endif + Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); + std::string myIpAddress; + { + // Construct a pipeline with a single transport policy not using a proxy. + Azure::Core::Http::Policies::TransportOptions transportOptions; + + Azure::Core::Http::_internal::HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + checkResponseCode(response->GetStatusCode()); + auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length")); + CheckBodyFromBuffer(*response, expectedResponseBodySize); + myIpAddress = GetIpAddressFromHttpBinServer(response); + } + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + transportOptions.HttpProxy = HttpProxyServer(); + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + checkResponseCode(response->GetStatusCode()); + auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length")); + CheckBodyFromBuffer(*response, expectedResponseBodySize); + VerifyIsProxiedResponse(response, myIpAddress); + } + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + transportOptions.HttpProxy = HttpProxyServer(); + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + testUrl.SetScheme("http"); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + checkResponseCode(response->GetStatusCode()); + auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length")); + CheckBodyFromBuffer(*response, expectedResponseBodySize); + VerifyIsProxiedResponse(response, myIpAddress); + } + } + +#if !defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) + typedef int CURLcode; +#endif + + TEST_F(TransportAdapterOptions, ProxyWithPasswordHttps_LIVENONLY_) + { + // will skip test under some cased where test can't run (usually LIVE only tests) +#if !defined(CODE_COVERAGE) + if (GetTestMode() != TestMode::LIVE) + { + GTEST_SKIP(); + } +#endif + Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); + + // HTTPS Connections. + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + transportOptions.HttpProxy = HttpProxyServerWithPassword(); + transportOptions.ProxyUserName = "user"; + transportOptions.ProxyPassword = "notthepassword"; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + try + { + // WinHTTP treats 407 authn errors from a proxy CONNECT as an HTTP server error, so deal + // with it that way. + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + EXPECT_EQ( + response->GetStatusCode(), + Azure::Core::Http::HttpStatusCode::ProxyAuthenticationRequired); + } + catch (Azure::Core::Http::TransportException const&) + { + // CURL returns a connection error which triggers a transport exception. + // See https://curl.se/mail/lib-2009-07/0078.html for more information. + } + } + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + transportOptions.HttpProxy = HttpProxyServerWithPassword(); + transportOptions.ProxyUserName = "user"; + transportOptions.ProxyPassword = "password"; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + checkResponseCode(response->GetStatusCode()); + auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length")); + CheckBodyFromBuffer(*response, expectedResponseBodySize); + } + } + + TEST_F(TransportAdapterOptions, ProxyWithPasswordHttp_LIVEONLY_) + { + // will skip test under some cased where test can't run (usually LIVE only tests) +#if !defined(CODE_COVERAGE) + if (GetTestMode() != TestMode::LIVE) + { + GTEST_SKIP(); + } +#endif + Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); + // HTTP Connections. + testUrl.SetScheme("http"); + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + transportOptions.HttpProxy = HttpProxyServerWithPassword(); + transportOptions.ProxyUserName = "user"; + transportOptions.ProxyPassword = "notthepassword"; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + EXPECT_EQ( + response->GetStatusCode(), + Azure::Core::Http::HttpStatusCode::ProxyAuthenticationRequired); + } + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + transportOptions.HttpProxy = HttpProxyServerWithPassword(); + transportOptions.ProxyUserName = "user"; + transportOptions.ProxyPassword = "password"; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + checkResponseCode(response->GetStatusCode()); + auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length")); + CheckBodyFromBuffer(*response, expectedResponseBodySize); + } + } +}}} // namespace Azure::Core::Test \ No newline at end of file diff --git a/sdk/core/azure-core/test/ut/websocket_test.cpp b/sdk/core/azure-core/test/ut/websocket_test.cpp index 3160934962..e45ab021aa 100644 --- a/sdk/core/azure-core/test/ut/websocket_test.cpp +++ b/sdk/core/azure-core/test/ut/websocket_test.cpp @@ -364,6 +364,16 @@ TEST_F(WebSocketTests, PingSendTest) Azure::Core::Context receiveContext = Azure::Core::Context::ApplicationContext.WithDeadline( Azure::DateTime{std::chrono::system_clock::now() + 10s}); EXPECT_THROW(testSocket.ReceiveFrame(receiveContext), Azure::Core::OperationCancelledException); + + // The python websocket implementation sometimes has to be "kicked" to process operations, it's + // possible that the "pong" is queued up and has not been sent until the python server receives + // a request from the client. This is permitted because the protocol only requires that the + // server send a pong when it's convenient. + std::vector sendData = GenerateRandomBytes(0, 10); + testSocket.SendFrame(sendData, true /*, context*/); + auto response = testSocket.ReceiveFrame(); + EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); + auto statistics = testSocket.GetStatistics(); GTEST_LOG_(INFO) << "Total bytes sent: " << std::dec << statistics.BytesSent; GTEST_LOG_(INFO) << "Total bytes received: " << std::dec << statistics.BytesReceived; @@ -386,7 +396,7 @@ TEST_F(WebSocketTests, PingSendTest) TEST_F(WebSocketTests, MultiThreadedTestOnSingleSocket) { constexpr size_t threadCount = 50; - constexpr size_t testDataLength = 200000; + constexpr size_t testDataLength = 220000; constexpr size_t testDataSize = 100; constexpr auto testDuration = 10s; @@ -397,12 +407,12 @@ TEST_F(WebSocketTests, MultiThreadedTestOnSingleSocket) // seed test data for the operations. std::vector> testData(testDataLength); std::vector> receivedData(testDataLength); - std::atomic_size_t iterationCount(0); + std::atomic iterationCount(0); // Spin up threadCount threads and hammer the echo server for 10 seconds. std::vector threads; - std::atomic_int32_t cancellationExceptions{0}; - std::atomic_int32_t exceptions{0}; + std::atomic cancellationExceptions{0}; + std::atomic exceptions{0}; for (size_t threadIndex = 0; threadIndex < threadCount; threadIndex += 1) { threads.push_back(std::thread([&]() { @@ -552,19 +562,19 @@ TEST_F(WebSocketTests, MultiThreadedTestOnSingleSocket) TEST_F(WebSocketTests, MultiThreadedTestOnMultipleSockets) { constexpr size_t threadCount = 50; - constexpr size_t testDataLength = 200000; + constexpr size_t testDataLength = 240000; constexpr size_t testDataSize = 100; constexpr auto testDuration = 10s; // seed test data for the operations. std::vector> testData(testDataLength); std::vector> receivedData(testDataLength); - std::atomic_size_t iterationCount(0); + std::atomic iterationCount(0); // Spin up threadCount threads and hammer the echo server for 10 seconds. std::vector threads; - std::atomic_int32_t cancellationExceptions{0}; - std::atomic_int32_t exceptions{0}; + std::atomic cancellationExceptions{0}; + std::atomic exceptions{0}; for (size_t threadIndex = 0; threadIndex < threadCount; threadIndex += 1) { threads.push_back(std::thread([&]() { diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 34be7a63ef..e47adae6dc 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -70,6 +70,16 @@ stages: workingDirectory: build condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) displayName: Launch python websocket server (Linux). + - pwsh: | + docker build -t squid-local $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy + docker build -t squid-local.passwd $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd + docker run --rm -d -p 3128:3128 squid-local + docker run --rm -d -p 3129:3129 squid-local.passwd + displayName: Launch Docker container proxy. + # The image we use for MacOS doesn't support docker, so skip on MacOS. + # We don't have a squid proxy container for windows, so we only run this on Ubuntu. + condition: and(succeeded(), contains(variables.CmakeArgs, 'CODE_COVERAGE'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + PostTestSteps: # Shut down the test server. This uses curl to send a request to the "terminateserver" websocket endpoint. # When the test server receives a request on terminateserver, it shuts down gracefully. @@ -86,6 +96,12 @@ stages: http://localhost:8000/terminateserver displayName: Shutdown WebSocket server. condition: contains(variables.CmakeArgs, 'BUILD_TESTING=ON') + - pwsh: | + docker ps -q -f ancestor=azsdkengsys.azurecr.io/cpp/squid | ForEach-Object { ` + docker stop $_ ` + } + displayName: Shutdown Squid Proxy. + condition: and(contains(variables.CmakeArgs, 'BUILD_TESTING=ON'), contains(variables['OSVmImage'], 'ubuntu')) - template: /eng/common/pipelines/templates/steps/publish-artifact.yml parameters: ArtifactPath: '$(Build.SourcesDirectory)/WebSocketServer.log' diff --git a/sdk/core/test-resources.bicep b/sdk/core/test-resources.bicep new file mode 100644 index 0000000000..0c3b0ed91e --- /dev/null +++ b/sdk/core/test-resources.bicep @@ -0,0 +1,116 @@ +// cspell: words azuresdkforcppproxy azuresdkforcppauthproxy +@description('Name for the container group') +param anonymousName string = 'azuresdkforcppproxy' + +@description('Name for the container group') +param authenticatedName string = 'azuresdkforcppauthproxy' + +@description('Location for all resources.') +param location string = resourceGroup().location + +@description('Container image to deploy. Should be of the form repoName/imagename:tag for images stored in public Docker Hub, or a fully qualified URI for other registries. Images from private registries require additional registry credentials.') +param anonymousImage string = 'azsdkengsys.azurecr.io/cpp/squid:latest' + +@description('Container image to deploy. Should be of the form repoName/imagename:tag for images stored in public Docker Hub, or a fully qualified URI for other registries. Images from private registries require additional registry credentials.') +param authenticatedImage string = 'azsdkengsys.azurecr.io/cpp/squid.passwd:latest' + +@description('Port to open on the container and the public IP address.') +param anonymousPort int = 3128 +@description('Port to open on the container and the public IP address.') +param authenticatedPort int = 3129 + +@description('The number of CPU cores to allocate to the container.') +param cpuCores int = 1 + +@description('The amount of memory to allocate to the container in gigabytes.') +param memoryInGb int = 2 + +@description('The behavior of Azure runtime if container has stopped.') +@allowed([ + 'Always' + 'Never' + 'OnFailure' +]) +param restartPolicy string = 'Always' + +resource anonymousContainerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01' = { + name: anonymousName + location: location + properties: { + containers: [ + { + name: anonymousName + properties: { + image: anonymousImage + ports: [ + { + port: anonymousPort + protocol: 'TCP' + } + ] + environmentVariables:[ + { } + ] + resources: { + requests: { + cpu: cpuCores + memoryInGB: memoryInGb + } + } + } + } + ] + osType: 'Linux' + restartPolicy: restartPolicy + ipAddress: { + type: 'Public' + ports: [ + { + port: anonymousPort + protocol: 'TCP' + } + ] + } + } +} + +resource authenticatedContainerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01' = { + name: authenticatedName + location: location + properties: { + containers: [ + { + name: authenticatedName + properties: { + image: authenticatedImage + ports: [ + { + port: authenticatedPort + protocol: 'TCP' + } + ] + resources: { + requests: { + cpu: cpuCores + memoryInGB: memoryInGb + } + } + } + } + ] + osType: 'Linux' + restartPolicy: restartPolicy + ipAddress: { + type: 'Public' + ports: [ + { + port: authenticatedPort + protocol: 'TCP' + } + ] + } + } +} + +output anonymousContainerIPv4Address string = anonymousContainerGroup.properties.ipAddress.ip +output authenticatedContainerIPv4Address string = authenticatedContainerGroup.properties.ipAddress.ip From 2e88a6eb355f6a8915066a9470fe9f46026f351a Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 22 Aug 2022 11:47:25 -0700 Subject: [PATCH 04/75] Sync WebSockets branch with Main. (#3895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Stress test (#3820) * mem leak fix * PR comments fix * PR comments * seems to work? * clang * curl again * add first stress test * also update gitignore * missing line * only linux * clang typo format * typo 2 * PR comments * cspell * remove terminator * Fixed the metadata for better handling (#3824) Co-authored-by: sima-zhu * Update attestation core vcpkg dependency to latest GA version that is required. (#3830) * Update attestation core vcpkg dependency to latest GA version that is required. * Update vcpkg config.cmake to match the dependency version needed. * Remove winhttp (#3832) * remove refs to winhttp * this tsst only curl * Move perf.yml to eng/common (#3833) Co-authored-by: Mike Harder * Sync eng/common directory with azure-sdk-tools for PR 3656 (#3834) * someone wants to reference the test-proxy startup scripts externally. to make this easy on them we're parameterizing the root of the eng/common for easy use in that scenario * two leading $ signs on the definition of the certificate path was causing some issues! Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Update casing for 'verison' (#3821) Co-authored-by: Daniel Jurek * Print additional result summary formats to pipelines UI (#3842) Co-authored-by: Mike Harder * Sync eng/common directory with azure-sdk-tools for PR 3702 (#3843) * Add language-service to list of valid sample slugs * Update link to taxonomies Co-authored-by: Heath Stewart * Fix incorrect failure notification in vcpkg publishing (#3838) * Set up for testing of template pipeline * Override branches, set up for template GA release * More TODOs to prevent merging an unintended change * More removal of TestPipeline * Increment template version number * Use script to set package version * Check out the correct branch * branch parameter in the command * Use $(PublishToVcpkg) to determine if we should check for changes * dictionary syntax * Set GA package version to validate GA publish scenario * Update changelog * create-pull-request.yml optionally pushes changes * Output GH PR URI * Macro syntax with a variable set earlier * Move up to 1.2.0-beta.2 * beta.1 * Revert changelog * Revert testing-related changes * Revert vcpkg-clone.yml * Revert eng/common changes, ensure global $(HasChanges) is set properly * Changes to enable testing * 1.1.0-beta.1 * vcpkg clone should clone at configured branch * Clone "main" branch of vcpkg betas * Undo test-specific changes * More PR cleanup * PR cleanup * Helm charts (#3841) * helm chart * first pipe setup * poi * magiks * ewewe * stress * cleanup * pr * QFE and readme * clang * stupid clang , waste of time * ewqwewewrqrewewrqewrqwrqr * stupid clang * cspell * PR * try try again * clang again * Sync eng/common directory with azure-sdk-tools for PR 3661 (#3846) * Add full clone fallback to sparse checkout * Improve clone handling and overrides for sparse checkout * Use SkipSparseCheckout variable name Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3735 (#3845) * Detect API changes using new snadboxinx approach * Added strictmode * Remove unset variable * Changes as per strict mode 3 * Rervert strict mode to allow language level fixes to merge first Co-authored-by: praveenkuttappan * Increment version for keyvault releases (#3809) * Increment package version after release of azure-security-keyvault-keys * Increment package version after release of azure-security-keyvault-secrets * Increment package version after release of azure-security-keyvault-certificates * Removed hard dependency on opentelemetry version (#3844) * Revert "Add full clone fallback to sparse checkout (#3661)" (#3851) This reverts commit 7605ead00308dd20f20f2afe5acc4ec9900a2c47. Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3753 (#3857) * Bump MacOs version to macos-11 * Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 Co-authored-by: Wes Haggard * Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 Co-authored-by: Wes Haggard Co-authored-by: sima-zhu Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: Wes Haggard * Bump macOs version to macos-11 (#3853) * Update CHANGELOG.md * Fix misleading step name in az module install (#3859) Co-authored-by: Ben Broderick Phillips * Retry poll calls on EINTR (#3858) When signals are delievered to the process, calls here to poll may be interrupted and return with a spurious failure. The call instead should be restarted. * Fix bad path to sample matrix json (#3860) Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3826 (#3863) * Add link checking for stress CI * Remove region segment from stress testing links Co-authored-by: Ben Broderick Phillips * Core August releases (#3862) * Core August releases * cspell Co-authored-by: Anton Kolesnyk * Increment version for core releases (#3865) * Increment package version after release of azure-core * Increment package version after release of azure-core-tracing-opentelemetry * Storage Aug GA release (#3864) * CG only runs on internal (#3866) * Condition added and indentation changes * STG 79 80 81 Features (#3850) * Sync eng/common directory with azure-sdk-tools for PR 3860 (#3871) * updating pfx and cert * update the targeted version of the proxy as well Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Storage August Preview Release (#3868) * Storage August Preview Release * update versions * Increment version for storage releases (#3875) * Increment package version after release of azure-storage-common * Increment package version after release of azure-storage-blobs * Fix an issue that reason phrase is missing as expected from HTTP/2 server (#3879) * Fix an issue that reason phrase is missing as expected from HTTP/2 server * reverse the condition * compact comments * fix clang format * Update CODEOWNERS (#3881) * updated targeted proxy version to one that properly allows consumption of TLS certificates (#3888) Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Fix `azure-storage-blobs-cpp` beta install (#3889) Co-authored-by: Anton Kolesnyk * Fixed merge conflict typo Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com> Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: sima-zhu Co-authored-by: Ahson Khan Co-authored-by: Mike Harder Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> Co-authored-by: Daniel Jurek Co-authored-by: Heath Stewart Co-authored-by: Ben Broderick Phillips Co-authored-by: praveenkuttappan Co-authored-by: Ben Broderick Phillips Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Rick Winter Co-authored-by: John Heffner Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Co-authored-by: Anton Kolesnyk Co-authored-by: JinmingHu Co-authored-by: Jonathan Cárdenas Co-authored-by: keshen-msft <53491277+keshen-msft@users.noreply.github.com> Co-authored-by: microzchang <110015819+microzchang@users.noreply.github.com> --- .github/CODEOWNERS | 2 +- .vscode/cspell.json | 6 +- .../TestResources/setup-environments.yml | 2 +- .../templates/steps/verify-links.yml | 2 +- eng/common/scripts/job-matrix/README.md | 10 +- .../scripts/job-matrix/samples/matrix.json | 2 +- .../job-matrix-functions.filter.tests.ps1 | 2 +- .../tests/job-matrix-functions.tests.ps1 | 16 +- .../stress-test-deployment-lib.ps1 | 2 +- eng/common/testproxy/dotnet-devcert.crt | 30 +- eng/common/testproxy/dotnet-devcert.pfx | Bin 2445 -> 2445 bytes eng/common/testproxy/target_version.txt | 2 +- .../templates/jobs/archetype-sdk-client.yml | 19 +- eng/pipelines/templates/jobs/ci.tests.yml | 19 +- .../stages/platform-matrix-cmakegenerate.json | 2 +- .../platform-matrix-cmakesourcegenerate.json | 2 +- .../stages/platform-matrix-live.json | 2 +- .../templates/stages/platform-matrix.json | 5 +- .../CHANGELOG.md | 8 +- .../src/private/package_version.hpp | 2 +- sdk/core/azure-core/CHANGELOG.md | 13 + sdk/core/azure-core/src/http/curl/curl.cpp | 51 +- .../src/http/winhttp/win_http_transport.cpp | 30 +- sdk/storage/azure-storage-blobs/CHANGELOG.md | 23 +- .../azure-storage-blobs/CMakeLists.txt | 4 +- .../storage/blobs/blob_container_client.hpp | 18 + .../inc/azure/storage/blobs/blob_options.hpp | 12 + .../azure/storage/blobs/blob_responses.hpp | 45 ++ .../azure/storage/blobs/blob_sas_builder.hpp | 15 + .../inc/azure/storage/blobs/rest_client.hpp | 165 +++-- .../azure-storage-blobs/src/blob_client.cpp | 2 + .../src/blob_container_client.cpp | 230 ++++--- .../src/blob_responses.cpp | 12 +- .../src/blob_sas_builder.cpp | 26 +- .../src/block_blob_client.cpp | 1 + .../src/private/package_version.hpp | 4 +- .../azure-storage-blobs/src/rest_client.cpp | 614 ++++++++++++++---- .../azure-storage-blobs/swagger/README.md | 62 +- .../test/ut/blob_container_client_test.cpp | 124 +++- .../test/ut/blob_sas_test.cpp | 30 + .../test/ut/block_blob_client_test.cpp | 59 ++ ...obContainerClientTest.EncryptionScope.json | 438 +++++++++++++ ...obContainerClientTest.SpecialBlobName.json | 332 ++++++---- .../BlobContainerClientTest.Tags.json | 456 ++++++++++--- .../BlobServiceClientTest.SetProperties.json | 60 +- ...obClientTest.CopyWithTagsMetadataTier.json | 314 +++++---- ...ntTest.SyncCopyFromUriEncryptionScope.json | 270 ++++++++ .../BlockBlobClientTest.UploadFromUri.json | 201 ++++-- sdk/storage/azure-storage-blobs/vcpkg.json | 4 +- .../azure-storage-blobs/vcpkg/Config.cmake.in | 2 +- .../azure-storage-blobs/vcpkg/vcpkg.json | 2 +- sdk/storage/azure-storage-common/CHANGELOG.md | 9 +- .../azure-storage-common/CMakeLists.txt | 4 +- .../storage/common/account_sas_builder.hpp | 10 + .../src/account_sas_builder.cpp | 14 +- .../src/private/package_version.hpp | 2 +- sdk/storage/azure-storage-common/vcpkg.json | 4 +- .../vcpkg/Config.cmake.in | 2 +- .../azure-storage-common/vcpkg/vcpkg.json | 2 +- sdk/storage/test-resources-post.ps1 | 7 + 60 files changed, 2897 insertions(+), 911 deletions(-) create mode 100644 sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.EncryptionScope.json create mode 100644 sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.SyncCopyFromUriEncryptionScope.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index aedc472e01..39e0af410d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -36,7 +36,7 @@ /sdk/keyvault/ @vhvb1989 @gearama @antkmsft @rickwinter # PRLabel: %Storage -/sdk/storage/ @vinjiang @katmsft @Jinming-Hu @EmmaZhu @antkmsft @vhvb1989 @gearama @LarryOsterman +/sdk/storage/ @vinjiang @katmsft @Jinming-Hu @EmmaZhu @antkmsft @vhvb1989 @gearama @LarryOsterman @microzchang # PRLabel: %EngSys /sdk/template/ @danieljurek @weshaggard diff --git a/.vscode/cspell.json b/.vscode/cspell.json index f0d6ff71a7..a62e2688de 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -11,8 +11,8 @@ "*.exe", "*.a", "*.lib", - "*.yaml", - "**/libcurl-stress-test/README.md", + "*.yaml", + "**/libcurl-stress-test/README.md", ".github/CODEOWNERS", ".gitignore", ".vscode/cspell.json", @@ -200,6 +200,8 @@ "davidchisnall", "Gabor", "Gyimesi", + "Heffner", + "johnwheffner", "Joubert", "juchem", "lordgamez", diff --git a/eng/common/TestResources/setup-environments.yml b/eng/common/TestResources/setup-environments.yml index ef400bcb1d..a829b8dadf 100644 --- a/eng/common/TestResources/setup-environments.yml +++ b/eng/common/TestResources/setup-environments.yml @@ -21,7 +21,7 @@ steps: condition: contains(variables['OSVmImage'], 'mac') - task: Powershell@2 - displayName: Register Dogfood environment + displayName: Setup Az Modules and Dogfood Environment inputs: targetType: inline pwsh: true diff --git a/eng/common/pipelines/templates/steps/verify-links.yml b/eng/common/pipelines/templates/steps/verify-links.yml index 12e14d3991..8a84f8d0ec 100644 --- a/eng/common/pipelines/templates/steps/verify-links.yml +++ b/eng/common/pipelines/templates/steps/verify-links.yml @@ -28,4 +28,4 @@ steps: -branchReplacementName ${{ parameters.BranchReplacementName }} -devOpsLogging: $true -checkLinkGuidance: ${{ parameters.CheckLinkGuidance }} - -inputCacheFile "https://azuresdkartifacts.blob.core.windows.net/verify-links-cache/verify-links-cache.txt" \ No newline at end of file + -inputCacheFile "https://azuresdkartifacts.blob.core.windows.net/verify-links-cache/verify-links-cache.txt" diff --git a/eng/common/scripts/job-matrix/README.md b/eng/common/scripts/job-matrix/README.md index b9f540e42e..d112c53574 100644 --- a/eng/common/scripts/job-matrix/README.md +++ b/eng/common/scripts/job-matrix/README.md @@ -39,13 +39,13 @@ jobs: parameters: MatrixConfigs: - Name: base_product_matrix - Path: eng/scripts/job-matrix/samples/matrix.json + Path: eng/common/scripts/job-matrix/samples/matrix.json Selection: all NonSparseParameters: - framework GenerateVMJobs: true - Name: sparse_product_matrix - Path: eng/scripts/job-matrix/samples/matrix.json + Path: eng/common/scripts/job-matrix/samples/matrix.json Selection: sparse GenerateVMJobs: true JobTemplatePath: /eng/common/scripts/job-matrix/samples/matrix-job-sample.yml @@ -102,7 +102,7 @@ Example: "operatingSystem": [ "windows-2019", "ubuntu-18.04", - "macOS-10.15" + "macos-11" ], "framework": [ "net461", @@ -380,7 +380,7 @@ In the matrix job output that azure pipelines consumes, the format is a dictiona { "net461_macOS1015": { "framework": "net461", - "operatingSystem": "macOS-10.15" + "operatingSystem": "macos-11" }, "net50_ubuntu1804": { "framework": "net50", @@ -512,7 +512,7 @@ Given a matrix like below with `JavaTestVersion` marked as a non-sparse paramete "Agent": { "windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" }, "ubuntu-1804": { "OSVmImage": "MMSUbuntu18.04", "Pool": "azsdk-pool-mms-ubuntu-1804-general" }, - "macOS-10.15": { "OSVmImage": "macOS-10.15", "Pool": "Azure Pipelines" } + "macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" } }, "JavaTestVersion": [ "1.8", "1.11" ], "AZURE_TEST_HTTP_CLIENTS": "netty", diff --git a/eng/common/scripts/job-matrix/samples/matrix.json b/eng/common/scripts/job-matrix/samples/matrix.json index a9e291604d..98e1dd757f 100644 --- a/eng/common/scripts/job-matrix/samples/matrix.json +++ b/eng/common/scripts/job-matrix/samples/matrix.json @@ -6,7 +6,7 @@ "Agent": { "ubuntu": { "OSVmImage": "ubuntu-18.04", "Pool": "Azure Pipelines" }, "windows": { "OSVmImage": "windows-2019", "Pool": "Azure Pipelines" }, - "macOS": { "OSVmImage": "macOS-10.15", "Pool": "Azure Pipelines" } + "macOS": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" } }, "TestTargetFramework": [ "netcoreapp2.1", "net461", "net5.0" ] }, diff --git a/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1 b/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1 index a25367bebf..7c327eb27d 100644 --- a/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1 +++ b/eng/common/scripts/job-matrix/tests/job-matrix-functions.filter.tests.ps1 @@ -6,7 +6,7 @@ BeforeAll { $matrixConfig = @" { "matrix": { - "operatingSystem": [ "windows-2019", "ubuntu-18.04", "macOS-10.15" ], + "operatingSystem": [ "windows-2019", "ubuntu-18.04", "macos-11" ], "framework": [ "net461", "netcoreapp2.1" ], "additionalArguments": [ "", "mode=test" ] } diff --git a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 index 38b7e44429..689ed91083 100644 --- a/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 +++ b/eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 @@ -12,7 +12,7 @@ BeforeAll { "operatingSystem": [ "windows-2019", "ubuntu-18.04", - "macOS-10.15" + "macos-11" ], "framework": [ "net461", @@ -36,11 +36,11 @@ BeforeAll { "framework": "net461" }, { - "operatingSystem": "macOS-10.15", + "operatingSystem": "macos-11", "framework": "netcoreapp2.1" }, { - "operatingSystem": ["macOS-10.15", "ubuntu-18.04"], + "operatingSystem": ["macos-11", "ubuntu-18.04"], "additionalArguments": "--enableFoo" } ] @@ -275,7 +275,7 @@ Describe "Platform Matrix Generation" -Tag "generate" { "operatingSystem": [ "windows-2019", "ubuntu-18.04", - "macOS-10.15" + "macos-11" ], "framework": [ "net461", @@ -340,7 +340,7 @@ Describe "Platform Matrix Generation" -Tag "generate" { $element.parameters.additionalArguments | Should -Be "--enableFoo" $element = GetNdMatrixElement @(2, 1, 1) $matrix $dimensions - $element.parameters.operatingSystem | Should -Be "macOS-10.15" + $element.parameters.operatingSystem | Should -Be "macos-11" $element.parameters.framework | Should -Be "netcoreapp2.1" $element.parameters.additionalArguments | Should -Be "--enableFoo" } @@ -348,7 +348,7 @@ Describe "Platform Matrix Generation" -Tag "generate" { It "Should initialize a sparse matrix from an N-dimensional matrix" -TestCases @( @{ i = 0; name = "windows2019_net461"; operatingSystem = "windows-2019"; framework = "net461"; additionalArguments = ""; } @{ i = 1; name = "ubuntu1804_netcoreapp21_withfoo"; operatingSystem = "ubuntu-18.04"; framework = "netcoreapp2.1"; additionalArguments = "--enableFoo"; } - @{ i = 2; name = "macOS1015_net461"; operatingSystem = "macOS-10.15"; framework = "net461"; additionalArguments = ""; } + @{ i = 2; name = "macOS11_net461"; operatingSystem = "macos-11"; framework = "net461"; additionalArguments = ""; } ) { $sparseMatrix = GenerateSparseMatrix $generateConfig.matrixParameters $generateConfig.displayNamesLookup $dimensions = GetMatrixDimensions $generateConfig.matrixParameters @@ -440,9 +440,9 @@ Describe "Platform Matrix Post Transformation" -Tag "transform" { $matrix[2].parameters.operatingSystem | Should -Be "ubuntu-18.04" $matrix[2].parameters.additionalArguments | Should -Be "" - $matrix[4].name | Should -Be "macOS1015_net461" + $matrix[4].name | Should -Be "macOS11_net461" $matrix[4].parameters.framework | Should -Be "net461" - $matrix[4].parameters.operatingSystem | Should -Be "macOS-10.15" + $matrix[4].parameters.operatingSystem | Should -Be "macos-11" $matrix[4].parameters.additionalArguments | Should -Be "" $matrix[7].name | Should -Be "windows2019_net50_enableWindowsFoo" diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index 97c4d925fe..9369dcc6ba 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -253,7 +253,7 @@ function CheckDependencies() }, @{ Command = "az"; - Help = "Azure CLI must be installed: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli"; + Help = "Azure CLI must be installed: https://docs.microsoft.com/cli/azure/install-azure-cli"; } ) diff --git a/eng/common/testproxy/dotnet-devcert.crt b/eng/common/testproxy/dotnet-devcert.crt index e8575ea445..07976e52ef 100644 --- a/eng/common/testproxy/dotnet-devcert.crt +++ b/eng/common/testproxy/dotnet-devcert.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDSDCCAjCgAwIBAgIUPMKpJ/j10eQrcQBNnkImIaOYHakwDQYJKoZIhvcNAQEL -BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIxMDgwNTAwMzU1NloXDTIyMDgw -NTAwMzU1NlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAxe/ZseXgOTVoF7uTjX5Leknk95jIoyGc+VlxA8BhzGOr -r4u6VNQZRCMq+svHY36tW4+u/xHNe2kvbwy2mnS8cFFLfst+94qBZVJDBxSGZ9I/ -wekErNsjFsik4UrMvcC+ZlGPh7hb3f7tSx29tn1DIkAUXVnbZ6TT5s+mYRQpZ6fW -6kR3RNfc0A1IUM7Zs9yfNEr0O2H41P2HcLKoOPtvd7GvTQm9Ofh3srKvII+sZn/J -WH7r76oRQMX904mOMdryQwZLObsqX4dXIEbafKVSecB3PBVIhv8gVtJhcZbQP1pI -mMiWd6PHv46ZhGf7+cKnYUSa8Ia2t/wetK1wd00dFwIDAQABo4GRMIGOMA8GA1Ud +MIIDSDCCAjCgAwIBAgIUIoKu8Oao7j10TLNxaUG2Bs0FrRwwDQYJKoZIhvcNAQEL +BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIyMDgwNTIxMTcyM1oXDTIzMDgw +NTIxMTcyM1owFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA0UPG7ER++5/9D/qa4SCtt7QvdHwcpidbwktPNU8iRW7V +pIDPWS4goLp/+7+maT0Z/mqwSO3JDtm/dtdlr3F/5EMgyUExnYcvUixZAiyFyEwj +j6wnAtNvqsg4rDqBlD17fuqTVsZm9Yo7QYub6p5PeznWYucOxRrczqFCiW4uj0Yk +GgUHPPmCvhSDKowV8CYRHfkD6R8R4SFkoP3/uejXHxeXoYJNMWq5K0GqGaOZtNFB +F7QWZHoLrRpZcY4h+DxwP3c+/FdlVcs9nstkF+EnTnwx5IRyKsaWb/pUEmYKvNDz +wi6qnRUdu+DghZuvyZZDgwoYrSZokcbKumk0MsLC3QIDAQABo4GRMIGOMA8GA1Ud EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGmMBYGA1UdJQEB/wQMMAoGCCsGAQUF BwMBMBcGA1UdEQEB/wQNMAuCCWxvY2FsaG9zdDA6BgorBgEEAYI3VAEBBCwMKkFT UC5ORVQgQ29yZSBIVFRQUyBkZXZlbG9wbWVudCBjZXJ0aWZpY2F0ZTANBgkqhkiG -9w0BAQsFAAOCAQEAIj2VlBVcXGSly6KCBg6lgwFi+henWfSox77iuGAaAxDjN3jd -9lZahW4MPNLHKSrPRb4YNSLZ2jh7zdcttQrqd4qH65o1q56q5JrCmli99iIzY9Y8 -RdYyxK4Zzr31wjpsyFiWQfqJTuSFUUg9uDDj0negwEZLIGlt7nr12wflt2+QOJtD -byMeSZLbB5dPzn341DK0qfJEJMMgL0XsPEVZ3TQ6Alc9zq5wI608C/mXnz3xJE05 -UTYD8pRJJ/DyG0empvOVE8Sg93msHPquAbgqO9aqCpykgg/a8CFvI4wRdfvGEFlv -8XJKL8Y/PFsmFeO3axq3zUYKFVdc9Un4dFIaag== +9w0BAQsFAAOCAQEARX4NxGbycdPVuqvu/CO+/LpWrEm1OcOl7N57/mD5npTIJT78 +TYtXk1J61akumKdf5CaBgCDRcl35LhioFZIMEsiOidffAp6t493xocncFBhIYYrZ +HS6aKsZKPu8h3wOLpYu+zh7f0Hx6pkHPAfw4+knmQjDYomz/hTwuo/MuT8k6Ee7B +NGWqxUamLI8bucuf2ZfT1XOq83uWaFF5KwAuVLhpzo39/TmPyYGnaoKRYf9QjabS +LUjecMNLJFWHUSD4cKHvXJjDYZEiCiy+MdUDytWIsfw0fzAUjz9Qaz8YpZ+fXufM +MNMNfyJHSMEMFIT2D1UaQiwryXWQWJ93OiSdjA== -----END CERTIFICATE----- diff --git a/eng/common/testproxy/dotnet-devcert.pfx b/eng/common/testproxy/dotnet-devcert.pfx index 28058ae4ce30e7a413e8f872d930fa2cf5c2107c..a971cd950a1e42e5c03a5f0aebde478d8a70614d 100644 GIT binary patch delta 2311 zcmV+i3HbJn6O9v)U4KLwz`a{K}U2mpYB1E}N1nyh7MX`_CLGE&P2OCSf38YR4| z3=%R0yP3UYyBaIHiHOQRDR#UW;NKfzP2_-uQh9LnSvZ0N7{C_~qx#9H8TO0$q66Zx zxF_t8LYKb6bzwFX2x^~jZ5E)2dpe$HU6#K*v>HjhXa5$3MSo~7h|T%&ecj^z3b|Vd zpbPH}t%H3ZNvme298)-0Q1muXd6Nik($=2@&(C8JFhZb4<;~@j+fW)MfVK(FI>Z?+ zlaC&Np@7n2mM8?=-s0T>UlX;7n{|d?521>hj%S62uQYq8s~leS(iO4^Rps;rG&f40 zjt=&|1dpfjVSiB}r>N|x`?P(WYiMhcNZ9wP=dc}Pbh8ikg$U1B;p@j~G;zy}R2T&u zqC3cbRLWXCR%ctg2=Mp;*6EK>azpCo%sVM~^b#L+TounBJ|;nwOif61K=?X=eAw>y%nto}qkrtYb^mi(Ucy>vplM#y?s_z! z_O#mG?djUPHmen0M~eK0`iX>M$dj(E!g4P{A%|633 z9cli1R)6QEjhjnX!hpXUGje?bFE&%ak1rnQN_Pi#N-t+D>Lw%S->d=%C#PSo_laQJ z=UXN3gfA9pL+c0cMn)okN{WYCb2qD_^QpcL5wRcJsok$yev|Iu{hU!y0wuI*k+5W; zFr_hb5WHp-OAQpi{Me#rjXGk5* zA;=EDV!)N(G06pyeYFKoZ%XPI#HJ46B9kN4KwchlhQ81gL>7K;4H>b8CrL^JxI>OR zw|_`el#;Qul;c2nk!3&k>ryv!+t?mR)0WUt+^3zDnDF3mEiw6cNTym5PY;EHw2INA?`SgnmQPF2|ujI&)Bd@&geC2W7^e_1%%P7T6JAAR#pL` zb$+etEY6MT`gnrs=3DBa_JKBtwi@|jVzC@Rkp`w8DdOm!gOe2mMt}SobWuN3{=xzR z2ml0v1jwCc*1UmW6Gb>VaU;V0(ZCA+%8uAzW@*1L{%_rVXFA)T(2JNumhI#NYTCGX*}8}A%zB@`Ib{=olmSLzwY zh4g+!i%T+NiK|R;i*>E`OqXk&DMLA!~J)2goUN z;}qlNDw7F%4Z$40;EN`P=K)l=7rpxrOU#uE)u1qG_BT!#f6mVugq|PFpMh~dlorH) zlj?r)+yQLZ3D3+Bw_dn%LeCUQl{9GKu3fTNM8l`dzD64mB7Ty=WTRPTYy76j==D&5 zs+~Z9Q&FIdmw)!}xE`ELCoCJ1c4GE!n@D7N|-kBt0h(tL`|x5qy;^Pmb9~S!c{{q+=(qjzPH1(g!}$i zddA+vHDHF!FR-vlM2^0RZ+u%K$(+3`pHc_ABlX;m5}nRuNi}n75*CT)_}?tVV`@Tl z{W?j$xqpvmd=bpL-Gc__?-X5vg`6r1odrO5?kG6=Iq2fTej9P;_e8FwRebW^NVG<< zUfcJ^*>c#S2l)=%hU_A2p1i2WB6H)xo^aSpWaO*w`|er*c|eldeQa8Tbzbi`sG=5( z_1#TzZm~>p`PGt0lIZ3z%DChPwK@rPeIwhMW`Eez0F;q5ag*a}KW9epMo)N1xrp$a zfrUDW*xkFlSLr?TmF((i=lIm4hnWs#z`g+*R7^0%NIA^k30&Euw~>Zh@SV3Z zDn0plHnJvlYtJfWqlU89t`5@SOvp&1xiMpx;&I0ZY%tcqf=Q9@7FbBWbLXo-R`j1t zseiKU6JotI#+m{6+diOGE%dt=S|#a?#2+BfjCa?Ov~$I86b9#%vV2UFKSEc-*$I}5jkM*+ja_g1b=w# zhnH@)O7suyph&7BJDLjFz!Z4msyli99t^n$v^3Rcqf;EMpTQ73{YhcgaDh>!TzJop zi)G>#*Ob8oP|;{4k>2?is*c0f5mbpb_ahHM?1)NaZt*IN9F%zcH((<%B`_lf2`Yw2 zhW8Bt2^BFG1QbC7aCxMw#~G>_hddqrDGUC^5z3P=F)$%82?hl#4g&%j1povTv<;4F h#W825pUKW`Rlb&$9I9pK1PCwl=9i$=>oNiY2mm^`ZGZp( delta 2311 zcmV+i3HbJn6O9v)U4QzFW>WI?54HjV2mpYB1E?0@CigS-n3b8=c^p`^>Xld4L8IXF zXX**plkyrolD$iHRfuNMbYH1Vg$&`IXLC8KZg1I@5aQ%qhaCxoSOZ~kLbz+LThOFL z6Gn#mncW-6_3`=|Wzo6*lFmRlJlCW`*qpHa+7drZVMAy*V}GOe!b)|WF2zWX!WCSc z9TD&$N%u7y^k!|tmc5lfjL*K^S15Vd@E97U55w>=fwmQpVdG&vHN|UXPJ9J2W?x|o zlFjTAkZbY{Q~r|#^;)-!0p?Obt6Pn_q#o*X&FM$-y8_65_5R{o`zX}pG*0oTqGKIxj&#LEnA*cJd` z4o>rCO{9qPro)dfDY|tf5h8?&ybx1Q(mqGdZ@F68(I20qV$Ww*MkOc6%<{I6M@Ea> z%dNGtWX@6Z9qUq6PRMv49U#)#rQhvM@p$}9xz2q4i+>SER>$+(i3I7wN%0WlLi$Qg z)hxg70s1&|j7z)JDh9wJc|dMI_w{Xi;`IO3=m=f6)?`1Dx{gvK?CJ4Jgki*)nkb&8 zdzo#S^Ysym`gUN&gyZNK@%+olxQYcjE6r{}BX3?x28;IEqwDAnl%4;|oc<)lZw6pC z*<7P5y?>uHluJQQb*q7oEMx;Iv5nRHha|wadMw+oatmSVX&%P9T}+rcT9#c)%5JpE zl@2DEH@_v=_=^12n-876*9}&x=Ss_M>gP)oRI~VNO+u}^P!)UF8H;iZ@VV4I+kDR- zdCQhI9KE_JA;(yWKg+Flo;g6ww}n{>s^H|7Z-2m^)isVCPce!Kw-BU;;5U8VAo~8{ zpSQRkK!m$Cij_K}1#H91<9okACjXgH&ofFdkpJ4;OHG|^sC|hd+61JA!@b_3@gbtu z*7l^<*OQ81kZZf7GPj# zHGf6#A;BjhP-l;$sN26t9)diF+&75^L_4N_K1Ky%wHx)diWmkW*PeHksF8t%NEY-O zCSWsC4okLYY|(%Iopf7_gxjV)GX`S4PDR29Aej7_3bgw-|I2_E4hROZ!nfQ~=z=yu zPo7{fzlJlw!D-9BvI#R^udMImyorVg_CL>x-U|)m(I~nM5)+-EALZrx$q}7(8q82f zbjL&iI^1GaSX)a6ke61=aZIowX?kJU=&8>Ss|}VAO#WBxGm{krMt}8*Eb9;+^h5#z z2ml0v1jxDm=AZ31%Hx(vqoH!EA<$DnO^GSt0${#G9~PsK8x7z)E7=m-Twp|yaGYo9 zcHlax7Q09)Pv4mIlN?h?=VT>`*dT=*R2&vAFRV$3g&u~V6u_YvweZak`2rJqBZl*H zPmU(=DDuaX5?SiJhkxL-g7XeeAI93ERX;iAsCu&4No3)^P|CSEg8hv{Hg)SttGCyASV#+8&;sBEIp7UxjYguGQqSPzvnALj> z91TEO-EHw-5_Fts=>`$;UDk7n7X`UYErd7r-OA8P54F@Fq60%y9>cfkB;l0d?& z9%&ug^tL@s9P7ob*g!Mb(yIdHwyu85qbjSBeci6ovN@2Sp9bTp86dRFC|0+{=czdM zK>hVb)HGcrK7-cSS3%b&wZ1_tS33Bi5^oq>m&Vlu#`QS8x!kgkD^ zk2plENCNFdI#sZCz~OAAG*xS77fh8|wPW4O-4<4~rhj}e1MO(F)Rna27z_NNmcU4` zo8+ETaVg=;%UN6B;-C7YKLocqNS`*ezVK{Ksz0>64_^m&2+CvqcD1mpIBQ;vh2ta z2JEI7fqzZ(-APOs@Sks-$c{10^~y!T#1%a%lfrFMXz(ihbMzN(0`wu)}CB9W;W+@CSIUAfCV!MT$} zMCe6~7sf`pmE|DYF;RWcLW`87ClA0X-6l`Wm%&v2uKlzCS1yN!o`m1Soesyz5F!CB z08hXnh diff --git a/eng/common/testproxy/target_version.txt b/eng/common/testproxy/target_version.txt index 640f3e5d1d..0ea1143fba 100644 --- a/eng/common/testproxy/target_version.txt +++ b/eng/common/testproxy/target_version.txt @@ -1 +1 @@ -1.0.0-dev.20220630.4 +1.0.0-dev.20220810.2 diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 6a1652faec..e755496f90 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -270,13 +270,14 @@ jobs: - template: /eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Generate BOM' - condition: succeededOrFailed() - inputs: - BuildDropPath: $(Build.SourcesDirectory)/build + - ${{if eq(variables['System.TeamProject'], 'internal') }}: + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: 'Generate BOM' + condition: succeededOrFailed() + inputs: + BuildDropPath: $(Build.SourcesDirectory)/build - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactPath: '$(Build.SourcesDirectory)/build/_manifest' - ArtifactName: 'release_artifact_manifest' + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactPath: '$(Build.SourcesDirectory)/build/_manifest' + ArtifactName: 'release_artifact_manifest' diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 87b5eb0f82..1e1ede079b 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -271,13 +271,14 @@ jobs: displayName: Set bom file artifact name condition: succeededOrFailed() - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Generate BOM' - condition: succeededOrFailed() - inputs: - BuildDropPath: $(Build.ArtifactStagingDirectory) + - ${{if eq(variables['System.TeamProject'], 'internal') }}: + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: 'Generate BOM' + condition: succeededOrFailed() + inputs: + BuildDropPath: $(Build.ArtifactStagingDirectory) - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactPath: '$(Build.ArtifactStagingDirectory)/_manifest' - ArtifactName: 'bom_manifest_$(BomArtifactName)' \ No newline at end of file + - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + parameters: + ArtifactPath: '$(Build.ArtifactStagingDirectory)/_manifest' + ArtifactName: 'bom_manifest_$(BomArtifactName)' diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json index 1bab65ae73..a0ac2ef0c0 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json @@ -15,7 +15,7 @@ }, "Mac": { "Pool": "Azure Pipelines", - "OSVmImage": "macOS-10.15", + "OSVmImage": "macos-11", "VCPKG_DEFAULT_TRIPLET": "x64-osx" } } diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json index 701d9d055f..49ac2e648a 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json @@ -14,7 +14,7 @@ }, "Mac": { "Pool": "Azure Pipelines", - "OSVmImage": "macOS-10.15", + "OSVmImage": "macos-11", "CmakeEnvArg": "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include ", "BrewDependencies": "openssl" } diff --git a/eng/pipelines/templates/stages/platform-matrix-live.json b/eng/pipelines/templates/stages/platform-matrix-live.json index b843833c84..7e9f018107 100644 --- a/eng/pipelines/templates/stages/platform-matrix-live.json +++ b/eng/pipelines/templates/stages/platform-matrix-live.json @@ -7,7 +7,7 @@ "StaticConfigs": { "MacOS_x64_with_unit_test": { "Pool": "Azure Pipelines", - "OSVmImage": "macOS-10.15", + "OSVmImage": "macos-11", "VCPKG_DEFAULT_TRIPLET": "x64-osx", "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON", "AZURE_CORE_ENABLE_JSON_TESTS": 1, diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index 15571ad469..889b8392c3 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -5,11 +5,8 @@ "include": [ { "OSConfiguration": { - "macOS-10.15": { - "OSVmImage": "macOS-10.15" - }, "macOS-11": { - "OSVmImage": "macOS-11", + "OSVmImage": "macos-11", "XCODE_VERSION": "12.5.1" } }, diff --git a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md index 86367b48ee..abb1f76468 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md +++ b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.4 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 1.0.0-beta.3 (2022-08-04) + +### Other Changes + +- Removed hard dependency on `opentelemetry-cpp` package version. + ## 1.0.0-beta.2 (2022-06-30) ### Breaking Changes diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/private/package_version.hpp b/sdk/core/azure-core-tracing-opentelemetry/src/private/package_version.hpp index dae62804f5..fb747ab534 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/private/package_version.hpp +++ b/sdk/core/azure-core-tracing-opentelemetry/src/private/package_version.hpp @@ -13,7 +13,7 @@ #define AZURE_CORE_OPENTELEMETRY_VERSION_MAJOR 1 #define AZURE_CORE_OPENTELEMETRY_VERSION_MINOR 0 #define AZURE_CORE_OPENTELEMETRY_VERSION_PATCH 0 -#define AZURE_CORE_OPENTELEMETRY_VERSION_PRERELEASE "beta.3" +#define AZURE_CORE_OPENTELEMETRY_VERSION_PRERELEASE "beta.4" #define AZURE_CORE_OPENTELEMETRY_VERSION_ITOA_HELPER(i) #i #define AZURE_CORE_OPENTELEMETRY_VERSION_ITOA(i) AZURE_CORE_OPENTELEMETRY_VERSION_ITOA_HELPER(i) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index a22b3ae927..c7f91f9f98 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -13,6 +13,19 @@ ### Other Changes +## 1.7.1 (2022-08-04) + +### Bugs Fixed + +- [[#3794]](https://github.com/Azure/azure-sdk-for-cpp/issues/3794) Fix memory leak in `CurlTransport`. +- [[#3692]](https://github.com/Azure/azure-sdk-for-cpp/issues/3692) Interrupted poll calls cause spurious HTTP request failures. (A community contribution, courtesy of _[johnwheffner](https://github.com/johnwheffner)_) + +### Acknowledgments + +Thank you to our developer community members who helped to make Azure Core better with their contributions to this release: + +- John Heffner _([GitHub](https://github.com/johnwheffner))_ + ## 1.7.0 (2022-06-30) ### Features Added diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 417b9d891c..79ce8c0f06 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -2,12 +2,22 @@ // SPDX-License-Identifier: MIT #include "azure/core/base64.hpp" +#include "azure/core/platform.hpp" + +#if defined(AZ_PLATFORM_WINDOWS) +#if !defined(WIN32_LEAN_AND_MEAN) +#define WIN32_LEAN_AND_MEAN +#endif +#if !defined(NOMINMAX) +#define NOMINMAX +#endif +#endif + #include "azure/core/http/curl_transport.hpp" #include "azure/core/http/http.hpp" #include "azure/core/http/policies/policy.hpp" #include "azure/core/http/transport.hpp" #include "azure/core/internal/diagnostics/log.hpp" -#include "azure/core/platform.hpp" // Private include #include "curl_connection_pool_private.hpp" @@ -18,16 +28,11 @@ #include // for poll() #include // for socket shutdown #elif defined(AZ_PLATFORM_WINDOWS) -#if !defined(WIN32_LEAN_AND_MEAN) -#define WIN32_LEAN_AND_MEAN -#endif -#if !defined(NOMINMAX) -#define NOMINMAX -#endif #include // for WSAPoll(); #endif #include +#include #include #include #include @@ -101,25 +106,35 @@ int pollSocketUntilEventOrTimeout( // we use 1 as arg. // Cancelation is possible by calling poll() with small time intervals instead of using the - // requested timeout. Default interval for calling poll() is 1 sec whenever arg timeout is - // greater than 1 sec. Otherwise the interval is set to timeout - long interval = 1000; // 1 second - if (timeout < interval) - { - interval = timeout; - } + // requested timeout. The polling interval is 1 second. + static constexpr std::chrono::milliseconds pollInterval(1000); // 1 second int result = 0; - for (long counter = 0; counter < timeout && result == 0; counter = counter + interval) + auto now = std::chrono::steady_clock::now(); + auto deadline = now + std::chrono::milliseconds(timeout); + while (now < deadline) { // check cancelation context.ThrowIfCancelled(); + int pollTimeoutMs = static_cast( + std::min( + pollInterval, std::chrono::duration_cast(deadline - now)) + .count()); #if defined(AZ_PLATFORM_POSIX) - result = poll(&poller, 1, interval); + result = poll(&poller, 1, pollTimeoutMs); + if (result < 0 && EINTR == errno) + { + continue; + } #elif defined(AZ_PLATFORM_WINDOWS) - result = WSAPoll(&poller, 1, interval); + result = WSAPoll(&poller, 1, pollTimeoutMs); #endif + if (result != 0) + { + return result; + } + now = std::chrono::steady_clock::now(); } - // result can be either 0 (timeout) or > 1 (socket ready) + // result can be 0 (timeout), > 0 (socket ready), or < 0 (error) return result; } diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index 3461e12485..d5ec6f559b 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -679,17 +679,27 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( std::string reasonPhrase; DWORD sizeOfReasonPhrase = sizeOfHeaders; - if (WinHttpQueryHeaders( - requestHandle.get(), - WINHTTP_QUERY_STATUS_TEXT, - WINHTTP_HEADER_NAME_BY_INDEX, - outputBuffer.data(), - &sizeOfReasonPhrase, - WINHTTP_NO_HEADER_INDEX)) + // HTTP/2 does not support reason phrase, refer to + // https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2.4. + if (majorVersion == 1) { - start = outputBuffer.begin(); - reasonPhrase - = WideStringToString(std::wstring(start, start + sizeOfReasonPhrase / sizeof(WCHAR))); + if (WinHttpQueryHeaders( + requestHandle.get(), + WINHTTP_QUERY_STATUS_TEXT, + WINHTTP_HEADER_NAME_BY_INDEX, + outputBuffer.data(), + &sizeOfReasonPhrase, + WINHTTP_NO_HEADER_INDEX)) + { + // even with HTTP/1.1, we cannot assume that reason phrase is set since it is optional + // according to https://www.rfc-editor.org/rfc/rfc2616.html#section-6.1.1. + if (sizeOfReasonPhrase > 0) + { + start = outputBuffer.begin(); + reasonPhrase + = WideStringToString(std::wstring(start, start + sizeOfReasonPhrase / sizeof(WCHAR))); + } + } } // Allocate the instance of the response on the heap with a shared ptr so this memory gets diff --git a/sdk/storage/azure-storage-blobs/CHANGELOG.md b/sdk/storage/azure-storage-blobs/CHANGELOG.md index ecaf1a8736..09af321dd0 100644 --- a/sdk/storage/azure-storage-blobs/CHANGELOG.md +++ b/sdk/storage/azure-storage-blobs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.5.0-beta.3 (Unreleased) +## 12.6.0-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,27 @@ ### Other Changes +## 12.6.0-beta.1 (2022-08-09) + +### Features Added + +- Bumped up API version to `2021-04-10`. +- Added support for encryption scope SAS (`ses` query parameter in SAS token). +- Added encryption scope support for `BlobClient::CopyFromUri()`. +- Added support for filtering blobs on container level. +- Added support for tags copy mode (replace or copy from source) when copying blobs from URL. +- Added support for permanent delete permission in SAS. + +### Bugs Fixed + +- Fixed listing blobs failure when blob name contains invalid characters in xml. + +## 12.5.0 (2022-08-08) + +### Features Added + +- Features in `12.5.0.beta1` and `12.5.0.beta2` are now generally available. + ## 12.5.0-beta.2 (2022-07-07) ### Features Added diff --git a/sdk/storage/azure-storage-blobs/CMakeLists.txt b/sdk/storage/azure-storage-blobs/CMakeLists.txt index 8ecec312ec..9cb06ad5b6 100644 --- a/sdk/storage/azure-storage-blobs/CMakeLists.txt +++ b/sdk/storage/azure-storage-blobs/CMakeLists.txt @@ -32,9 +32,9 @@ if(FETCH_SOURCE_DEPS) add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL) endforeach() elseif(NOT AZ_ALL_LIBRARIES) - find_package(azure-storage-common-cpp "12.2.4" CONFIG QUIET) + find_package(azure-storage-common-cpp CONFIG QUIET) if(NOT azure-storage-common-cpp_FOUND) - find_package(azure-storage-common-cpp "12.2.4" REQUIRED) + find_package(azure-storage-common-cpp REQUIRED) endif() endif() diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp index e25d3c8235..74a4de2dc5 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp @@ -285,6 +285,24 @@ namespace Azure { namespace Storage { namespace Blobs { const UploadBlockBlobOptions& options = UploadBlockBlobOptions(), const Azure::Core::Context& context = Azure::Core::Context()) const; + /** + * @brief The Filter Blobs operation enables callers to list blobs in a container whose + * tags match a given search expression. + * + * @param tagFilterSqlExpression The where parameter enables the caller to query blobs + * whose tags match a given expression. The given expression must evaluate to true for a blob to + * be returned in the results. The [OData - ABNF] filter syntax rule defines the formal grammar + * for the value of the where query parameter, however, only a subset of the OData filter syntax + * is supported in the Blob service. + * @param options Optional parameters to execute this function. + * @param context Context for cancelling long running operations. + * @return A FindBlobsByTagsPagedResponse describing the blobs. + */ + FindBlobsByTagsPagedResponse FindBlobsByTags( + const std::string& tagFilterSqlExpression, + const FindBlobsByTagsOptions& options = FindBlobsByTagsOptions(), + const Azure::Core::Context& context = Azure::Core::Context()) const; + /** * @brief Creates a new batch object to collect subrequests that can be submitted together via * SubmitBatch. diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp index 912cee90ec..9235eeeb35 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp @@ -574,6 +574,12 @@ namespace Azure { namespace Storage { namespace Blobs { * Indicates whether the destination blob has a legal hold. */ Azure::Nullable HasLegalHold; + + /** + * Indicates the tags on the destination blob should be copied from source or replaced by Tags + * in this option. Default is to replace. + */ + Models::BlobCopySourceTagsMode CopySourceTagsMode; }; /** @@ -932,6 +938,12 @@ namespace Azure { namespace Storage { namespace Blobs { * If the two hashes do not match, the operation will fail. */ Azure::Nullable TransactionalContentHash; + + /** + * Indicates the tags on the destination blob should be copied from source or replaced by Tags + * in this option. Default is to replace. + */ + Models::BlobCopySourceTagsMode CopySourceTagsMode; }; /** diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_responses.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_responses.hpp index 573265ca44..b0bf4fdd64 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_responses.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_responses.hpp @@ -163,6 +163,49 @@ namespace Azure { namespace Storage { std::string LeaseId; }; + /** + * @brief An Azure Storage blob. + */ + struct BlobItem final + { + /** + * Blob name. + */ + std::string Name; + /** + * Indicates whether this blob was deleted. + */ + bool IsDeleted = bool(); + /** + * A string value that uniquely identifies a blob snapshot. + */ + std::string Snapshot; + /** + * A string value that uniquely identifies a blob version. + */ + Nullable VersionId; + /** + * Indicates if this is the current version of the blob. + */ + Nullable IsCurrentVersion; + /** + * Properties of a blob. + */ + BlobItemDetails Details; + /** + * Indicates that this root blob has been deleted, but it has versions that are active. + */ + Nullable HasVersionsOnly; + /** + * Size in bytes. + */ + int64_t BlobSize = int64_t(); + /** + * Type of the blob. + */ + Models::BlobType BlobType; + }; + /** * @brief Response type for #Azure::Storage::Blobs::BlobBatchClient::SubmitBatch. */ @@ -267,10 +310,12 @@ namespace Azure { namespace Storage { void OnNextPage(const Azure::Core::Context& context); std::shared_ptr m_blobServiceClient; + std::shared_ptr m_blobContainerClient; FindBlobsByTagsOptions m_operationOptions; std::string m_tagFilterSqlExpression; friend class BlobServiceClient; + friend class BlobContainerClient; friend class Azure::Core::PagedResponse; }; diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_sas_builder.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_sas_builder.hpp index b988b4ba21..16c27507a3 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_sas_builder.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_sas_builder.hpp @@ -90,6 +90,11 @@ namespace Azure { namespace Storage { namespace Sas { */ SetImmutabilityPolicy = 256, + /** + * @brief Indicates that permanent delete is permitted. + */ + PermanentDelete = 512, + /** * @brief Indicates that all permissions are set. */ @@ -160,6 +165,11 @@ namespace Azure { namespace Storage { namespace Sas { */ SetImmutabilityPolicy = 128, + /** + * @brief Indicates that permanent delete is permitted. + */ + PermanentDelete = 256, + /** * @brief Indicates that all permissions are set. */ @@ -269,6 +279,11 @@ namespace Azure { namespace Storage { namespace Sas { */ std::string ContentType; + /** + * @brief Optional encryption scope to use when sending requests authorized with this SAS url. + */ + std::string EncryptionScope; + /** * @brief Sets the permissions for the blob container SAS. * diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/rest_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/rest_client.hpp index 316f370646..2cb58be985 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/rest_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/rest_client.hpp @@ -31,7 +31,7 @@ namespace Azure { namespace Storage { namespace Blobs { /** * The version used for the operations to Azure storage services. */ - constexpr static const char* ApiVersion = "2020-10-02"; + constexpr static const char* ApiVersion = "2021-04-10"; } // namespace _detail namespace Models { /** @@ -619,20 +619,6 @@ namespace Azure { namespace Storage { namespace Blobs { */ std::map Tags; }; - namespace _detail { - /** - * @brief The result of a Filter Blobs API call. - */ - struct FindBlobsByTagsResult final - { - std::string ServiceEndpoint; - /** - * Array of TaggedBlobItem. - */ - std::vector Items; - Nullable ContinuationToken; - }; - } // namespace _detail /** * @brief Response type for #Azure::Storage::Blobs::BlobContainerClient::Create. */ @@ -820,6 +806,18 @@ namespace Azure { namespace Storage { namespace Blobs { */ std::string ContentType; }; + /** + * @brief The result of a Filter Blobs API call. + */ + struct FindBlobsByTagsResult final + { + std::string ServiceEndpoint; + /** + * Array of TaggedBlobItem. + */ + std::vector Items; + Nullable ContinuationToken; + }; /** * @brief Response type for #Azure::Storage::Blobs::BlobContainerClient::AcquireLease. */ @@ -921,6 +919,17 @@ namespace Azure { namespace Storage { namespace Blobs { */ std::string LeaseId; }; + struct BlobName final + { + /** + * Indicates if the blob name is encoded. + */ + bool Encoded = bool(); + /** + * The name of the blob. + */ + std::string Content; + }; } // namespace _detail /** * @brief Status of the copy operation. @@ -1314,48 +1323,50 @@ namespace Azure { namespace Storage { namespace Blobs { private: std::string m_value; }; - /** - * @brief An Azure Storage blob. - */ - struct BlobItem final - { - /** - * Blob name. - */ - std::string Name; - /** - * Indicates whether this blob was deleted. - */ - bool IsDeleted = bool(); - /** - * A string value that uniquely identifies a blob snapshot. - */ - std::string Snapshot; - /** - * A string value that uniquely identifies a blob version. - */ - Nullable VersionId; - /** - * Indicates if this is the current version of the blob. - */ - Nullable IsCurrentVersion; - /** - * Properties of a blob. - */ - BlobItemDetails Details; - /** - * Indicates that this root blob has been deleted, but it has versions that are active. - */ - Nullable HasVersionsOnly; - /** - * Size in bytes. - */ - int64_t BlobSize = int64_t(); + namespace _detail { /** - * Type of the blob. + * @brief An Azure Storage blob. */ - Models::BlobType BlobType; - }; + struct BlobItem final + { + /** + * Blob name. + */ + BlobName Name; + /** + * Indicates whether this blob was deleted. + */ + bool IsDeleted = bool(); + /** + * A string value that uniquely identifies a blob snapshot. + */ + std::string Snapshot; + /** + * A string value that uniquely identifies a blob version. + */ + Nullable VersionId; + /** + * Indicates if this is the current version of the blob. + */ + Nullable IsCurrentVersion; + /** + * Properties of a blob. + */ + BlobItemDetails Details; + /** + * Indicates that this root blob has been deleted, but it has versions that are active. + */ + Nullable HasVersionsOnly; + /** + * Size in bytes. + */ + int64_t BlobSize = int64_t(); + /** + * Type of the blob. + */ + Models::BlobType BlobType; + }; + } // namespace _detail /** * @brief Include this parameter to specify one or more datasets to include in the response. */ @@ -1423,9 +1434,9 @@ namespace Azure { namespace Storage { namespace Blobs { */ std::vector Items; /** - * Array of ListBlobsHierarchySegmentResponseBlobPrefixesItem. + * Array of BlobName. */ - std::vector BlobPrefixes; + std::vector BlobPrefixes; }; } // namespace _detail /** @@ -2159,6 +2170,26 @@ namespace Azure { namespace Storage { namespace Blobs { Models::CopyStatus CopyStatus; }; } // namespace _detail + /** + * @brief Optional, default 'replace'. Indicates if source tags should be copied or replaced + * with the tags specified by x-ms-tags. + */ + class BlobCopySourceTagsMode final { + public: + BlobCopySourceTagsMode() = default; + explicit BlobCopySourceTagsMode(std::string value) : m_value(std::move(value)) {} + bool operator==(const BlobCopySourceTagsMode& other) const + { + return m_value == other.m_value; + } + bool operator!=(const BlobCopySourceTagsMode& other) const { return !(*this == other); } + const std::string& ToString() const { return m_value; } + AZ_STORAGE_BLOBS_DLLEXPORT const static BlobCopySourceTagsMode Replace; + AZ_STORAGE_BLOBS_DLLEXPORT const static BlobCopySourceTagsMode Copy; + + private: + std::string m_value; + }; /** * @brief Response type for #Azure::Storage::Blobs::BlobClient::CopyFromUri. */ @@ -2194,6 +2225,12 @@ namespace Azure { namespace Storage { namespace Blobs { * copied content. This header is only returned if the source content MD5 was specified. */ Nullable TransactionalContentHash; + /** + * Returns the name of the encryption scope used to encrypt the blob contents and application + * metadata. Note that the absence of this header implies use of the default account + * encryption scope. + */ + Nullable EncryptionScope; }; /** * @brief Response type for #Azure::Storage::Blobs::BlobClient::AbortCopyFromUri. @@ -3323,6 +3360,17 @@ namespace Azure { namespace Storage { namespace Blobs { Core::IO::BodyStream& requestBody, const SubmitBlobContainerBatchOptions& options, const Core::Context& context); + struct FindBlobContainerBlobsByTagsOptions final + { + Nullable Where; + Nullable Marker; + Nullable MaxResults; + }; + static Response FindBlobsByTags( + Core::Http::_internal::HttpPipeline& pipeline, + const Core::Url& url, + const FindBlobContainerBlobsByTagsOptions& options, + const Core::Context& context); struct AcquireBlobContainerLeaseOptions final { Nullable Duration; @@ -3692,6 +3740,8 @@ namespace Azure { namespace Storage { namespace Blobs { Nullable ImmutabilityPolicyMode; Nullable LegalHold; Nullable CopySourceAuthorization; + Nullable EncryptionScope; + Nullable CopySourceTags; Nullable> SourceContentcrc64; }; static Response CopyFromUri( @@ -4134,6 +4184,7 @@ namespace Azure { namespace Storage { namespace Blobs { std::string CopySource; Nullable CopySourceBlobProperties; Nullable CopySourceAuthorization; + Nullable CopySourceTags; Nullable> SourceContentcrc64; }; static Response UploadFromUri( diff --git a/sdk/storage/azure-storage-blobs/src/blob_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_client.cpp index f82598396e..e391f3e376 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_client.cpp @@ -677,6 +677,8 @@ namespace Azure { namespace Storage { namespace Blobs { protocolLayerOptions.ImmutabilityPolicyMode = options.ImmutabilityPolicy.Value().PolicyMode; } protocolLayerOptions.LegalHold = options.HasLegalHold; + protocolLayerOptions.EncryptionScope = m_encryptionScope; + protocolLayerOptions.CopySourceTags = options.CopySourceTagsMode; return _detail::BlobClient::CopyFromUri(*m_pipeline, m_blobUrl, protocolLayerOptions, context); } diff --git a/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp index b79eab00a4..806a753aaf 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp @@ -22,6 +22,87 @@ namespace Azure { namespace Storage { namespace Blobs { + namespace { + Models::BlobItem BlobItemConversion(Models::_detail::BlobItem& item) + { + Models::BlobItem blobItem; + if (item.Name.Encoded) + { + blobItem.Name = Core::Url::Decode(item.Name.Content); + } + else + { + blobItem.Name = std::move(item.Name.Content); + } + blobItem.IsDeleted = item.IsDeleted; + blobItem.Snapshot = std::move(item.Snapshot); + blobItem.VersionId = std::move(item.VersionId); + blobItem.IsCurrentVersion = item.IsCurrentVersion; + blobItem.Details = std::move(item.Details); + blobItem.HasVersionsOnly = item.HasVersionsOnly; + blobItem.BlobSize = item.BlobSize; + blobItem.BlobType = std::move(item.BlobType); + if (blobItem.Details.AccessTier.HasValue() + && !blobItem.Details.IsAccessTierInferred.HasValue()) + { + blobItem.Details.IsAccessTierInferred = false; + } + if (blobItem.VersionId.HasValue()) + { + if (!blobItem.HasVersionsOnly.HasValue()) + { + blobItem.HasVersionsOnly = false; + } + if (!blobItem.IsCurrentVersion.HasValue()) + { + blobItem.IsCurrentVersion = false; + } + } + if (blobItem.BlobType == Models::BlobType::AppendBlob + && !blobItem.Details.IsSealed.HasValue()) + { + blobItem.Details.IsSealed = false; + } + if (blobItem.Details.CopyStatus.HasValue() && !blobItem.Details.IsIncrementalCopy.HasValue()) + { + blobItem.Details.IsIncrementalCopy = false; + } + { + /* + * Object replication metadata is in the following format. + * + * replication status + * <...> + * + * + * We'll convert the metadata to a vector of policies, each policy being a vector of rules. + */ + std::map> orPropertiesMap; + for (auto& policy : blobItem.Details.ObjectReplicationSourceProperties) + { + for (auto& rule : policy.Rules) + { + auto underscorePos = rule.RuleId.find('_', 3); + std::string policyId + = std::string(rule.RuleId.begin() + 3, rule.RuleId.begin() + underscorePos); + std::string ruleId = rule.RuleId.substr(underscorePos + 1); + rule.RuleId = ruleId; + orPropertiesMap[policyId].emplace_back(std::move(rule)); + } + } + blobItem.Details.ObjectReplicationSourceProperties.clear(); + for (auto& property : orPropertiesMap) + { + Models::ObjectReplicationPolicy policy; + policy.PolicyId = property.first; + policy.Rules = std::move(property.second); + blobItem.Details.ObjectReplicationSourceProperties.emplace_back(std::move(policy)); + } + } + return blobItem; + } + } // namespace + BlobContainerClient BlobContainerClient::CreateFromConnectionString( const std::string& connectionString, const std::string& blobContainerName, @@ -271,61 +352,15 @@ namespace Azure { namespace Storage { namespace Blobs { m_blobContainerUrl, protocolLayerOptions, _internal::WithReplicaStatus(context)); - for (auto& i : response.Value.Items) - { - if (i.Details.AccessTier.HasValue() && !i.Details.IsAccessTierInferred.HasValue()) - { - i.Details.IsAccessTierInferred = false; - } - if (i.VersionId.HasValue()) - { - if (!i.HasVersionsOnly.HasValue()) - { - i.HasVersionsOnly = false; - } - if (!i.IsCurrentVersion.HasValue()) - { - i.IsCurrentVersion = false; - } - } - if (i.BlobType == Models::BlobType::AppendBlob && !i.Details.IsSealed.HasValue()) - { - i.Details.IsSealed = false; - } - if (i.Details.CopyStatus.HasValue() && !i.Details.IsIncrementalCopy.HasValue()) - { - i.Details.IsIncrementalCopy = false; - } - { - std::map> orPropertiesMap; - for (auto& policy : i.Details.ObjectReplicationSourceProperties) - { - for (auto& rule : policy.Rules) - { - auto underscorePos = rule.RuleId.find('_', 3); - std::string policyId - = std::string(rule.RuleId.begin() + 3, rule.RuleId.begin() + underscorePos); - std::string ruleId = rule.RuleId.substr(underscorePos + 1); - rule.RuleId = ruleId; - orPropertiesMap[policyId].emplace_back(std::move(rule)); - } - } - i.Details.ObjectReplicationSourceProperties.clear(); - for (auto& property : orPropertiesMap) - { - Models::ObjectReplicationPolicy policy; - policy.PolicyId = property.first; - policy.Rules = std::move(property.second); - i.Details.ObjectReplicationSourceProperties.emplace_back(std::move(policy)); - } - } - } ListBlobsPagedResponse pagedResponse; pagedResponse.ServiceEndpoint = std::move(response.Value.ServiceEndpoint); pagedResponse.BlobContainerName = std::move(response.Value.BlobContainerName); pagedResponse.Prefix = std::move(response.Value.Prefix); - pagedResponse.Blobs = std::move(response.Value.Items); + for (auto& i : response.Value.Items) + { + pagedResponse.Blobs.push_back(BlobItemConversion(i)); + } pagedResponse.m_blobContainerClient = std::make_shared(*this); pagedResponse.m_operationOptions = options; pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string()); @@ -351,55 +386,6 @@ namespace Azure { namespace Storage { namespace Blobs { m_blobContainerUrl, protocolLayerOptions, _internal::WithReplicaStatus(context)); - for (auto& i : response.Value.Items) - { - if (i.Details.AccessTier.HasValue() && !i.Details.IsAccessTierInferred.HasValue()) - { - i.Details.IsAccessTierInferred = false; - } - if (i.VersionId.HasValue()) - { - if (!i.HasVersionsOnly.HasValue()) - { - i.HasVersionsOnly = false; - } - if (!i.IsCurrentVersion.HasValue()) - { - i.IsCurrentVersion = false; - } - } - if (i.BlobType == Models::BlobType::AppendBlob && !i.Details.IsSealed.HasValue()) - { - i.Details.IsSealed = false; - } - if (i.Details.CopyStatus.HasValue() && !i.Details.IsIncrementalCopy.HasValue()) - { - i.Details.IsIncrementalCopy = false; - } - { - std::map> orPropertiesMap; - for (auto& policy : i.Details.ObjectReplicationSourceProperties) - { - for (auto& rule : policy.Rules) - { - auto underscorePos = rule.RuleId.find('_', 3); - std::string policyId - = std::string(rule.RuleId.begin() + 3, rule.RuleId.begin() + underscorePos); - std::string ruleId = rule.RuleId.substr(underscorePos + 1); - rule.RuleId = ruleId; - orPropertiesMap[policyId].emplace_back(std::move(rule)); - } - } - i.Details.ObjectReplicationSourceProperties.clear(); - for (auto& property : orPropertiesMap) - { - Models::ObjectReplicationPolicy policy; - policy.PolicyId = property.first; - policy.Rules = std::move(property.second); - i.Details.ObjectReplicationSourceProperties.emplace_back(std::move(policy)); - } - } - } ListBlobsByHierarchyPagedResponse pagedResponse; @@ -407,8 +393,21 @@ namespace Azure { namespace Storage { namespace Blobs { pagedResponse.BlobContainerName = std::move(response.Value.BlobContainerName); pagedResponse.Prefix = std::move(response.Value.Prefix); pagedResponse.Delimiter = std::move(response.Value.Delimiter); - pagedResponse.Blobs = std::move(response.Value.Items); - pagedResponse.BlobPrefixes = std::move(response.Value.BlobPrefixes); + for (auto& i : response.Value.Items) + { + pagedResponse.Blobs.push_back(BlobItemConversion(i)); + } + for (auto& i : response.Value.BlobPrefixes) + { + if (i.Encoded) + { + pagedResponse.BlobPrefixes.push_back(Core::Url::Decode(i.Content)); + } + else + { + pagedResponse.BlobPrefixes.push_back(std::move(i.Content)); + } + } pagedResponse.m_blobContainerClient = std::make_shared(*this); pagedResponse.m_operationOptions = options; pagedResponse.m_delimiter = delimiter; @@ -467,6 +466,34 @@ namespace Azure { namespace Storage { namespace Blobs { std::move(blockBlobClient), std::move(response.RawResponse)); } + FindBlobsByTagsPagedResponse BlobContainerClient::FindBlobsByTags( + const std::string& tagFilterSqlExpression, + const FindBlobsByTagsOptions& options, + const Azure::Core::Context& context) const + { + _detail::BlobContainerClient::FindBlobContainerBlobsByTagsOptions protocolLayerOptions; + protocolLayerOptions.Where = tagFilterSqlExpression; + protocolLayerOptions.Marker = options.ContinuationToken; + protocolLayerOptions.MaxResults = options.PageSizeHint; + auto response = _detail::BlobContainerClient::FindBlobsByTags( + *m_pipeline, + m_blobContainerUrl, + protocolLayerOptions, + _internal::WithReplicaStatus(context)); + + FindBlobsByTagsPagedResponse pagedResponse; + pagedResponse.ServiceEndpoint = std::move(response.Value.ServiceEndpoint); + pagedResponse.TaggedBlobs = std::move(response.Value.Items); + pagedResponse.m_blobContainerClient = std::make_shared(*this); + pagedResponse.m_operationOptions = options; + pagedResponse.m_tagFilterSqlExpression = tagFilterSqlExpression; + pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string()); + pagedResponse.NextPageToken = response.Value.ContinuationToken; + pagedResponse.RawResponse = std::move(response.RawResponse); + + return pagedResponse; + } + BlobContainerBatch BlobContainerClient::CreateBatch() const { return BlobContainerBatch(*this); } Response BlobContainerClient::SubmitBatch( @@ -487,5 +514,4 @@ namespace Azure { namespace Storage { namespace Blobs { return Azure::Response( Models::SubmitBlobBatchResult(), std::move(response.RawResponse)); } - }}} // namespace Azure::Storage::Blobs diff --git a/sdk/storage/azure-storage-blobs/src/blob_responses.cpp b/sdk/storage/azure-storage-blobs/src/blob_responses.cpp index a8f5269d65..bc736cbd4c 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_responses.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_responses.cpp @@ -70,8 +70,16 @@ namespace Azure { namespace Storage { namespace Blobs { void FindBlobsByTagsPagedResponse::OnNextPage(const Azure::Core::Context& context) { m_operationOptions.ContinuationToken = NextPageToken; - *this = m_blobServiceClient->FindBlobsByTags( - m_tagFilterSqlExpression, m_operationOptions, context); + if (m_blobServiceClient) + { + *this = m_blobServiceClient->FindBlobsByTags( + m_tagFilterSqlExpression, m_operationOptions, context); + } + else + { + *this = m_blobContainerClient->FindBlobsByTags( + m_tagFilterSqlExpression, m_operationOptions, context); + } } void ListBlobsPagedResponse::OnNextPage(const Azure::Core::Context& context) diff --git a/sdk/storage/azure-storage-blobs/src/blob_sas_builder.cpp b/sdk/storage/azure-storage-blobs/src/blob_sas_builder.cpp index 35d7677df0..c629933eab 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_sas_builder.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_sas_builder.cpp @@ -67,6 +67,11 @@ namespace Azure { namespace Storage { namespace Sas { { Permissions += "x"; } + if ((permissions & BlobContainerSasPermissions::PermanentDelete) + == BlobContainerSasPermissions::PermanentDelete) + { + Permissions += "y"; + } if ((permissions & BlobContainerSasPermissions::List) == BlobContainerSasPermissions::List) { Permissions += "l"; @@ -110,6 +115,10 @@ namespace Azure { namespace Storage { namespace Sas { { Permissions += "x"; } + if ((permissions & BlobSasPermissions::PermanentDelete) == BlobSasPermissions::PermanentDelete) + { + Permissions += "y"; + } if ((permissions & BlobSasPermissions::Tags) == BlobSasPermissions::Tags) { Permissions += "t"; @@ -154,8 +163,8 @@ namespace Azure { namespace Storage { namespace Sas { std::string stringToSign = Permissions + "\n" + startsOnStr + "\n" + expiresOnStr + "\n" + canonicalName + "\n" + Identifier + "\n" + (IPRange.HasValue() ? IPRange.Value() : "") + "\n" + protocol + "\n" + SasVersion + "\n" + resource + "\n" + snapshotVersion + "\n" - + CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage - + "\n" + ContentType; + + EncryptionScope + "\n" + CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + + "\n" + ContentLanguage + "\n" + ContentType; std::string signature = Azure::Core::Convert::Base64Encode(_internal::HmacSha256( std::vector(stringToSign.begin(), stringToSign.end()), @@ -206,6 +215,10 @@ namespace Azure { namespace Storage { namespace Sas { { builder.AppendQueryParameter("rsct", _internal::UrlEncodeQueryParameter(ContentType)); } + if (!EncryptionScope.empty()) + { + builder.AppendQueryParameter("ses", _internal::UrlEncodeQueryParameter(EncryptionScope)); + } return builder.GetAbsoluteUrl(); } @@ -249,8 +262,9 @@ namespace Azure { namespace Storage { namespace Sas { + userDelegationKey.SignedTenantId + "\n" + signedStartsOnStr + "\n" + signedExpiresOnStr + "\n" + userDelegationKey.SignedService + "\n" + userDelegationKey.SignedVersion + "\n\n\n\n" + (IPRange.HasValue() ? IPRange.Value() : "") + "\n" + protocol + "\n" - + SasVersion + "\n" + resource + "\n" + snapshotVersion + "\n" + CacheControl + "\n" - + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage + "\n" + ContentType; + + SasVersion + "\n" + resource + "\n" + snapshotVersion + "\n" + EncryptionScope + "\n" + + CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage + + "\n" + ContentType; std::string signature = Azure::Core::Convert::Base64Encode(_internal::HmacSha256( std::vector(stringToSign.begin(), stringToSign.end()), @@ -300,6 +314,10 @@ namespace Azure { namespace Storage { namespace Sas { { builder.AppendQueryParameter("rsct", _internal::UrlEncodeQueryParameter(ContentType)); } + if (!EncryptionScope.empty()) + { + builder.AppendQueryParameter("ses", _internal::UrlEncodeQueryParameter(EncryptionScope)); + } builder.AppendQueryParameter("sig", _internal::UrlEncodeQueryParameter(signature)); return builder.GetAbsoluteUrl(); diff --git a/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp b/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp index 9e14727dfd..9aefdafc0e 100644 --- a/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp @@ -378,6 +378,7 @@ namespace Azure { namespace Storage { namespace Blobs { protocolLayerOptions.EncryptionAlgorithm = m_customerProvidedKey.Value().Algorithm.ToString(); } protocolLayerOptions.EncryptionScope = m_encryptionScope; + protocolLayerOptions.CopySourceTags = options.CopySourceTagsMode; return _detail::BlockBlobClient::UploadFromUri( *m_pipeline, m_blobUrl, protocolLayerOptions, context); } diff --git a/sdk/storage/azure-storage-blobs/src/private/package_version.hpp b/sdk/storage/azure-storage-blobs/src/private/package_version.hpp index 7b4f6ff65e..86c7dd8e07 100644 --- a/sdk/storage/azure-storage-blobs/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-blobs/src/private/package_version.hpp @@ -9,9 +9,9 @@ #pragma once #define AZURE_STORAGE_BLOBS_VERSION_MAJOR 12 -#define AZURE_STORAGE_BLOBS_VERSION_MINOR 5 +#define AZURE_STORAGE_BLOBS_VERSION_MINOR 6 #define AZURE_STORAGE_BLOBS_VERSION_PATCH 0 -#define AZURE_STORAGE_BLOBS_VERSION_PRERELEASE "beta.3" +#define AZURE_STORAGE_BLOBS_VERSION_PRERELEASE "beta.2" #define AZURE_STORAGE_BLOBS_VERSION_ITOA_HELPER(i) #i #define AZURE_STORAGE_BLOBS_VERSION_ITOA(i) AZURE_STORAGE_BLOBS_VERSION_ITOA_HELPER(i) diff --git a/sdk/storage/azure-storage-blobs/src/rest_client.cpp b/sdk/storage/azure-storage-blobs/src/rest_client.cpp index 4fdcad2249..1678ac9b72 100644 --- a/sdk/storage/azure-storage-blobs/src/rest_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/rest_client.cpp @@ -170,6 +170,8 @@ namespace Azure { namespace Storage { namespace Blobs { "RelativeToCreation"); const ScheduleBlobExpiryOriginType ScheduleBlobExpiryOriginType::RelativeToNow("RelativeToNow"); const ScheduleBlobExpiryOriginType ScheduleBlobExpiryOriginType::Absolute("Absolute"); + const BlobCopySourceTagsMode BlobCopySourceTagsMode::Replace("REPLACE"); + const BlobCopySourceTagsMode BlobCopySourceTagsMode::Copy("COPY"); namespace _detail { const QueryRequestQueryType QueryRequestQueryType::SQL("SQL"); const QueryFormatType QueryFormatType::Delimited("delimited"); @@ -374,7 +376,7 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -394,7 +396,7 @@ namespace Azure { namespace Storage { namespace Blobs { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -690,7 +692,7 @@ namespace Azure { namespace Storage { namespace Blobs { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "stats"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -790,7 +792,7 @@ namespace Azure { namespace Storage { namespace Blobs { _internal::UrlEncodeQueryParameter( ListBlobContainersIncludeFlagsToString(options.Include.Value()))); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1075,7 +1077,7 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "userdelegationkey"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1190,7 +1192,7 @@ namespace Azure { namespace Storage { namespace Blobs { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "account"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -1220,7 +1222,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("Content-Type", options.MultipartContentType); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -1241,7 +1243,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("comp", "blobs"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.Where.HasValue() && !options.Where.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1397,7 +1399,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-blob-public-access", options.Access.ToString()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.DefaultEncryptionScope.HasValue() && !options.DefaultEncryptionScope.Value().empty()) { @@ -1434,7 +1436,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1512,7 +1514,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Unmodified-Since", options.IfUnmodifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -1546,7 +1548,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Modified-Since", options.IfModifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1573,7 +1575,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1742,7 +1744,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Unmodified-Since", options.IfUnmodifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1765,7 +1767,7 @@ namespace Azure { namespace Storage { namespace Blobs { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "container"); request.GetUrl().AppendQueryParameter("comp", "undelete"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.DeletedContainerName.HasValue() && !options.DeletedContainerName.Value().empty()) { request.SetHeader("x-ms-deleted-container-name", options.DeletedContainerName.Value()); @@ -1795,7 +1797,7 @@ namespace Azure { namespace Storage { namespace Blobs { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "container"); request.GetUrl().AppendQueryParameter("comp", "rename"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (!options.SourceContainerName.empty()) { request.SetHeader("x-ms-source-container-name", options.SourceContainerName); @@ -1829,7 +1831,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("Content-Type", options.MultipartContentType); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -1842,6 +1844,155 @@ namespace Azure { namespace Storage { namespace Blobs { return Response( std::move(response), std::move(pRawResponse)); } + Response BlobContainerClient::FindBlobsByTags( + Core::Http::_internal::HttpPipeline& pipeline, + const Core::Url& url, + const FindBlobContainerBlobsByTagsOptions& options, + const Core::Context& context) + { + auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); + request.GetUrl().AppendQueryParameter("restype", "container"); + request.GetUrl().AppendQueryParameter("comp", "blobs"); + request.SetHeader("x-ms-version", "2021-04-10"); + if (options.Where.HasValue() && !options.Where.Value().empty()) + { + request.GetUrl().AppendQueryParameter( + "where", _internal::UrlEncodeQueryParameter(options.Where.Value())); + } + if (options.Marker.HasValue() && !options.Marker.Value().empty()) + { + request.GetUrl().AppendQueryParameter( + "marker", _internal::UrlEncodeQueryParameter(options.Marker.Value())); + } + if (options.MaxResults.HasValue()) + { + request.GetUrl().AppendQueryParameter( + "maxresults", std::to_string(options.MaxResults.Value())); + } + auto pRawResponse = pipeline.Send(request, context); + auto httpStatusCode = pRawResponse->GetStatusCode(); + if (httpStatusCode != Core::Http::HttpStatusCode::Ok) + { + throw StorageException::CreateFromResponse(std::move(pRawResponse)); + } + Models::_detail::FindBlobsByTagsResult response; + { + const auto& responseBody = pRawResponse->GetBody(); + _internal::XmlReader reader( + reinterpret_cast(responseBody.data()), responseBody.size()); + enum class XmlTagEnum + { + kUnknown, + kEnumerationResults, + kBlobs, + kBlob, + kName, + kContainerName, + kTags, + kTagSet, + kTag, + kKey, + kValue, + kNextMarker, + }; + const std::unordered_map XmlTagEnumMap{ + {"EnumerationResults", XmlTagEnum::kEnumerationResults}, + {"Blobs", XmlTagEnum::kBlobs}, + {"Blob", XmlTagEnum::kBlob}, + {"Name", XmlTagEnum::kName}, + {"ContainerName", XmlTagEnum::kContainerName}, + {"Tags", XmlTagEnum::kTags}, + {"TagSet", XmlTagEnum::kTagSet}, + {"Tag", XmlTagEnum::kTag}, + {"Key", XmlTagEnum::kKey}, + {"Value", XmlTagEnum::kValue}, + {"NextMarker", XmlTagEnum::kNextMarker}, + }; + std::vector xmlPath; + Models::TaggedBlobItem vectorElement1; + std::string mapKey2; + std::string mapValue3; + while (true) + { + auto node = reader.Read(); + if (node.Type == _internal::XmlNodeType::End) + { + break; + } + else if (node.Type == _internal::XmlNodeType::StartTag) + { + auto ite = XmlTagEnumMap.find(node.Name); + xmlPath.push_back(ite == XmlTagEnumMap.end() ? XmlTagEnum::kUnknown : ite->second); + } + else if (node.Type == _internal::XmlNodeType::Text) + { + if (xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob + && xmlPath[3] == XmlTagEnum::kName) + { + vectorElement1.BlobName = node.Value; + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob + && xmlPath[3] == XmlTagEnum::kContainerName) + { + vectorElement1.BlobContainerName = node.Value; + } + else if ( + xmlPath.size() == 7 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob + && xmlPath[3] == XmlTagEnum::kTags && xmlPath[4] == XmlTagEnum::kTagSet + && xmlPath[5] == XmlTagEnum::kTag && xmlPath[6] == XmlTagEnum::kKey) + { + mapKey2 = node.Value; + } + else if ( + xmlPath.size() == 7 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob + && xmlPath[3] == XmlTagEnum::kTags && xmlPath[4] == XmlTagEnum::kTagSet + && xmlPath[5] == XmlTagEnum::kTag && xmlPath[6] == XmlTagEnum::kValue) + { + mapValue3 = node.Value; + } + else if ( + xmlPath.size() == 2 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kNextMarker) + { + response.ContinuationToken = node.Value; + } + } + else if (node.Type == _internal::XmlNodeType::Attribute) + { + if (xmlPath.size() == 1 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && node.Name == "ServiceEndpoint") + { + response.ServiceEndpoint = node.Value; + } + } + else if (node.Type == _internal::XmlNodeType::EndTag) + { + if (xmlPath.size() == 7 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob + && xmlPath[3] == XmlTagEnum::kTags && xmlPath[4] == XmlTagEnum::kTagSet + && xmlPath[5] == XmlTagEnum::kTag && xmlPath[6] == XmlTagEnum::kValue) + { + vectorElement1.Tags[std::move(mapKey2)] = std::move(mapValue3); + } + else if ( + xmlPath.size() == 3 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob) + { + response.Items.push_back(std::move(vectorElement1)); + vectorElement1 = Models::TaggedBlobItem(); + } + xmlPath.pop_back(); + } + } + } + return Response( + std::move(response), std::move(pRawResponse)); + } Response BlobContainerClient::AcquireLease( Core::Http::_internal::HttpPipeline& pipeline, const Core::Url& url, @@ -1872,7 +2023,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Unmodified-Since", options.IfUnmodifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -1913,7 +2064,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Unmodified-Since", options.IfUnmodifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1953,7 +2104,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Unmodified-Since", options.IfUnmodifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1994,7 +2145,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Unmodified-Since", options.IfUnmodifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -2039,7 +2190,7 @@ namespace Azure { namespace Storage { namespace Blobs { "If-Unmodified-Since", options.IfUnmodifiedSince.Value().ToString(Azure::DateTime::DateFormat::Rfc1123)); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2086,7 +2237,7 @@ namespace Azure { namespace Storage { namespace Blobs { _internal::UrlEncodeQueryParameter( ListBlobsIncludeFlagsToString(options.Include.Value()))); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2221,7 +2372,7 @@ namespace Azure { namespace Storage { namespace Blobs { {"BlobType", XmlTagEnum::kBlobType}, }; std::vector xmlPath; - Models::BlobItem vectorElement1; + Models::_detail::BlobItem vectorElement1; std::string mapKey2; std::string mapValue3; std::string mapKey4; @@ -2285,7 +2436,7 @@ namespace Azure { namespace Storage { namespace Blobs { && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob && xmlPath[3] == XmlTagEnum::kName) { - vectorElement1.Name = node.Value; + vectorElement1.Name.Content = node.Value; } else if ( xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults @@ -2670,6 +2821,13 @@ namespace Azure { namespace Storage { namespace Blobs { { response.BlobContainerName = node.Value; } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob + && xmlPath[3] == XmlTagEnum::kName && node.Name == "Encoded") + { + vectorElement1.Name.Encoded = node.Value == std::string("true"); + } } else if (node.Type == _internal::XmlNodeType::EndTag) { @@ -2703,7 +2861,7 @@ namespace Azure { namespace Storage { namespace Blobs { && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob) { response.Items.push_back(std::move(vectorElement1)); - vectorElement1 = Models::BlobItem(); + vectorElement1 = Models::_detail::BlobItem(); } xmlPath.pop_back(); } @@ -2749,7 +2907,7 @@ namespace Azure { namespace Storage { namespace Blobs { _internal::UrlEncodeQueryParameter( ListBlobsIncludeFlagsToString(options.Include.Value()))); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2888,14 +3046,14 @@ namespace Azure { namespace Storage { namespace Blobs { {"BlobPrefix", XmlTagEnum::kBlobPrefix}, }; std::vector xmlPath; - Models::BlobItem vectorElement1; + Models::_detail::BlobItem vectorElement1; std::string mapKey2; std::string mapValue3; std::string mapKey4; std::string mapValue5; Models::ObjectReplicationPolicy vectorElement6; Models::ObjectReplicationRule vectorElement7; - std::string vectorElement8; + Models::_detail::BlobName vectorElement8; while (true) { auto node = reader.Read(); @@ -2959,7 +3117,7 @@ namespace Azure { namespace Storage { namespace Blobs { && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob && xmlPath[3] == XmlTagEnum::kName) { - vectorElement1.Name = node.Value; + vectorElement1.Name.Content = node.Value; } else if ( xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults @@ -3335,7 +3493,7 @@ namespace Azure { namespace Storage { namespace Blobs { && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlobPrefix && xmlPath[3] == XmlTagEnum::kName) { - vectorElement8 = node.Value; + vectorElement8.Content = node.Value; } } else if (node.Type == _internal::XmlNodeType::Attribute) @@ -3351,6 +3509,20 @@ namespace Azure { namespace Storage { namespace Blobs { { response.BlobContainerName = node.Value; } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob + && xmlPath[3] == XmlTagEnum::kName && node.Name == "Encoded") + { + vectorElement1.Name.Encoded = node.Value == std::string("true"); + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlobPrefix + && xmlPath[3] == XmlTagEnum::kName && node.Name == "Encoded") + { + vectorElement8.Encoded = node.Value == std::string("true"); + } } else if (node.Type == _internal::XmlNodeType::EndTag) { @@ -3384,7 +3556,7 @@ namespace Azure { namespace Storage { namespace Blobs { && xmlPath[1] == XmlTagEnum::kBlobs && xmlPath[2] == XmlTagEnum::kBlob) { response.Items.push_back(std::move(vectorElement1)); - vectorElement1 = Models::BlobItem(); + vectorElement1 = Models::_detail::BlobItem(); } else if ( xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults @@ -3392,7 +3564,7 @@ namespace Azure { namespace Storage { namespace Blobs { && xmlPath[3] == XmlTagEnum::kName) { response.BlobPrefixes.push_back(std::move(vectorElement8)); - vectorElement8 = std::string(); + vectorElement8 = Models::_detail::BlobName(); } xmlPath.pop_back(); } @@ -3476,7 +3648,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (!(httpStatusCode == Core::Http::HttpStatusCode::Ok @@ -3486,8 +3658,11 @@ namespace Azure { namespace Storage { namespace Blobs { } Models::DownloadBlobResult response; response.BodyStream = pRawResponse->ExtractBodyStream(); - response.Details.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.Details.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } for (auto i = pRawResponse->GetHeaders().lower_bound("x-ms-meta-"); i != pRawResponse->GetHeaders().end() && i->first.substr(0, 10) == "x-ms-meta-"; ++i) @@ -3503,7 +3678,10 @@ namespace Azure { namespace Storage { namespace Blobs { { response.Details.HttpHeaders.ContentType = pRawResponse->GetHeaders().at("Content-Type"); } - response.Details.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.Details.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } if (pRawResponse->GetHeaders().count("Content-Encoding") != 0) { response.Details.HttpHeaders.ContentEncoding @@ -3746,7 +3924,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3754,8 +3932,11 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::BlobProperties response; - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.CreatedOn = DateTime::Parse( pRawResponse->GetHeaders().at("x-ms-creation-time"), Azure::DateTime::DateFormat::Rfc1123); @@ -3827,7 +4008,10 @@ namespace Azure { namespace Storage { namespace Blobs { { response.HttpHeaders.ContentType = pRawResponse->GetHeaders().at("Content-Type"); } - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } if (pRawResponse->GetHeaders().count("Content-MD5") != 0) { response.HttpHeaders.ContentHash.Value @@ -4002,7 +4186,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -4020,7 +4204,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "undelete"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -4039,7 +4223,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "expiry"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (!options.ExpiryOptions.ToString().empty()) { request.SetHeader("x-ms-expiry-option", options.ExpiryOptions.ToString()); @@ -4055,9 +4239,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::SetBlobExpiryResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } return Response(std::move(response), std::move(pRawResponse)); } Response BlobClient::SetHttpHeaders( @@ -4121,7 +4311,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-blob-content-disposition", options.BlobContentDisposition); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -4129,9 +4319,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::SetBlobHttpHeadersResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("x-ms-blob-sequence-number") != 0) { response.SequenceNumber @@ -4148,7 +4344,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "immutabilityPolicies"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.IfUnmodifiedSince.HasValue()) { request.SetHeader( @@ -4191,7 +4387,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Delete, url); request.GetUrl().AppendQueryParameter("comp", "immutabilityPolicies"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -4211,7 +4407,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "legalhold"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); request.SetHeader("x-ms-legal-hold", options.LegalHold ? "true" : "false"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -4283,7 +4479,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -4291,9 +4487,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::SetBlobMetadataResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("x-ms-version-id") != 0) { response.VersionId = pRawResponse->GetHeaders().at("x-ms-version-id"); @@ -4352,7 +4554,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -4360,9 +4562,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::_detail::AcquireBlobLeaseResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.LeaseId = pRawResponse->GetHeaders().at("x-ms-lease-id"); return Response( std::move(response), std::move(pRawResponse)); @@ -4404,7 +4612,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -4412,9 +4620,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::_detail::ReleaseBlobLeaseResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } return Response( std::move(response), std::move(pRawResponse)); } @@ -4455,7 +4669,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -4463,9 +4677,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::_detail::RenewBlobLeaseResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.LeaseId = pRawResponse->GetHeaders().at("x-ms-lease-id"); return Response( std::move(response), std::move(pRawResponse)); @@ -4511,7 +4731,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -4519,9 +4739,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::_detail::ChangeBlobLeaseResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.LeaseId = pRawResponse->GetHeaders().at("x-ms-lease-id"); return Response( std::move(response), std::move(pRawResponse)); @@ -4563,7 +4789,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -4571,9 +4797,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::_detail::BreakBlobLeaseResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.LeaseTime = std::stoi(pRawResponse->GetHeaders().at("x-ms-lease-time")); return Response( std::move(response), std::move(pRawResponse)); @@ -4637,7 +4869,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -4646,9 +4878,15 @@ namespace Azure { namespace Storage { namespace Blobs { } Models::CreateBlobSnapshotResult response; response.Snapshot = pRawResponse->GetHeaders().at("x-ms-snapshot"); - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("x-ms-version-id") != 0) { response.VersionId = pRawResponse->GetHeaders().at("x-ms-version-id"); @@ -4738,7 +4976,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.BlobTagsString.HasValue() && !options.BlobTagsString.Value().empty()) { request.SetHeader("x-ms-tags", options.BlobTagsString.Value()); @@ -4771,9 +5009,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::_detail::StartBlobCopyFromUriResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("x-ms-version-id") != 0) { response.VersionId = pRawResponse->GetHeaders().at("x-ms-version-id"); @@ -4851,7 +5095,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.SourceContentMD5.HasValue() && !Core::Convert::Base64Encode(options.SourceContentMD5.Value()).empty()) { @@ -4886,6 +5130,14 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader( "x-ms-copy-source-authorization", options.CopySourceAuthorization.Value()); } + if (options.EncryptionScope.HasValue() && !options.EncryptionScope.Value().empty()) + { + request.SetHeader("x-ms-encryption-scope", options.EncryptionScope.Value()); + } + if (options.CopySourceTags.HasValue() && !options.CopySourceTags.Value().ToString().empty()) + { + request.SetHeader("x-ms-copy-source-tag-option", options.CopySourceTags.Value().ToString()); + } if (options.SourceContentcrc64.HasValue() && !Core::Convert::Base64Encode(options.SourceContentcrc64.Value()).empty()) { @@ -4900,9 +5152,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::CopyBlobFromUriResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("x-ms-version-id") != 0) { response.VersionId = pRawResponse->GetHeaders().at("x-ms-version-id"); @@ -4923,6 +5181,10 @@ namespace Azure { namespace Storage { namespace Blobs { = Core::Convert::Base64Decode(pRawResponse->GetHeaders().at("x-ms-content-crc64")); response.TransactionalContentHash.Value().Algorithm = HashAlgorithm::Crc64; } + if (pRawResponse->GetHeaders().count("x-ms-encryption-scope") != 0) + { + response.EncryptionScope = pRawResponse->GetHeaders().at("x-ms-encryption-scope"); + } return Response(std::move(response), std::move(pRawResponse)); } Response BlobClient::AbortCopyFromUri( @@ -4943,7 +5205,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::NoContent) @@ -4981,7 +5243,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-rehydrate-priority", options.RehydratePriority.Value().ToString()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -5283,7 +5545,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.EncryptionScope.HasValue() && !options.EncryptionScope.Value().empty()) { request.SetHeader("x-ms-encryption-scope", options.EncryptionScope.Value()); @@ -5297,9 +5559,15 @@ namespace Azure { namespace Storage { namespace Blobs { } Models::QueryBlobResult response; response.BodyStream = pRawResponse->ExtractBodyStream(); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } if (pRawResponse->GetHeaders().count("x-ms-lease-duration") != 0) { response.LeaseDuration @@ -5320,7 +5588,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("comp", "tags"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.Snapshot.HasValue() && !options.Snapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -5447,7 +5715,7 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader("Content-Type", "application/xml; charset=UTF-8"); request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("comp", "tags"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.VersionId.HasValue() && !options.VersionId.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -5578,7 +5846,7 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader( "x-ms-blob-sequence-number", std::to_string(options.BlobSequenceNumber.Value())); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.BlobTagsString.HasValue() && !options.BlobTagsString.Value().empty()) { request.SetHeader("x-ms-tags", options.BlobTagsString.Value()); @@ -5607,9 +5875,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::CreatePageBlobResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("x-ms-version-id") != 0) { response.VersionId = pRawResponse->GetHeaders().at("x-ms-version-id"); @@ -5718,7 +5992,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -5726,9 +6000,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::UploadPagesResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("Content-MD5") != 0) { response.TransactionalContentHash = ContentHash(); @@ -5835,7 +6115,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -5843,9 +6123,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::ClearPagesResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.SequenceNumber = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); return Response(std::move(response), std::move(pRawResponse)); @@ -5969,7 +6255,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-source-if-none-match", options.SourceIfNoneMatch.ToString()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.CopySourceAuthorization.HasValue() && !options.CopySourceAuthorization.Value().empty()) { @@ -5983,9 +6269,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::UploadPagesFromUriResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } if (pRawResponse->GetHeaders().count("Content-MD5") != 0) { response.TransactionalContentHash = ContentHash(); @@ -6061,7 +6353,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.Marker.HasValue() && !options.Marker.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -6172,9 +6464,15 @@ namespace Azure { namespace Storage { namespace Blobs { } } } - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } response.BlobSize = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-content-length")); return Response( std::move(response), std::move(pRawResponse)); @@ -6233,7 +6531,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.Marker.HasValue() && !options.Marker.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -6344,9 +6642,15 @@ namespace Azure { namespace Storage { namespace Blobs { } } } - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } response.BlobSize = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-content-length")); return Response( std::move(response), std::move(pRawResponse)); @@ -6407,7 +6711,7 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } request.SetHeader("x-ms-blob-content-length", std::to_string(options.BlobContentLength)); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -6415,9 +6719,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::ResizePageBlobResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.SequenceNumber = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); return Response(std::move(response), std::move(pRawResponse)); @@ -6467,7 +6777,7 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader( "x-ms-blob-sequence-number", std::to_string(options.BlobSequenceNumber.Value())); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -6475,9 +6785,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::UpdateSequenceNumberResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.SequenceNumber = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); return Response( @@ -6519,7 +6835,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-copy-source", options.CopySource); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -6527,9 +6843,15 @@ namespace Azure { namespace Storage { namespace Blobs { throw StorageException::CreateFromResponse(std::move(pRawResponse)); } Models::_detail::StartBlobCopyIncrementalResult response; - response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); - response.LastModified = DateTime::Parse( - pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + if (pRawResponse->GetHeaders().count("ETag") != 0) + { + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + } + if (pRawResponse->GetHeaders().count("Last-Modified") != 0) + { + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + } response.CopyId = pRawResponse->GetHeaders().at("x-ms-copy-id"); response.CopyStatus = Models::CopyStatus(pRawResponse->GetHeaders().at("x-ms-copy-status")); if (pRawResponse->GetHeaders().count("x-ms-version-id") != 0) @@ -6624,7 +6946,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.BlobTagsString.HasValue() && !options.BlobTagsString.Value().empty()) { request.SetHeader("x-ms-tags", options.BlobTagsString.Value()); @@ -6752,7 +7074,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -6906,7 +7228,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-source-if-none-match", options.SourceIfNoneMatch.ToString()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.CopySourceAuthorization.HasValue() && !options.CopySourceAuthorization.Value().empty()) { @@ -6962,7 +7284,7 @@ namespace Azure { namespace Storage { namespace Blobs { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "seal"); - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -7101,7 +7423,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.BlobTagsString.HasValue() && !options.BlobTagsString.Value().empty()) { request.SetHeader("x-ms-tags", options.BlobTagsString.Value()); @@ -7284,7 +7606,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-source-if-tags", options.SourceIfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.SourceContentMD5.HasValue() && !Core::Convert::Base64Encode(options.SourceContentMD5.Value()).empty()) { @@ -7312,6 +7634,10 @@ namespace Azure { namespace Storage { namespace Blobs { request.SetHeader( "x-ms-copy-source-authorization", options.CopySourceAuthorization.Value()); } + if (options.CopySourceTags.HasValue() && !options.CopySourceTags.Value().ToString().empty()) + { + request.SetHeader("x-ms-copy-source-tag-option", options.CopySourceTags.Value().ToString()); + } if (options.SourceContentcrc64.HasValue() && !Core::Convert::Base64Encode(options.SourceContentcrc64.Value()).empty()) { @@ -7412,7 +7738,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-encryption-scope", options.EncryptionScope.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -7526,7 +7852,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-source-if-none-match", options.SourceIfNoneMatch.ToString()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.CopySourceAuthorization.HasValue() && !options.CopySourceAuthorization.Value().empty()) { @@ -7693,7 +8019,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); if (options.BlobTagsString.HasValue() && !options.BlobTagsString.Value().empty()) { request.SetHeader("x-ms-tags", options.BlobTagsString.Value()); @@ -7782,7 +8108,7 @@ namespace Azure { namespace Storage { namespace Blobs { { request.SetHeader("x-ms-if-tags", options.IfTags.Value()); } - request.SetHeader("x-ms-version", "2020-10-02"); + request.SetHeader("x-ms-version", "2021-04-10"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) diff --git a/sdk/storage/azure-storage-blobs/swagger/README.md b/sdk/storage/azure-storage-blobs/swagger/README.md index 2a31bd673f..2b34011ca2 100644 --- a/sdk/storage/azure-storage-blobs/swagger/README.md +++ b/sdk/storage/azure-storage-blobs/swagger/README.md @@ -9,7 +9,7 @@ package-name: azure-storage-blobs namespace: Azure::Storage::Blobs output-folder: generated clear-output-folder: true -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.BlobStorage/preview/2020-10-02/blob.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.BlobStorage/preview/2021-04-10/blob.json ``` ## ModelFour Options @@ -102,7 +102,7 @@ directive: "name": "ApiVersion", "modelAsString": false }, - "enum": ["2020-10-02"], + "enum": ["2021-04-10"], "description": "The version used for the operations to Azure storage services." }; ``` @@ -116,6 +116,7 @@ directive: transform: > $["/?comp=list"].get.operationId = "Service_ListBlobContainers"; $["/?comp=blobs"].get.operationId = "Service_FindBlobsByTags"; + $["/{containerName}?restype=container&comp=blobs"].get.operationId = "BlobContainer_FindBlobsByTags"; $["/{containerName}/{blob}?comp=incrementalcopy"].put.operationId = "PageBlob_StartCopyIncremental"; $["/{containerName}?restype=container&comp=list&flat"].get.operationId = "BlobContainer_ListBlobs"; $["/{containerName}?restype=container&comp=list&hierarchy"].get.operationId = "BlobContainer_ListBlobsByHierarchy"; @@ -279,6 +280,7 @@ directive: delete $.EncryptionAlgorithm["enum"]; delete $.EncryptionAlgorithm["x-ms-enum"]; $.ImmutabilityPolicyMode.enum = $.ImmutabilityPolicyMode.enum.map(e => e.toLowerCase()); + $.CopySourceTags["x-ms-enum"]["name"] = "BlobCopySourceTagsMode"; - from: swagger-document where: $.definitions transform: > @@ -467,6 +469,54 @@ directive: $.ArchiveStatus.description = "For blob storage LRS accounts, valid values are rehydrate-pending-to-hot/rehydrate-pending-to-cool. If the blob is being rehydrated and is not complete then this value indicates that rehydrate is pending and also tells the destination tier."; ``` +### Striped Blob Support + +```yaml +directive: + - from: swagger-document + where: $ + transform: > + const operations = [ + "Blob_GetProperties", + "Blob_Download", + "Blob_SetExpiry", + "Blob_SetHTTPHeaders", + "Blob_SetMetadata", + "Blob_AcquireLease", + "Blob_ReleaseLease", + "Blob_RenewLease", + "Blob_ChangeLease", + "Blob_BreakLease", + "Blob_CreateSnapshot", + "Blob_StartCopyFromUri", + "Blob_CopyFromUri", + "Blob_Query", + "PageBlob_Create", + "PageBlob_UploadPages", + "PageBlob_ClearPages", + "PageBlob_UploadPagesFromUri", + "PageBlob_GetPageRanges", + "PageBlob_GetPageRangesDiff", + "PageBlob_Resize", + "PageBlob_UpdateSequenceNumber", + "PageBlob_StartCopyIncremental", + ]; + for (const url in $["x-ms-paths"]) { + for (const verb in $["x-ms-paths"][url]) { + if (!operations.includes($["x-ms-paths"][url][verb].operationId)) continue; + const operation = $["x-ms-paths"][url][verb]; + + const status_codes = Object.keys(operation.responses).filter(s => s !== "default"); + status_codes.forEach((status_code, i) => { + operation.responses[status_code].headers["Last-Modified"]["x-ms-client-default"] = ""; + operation.responses[status_code].headers["Last-Modified"]["x-nullable"] = true; + operation.responses[status_code].headers["ETag"]["x-ms-client-default"] = ""; + operation.responses[status_code].headers["ETag"]["x-nullable"] = true; + }); + } + } +``` + ### GetBlobServiceProperties ```yaml @@ -745,7 +795,12 @@ directive: delete $.ListBlobsFlatSegmentResponse.required; $.ListBlobsFlatSegmentResponse.properties["NextMarker"]["x-nullable"] = true; + $.BlobName["x-namespace"] = "_detail"; + delete $.BlobName.properties["content"]["xml"]; + $.BlobName["xml"] = {"name": "Name"}; + $.BlobName.properties["content"]["x-ms-xml"] = {"name": "."}; $.BlobItemInternal["x-ms-client-name"] = "BlobItem"; + $.BlobItemInternal["x-namespace"] = "_detail"; $.BlobItemInternal.properties["Deleted"]["x-ms-client-name"] = "IsDeleted"; $.BlobItemInternal.properties["Properties"]["x-ms-client-name"] = "Details"; $.BlobItemInternal.properties["BlobSize"] = $.BlobPropertiesInternal.properties["Content-Length"]; @@ -835,7 +890,7 @@ directive: $.ListBlobsHierarchySegmentResponse.properties["NextMarker"]["x-ms-client-name"] = "ContinuationToken"; $.ListBlobsHierarchySegmentResponse.properties["Blobs"] = $.ListBlobsFlatSegmentResponse.properties["Blobs"]; $.ListBlobsHierarchySegmentResponse.properties["Blobs"]["x-ms-client-name"] = "Items"; - $.ListBlobsHierarchySegmentResponse.properties["BlobPrefixes"] = {"type": "array", "items": {"type": "string", "xml": {"name": "Name"}}, "x-ms-xml": {"wrapped": true, "name": "Blobs/BlobPrefix"}}; + $.ListBlobsHierarchySegmentResponse.properties["BlobPrefixes"] = {"type": "array", "items": {"$ref": "#/definitions/BlobName"}, "x-ms-xml": {"wrapped": true, "name": "Blobs/BlobPrefix"}}; delete $.ListBlobsHierarchySegmentResponse.properties["Marker"]; delete $.ListBlobsHierarchySegmentResponse.properties["MaxResults"]; delete $.ListBlobsHierarchySegmentResponse.properties["Segment"]; @@ -1163,6 +1218,7 @@ directive: $["Content-MD5"]["x-nullable"] = true; $["x-ms-content-crc64"]["x-ms-client-name"] = "TransactionalContentHash"; $["x-ms-content-crc64"]["x-nullable"] = true; + $["x-ms-encryption-scope"]["x-nullable"] = true; ``` ### QueryBlobContent diff --git a/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp index deb79a8728..9017f6f18f 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/blob_container_client_test.cpp @@ -477,21 +477,21 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(BlobContainerClientTest, DISABLED_EncryptionScope) + TEST_F(BlobContainerClientTest, EncryptionScope) { - auto client = GetBlobContainerTestClient(); - client.Create(); + auto blobContainerClient = GetBlobContainerTestClient(); + blobContainerClient.CreateIfNotExists(); auto const& testEncryptionScope = GetTestEncryptionScope(); { - auto properties = client.GetProperties().Value; + auto properties = blobContainerClient.GetProperties().Value; EXPECT_EQ(properties.DefaultEncryptionScope, AccountEncryptionKey); EXPECT_EQ(properties.PreventEncryptionScopeOverride, false); } { - std::string containerName = LowercaseRandomString(); - std::string blobName = RandomString(); - Blobs::BlobClientOptions options; + std::string containerName = GetContainerValidName() + "1"; + std::string blobName = GetTestName() + "1"; + Blobs::BlobClientOptions options = InitClientOptions(); options.EncryptionScope = testEncryptionScope; auto containerClient = Azure::Storage::Blobs::BlobContainerClient::CreateFromConnectionString( StandardStorageConnectionString(), containerName, options); @@ -526,9 +526,7 @@ namespace Azure { namespace Storage { namespace Test { appendBlobClient.Delete(); EXPECT_TRUE(blobContentInfo.Value.EncryptionScope.HasValue()); EXPECT_EQ(blobContentInfo.Value.EncryptionScope.Value(), testEncryptionScope); - auto appendBlobClientWithoutEncryptionScope - = Azure::Storage::Blobs::AppendBlobClient::CreateFromConnectionString( - StandardStorageConnectionString(), containerName, blobName); + auto appendBlobClientWithoutEncryptionScope = containerClient.GetAppendBlobClient(blobName); blobContentInfo = appendBlobClientWithoutEncryptionScope.Create(); appendBlobClientWithoutEncryptionScope.Delete(); EXPECT_TRUE(blobContentInfo.Value.EncryptionScope.HasValue()); @@ -536,8 +534,8 @@ namespace Azure { namespace Storage { namespace Test { containerClient.Delete(); } { - std::string blobName = RandomString(); - Blobs::BlobClientOptions options; + std::string blobName = GetTestName() + "2"; + Blobs::BlobClientOptions options = InitClientOptions(); options.EncryptionScope = testEncryptionScope; auto appendBlobClient = Azure::Storage::Blobs::AppendBlobClient::CreateFromConnectionString( StandardStorageConnectionString(), m_containerName, blobName, options); @@ -557,8 +555,7 @@ namespace Azure { namespace Storage { namespace Test { bodyStream.Rewind(); auto appendBlobClientWithoutEncryptionScope - = Azure::Storage::Blobs::AppendBlobClient::CreateFromConnectionString( - StandardStorageConnectionString(), m_containerName, blobName); + = blobContainerClient.GetAppendBlobClient(blobName); EXPECT_THROW( appendBlobClientWithoutEncryptionScope.AppendBlock(bodyStream), StorageException); EXPECT_THROW(appendBlobClientWithoutEncryptionScope.CreateSnapshot(), StorageException); @@ -790,15 +787,11 @@ namespace Azure { namespace Storage { namespace Test { TEST_F(BlobContainerClientTest, Tags) { - auto client = GetBlobContainerTestClient(); - client.Create(); + auto containerClient = GetBlobContainerTestClient(); + containerClient.Create(); std::string blobName = "blob" + m_containerName; - auto blobClient = Azure::Storage::Blobs::AppendBlobClient::CreateFromConnectionString( - StandardStorageConnectionString(), - m_containerName, - blobName, - InitClientOptions()); + auto blobClient = containerClient.GetAppendBlobClient(blobName); blobClient.Create(); auto properties = blobClient.GetProperties().Value; @@ -837,14 +830,43 @@ namespace Azure { namespace Storage { namespace Test { auto blobItem = GetBlobItem(blobName, Blobs::Models::ListBlobsIncludeFlags::Tags); EXPECT_EQ(blobItem.Details.Tags, tags); + std::vector blobNames; + blobNames.push_back(blobName); + for (int i = 0; i < 5; ++i) + { + const auto blobName1 = blobName + std::to_string(i); + blobNames.push_back(blobName1); + auto blobClient1 = containerClient.GetAppendBlobClient(blobName1); + blobClient1.Create(); + blobClient1.SetTags(tags); + } + auto blobServiceClient = Azure::Storage::Blobs::BlobServiceClient::CreateFromConnectionString( StandardStorageConnectionString(), InitClientOptions()); std::string whereExpression = c1 + " = '" + v1 + "' AND " + c2 + " >= '" + v2 + "' AND " + c3 + " <= '" + v3 + "'"; - std::vector findResults; + std::vector findResults; + std::vector findResults2; for (int i = 0; i < 30; ++i) { + findResults.clear(); + findResults2.clear(); + Blobs::FindBlobsByTagsOptions findOptions; + findOptions.PageSizeHint = 2; + + for (auto pageResult = containerClient.FindBlobsByTags(whereExpression); pageResult.HasPage(); + pageResult.MoveToNextPage()) + { + EXPECT_FALSE(pageResult.ServiceEndpoint.empty()); + for (auto& item : pageResult.TaggedBlobs) + { + EXPECT_FALSE(item.BlobName.empty()); + EXPECT_EQ(item.BlobContainerName, m_containerName); + EXPECT_FALSE(item.Tags.empty()); + findResults2.emplace_back(item.BlobName); + } + } for (auto pageResult = blobServiceClient.FindBlobsByTags(whereExpression); pageResult.HasPage(); pageResult.MoveToNextPage()) @@ -853,13 +875,13 @@ namespace Azure { namespace Storage { namespace Test { for (auto& item : pageResult.TaggedBlobs) { EXPECT_FALSE(item.BlobName.empty()); - EXPECT_FALSE(item.BlobContainerName.empty()); + EXPECT_EQ(item.BlobContainerName, m_containerName); EXPECT_FALSE(item.Tags.empty()); - findResults.emplace_back(std::move(item)); + findResults.emplace_back(item.BlobName); } } - if (findResults.empty()) + if (findResults.size() != blobNames.size() || findResults2.size() != blobNames.size()) { TestSleep(1s); } @@ -868,9 +890,13 @@ namespace Azure { namespace Storage { namespace Test { break; } } - ASSERT_FALSE(findResults.empty()); - EXPECT_EQ(findResults[0].BlobName, blobName); - EXPECT_EQ(findResults[0].BlobContainerName, m_containerName); + EXPECT_EQ(findResults.size(), blobNames.size()); + EXPECT_EQ(findResults2.size(), blobNames.size()); + std::sort(blobNames.begin(), blobNames.end()); + std::sort(findResults.begin(), findResults.end()); + std::sort(findResults2.begin(), findResults2.end()); + EXPECT_EQ(blobNames, findResults); + EXPECT_EQ(blobNames, findResults2); } TEST_F(BlobContainerClientTest, AccessConditionTags) @@ -1182,7 +1208,7 @@ namespace Azure { namespace Storage { namespace Test { TEST_F(BlobContainerClientTest, SpecialBlobName) { auto client = GetBlobContainerTestClient(); - client.Create(); + client.CreateIfNotExists(); const std::string non_ascii_word = "\xE6\xB5\x8B\xE8\xAF\x95"; const std::string encoded_non_ascii_word = "%E6%B5%8B%E8%AF%95"; @@ -1248,6 +1274,46 @@ namespace Azure { namespace Storage { namespace Test { auto blobItem = GetBlobItem(blobName); EXPECT_EQ(blobItem.Name, blobName); } + { + /* + * UTF-16 0xFFFF and 0xFFFE are not valid in XML, we'll need to encode if blob name contains + * these two characters. + */ + const std::string blobPrefix + = std::string("aaaaa\xEF\xBF\xBF") + "bbb/"; // UTF-8 0xEF, 0xBF, 0xBF is UTF-16 0xFFFF + const std::string blobName = blobPrefix + "ccc"; + auto blobClient = Blobs::BlockBlobClient::CreateFromConnectionString( + StandardStorageConnectionString(), m_containerName, blobName, clientOptions); + EXPECT_NO_THROW(blobClient.UploadFrom(nullptr, 0)); + auto blobUrl = blobClient.GetUrl(); + EXPECT_EQ(blobUrl, client.GetUrl() + "/" + _internal::UrlEncodePath(blobName)); + Blobs::Models::BlobItem blobItem; + Blobs::ListBlobsOptions options; + options.Prefix = "aaaaa"; + for (auto page = client.ListBlobs(options); page.HasPage(); page.MoveToNextPage()) + { + for (auto& blob : page.Blobs) + { + if (blob.Name == blobName) + { + blobItem = std::move(blob); + } + } + } + EXPECT_EQ(blobItem.Name, blobName); + bool found = false; + for (auto page = client.ListBlobsByHierarchy("/"); page.HasPage(); page.MoveToNextPage()) + { + for (auto& p : page.BlobPrefixes) + { + if (p == blobPrefix) + { + found = true; + } + } + } + EXPECT_TRUE(found); + } } TEST_F(BlobContainerClientTest, QuestionMarkBlobName) diff --git a/sdk/storage/azure-storage-blobs/test/ut/blob_sas_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/blob_sas_test.cpp index 7244866d91..b9f8d3e6f9 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/blob_sas_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/blob_sas_test.cpp @@ -584,6 +584,36 @@ namespace Azure { namespace Storage { namespace Test { options.DeleteSnapshots = Blobs::Models::DeleteSnapshotsOption::IncludeSnapshots; blobClient0.Delete(options); } + + // Encryption scope + const auto encryptionScope = GetTestEncryptionScope(); + { + auto sasBuilderWithEncryptionScope = blobSasBuilder; + sasBuilderWithEncryptionScope.EncryptionScope = encryptionScope; + auto blobClientEncryptionScopeSas = Blobs::AppendBlobClient( + blobUrl + sasBuilderWithEncryptionScope.GenerateSasToken(*keyCredential)); + blobClientEncryptionScopeSas.Create(); + auto blobProperties = blobClientEncryptionScopeSas.GetProperties().Value; + ASSERT_TRUE(blobProperties.EncryptionScope.HasValue()); + EXPECT_EQ(blobProperties.EncryptionScope.Value(), encryptionScope); + + blobClientEncryptionScopeSas = Blobs::AppendBlobClient( + blobUrl + sasBuilderWithEncryptionScope.GenerateSasToken(userDelegationKey, accountName)); + blobClientEncryptionScopeSas.Create(); + blobProperties = blobClientEncryptionScopeSas.GetProperties().Value; + ASSERT_TRUE(blobProperties.EncryptionScope.HasValue()); + EXPECT_EQ(blobProperties.EncryptionScope.Value(), encryptionScope); + } + { + auto sasBuilderWithEncryptionScope = accountSasBuilder; + sasBuilderWithEncryptionScope.EncryptionScope = encryptionScope; + auto blobClientEncryptionScopeSas = Blobs::AppendBlobClient( + blobUrl + sasBuilderWithEncryptionScope.GenerateSasToken(*keyCredential)); + blobClientEncryptionScopeSas.Create(); + auto blobProperties = blobClientEncryptionScopeSas.GetProperties().Value; + ASSERT_TRUE(blobProperties.EncryptionScope.HasValue()); + EXPECT_EQ(blobProperties.EncryptionScope.Value(), encryptionScope); + } } }}} // namespace Azure::Storage::Test diff --git a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp index 61d24bcde0..5e7b2e28f1 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp @@ -378,6 +378,52 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_FALSE(blobItem.Details.IncrementalCopyDestinationSnapshot.HasValue()); } + TEST_F(BlockBlobClientTest, SyncCopyFromUriEncryptionScope) + { + auto clientOptions = InitClientOptions(); + const auto encryptionScope = GetTestEncryptionScope(); + clientOptions.EncryptionScope = encryptionScope; + const auto containerName = GetContainerValidName(); + const auto blobName = "b"; + auto containerClient = Blobs::BlobContainerClient::CreateFromConnectionString( + StandardStorageConnectionString(), containerName, clientOptions); + containerClient.CreateIfNotExists(); + auto srcBlobClient = containerClient.GetBlockBlobClient(blobName); + uint8_t data; + srcBlobClient.UploadFrom(&data, 1); + + auto properties = srcBlobClient.GetProperties().Value; + ASSERT_TRUE(properties.EncryptionScope.HasValue()); + EXPECT_EQ(properties.EncryptionScope.Value(), encryptionScope); + + { + Sas::BlobSasBuilder builder; + builder.ExpiresOn = std::chrono::system_clock::now() + std::chrono::hours(1); + builder.BlobContainerName = containerName; + builder.BlobName = blobName; + builder.Resource = Sas::BlobSasResource::Blob; + builder.EncryptionScope = encryptionScope; + builder.SetPermissions("r"); + auto keyCredential + = _internal::ParseConnectionString(StandardStorageConnectionString()).KeyCredential; + auto sasToken = builder.GenerateSasToken(*keyCredential); + + auto destBlobClient = GetBlockBlobClient(GetTestName()); + auto response = destBlobClient.CopyFromUri(srcBlobClient.GetUrl() + sasToken); + EXPECT_FALSE(response.Value.EncryptionScope.HasValue()); + properties = destBlobClient.GetProperties().Value; + EXPECT_FALSE(properties.EncryptionScope.HasValue()); + + destBlobClient = containerClient.GetBlockBlobClient(GetTestName()); + response = destBlobClient.CopyFromUri(srcBlobClient.GetUrl() + GetSas()); + ASSERT_TRUE(response.Value.EncryptionScope.HasValue()); + EXPECT_EQ(response.Value.EncryptionScope.Value(), encryptionScope); + properties = destBlobClient.GetProperties().Value; + ASSERT_TRUE(properties.EncryptionScope.HasValue()); + EXPECT_EQ(properties.EncryptionScope.Value(), encryptionScope); + } + } + TEST_F(BlockBlobClientTest, AsyncCopyFromUri) { @@ -455,6 +501,11 @@ namespace Azure { namespace Storage { namespace Test { properties = blobClient->GetProperties().Value; EXPECT_EQ(properties.Metadata, options2.Metadata); EXPECT_EQ(properties.AccessTier.Value(), options2.AccessTier.Value()); + + options2.CopySourceTagsMode = Blobs::Models::BlobCopySourceTagsMode::Copy; + options2.Tags.clear(); + blobClient->CopyFromUri(blockBlobClient.GetUrl() + GetSas(), options2); + EXPECT_TRUE(blobClient->GetTags().Value.empty()); } TEST_F(BlockBlobClientTest, SnapShotVersions) @@ -1856,6 +1907,9 @@ namespace Azure { namespace Storage { namespace Test { auto srcBlobClient = GetBlockBlobClient(testName + "src"); std::vector blobContent(100, 'a'); srcBlobClient.UploadFrom(blobContent.data(), blobContent.size()); + std::map srcTags; + srcTags["srctags"] = "a1212"; + srcBlobClient.SetTags(srcTags); const std::vector blobMd5 = Azure::Core::Cryptography::Md5Hash().Final(blobContent.data(), blobContent.size()); @@ -1894,6 +1948,11 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ(destBlobProperties.Metadata, options.Metadata); EXPECT_EQ(destBlobProperties.AccessTier.Value(), options.AccessTier.Value()); EXPECT_EQ(static_cast(destBlobProperties.TagCount.Value()), options.Tags.size()); + + options.CopySourceTagsMode = Blobs::Models::BlobCopySourceTagsMode::Copy; + options.Tags.clear(); + uploadFromUriResult = destBlobClient.UploadFromUri(srcBlobClient.GetUrl() + GetSas(), options); + EXPECT_EQ(destBlobClient.GetTags().Value, srcTags); } TEST_F(BlockBlobClientTest, SetGetTagsWithLeaseId) diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.EncryptionScope.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.EncryptionScope.json new file mode 100644 index 0000000000..12998d7a68 --- /dev/null +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.EncryptionScope.json @@ -0,0 +1,438 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "22d4c37d-0ebb-4efb-71a4-886a26c89468", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:20 GMT", + "etag": "\"0x8DA569ABC06F99A\"", + "last-modified": "Sat, 25 Jun 2022 11:06:20 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "22d4c37d-0ebb-4efb-71a4-886a26c89468", + "x-ms-request-id": "ebab5f19-201e-008a-0883-888173000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "4335df5c-f537-4a37-47cc-a7138e726cec", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:20 GMT", + "etag": "\"0x8DA569ABC06F99A\"", + "last-modified": "Sat, 25 Jun 2022 11:06:20 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "4335df5c-f537-4a37-47cc-a7138e726cec", + "x-ms-default-encryption-scope": "$account-encryption-key", + "x-ms-deny-encryption-scope-override": "false", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-immutable-storage-with-versioning-enabled": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "ebab5fa6-201e-008a-7f83-888173000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "17759e44-94b8-4573-7a47-b1a02f72b540", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:21 GMT", + "etag": "\"0x8DA569ABD0DDEED\"", + "last-modified": "Sat, 25 Jun 2022 11:06:22 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "17759e44-94b8-4573-7a47-b1a02f72b540", + "x-ms-request-id": "6ba8114b-c01e-003b-5a83-889f66000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "2052d85c-bb20-49d4-50f4-2b4066de48e2", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:21 GMT", + "etag": "\"0x8DA569ABD0DDEED\"", + "last-modified": "Sat, 25 Jun 2022 11:06:22 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "2052d85c-bb20-49d4-50f4-2b4066de48e2", + "x-ms-default-encryption-scope": "EncryptionScopeForTest", + "x-ms-deny-encryption-scope-override": "true", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-immutable-storage-with-versioning-enabled": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6ba8124f-c01e-003b-4b83-889f66000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "902b63b1-4e49-4c49-4a56-337bf646679e", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:22 GMT", + "etag": "\"0x8DA569ABD70E40E\"", + "last-modified": "Sat, 25 Jun 2022 11:06:22 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "902b63b1-4e49-4c49-4a56-337bf646679e", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-request-id": "6ba812ea-c01e-003b-5483-889f66000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T11:06:22.9591054Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1/EncryptionScope1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "275875fd-2e48-4d94-67cd-5091dc17b4ec", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "EncryptionScope1EncryptionScope12022-06-25T11:06:22.9591054ZtrueSat, 25 Jun 2022 11:06:22 GMTSat, 25 Jun 2022 11:06:22 GMT0x8DA569ABD70E40E0application/octet-streamAppendBlobunlockedavailabletrueEncryptionScopeForTest", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 11:06:22 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "vary": "Origin", + "x-ms-client-request-id": "275875fd-2e48-4d94-67cd-5091dc17b4ec", + "x-ms-request-id": "6ba8139f-c01e-003b-7683-889f66000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1?comp=list&prefix=EncryptionScope1&restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f7f009d3-5966-4d60-440f-d82a47574a0d", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:22 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f7f009d3-5966-4d60-440f-d82a47574a0d", + "x-ms-delete-type-permanent": "false", + "x-ms-request-id": "6ba8145b-c01e-003b-2983-889f66000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1/EncryptionScope1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "ccaa96f1-f381-43b6-5325-e5bd7484e6e1", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:23 GMT", + "etag": "\"0x8DA569ABE0D0D12\"", + "last-modified": "Sat, 25 Jun 2022 11:06:23 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ccaa96f1-f381-43b6-5325-e5bd7484e6e1", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-request-id": "6ba8151c-c01e-003b-5a83-889f66000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T11:06:23.9825170Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1/EncryptionScope1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "cfc82c9a-1e0e-43d7-7298-e6944de984e9", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:23 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cfc82c9a-1e0e-43d7-7298-e6944de984e9", + "x-ms-delete-type-permanent": "false", + "x-ms-request-id": "6ba815bd-c01e-003b-6e83-889f66000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1/EncryptionScope1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "c50e76ee-c87e-4628-6981-5e8fbbbcca78", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:23 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c50e76ee-c87e-4628-6981-5e8fbbbcca78", + "x-ms-request-id": "6ba8165b-c01e-003b-7c83-889f66000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope1?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "92aa4595-64a3-44a4-702a-7919621cb2e7", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:25 GMT", + "etag": "\"0x8DA569ABF593256\"", + "last-modified": "Sat, 25 Jun 2022 11:06:26 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "92aa4595-64a3-44a4-702a-7919621cb2e7", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-request-id": "6de14a56-d01e-008e-6a83-880c74000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T11:06:26.1592662Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope/EncryptionScope2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "ed1fdcbf-8c40-4e43-6271-d49280d72107", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:26 GMT", + "etag": "\"0x8DA569ABF8BD3A3\"", + "last-modified": "Sat, 25 Jun 2022 11:06:26 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ed1fdcbf-8c40-4e43-6271-d49280d72107", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-request-id": "6de14b42-d01e-008e-3983-880c74000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T11:06:26.4930752Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope/EncryptionScope2?comp=metadata" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "24857204-e9a7-4eb4-6d56-1287464158d4", + "x-ms-version": "2021-04-10" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "accept-ranges": "bytes", + "content-length": "0", + "content-type": "application/octet-stream", + "date": "Sat, 25 Jun 2022 11:06:26 GMT", + "etag": "\"0x8DA569ABF8BD3A3\"", + "last-modified": "Sat, 25 Jun 2022 11:06:26 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-blob-committed-block-count": "0", + "x-ms-blob-type": "AppendBlob", + "x-ms-client-request-id": "24857204-e9a7-4eb4-6d56-1287464158d4", + "x-ms-creation-time": "Sat, 25 Jun 2022 11:06:26 GMT", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-is-current-version": "true", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6de14bee-d01e-008e-4f83-880c74000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T11:06:26.4930752Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope/EncryptionScope2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "d8463f10-a4aa-4daf-71c3-cc75dcbd31a4", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:26 GMT", + "etag": "\"0x8DA569ABFECAA0E\"", + "last-modified": "Sat, 25 Jun 2022 11:06:27 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-append-offset": "0", + "x-ms-blob-committed-block-count": "1", + "x-ms-client-request-id": "d8463f10-a4aa-4daf-71c3-cc75dcbd31a4", + "x-ms-content-crc64": "KIfs70dQ2tU=", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-request-id": "6de14cb2-d01e-008e-0383-880c74000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope/EncryptionScope2?comp=appendblock" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "e941f6fc-c95c-415a-60a0-a02fb7009a1b", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "BlobUsesCustomerSpecifiedEncryptionThe blob is encrypted with customer specified encryption, but it was not provided in the request.\nRequestId:6de14d6d-d01e-008e-2083-880c74000000\nTime:2022-06-25T11:06:27.4443202Z", + "REASON_PHRASE": "The blob is encrypted with customer specified encryption, but it was not provided in the request.", + "STATUS_CODE": "409", + "content-length": "301", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 11:06:27 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e941f6fc-c95c-415a-60a0-a02fb7009a1b", + "x-ms-error-code": "BlobUsesCustomerSpecifiedEncryption", + "x-ms-request-id": "6de14d6d-d01e-008e-2083-880c74000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope/EncryptionScope2?comp=appendblock" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "2c582440-9af5-49d7-402d-3dae79759740", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "BlobUsesCustomerSpecifiedEncryptionThe blob is encrypted with customer specified encryption, but it was not provided in the request.\nRequestId:6de14e3e-d01e-008e-5683-880c74000000\nTime:2022-06-25T11:06:27.7611392Z", + "REASON_PHRASE": "The blob is encrypted with customer specified encryption, but it was not provided in the request.", + "STATUS_CODE": "409", + "content-length": "301", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 11:06:27 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "2c582440-9af5-49d7-402d-3dae79759740", + "x-ms-error-code": "BlobUsesCustomerSpecifiedEncryption", + "x-ms-request-id": "6de14e3e-d01e-008e-5683-880c74000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope/EncryptionScope2?comp=snapshot" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "440e942f-fba7-4c84-499d-db434b43d1af", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:27 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "440e942f-fba7-4c84-499d-db434b43d1af", + "x-ms-delete-type-permanent": "false", + "x-ms-request-id": "6de14ef7-d01e-008e-7683-880c74000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope/EncryptionScope2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "25abaec8-8a44-45dc-4839-620961349064", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 11:06:28 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "25abaec8-8a44-45dc-4839-620961349064", + "x-ms-request-id": "6de14fdd-d01e-008e-3083-880c74000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestencryptionscope?restype=container" + } + ] +} diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.SpecialBlobName.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.SpecialBlobName.json index c8094abbf3..2dea9f397f 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.SpecialBlobName.json +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.SpecialBlobName.json @@ -2,31 +2,31 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "caddbf7c-e6b7-46ec-7ac1-39ae992cab98", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3fc8632c-7297-4a15-5492-7b9317e80e4f", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { - "BODY": "", - "REASON_PHRASE": "Created", - "STATUS_CODE": "201", - "content-length": "0", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", - "etag": "\"0x8D9C0DFE35200EE\"", - "last-modified": "Thu, 16 Dec 2021 22:03:27 GMT", + "BODY": "ContainerAlreadyExistsThe specified container already exists.\nRequestId:622f35fc-801e-0005-3749-880819000000\nTime:2022-06-25T04:08:00.1551929Z", + "REASON_PHRASE": "The specified container already exists.", + "STATUS_CODE": "409", + "content-length": "230", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 04:07:59 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "caddbf7c-e6b7-46ec-7ac1-39ae992cab98", - "x-ms-request-id": "618559cc-a01e-0077-5ac8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "3fc8632c-7297-4a15-5492-7b9317e80e4f", + "x-ms-error-code": "ContainerAlreadyExists", + "x-ms-request-id": "622f35fc-801e-0005-3749-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "82e15a63-aa5e-4715-6bde-77b844a46d09", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "ec9c64ee-f1c3-4300-7172-e3e24d798f28", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -34,44 +34,45 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", - "etag": "\"0x8D9C0DFE354586A\"", - "last-modified": "Thu, 16 Dec 2021 22:03:27 GMT", + "date": "Sat, 25 Jun 2022 04:08:00 GMT", + "etag": "\"0x8DA56604B35A589\"", + "last-modified": "Sat, 25 Jun 2022 04:08:00 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "82e15a63-aa5e-4715-6bde-77b844a46d09", - "x-ms-request-id": "618559e3-a01e-0077-6ec8-f2bf6a000000", + "x-ms-client-request-id": "ec9c64ee-f1c3-4300-7172-e3e24d798f28", + "x-ms-request-id": "622f3652-801e-0005-7d49-880819000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:03:27.3831530Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T04:08:00.5002633Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname/a%20b%20c%20/%20!@%23$%25%5E&*(%3F/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "12033ef8-005f-4ad3-6f1a-a439dab4aa71", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "e38f0600-eb9a-448d-6a5e-2191b28ac925", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobnamea b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname2021-12-16T22:03:27.3831530ZtrueThu, 16 Dec 2021 22:03:27 GMTThu, 16 Dec 2021 22:03:27 GMT0x8D9C0DFE354586A0application/octet-streamAppendBlobunlockedavailabletrue", + "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobnamea b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname2022-06-25T04:08:00.5002633ZtrueSat, 25 Jun 2022 04:08:00 GMTSat, 25 Jun 2022 04:08:00 GMT0x8DA56604B35A5890application/octet-streamAppendBlobunlockedavailabletrue", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", + "date": "Sat, 25 Jun 2022 04:08:00 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "12033ef8-005f-4ad3-6f1a-a439dab4aa71", - "x-ms-request-id": "618559fc-a01e-0077-05c8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "e38f0600-eb9a-448d-6a5e-2191b28ac925", + "x-ms-request-id": "622f36ae-801e-0005-4b49-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&prefix=a%20b%20c%20/%20!@%23$%25%5E%26*(?/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname&restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "da2b7858-f6f5-4ef5-5a59-f7e20263c86e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "8e43d1b6-423b-45e6-573b-e5934d128d8e", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -79,44 +80,45 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", - "etag": "\"0x8D9C0DFE3584F7E\"", - "last-modified": "Thu, 16 Dec 2021 22:03:27 GMT", + "date": "Sat, 25 Jun 2022 04:08:00 GMT", + "etag": "\"0x8DA56604B95B8F3\"", + "last-modified": "Sat, 25 Jun 2022 04:08:01 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "da2b7858-f6f5-4ef5-5a59-f7e20263c86e", - "x-ms-request-id": "61855a04-a01e-0077-0dc8-f2bf6a000000", + "x-ms-client-request-id": "8e43d1b6-423b-45e6-573b-e5934d128d8e", + "x-ms-request-id": "622f3721-801e-0005-2a49-880819000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:03:27.4091390Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T04:08:01.1299059Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname/a%20b%20c%20/%20!@%23$%25%5E&*(%3F/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname1" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c3e7786f-0319-4b56-6fae-57b9dec17d2f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "cb10401c-3444-47cd-4541-353fa51b9262", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname1a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname12021-12-16T22:03:27.4091390ZtrueThu, 16 Dec 2021 22:03:27 GMTThu, 16 Dec 2021 22:03:27 GMT0x8D9C0DFE3584F7E1024application/octet-stream0PageBlobunlockedavailabletrue", + "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname1a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname12022-06-25T04:08:01.1299059ZtrueSat, 25 Jun 2022 04:08:01 GMTSat, 25 Jun 2022 04:08:01 GMT0x8DA56604B95B8F31024application/octet-stream0PageBlobunlockedavailabletrue", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", + "date": "Sat, 25 Jun 2022 04:08:01 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "c3e7786f-0319-4b56-6fae-57b9dec17d2f", - "x-ms-request-id": "61855a12-a01e-0077-1bc8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "cb10401c-3444-47cd-4541-353fa51b9262", + "x-ms-request-id": "622f3787-801e-0005-7c49-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&prefix=a%20b%20c%20/%20!@%23$%25%5E%26*(?/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname1&restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ffab671a-a5f1-4b03-78ce-51a6b00cf42f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "a432efe8-3979-40fa-68fe-d3b2c72735e5", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -125,45 +127,46 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "1B2M2Y8AsgTpgAmY7PhCfg==", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", - "etag": "\"0x8D9C0DFE35BF86A\"", - "last-modified": "Thu, 16 Dec 2021 22:03:27 GMT", + "date": "Sat, 25 Jun 2022 04:08:01 GMT", + "etag": "\"0x8DA56604BF94E4E\"", + "last-modified": "Sat, 25 Jun 2022 04:08:01 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ffab671a-a5f1-4b03-78ce-51a6b00cf42f", + "x-ms-client-request-id": "a432efe8-3979-40fa-68fe-d3b2c72735e5", "x-ms-content-crc64": "AAAAAAAAAAA=", - "x-ms-request-id": "61855a17-a01e-0077-20c8-f2bf6a000000", + "x-ms-request-id": "622f37fc-801e-0005-5f49-880819000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:03:27.4341237Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T04:08:01.7825358Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname/a%20b%20c%20/%20!@%23$%25%5E&*(%3F/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ec3e273d-c029-4d6c-5104-4145943eb035", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "a229df2f-a3bb-432a-7152-9955416851ea", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname2a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname22021-12-16T22:03:27.4341237ZtrueThu, 16 Dec 2021 22:03:27 GMTThu, 16 Dec 2021 22:03:27 GMT0x8D9C0DFE35BF86A0application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletrue", + "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname2a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname22022-06-25T04:08:01.7825358ZtrueSat, 25 Jun 2022 04:08:01 GMTSat, 25 Jun 2022 04:08:01 GMT0x8DA56604BF94E4E0application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==Sat, 25 Jun 2022 04:08:01 GMTBlockBlobHottrueunlockedavailabletrue", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", + "date": "Sat, 25 Jun 2022 04:08:01 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "ec3e273d-c029-4d6c-5104-4145943eb035", - "x-ms-request-id": "61855a2b-a01e-0077-32c8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "a229df2f-a3bb-432a-7152-9955416851ea", + "x-ms-request-id": "622f385c-801e-0005-3349-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&prefix=a%20b%20c%20/%20!@%23$%25%5E%26*(?/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname2&restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a407d655-98e4-4007-7f20-ee6287439ea6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3b355deb-3bc9-4718-427b-8621b7726914", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -171,44 +174,45 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", - "etag": "\"0x8D9C0DFE35F7A58\"", - "last-modified": "Thu, 16 Dec 2021 22:03:27 GMT", + "date": "Sat, 25 Jun 2022 04:08:02 GMT", + "etag": "\"0x8DA56604D1DA6A1\"", + "last-modified": "Sat, 25 Jun 2022 04:08:03 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a407d655-98e4-4007-7f20-ee6287439ea6", - "x-ms-request-id": "61855a38-a01e-0077-3fc8-f2bf6a000000", + "x-ms-client-request-id": "3b355deb-3bc9-4718-427b-8621b7726914", + "x-ms-request-id": "ffcf3275-601e-006f-2e49-88d031000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:03:27.4571105Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T04:08:03.6984481Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname/a%20b%20c%20/%20!@%23$%25%5E&*(%3F/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname3" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3520d768-cb71-40ca-4717-f54b06b09dd5", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f26c20bf-9c58-408a-52da-7152f4265756", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname3a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname32021-12-16T22:03:27.4571105ZtrueThu, 16 Dec 2021 22:03:27 GMTThu, 16 Dec 2021 22:03:27 GMT0x8D9C0DFE35F7A580application/octet-streamAppendBlobunlockedavailabletrue", + "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname3a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname32022-06-25T04:08:03.6984481ZtrueSat, 25 Jun 2022 04:08:03 GMTSat, 25 Jun 2022 04:08:03 GMT0x8DA56604D1DA6A10application/octet-streamAppendBlobunlockedavailabletrue", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", + "date": "Sat, 25 Jun 2022 04:08:03 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "3520d768-cb71-40ca-4717-f54b06b09dd5", - "x-ms-request-id": "61855a86-a01e-0077-06c8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "f26c20bf-9c58-408a-52da-7152f4265756", + "x-ms-request-id": "ffcf32d9-601e-006f-7d49-88d031000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&prefix=a%20b%20c%20/%20!@%23$%25%5E%26*(?/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname3&restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7a018901-b9f5-475d-7ad3-528304f5e56a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "74ff023a-6e85-4df5-60b2-956d91d626ad", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -216,44 +220,45 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", - "etag": "\"0x8D9C0DFE379672B\"", - "last-modified": "Thu, 16 Dec 2021 22:03:27 GMT", + "date": "Sat, 25 Jun 2022 04:08:03 GMT", + "etag": "\"0x8DA56604D7FDCA1\"", + "last-modified": "Sat, 25 Jun 2022 04:08:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7a018901-b9f5-475d-7ad3-528304f5e56a", - "x-ms-request-id": "61855aa8-a01e-0077-22c8-f2bf6a000000", + "x-ms-client-request-id": "74ff023a-6e85-4df5-60b2-956d91d626ad", + "x-ms-request-id": "ffcf3364-601e-006f-7249-88d031000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:03:27.6260139Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T04:08:04.3420833Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname/a%20b%20c%20/%20!@%23$%25%5E&*(%3F/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname4" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "cad09f8a-4389-4cac-6f56-5c2da587c46a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "c42613c6-20bc-4564-4252-95e69547963d", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname4a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname42021-12-16T22:03:27.6260139ZtrueThu, 16 Dec 2021 22:03:27 GMTThu, 16 Dec 2021 22:03:27 GMT0x8D9C0DFE379672B1024application/octet-stream0PageBlobunlockedavailabletrue", + "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname4a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname42022-06-25T04:08:04.3420833ZtrueSat, 25 Jun 2022 04:08:04 GMTSat, 25 Jun 2022 04:08:04 GMT0x8DA56604D7FDCA11024application/octet-stream0PageBlobunlockedavailabletrue", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", + "date": "Sat, 25 Jun 2022 04:08:03 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "cad09f8a-4389-4cac-6f56-5c2da587c46a", - "x-ms-request-id": "61855acc-a01e-0077-41c8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "c42613c6-20bc-4564-4252-95e69547963d", + "x-ms-request-id": "ffcf33b9-601e-006f-3a49-88d031000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&prefix=a%20b%20c%20/%20!@%23$%25%5E%26*(?/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname4&restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2e779d6b-1223-43cf-4261-5d744c50562c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "7e60c45f-cee6-4342-6aec-024b9c7ab84f", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -262,45 +267,116 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "1B2M2Y8AsgTpgAmY7PhCfg==", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", - "etag": "\"0x8D9C0DFE3821876\"", - "last-modified": "Thu, 16 Dec 2021 22:03:27 GMT", + "date": "Sat, 25 Jun 2022 04:08:04 GMT", + "etag": "\"0x8DA56604DE4AA48\"", + "last-modified": "Sat, 25 Jun 2022 04:08:05 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2e779d6b-1223-43cf-4261-5d744c50562c", + "x-ms-client-request-id": "7e60c45f-cee6-4342-6aec-024b9c7ab84f", "x-ms-content-crc64": "AAAAAAAAAAA=", - "x-ms-request-id": "61855af5-a01e-0077-66c8-f2bf6a000000", + "x-ms-request-id": "ffcf340c-601e-006f-7949-88d031000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:03:27.6829814Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T04:08:05.0027080Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname/a%20b%20c%20/%20!@%23$%25%5E&*(%3F/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname5" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "4e17334c-3d24-4fe8-5b5d-9304273ad43b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "31be965d-048e-4b62-4102-13931bf0b89f", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname5a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname52021-12-16T22:03:27.6829814ZtrueThu, 16 Dec 2021 22:03:27 GMTThu, 16 Dec 2021 22:03:27 GMT0x8D9C0DFE38218760application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletrue", + "BODY": "a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname5a b c / !@#$%^&*(?/<>,.;:'\"[]{}|`~) def测试blobcontainerclienttestspecialblobname52022-06-25T04:08:05.0027080ZtrueSat, 25 Jun 2022 04:08:05 GMTSat, 25 Jun 2022 04:08:05 GMT0x8DA56604DE4AA480application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==Sat, 25 Jun 2022 04:08:05 GMTBlockBlobHottrueunlockedavailabletrue", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", + "date": "Sat, 25 Jun 2022 04:08:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "4e17334c-3d24-4fe8-5b5d-9304273ad43b", - "x-ms-request-id": "61855b06-a01e-0077-77c8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "31be965d-048e-4b62-4102-13931bf0b89f", + "x-ms-request-id": "ffcf34a1-601e-006f-7649-88d031000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&prefix=a%20b%20c%20/%20!@%23$%25%5E%26*(?/%3C%3E,.;:'%22%5B%5D%7B%7D%7C%60~)%20def%E6%B5%8B%E8%AF%95blobcontainerclienttestspecialblobname5&restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f7c4cd4e-4cce-4b7a-5c9c-942607c5545a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "a11ef2ee-8ed2-45b7-68ff-8fa78fdbc6ee", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "content-md5": "1B2M2Y8AsgTpgAmY7PhCfg==", + "date": "Sat, 25 Jun 2022 04:08:05 GMT", + "etag": "\"0x8DA56604EA67E90\"", + "last-modified": "Sat, 25 Jun 2022 04:08:06 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "a11ef2ee-8ed2-45b7-68ff-8fa78fdbc6ee", + "x-ms-content-crc64": "AAAAAAAAAAA=", + "x-ms-request-id": "ffcf34eb-601e-006f-3149-88d031000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T04:08:06.2739872Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname/aaaaa%EF%BF%BFbbb/ccc" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "bba38f86-d5be-4443-65ff-cc4f802207ef", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "aaaaaaaaaabbb/c2022-06-25T04:07:05.9242223ZtrueSat, 25 Jun 2022 04:07:05 GMTSat, 25 Jun 2022 04:07:05 GMT0x8DA56602AAE00EF0application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==Sat, 25 Jun 2022 04:07:05 GMTBlockBlobHottrueunlockedavailabletrueaaaaa%EF%BF%BFbbb%2Fccc2022-06-25T04:08:06.2739872ZtrueSat, 25 Jun 2022 04:08:06 GMTSat, 25 Jun 2022 04:08:06 GMT0x8DA56604EA67E900application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==Sat, 25 Jun 2022 04:08:06 GMTBlockBlobHottrueunlockedavailabletrue", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 04:08:05 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "vary": "Origin", + "x-ms-client-request-id": "bba38f86-d5be-4443-65ff-cc4f802207ef", + "x-ms-request-id": "ffcf35ef-601e-006f-0349-88d031000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&prefix=aaaaa&restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "699e782f-6444-40a7-5c64-9f27b2a96d17", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "/a b c /aaaaabbb/aaaaa%EF%BF%BFbbb%2F", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 04:08:06 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "vary": "Origin", + "x-ms-client-request-id": "699e782f-6444-40a7-5c64-9f27b2a96d17", + "x-ms-request-id": "ffcf364d-601e-006f-5349-88d031000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?comp=list&delimiter=/&restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "1d2979d4-69cd-4e0f-76ab-5ecdda375617", + "x-ms-version": "2021-04-10" }, "Method": "DELETE", "Response": { @@ -308,11 +384,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:03:26 GMT", + "date": "Sat, 25 Jun 2022 04:08:06 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f7c4cd4e-4cce-4b7a-5c9c-942607c5545a", - "x-ms-request-id": "61855b19-a01e-0077-0ac8-f2bf6a000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "1d2979d4-69cd-4e0f-76ab-5ecdda375617", + "x-ms-request-id": "ffcf36ba-601e-006f-3249-88d031000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttestspecialblobname?restype=container" } diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.Tags.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.Tags.json index 61bdf83635..654df9c244 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.Tags.json +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobContainerClientTest.Tags.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "3bcb2309-aaf3-4d0b-6f9a-440a118f1b6b", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "64a2b3a3-6966-4163-51ea-fb2a95fa1331", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Sun, 20 Feb 2022 05:27:30 GMT", - "etag": "\"0x8D9F431B080C267\"", - "last-modified": "Sun, 20 Feb 2022 05:27:30 GMT", + "date": "Sat, 25 Jun 2022 05:24:11 GMT", + "etag": "\"0x8DA566AEFDBD255\"", + "last-modified": "Sat, 25 Jun 2022 05:24:11 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3bcb2309-aaf3-4d0b-6f9a-440a118f1b6b", - "x-ms-request-id": "de3aee85-001e-0039-7a1a-263749000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "64a2b3a3-6966-4163-51ea-fb2a95fa1331", + "x-ms-request-id": "824ed3d1-f01e-0052-1553-88a62a000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags?restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "d27606df-4899-49bc-58ea-faea349cceb6", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "4beb1b5d-fb88-43be-779f-f761380d4e99", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -34,23 +34,23 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Sun, 20 Feb 2022 05:27:30 GMT", - "etag": "\"0x8D9F431B0A856C4\"", - "last-modified": "Sun, 20 Feb 2022 05:27:30 GMT", + "date": "Sat, 25 Jun 2022 05:24:11 GMT", + "etag": "\"0x8DA566AF0179384\"", + "last-modified": "Sat, 25 Jun 2022 05:24:12 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d27606df-4899-49bc-58ea-faea349cceb6", - "x-ms-request-id": "de3aef0c-001e-0039-741a-263749000000", + "x-ms-client-request-id": "4beb1b5d-fb88-43be-779f-f761380d4e99", + "x-ms-request-id": "824ed4a2-f01e-0052-5a53-88a62a000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T05:27:30.4032964Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:12.0955540Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "c972d5e7-b0a8-4826-6ffd-525ea77f984b", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f70ef028-b83b-4553-7fd0-3368ca80f058", + "x-ms-version": "2021-04-10" }, "Method": "HEAD", "Response": { @@ -60,30 +60,30 @@ "accept-ranges": "bytes", "content-length": "0", "content-type": "application/octet-stream", - "date": "Sun, 20 Feb 2022 05:27:30 GMT", - "etag": "\"0x8D9F431B0A856C4\"", - "last-modified": "Sun, 20 Feb 2022 05:27:30 GMT", + "date": "Sat, 25 Jun 2022 05:24:12 GMT", + "etag": "\"0x8DA566AF0179384\"", + "last-modified": "Sat, 25 Jun 2022 05:24:12 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "vary": "Origin", "x-ms-blob-committed-block-count": "0", "x-ms-blob-type": "AppendBlob", - "x-ms-client-request-id": "c972d5e7-b0a8-4826-6ffd-525ea77f984b", - "x-ms-creation-time": "Sun, 20 Feb 2022 05:27:30 GMT", + "x-ms-client-request-id": "f70ef028-b83b-4553-7fd0-3368ca80f058", + "x-ms-creation-time": "Sat, 25 Jun 2022 05:24:12 GMT", "x-ms-is-current-version": "true", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "de3aef4e-001e-0039-321a-263749000000", + "x-ms-request-id": "824ed58d-f01e-0052-2453-88a62a000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T05:27:30.4032964Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:12.0955540Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "aacd61c4-2e05-42ca-5c7a-0707670bf89d", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3333e184-195e-405b-4fb6-3bed6bb32dcd", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { @@ -93,30 +93,30 @@ "accept-ranges": "bytes", "content-length": "0", "content-type": "application/octet-stream", - "date": "Sun, 20 Feb 2022 05:27:30 GMT", - "etag": "\"0x8D9F431B0A856C4\"", - "last-modified": "Sun, 20 Feb 2022 05:27:30 GMT", + "date": "Sat, 25 Jun 2022 05:24:12 GMT", + "etag": "\"0x8DA566AF0179384\"", + "last-modified": "Sat, 25 Jun 2022 05:24:12 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "vary": "Origin", "x-ms-blob-committed-block-count": "0", "x-ms-blob-type": "AppendBlob", - "x-ms-client-request-id": "aacd61c4-2e05-42ca-5c7a-0707670bf89d", - "x-ms-creation-time": "Sun, 20 Feb 2022 05:27:30 GMT", + "x-ms-client-request-id": "3333e184-195e-405b-4fb6-3bed6bb32dcd", + "x-ms-creation-time": "Sat, 25 Jun 2022 05:24:12 GMT", "x-ms-is-current-version": "true", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "de3aef96-001e-0039-731a-263749000000", + "x-ms-request-id": "824ed640-f01e-0052-4753-88a62a000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T05:27:30.4032964Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:12.0955540Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "73557ccc-c7ff-4c06-729f-d89428b60337", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "1d2bf0a4-3508-4f20-78fe-8e728e082112", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { @@ -125,40 +125,40 @@ "STATUS_CODE": "200", "content-length": "64", "content-type": "application/xml", - "date": "Sun, 20 Feb 2022 05:27:31 GMT", + "date": "Sat, 25 Jun 2022 05:24:12 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "vary": "Origin", - "x-ms-client-request-id": "73557ccc-c7ff-4c06-729f-d89428b60337", - "x-ms-request-id": "de3af016-001e-0039-6d1a-263749000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "1d2bf0a4-3508-4f20-78fe-8e728e082112", + "x-ms-request-id": "824ed735-f01e-0052-2a53-88a62a000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags?comp=tags" }, { "Headers": { "content-type": "application/xml; charset=UTF-8", - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "26b3ed0e-789a-4191-6ea2-c15a517a97dc", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "1c6da193-c721-4cf3-5583-c6e0ecf794a9", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { "BODY": "", "REASON_PHRASE": "No Content", "STATUS_CODE": "204", - "date": "Sun, 20 Feb 2022 05:27:31 GMT", + "date": "Sat, 25 Jun 2022 05:24:13 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "26b3ed0e-789a-4191-6ea2-c15a517a97dc", - "x-ms-request-id": "de3af091-001e-0039-621a-263749000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "1c6da193-c721-4cf3-5583-c6e0ecf794a9", + "x-ms-request-id": "824ed839-f01e-0052-1653-88a62a000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags?comp=tags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "43cdb534-1edc-42c0-6e8f-b7eec3d97864", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "14274b63-a0c3-426b-6247-29412e2ed9b4", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { @@ -167,20 +167,20 @@ "STATUS_CODE": "200", "content-length": "354", "content-type": "application/xml", - "date": "Sun, 20 Feb 2022 05:27:31 GMT", + "date": "Sat, 25 Jun 2022 05:24:13 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "vary": "Origin", - "x-ms-client-request-id": "43cdb534-1edc-42c0-6e8f-b7eec3d97864", - "x-ms-request-id": "de3af0fc-001e-0039-3d1a-263749000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "14274b63-a0c3-426b-6247-29412e2ed9b4", + "x-ms-request-id": "824ed93a-f01e-0052-0653-88a62a000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags?comp=tags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "eb6e23cb-20ef-4a95-63a5-04f64d421ff6", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3ed2f563-3f19-47b2-70bd-f363a025268f", + "x-ms-version": "2021-04-10" }, "Method": "HEAD", "Response": { @@ -190,31 +190,31 @@ "accept-ranges": "bytes", "content-length": "0", "content-type": "application/octet-stream", - "date": "Sun, 20 Feb 2022 05:27:31 GMT", - "etag": "\"0x8D9F431B0A856C4\"", - "last-modified": "Sun, 20 Feb 2022 05:27:30 GMT", + "date": "Sat, 25 Jun 2022 05:24:13 GMT", + "etag": "\"0x8DA566AF0179384\"", + "last-modified": "Sat, 25 Jun 2022 05:24:12 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "vary": "Origin", "x-ms-blob-committed-block-count": "0", "x-ms-blob-type": "AppendBlob", - "x-ms-client-request-id": "eb6e23cb-20ef-4a95-63a5-04f64d421ff6", - "x-ms-creation-time": "Sun, 20 Feb 2022 05:27:30 GMT", + "x-ms-client-request-id": "3ed2f563-3f19-47b2-70bd-f363a025268f", + "x-ms-creation-time": "Sat, 25 Jun 2022 05:24:12 GMT", "x-ms-is-current-version": "true", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "de3af146-001e-0039-7e1a-263749000000", + "x-ms-request-id": "824ed9ca-f01e-0052-0253-88a62a000000", "x-ms-server-encrypted": "true", "x-ms-tag-count": "3", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T05:27:30.4032964Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:12.0955540Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "375d08ae-5e8d-4157-586f-6d5001d6bc49", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "92cda55d-c210-4833-685f-653d1636efe9", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { @@ -224,75 +224,317 @@ "accept-ranges": "bytes", "content-length": "0", "content-type": "application/octet-stream", - "date": "Sun, 20 Feb 2022 05:27:32 GMT", - "etag": "\"0x8D9F431B0A856C4\"", - "last-modified": "Sun, 20 Feb 2022 05:27:30 GMT", + "date": "Sat, 25 Jun 2022 05:24:14 GMT", + "etag": "\"0x8DA566AF0179384\"", + "last-modified": "Sat, 25 Jun 2022 05:24:12 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "vary": "Origin", "x-ms-blob-committed-block-count": "0", "x-ms-blob-type": "AppendBlob", - "x-ms-client-request-id": "375d08ae-5e8d-4157-586f-6d5001d6bc49", - "x-ms-creation-time": "Sun, 20 Feb 2022 05:27:30 GMT", + "x-ms-client-request-id": "92cda55d-c210-4833-685f-653d1636efe9", + "x-ms-creation-time": "Sat, 25 Jun 2022 05:24:12 GMT", "x-ms-is-current-version": "true", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "de3af1bd-001e-0039-611a-263749000000", + "x-ms-request-id": "824eda61-f01e-0052-0353-88a62a000000", "x-ms-server-encrypted": "true", "x-ms-tag-count": "3", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T05:27:30.4032964Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:12.0955540Z" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "ba59ce19-b611-4474-524f-5234298a790c", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6b2698d9-5396-461c-5cc8-ec12ad08c24d", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "blobblobcontainerclienttesttagsblobblobcontainerclienttesttags2022-02-20T05:27:30.4032964ZtrueSun, 20 Feb 2022 05:27:30 GMTSun, 20 Feb 2022 05:27:30 GMT0x8D9F431B0A856C40application/octet-streamAppendBlobunlockedavailabletrue3kblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6", + "BODY": "blobblobcontainerclienttesttagsblobblobcontainerclienttesttags2022-06-25T05:24:12.0955540ZtrueSat, 25 Jun 2022 05:24:12 GMTSat, 25 Jun 2022 05:24:12 GMT0x8DA566AF01793840application/octet-streamAppendBlobunlockedavailabletrue3kblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Sun, 20 Feb 2022 05:27:32 GMT", + "date": "Sat, 25 Jun 2022 05:24:14 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", "vary": "Origin", - "x-ms-client-request-id": "ba59ce19-b611-4474-524f-5234298a790c", - "x-ms-request-id": "de3af230-001e-0039-4a1a-263749000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "6b2698d9-5396-461c-5cc8-ec12ad08c24d", + "x-ms-request-id": "824edb38-f01e-0052-4953-88a62a000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags?comp=list&include=tags&prefix=blobblobcontainerclienttesttags&restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "92b49baf-2160-4324-41f0-389224fe6732", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "138b2a47-0144-4779-7fdd-72c2b9a12578", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 05:24:14 GMT", + "etag": "\"0x8DA566AF1EC3597\"", + "last-modified": "Sat, 25 Jun 2022 05:24:15 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "138b2a47-0144-4779-7fdd-72c2b9a12578", + "x-ms-request-id": "824edbf3-f01e-0052-7b53-88a62a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:15.1657879Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags0" + }, + { + "Headers": { + "content-type": "application/xml; charset=UTF-8", + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "141c5f97-9d6c-4908-6ab4-f41a61764095", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "No Content", + "STATUS_CODE": "204", + "date": "Sat, 25 Jun 2022 05:24:15 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "141c5f97-9d6c-4908-6ab4-f41a61764095", + "x-ms-request-id": "824edc5c-f01e-0052-5253-88a62a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags0?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6d425483-862e-43d2-736a-401341706ffe", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 05:24:15 GMT", + "etag": "\"0x8DA566AF268582F\"", + "last-modified": "Sat, 25 Jun 2022 05:24:15 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6d425483-862e-43d2-736a-401341706ffe", + "x-ms-request-id": "824edd36-f01e-0052-1153-88a62a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:15.9793199Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags1" + }, + { + "Headers": { + "content-type": "application/xml; charset=UTF-8", + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "d6f7fde7-ac2c-4739-5b27-42c74263f998", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "No Content", + "STATUS_CODE": "204", + "date": "Sat, 25 Jun 2022 05:24:16 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d6f7fde7-ac2c-4739-5b27-42c74263f998", + "x-ms-request-id": "824ede3e-f01e-0052-0653-88a62a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags1?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "795dd0c1-f698-4d35-53de-f8f28ca29e01", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 05:24:16 GMT", + "etag": "\"0x8DA566AF2E1BC18\"", + "last-modified": "Sat, 25 Jun 2022 05:24:16 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "795dd0c1-f698-4d35-53de-f8f28ca29e01", + "x-ms-request-id": "824edf4e-f01e-0052-7f53-88a62a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:16.7748632Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags2" + }, + { + "Headers": { + "content-type": "application/xml; charset=UTF-8", + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3a022011-3dbd-4491-6454-3825821c6a7c", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "No Content", + "STATUS_CODE": "204", + "date": "Sat, 25 Jun 2022 05:24:16 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3a022011-3dbd-4491-6454-3825821c6a7c", + "x-ms-request-id": "824ee006-f01e-0052-2553-88a62a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags2?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "c2e65d82-e361-4e97-45a8-a58fa2ea3643", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 05:24:17 GMT", + "etag": "\"0x8DA566AF35DB7A4\"", + "last-modified": "Sat, 25 Jun 2022 05:24:17 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c2e65d82-e361-4e97-45a8-a58fa2ea3643", + "x-ms-request-id": "824ee123-f01e-0052-2c53-88a62a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:17.5873956Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags3" + }, + { + "Headers": { + "content-type": "application/xml; charset=UTF-8", + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "ed175c6a-37ec-4150-588e-c997d7fd911f", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "No Content", + "STATUS_CODE": "204", + "date": "Sat, 25 Jun 2022 05:24:17 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ed175c6a-37ec-4150-588e-c997d7fd911f", + "x-ms-request-id": "824ee21c-f01e-0052-1053-88a62a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags3?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "36980153-45ba-499d-73e5-fd73fe308659", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 05:24:18 GMT", + "etag": "\"0x8DA566AF3D87AE1\"", + "last-modified": "Sat, 25 Jun 2022 05:24:18 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "36980153-45ba-499d-73e5-fd73fe308659", + "x-ms-request-id": "824ee355-f01e-0052-3a53-88a62a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T05:24:18.3919329Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags4" + }, + { + "Headers": { + "content-type": "application/xml; charset=UTF-8", + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "5ae1f731-ac3b-4c55-46fa-9ee7460ae898", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "No Content", + "STATUS_CODE": "204", + "date": "Sat, 25 Jun 2022 05:24:18 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5ae1f731-ac3b-4c55-46fa-9ee7460ae898", + "x-ms-request-id": "824ee41d-f01e-0052-7053-88a62a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags/blobblobcontainerclienttesttags4?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "11c82f51-62cd-4fb0-57f3-2a333378b8fb", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "\nkblobcontainerclienttesttags1 = 'blobcontainerclienttesttags2' AND kblobcontainerclienttesttags3 >= 'blobcontainerclienttesttags4' AND kblobcontainerclienttesttags5 <= 'blobcontainerclienttesttags6'blobblobcontainerclienttesttagsblobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags0blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags1blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags2blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags3blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags4blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 05:24:55 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "vary": "Origin", + "x-ms-client-request-id": "11c82f51-62cd-4fb0-57f3-2a333378b8fb", + "x-ms-request-id": "f40e10ad-501e-0029-0b53-88e4b6000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags?comp=blobs&restype=container&where=kblobcontainerclienttesttags1%20%3D%20'blobcontainerclienttesttags2'%20AND%20kblobcontainerclienttesttags3%20%3E%3D%20'blobcontainerclienttesttags4'%20AND%20kblobcontainerclienttesttags5%20%3C%3D%20'blobcontainerclienttesttags6'" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "0c45311a-bcfc-4c43-4c1b-2a034c197115", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "\nkblobcontainerclienttesttags1 = 'blobcontainerclienttesttags2' AND kblobcontainerclienttesttags3 >= 'blobcontainerclienttesttags4' AND kblobcontainerclienttesttags5 <= 'blobcontainerclienttesttags6'blobblobcontainerclienttesttagsblobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6", + "BODY": "\nkblobcontainerclienttesttags1 = 'blobcontainerclienttesttags2' AND kblobcontainerclienttesttags3 >= 'blobcontainerclienttesttags4' AND kblobcontainerclienttesttags5 <= 'blobcontainerclienttesttags6'blobblobcontainerclienttesttagsblobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags0blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags1blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags2blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags3blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6blobblobcontainerclienttesttags4blobcontainerclienttesttagskblobcontainerclienttesttags1blobcontainerclienttesttags2kblobcontainerclienttesttags3blobcontainerclienttesttags4kblobcontainerclienttesttags5blobcontainerclienttesttags6", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Sun, 20 Feb 2022 05:27:33 GMT", + "date": "Sat, 25 Jun 2022 05:25:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", "vary": "Origin", - "x-ms-client-request-id": "92b49baf-2160-4324-41f0-389224fe6732", - "x-ms-request-id": "de3af2ac-001e-0039-3a1a-263749000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "0c45311a-bcfc-4c43-4c1b-2a034c197115", + "x-ms-request-id": "8c4ecb35-801e-0077-4353-880f56000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net?comp=blobs&where=kblobcontainerclienttesttags1%20%3D%20'blobcontainerclienttesttags2'%20AND%20kblobcontainerclienttesttags3%20%3E%3D%20'blobcontainerclienttesttags4'%20AND%20kblobcontainerclienttesttags5%20%3C%3D%20'blobcontainerclienttesttags6'" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "8c2ebbaa-5369-47c2-4c87-ed254b8b3e93", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "afc5609e-ea85-4d73-7447-52519486a810", + "x-ms-version": "2021-04-10" }, "Method": "DELETE", "Response": { @@ -300,11 +542,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Sun, 20 Feb 2022 05:27:33 GMT", + "date": "Sat, 25 Jun 2022 05:25:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8c2ebbaa-5369-47c2-4c87-ed254b8b3e93", - "x-ms-request-id": "de3af3a9-001e-0039-211a-263749000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "afc5609e-ea85-4d73-7447-52519486a810", + "x-ms-request-id": "8c4ed7b9-801e-0077-5d53-880f56000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blobcontainerclienttesttags?restype=container" } diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobServiceClientTest.SetProperties.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobServiceClientTest.SetProperties.json index 429767bcfd..2c1d7291ae 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobServiceClientTest.SetProperties.json +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlobServiceClientTest.SetProperties.json @@ -2,32 +2,32 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.1 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "35419e25-3165-4f93-51f9-5bab0eaec1ae", - "x-ms-version": "2020-10-02" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "2a77ceea-064a-429a-6021-4ca52875ace4", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "1.0truetruetruetrue31.0truetruetrue41.0truetruetrue4GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320true7falsetrueindex.html404.html2020-02-10", + "BODY": "1.0truetruetruetrue31.0truetruetrue41.0truetruetrue4GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320falsefalsetrueindex.html404.html2020-02-10", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Mon, 16 May 2022 12:49:31 GMT", + "date": "Sat, 25 Jun 2022 09:01:41 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", "vary": "Origin", - "x-ms-client-request-id": "35419e25-3165-4f93-51f9-5bab0eaec1ae", - "x-ms-request-id": "da10e09f-c01e-0082-5723-699b7c000000", - "x-ms-version": "2020-10-02" + "x-ms-client-request-id": "2a77ceea-064a-429a-6021-4ca52875ace4", + "x-ms-request-id": "62a44147-801e-0005-4972-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net?comp=properties&restype=service" }, { "Headers": { "content-type": "application/xml; charset=UTF-8", - "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.1 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "6944decb-5ada-41b4-6365-2f9b90220ebe", - "x-ms-version": "2020-10-02" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6a95c651-9aa3-492b-5972-8cbb59324f71", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -35,42 +35,42 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Mon, 16 May 2022 12:49:33 GMT", + "date": "Sat, 25 Jun 2022 09:01:42 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6944decb-5ada-41b4-6365-2f9b90220ebe", - "x-ms-request-id": "da10e162-c01e-0082-1423-699b7c000000", - "x-ms-version": "2020-10-02" + "x-ms-client-request-id": "6a95c651-9aa3-492b-5972-8cbb59324f71", + "x-ms-request-id": "62a442ae-801e-0005-0a72-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net?comp=properties&restype=service" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.1 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "a72f237f-cb76-4e90-52a6-eea437169f93", - "x-ms-version": "2020-10-02" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "d278e4e0-815c-49df-67ab-a8de0f97ef49", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { - "BODY": "1.0falsefalsefalsetrue31.0truetruetrue41.0truetruetrue4GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320true7falsetrueindex.html404.html2020-10-02", + "BODY": "1.0falsefalsefalsetrue31.0truetruetrue41.0truetruetrue4GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320true7falsetrueindex.html404.html2021-04-10", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Mon, 16 May 2022 12:49:43 GMT", + "date": "Sat, 25 Jun 2022 09:01:52 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", "vary": "Origin", - "x-ms-client-request-id": "a72f237f-cb76-4e90-52a6-eea437169f93", - "x-ms-request-id": "da10fdaf-c01e-0082-1623-699b7c000000", - "x-ms-version": "2020-10-02" + "x-ms-client-request-id": "d278e4e0-815c-49df-67ab-a8de0f97ef49", + "x-ms-request-id": "62a46672-801e-0005-3372-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net?comp=properties&restype=service" }, { "Headers": { "content-type": "application/xml; charset=UTF-8", - "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.1 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "ff874718-2fc2-479f-6308-fe94f0c824c9", - "x-ms-version": "2020-10-02" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b4b5d9aa-af34-4034-50e3-7188883a0fd8", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -78,11 +78,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Mon, 16 May 2022 12:49:43 GMT", + "date": "Sat, 25 Jun 2022 09:01:52 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ff874718-2fc2-479f-6308-fe94f0c824c9", - "x-ms-request-id": "da10fe3e-c01e-0082-1b23-699b7c000000", - "x-ms-version": "2020-10-02" + "x-ms-client-request-id": "b4b5d9aa-af34-4034-50e3-7188883a0fd8", + "x-ms-request-id": "62a46785-801e-0005-3272-880819000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net?comp=properties&restype=service" } diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.CopyWithTagsMetadataTier.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.CopyWithTagsMetadataTier.json index d691278c7b..8370fc74a4 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.CopyWithTagsMetadataTier.json +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.CopyWithTagsMetadataTier.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7d24cc71-aa97-4c63-4969-f47fa74c2dec", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "136c790c-0de5-4777-7b0a-c54ea67fb8f4", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:04:17 GMT", - "etag": "\"0x8D9C0E001DE1B9E\"", - "last-modified": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:32:57 GMT", + "etag": "\"0x8DA56854EE03EE9\"", + "last-modified": "Sat, 25 Jun 2022 08:32:58 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7d24cc71-aa97-4c63-4969-f47fa74c2dec", - "x-ms-request-id": "9097b259-401e-0032-29c8-f26a89000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "136c790c-0de5-4777-7b0a-c54ea67fb8f4", + "x-ms-request-id": "01b563eb-101e-0091-0c6e-88bf70000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier?restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "df627bad-9f58-4892-6a70-ab7cff370d68", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "1b091b27-82b3-4b5f-5c06-73a542126d17", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -35,24 +35,24 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "IFj7U/ZD/NWKjYOgVUI5Kw==", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", - "etag": "\"0x8D9C0E0020A0D10\"", - "last-modified": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:02 GMT", + "etag": "\"0x8DA5685518CC746\"", + "last-modified": "Sat, 25 Jun 2022 08:33:02 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "df627bad-9f58-4892-6a70-ab7cff370d68", + "x-ms-client-request-id": "1b091b27-82b3-4b5f-5c06-73a542126d17", "x-ms-content-crc64": "DU01Kv81ewI=", - "x-ms-request-id": "9097b27e-401e-0032-4ac8-f26a89000000", + "x-ms-request-id": "01b5649f-101e-0091-176e-88bf70000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:04:18.9056272Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:02.5166150Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ff1b397b-31c5-4ebd-531f-b4a52c16acca", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "7e32eb34-f071-43c5-420f-fd410e21c2f6", + "x-ms-version": "2021-04-10" }, "Method": "HEAD", "Response": { @@ -67,54 +67,56 @@ "content-length": "8388608", "content-md5": "IFj7U/ZD/NWKjYOgVUI5Kw==", "content-type": "application/x-binary", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", - "etag": "\"0x8D9C0E0020A0D10\"", - "last-modified": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:02 GMT", + "etag": "\"0x8DA5685518CC746\"", + "last-modified": "Sat, 25 Jun 2022 08:33:02 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", "x-ms-access-tier": "Hot", - "x-ms-access-tier-change-time": "Thu, 16 Dec 2021 22:04:18 GMT", + "x-ms-access-tier-change-time": "Sat, 25 Jun 2022 08:33:02 GMT", "x-ms-blob-type": "BlockBlob", - "x-ms-client-request-id": "ff1b397b-31c5-4ebd-531f-b4a52c16acca", - "x-ms-creation-time": "Thu, 16 Dec 2021 22:04:18 GMT", + "x-ms-client-request-id": "7e32eb34-f071-43c5-420f-fd410e21c2f6", + "x-ms-creation-time": "Sat, 25 Jun 2022 08:33:02 GMT", "x-ms-is-current-version": "true", + "x-ms-last-access-time": "Sat, 25 Jun 2022 08:33:02 GMT", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-key1": "V1", "x-ms-meta-key2": "Value2", - "x-ms-request-id": "9097b3ff-401e-0032-37c8-f26a89000000", + "x-ms-request-id": "01b56cdb-101e-0091-556e-88bf70000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:04:18.9056272Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:02.5166150Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "100ee672-a8fc-4840-6e02-67c02bf2766b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "4192a549-8f08-4fd4-6e7e-85efbaa92681", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { - "BODY": "ContainerAlreadyExistsThe specified container already exists.\nRequestId:9097b415-401e-0032-4dc8-f26a89000000\nTime:2021-12-16T22:04:18.9304631Z", + "BODY": "ContainerAlreadyExistsThe specified container already exists.\nRequestId:493db977-701e-0097-656e-888ccf000000\nTime:2022-06-25T08:33:04.6359117Z", "REASON_PHRASE": "The specified container already exists.", "STATUS_CODE": "409", "content-length": "230", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "100ee672-a8fc-4840-6e02-67c02bf2766b", + "x-ms-client-request-id": "4192a549-8f08-4fd4-6e7e-85efbaa92681", "x-ms-error-code": "ContainerAlreadyExists", - "x-ms-request-id": "9097b415-401e-0032-4dc8-f26a89000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "493db977-701e-0097-656e-888ccf000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier?restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a4c089ba-c43f-4274-5e31-7ccd54d78790", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "a66a210e-4304-4937-5c0b-477f14dc3058", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -122,24 +124,24 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", - "etag": "\"0x8D9C0E002157D15\"", - "last-modified": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:04 GMT", + "etag": "\"0x8DA568553052627\"", + "last-modified": "Sat, 25 Jun 2022 08:33:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a4c089ba-c43f-4274-5e31-7ccd54d78790", - "x-ms-copy-id": "945f5ef8-d16c-4725-94aa-06750c6a2f85", + "x-ms-client-request-id": "a66a210e-4304-4937-5c0b-477f14dc3058", + "x-ms-copy-id": "cbf0feff-0fea-4a42-9301-767704d03f5a", "x-ms-copy-status": "success", - "x-ms-request-id": "f29278bf-701e-0039-47c8-f291e2000000", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:04:18.9805845Z" + "x-ms-request-id": "493db9dd-701e-0097-426e-888ccf000000", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:04.9831975Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b45cc05b-bcac-474e-5365-20d361647029", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "4b660780-eecf-463f-648c-1eae7fccba0a", + "x-ms-version": "2021-04-10" }, "Method": "HEAD", "Response": { @@ -154,38 +156,40 @@ "content-length": "8388608", "content-md5": "IFj7U/ZD/NWKjYOgVUI5Kw==", "content-type": "application/x-binary", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", - "etag": "\"0x8D9C0E002157D15\"", - "last-modified": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:04 GMT", + "etag": "\"0x8DA568553052627\"", + "last-modified": "Sat, 25 Jun 2022 08:33:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", "x-ms-access-tier": "Cool", - "x-ms-access-tier-change-time": "Thu, 16 Dec 2021 22:04:18 GMT", + "x-ms-access-tier-change-time": "Sat, 25 Jun 2022 08:33:04 GMT", "x-ms-blob-type": "BlockBlob", - "x-ms-client-request-id": "b45cc05b-bcac-474e-5365-20d361647029", - "x-ms-copy-completion-time": "Thu, 16 Dec 2021 22:04:18 GMT", - "x-ms-copy-id": "945f5ef8-d16c-4725-94aa-06750c6a2f85", + "x-ms-client-request-id": "4b660780-eecf-463f-648c-1eae7fccba0a", + "x-ms-copy-completion-time": "Sat, 25 Jun 2022 08:33:04 GMT", + "x-ms-copy-id": "cbf0feff-0fea-4a42-9301-767704d03f5a", "x-ms-copy-progress": "8388608/8388608", - "x-ms-copy-source": "https://forcpprecordings.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier", + "x-ms-copy-source": "https://euap.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier", "x-ms-copy-status": "success", - "x-ms-creation-time": "Thu, 16 Dec 2021 22:04:18 GMT", + "x-ms-creation-time": "Sat, 25 Jun 2022 08:33:04 GMT", "x-ms-is-current-version": "true", + "x-ms-last-access-time": "Sat, 25 Jun 2022 08:33:04 GMT", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-key1": "value1", "x-ms-meta-key2": "value2", - "x-ms-request-id": "f29278d3-701e-0039-56c8-f291e2000000", + "x-ms-request-id": "493dba98-701e-0097-676e-888ccf000000", "x-ms-server-encrypted": "true", "x-ms-tag-count": "3", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:04:18.9805845Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:04.9831975Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f821b509-6055-40e0-4cd2-e4fd3acdcb0e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "5581ba07-fbca-4af2-6f78-e2b26eb6c951", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { @@ -194,19 +198,20 @@ "STATUS_CODE": "200", "content-length": "225", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:05 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f821b509-6055-40e0-4cd2-e4fd3acdcb0e", - "x-ms-request-id": "f29278e3-701e-0039-66c8-f291e2000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "5581ba07-fbca-4af2-6f78-e2b26eb6c951", + "x-ms-request-id": "493dbb49-701e-0097-0c6e-888ccf000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob?comp=tags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3a44bbde-1e9c-45f2-6798-ed427e14c965", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "e1bf4178-857c-4a43-5ef7-1db5db62b85a", + "x-ms-version": "2021-04-10" }, "Method": "HEAD", "Response": { @@ -221,38 +226,40 @@ "content-length": "8388608", "content-md5": "IFj7U/ZD/NWKjYOgVUI5Kw==", "content-type": "application/x-binary", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", - "etag": "\"0x8D9C0E002157D15\"", - "last-modified": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:05 GMT", + "etag": "\"0x8DA568553052627\"", + "last-modified": "Sat, 25 Jun 2022 08:33:04 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", "x-ms-access-tier": "Cool", - "x-ms-access-tier-change-time": "Thu, 16 Dec 2021 22:04:18 GMT", + "x-ms-access-tier-change-time": "Sat, 25 Jun 2022 08:33:04 GMT", "x-ms-blob-type": "BlockBlob", - "x-ms-client-request-id": "3a44bbde-1e9c-45f2-6798-ed427e14c965", - "x-ms-copy-completion-time": "Thu, 16 Dec 2021 22:04:18 GMT", - "x-ms-copy-id": "945f5ef8-d16c-4725-94aa-06750c6a2f85", + "x-ms-client-request-id": "e1bf4178-857c-4a43-5ef7-1db5db62b85a", + "x-ms-copy-completion-time": "Sat, 25 Jun 2022 08:33:04 GMT", + "x-ms-copy-id": "cbf0feff-0fea-4a42-9301-767704d03f5a", "x-ms-copy-progress": "8388608/8388608", - "x-ms-copy-source": "https://forcpprecordings.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier", + "x-ms-copy-source": "https://euap.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier", "x-ms-copy-status": "success", - "x-ms-creation-time": "Thu, 16 Dec 2021 22:04:18 GMT", + "x-ms-creation-time": "Sat, 25 Jun 2022 08:33:04 GMT", "x-ms-is-current-version": "true", + "x-ms-last-access-time": "Sat, 25 Jun 2022 08:33:04 GMT", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-key1": "value1", "x-ms-meta-key2": "value2", - "x-ms-request-id": "f29278f2-701e-0039-72c8-f291e2000000", + "x-ms-request-id": "493dbbb5-701e-0097-6f6e-888ccf000000", "x-ms-server-encrypted": "true", "x-ms-tag-count": "3", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:04:18.9805845Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:04.9831975Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b3a9fb6f-b2eb-4fc5-7d97-4bfb89fb14d6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "9f7fcf73-3b47-46c2-70cd-cda588a6e28e", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -260,25 +267,26 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", - "etag": "\"0x8D9C0E0022A6A68\"", - "last-modified": "Thu, 16 Dec 2021 22:04:19 GMT", + "date": "Sat, 25 Jun 2022 08:33:06 GMT", + "etag": "\"0x8DA568553CE6111\"", + "last-modified": "Sat, 25 Jun 2022 08:33:06 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b3a9fb6f-b2eb-4fc5-7d97-4bfb89fb14d6", + "x-ms-client-request-id": "9f7fcf73-3b47-46c2-70cd-cda588a6e28e", "x-ms-content-crc64": "DU01Kv81ewI=", - "x-ms-copy-id": "50498d84-8995-4f25-bbc3-cbc33921f867", + "x-ms-copy-id": "5da2d634-99ff-47da-809e-b5d0fc2ec8da", "x-ms-copy-status": "success", - "x-ms-request-id": "f29278f7-701e-0039-76c8-f291e2000000", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:04:19.2764164Z" + "x-ms-request-id": "493dbc52-701e-0097-746e-888ccf000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:06.5073218Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "be7281fe-7925-4dd4-528e-2dad35695bd0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "d1171672-12be-48f7-788b-eb6c6754394d", + "x-ms-version": "2021-04-10" }, "Method": "GET", "Response": { @@ -287,19 +295,20 @@ "STATUS_CODE": "200", "content-length": "225", "content-type": "application/xml", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:06 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "be7281fe-7925-4dd4-528e-2dad35695bd0", - "x-ms-request-id": "f2927977-701e-0039-6dc8-f291e2000000", - "x-ms-version": "2020-02-10" + "vary": "Origin", + "x-ms-client-request-id": "d1171672-12be-48f7-788b-eb6c6754394d", + "x-ms-request-id": "493dbd7b-701e-0097-7f6e-888ccf000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob?comp=tags" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "36cae37f-2538-4752-5030-947db4ad0ef4", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "1bbe7c71-9919-41d4-67ea-ac82c70cc776", + "x-ms-version": "2021-04-10" }, "Method": "HEAD", "Response": { @@ -314,38 +323,89 @@ "content-length": "8388608", "content-md5": "IFj7U/ZD/NWKjYOgVUI5Kw==", "content-type": "application/x-binary", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", - "etag": "\"0x8D9C0E0022A6A68\"", - "last-modified": "Thu, 16 Dec 2021 22:04:19 GMT", + "date": "Sat, 25 Jun 2022 08:33:06 GMT", + "etag": "\"0x8DA568553CE6111\"", + "last-modified": "Sat, 25 Jun 2022 08:33:06 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", "x-ms-access-tier": "Cool", - "x-ms-access-tier-change-time": "Thu, 16 Dec 2021 22:04:19 GMT", + "x-ms-access-tier-change-time": "Sat, 25 Jun 2022 08:33:06 GMT", "x-ms-blob-type": "BlockBlob", - "x-ms-client-request-id": "36cae37f-2538-4752-5030-947db4ad0ef4", - "x-ms-copy-completion-time": "Thu, 16 Dec 2021 22:04:19 GMT", - "x-ms-copy-id": "50498d84-8995-4f25-bbc3-cbc33921f867", + "x-ms-client-request-id": "1bbe7c71-9919-41d4-67ea-ac82c70cc776", + "x-ms-copy-completion-time": "Sat, 25 Jun 2022 08:33:06 GMT", + "x-ms-copy-id": "5da2d634-99ff-47da-809e-b5d0fc2ec8da", "x-ms-copy-progress": "8388608/8388608", - "x-ms-copy-source": "https://forcpprecordings.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier?se=2021-12-19T22:04:19Z&sp=racwdxlt&spr=https,http&sr=c&sv=2020-02-10", + "x-ms-copy-source": "https://euap.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTier?se=2022-06-28T08:33:06Z&sp=racwdxlti&spr=https,http&sr=c&sv=2021-04-10", "x-ms-copy-status": "success", - "x-ms-creation-time": "Thu, 16 Dec 2021 22:04:19 GMT", + "x-ms-creation-time": "Sat, 25 Jun 2022 08:33:06 GMT", "x-ms-is-current-version": "true", + "x-ms-last-access-time": "Sat, 25 Jun 2022 08:33:06 GMT", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-key1": "value1", "x-ms-meta-key2": "value2", - "x-ms-request-id": "f292797c-701e-0039-72c8-f291e2000000", + "x-ms-request-id": "493dbe65-701e-0097-5a6e-888ccf000000", "x-ms-server-encrypted": "true", "x-ms-tag-count": "3", - "x-ms-version": "2020-02-10", - "x-ms-version-id": "2021-12-16T22:04:19.2764164Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:06.5073218Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.2.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "4fbcc750-e5ae-45eb-7372-f90dc49649fa", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f6550362-64c1-4e2b-7595-a8cf98f57ddf", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 08:33:09 GMT", + "etag": "\"0x8DA56855480CE9F\"", + "last-modified": "Sat, 25 Jun 2022 08:33:07 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f6550362-64c1-4e2b-7595-a8cf98f57ddf", + "x-ms-content-crc64": "DU01Kv81ewI=", + "x-ms-copy-id": "671e0096-5d20-4fb2-8571-45b304b27e77", + "x-ms-copy-status": "success", + "x-ms-request-id": "493dbf60-701e-0097-446e-888ccf000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:33:10.2121924Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "2dff27e6-7c8b-4677-5651-0786d6fa3b35", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "\n", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "64", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 08:33:10 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "2dff27e6-7c8b-4677-5651-0786d6fa3b35", + "x-ms-request-id": "493dc6d5-701e-0097-116e-888ccf000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier/CopyWithTagsMetadataTierblob?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "1b6c5ce6-7954-4300-6355-a33a8eaaa52e", + "x-ms-version": "2021-04-10" }, "Method": "DELETE", "Response": { @@ -353,11 +413,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Thu, 16 Dec 2021 22:04:18 GMT", + "date": "Sat, 25 Jun 2022 08:33:10 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "4fbcc750-e5ae-45eb-7372-f90dc49649fa", - "x-ms-request-id": "f2927987-701e-0039-7dc8-f291e2000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "1b6c5ce6-7954-4300-6355-a33a8eaaa52e", + "x-ms-request-id": "493dc777-701e-0097-286e-888ccf000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestcopywithtagsmetadatatier?restype=container" } diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.SyncCopyFromUriEncryptionScope.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.SyncCopyFromUriEncryptionScope.json new file mode 100644 index 0000000000..1d8d53536b --- /dev/null +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.SyncCopyFromUriEncryptionScope.json @@ -0,0 +1,270 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "18525e7b-72ee-4074-64c6-8567d0f90d58", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 10:42:08 GMT", + "etag": "\"0x8DA56975A9A5D24\"", + "last-modified": "Sat, 25 Jun 2022 10:42:08 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "18525e7b-72ee-4074-64c6-8567d0f90d58", + "x-ms-request-id": "7db12147-701e-005c-3980-888f9a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "d3f3a901-06c0-490a-78e8-ed4fa5255089", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "content-md5": "oulw8XCWHOh5GQ1kmCyU7A==", + "date": "Sat, 25 Jun 2022 10:42:08 GMT", + "etag": "\"0x8DA56975ACF665B\"", + "last-modified": "Sat, 25 Jun 2022 10:42:08 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d3f3a901-06c0-490a-78e8-ed4fa5255089", + "x-ms-content-crc64": "CCucyRQQkvc=", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-request-id": "7db12165-701e-005c-4d80-888f9a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T10:42:08.9938523Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/b" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "2c0ed87c-c550-4cba-7603-b99779cf4eb9", + "x-ms-version": "2021-04-10" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "accept-ranges": "bytes", + "content-length": "1", + "content-md5": "oulw8XCWHOh5GQ1kmCyU7A==", + "content-type": "application/octet-stream", + "date": "Sat, 25 Jun 2022 10:42:09 GMT", + "etag": "\"0x8DA56975ACF665B\"", + "last-modified": "Sat, 25 Jun 2022 10:42:08 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "2c0ed87c-c550-4cba-7603-b99779cf4eb9", + "x-ms-creation-time": "Sat, 25 Jun 2022 10:42:08 GMT", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-is-current-version": "true", + "x-ms-last-access-time": "Sat, 25 Jun 2022 10:42:08 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "7db1218f-701e-005c-6b80-888f9a000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T10:42:08.9938523Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/b" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "eb65ca72-479a-4038-46dc-362eccfb4a3e", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "ContainerAlreadyExistsThe specified container already exists.\nRequestId:b094243f-e01e-0061-1980-88f981000000\nTime:2022-06-25T10:42:10.7810686Z", + "REASON_PHRASE": "The specified container already exists.", + "STATUS_CODE": "409", + "content-length": "230", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 10:42:10 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "eb65ca72-479a-4038-46dc-362eccfb4a3e", + "x-ms-error-code": "ContainerAlreadyExists", + "x-ms-request-id": "b094243f-e01e-0061-1980-88f981000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f4112cb8-949f-4bb4-5ed6-b8263c6df8ae", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 10:42:11 GMT", + "etag": "\"0x8DA56975C80B0CF\"", + "last-modified": "Sat, 25 Jun 2022 10:42:11 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f4112cb8-949f-4bb4-5ed6-b8263c6df8ae", + "x-ms-content-crc64": "CCucyRQQkvc=", + "x-ms-copy-id": "dd2ee348-bd30-4036-b9b5-686db1ea6db6", + "x-ms-copy-status": "success", + "x-ms-request-id": "b0942488-e01e-0061-5280-88f981000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T10:42:12.0081191Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/SyncCopyFromUriEncryptionScope" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "2a9b78b4-c94d-4699-49bb-8ee631dfef0f", + "x-ms-version": "2021-04-10" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "accept-ranges": "bytes", + "content-length": "1", + "content-md5": "oulw8XCWHOh5GQ1kmCyU7A==", + "content-type": "application/octet-stream", + "date": "Sat, 25 Jun 2022 10:42:11 GMT", + "etag": "\"0x8DA56975C80B0CF\"", + "last-modified": "Sat, 25 Jun 2022 10:42:11 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "2a9b78b4-c94d-4699-49bb-8ee631dfef0f", + "x-ms-copy-completion-time": "Sat, 25 Jun 2022 10:42:11 GMT", + "x-ms-copy-id": "dd2ee348-bd30-4036-b9b5-686db1ea6db6", + "x-ms-copy-progress": "1/1", + "x-ms-copy-source": "https://euap.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/b?se=2022-06-25T11:42:09Z&ses=EncryptionScopeForTest&sp=r&spr=https&sr=b&sv=2021-04-10", + "x-ms-copy-status": "success", + "x-ms-creation-time": "Sat, 25 Jun 2022 10:42:11 GMT", + "x-ms-is-current-version": "true", + "x-ms-last-access-time": "Sat, 25 Jun 2022 10:42:11 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "b09425d0-e01e-0061-6d80-88f981000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T10:42:12.0081191Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/SyncCopyFromUriEncryptionScope" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6e498011-4bc4-45e2-6ca4-a72e6c9861ee", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 10:42:11 GMT", + "etag": "\"0x8DA56975CFDE4D3\"", + "last-modified": "Sat, 25 Jun 2022 10:42:12 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6e498011-4bc4-45e2-6ca4-a72e6c9861ee", + "x-ms-content-crc64": "CCucyRQQkvc=", + "x-ms-copy-id": "646f3479-cf89-4287-a096-ecaeec84d1e7", + "x-ms-copy-status": "success", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-request-id": "b094262d-e01e-0061-4080-88f981000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T10:42:12.6667408Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/SyncCopyFromUriEncryptionScope" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "57dc3581-50e7-4f6f-42ca-349d13affe16", + "x-ms-version": "2021-04-10" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "accept-ranges": "bytes", + "content-length": "1", + "content-md5": "oulw8XCWHOh5GQ1kmCyU7A==", + "content-type": "application/octet-stream", + "date": "Sat, 25 Jun 2022 10:42:12 GMT", + "etag": "\"0x8DA56975CFDE4D3\"", + "last-modified": "Sat, 25 Jun 2022 10:42:12 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "57dc3581-50e7-4f6f-42ca-349d13affe16", + "x-ms-copy-completion-time": "Sat, 25 Jun 2022 10:42:12 GMT", + "x-ms-copy-id": "646f3479-cf89-4287-a096-ecaeec84d1e7", + "x-ms-copy-progress": "1/1", + "x-ms-copy-source": "https://euap.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/b?se=2022-06-28T10:42:12Z&sp=racwdxlti&spr=https,http&sr=c&sv=2021-04-10", + "x-ms-copy-status": "success", + "x-ms-creation-time": "Sat, 25 Jun 2022 10:42:12 GMT", + "x-ms-encryption-scope": "EncryptionScopeForTest", + "x-ms-is-current-version": "true", + "x-ms-last-access-time": "Sat, 25 Jun 2022 10:42:12 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "b0942676-e01e-0061-7e80-88f981000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T10:42:12.6667408Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope/SyncCopyFromUriEncryptionScope" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "d0603541-cf85-4f58-64ca-f032c5755aa6", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Sat, 25 Jun 2022 10:42:12 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d0603541-cf85-4f58-64ca-f032c5755aa6", + "x-ms-request-id": "b09426b4-e01e-0061-3280-88f981000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestsynccopyfromuriencryptionscope?restype=container" + } + ] +} diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.UploadFromUri.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.UploadFromUri.json index 1198ae4050..168cd90e47 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.UploadFromUri.json +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.UploadFromUri.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "84fcb7ca-fda3-4111-6c4d-1b5fd28bfc8a", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "67b0d7d2-83bf-4544-52c5-a7e561d6cc68", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Sun, 20 Feb 2022 07:09:23 GMT", - "etag": "\"0x8D9F43FEC8C86B7\"", - "last-modified": "Sun, 20 Feb 2022 07:09:23 GMT", + "date": "Sat, 25 Jun 2022 08:35:55 GMT", + "etag": "\"0x8DA5685B9381135\"", + "last-modified": "Sat, 25 Jun 2022 08:35:56 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "84fcb7ca-fda3-4111-6c4d-1b5fd28bfc8a", - "x-ms-request-id": "29d5e0bd-f01e-0042-4228-266342000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "67b0d7d2-83bf-4544-52c5-a7e561d6cc68", + "x-ms-request-id": "d8f62ac8-801e-002a-096e-8805d2000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri?restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "834a37a6-a281-43c0-5b89-f17f09504bc9", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "18f63ab3-f9e9-4970-42b1-4eb151f031f4", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -35,46 +35,66 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "NqksyUqeD6IfYl+L+wB63w==", - "date": "Sun, 20 Feb 2022 07:09:23 GMT", - "etag": "\"0x8D9F43FECB1518C\"", - "last-modified": "Sun, 20 Feb 2022 07:09:24 GMT", + "date": "Sat, 25 Jun 2022 08:35:55 GMT", + "etag": "\"0x8DA5685B96E3A14\"", + "last-modified": "Sat, 25 Jun 2022 08:35:56 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "834a37a6-a281-43c0-5b89-f17f09504bc9", + "x-ms-client-request-id": "18f63ab3-f9e9-4970-42b1-4eb151f031f4", "x-ms-content-crc64": "eeIkJntVfP0=", - "x-ms-request-id": "29d5e126-f01e-0042-2028-266342000000", + "x-ms-request-id": "d8f62b2d-801e-002a-5d6e-8805d2000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T07:09:24.0796556Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:35:56.7994388Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri/UploadFromUrisrc" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "39306e7d-ff5a-4915-7056-e9406f87f5f7", - "x-ms-version": "2020-08-04" + "content-type": "application/xml; charset=UTF-8", + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "cb8fd8a7-1c9e-4f6b-41a9-a6f79e80ec37", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { - "BODY": "ContainerAlreadyExistsThe specified container already exists.\nRequestId:29d5e18f-f01e-0042-7c28-266342000000\nTime:2022-02-20T07:09:24.3192637Z", + "BODY": "", + "REASON_PHRASE": "No Content", + "STATUS_CODE": "204", + "date": "Sat, 25 Jun 2022 08:35:56 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cb8fd8a7-1c9e-4f6b-41a9-a6f79e80ec37", + "x-ms-request-id": "d8f62b7a-801e-002a-216e-8805d2000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri/UploadFromUrisrc?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "93c2cbea-83c3-43dd-4ed0-15e39e983666", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "ContainerAlreadyExistsThe specified container already exists.\nRequestId:0abe50d6-801e-0067-086e-88ca3e000000\nTime:2022-06-25T08:35:58.5742177Z", "REASON_PHRASE": "The specified container already exists.", "STATUS_CODE": "409", "content-length": "230", "content-type": "application/xml", - "date": "Sun, 20 Feb 2022 07:09:23 GMT", + "date": "Sat, 25 Jun 2022 08:35:58 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "39306e7d-ff5a-4915-7056-e9406f87f5f7", + "x-ms-client-request-id": "93c2cbea-83c3-43dd-4ed0-15e39e983666", "x-ms-error-code": "ContainerAlreadyExists", - "x-ms-request-id": "29d5e18f-f01e-0042-7c28-266342000000", - "x-ms-version": "2020-08-04" + "x-ms-request-id": "0abe50d6-801e-0067-086e-88ca3e000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri?restype=container" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "369cc4e3-19c9-4cb6-5738-4ccb9ffd0cad", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "1a0438ef-eef1-442b-76df-5f63644f0c3b", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -82,24 +102,24 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Sun, 20 Feb 2022 07:09:24 GMT", - "etag": "\"0x8D9F43FED2BEDF1\"", - "last-modified": "Sun, 20 Feb 2022 07:09:24 GMT", + "date": "Sat, 25 Jun 2022 08:35:59 GMT", + "etag": "\"0x8DA5685BB846F69\"", + "last-modified": "Sat, 25 Jun 2022 08:36:00 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "369cc4e3-19c9-4cb6-5738-4ccb9ffd0cad", + "x-ms-client-request-id": "1a0438ef-eef1-442b-76df-5f63644f0c3b", "x-ms-content-crc64": "eeIkJntVfP0=", - "x-ms-request-id": "29d5e1eb-f01e-0042-4e28-266342000000", + "x-ms-request-id": "0abe511b-801e-0067-3c6e-88ca3e000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T07:09:24.8831985Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:36:00.3004265Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri/UploadFromUridest" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "ff0dda4c-5d74-4015-6c1b-553b3fe1db6f", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "50eba16e-87e6-4030-4581-0e8f9b72cfe4", + "x-ms-version": "2021-04-10" }, "Method": "PUT", "Response": { @@ -107,24 +127,24 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Sun, 20 Feb 2022 07:09:24 GMT", - "etag": "\"0x8D9F43FED54098A\"", - "last-modified": "Sun, 20 Feb 2022 07:09:25 GMT", + "date": "Sat, 25 Jun 2022 08:36:00 GMT", + "etag": "\"0x8DA5685BBB90C39\"", + "last-modified": "Sat, 25 Jun 2022 08:36:00 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ff0dda4c-5d74-4015-6c1b-553b3fe1db6f", + "x-ms-client-request-id": "50eba16e-87e6-4030-4581-0e8f9b72cfe4", "x-ms-content-crc64": "eeIkJntVfP0=", - "x-ms-request-id": "29d5e2c8-f01e-0042-0928-266342000000", + "x-ms-request-id": "0abe5245-801e-0067-266e-88ca3e000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T07:09:25.1480484Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:36:00.6472274Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri/UploadFromUridest" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "3b22ec6c-5928-4bb4-5090-ca11043d7340", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "21280641-6c84-4fe8-7e8a-46e51aed048c", + "x-ms-version": "2021-04-10" }, "Method": "HEAD", "Response": { @@ -136,34 +156,81 @@ "content-length": "100", "content-md5": "NqksyUqeD6IfYl+L+wB63w==", "content-type": "application/octet-stream", - "date": "Sun, 20 Feb 2022 07:09:25 GMT", - "etag": "\"0x8D9F43FED54098A\"", - "last-modified": "Sun, 20 Feb 2022 07:09:25 GMT", + "date": "Sat, 25 Jun 2022 08:36:00 GMT", + "etag": "\"0x8DA5685BBB90C39\"", + "last-modified": "Sat, 25 Jun 2022 08:36:00 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "vary": "Origin", "x-ms-access-tier": "Cool", - "x-ms-access-tier-change-time": "Sun, 20 Feb 2022 07:09:25 GMT", + "x-ms-access-tier-change-time": "Sat, 25 Jun 2022 08:36:00 GMT", "x-ms-blob-type": "BlockBlob", - "x-ms-client-request-id": "3b22ec6c-5928-4bb4-5090-ca11043d7340", - "x-ms-creation-time": "Sun, 20 Feb 2022 07:09:25 GMT", + "x-ms-client-request-id": "21280641-6c84-4fe8-7e8a-46e51aed048c", + "x-ms-creation-time": "Sat, 25 Jun 2022 08:36:00 GMT", "x-ms-is-current-version": "true", - "x-ms-last-access-time": "Sun, 20 Feb 2022 07:09:25 GMT", + "x-ms-last-access-time": "Sat, 25 Jun 2022 08:36:00 GMT", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-k": "v", - "x-ms-request-id": "29d5e327-f01e-0042-5a28-266342000000", + "x-ms-request-id": "0abe5296-801e-0067-6c6e-88ca3e000000", "x-ms-server-encrypted": "true", "x-ms-tag-count": "1", - "x-ms-version": "2020-08-04", - "x-ms-version-id": "2022-02-20T07:09:25.1480484Z" + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:36:00.6472274Z" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri/UploadFromUridest" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-blobs/12.4.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "597a38e1-cccb-4806-7066-5f71235fa1bc", - "x-ms-version": "2020-08-04" + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "d4b00e3d-6917-41a2-4bf1-aa2f71234888", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Sat, 25 Jun 2022 08:36:01 GMT", + "etag": "\"0x8DA5685BC4029B6\"", + "last-modified": "Sat, 25 Jun 2022 08:36:01 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d4b00e3d-6917-41a2-4bf1-aa2f71234888", + "x-ms-content-crc64": "eeIkJntVfP0=", + "x-ms-request-id": "0abe52e1-801e-0067-2e6e-88ca3e000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-04-10", + "x-ms-version-id": "2022-06-25T08:36:01.5317190Z" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri/UploadFromUridest" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f367c302-0906-4b49-6a8b-034327cc7eab", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "\nsrctagsa1212", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "121", + "content-type": "application/xml", + "date": "Sat, 25 Jun 2022 08:36:03 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "f367c302-0906-4b49-6a8b-034327cc7eab", + "x-ms-request-id": "0abe5355-801e-0067-196e-88ca3e000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri/UploadFromUridest?comp=tags" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.5.0-beta.2 (Windows 10 Pro 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "a4648ef8-9309-463c-7938-4247079b46bd", + "x-ms-version": "2021-04-10" }, "Method": "DELETE", "Response": { @@ -171,11 +238,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Sun, 20 Feb 2022 07:09:25 GMT", + "date": "Sat, 25 Jun 2022 08:36:03 GMT", "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "597a38e1-cccb-4806-7066-5f71235fa1bc", - "x-ms-request-id": "29d5e380-f01e-0042-2928-266342000000", - "x-ms-version": "2020-08-04" + "x-ms-client-request-id": "a4648ef8-9309-463c-7938-4247079b46bd", + "x-ms-request-id": "0abe5479-801e-0067-086e-88ca3e000000", + "x-ms-version": "2021-04-10" }, "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestuploadfromuri?restype=container" } diff --git a/sdk/storage/azure-storage-blobs/vcpkg.json b/sdk/storage/azure-storage-blobs/vcpkg.json index fa4846e6ee..2fc9d767eb 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg.json +++ b/sdk/storage/azure-storage-blobs/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-blobs-cpp", - "version-semver": "12.5.0-beta.1", + "version-semver": "12.6.0-beta.1", "description": [ "Microsoft Azure Storage Blobs SDK for C++", "This library provides Azure Storage Blobs SDK." @@ -11,7 +11,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.4" + "version>=": "12.3.0-beta.1" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in index a6e782faf9..99a32a3442 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in +++ b/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in @@ -4,7 +4,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(azure-storage-common-cpp "12.2.4") +find_dependency(azure-storage-common-cpp "12.3.0-beta.1") include("${CMAKE_CURRENT_LIST_DIR}/azure-storage-blobs-cppTargets.cmake") diff --git a/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json b/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json index bb78077f9a..8b020d6eff 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json +++ b/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.4" + "version>=": "12.3.0-beta.1" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-common/CHANGELOG.md b/sdk/storage/azure-storage-common/CHANGELOG.md index 82e7ca3244..10404b2873 100644 --- a/sdk/storage/azure-storage-common/CHANGELOG.md +++ b/sdk/storage/azure-storage-common/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.3.0-beta.1 (Unreleased) +## 12.3.0-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,13 @@ ### Other Changes +## 12.3.0-beta.1 (2022-08-09) + +### Features Added + +- Added support for encryption scope SAS (`ses` query parameter in SAS token). +- Added support for permanent delete permission in SAS. + ## 12.2.4 (2022-06-07) ### Bugs Fixed diff --git a/sdk/storage/azure-storage-common/CMakeLists.txt b/sdk/storage/azure-storage-common/CMakeLists.txt index ad8759b9f5..21baa9313d 100644 --- a/sdk/storage/azure-storage-common/CMakeLists.txt +++ b/sdk/storage/azure-storage-common/CMakeLists.txt @@ -32,9 +32,9 @@ if(FETCH_SOURCE_DEPS) add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL) endforeach() elseif(NOT AZ_ALL_LIBRARIES) - find_package(azure-core-cpp "1.5.0" CONFIG QUIET) + find_package(azure-core-cpp "1.7.1" CONFIG QUIET) if(NOT azure-core-cpp_FOUND) - find_package(azure-core-cpp "1.5.0" REQUIRED) + find_package(azure-core-cpp "1.7.1" REQUIRED) endif() endif() diff --git a/sdk/storage/azure-storage-common/inc/azure/storage/common/account_sas_builder.hpp b/sdk/storage/azure-storage-common/inc/azure/storage/common/account_sas_builder.hpp index ae1912f489..359f16a389 100644 --- a/sdk/storage/azure-storage-common/inc/azure/storage/common/account_sas_builder.hpp +++ b/sdk/storage/azure-storage-common/inc/azure/storage/common/account_sas_builder.hpp @@ -188,6 +188,11 @@ namespace Azure { namespace Storage { namespace Sas { */ SetImmutabilityPolicy = 2048, + /** + * @brief Indicates that permanent delete is permitted. + */ + PermanentDelete = 4096, + /** * @brief Indicates that all permissions are set. */ @@ -250,6 +255,11 @@ namespace Azure { namespace Storage { namespace Sas { */ AccountSasResource ResourceTypes; + /** + * @brief Optional encryption scope to use when sending requests authorized with this SAS url. + */ + std::string EncryptionScope; + /** * @brief Sets the permissions for an account SAS. * diff --git a/sdk/storage/azure-storage-common/src/account_sas_builder.cpp b/sdk/storage/azure-storage-common/src/account_sas_builder.cpp index 42e94d31cf..2a64dc90a4 100644 --- a/sdk/storage/azure-storage-common/src/account_sas_builder.cpp +++ b/sdk/storage/azure-storage-common/src/account_sas_builder.cpp @@ -9,7 +9,7 @@ namespace Azure { namespace Storage { namespace Sas { namespace { - constexpr static const char* SasVersion = "2020-08-04"; + constexpr static const char* SasVersion = "2021-04-10"; } void AccountSasBuilder::SetPermissions(AccountSasPermissions permissions) @@ -32,6 +32,11 @@ namespace Azure { namespace Storage { namespace Sas { { Permissions += "x"; } + if ((permissions & AccountSasPermissions::PermanentDelete) + == AccountSasPermissions::PermanentDelete) + { + Permissions += "y"; + } if ((permissions & AccountSasPermissions::List) == AccountSasPermissions::List) { Permissions += "l"; @@ -108,7 +113,8 @@ namespace Azure { namespace Storage { namespace Sas { std::string stringToSign = credential.AccountName + "\n" + Permissions + "\n" + services + "\n" + resourceTypes + "\n" + startsOnStr + "\n" + expiresOnStr + "\n" - + (IPRange.HasValue() ? IPRange.Value() : "") + "\n" + protocol + "\n" + SasVersion + "\n"; + + (IPRange.HasValue() ? IPRange.Value() : "") + "\n" + protocol + "\n" + SasVersion + "\n" + + EncryptionScope + "\n"; std::string signature = Azure::Core::Convert::Base64Encode(_internal::HmacSha256( std::vector(stringToSign.begin(), stringToSign.end()), @@ -130,6 +136,10 @@ namespace Azure { namespace Storage { namespace Sas { } builder.AppendQueryParameter("spr", _internal::UrlEncodeQueryParameter(protocol)); builder.AppendQueryParameter("sig", _internal::UrlEncodeQueryParameter(signature)); + if (!EncryptionScope.empty()) + { + builder.AppendQueryParameter("ses", _internal::UrlEncodeQueryParameter(EncryptionScope)); + } return builder.GetAbsoluteUrl(); } diff --git a/sdk/storage/azure-storage-common/src/private/package_version.hpp b/sdk/storage/azure-storage-common/src/private/package_version.hpp index c1ddc04729..009cfc55f3 100644 --- a/sdk/storage/azure-storage-common/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-common/src/private/package_version.hpp @@ -13,7 +13,7 @@ #define AZURE_STORAGE_COMMON_VERSION_MAJOR 12 #define AZURE_STORAGE_COMMON_VERSION_MINOR 3 #define AZURE_STORAGE_COMMON_VERSION_PATCH 0 -#define AZURE_STORAGE_COMMON_VERSION_PRERELEASE "beta.1" +#define AZURE_STORAGE_COMMON_VERSION_PRERELEASE "beta.2" #define AZURE_STORAGE_COMMON_VERSION_ITOA_HELPER(i) #i #define AZURE_STORAGE_COMMON_VERSION_ITOA(i) AZURE_STORAGE_COMMON_VERSION_ITOA_HELPER(i) diff --git a/sdk/storage/azure-storage-common/vcpkg.json b/sdk/storage/azure-storage-common/vcpkg.json index 448f7f7bc3..10a5ae49ec 100644 --- a/sdk/storage/azure-storage-common/vcpkg.json +++ b/sdk/storage/azure-storage-common/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-common-cpp", - "version-semver": "12.2.4", + "version-semver": "12.3.0-beta.1", "description": [ "Microsoft Azure Common Storage SDK for C++", "This library provides common Azure Storage-related abstractions for Azure SDK." @@ -11,7 +11,7 @@ { "name": "azure-core-cpp", "default-features": false, - "version>=": "1.5.0" + "version>=": "1.7.1" }, { "name": "libxml2", diff --git a/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in index f92c6f19be..3ac85c7dd0 100644 --- a/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in +++ b/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in @@ -5,7 +5,7 @@ include(CMakeFindDependencyMacro) find_dependency(Threads) -find_dependency(azure-core-cpp "1.5.0") +find_dependency(azure-core-cpp "1.7.1") if(NOT WIN32) find_dependency(LibXml2) diff --git a/sdk/storage/azure-storage-common/vcpkg/vcpkg.json b/sdk/storage/azure-storage-common/vcpkg/vcpkg.json index 76b59e120b..3ddfbab70d 100644 --- a/sdk/storage/azure-storage-common/vcpkg/vcpkg.json +++ b/sdk/storage/azure-storage-common/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-core-cpp", "default-features": false, - "version>=": "1.5.0" + "version>=": "1.7.1" }, { "name": "libxml2", diff --git a/sdk/storage/test-resources-post.ps1 b/sdk/storage/test-resources-post.ps1 index 268ab57d46..539c242e10 100644 --- a/sdk/storage/test-resources-post.ps1 +++ b/sdk/storage/test-resources-post.ps1 @@ -1,6 +1,13 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +param( + [string] $ResourceGroupName, + [hashtable] $DeploymentOutputs +) + +New-AzStorageEncryptionScope -ResourceGroupName $ResourceGroupName -StorageAccountName $DeploymentOutputs['ACCOUNT_NAME'] -EncryptionScopeName "EncryptionScopeForTest" -StorageEncryption + # This script is used to wait until XCache is refreshed for the service properties (30s), and role assignment takes effect (300s). Start-Sleep -s 300 From 40cf5608afdb5e7f8b4285a714a10207a3d5d6e1 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 24 Aug 2022 14:19:31 -0700 Subject: [PATCH 05/75] Moved winhttp tests to WS2022 for WSL support (#3898) * Moved winhttp tests to WS2022 for WSL support * Windows 2022 images has VS 2022 not 2019 * Fixed get-binarysizes script to account for WS 2022 image; formatted platform matrix files * Install squid proxies * Fixed typo in Install-WSL script * Added WS2022 to live tests * Cleaned up platform matrix platforms; removed code coverage exception to proxy tests * Fixed two compiler warnings reported by the cognitive services team --- .vscode/cspell.json | 4 +- .../stages/platform-matrix-live.json | 310 ++++++++-------- .../templates/stages/platform-matrix.json | 334 ++++++++++-------- eng/scripts/Get-BinarySizes.ps1 | 23 +- eng/scripts/Install-WSL.ps1 | 14 + .../azure-core/inc/azure/core/context.hpp | 8 + sdk/core/azure-core/test/ut/CMakeLists.txt | 6 +- .../proxy_tests/localproxy.passwd/Dockerfile | 6 +- .../proxy_tests/localproxy.passwd/squid.conf | 4 +- .../test/ut/proxy_tests/run_wsl_proxy.ps1 | 27 ++ .../test/ut/transport_policy_options.cpp | 54 +-- .../azure-core/test/ut/websocket_test.cpp | 2 +- sdk/core/ci.yml | 30 +- sdk/core/test-resources.bicep | 116 ------ 14 files changed, 453 insertions(+), 485 deletions(-) create mode 100644 eng/scripts/Install-WSL.ps1 create mode 100644 sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 delete mode 100644 sdk/core/test-resources.bicep diff --git a/.vscode/cspell.json b/.vscode/cspell.json index a62e2688de..ec5a6d9b3e 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -11,8 +11,8 @@ "*.exe", "*.a", "*.lib", - "*.yaml", - "**/libcurl-stress-test/README.md", + "*.yaml", + "**/libcurl-stress-test/README.md", ".github/CODEOWNERS", ".gitignore", ".vscode/cspell.json", diff --git a/eng/pipelines/templates/stages/platform-matrix-live.json b/eng/pipelines/templates/stages/platform-matrix-live.json index 7e9f018107..1c0264d892 100644 --- a/eng/pipelines/templates/stages/platform-matrix-live.json +++ b/eng/pipelines/templates/stages/platform-matrix-live.json @@ -1,152 +1,172 @@ { - "displayNames": { - "_": "" + "displayNames": { + "MacOS": "" + }, + "include": [ + { + "StaticConfigs": { + "x64_with_unit_test": { + "Pool": "Azure Pipelines", + "OSVmImage": "macos-11", + "VCPKG_DEFAULT_TRIPLET": "x64-osx", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DDISABLE_PROXY_TESTS=ON ", + "AZURE_CORE_ENABLE_JSON_TESTS": 1, + "BuildArgs": "-j 4" + } + } + }, + { + "StaticConfigs": { + "Ubu1804": { + "VCPKG_DEFAULT_TRIPLET": "x64-linux", + "BuildArgs": "-j 4", + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "RunProxyTests": true + } + }, + "BuildConfig": { + "x64_gcc5_with_unit_test": { + "CmakeEnvArg": "CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON" + }, + "x64_with_unit_test": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON", + "AptDependencies": "gcovr lcov", + "CODE_COVERAGE": "enabled", + "CODE_COVERAGE_COLLECT_ONLY": 1, + "AZURE_CORE_ENABLE_JSON_TESTS": 1 + } + } + }, + { + "StaticConfigs": { + "Ubu20": { + "BuildArgs": "-j 4", + "Pool": "azsdk-pool-mms-ubuntu-2004-general", + "OSVmImage": "MMSUbuntu20.04", + "VCPKG_DEFAULT_TRIPLET": "x64-linux", + "RunProxyTests": true + } + }, + "BuildConfiguration": { + "x64_with_unit_test": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON", + "AZURE_CORE_ENABLE_JSON_TESTS": 1 + }, + "samples": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON -DCMAKE_BUILD_TYPE=Release ", + "RunSamples": 1 + }, + "x64_no_rtti": { + "CmakeArgs": " -DBUILD_RTTI=OFF -DCMAKE_BUILD_TYPE=Release " + } + } }, - "include": [ - { - "StaticConfigs": { - "MacOS_x64_with_unit_test": { - "Pool": "Azure Pipelines", - "OSVmImage": "macos-11", - "VCPKG_DEFAULT_TRIPLET": "x64-osx", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON", - "AZURE_CORE_ENABLE_JSON_TESTS": 1, - "BuildArgs": "-j 4" - } - } + { + "StaticConfigs": { + "Win2019": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "CMAKE_GENERATOR": "Visual Studio 16 2019" + } + }, + "BuildConfig": { + "x86_with_unit_test_winHttp": { + "VcpkgInstall": "openssl", + "CMAKE_GENERATOR_PLATFORM": "Win32", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON -DDISABLE_PROXY_TESTS=ON ", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", + "WindowsCtestConfig": "-C Release", + "BuildArgs": "-v --parallel 8 --config Release" + }, + "x86_no_rtti_with_unit_test": { + "VcpkgInstall": "libxml2 openssl", + "CMAKE_GENERATOR_PLATFORM": "Win32", + "CmakeArgs": " -DBUILD_RTTI=OFF -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON -DMSVC_USE_STATIC_CRT=ON -DDISABLE_PROXY_TESTS=ON ", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", + "WindowsCtestConfig": "-C Release", + "BuildArgs": "-v --parallel 8 --config Release" + }, + "x86_with_unit_test_libcurl": { + "CMAKE_GENERATOR_PLATFORM": "Win32", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON -DDISABLE_PROXY_TESTS=ON ", + "BuildArgs": "-v --parallel 8" + }, + "HSM_x64_with_unit_test_libcurl": { + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON -DDISABLE_PROXY_TESTS=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "WindowsCtestConfig": "-C Release", + "KVLocation": "eastus2", + "EnableHSM": 1 + }, + "x64_with_unit_samples_libcurl": { + "VcpkgInstall": "curl[winssl] openssl", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DMSVC_USE_STATIC_CRT=ON -DDISABLE_PROXY_TESTS=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "RunSamples": 1, + "WindowsCtestConfig": "-C Release" + } + } + }, + { + "StaticConfigs": { + "Win2022": { + "Pool": "Azure Pipelines", + "OSVmImage": "windows-2022", + "CMAKE_GENERATOR": "Visual Studio 17 2022", + "RunProxyTests": true + } + }, + "BuildConfig": { + "x64_with_json_unit_test_winHttp": { + "VcpkgInstall": "openssl", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "AZURE_CORE_ENABLE_JSON_TESTS": 1, + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "WindowsCtestConfig": "-C Release" + }, + "x86_with_unit_test_libcurl": { + "CMAKE_GENERATOR_PLATFORM": "Win32", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON ", + "BuildArgs": "-v --parallel 8" }, - { - "StaticConfigs": { - "_": { - "VCPKG_DEFAULT_TRIPLET": "x64-linux", - "BuildArgs": "-j 4", - "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "OSVmImage": "MMSUbuntu18.04" - } - }, - "BuildConfig": { - "Linux_x64_gcc5_with_unit_test": { - "CmakeEnvArg": "CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 cmake", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON" - }, - "Linux_x64_with_unit_test": { - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON", - "AptDependencies": "gcovr lcov", - "CODE_COVERAGE": "enabled", - "CODE_COVERAGE_COLLECT_ONLY": 1, - "AZURE_CORE_ENABLE_JSON_TESTS": 1 - } - } + "x64_with_json_unit_samples_winHttp": { + "VcpkgInstall": "openssl", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "AZURE_CORE_ENABLE_JSON_TESTS": 1, + "RunSamples": 1, + "WindowsCtestConfig": "-C Release" }, - { - "StaticConfigs": { - "_": { - "BuildArgs": "-j 4", - "Pool": "azsdk-pool-mms-ubuntu-2004-general", - "OSVmImage": "MMSUbuntu20.04", - "VCPKG_DEFAULT_TRIPLET": "x64-linux" - } - }, - "BuildConfiguration": { - "Ubuntu20_x64_with_unit_test": { - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON", - "AZURE_CORE_ENABLE_JSON_TESTS": 1 - }, - "Ubuntu20_samples": { - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON -DCMAKE_BUILD_TYPE=Release ", - "RunSamples": 1 - }, - "Ubuntu20_x64_no_rtti": { - "CmakeArgs": " -DBUILD_RTTI=OFF -DCMAKE_BUILD_TYPE=Release " - } - } + "x64_with_unit_test_winHttp": { + "VcpkgInstall": "openssl", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "WindowsCtestConfig": "-C Release" }, - { - "StaticConfigs": { - "_": { - "Pool": "azsdk-pool-mms-win-2019-general", - "OSVmImage": "MMS2019", - "CMAKE_GENERATOR": "Visual Studio 16 2019" - } - }, - "BuildConfig": { - "Win_x86_with_unit_test_winHttp": { - "VcpkgInstall": "openssl", - "CMAKE_GENERATOR_PLATFORM": "Win32", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON ", - "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", - "WindowsCtestConfig": "-C Release", - "BuildArgs": "-v --parallel 8 --config Release" - }, - "Win_x86_no_rtti_with_unit_test": { - "VcpkgInstall": "libxml2 openssl", - "CMAKE_GENERATOR_PLATFORM": "Win32", - "CmakeArgs": " -DBUILD_RTTI=OFF -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON -DMSVC_USE_STATIC_CRT=ON", - "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", - "WindowsCtestConfig": "-C Release", - "BuildArgs": "-v --parallel 8 --config Release" - }, - "Win_x86_with_unit_test_libcurl": { - "CMAKE_GENERATOR_PLATFORM": "Win32", - "VCPKG_DEFAULT_TRIPLET": "x86-windows-static", - "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON ", - "BuildArgs": "-v --parallel 8" - }, - "Win_x64_with_json_unit_test_winHttp": { - "VcpkgInstall": "openssl", - "CMAKE_GENERATOR_PLATFORM": "x64", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", - "BuildArgs": "-v --parallel 8 --config Release", - "AZURE_CORE_ENABLE_JSON_TESTS": 1, - "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", - "WindowsCtestConfig": "-C Release" - }, - "Win_x64_with_json_unit_samples_winHttp": { - "VcpkgInstall": "openssl", - "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", - "CMAKE_GENERATOR_PLATFORM": "x64", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", - "BuildArgs": "-v --parallel 8 --config Release", - "AZURE_CORE_ENABLE_JSON_TESTS": 1, - "RunSamples": 1, - "WindowsCtestConfig": "-C Release" - }, - "Win_x64_with_unit_test_winHttp": { - "VcpkgInstall": "openssl", - "CMAKE_GENERATOR_PLATFORM": "x64", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON ", - "BuildArgs": "-v --parallel 8 --config Release", - "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", - "WindowsCtestConfig": "-C Release" - }, - "Win_x64_with_unit_samples_winHttp": { - "VcpkgInstall": "openssl", - "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", - "CMAKE_GENERATOR_PLATFORM": "x64", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DMSVC_USE_STATIC_CRT=ON ", - "BuildArgs": "-v --parallel 8 --config Release", - "RunSamples": 1, - "WindowsCtestConfig": "-C Release" - }, - "HSM_Win_x64_with_unit_test_libcurl": { - "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", - "CMAKE_GENERATOR_PLATFORM": "x64", - "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON ", - "BuildArgs": "-v --parallel 8 --config Release", - "WindowsCtestConfig": "-C Release", - "KVLocation": "eastus2", - "EnableHSM": 1 - }, - "Win_x64_with_unit_samples_libcurl": { - "VcpkgInstall": "curl[winssl] openssl", - "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", - "CMAKE_GENERATOR_PLATFORM": "x64", - "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DMSVC_USE_STATIC_CRT=ON ", - "BuildArgs": "-v --parallel 8 --config Release", - "RunSamples": 1, - "WindowsCtestConfig": "-C Release" - } - } + "x64_with_unit_samples_winHttp": { + "VcpkgInstall": "openssl", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DMSVC_USE_STATIC_CRT=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "RunSamples": 1, + "WindowsCtestConfig": "-C Release" } - ] + } + } + ] } \ No newline at end of file diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index 889b8392c3..76d1bd0368 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -1,162 +1,186 @@ { - "displayNames": { - "_": "" + "displayNames": { + "_": "" + }, + "include": [ + { + "OSConfiguration": { + "macOS-11": { + "OSVmImage": "macos-11", + "XCODE_VERSION": "12.5.1" + } + }, + "StaticConfigs": { + "_": { + "Pool": "Azure Pipelines", + "BuildArgs": "-j 10", + "VCPKG_DEFAULT_TRIPLET": "x64-osx", + "CmakeArgs": " -DBUILD_TESTING=ON -DDISABLE_PROXY_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON", + "PublishMapFiles": "true" + } + }, + "BuildConfig": { + "debug": { + "CMAKE_BUILD_TYPE": "Debug" + }, + "release": { + "CMAKE_BUILD_TYPE": "Release" + } + } }, - "include": [ - { - "OSConfiguration": { - "macOS-11": { - "OSVmImage": "macos-11", - "XCODE_VERSION": "12.5.1" - } - }, - "StaticConfigs": { - "_": { - "Pool": "Azure Pipelines", - "BuildArgs": "-j 10", - "VCPKG_DEFAULT_TRIPLET": "x64-osx", - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON", - "PublishMapFiles": "true" - } - }, - "BuildConfig": { - "debug": { - "CMAKE_BUILD_TYPE": "Debug" - }, - "release": { - "CMAKE_BUILD_TYPE": "Release" - } - } + { + "StaticConfigs": { + "Win2019": { + "OSVmImage": "MMS2019", + "Pool": "azsdk-pool-mms-win-2019-general", + "CMAKE_GENERATOR": "Visual Studio 16 2019" + } + }, + "TargetPlatform": { + "Win32Api_curl": { + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON" }, - { - "StaticConfigs": { - "Windows2019": { - "OSVmImage": "MMS2019", - "Pool": "azsdk-pool-mms-win-2019-general", - "CMAKE_GENERATOR": "Visual Studio 16 2019" - } - }, - "TargetPlatform": { - "Win32Api_curl": { - "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON" - }, - "Win32Api_release_curl": { - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON -DMSVC_USE_STATIC_CRT=ON", - "BuildArgs": "--parallel 8 --config Release", - "PublishMapFiles": "true" - }, - "Win32Api_debug_tests": { - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON -DBUILD_TRANSPORT_WINHTTP=ON -DMSVC_USE_STATIC_CRT=ON", - "BuildArgs": "--parallel 8 --config Debug", - "PublishMapFiles": "true" - } - }, - "TargetArchitecture": { - "x86": { - "CMAKE_GENERATOR_PLATFORM": "Win32", - "VCPKG_DEFAULT_TRIPLET": "x86-windows-static" - }, - "x64": { - "CMAKE_GENERATOR_PLATFORM": "x64", - "VCPKG_DEFAULT_TRIPLET": "x64-windows-static" - } - } + "Win32Api_release_curl": { + "CmakeArgs": " -DBUILD_TESTING=ON -DDISABLE_PROXY_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON -DMSVC_USE_STATIC_CRT=ON ", + "BuildArgs": "--parallel 8 --config Release", + "PublishMapFiles": "true" + } + }, + "TargetArchitecture": { + "x86": { + "CMAKE_GENERATOR_PLATFORM": "Win32", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static" }, - { - "StaticConfigs": { - "Windows2019": { - "VcpkgInstall": "openssl", - "OSVmImage": "MMS2019", - "Pool": "azsdk-pool-mms-win-2019-general", - "CMAKE_GENERATOR": "Visual Studio 16 2019", - "PublishMapFiles": "true" - } - }, - "TargetPlatform": { - "UWP_debug": { - "CMAKE_SYSTEM_NAME": "WindowsStore", - "CMAKE_SYSTEM_VERSION": "10.0", - "CmakeArgs": " -DBUILD_TRANSPORT_WINHTTP=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", - "BuildArgs": "--parallel 8 --config Debug" - }, - "UWP_release": { - "CMAKE_SYSTEM_NAME": "WindowsStore", - "CMAKE_SYSTEM_VERSION": "10.0", - "CmakeArgs": " -DBUILD_TRANSPORT_WINHTTP=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", - "BuildArgs": "--parallel 8 --config Release" - } - }, - "TargetArchitecture": { - "x64": { - "CMAKE_GENERATOR_PLATFORM": "x64", - "VCPKG_DEFAULT_TRIPLET": "x64-uwp" - } - } + "x64": { + "CMAKE_GENERATOR_PLATFORM": "x64", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static" + } + } + }, + { + "StaticConfigs": { + "Win2022": { + "OSVmImage": "windows-2022", + "Pool": "Azure Pipelines", + "RunProxyTests": true, + "CMAKE_GENERATOR": "Visual Studio 17 2022" + } + }, + "TargetPlatform": { + "Win32Api_debug_tests": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_TRANSPORT_CURL=ON -DBUILD_TRANSPORT_WINHTTP=ON -DMSVC_USE_STATIC_CRT=ON", + "BuildArgs": "--parallel 8 --config Debug", + "PublishMapFiles": "true" + } + }, + "TargetArchitecture": { + "x86": { + "CMAKE_GENERATOR_PLATFORM": "Win32", + "VCPKG_DEFAULT_TRIPLET": "x86-windows-static" }, - { - "StaticConfigs": { - "Ubuntu18": { - "OSVmImage": "MMSUbuntu18.04", - "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "VCPKG_DEFAULT_TRIPLET": "x64-linux", - "BuildArgs": "-j 10" - } - }, - "BuildSettings": { - "gpp-5": { - "AptDependencies": "g++-5", - "CmakeEnvArg": "CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 " - }, - "gpp-8": { - "AptDependencies": "g++-8", - "CC": "/usr/bin/gcc-8", - "CXX": "/usr/bin/g++-8" - }, - "gpp-9": { - "AptDependencies": "g++-9", - "CC": "/usr/bin/gcc-9", - "CXX": "/usr/bin/g++-9" - }, - "included_coverage": { - "AptDependencies": "gcovr lcov", - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON -DCMAKE_VERBOSE_MAKEFILE=ON", - "CODE_COVERAGE_COLLECT_ONLY": "1", - "CODE_COVERAGE": "enabled", - "PublishMapFiles": "true" - }, - "included": {}, - "included_release": { - "CMAKE_BUILD_TYPE": "Release", - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON", - "PublishMapFiles": "true" - }, - "included_samples": { - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON ", - "PublishMapFiles": "true" - } - } + "x64": { + "CMAKE_GENERATOR_PLATFORM": "x64", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static" + } + } + }, + { + "StaticConfigs": { + "Win2019": { + "VcpkgInstall": "openssl", + "OSVmImage": "MMS2019", + "Pool": "azsdk-pool-mms-win-2019-general", + "CMAKE_GENERATOR": "Visual Studio 16 2019", + "PublishMapFiles": "true" + } + }, + "TargetPlatform": { + "UWP_debug": { + "CMAKE_SYSTEM_NAME": "WindowsStore", + "CMAKE_SYSTEM_VERSION": "10.0", + "CmakeArgs": " -DBUILD_TRANSPORT_WINHTTP=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", + "BuildArgs": "--parallel 8 --config Debug" }, - { - "StaticConfigs": { - "Ubuntu20": { - "OSVmImage": "MMSUbuntu20.04", - "Pool": "azsdk-pool-mms-ubuntu-2004-general", - "VCPKG_DEFAULT_TRIPLET": "x64-linux", - "BuildArgs": "-j 10", - "CC": "/usr/bin/clang-11", - "CXX": "/usr/bin/clang++-11", - "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON", - "PublishMapFiles": "true" - } - }, - "BuildSettings": { - "clang-11": { - "CHECK_CLANG_FORMAT": "1" - }, - "included_release": { - "CMAKE_BUILD_TYPE": "Release" - } - } - } - ] + "UWP_release": { + "CMAKE_SYSTEM_NAME": "WindowsStore", + "CMAKE_SYSTEM_VERSION": "10.0", + "CmakeArgs": " -DBUILD_TRANSPORT_WINHTTP=ON -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON ", + "BuildArgs": "--parallel 8 --config Release" + } + }, + "TargetArchitecture": { + "x64": { + "CMAKE_GENERATOR_PLATFORM": "x64", + "VCPKG_DEFAULT_TRIPLET": "x64-uwp" + } + } + }, + { + "StaticConfigs": { + "Ubuntu18": { + "OSVmImage": "MMSUbuntu18.04", + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "VCPKG_DEFAULT_TRIPLET": "x64-linux", + "BuildArgs": "-j 10", + "RunProxyTests": true + } + }, + "BuildSettings": { + "gpp-5": { + "AptDependencies": "g++-5", + "CmakeEnvArg": "CC=/usr/bin/gcc-5 CXX=/usr/bin/g++-5 " + }, + "gpp-8": { + "AptDependencies": "g++-8", + "CC": "/usr/bin/gcc-8", + "CXX": "/usr/bin/g++-8" + }, + "gpp-9": { + "AptDependencies": "g++-9", + "CC": "/usr/bin/gcc-9", + "CXX": "/usr/bin/g++-9" + }, + "included_coverage": { + "AptDependencies": "gcovr lcov", + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CODE_COVERAGE=ON -DCMAKE_VERBOSE_MAKEFILE=ON", + "CODE_COVERAGE_COLLECT_ONLY": "1", + "CODE_COVERAGE": "enabled", + "PublishMapFiles": "true" + }, + "included": {}, + "included_release": { + "CMAKE_BUILD_TYPE": "Release", + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON", + "PublishMapFiles": "true" + }, + "included_samples": { + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_SAMPLES=ON ", + "PublishMapFiles": "true" + } + } + }, + { + "StaticConfigs": { + "Ubuntu20": { + "OSVmImage": "MMSUbuntu20.04", + "Pool": "azsdk-pool-mms-ubuntu-2004-general", + "VCPKG_DEFAULT_TRIPLET": "x64-linux", + "BuildArgs": "-j 10", + "CC": "/usr/bin/clang-11", + "CXX": "/usr/bin/clang++-11", + "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON", + "PublishMapFiles": "true", + "RunProxyTests": true + } + }, + "BuildSettings": { + "clang-11": { + "CHECK_CLANG_FORMAT": "1" + }, + "included_release": { + "CMAKE_BUILD_TYPE": "Release" + } + } + } + ] } diff --git a/eng/scripts/Get-BinarySizes.ps1 b/eng/scripts/Get-BinarySizes.ps1 index d032123801..1cc164e4ee 100644 --- a/eng/scripts/Get-BinarySizes.ps1 +++ b/eng/scripts/Get-BinarySizes.ps1 @@ -41,13 +41,16 @@ function setEnvVar($key, $value) { } function getTargetOs { - if ($OsVMImage.StartsWith('macOS')) { + if ($OsVMImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { return $OsVMImage } if ($OsVMImage -eq "MMS2019") { return "win-2019" } + if ($OsVMImage -eq "windows-2022") { + return "win-2022" + } if ($OsVMImage -eq "MMSUbuntu18.04") { return "ubuntu-18.04" @@ -57,11 +60,11 @@ function getTargetOs { return "ubuntu-20.04" } - LogError "Could not infer target OS" + LogError "Could not infer target OS from " $OSVmImage } function getTargetArchitecture { - if ($OSVmImage.StartsWith('macOS')) { + if ($OSVmImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { return "x64" } @@ -78,7 +81,7 @@ function getTargetArchitecture { } function getToolChain { - if ($OSVmImage.StartsWith('macOS')) { + if ($OSVmImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { return "AppleClang 12" } @@ -86,6 +89,10 @@ function getToolChain { return "MSVC" } + if ($OSVmImage -eq "windows-2022") { + return "MSVC17" + } + if ($OSVmImage.Contains("Ubuntu")) { if ($CmakeEnvArg.Contains('g++-5')) { return 'g++-5' @@ -98,15 +105,15 @@ function getToolChain { } return "g++-7" } - LogError "Could not infer toolchain" + LogError "Could not infer toolchain from " $OSVmImage and $CmakeEnvArg } function getTargetPlatform { - if ($OSVmImage.StartsWith('macOS')) { + if ($OSVmImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { return "macos" } - if ($OSVmImage -eq 'MMS2019') { + if ($OSVmImage -eq 'MMS2019' -or $OsVMImage -eq "windows-2022") { if (!$env:CMAKE_SYSTEM_NAME -and !$CmakeArgs.Contains('WindowsStore')) { return 'win32' } elseif ($env:CMAKE_SYSTEM_NAME -eq 'WindowsStore' -or $CmakeArgs.Contains('WindowsStore')) { @@ -118,7 +125,7 @@ function getTargetPlatform { return 'linux' } - LogError "Could not infer target platform" + LogError "Could not infer target platform from " $OSVmImage } function getBuildConfiguration { diff --git a/eng/scripts/Install-WSL.ps1 b/eng/scripts/Install-WSL.ps1 new file mode 100644 index 0000000000..1230632df2 --- /dev/null +++ b/eng/scripts/Install-WSL.ps1 @@ -0,0 +1,14 @@ +write-host "WSL install of ubuntu." +wsl --install -d Ubuntu-20.04 + +write-host "Launch WSL." +[console]::OutputEncoding = New-Object System.Text.UnicodeEncoding +$wsl = wsl -l -v | out-string + +write-host $wsl +while ($wsl -notmatch 'Ubuntu-20.04.*running') { + start-sleep -seconds 1 + $wsl = wsl -l -v | out-string + write-host $wsl +} +write-host "Ubuntu installed." diff --git a/sdk/core/azure-core/inc/azure/core/context.hpp b/sdk/core/azure-core/inc/azure/core/context.hpp index 5a610bb3d9..68ee8b31cd 100644 --- a/sdk/core/azure-core/inc/azure/core/context.hpp +++ b/sdk/core/azure-core/inc/azure/core/context.hpp @@ -146,6 +146,14 @@ namespace Azure { namespace Core { */ Context() : m_contextSharedState(std::make_shared()) {} + /** + * @brief Constructs a `%Context` from another `%Context` instance. + * + * @param that Another instance to copy. + * + */ + Context(Context const& that) = default; + /** * @brief Assigns `%Context` to another `%Context` instance. * diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index 917615e2d2..db39d8f34b 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -100,9 +100,9 @@ if (MSVC) target_compile_options(azure-core-test PUBLIC /wd26495 /wd26812 /wd6326 /wd28204 /wd28020 /wd6330 /wd4389) endif() -if (BUILD_CODE_COVERAGE) -message(STATUS "Building for Code Coverage." ) -add_compile_definitions(CODE_COVERAGE) +if (DISABLE_PROXY_TESTS) +message(STATUS "Disabling proxy tests because they cannot be supported on this environment." ) +add_compile_definitions(DISABLE_PROXY_TESTS) endif() # Additional test files to be copied to the output directory. diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile index 4bfef7bd1d..45bd84dfa5 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile @@ -20,11 +20,11 @@ RUN apt-get -y update WORKDIR / -COPY ./squid.conf /etc/squid/squid.conf -COPY ./proxypasswd /etc/squid/passwords +COPY ./squid.conf /tmp/squid.conf +COPY ./proxypasswd /tmp/proxypasswd EXPOSE 3129 STOPSIGNAL SIGTERM -ENTRYPOINT squid -f /etc/squid/squid.conf && sleep 10 && tail -f /var/log/squid/access.log +ENTRYPOINT squid -f /tmp/squid.conf && sleep 10 && tail -f /var/log/squid/access.log diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf index 594e350202..0494ddb0e1 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/squid.conf @@ -439,7 +439,7 @@ ##auth_param ntlm children 20 startup=0 idle=1 ##auth_param ntlm keep_alive on ## -auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords +auth_param basic program /usr/lib/squid/basic_ncsa_auth /tmp/proxypasswd auth_param basic children 5 startup=5 idle=1 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours @@ -4181,7 +4181,7 @@ http_port 3129 # TAG: pid_filename # A filename to write the process-id to. To disable, enter "none". #Default: -# pid_filename /var/run/squid.pid +pid_filename /var/run/squid2.pid # TAG: client_netmask # A netmask for client addresses in logfiles and cachemgr output. diff --git a/sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 new file mode 100644 index 0000000000..6d91729520 --- /dev/null +++ b/sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 @@ -0,0 +1,27 @@ +# cspell: words auxf +wsl sudo apt-get -y install squid +if (!$?) { + write-error "Failed to launch anonymous server." +} + +copy localproxy/squid.conf \\wsl$\Ubuntu-20.04\etc\squid\squid.conf +copy localproxy.passwd/proxypasswd //wsl$/Ubuntu-20.04/tmp/proxypasswd +copy localproxy.passwd/squid.conf \\wsl$\Ubuntu-20.04\tmp\squid.conf + +write-host "Verify contents of /etc/squid and /tmp to confirm copy succeeded." +wsl ls -l /etc/squid /tmp + +write-host "Launch anonymous squid server." +wsl sudo squid -f /etc/squid/squid.conf +if (!$?) { + write-error "Failed to launch anonymous server." +} + +write-host "Launch authenticated squid server." +wsl sudo squid -f /tmp/squid.conf +if (!$?) { + write-error "Failed to launch authenticated server." +} + +write-host "Dump processes; verify two copies of squid running." +wsl ps auxf diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp index 3c8977de20..eda51ba327 100644 --- a/sdk/core/azure-core/test/ut/transport_policy_options.cpp +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -14,6 +14,7 @@ #include #include +#if !defined(DISABLE_PROXY_TESTS) namespace Azure { namespace Core { namespace Test { namespace { constexpr static const char AzureSdkHttpbinServerSchema[] = "https"; @@ -91,32 +92,30 @@ namespace Azure { namespace Core { namespace Test { std::string HttpProxyServer() { -#if defined(CODE_COVERAGE) - return "http://127.0.0.1:3128"; -#else std::string anonymousServer{ Azure::Core::_internal::Environment::GetVariable("ANONYMOUSCONTAINERIPV4ADDRESS")}; + GTEST_LOG_(INFO) << "Anonymous server: " << anonymousServer; if (anonymousServer.empty()) { + GTEST_LOG_(ERROR) + << "Could not find value for ANONYMOUSCONTAINERIPV4ADDRESS, Assuming local."; anonymousServer = "127.0.0.1"; } return "http://" + anonymousServer + ":3128"; -#endif } std::string HttpProxyServerWithPassword() { -#if defined(CODE_COVERAGE) - return "http://127.0.0.1:3129"; -#else std::string authenticatedServer{ Azure::Core::_internal::Environment::GetVariable("AUTHENTICATEDCONTAINERIPV4ADDRESS")}; + GTEST_LOG_(INFO) << "Authenticated server: " << authenticatedServer; if (authenticatedServer.empty()) { + GTEST_LOG_(ERROR) + << "Could not find value for AUTHENTICATEDCONTAINERIPV4ADDRESS, Assuming local."; authenticatedServer = "127.0.0.1"; } return "http://" + authenticatedServer + ":3129"; -#endif } protected: @@ -248,25 +247,9 @@ namespace Azure { namespace Core { namespace Test { using namespace Azure::Core::Http::_internal; using namespace Azure::Core::Http::Policies::_internal; -#if defined(CODE_COVERAGE) -#else -#endif - // constexpr char SocksProxyServer[] = "socks://98.162.96.41:4145"; - TEST_F(TransportAdapterOptions, SimpleProxyTests_LIVEONLY_) + TEST_F(TransportAdapterOptions, SimpleProxyTests) { - // will skip test under some cased where test can't run (usually LIVE only tests) -#if !defined(CODE_COVERAGE) - if (GetTestMode() != TestMode::LIVE) - { - GTEST_LOG_(INFO) << "Skipping live only test."; - GTEST_SKIP(); - } - else - { - GTEST_LOG_(INFO) << "Running live only test."; - } -#endif Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); std::string myIpAddress; { @@ -315,15 +298,8 @@ namespace Azure { namespace Core { namespace Test { typedef int CURLcode; #endif - TEST_F(TransportAdapterOptions, ProxyWithPasswordHttps_LIVENONLY_) + TEST_F(TransportAdapterOptions, ProxyWithPasswordHttps) { - // will skip test under some cased where test can't run (usually LIVE only tests) -#if !defined(CODE_COVERAGE) - if (GetTestMode() != TestMode::LIVE) - { - GTEST_SKIP(); - } -#endif Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); // HTTPS Connections. @@ -367,15 +343,8 @@ namespace Azure { namespace Core { namespace Test { } } - TEST_F(TransportAdapterOptions, ProxyWithPasswordHttp_LIVEONLY_) + TEST_F(TransportAdapterOptions, ProxyWithPasswordHttp) { - // will skip test under some cased where test can't run (usually LIVE only tests) -#if !defined(CODE_COVERAGE) - if (GetTestMode() != TestMode::LIVE) - { - GTEST_SKIP(); - } -#endif Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); // HTTP Connections. testUrl.SetScheme("http"); @@ -408,4 +377,5 @@ namespace Azure { namespace Core { namespace Test { CheckBodyFromBuffer(*response, expectedResponseBodySize); } } -}}} // namespace Azure::Core::Test \ No newline at end of file +}}} // namespace Azure::Core::Test +#endif // defined(DISABLE_PROXY_TESTS) diff --git a/sdk/core/azure-core/test/ut/websocket_test.cpp b/sdk/core/azure-core/test/ut/websocket_test.cpp index e45ab021aa..0227f7ce6d 100644 --- a/sdk/core/azure-core/test/ut/websocket_test.cpp +++ b/sdk/core/azure-core/test/ut/websocket_test.cpp @@ -396,7 +396,7 @@ TEST_F(WebSocketTests, PingSendTest) TEST_F(WebSocketTests, MultiThreadedTestOnSingleSocket) { constexpr size_t threadCount = 50; - constexpr size_t testDataLength = 220000; + constexpr size_t testDataLength = 275000; constexpr size_t testDataSize = 100; constexpr auto testDuration = 10s; diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index e47adae6dc..45e6e3e0e2 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -62,23 +62,37 @@ stages: filePath: build/sdk/core/azure-core/test/ut/Start-WebSocketServer.ps1 arguments: $(Build.SourcesDirectory)/WebSocketServer.log workingDirectory: build/sdk/core/azure-core/test/ut - condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) # It would be nice to collapse this branch with the previous one, but nohup doesn't seem to # behave when called from powershell. - bash: | nohup python sdk/core/azure-core/test/ut/websocket_server.py > $(Build.SourcesDirectory)/WebSocketServer.log & workingDirectory: build - condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows')), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) displayName: Launch python websocket server (Linux). - pwsh: | docker build -t squid-local $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy docker build -t squid-local.passwd $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd docker run --rm -d -p 3128:3128 squid-local docker run --rm -d -p 3129:3129 squid-local.passwd - displayName: Launch Docker container proxy. - # The image we use for MacOS doesn't support docker, so skip on MacOS. - # We don't have a squid proxy container for windows, so we only run this on Ubuntu. - condition: and(succeeded(), contains(variables.CmakeArgs, 'CODE_COVERAGE'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + displayName: Launch Linux Docker container proxy + # If we're on Ubuntu and running proxy tests, build and launch a local squid proxy + condition: and(succeeded(), contains(variables['Agent.OS'], 'linux'), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + + - pwsh: eng/scripts/Install-WSL.ps1 + displayName: Install WSL on Windows hosts when proxy tests are enabled.. + condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + + - pwsh: ./run_wsl_proxy.ps1 + displayName: Launch WSL Proxy Server. + workingDirectory: $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests + condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + + # Verify that the proxy servers are running locally whenever we're expected to run proxy tests. + - pwsh: ./verify_proxy.ps1 + workingDirectory: $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests + displayName: Verify Proxy Server Working Correctly. + condition: and(succeeded(), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) PostTestSteps: # Shut down the test server. This uses curl to send a request to the "terminateserver" websocket endpoint. @@ -97,11 +111,11 @@ stages: displayName: Shutdown WebSocket server. condition: contains(variables.CmakeArgs, 'BUILD_TESTING=ON') - pwsh: | - docker ps -q -f ancestor=azsdkengsys.azurecr.io/cpp/squid | ForEach-Object { ` + docker ps -q -f ancestor=ubuntu/squid | ForEach-Object { ` docker stop $_ ` } displayName: Shutdown Squid Proxy. - condition: and(contains(variables.CmakeArgs, 'BUILD_TESTING=ON'), contains(variables['OSVmImage'], 'ubuntu')) + condition: and(contains(variables.CmakeArgs, 'BUILD_TESTING=ON'), variables.RunProxyTests, contains(variables['OSVmImage'], 'linux')) - template: /eng/common/pipelines/templates/steps/publish-artifact.yml parameters: ArtifactPath: '$(Build.SourcesDirectory)/WebSocketServer.log' diff --git a/sdk/core/test-resources.bicep b/sdk/core/test-resources.bicep deleted file mode 100644 index 0c3b0ed91e..0000000000 --- a/sdk/core/test-resources.bicep +++ /dev/null @@ -1,116 +0,0 @@ -// cspell: words azuresdkforcppproxy azuresdkforcppauthproxy -@description('Name for the container group') -param anonymousName string = 'azuresdkforcppproxy' - -@description('Name for the container group') -param authenticatedName string = 'azuresdkforcppauthproxy' - -@description('Location for all resources.') -param location string = resourceGroup().location - -@description('Container image to deploy. Should be of the form repoName/imagename:tag for images stored in public Docker Hub, or a fully qualified URI for other registries. Images from private registries require additional registry credentials.') -param anonymousImage string = 'azsdkengsys.azurecr.io/cpp/squid:latest' - -@description('Container image to deploy. Should be of the form repoName/imagename:tag for images stored in public Docker Hub, or a fully qualified URI for other registries. Images from private registries require additional registry credentials.') -param authenticatedImage string = 'azsdkengsys.azurecr.io/cpp/squid.passwd:latest' - -@description('Port to open on the container and the public IP address.') -param anonymousPort int = 3128 -@description('Port to open on the container and the public IP address.') -param authenticatedPort int = 3129 - -@description('The number of CPU cores to allocate to the container.') -param cpuCores int = 1 - -@description('The amount of memory to allocate to the container in gigabytes.') -param memoryInGb int = 2 - -@description('The behavior of Azure runtime if container has stopped.') -@allowed([ - 'Always' - 'Never' - 'OnFailure' -]) -param restartPolicy string = 'Always' - -resource anonymousContainerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01' = { - name: anonymousName - location: location - properties: { - containers: [ - { - name: anonymousName - properties: { - image: anonymousImage - ports: [ - { - port: anonymousPort - protocol: 'TCP' - } - ] - environmentVariables:[ - { } - ] - resources: { - requests: { - cpu: cpuCores - memoryInGB: memoryInGb - } - } - } - } - ] - osType: 'Linux' - restartPolicy: restartPolicy - ipAddress: { - type: 'Public' - ports: [ - { - port: anonymousPort - protocol: 'TCP' - } - ] - } - } -} - -resource authenticatedContainerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01' = { - name: authenticatedName - location: location - properties: { - containers: [ - { - name: authenticatedName - properties: { - image: authenticatedImage - ports: [ - { - port: authenticatedPort - protocol: 'TCP' - } - ] - resources: { - requests: { - cpu: cpuCores - memoryInGB: memoryInGb - } - } - } - } - ] - osType: 'Linux' - restartPolicy: restartPolicy - ipAddress: { - type: 'Public' - ports: [ - { - port: authenticatedPort - protocol: 'TCP' - } - ] - } - } -} - -output anonymousContainerIPv4Address string = anonymousContainerGroup.properties.ipAddress.ip -output authenticatedContainerIPv4Address string = authenticatedContainerGroup.properties.ipAddress.ip From bcf83a48cbeb96947e783d7770997a6e89821b0f Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 29 Aug 2022 11:33:11 -0700 Subject: [PATCH 06/75] Update the feature/websockets branch with changes from main (#3903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Stress test (#3820) * mem leak fix * PR comments fix * PR comments * seems to work? * clang * curl again * add first stress test * also update gitignore * missing line * only linux * clang typo format * typo 2 * PR comments * cspell * remove terminator * Fixed the metadata for better handling (#3824) Co-authored-by: sima-zhu * Update attestation core vcpkg dependency to latest GA version that is required. (#3830) * Update attestation core vcpkg dependency to latest GA version that is required. * Update vcpkg config.cmake to match the dependency version needed. * Remove winhttp (#3832) * remove refs to winhttp * this tsst only curl * Move perf.yml to eng/common (#3833) Co-authored-by: Mike Harder * Sync eng/common directory with azure-sdk-tools for PR 3656 (#3834) * someone wants to reference the test-proxy startup scripts externally. to make this easy on them we're parameterizing the root of the eng/common for easy use in that scenario * two leading $ signs on the definition of the certificate path was causing some issues! Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Update casing for 'verison' (#3821) Co-authored-by: Daniel Jurek * Print additional result summary formats to pipelines UI (#3842) Co-authored-by: Mike Harder * Sync eng/common directory with azure-sdk-tools for PR 3702 (#3843) * Add language-service to list of valid sample slugs * Update link to taxonomies Co-authored-by: Heath Stewart * Fix incorrect failure notification in vcpkg publishing (#3838) * Set up for testing of template pipeline * Override branches, set up for template GA release * More TODOs to prevent merging an unintended change * More removal of TestPipeline * Increment template version number * Use script to set package version * Check out the correct branch * branch parameter in the command * Use $(PublishToVcpkg) to determine if we should check for changes * dictionary syntax * Set GA package version to validate GA publish scenario * Update changelog * create-pull-request.yml optionally pushes changes * Output GH PR URI * Macro syntax with a variable set earlier * Move up to 1.2.0-beta.2 * beta.1 * Revert changelog * Revert testing-related changes * Revert vcpkg-clone.yml * Revert eng/common changes, ensure global $(HasChanges) is set properly * Changes to enable testing * 1.1.0-beta.1 * vcpkg clone should clone at configured branch * Clone "main" branch of vcpkg betas * Undo test-specific changes * More PR cleanup * PR cleanup * Helm charts (#3841) * helm chart * first pipe setup * poi * magiks * ewewe * stress * cleanup * pr * QFE and readme * clang * stupid clang , waste of time * ewqwewewrqrewewrqewrqwrqr * stupid clang * cspell * PR * try try again * clang again * Sync eng/common directory with azure-sdk-tools for PR 3661 (#3846) * Add full clone fallback to sparse checkout * Improve clone handling and overrides for sparse checkout * Use SkipSparseCheckout variable name Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3735 (#3845) * Detect API changes using new snadboxinx approach * Added strictmode * Remove unset variable * Changes as per strict mode 3 * Rervert strict mode to allow language level fixes to merge first Co-authored-by: praveenkuttappan * Increment version for keyvault releases (#3809) * Increment package version after release of azure-security-keyvault-keys * Increment package version after release of azure-security-keyvault-secrets * Increment package version after release of azure-security-keyvault-certificates * Removed hard dependency on opentelemetry version (#3844) * Revert "Add full clone fallback to sparse checkout (#3661)" (#3851) This reverts commit 7605ead00308dd20f20f2afe5acc4ec9900a2c47. Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3753 (#3857) * Bump MacOs version to macos-11 * Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 Co-authored-by: Wes Haggard * Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 Co-authored-by: Wes Haggard Co-authored-by: sima-zhu Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: Wes Haggard * Bump macOs version to macos-11 (#3853) * Update CHANGELOG.md * Fix misleading step name in az module install (#3859) Co-authored-by: Ben Broderick Phillips * Retry poll calls on EINTR (#3858) When signals are delievered to the process, calls here to poll may be interrupted and return with a spurious failure. The call instead should be restarted. * Fix bad path to sample matrix json (#3860) Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3826 (#3863) * Add link checking for stress CI * Remove region segment from stress testing links Co-authored-by: Ben Broderick Phillips * Core August releases (#3862) * Core August releases * cspell Co-authored-by: Anton Kolesnyk * Increment version for core releases (#3865) * Increment package version after release of azure-core * Increment package version after release of azure-core-tracing-opentelemetry * Storage Aug GA release (#3864) * CG only runs on internal (#3866) * Condition added and indentation changes * STG 79 80 81 Features (#3850) * Sync eng/common directory with azure-sdk-tools for PR 3860 (#3871) * updating pfx and cert * update the targeted version of the proxy as well Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Storage August Preview Release (#3868) * Storage August Preview Release * update versions * Increment version for storage releases (#3875) * Increment package version after release of azure-storage-common * Increment package version after release of azure-storage-blobs * Fix an issue that reason phrase is missing as expected from HTTP/2 server (#3879) * Fix an issue that reason phrase is missing as expected from HTTP/2 server * reverse the condition * compact comments * fix clang format * Update CODEOWNERS (#3881) * updated targeted proxy version to one that properly allows consumption of TLS certificates (#3888) Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Fix `azure-storage-blobs-cpp` beta install (#3889) Co-authored-by: Anton Kolesnyk * Fixed #3899 - Handle new OSX version correctly; reformatted platform-matrix JSON files (#3900) * Simpler get-binarysizes check for OSX (#3901) * Simpler get-binarysizes check for OSX * Missed wildcard Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com> Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: sima-zhu Co-authored-by: Ahson Khan Co-authored-by: Mike Harder Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> Co-authored-by: Daniel Jurek Co-authored-by: Heath Stewart Co-authored-by: Ben Broderick Phillips Co-authored-by: praveenkuttappan Co-authored-by: Ben Broderick Phillips Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Rick Winter Co-authored-by: John Heffner Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Co-authored-by: Anton Kolesnyk Co-authored-by: JinmingHu Co-authored-by: Jonathan Cárdenas Co-authored-by: keshen-msft <53491277+keshen-msft@users.noreply.github.com> Co-authored-by: microzchang <110015819+microzchang@users.noreply.github.com> --- .../stages/platform-matrix-cmakegenerate.json | 40 +++++++++---------- .../platform-matrix-cmakesourcegenerate.json | 40 +++++++++---------- eng/scripts/Get-BinarySizes.ps1 | 8 ++-- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json index a0ac2ef0c0..c6b27addaa 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakegenerate.json @@ -1,23 +1,23 @@ { - "matrix": { - "CmakeEnvArg": "", - "OSConfig": { - "Linux": { - "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "OSVmImage": "MMSUbuntu18.04", - "AptDependencies": "libcurl4-openssl-dev", - "VCPKG_DEFAULT_TRIPLET": "x64-linux" - }, - "Windows": { - "Pool": "azsdk-pool-mms-win-2019-general", - "OSVmImage": "MMS2019", - "VCPKG_DEFAULT_TRIPLET": "x64-windows" - }, - "Mac": { - "Pool": "Azure Pipelines", - "OSVmImage": "macos-11", - "VCPKG_DEFAULT_TRIPLET": "x64-osx" - } - } + "matrix": { + "CmakeEnvArg": "", + "OSConfig": { + "Linux": { + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "AptDependencies": "libcurl4-openssl-dev", + "VCPKG_DEFAULT_TRIPLET": "x64-linux" + }, + "Windows": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "VCPKG_DEFAULT_TRIPLET": "x64-windows" + }, + "Mac": { + "Pool": "Azure Pipelines", + "OSVmImage": "macos-11", + "VCPKG_DEFAULT_TRIPLET": "x64-osx" + } } + } } diff --git a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json index 49ac2e648a..07e9fbc210 100644 --- a/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json +++ b/eng/pipelines/templates/stages/platform-matrix-cmakesourcegenerate.json @@ -1,23 +1,23 @@ { - "matrix": { - "OSConfig": { - "Windows": { - "Pool": "azsdk-pool-mms-win-2019-general", - "OSVmImage": "MMS2019", - "CmakeEnvArg": "" - }, - "Linux": { - "Pool": "azsdk-pool-mms-ubuntu-1804-general", - "OSVmImage": "MMSUbuntu18.04", - "CmakeEnvArg": "", - "AptDependencies": "libcurl4-openssl-dev" - }, - "Mac": { - "Pool": "Azure Pipelines", - "OSVmImage": "macos-11", - "CmakeEnvArg": "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include ", - "BrewDependencies": "openssl" - } - } + "matrix": { + "OSConfig": { + "Windows": { + "Pool": "azsdk-pool-mms-win-2019-general", + "OSVmImage": "MMS2019", + "CmakeEnvArg": "" + }, + "Linux": { + "Pool": "azsdk-pool-mms-ubuntu-1804-general", + "OSVmImage": "MMSUbuntu18.04", + "CmakeEnvArg": "", + "AptDependencies": "libcurl4-openssl-dev" + }, + "Mac": { + "Pool": "Azure Pipelines", + "OSVmImage": "macos-11", + "CmakeEnvArg": "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include ", + "BrewDependencies": "openssl" + } } + } } diff --git a/eng/scripts/Get-BinarySizes.ps1 b/eng/scripts/Get-BinarySizes.ps1 index 1cc164e4ee..bbe5be472f 100644 --- a/eng/scripts/Get-BinarySizes.ps1 +++ b/eng/scripts/Get-BinarySizes.ps1 @@ -41,7 +41,7 @@ function setEnvVar($key, $value) { } function getTargetOs { - if ($OsVMImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { + if ($OsVMImage -like 'macOS*') { return $OsVMImage } @@ -64,7 +64,7 @@ function getTargetOs { } function getTargetArchitecture { - if ($OSVmImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { + if ($OSVmImage -like 'macOS*') { return "x64" } @@ -81,7 +81,7 @@ function getTargetArchitecture { } function getToolChain { - if ($OSVmImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { + if ($OSVmImage -like 'macOS*') { return "AppleClang 12" } @@ -109,7 +109,7 @@ function getToolChain { } function getTargetPlatform { - if ($OSVmImage.StartsWith('macOS', $true, (Get-Culture).InvariantCulture)) { + if ($OSVmImage -like 'macOS*') { return "macos" } From ceca1cf1562d0a251992d0e335de782bc9415784 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 19 Sep 2022 11:04:03 -0700 Subject: [PATCH 07/75] Added functionality to enable CRL checking for CURL on linux; added tests for this new functionality. (#3923) # Added functionality to enable CRL checking for CURL on linux. This one is somewhat unpleasant and much larger than expected. This pull request enables two pieces of functionality: 1. The ability to specify a known root certificate to the CURL HTTP transport (instead of a certificate file). 2. The ability to enable CRL validation (normally this is disabled in libCURL). Enabling CRL validation ended up pulling in a significant chunk of code from azure-c-shared-util which handled retrieving CRLs (I was unable to find code in libCURL to do this). Native LibCURL support for CRL validation is limited to the schannel SSL backend (Windows Only). This change also adds logic to the CURL transport to enable the ability to ignore CRL retrieval errors (there doesn't seem to be a comparable way of doing this for WinHTTP so it is a CURL transport only option). To verify the root certificate logic, an extremely simple client for the SDK Test Proxy was written and is used to "record" a request to the C++ SDK HTTP server. --- .../templates/jobs/archetype-sdk-client.yml | 4 +- eng/pipelines/templates/jobs/ci.tests.yml | 8 +- eng/pipelines/templates/jobs/live.tests.yml | 4 +- .../templates/stages/archetype-sdk-client.yml | 4 +- .../templates/stages/archetype-sdk-tests.yml | 4 +- .../inc/azure/core/http/curl_transport.hpp | 30 +- .../inc/azure/core/http/policies/policy.hpp | 24 +- .../azure/core/http/win_http_transport.hpp | 99 ++ .../azure-core/inc/azure/core/platform.hpp | 6 + sdk/core/azure-core/src/http/curl/curl.cpp | 967 ++++++++++++++---- .../curl/curl_connection_pool_private.hpp | 7 - .../src/http/curl/curl_connection_private.hpp | 149 ++- .../azure-core/src/http/transport_policy.cpp | 61 +- .../src/http/winhttp/win_http_transport.cpp | 262 ++++- sdk/core/azure-core/test/ut/CMakeLists.txt | 7 +- .../test/ut/curl_connection_pool_test.cpp | 16 +- .../azure-core/test/ut/curl_options_test.cpp | 17 +- .../test/ut/transport_policy_options.cpp | 515 +++++++++- sdk/core/ci.yml | 8 +- 19 files changed, 1816 insertions(+), 376 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index e755496f90..3081c4a558 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -33,10 +33,10 @@ parameters: type: object default: [] - name: PreTestSteps - type: object + type: stepList default: [] - name: PostTestSteps - type: object + type: stepList default: [] jobs: diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 1e1ede079b..19d7dd6535 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -47,10 +47,10 @@ parameters: type: boolean default: false - name: PreTestSteps - type: object + type: stepList default: [] - name: PostTestSteps - type: object + type: stepList default: [] @@ -145,7 +145,7 @@ jobs: Env: "$(CmakeEnvArg)" - ${{ parameters.PreTestSteps }} - + - pwsh: | ctest ` -C Debug ` @@ -156,7 +156,7 @@ jobs: -T Test workingDirectory: build displayName: Test - + - ${{ parameters.PostTestSteps }} - task: PublishTestResults@2 diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 19e73bb0b5..de57d3db24 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -37,10 +37,10 @@ parameters: type: boolean default: false - name: PreTestSteps - type: object + type: stepList default: [] - name: PostTestSteps - type: object + type: stepList default: [] jobs: diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 334e580647..6a86decd0f 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -68,10 +68,10 @@ parameters: type: string default: '' - name: PreTestSteps - type: object + type: stepList default: [] - name: PostTestSteps - type: object + type: stepList default: [] diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index a4aba5565b..ed3d8f5459 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -30,10 +30,10 @@ parameters: type: string default: '' - name: PreTestSteps - type: object + type: stepList default: [] - name: PostTestSteps - type: object + type: stepList default: [] stages: diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index 5a8a6d91c0..cf6ef84ae3 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -38,10 +38,31 @@ namespace Azure { namespace Core { namespace Http { * * @remark Libcurl does revocation list check by default for SSL backends that supports this * feature. However, the Azure SDK overrides libcurl's behavior and disables the revocation list - * check by default. - * + * check by default. This ensures that the LibCURL behavior matches the WinHTTP behavior. */ bool EnableCertificateRevocationListCheck = false; + + /** + * @brief This option allows SSL connections to proceed even if there is an error retrieving the + * Certificate Revocation List. + * + * @remark Note that this only works when LibCURL is configured to use openssl as its TLS + * provider. That functionally limits this check to Linux only, and then only when openssl is + * configured (the default). + */ + bool AllowFailedCrlRetrieval = false; + + /** + * @brief A set of PEM encoded X.509 certificates and CRLs describing the certificates used to + * validate the server. + * + * @remark The Azure SDK will not directly validate these certificates. + * + * @remark More about this option: + * https://curl.haxx.se/libcurl/c/CURLOPT_CAINFO_BLOB.html + * + */ + std::string PemEncodedExpectedRootCertificates; }; /** @@ -86,7 +107,8 @@ namespace Azure { namespace Core { namespace Http { */ std::string ProxyPassword; /** - * @brief The string for the certificate authenticator is sent to libcurl handle directly. + * @brief Path to a PEM encoded file containing the certificate authorities sent to libcurl + * handle directly. * * @remark The Azure SDK will not check if the path is valid or not. * @@ -95,6 +117,7 @@ namespace Azure { namespace Core { namespace Http { * */ std::string CAInfo; + /** * @brief All HTTP requests will keep the connection channel open to the service. * @@ -106,6 +129,7 @@ namespace Azure { namespace Core { namespace Http { * handle. It is `true` by default. */ bool HttpKeepAlive = true; + /** * @brief This option determines whether libcurl verifies the authenticity of the peer's * certificate. diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 645c387108..61e144939d 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -144,17 +144,35 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * * @remark The URL for the proxy server to use for this connection. */ - Azure::Nullable HttpProxy; + Azure::Nullable HttpProxy{}; /** * @brief The username to use when authenticating with the proxy server. */ - std::string ProxyUserName; + std::string ProxyUserName{}; /** * @brief The password to use when authenticating with the proxy server. */ - std::string ProxyPassword; + std::string ProxyPassword{}; + + /** + * @brief Enable TLS Certificate validation against a certificate revocation list. + * + * @remark Note that by default CRL validation is *disabled*. + */ + bool EnableCertificateRevocationListCheck{false}; + + /** + * @brief Base64 encoded DER representation of an X.509 certificate expected in the certificate + * chain used in TLS connections. + * + * @remark Note that with the schannel and sectransp crypto backends, settting the + * expected root certificate disables access to the system certificate store. + * This means that the expected root certificate is the only certificate that will be trusted. + */ + std::string ExpectedTlsRootCertificate{}; + #endif // defined(CURL_ADAPTER) || defined(WINHTTP_ADAPTER) #endif // !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 7547f05be2..9001cbcbb5 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -4,6 +4,7 @@ /** * @file * @brief #Azure::Core::Http::HttpTransport implementation via WinHTTP. + * cspell:words HCERTIFICATECHAIN PCCERT CCERT HCERTCHAINENGINE HCERTSTORE */ #pragma once @@ -22,11 +23,13 @@ #define NOMINMAX #endif #include + #endif #include #include #include +#include #include namespace Azure { namespace Core { namespace Http { @@ -49,6 +52,61 @@ namespace Azure { namespace Core { namespace Http { }; using unique_HINTERNET = std::unique_ptr; + // unique_ptr class wrapping a PCCERT_CHAIN_CONTEXT + struct HCERTIFICATECHAIN_deleter + { + void operator()(PCCERT_CHAIN_CONTEXT handle) + { + // unique_ptr class wrapping an HINTERNET handle + { + CertFreeCertificateChain(handle); + } + } + }; + using unique_CCERT_CHAIN_CONTEXT + = std::unique_ptr; + + // unique_ptr class wrapping an HCERTCHAINENGINE handle + struct HCERTCHAINENGINE_deleter + { + void operator()(HCERTCHAINENGINE handle) noexcept + { + if (handle != nullptr) + { + CertFreeCertificateChainEngine(handle); + } + } + }; + using unique_HCERTCHAINENGINE = std::unique_ptr; + + // unique_ptr class wrapping an HCERTSTORE handle + struct HCERTSTORE_deleter + { + public: + void operator()(HCERTSTORE handle) noexcept + { + if (handle != nullptr) + { + CertCloseStore(handle, 0); + } + } + }; + using unique_HCERTSTORE = std::unique_ptr; + + // unique_ptr class wrapping a PCCERT_CONTEXT + struct CERTCONTEXT_deleter + { + public: + void operator()(PCCERT_CONTEXT handle) noexcept + { + if (handle != nullptr) + { + CertFreeCertificateContext(handle); + } + } + }; + using unique_PCCERT_CONTEXT = std::unique_ptr; + class WinHttpStream final : public Azure::Core::IO::BodyStream { private: _detail::unique_HINTERNET m_requestHandle; @@ -122,6 +180,11 @@ namespace Azure { namespace Core { namespace Http { */ bool EnableSystemDefaultProxy{false}; + /** + * @brief If True, enables checks for certificate revocation. + */ + bool EnableCertificateRevocationListCheck{false}; + /** * @brief Proxy information. * @@ -142,6 +205,13 @@ namespace Azure { namespace Core { namespace Http { * @brief Password for proxy authentication. */ std::string ProxyPassword; + + /** + * @brief Array of Base64 encoded DER encoded X.509 certificate. These certificates should form + * a chain of certificates which will be used to validate the server certificate sent by the + * server. + */ + std::vector ExpectedTlsRootCertificates; }; /** @@ -155,6 +225,7 @@ namespace Azure { namespace Core { namespace Http { // This should remain immutable and not be modified after calling the ctor, to avoid threading // issues. _detail::unique_HINTERNET m_sessionHandle; + bool m_requestHandleClosed{false}; _detail::unique_HINTERNET CreateSessionHandle(); _detail::unique_HINTERNET CreateConnectionHandle( @@ -183,6 +254,34 @@ namespace Azure { namespace Core { namespace Http { _detail::unique_HINTERNET& requestHandle, HttpMethod requestMethod); + /* + * Callback from WinHTTP called after the TLS certificates are received when the caller sets + * expected TLS root certificates. + */ + static void CALLBACK StatusCallback( + HINTERNET hInternet, + DWORD_PTR dwContext, + DWORD dwInternetStatus, + LPVOID lpvStatusInformation, + DWORD dwStatusInformationLength) noexcept; + /* + * Callback from WinHTTP called after the TLS certificates are received when the caller sets + * expected TLS root certificates. + */ + void OnHttpStatusOperation(HINTERNET hInternet, DWORD dwInternetStatus); + /* + * Adds the specified trusted certificates to the specified certificate store. + */ + bool AddCertificatesToStore( + std::vector const& trustedCertificates, + _detail::unique_HCERTSTORE const& hCertStore); + /* + * Verifies that the certificate context is in the trustedCertificates set of certificates. + */ + bool VerifyCertificatesInChain( + std::vector const& trustedCertificates, + _detail::unique_PCCERT_CONTEXT const& serverCertificate); + // Callback to allow a derived transport to extract the request handle. Used for WebSocket // transports. protected: diff --git a/sdk/core/azure-core/inc/azure/core/platform.hpp b/sdk/core/azure-core/inc/azure/core/platform.hpp index 155f23c8ad..d46d3d587a 100644 --- a/sdk/core/azure-core/inc/azure/core/platform.hpp +++ b/sdk/core/azure-core/inc/azure/core/platform.hpp @@ -47,4 +47,10 @@ #define AZ_PLATFORM_WINDOWS #elif defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)) #define AZ_PLATFORM_POSIX +#if defined(__APPLE__) || defined(__MACH__) +#define AZ_PLATFORM_MAC +#else +#define AZ_PLATFORM_LINUX +#endif + #endif diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 79ce8c0f06..e15aa1569a 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT +// cspell:words OCSP crls #include "azure/core/base64.hpp" #include "azure/core/platform.hpp" @@ -25,6 +26,12 @@ #include "curl_session_private.hpp" #if defined(AZ_PLATFORM_POSIX) +#include +#include +#include +#include +#include +#include #include // for poll() #include // for socket shutdown #elif defined(AZ_PLATFORM_WINDOWS) @@ -34,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -1099,7 +1107,9 @@ size_t CurlSession::ResponseBufferParser::Parse( { // Should never happen that parser is not statusLIne or Headers and we still try // to parse more. + // LCOV_EXCL_START AZURE_UNREACHABLE_CODE(); + // LCOV_EXCL_STOP } // clean internal buffer this->m_internalBuffer.clear(); @@ -1137,7 +1147,9 @@ size_t CurlSession::ResponseBufferParser::Parse( { // Should never happen that parser is not statusLIne or Headers and we still try // to parse more. + // LCOV_EXCL_START AZURE_UNREACHABLE_CODE(); + // LCOV_EXCL_STOP } } } @@ -1166,135 +1178,6 @@ size_t CurlSession::ResponseBufferParser::Parse( return index; } -// Finds delimiter '\r' as the end of the -size_t CurlSession::ResponseBufferParser::BuildStatusCode( - uint8_t const* const buffer, - size_t const bufferSize) -{ - if (this->state != ResponseParserState::StatusLine) - { - return 0; // Wrong internal state to call this method. - } - - uint8_t endOfStatusLine = '\r'; - auto endOfBuffer = buffer + bufferSize; - - // Look for the end of status line in buffer - auto indexOfEndOfStatusLine = std::find(buffer, endOfBuffer, endOfStatusLine); - - if (indexOfEndOfStatusLine == endOfBuffer) - { - // did not find the delimiter yet, copy to internal buffer - this->m_internalBuffer.append(buffer, endOfBuffer); - return bufferSize; // all buffer read and requesting for more - } - - // Delimiter found, check if there is data in the internal buffer - if (this->m_internalBuffer.size() > 0) - { - // If the index is same as buffer it means delimiter is at position 0, meaning that - // internalBuffer contains the status line and we don't need to add anything else - if (indexOfEndOfStatusLine > buffer) - { - // Append and build response minus the delimiter - this->m_internalBuffer.append(buffer, indexOfEndOfStatusLine); - } - this->m_response = CreateHTTPResponse(this->m_internalBuffer); - } - else - { - // Internal Buffer was not required, create response directly from buffer - this->m_response = CreateHTTPResponse(std::string(buffer, indexOfEndOfStatusLine)); - } - - // update control - this->state = ResponseParserState::Headers; - this->m_internalBuffer.clear(); - - // Return the index of the next char to read after delimiter - // No need to advance one more char ('\n') (since we might be at the end of the array) - // Parsing Headers will make sure to move one possition - return indexOfEndOfStatusLine + 1 - buffer; -} - -// Finds delimiter '\r' as the end of the -size_t CurlSession::ResponseBufferParser::BuildHeader( - uint8_t const* const buffer, - size_t const bufferSize) -{ - if (this->state != ResponseParserState::Headers) - { - return 0; // can't run this if state is not Headers. - } - - uint8_t delimiter = '\r'; - auto start = buffer; - auto endOfBuffer = buffer + bufferSize; - - if (bufferSize == 1 && buffer[0] == '\n') - { - // rare case of using buffer of size 1 to read. In this case, if the char is next value - // after headers or previous header, just consider it as read and return - return bufferSize; - } - else if (bufferSize > 1 && this->m_internalBuffer.size() == 0) // only if nothing in - // buffer, advance - { - // move offset one possition. This is because readStatusLine and readHeader will read up - // to - // '\r' then next delimiter is '\n' and we don't care - start = buffer + 1; - } - - // Look for the end of status line in buffer - auto indexOfEndOfStatusLine = std::find(start, endOfBuffer, delimiter); - - if (indexOfEndOfStatusLine == start && this->m_internalBuffer.size() == 0) - { - // \r found at the start means the end of headers - this->m_internalBuffer.clear(); - this->m_parseCompleted = true; - return 1; // can't return more than the found delimiter. On read remaining we need to - // also remove first char - } - - if (indexOfEndOfStatusLine == endOfBuffer) - { - // did not find the delimiter yet, copy to internal buffer - this->m_internalBuffer.append(start, endOfBuffer); - return bufferSize; // all buffer read and requesting for more - } - - // Delimiter found, check if there is data in the internal buffer - if (this->m_internalBuffer.size() > 0) - { - // If the index is same as buffer it means delimiter is at position 0, meaning that - // internalBuffer contains the status line and we don't need to add anything else - if (indexOfEndOfStatusLine > buffer) - { - // Append and build response minus the delimiter - this->m_internalBuffer.append(start, indexOfEndOfStatusLine); - } - // will throw if header is invalid - SetHeader(*m_response, this->m_internalBuffer); - } - else - { - // Internal Buffer was not required, create response directly from buffer - std::string header(std::string(start, indexOfEndOfStatusLine)); - // will throw if header is invalid - SetHeader(*this->m_response, header); - } - - // reuse buffer - this->m_internalBuffer.clear(); - - // Return the index of the next char to read after delimiter - // No need to advance one more char ('\n') (since we might be at the end of the array) - // Parsing Headers will make sure to move one position - return indexOfEndOfStatusLine + 1 - buffer; -} - namespace { // Calculate the connection key. // The connection key is a tuple of host, proxy info, TLS info, etc. Basically any characteristics @@ -1318,6 +1201,13 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption key.append(","); key.append(options.NoSignal ? "1" : "0"); key.append(","); + key.append(options.SslOptions.AllowFailedCrlRetrieval ? "FC" : "0"); + key.append(","); + key.append( + !options.SslOptions.PemEncodedExpectedRootCertificates.empty() ? std::to_string( + std::hash{}(options.SslOptions.PemEncodedExpectedRootCertificates)) + : "0"); + key.append(","); // using DefaultConnectionTimeout or 0 result in the same setting key.append( (options.ConnectionTimeout == Azure::Core::Http::_detail::DefaultConnectionTimeout @@ -1372,12 +1262,7 @@ void DumpCurlInfoToLog(std::string const& text, uint8_t* ptr, size_t size) } // namespace -int CurlConnectionPool::CurlLoggingCallback( - CURL*, - curl_infotype type, - char* data, - size_t size, - void*) +int CurlConnection::CurlLoggingCallback(CURL*, curl_infotype type, char* data, size_t size, void*) { if (type == CURLINFO_TEXT) { @@ -1420,6 +1305,558 @@ int CurlConnectionPool::CurlLoggingCallback( } return 0; } +#if !defined(AZ_PLATFORM_WINDOWS) +namespace Azure { namespace Core { namespace Http { + namespace _detail { + + // Helpers to provide RAII wrappers for OpenSSL types. + template struct openssl_deleter + { + void operator()(T* obj) { Deleter(obj); } + }; + template + using basic_openssl_unique_ptr = std::unique_ptr>; + + // *** Given just T, map it to the corresponding FreeFunc: + template struct type_map_helper; + template <> struct type_map_helper + { + using type = basic_openssl_unique_ptr; + }; + template <> struct type_map_helper + { + using type = basic_openssl_unique_ptr; + }; + + template <> struct type_map_helper + { + using type = basic_openssl_unique_ptr; + }; + + template <> struct type_map_helper + { + static void FreeCrlStack(STACK_OF(X509_CRL) * obj) + { + sk_X509_CRL_pop_free(obj, X509_CRL_free); + } + using type = basic_openssl_unique_ptr; + }; + + // *** Now users can say openssl_unique_ptr if they want: + template using openssl_unique_ptr = typename type_map_helper::type; + + // *** Or the current solution's convenience aliases: + using openssl_bio = openssl_unique_ptr; + using openssl_x509 = openssl_unique_ptr; + using openssl_x509_crl = openssl_unique_ptr; + using openssl_x509_crl_stack = openssl_unique_ptr; + + template + auto make_openssl_unique(Api& OpensslApi, Args&&... args) + { + auto raw = OpensslApi(std::forward( + args)...); // forwarding is probably unnecessary, could use const Args&... + // check raw + using T = std::remove_pointer_t; // no need to request T when we can see + // what OpensslApi returned + return openssl_unique_ptr{raw}; + } + + // Disable Code Coverage across GetOpenSSLError because we don't have a good way of forcing + // OpenSSL to fail. + // LCOV_EXCL_START + std::string GetOpenSSLError(std::string const& what) + { + auto bio(make_openssl_unique(BIO_new, BIO_s_mem())); + + BIO_printf(bio.get(), "Error in %hs: ", what.c_str()); + if (ERR_peek_error() != 0) + { + ERR_print_errors(bio.get()); + } + else + { + BIO_printf(bio.get(), "Unknown error."); + } + + uint8_t* bioData; + long bufferSize = BIO_get_mem_data(bio.get(), &bioData); + std::string returnValue; + returnValue.resize(bufferSize); + memcpy(&returnValue[0], bioData, bufferSize); + + return returnValue; + } + // LCOV_EXCL_STOP + + } // namespace _detail + + namespace { + // int g_ssl_crl_max_size_in_kb = 20; + /** + * @brief THe Cryptography class provides a set of basic cryptographic primatives required + * by the attestation samples. + */ + + _detail::openssl_x509_crl LoadCrlFromUrl(std::string const& url) + { + Log::Write(Logger::Level::Informational, "Load CRL from Url: " + url); + auto crl = _detail::make_openssl_unique(X509_CRL_load_http, url.c_str(), nullptr, nullptr, 5); + if (!crl) + { + Log::Write(Logger::Level::Error, _detail::GetOpenSSLError("Load CRL")); + } + + return crl; + } + + enum class CrlFormat : int + { + Http, + Asn1, + PEM, + }; + + _detail::openssl_x509_crl LoadCrl(std::string const& source, CrlFormat format) + { + _detail::openssl_x509_crl x; + _detail::openssl_bio in; + + if (format == CrlFormat::Http) + { + return LoadCrlFromUrl(source); + } + return x; + } + + bool IsCrlValid(X509_CRL* crl) + { + const ASN1_TIME* at = X509_CRL_get0_nextUpdate(crl); + + int day = -1; + int sec = -1; + if (!ASN1_TIME_diff(&day, &sec, nullptr, at)) + { + Log::Write(Logger::Level::Error, "Could not check expiration"); + return false; /* Safe default, invalid */ + } + + if (day > 0 || sec > 0) + { + return true; /* Later, valid */ + } + return false; /* Before or same, invalid */ + } + + const char* GetDistributionPointUrl(DIST_POINT* dp) + { + GENERAL_NAMES* gens; + GENERAL_NAME* gen; + int i, nameType; + ASN1_STRING* uri; + + if (!dp->distpoint) + { + Log::Write(Logger::Level::Informational, "returning, dp->distpoint is null"); + return nullptr; + } + + if (dp->distpoint->type != 0) + { + Log::Write( + Logger::Level::Informational, + "returning, dp->distpoint->type is " + std::to_string(dp->distpoint->type)); + return nullptr; + } + + gens = dp->distpoint->name.fullname; + + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) + { + gen = sk_GENERAL_NAME_value(gens, i); + uri = static_cast(GENERAL_NAME_get0_value(gen, &nameType)); + + if (nameType == GEN_URI && ASN1_STRING_length(uri) > 6) + { + const char* uptr = reinterpret_cast(ASN1_STRING_get0_data(uri)); + if (strncmp(uptr, "http://", 7) == 0) + { + return uptr; + } + } + } + + return nullptr; + } + + std::mutex crl_cache_lock; + std::vector crl_cache; + + bool SaveCertificateCrlToMemory(X509* cert, _detail::openssl_x509_crl const& crl) + { + std::unique_lock lockResult(crl_cache_lock); + + // update existing + X509_NAME* cert_issuer = cert ? X509_get_issuer_name(cert) : nullptr; + for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) + { + X509_CRL* cacheEntry = *it; + if (!cacheEntry) + { + continue; + } + + X509_NAME* crl_issuer = X509_CRL_get_issuer(cacheEntry); + if (!crl_issuer || !cert_issuer) + { + continue; + } + + // If we are getting a new CRL for an existing CRL, update the + // CRL with the new CRL. + if (0 == X509_NAME_cmp(crl_issuer, cert_issuer)) + { + // Bump the refcount on the new CRL before adding it to the cache. + X509_CRL_free(*it); + X509_CRL_up_ref(crl.get()); + *it = crl.get(); + return true; + } + } + + // not found, so try to find slot by purging outdated + for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) + { + if (!*it) + { + // set new + X509_CRL_free(*it); + X509_CRL_up_ref(crl.get()); + *it = crl.get(); + return true; + } + + if (!IsCrlValid(*it)) + { + // remove stale + X509_CRL_free(*it); + X509_CRL_up_ref(crl.get()); + *it = crl.get(); + return true; + } + } + + // Clone the certificate and add it to the cache. + X509_CRL_up_ref(crl.get()); + crl_cache.push_back(crl.get()); + return true; + } + + _detail::openssl_x509_crl LoadCertificateCrlFromMemory(X509* cert) + { + X509_NAME* cert_issuer = cert ? X509_get_issuer_name(cert) : nullptr; + + std::unique_lock lockResult(crl_cache_lock); + + for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) + { + X509_CRL* crl = *it; + if (!*it) + { + continue; + } + + // names don't match up. probably a hash collision + // so lets test if there is another crl on disk. + X509_NAME* crl_issuer = X509_CRL_get_issuer(crl); + if (!crl_issuer || !cert_issuer) + { + continue; + } + + if (0 != X509_NAME_cmp(crl_issuer, cert_issuer)) + { + continue; + } + + if (!IsCrlValid(crl)) + { + Log::Write(Logger::Level::Informational, "Discarding outdated CRL"); + X509_CRL_free(*it); + *it = nullptr; + continue; + } + + X509_CRL_up_ref(crl); + return _detail::openssl_x509_crl(crl); + } + return nullptr; + } + + _detail::openssl_x509_crl LoadCrlFromCacheAndDistributionPoint( + X509* cert, + STACK_OF(DIST_POINT) * crlDistributionPointStack) + { + int i; + + _detail::openssl_x509_crl crl = LoadCertificateCrlFromMemory(cert); + if (crl) + { + return crl; + } + + // file was not found on disk cache, + // so, now loading from web. + // Walk through the possible CRL distribution points + // looking for one which has a URL that we can download. + const char* urlptr = nullptr; + for (i = 0; i < sk_DIST_POINT_num(crlDistributionPointStack); i++) + { + DIST_POINT* dp = sk_DIST_POINT_value(crlDistributionPointStack, i); + + urlptr = GetDistributionPointUrl(dp); + if (urlptr) + { + // try to load from web, exit loop if + // successfully downloaded + crl = LoadCrl(urlptr, CrlFormat::Http); + if (crl) + break; + } + } + + if (!urlptr) + { + Log::Write(Logger::Level::Error, "No CRL dist point qualified for downloading."); + } + + if (crl) + { + // save it to memory + SaveCertificateCrlToMemory(cert, crl); + } + + return crl; + } + + /** + * @brief Retrieve the CRL associated with the provided store context, if available. + * + */ + STACK_OF(X509_CRL) * CrlHttpCallback(const X509_STORE_CTX* context, const X509_NAME*) + { + _detail::openssl_x509_crl crl; + STACK_OF(DIST_POINT) * crlDistributionPoint; + + _detail::openssl_x509_crl_stack crlStack + = _detail::openssl_x509_crl_stack(sk_X509_CRL_new_null()); + if (crlStack == nullptr) + { + Log::Write(Logger::Level::Error, "Failed to allocate STACK_OF(X509_CRL)"); + return nullptr; + } + + X509* currentCertificate = X509_STORE_CTX_get_current_cert(context); + + // try to download Crl + crlDistributionPoint = static_cast( + X509_get_ext_d2i(currentCertificate, NID_crl_distribution_points, nullptr, nullptr)); + if (!crlDistributionPoint + && X509_NAME_cmp( + X509_get_issuer_name(currentCertificate), + X509_get_subject_name(currentCertificate)) + != 0) + { + Log::Write( + Logger::Level::Error, + "No CRL distribution points defined on non self-issued cert, CRL check may fail."); + return nullptr; + } + + crl = LoadCrlFromCacheAndDistributionPoint(currentCertificate, crlDistributionPoint); + + sk_DIST_POINT_pop_free(crlDistributionPoint, DIST_POINT_free); + if (!crl) + { + Log::Write(Logger::Level::Error, "Unable to retrieve CRL, CRL check may fail."); + return nullptr; + } + + sk_X509_CRL_push(crlStack.get(), X509_CRL_dup(crl.get())); + + // try to download delta Crl + crlDistributionPoint = static_cast( + X509_get_ext_d2i(currentCertificate, NID_freshest_crl, nullptr, nullptr)); + if (crlDistributionPoint != nullptr) + { + crl = LoadCrlFromCacheAndDistributionPoint(currentCertificate, crlDistributionPoint); + + sk_DIST_POINT_pop_free(crlDistributionPoint, DIST_POINT_free); + if (crl) + { + sk_X509_CRL_push(crlStack.get(), X509_CRL_dup(crl.get())); + } + } + + return crlStack.release(); + } + + int GetOpenSSLContextConnectionIndex() + { + static int openSslConnectionIndex = -1; + if (openSslConnectionIndex < 0) + { + openSslConnectionIndex = X509_STORE_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr); + } + return openSslConnectionIndex; + } + int GetOpenSSLContextLastVerifyFunction() + { + static int openSslLastVerifyFunctionIndex = -1; + if (openSslLastVerifyFunctionIndex < 0) + { + openSslLastVerifyFunctionIndex + = X509_STORE_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr); + } + return openSslLastVerifyFunctionIndex; + } + } // namespace +}}} // namespace Azure::Core::Http + +// OpenSSL X509 Certificate Validation function - based off of the example found at: +// https://linux.die.net/man/3/x509_store_ctx_set_verify_cb +// +int CurlConnection::VerifyCertificateError(int ok, X509_STORE_CTX* storeContext) +{ + X509_STORE* certStore = X509_STORE_CTX_get0_store(storeContext); + X509* err_cert; + int err, depth; + _detail::openssl_bio bio_err(_detail::make_openssl_unique(BIO_new, BIO_s_mem())); + + err_cert = X509_STORE_CTX_get_current_cert(storeContext); + err = X509_STORE_CTX_get_error(storeContext); + depth = X509_STORE_CTX_get_error_depth(storeContext); + + BIO_printf(bio_err.get(), "depth=%d ", depth); + if (err_cert) + { + X509_NAME_print_ex(bio_err.get(), X509_get_subject_name(err_cert), 0, XN_FLAG_ONELINE); + BIO_puts(bio_err.get(), "\n"); + } + else + { + BIO_puts(bio_err.get(), "\n"); + } + if (!ok) + { + BIO_printf(bio_err.get(), "verify error:num=%d: %s\n", err, X509_verify_cert_error_string(err)); + } + + switch (err) + { + case X509_V_ERR_UNABLE_TO_GET_CRL: + BIO_printf(bio_err.get(), "Unable to retrieve CRL."); + break; + } + if (err == X509_V_OK && ok == 2) + { + /* print out policies */ + BIO_printf(bio_err.get(), "verify return:%d\n", ok); + } + + // Handle certificate specific errors here based on configuration options. + { + if (err == X509_V_ERR_UNABLE_TO_GET_CRL) + { + if (m_allowFailedCrlRetrieval) + { + BIO_printf(bio_err.get(), "Ignoring CRL retrieval error by configuration.\n"); + // Clear the X509 error in the store context, because CURL retrieves it, + // and it overwrites the successful result. + X509_STORE_CTX_set_error(storeContext, X509_V_OK); + // Return true, indicating that things are all good. + ok = 1; + } + else + { + BIO_printf( + bio_err.get(), "Fail TLS negotiation because CRL retrieval is not configured.\n"); + } + } + } + + char outputString[128]; + int len; + while ((len = BIO_gets(bio_err.get(), outputString, sizeof(outputString))) >= 0) + { + if (len == 0) + { + break; + } + if (outputString[len - 1] == '\n') + { + outputString[len - 1] = '\0'; + } + Log::Write(Logger::Level::Informational, std::string(outputString)); + } + + if (ok) + { + // We've done our stuff, call the pre-existing callback. + auto existingCallback = reinterpret_cast( + X509_STORE_get_ex_data(certStore, GetOpenSSLContextLastVerifyFunction())); + if (existingCallback != nullptr) + { + ok = existingCallback(ok, storeContext); + } + } + return (ok); +} + +int CurlConnection::CurlSslCtxCallback(CURL* curl, void* sslctx, void* parm) +{ + CurlConnection* connection = static_cast(parm); + return connection->SslCtxCallback(curl, sslctx); +} + +int CurlConnection::SslCtxCallback(CURL*, void* sslctx) +{ + SSL_CTX* ctx = reinterpret_cast(sslctx); + + // Note: SSL_CTX_get_cert_store does NOT increase the store reference count. + X509_STORE* certStore = SSL_CTX_get_cert_store(ctx); + X509_VERIFY_PARAM* verifyParam = X509_STORE_get0_param(certStore); + if (m_enableCrlValidation) + { + + // Store our connection handle in the store extended data so it can be retrieved + // in later callbacks. This allows setting options on a per-connection basis. + X509_STORE_set_ex_data(certStore, GetOpenSSLContextConnectionIndex(), this); + + X509_VERIFY_PARAM_set_flags(verifyParam, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); + X509_STORE_set_lookup_crls_cb(certStore, CrlHttpCallback); + + X509_STORE_set_ex_data( + certStore, + GetOpenSSLContextLastVerifyFunction(), + reinterpret_cast(X509_STORE_get_verify_cb(certStore))); + + X509_STORE_set_verify_cb(certStore, [](int ok, X509_STORE_CTX* storeContext) { + X509_STORE* certStore = X509_STORE_CTX_get0_store(storeContext); + + CurlConnection* thisConnection = reinterpret_cast( + X509_STORE_get_ex_data(certStore, GetOpenSSLContextConnectionIndex())); + + return thisConnection->VerifyCertificateError(ok, storeContext); + }); + } + else + { + X509_VERIFY_PARAM_clear_flags(verifyParam, X509_V_FLAG_CRL_CHECK); + } + return CURLE_OK; +} +#endif std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlConnection( Request& request, @@ -1480,8 +1917,82 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo // Creating a new connection is thread safe. No need to lock mutex here. // No available connection for the pool for the required host. Create one Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Spawn new connection."); - unique_CURL newHandle(curl_easy_init(), CURL_deleter{}); - if (!newHandle) + + return std::make_unique(request, options, hostDisplayName, connectionKey); +} + +// Move the connection back to the connection pool. Push it to the front so it becomes the +// first connection to be picked next time some one ask for a connection to the pool (LIFO) +void CurlConnectionPool::MoveConnectionBackToPool( + std::unique_ptr connection, + HttpStatusCode lastStatusCode) +{ + auto code = static_cast::type>(lastStatusCode); + // laststatusCode = 0 + if (code < 200 || code >= 300) + { + // A handler with previous response with Error can't be re-use. + return; + } + + if (connection->IsShutdown()) + { + // Can't re-used a shut down connection + return; + } + + Log::Write(Logger::Level::Verbose, "Moving connection to pool..."); + + decltype(CurlConnectionPool::g_curlConnectionPool + .ConnectionPoolIndex)::mapped_type::value_type connectionToBeRemoved; + + // Lock mutex to access connection pool. mutex is unlock as soon as lock is out of scope + std::unique_lock lock(CurlConnectionPool::ConnectionPoolMutex); + auto& poolId = connection->GetConnectionKey(); + auto& hostPool = g_curlConnectionPool.ConnectionPoolIndex[poolId]; + + if (hostPool.size() >= _detail::MaxConnectionsPerIndex && !hostPool.empty()) + { + // Remove the last connection from the pool to insert this one. + auto lastConnection = --hostPool.end(); + connectionToBeRemoved = std::move(*lastConnection); + hostPool.erase(lastConnection); + } + + // update the time when connection was moved back to pool + connection->UpdateLastUsageTime(); + hostPool.push_front(std::move(connection)); + + if (m_cleanThread.joinable() && !IsCleanThreadRunning) + { + // Clean thread was running before but it's finished, join it to finalize + m_cleanThread.join(); + } + + // Cleanup will start a background thread which will close abandoned connections from the pool. + // This will free-up resources from the app + // This is the only call to cleanup. + if (!m_cleanThread.joinable()) + { + Log::Write(Logger::Level::Verbose, "Start clean thread"); + IsCleanThreadRunning = true; + m_cleanThread = std::thread(CleanupThread); + } + else + { + Log::Write(Logger::Level::Verbose, "Clean thread running. Won't start a new one."); + } +} + +CurlConnection::CurlConnection( + Request& request, + CurlTransportOptions const& options, + std::string const& hostDisplayName, + std::string const& connectionPropertiesKey) + : m_connectionKey(std::move(connectionPropertiesKey)) +{ + m_handle = _detail::unique_CURL(curl_easy_init(), _detail::CURL_deleter{}); + if (!m_handle) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " @@ -1491,16 +2002,15 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (options.EnableCurlTracing) { - if (!SetLibcurlOption( - newHandle, CURLOPT_DEBUGFUNCTION, CurlConnectionPool::CurlLoggingCallback, &result)) + m_handle, CURLOPT_DEBUGFUNCTION, CurlConnection::CurlLoggingCallback, &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + std::string(". Could not enable logging callback.") + std::string(curl_easy_strerror(result))); } - if (!SetLibcurlOption(newHandle, CURLOPT_VERBOSE, 1, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_VERBOSE, 1, &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate @@ -1510,31 +2020,32 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo } // Libcurl setup before open connection (url, connect_only, timeout) - if (!SetLibcurlOption(newHandle, CURLOPT_URL, request.GetUrl().GetAbsoluteUrl().data(), &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_URL, request.GetUrl().GetAbsoluteUrl().data(), &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " + std::string(curl_easy_strerror(result))); } - if (port != 0 && !SetLibcurlOption(newHandle, CURLOPT_PORT, port, &result)) + if (request.GetUrl().GetPort() != 0 + && !SetLibcurlOption(m_handle, CURLOPT_PORT, request.GetUrl().GetPort(), &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " + std::string(curl_easy_strerror(result))); } - if (!SetLibcurlOption(newHandle, CURLOPT_CONNECT_ONLY, 1L, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_CONNECT_ONLY, 1L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " + std::string(curl_easy_strerror(result))); } - // Set timeout to 24h. Libcurl will fail uploading on windows if timeout is: + // Set timeout to 24h. Libcurl will fail uploading on windows if timeout is: // timeout >= 25 days. Fails as soon as trying to upload any data // 25 days < timeout > 1 days. Fail on huge uploads ( > 1GB) - if (!SetLibcurlOption(newHandle, CURLOPT_TIMEOUT, 60L * 60L * 24L, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_TIMEOUT, 60L * 60L * 24L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " @@ -1543,7 +2054,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (options.ConnectionTimeout != Azure::Core::Http::_detail::DefaultConnectionTimeout) { - if (!SetLibcurlOption(newHandle, CURLOPT_CONNECTTIMEOUT_MS, options.ConnectionTimeout, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_CONNECTTIMEOUT_MS, options.ConnectionTimeout, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1558,7 +2069,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo */ if (options.Proxy) { - if (!SetLibcurlOption(newHandle, CURLOPT_PROXY, options.Proxy->c_str(), &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_PROXY, options.Proxy->c_str(), &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1569,7 +2080,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (!options.ProxyUsername.empty()) { - if (!SetLibcurlOption(newHandle, CURLOPT_PROXYUSERNAME, options.ProxyUsername.c_str(), &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_PROXYUSERNAME, options.ProxyUsername.c_str(), &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1579,7 +2090,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo } if (!options.ProxyPassword.empty()) { - if (!SetLibcurlOption(newHandle, CURLOPT_PROXYPASSWORD, options.ProxyPassword.c_str(), &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_PROXYPASSWORD, options.ProxyPassword.c_str(), &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1590,7 +2101,23 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (!options.CAInfo.empty()) { - if (!SetLibcurlOption(newHandle, CURLOPT_CAINFO, options.CAInfo.c_str(), &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_CAINFO, options.CAInfo.c_str(), &result)) + { + throw Azure::Core::Http::TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + + ". Failed to set CA cert file to:" + options.CAInfo + ". " + + std::string(curl_easy_strerror(result))); + } + } + + if (!options.SslOptions.PemEncodedExpectedRootCertificates.empty()) + { + curl_blob rootCertBlob + = {const_cast(reinterpret_cast( + options.SslOptions.PemEncodedExpectedRootCertificates.c_str())), + options.SslOptions.PemEncodedExpectedRootCertificates.size(), + CURL_BLOB_COPY}; + if (!SetLibcurlOption(m_handle, CURLOPT_CAINFO_BLOB, &rootCertBlob, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1599,23 +2126,52 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo } } +#if defined(AZ_PLATFORM_WINDOWS) long sslOption = 0; if (!options.SslOptions.EnableCertificateRevocationListCheck) { sslOption |= CURLSSLOPT_NO_REVOKE; } - if (!SetLibcurlOption(newHandle, CURLOPT_SSL_OPTIONS, sslOption, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_SSL_OPTIONS, sslOption, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". Failed to set ssl options to long bitmask:" + std::to_string(sslOption) + ". " + std::string(curl_easy_strerror(result))); } +#elif !defined(AZ_PLATFORM_MAC) + if (options.SslOptions.EnableCertificateRevocationListCheck) + { + if (!SetLibcurlOption( + m_handle, CURLOPT_SSL_CTX_FUNCTION, CurlConnection::CurlSslCtxCallback, &result)) + { + throw TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + + ". Failed to set SSL context callback. " + std::string(curl_easy_strerror(result))); + } + if (!SetLibcurlOption(m_handle, CURLOPT_SSL_CTX_DATA, this, &result)) + { + throw TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + + ". Failed to set SSL context callback data. " + + std::string(curl_easy_strerror(result))); + } + // if (!SetLibcurlOption(m_handle, CURLOPT_SSL_VERIFYSTATUS, 1, &result)) + // { + // throw TransportException( + // _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + // + ". Failed to enable OCSP chaining. " + + // std::string(curl_easy_strerror(result))); + // } + } + m_allowFailedCrlRetrieval = options.SslOptions.AllowFailedCrlRetrieval; +#endif + m_enableCrlValidation = options.SslOptions.EnableCertificateRevocationListCheck; if (!options.SslVerifyPeer) { - if (!SetLibcurlOption(newHandle, CURLOPT_SSL_VERIFYPEER, 0L, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_SSL_VERIFYPEER, 0L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1625,7 +2181,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo if (options.NoSignal) { - if (!SetLibcurlOption(newHandle, CURLOPT_NOSIGNAL, 1L, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_NOSIGNAL, 1L, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName @@ -1637,91 +2193,58 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo // curl-transport adapter supports only HTTP/1.1 // https://github.com/Azure/azure-sdk-for-cpp/issues/2848 // The libcurl uses HTTP/2 by default, if it can be negotiated with a server on handshake. - if (!SetLibcurlOption(newHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1, &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". Failed to set libcurl HTTP/1.1" + ". " + std::string(curl_easy_strerror(result))); } - // Make libcurl to support only TLS v1.2 or later - if (!SetLibcurlOption(newHandle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2, &result)) + // Make libcurl to support only TLS v1.2 or later + if (!SetLibcurlOption(m_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2, &result)) { throw Azure::Core::Http::TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". Failed enforcing TLS v1.2 or greater. " + std::string(curl_easy_strerror(result))); } - auto performResult = curl_easy_perform(newHandle.get()); + auto performResult = curl_easy_perform(m_handle.get()); if (performResult != CURLE_OK) { - throw Http::TransportException( - _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " - + std::string(curl_easy_strerror(performResult))); - } - - return std::make_unique(std::move(newHandle), connectionKey); -} - -// Move the connection back to the connection pool. Push it to the front so it becomes the -// first connection to be picked next time some one ask for a connection to the pool (LIFO) -void CurlConnectionPool::MoveConnectionBackToPool( - std::unique_ptr connection, - HttpStatusCode lastStatusCode) -{ - auto code = static_cast::type>(lastStatusCode); - // laststatusCode = 0 - if (code < 200 || code >= 300) - { - // A handler with previous response with Error can't be re-use. - return; - } - - if (connection->IsShutdown()) - { - // Can't re-used a shut down connection - return; - } - - Log::Write(Logger::Level::Verbose, "Moving connection to pool..."); - - decltype(CurlConnectionPool::g_curlConnectionPool - .ConnectionPoolIndex)::mapped_type::value_type connectionToBeRemoved; - - // Lock mutex to access connection pool. mutex is unlock as soon as lock is out of scope - std::unique_lock lock(CurlConnectionPool::ConnectionPoolMutex); - auto& poolId = connection->GetConnectionKey(); - auto& hostPool = g_curlConnectionPool.ConnectionPoolIndex[poolId]; - - if (hostPool.size() >= _detail::MaxConnectionsPerIndex && !hostPool.empty()) - { - // Remove the last connection from the pool to insert this one. - auto lastConnection = --hostPool.end(); - connectionToBeRemoved = std::move(*lastConnection); - hostPool.erase(lastConnection); - } - - // update the time when connection was moved back to pool - connection->UpdateLastUsageTime(); - hostPool.push_front(std::move(connection)); - - if (m_cleanThread.joinable() && !IsCleanThreadRunning) - { - // Clean thread was running before but it's finished, join it to finalize - m_cleanThread.join(); +#if defined(AZ_PLATFORM_LINUX) + if (performResult == CURLE_SSL_PEER_CERTIFICATE) + { + curl_easy_getinfo(m_handle.get(), CURLINFO_SSL_VERIFYRESULT, &result); + throw Http::TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " + + std::string(curl_easy_strerror(performResult)) + + ". Underlying error: " + X509_verify_cert_error_string(result)); + } + else +#endif + { + throw Http::TransportException( + _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName + ". " + + std::string(curl_easy_strerror(performResult))); + } } - // Cleanup will start a background thread which will close abandoned connections from the pool. - // This will free-up resources from the app - // This is the only call to cleanup. - if (!m_cleanThread.joinable()) - { - Log::Write(Logger::Level::Verbose, "Start clean thread"); - IsCleanThreadRunning = true; - m_cleanThread = std::thread(CleanupThread); - } - else + // Get the socket that libcurl is using from handle. Will use this to wait while + // reading/writing + // into wire +#if defined(_MSC_VER) +#pragma warning(push) +// C26812: The enum type 'CURLcode' is un-scoped. Prefer 'enum class' over 'enum' (Enum.3) +#pragma warning(disable : 26812) +#endif + result = curl_easy_getinfo(m_handle.get(), CURLINFO_ACTIVESOCKET, &m_curlSocket); +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + if (result != CURLE_OK) { - Log::Write(Logger::Level::Verbose, "Clean thread running. Won't start a new one."); + throw Http::TransportException( + "Broken connection. Couldn't get the active sockect for it." + + std::string(curl_easy_strerror(result))); } } diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp index 605136c875..df455984e3 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_pool_private.hpp @@ -120,13 +120,6 @@ namespace Azure { namespace Core { namespace Http { namespace _detail { // private constructor to keep this as singleton. CurlConnectionPool() { curl_global_init(CURL_GLOBAL_ALL); } - static int CurlLoggingCallback( - CURL* handle, - curl_infotype type, - char* data, - size_t size, - void* userp); - // Makes possible to know the number of current connections in the connection pool for an // index size_t ConnectionsOnPool(std::string const& host) { return ConnectionPoolIndex[host].size(); } diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index 705ec2d862..ccf1b217b5 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -10,7 +10,6 @@ #pragma once #include "azure/core/http/http.hpp" - #include #include @@ -26,6 +25,8 @@ #pragma warning(pop) #endif +typedef struct x509_store_ctx_st X509_STORE_CTX; + namespace Azure { namespace Core { namespace Http { namespace _detail { @@ -143,92 +144,88 @@ namespace Azure { namespace Core { namespace Http { curl_socket_t m_curlSocket; std::chrono::steady_clock::time_point m_lastUseTime; std::string m_connectionKey; + // CRL validation is disabled by default to be consistent with WinHTTP behavior + bool m_enableCrlValidation{false}; + // Allow the connection to proceed if retrieving the CRL failed. + bool m_allowFailedCrlRetrieval{true}; + + static int CurlLoggingCallback( + CURL* handle, + curl_infotype type, + char* data, + size_t size, + void* userp); + + static int CurlSslCtxCallback(CURL* curl, void* sslctx, void* parm); + int SslCtxCallback(CURL* curl, void* sslctx); + int VerifyCertificateError(int ok, X509_STORE_CTX* storeContext); public: /** * @brief Construct CURL HTTP connection. * - * @param handle CURL handle. + * @param request Remote request + * @param options Connection options. + * @param hostDisplayName Display name for remote host, used for diagnostics. * * @param connectionPropertiesKey CURL connection properties key */ - CurlConnection(_detail::unique_CURL&& handle, std::string connectionPropertiesKey) - : m_handle(std::move(handle)), m_connectionKey(std::move(connectionPropertiesKey)) - { - // Get the socket that libcurl is using from handle. Will use this to wait while - // reading/writing - // into wire -#if defined(_MSC_VER) -#pragma warning(push) -// C26812: The enum type 'CURLcode' is un-scoped. Prefer 'enum class' over 'enum' (Enum.3) -#pragma warning(disable : 26812) -#endif - auto result = curl_easy_getinfo(m_handle.get(), CURLINFO_ACTIVESOCKET, &m_curlSocket); -#if defined(_MSC_VER) -#pragma warning(pop) -#endif - if (result != CURLE_OK) - { - throw Http::TransportException( - "Broken connection. Couldn't get the active sockect for it." - + std::string(curl_easy_strerror(result))); - } - } + CurlConnection( + Azure::Core::Http::Request& request, + Azure::Core::Http::CurlTransportOptions const& options, + std::string const& hostDisplayName, + std::string const& connectionPropertiesKey); - /** - * @brief Destructor. - * @details Cleans up CURL (invokes `curl_easy_cleanup()`). - */ - ~CurlConnection() override {} + /** + * @brief Destructor. + * @details Cleans up CURL (invokes `curl_easy_cleanup()`). + */ + ~CurlConnection() override {} - std::string const& GetConnectionKey() const override { return this->m_connectionKey; } + std::string const& GetConnectionKey() const override { return this->m_connectionKey; } - /** - * @brief Update last usage time for the connection. - * - */ - void UpdateLastUsageTime() override - { - this->m_lastUseTime = std::chrono::steady_clock::now(); - } + /** + * @brief Update last usage time for the connection. + * + */ + void UpdateLastUsageTime() override { this->m_lastUseTime = std::chrono::steady_clock::now(); } - /** - * @brief Checks whether this CURL connection is expired. - * @return `true` if this connection is considered expired; otherwise, `false`. - */ - bool IsExpired() override - { - auto connectionOnWaitingTimeMs = std::chrono::duration_cast( - std::chrono::steady_clock::now() - this->m_lastUseTime); - return connectionOnWaitingTimeMs.count() >= _detail::DefaultConnectionExpiredMilliseconds; - } + /** + * @brief Checks whether this CURL connection is expired. + * @return `true` if this connection is considered expired; otherwise, `false`. + */ + bool IsExpired() override + { + auto connectionOnWaitingTimeMs = std::chrono::duration_cast( + std::chrono::steady_clock::now() - this->m_lastUseTime); + return connectionOnWaitingTimeMs.count() >= _detail::DefaultConnectionExpiredMilliseconds; + } - /** - * @brief This function is used when working with streams to pull more data from the wire. - * Function will try to keep pulling data from socket until the buffer is all written or until - * there is no more data to get from the socket. - * - * @param context A context to control the request lifetime. - * @param buffer ptr to buffer where to copy bytes from socket. - * @param bufferSize size of the buffer and the requested bytes to be pulled from wire. - * @return return the numbers of bytes pulled from socket. It can be less than what it was - * requested. - */ - size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) override; - - /** - * @brief This method will use libcurl socket to write all the bytes from buffer. - * - * @remarks Hardcoded timeout is used in case a socket stop responding. - * - * @param context A context to control the request lifetime. - * @param buffer ptr to the data to be sent to wire. - * @param bufferSize size of the buffer to send. - * @return CURL_OK when response is sent successfully. - */ - CURLcode SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) - override; - - void Shutdown() override; - }; + /** + * @brief This function is used when working with streams to pull more data from the wire. + * Function will try to keep pulling data from socket until the buffer is all written or until + * there is no more data to get from the socket. + * + * @param context A context to control the request lifetime. + * @param buffer ptr to buffer where to copy bytes from socket. + * @param bufferSize size of the buffer and the requested bytes to be pulled from wire. + * @return return the numbers of bytes pulled from socket. It can be less than what it was + * requested. + */ + size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) override; + + /** + * @brief This method will use libcurl socket to write all the bytes from buffer. + * + * @remarks Hardcoded timeout is used in case a socket stop responding. + * + * @param context A context to control the request lifetime. + * @param buffer ptr to the data to be sent to wire. + * @param bufferSize size of the buffer to send. + * @return CURL_OK when response is sent successfully. + */ + CURLcode SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) override; + + void Shutdown() override; + }; }}} // namespace Azure::Core::Http diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index 6f73124f49..f2d9e4eec8 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: MIT #include "azure/core/http/policies/policy.hpp" +#include "azure/core/platform.hpp" #if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) #include "azure/core/http/curl_transport.hpp" @@ -11,6 +12,9 @@ #include "azure/core/http/win_http_transport.hpp" #endif +#include +#include + using Azure::Core::Context; using namespace Azure::Core::IO; using namespace Azure::Core::Http; @@ -21,12 +25,31 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa namespace { bool AnyTransportOptionsSpecified(TransportOptions const& transportOptions) { - return !( - !transportOptions.HttpProxy.HasValue() && transportOptions.ProxyPassword.empty() - && transportOptions.ProxyUserName.empty()); + return ( + transportOptions.HttpProxy.HasValue() || !transportOptions.ProxyPassword.empty() + || !transportOptions.ProxyUserName.empty() + || transportOptions.EnableCertificateRevocationListCheck + || !transportOptions.ExpectedTlsRootCertificate.empty()); + } + + std::string PemEncodeFromBase64(std::string const& base64, std::string const& pemType) + { + std::stringstream rv; + rv << "-----BEGIN " << pemType << "-----" << std::endl; + std::string encodedValue(base64); + + // Insert crlf characters every 80 characters into the base64 encoded key to make it + // prettier. + size_t insertPos = 80; + while (insertPos < encodedValue.length()) + { + encodedValue.insert(insertPos, "\r\n"); + insertPos += 82; /* 80 characters plus the \r\n we just inserted */ + } + + rv << encodedValue << std::endl << "-----END " << pemType << "-----" << std::endl; + return rv.str(); } - // std::once_flag createTransportOnce; - // std::shared_ptr defaultTransport; } // namespace std::shared_ptr GetTransportAdapter(TransportOptions const& transportOptions) @@ -56,6 +79,24 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa } httpOptions.ProxyUserName = transportOptions.ProxyUserName; httpOptions.ProxyPassword = transportOptions.ProxyPassword; + // Note that WinHTTP accepts a set of root certificates, even though transportOptions only + // specifies a single one. + if (!transportOptions.ExpectedTlsRootCertificate.empty()) + { + httpOptions.ExpectedTlsRootCertificates.push_back( + transportOptions.ExpectedTlsRootCertificate); + } + if (transportOptions.EnableCertificateRevocationListCheck) + { + httpOptions.EnableCertificateRevocationListCheck; + } + // If you specify an expected TLS root certificate, you also need to enable ignoring unknown + // CAs. + if (!transportOptions.ExpectedTlsRootCertificate.empty()) + { + httpOptions.IgnoreUnknownCertificateAuthority; + } + return std::make_shared(httpOptions); } else @@ -83,6 +124,16 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa { curlOptions.ProxyPassword = transportOptions.ProxyPassword; } + + curlOptions.SslOptions.EnableCertificateRevocationListCheck + = transportOptions.EnableCertificateRevocationListCheck; + + if (!transportOptions.ExpectedTlsRootCertificate.empty()) + { + curlOptions.SslOptions.PemEncodedExpectedRootCertificates + = PemEncodeFromBase64(transportOptions.ExpectedTlsRootCertificate, "CERTIFICATE"); + } + return std::make_shared(curlOptions); } return defaultTransport; diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index d5ec6f559b..feadd948b2 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -1,8 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT +// cspell:words HCERTIFICATECHAIN PCCERT CCERT HCERTCHAINENGINE HCERTSTORE #include "azure/core/http/http.hpp" +#include "azure/core/base64.hpp" +#include "azure/core/diagnostics/logger.hpp" +#include "azure/core/internal/diagnostics/log.hpp" #include "azure/core/internal/strings.hpp" #if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) @@ -11,11 +15,15 @@ #include #include +#include #include +#include #include using Azure::Core::Context; using namespace Azure::Core::Http; +using namespace Azure::Core::Diagnostics; +using namespace Azure::Core::Diagnostics::_internal; namespace { @@ -196,9 +204,217 @@ std::string GetHeadersAsString(Azure::Core::Http::Request const& request) return requestHeaderString; } - } // namespace +// For each certificate specified in trustedCertificate, add to certificateStore. +bool WinHttpTransport::AddCertificatesToStore( + std::vector const& trustedCertificates, + _detail::unique_HCERTSTORE const& certificateStore) +{ + for (auto const& trustedCertificate : trustedCertificates) + { + auto derCertificate = Azure::Core::Convert::Base64Decode(trustedCertificate); + + if (!CertAddEncodedCertificateToStore( + certificateStore.get(), + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + derCertificate.data(), + static_cast(derCertificate.size()), + CERT_STORE_ADD_NEW, + NULL)) + { + GetErrorAndThrow("CertAddEncodedCertificateToStore failed"); + } + } + return true; +} + +// VerifyCertificateInChain determines whether the certificate in serverCertificate +// chains up to the PEM represented by trustedCertificate or not. +bool WinHttpTransport::VerifyCertificatesInChain( + std::vector const& trustedCertificates, + _detail::unique_PCCERT_CONTEXT const& serverCertificate) +{ + if ((trustedCertificates.empty()) || !serverCertificate) + { + return false; + } + + // Creates an in-memory certificate store that is destroyed at end of this function. + _detail::unique_HCERTSTORE certificateStore(CertOpenStore( + CERT_STORE_PROV_MEMORY, + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + 0, + CERT_STORE_CREATE_NEW_FLAG, + nullptr)); + if (!certificateStore) + { + GetErrorAndThrow("CertOpenStore failed"); + } + + // Add the trusted certificates to that store. + if (!AddCertificatesToStore(trustedCertificates, certificateStore)) + { + Log::Write(Logger::Level::Error, "Cannot add certificates to store"); + return false; + } + + _detail::unique_HCERTCHAINENGINE certificateChainEngine; + { + CERT_CHAIN_ENGINE_CONFIG EngineConfig{}; + EngineConfig.cbSize = sizeof(EngineConfig); + EngineConfig.dwFlags = CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE | CERT_CHAIN_ENABLE_SHARE_STORE; + EngineConfig.hExclusiveRoot = certificateStore.get(); + + HCERTCHAINENGINE engineHandle; + if (!CertCreateCertificateChainEngine(&EngineConfig, &engineHandle)) + { + GetErrorAndThrow("CertCreateCertificateChainEngine failed"); + } + certificateChainEngine.reset(engineHandle); + } + + // Generate a certificate chain using the local chain engine and the certificate store containing + // the trusted certificates. + _detail::unique_CCERT_CHAIN_CONTEXT chainContextToVerify; + { + CERT_CHAIN_PARA ChainPara{}; + ChainPara.cbSize = sizeof(ChainPara); + PCCERT_CHAIN_CONTEXT chainContext; + if (!CertGetCertificateChain( + certificateChainEngine.get(), + serverCertificate.get(), + nullptr, + certificateStore.get(), + &ChainPara, + 0, + nullptr, + &chainContext)) + { + GetErrorAndThrow("CertGetCertificateChain failed"); + } + chainContextToVerify.reset(chainContext); + } + + // And make sure that the certificate chain which was created matches the SSL chain. + { + CERT_CHAIN_POLICY_PARA PolicyPara{}; + PolicyPara.cbSize = sizeof(PolicyPara); + + CERT_CHAIN_POLICY_STATUS PolicyStatus{}; + PolicyStatus.cbSize = sizeof(PolicyStatus); + + if (!CertVerifyCertificateChainPolicy( + CERT_CHAIN_POLICY_SSL, chainContextToVerify.get(), &PolicyPara, &PolicyStatus)) + { + GetErrorAndThrow("CertVerifyCertificateChainPolicy"); + } + if (PolicyStatus.dwError != 0) + { + Log::Write( + Logger::Level::Error, + "CertVerifyCertificateChainPolicy sets certificateStatus " + + std::to_string(PolicyStatus.dwError)); + return false; + } + } + return true; +} + +/** + * Called by WinHTTP when sending a request to the server. This callback allows us to inspect the + * TLS certificate before sending it to the server. + */ +void WinHttpTransport::StatusCallback( + HINTERNET hInternet, + DWORD_PTR dwContext, + DWORD dwInternetStatus, + LPVOID, + DWORD) noexcept +{ + // If we're called before our context has been set (on Open and Close callbacks), ignore the + // status callback. + if (dwContext == 0) + { + return; + } + + try + { + WinHttpTransport* httpTransport = reinterpret_cast(dwContext); + httpTransport->OnHttpStatusOperation(hInternet, dwInternetStatus); + } + catch (Azure::Core::RequestFailedException& rfe) + { + // If an exception is thrown in the handler, log the error and terminate the connection. + Log::Write( + Logger::Level::Error, + "Request Failed Exception Thrown: " + std::string(rfe.what()) + rfe.Message); + WinHttpCloseHandle(hInternet); + } + catch (std::exception& ex) + { + // If an exception is thrown in the handler, log the error and terminate the connection. + Log::Write(Logger::Level::Error, "Exception Thrown: " + std::string(ex.what())); + } +} + +/** + * @brief HTTP Callback to enable private certificate checks. + * + * This method is called by WinHTTP when a certificate is received. This method is called multiple + * times based on the state of the TLS connection. We are only interested in + * WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, which is called during the TLS handshake. + * + * When called, we verify that the certificate chain sent from the server contains the certificate + * the HTTP client was configured with. If it is, we accept the connection, if it is not, + * we abort the connection, closing the incoming request handle. + */ +void WinHttpTransport::OnHttpStatusOperation(HINTERNET hInternet, DWORD dwInternetStatus) +{ + if (dwInternetStatus != WINHTTP_CALLBACK_STATUS_SENDING_REQUEST) + { + if (dwInternetStatus == WINHTTP_CALLBACK_STATUS_SECURE_FAILURE) + { + Log::Write(Logger::Level::Error, "Security failure. :("); + } + // Silently ignore if there's any statuses we get that we can't handle + return; + } + + // We will only set the Status callback if a root certificate has been set. + AZURE_ASSERT(!m_options.ExpectedTlsRootCertificates.empty()); + + // Ask WinHTTP for the server certificate - this won't be valid outside a status callback. + _detail::unique_PCCERT_CONTEXT serverCertificate; + { + PCCERT_CONTEXT certContext; + DWORD bufferLength = sizeof(certContext); + if (!WinHttpQueryOption( + hInternet, + WINHTTP_OPTION_SERVER_CERT_CONTEXT, + reinterpret_cast(&certContext), + &bufferLength)) + { + GetErrorAndThrow("Could not retrieve TLS server certificate."); + } + serverCertificate.reset(certContext); + } + + if (!VerifyCertificatesInChain(m_options.ExpectedTlsRootCertificates, serverCertificate)) + { + Log::Write(Logger::Level::Error, "Server certificate is not trusted. Aborting HTTP request"); + + // To signal to caller that the request is to be terminated, the callback closes the handle. + // This ensures that no message is sent to the server. + WinHttpCloseHandle(hInternet); + + // To avoid a double free of this handle record that we've + // already closed the handle. + m_requestHandleClosed = true; + } +} + void WinHttpTransport::GetErrorAndThrow(const std::string& exceptionMessage, DWORD error) { std::string errorMessage = exceptionMessage + " Error Code: " + std::to_string(error); @@ -277,6 +493,21 @@ _detail::unique_HINTERNET WinHttpTransport::CreateSessionHandle() GetErrorAndThrow("Error while enforcing TLS 1.2 for connection request."); } + if (!m_options.ExpectedTlsRootCertificates.empty()) + { + + // Set the callback function to be called when a server certificate is received. + if (WinHttpSetStatusCallback( + sessionHandle.get(), + &WinHttpTransport::StatusCallback, + WINHTTP_CALLBACK_FLAG_SEND_REQUEST /* WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS*/, + 0) + == WINHTTP_INVALID_STATUS_CALLBACK) + { + GetErrorAndThrow("Error while setting up the status callback."); + } + } + return sessionHandle; } @@ -396,7 +627,7 @@ _detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( } } - if (m_options.IgnoreUnknownCertificateAuthority) + if (m_options.IgnoreUnknownCertificateAuthority || !m_options.ExpectedTlsRootCertificates.empty()) { auto option = SECURITY_FLAG_IGNORE_UNKNOWN_CA; if (!WinHttpSetOption(request.get(), WINHTTP_OPTION_SECURITY_FLAGS, &option, sizeof(option))) @@ -405,6 +636,15 @@ _detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( } } + if (m_options.EnableCertificateRevocationListCheck) + { + DWORD value = WINHTTP_ENABLE_SSL_REVOCATION; + if (!WinHttpSetOption(request.get(), WINHTTP_OPTION_ENABLE_FEATURE, &value, sizeof(value))) + { + GetErrorAndThrow("Error while enabling CRL validation."); + } + } + // If we are supporting WebSockets, then let WinHTTP know that it should // prepare to upgrade the HttpRequest to a WebSocket. #pragma warning(push) @@ -491,7 +731,7 @@ void WinHttpTransport::SendRequest( WINHTTP_NO_REQUEST_DATA, 0, streamLength > 0 ? static_cast(streamLength) : 0, - 0)) + reinterpret_cast(this))) { // Errors include: // ERROR_WINHTTP_CANNOT_CONNECT @@ -729,8 +969,22 @@ std::unique_ptr WinHttpTransport::Send(Request& request, Context co _detail::unique_HINTERNET connectionHandle = CreateConnectionHandle(request.GetUrl(), context); _detail::unique_HINTERNET requestHandle = CreateRequestHandle(connectionHandle, request.GetUrl(), request.GetMethod()); + try + { + SendRequest(requestHandle, request, context); + } + catch (TransportException&) + { + // If there was a TLS validation error, then we will have closed the request handle + // during the TLS validation callback. So if an exception was thrown, if we force closed the + // request handle, clear the handle in the requestHandle to prevent a double free. + if (m_requestHandleClosed) + { + requestHandle.release(); + } - SendRequest(requestHandle, request, context); + throw; + } ReceiveResponse(requestHandle, context); diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index db39d8f34b..610962a11c 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -33,6 +33,11 @@ endif() include(GoogleTest) +if (NOT WIN32) +find_package(OpenSSL REQUIRED) +SET(OPENSSLCRYPTO OpenSSL::Crypto) +endif() + add_executable ( azure-core-test azure_core_test.cpp @@ -119,7 +124,7 @@ add_custom_command(TARGET azure-core-test POST_BUILD # Adding private headers from CORE to the tests so we can test the private APIs with no relative paths include. target_include_directories (azure-core-test PRIVATE $) -target_link_libraries(azure-core-test PRIVATE azure-core gtest gmock) +target_link_libraries(azure-core-test PRIVATE azure-core gtest gmock ${OPENSSLCRYPTO}) create_map_file(azure-core-test azure-core-test.map) diff --git a/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp b/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp index 5c5d8cb126..94dc7fa1ad 100644 --- a/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp +++ b/sdk/core/azure-core/test/ut/curl_connection_pool_test.cpp @@ -55,7 +55,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(AzureSdkHttpbinServer::Get())); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ",0,0,0,0,1,1,0,0")); + AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ",0,0,0,0,1,1,0,0,0,0")); { // Creating a new connection with default options @@ -124,7 +124,7 @@ namespace Azure { namespace Core { namespace Test { // Now test that using a different connection config won't re-use the same connection std::string const secondExpectedKey = AzureSdkHttpbinServer::Schema() + "://" - + AzureSdkHttpbinServer::Host() + ",0,0,0,0,1,0,0,200000"; + + AzureSdkHttpbinServer::Host() + ",0,0,0,0,1,0,0,0,0,200000"; { // Creating a new connection with options Azure::Core::Http::CurlTransportOptions options; @@ -433,7 +433,9 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(authority)); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ",0,0,0,0,1,1,0,0")); + AzureSdkHttpbinServer::Schema(), + AzureSdkHttpbinServer::Host(), + ",0,0,0,0,1,1,0,0,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool @@ -471,7 +473,7 @@ namespace Azure { namespace Core { namespace Test { std::string const expectedConnectionKey(CreateConnectionKey( AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), - ":443,0,0,0,0,1,1,0,0")); + ":443,0,0,0,0,1,1,0,0,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool @@ -508,7 +510,9 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::Request req( Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(authority)); std::string const expectedConnectionKey(CreateConnectionKey( - AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), ",0,0,0,0,1,1,0,0")); + AzureSdkHttpbinServer::Schema(), + AzureSdkHttpbinServer::Host(), + ",0,0,0,0,1,1,0,0,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool @@ -545,7 +549,7 @@ namespace Azure { namespace Core { namespace Test { std::string const expectedConnectionKey(CreateConnectionKey( AzureSdkHttpbinServer::Schema(), AzureSdkHttpbinServer::Host(), - ":443,0,0,0,0,1,1,0,0")); + ":443,0,0,0,0,1,1,0,0,0,0")); // Creating a new connection with default options auto connection = Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool diff --git a/sdk/core/azure-core/test/ut/curl_options_test.cpp b/sdk/core/azure-core/test/ut/curl_options_test.cpp index 75fb899292..c8dc62238c 100644 --- a/sdk/core/azure-core/test/ut/curl_options_test.cpp +++ b/sdk/core/azure-core/test/ut/curl_options_test.cpp @@ -78,13 +78,16 @@ namespace Azure { namespace Core { namespace Test { std::unique_ptr response; EXPECT_NO_THROW(response = pipeline.Send(request, Azure::Core::Context::ApplicationContext)); - auto responseCode = response->GetStatusCode(); - int expectedCode = 200; - EXPECT_PRED2( - [](int expected, int code) { return expected == code; }, - expectedCode, - static_cast::type>( - responseCode)); + if (response) + { + auto responseCode = response->GetStatusCode(); + int expectedCode = 200; + EXPECT_PRED2( + [](int expected, int code) { return expected == code; }, + expectedCode, + static_cast::type>( + responseCode)); + } // Clean the connection from the pool *Windows fails to clean if we leave to be clean upon // app-destruction diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp index eda51ba327..398f40f3c2 100644 --- a/sdk/core/azure-core/test/ut/transport_policy_options.cpp +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -4,6 +4,7 @@ #include "azure/core/context.hpp" #include "azure/core/http/curl_transport.hpp" #include "azure/core/http/policies/policy.hpp" +#include "azure/core/internal/client_options.hpp" #include "azure/core/internal/environment.hpp" #include "azure/core/internal/http/pipeline.hpp" #include "azure/core/internal/json/json.hpp" @@ -14,7 +15,8 @@ #include #include -#if !defined(DISABLE_PROXY_TESTS) +using namespace std::chrono_literals; + namespace Azure { namespace Core { namespace Test { namespace { constexpr static const char AzureSdkHttpbinServerSchema[] = "https"; @@ -90,33 +92,8 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::HttpStatusCode code, Azure::Core::Http::HttpStatusCode expectedCode = Azure::Core::Http::HttpStatusCode::Ok); - std::string HttpProxyServer() - { - std::string anonymousServer{ - Azure::Core::_internal::Environment::GetVariable("ANONYMOUSCONTAINERIPV4ADDRESS")}; - GTEST_LOG_(INFO) << "Anonymous server: " << anonymousServer; - if (anonymousServer.empty()) - { - GTEST_LOG_(ERROR) - << "Could not find value for ANONYMOUSCONTAINERIPV4ADDRESS, Assuming local."; - anonymousServer = "127.0.0.1"; - } - - return "http://" + anonymousServer + ":3128"; - } - std::string HttpProxyServerWithPassword() - { - std::string authenticatedServer{ - Azure::Core::_internal::Environment::GetVariable("AUTHENTICATEDCONTAINERIPV4ADDRESS")}; - GTEST_LOG_(INFO) << "Authenticated server: " << authenticatedServer; - if (authenticatedServer.empty()) - { - GTEST_LOG_(ERROR) - << "Could not find value for AUTHENTICATEDCONTAINERIPV4ADDRESS, Assuming local."; - authenticatedServer = "127.0.0.1"; - } - return "http://" + authenticatedServer + ":3129"; - } + std::string HttpProxyServer() { return "http://127.0.0.1:3128"; } + std::string HttpProxyServerWithPassword() { return "http://127.0.0.1:3129"; } protected: // Create @@ -247,6 +224,7 @@ namespace Azure { namespace Core { namespace Test { using namespace Azure::Core::Http::_internal; using namespace Azure::Core::Http::Policies::_internal; +#if !defined(DISABLE_PROXY_TESTS) // constexpr char SocksProxyServer[] = "socks://98.162.96.41:4145"; TEST_F(TransportAdapterOptions, SimpleProxyTests) { @@ -377,5 +355,484 @@ namespace Azure { namespace Core { namespace Test { CheckBodyFromBuffer(*response, expectedResponseBodySize); } } -}}} // namespace Azure::Core::Test + #endif // defined(DISABLE_PROXY_TESTS) + + TEST_F(TransportAdapterOptions, DisableCrlValidation) + { + Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); + // Azure::Core::Url testUrl("https://www.microsoft.com/"); + // HTTP Connections. + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // Note that the default is to *disable* CRL checks, because they are disabled + // by default. So we test *enabling* CRL validation checks. + transportOptions.EnableCertificateRevocationListCheck = true; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); + } +#if !defined(DISABLE_PROXY_TESTS) + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + transportOptions.HttpProxy = HttpProxyServerWithPassword(); + transportOptions.ProxyUserName = "user"; + transportOptions.ProxyPassword = "password"; + // Disable CA checks on proxy pipelines too. + transportOptions.EnableCertificateRevocationListCheck = true; + + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + checkResponseCode(response->GetStatusCode()); + auto expectedResponseBodySize = std::stoull(response->GetHeaders().at("content-length")); + CheckBodyFromBuffer(*response, expectedResponseBodySize); + } +#endif + } + + TEST_F(TransportAdapterOptions, CheckFailedCrlValidation) + { + // By default, for the Windows and Mac platforms, Curl uses + // SCHANNEL/SECTRANSP for CRL validation. Those SSL protocols + // don't have the same behaviors as OpenSSL does. +#if !defined(AZ_PLATFORM_WINDOWS) && !defined(AZ_PLATFORM_MAC) + // Azure::Core::Url + // testUrl("https://github.com/Azure/azure-sdk-for-cpp/blob/main/README.md"); + Azure::Core::Url testUrl("https://www.wikipedia.org"); + // For , github URLs work just fine if CRL validation is off, but if enabled, + // they fail. Let's use that fact to verify that CRL validation causes github + // URLs to fail. + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // Note that the default is to *disable* CRL checks, because they are disabled + // by default. So we test *enabling* CRL validation checks. + transportOptions.EnableCertificateRevocationListCheck = false; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + { + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); + } + } + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // Note that the default is to *disable* CRL checks, because they are disabled + // by default. So we test *enabling* CRL validation checks. + transportOptions.EnableCertificateRevocationListCheck = true; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + { + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + EXPECT_THROW( + pipeline.Send(request, Azure::Core::Context::ApplicationContext), + Azure::Core::Http::TransportException); + } + } + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // Note that the default is to *disable* CRL checks, because they are disabled + // by default. So we test *enabling* CRL validation checks. + // + // Retrieving the test URL should succeed if we allow failed CRL retrieval because + // the certificate for the test URL doesn't contain a CRL distribution points extension, + // and by default there is no platform CRL present. + Azure::Core::Http::CurlTransportOptions curlOptions; + curlOptions.SslOptions.AllowFailedCrlRetrieval = true; + curlOptions.SslOptions.EnableCertificateRevocationListCheck = true; + transportOptions.Transport = std::make_shared(curlOptions); + + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + { + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, testUrl); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); + } + } +#endif + } + + TEST_F(TransportAdapterOptions, MultipleCrlOperations) + { + std::vector testUrls{ + AzureSdkHttpbinServer::Get(), + "https://www.microsoft.com/", + "https://www.example.com/", + "https://www.google.com/", + }; + + GTEST_LOG_(INFO) << "Basic test calls."; + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // FIrst verify connectivity to the test servers. + transportOptions.EnableCertificateRevocationListCheck = false; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + for (auto const& target : testUrls) + { + GTEST_LOG_(INFO) << "Test " << target; + Azure::Core::Url url(target); + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url); + std::unique_ptr response; + EXPECT_NO_THROW( + response = pipeline.Send(request, Azure::Core::Context::ApplicationContext)); + if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found) + { + EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); + } + } + } + + // Now verify that once we enable CRL checks, we can still access the URLs. + GTEST_LOG_(INFO) << "Test with CRL checks enabled"; + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // Note that the default is to *disable* CRL checks, because they are disabled + // by default. So we test *enabling* CRL validation checks. + transportOptions.EnableCertificateRevocationListCheck = true; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + for (auto const& target : testUrls) + { + GTEST_LOG_(INFO) << "Test " << target; + Azure::Core::Url url(target); + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url); + std::unique_ptr response; + EXPECT_NO_THROW( + response = pipeline.Send(request, Azure::Core::Context::ApplicationContext)); + if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found) + { + EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); + } + } + } + + // Now verify that once we enable CRL checks, we can still access the URLs. + GTEST_LOG_(INFO) << "Test with CRL checks enabled. Iteration 2."; + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // Note that the default is to *disable* CRL checks, because they are disabled + // by default. So we test *enabling* CRL validation checks. + transportOptions.EnableCertificateRevocationListCheck = true; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + for (auto const& target : testUrls) + { + GTEST_LOG_(INFO) << "Test " << target; + Azure::Core::Url url(target); + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url); + std::unique_ptr response; + EXPECT_NO_THROW( + response = pipeline.Send(request, Azure::Core::Context::ApplicationContext)); + if (response && response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::Found) + { + EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); + } + } + } + } + + TEST_F(TransportAdapterOptions, TestRootCertificate) + { + // On Windows and OSX, setting a root certificate disables the default system certificate + // store. That means that if we set the expected certificate, we won't be able to connect to + // the server because the certificates root CA is not in the store. +#if defined(AZ_PLATFORM_LINUX) + // cspell:disable + std::string azurewebsitesCertificate + = "MIIF8zCCBNugAwIBAgIQCq+mxcpjxFFB6jvh98dTFzANBgkqhkiG9w0BAQwFADBh" + "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3" + "d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH" + "MjAeFw0yMDA3MjkxMjMwMDBaFw0yNDA2MjcyMzU5NTlaMFkxCzAJBgNVBAYTAlVT" + "MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKjAoBgNVBAMTIU1pY3Jv" + "c29mdCBBenVyZSBUTFMgSXNzdWluZyBDQSAwMTCCAiIwDQYJKoZIhvcNAQEBBQAD" + "ggIPADCCAgoCggIBAMedcDrkXufP7pxVm1FHLDNA9IjwHaMoaY8arqqZ4Gff4xyr" + "RygnavXL7g12MPAx8Q6Dd9hfBzrfWxkF0Br2wIvlvkzW01naNVSkHp+OS3hL3W6n" + "l/jYvZnVeJXjtsKYcXIf/6WtspcF5awlQ9LZJcjwaH7KoZuK+THpXCMtzD8XNVdm" + "GW/JI0C/7U/E7evXn9XDio8SYkGSM63aLO5BtLCv092+1d4GGBSQYolRq+7Pd1kR" + "EkWBPm0ywZ2Vb8GIS5DLrjelEkBnKCyy3B0yQud9dpVsiUeE7F5sY8Me96WVxQcb" + "OyYdEY/j/9UpDlOG+vA+YgOvBhkKEjiqygVpP8EZoMMijephzg43b5Qi9r5UrvYo" + "o19oR/8pf4HJNDPF0/FJwFVMW8PmCBLGstin3NE1+NeWTkGt0TzpHjgKyfaDP2tO" + "4bCk1G7pP2kDFT7SYfc8xbgCkFQ2UCEXsaH/f5YmpLn4YPiNFCeeIida7xnfTvc4" + "7IxyVccHHq1FzGygOqemrxEETKh8hvDR6eBdrBwmCHVgZrnAqnn93JtGyPLi6+cj" + "WGVGtMZHwzVvX1HvSFG771sskcEjJxiQNQDQRWHEh3NxvNb7kFlAXnVdRkkvhjpR" + "GchFhTAzqmwltdWhWDEyCMKC2x/mSZvZtlZGY+g37Y72qHzidwtyW7rBetZJAgMB" + "AAGjggGtMIIBqTAdBgNVHQ4EFgQUDyBd16FXlduSzyvQx8J3BM5ygHYwHwYDVR0j" + "BBgwFoAUTiJUIBiV5uNu5g/6+rkS7QYXjzkwDgYDVR0PAQH/BAQDAgGGMB0GA1Ud" + "JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMHYG" + "CCsGAQUFBwEBBGowaDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQu" + "Y29tMEAGCCsGAQUFBzAChjRodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGln" + "aUNlcnRHbG9iYWxSb290RzIuY3J0MHsGA1UdHwR0MHIwN6A1oDOGMWh0dHA6Ly9j" + "cmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RHMi5jcmwwN6A1oDOG" + "MWh0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RHMi5j" + "cmwwHQYDVR0gBBYwFDAIBgZngQwBAgEwCAYGZ4EMAQICMBAGCSsGAQQBgjcVAQQD" + "AgEAMA0GCSqGSIb3DQEBDAUAA4IBAQAlFvNh7QgXVLAZSsNR2XRmIn9iS8OHFCBA" + "WxKJoi8YYQafpMTkMqeuzoL3HWb1pYEipsDkhiMnrpfeYZEA7Lz7yqEEtfgHcEBs" + "K9KcStQGGZRfmWU07hPXHnFz+5gTXqzCE2PBMlRgVUYJiA25mJPXfB00gDvGhtYa" + "+mENwM9Bq1B9YYLyLjRtUz8cyGsdyTIG/bBM/Q9jcV8JGqMU/UjAdh1pFyTnnHEl" + "Y59Npi7F87ZqYYJEHJM2LGD+le8VsHjgeWX2CJQko7klXvcizuZvUEDTjHaQcs2J" + "+kPgfyMIOY1DMJ21NxOJ2xPRC/wAh/hzSBRVtoAnyuxtkZ4VjIOh"; + // cspell:enable + + { + Azure::Core::Http::Policies::TransportOptions transportOptions; + + // Note that the default is to *disable* CRL checks, because they are disabled + // by default. So we test *enabling* CRL validation checks. + transportOptions.ExpectedTlsRootCertificate = azurewebsitesCertificate; + HttpPipeline pipeline(CreateHttpPipeline(transportOptions)); + + Azure::Core::Url url(AzureSdkHttpbinServer::Get()); + auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, url); + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); + } +#endif + } + + const std::string TestProxyHttpsCertificate = + // cspell:disable + "MIIDSDCCAjCgAwIBAgIUIoKu8Oao7j10TLNxaUG2Bs0FrRwwDQYJKoZIhvcNAQEL" + "BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIyMDgwNTIxMTcyM1oXDTIzMDgw" + "NTIxMTcyM1owFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF" + "AAOCAQ8AMIIBCgKCAQEA0UPG7ER++5/9D/qa4SCtt7QvdHwcpidbwktPNU8iRW7V" + "pIDPWS4goLp/+7+maT0Z/mqwSO3JDtm/dtdlr3F/5EMgyUExnYcvUixZAiyFyEwj" + "j6wnAtNvqsg4rDqBlD17fuqTVsZm9Yo7QYub6p5PeznWYucOxRrczqFCiW4uj0Yk" + "GgUHPPmCvhSDKowV8CYRHfkD6R8R4SFkoP3/uejXHxeXoYJNMWq5K0GqGaOZtNFB" + "F7QWZHoLrRpZcY4h+DxwP3c+/FdlVcs9nstkF+EnTnwx5IRyKsaWb/pUEmYKvNDz" + "wi6qnRUdu+DghZuvyZZDgwoYrSZokcbKumk0MsLC3QIDAQABo4GRMIGOMA8GA1Ud" + "EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGmMBYGA1UdJQEB/wQMMAoGCCsGAQUF" + "BwMBMBcGA1UdEQEB/wQNMAuCCWxvY2FsaG9zdDA6BgorBgEEAYI3VAEBBCwMKkFT" + "UC5ORVQgQ29yZSBIVFRQUyBkZXZlbG9wbWVudCBjZXJ0aWZpY2F0ZTANBgkqhkiG" + "9w0BAQsFAAOCAQEARX4NxGbycdPVuqvu/CO+/LpWrEm1OcOl7N57/mD5npTIJT78" + "TYtXk1J61akumKdf5CaBgCDRcl35LhioFZIMEsiOidffAp6t493xocncFBhIYYrZ" + "HS6aKsZKPu8h3wOLpYu+zh7f0Hx6pkHPAfw4+knmQjDYomz/hTwuo/MuT8k6Ee7B" + "NGWqxUamLI8bucuf2ZfT1XOq83uWaFF5KwAuVLhpzo39/TmPyYGnaoKRYf9QjabS" + "LUjecMNLJFWHUSD4cKHvXJjDYZEiCiy+MdUDytWIsfw0fzAUjz9Qaz8YpZ+fXufM" + "MNMNfyJHSMEMFIT2D1UaQiwryXWQWJ93OiSdjA=="; + + const std::string InvalidTestProxyHttpsCertificate + = "MIIIujCCBqKgAwIBAgITMwAxS6DhmVCLBf6MWwAAADFLoDANBgkqhkiG9w0BAQwF" + "ADBZMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u" + "MSowKAYDVQQDEyFNaWNyb3NvZnQgQXp1cmUgVExTIElzc3VpbmcgQ0EgMDEwHhcN" + "MjIwMzE0MTgzOTU1WhcNMjMwMzA5MTgzOTU1WjBqMQswCQYDVQQGEwJVUzELMAkG" + "A1UECBMCV0ExEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBD" + "b3Jwb3JhdGlvbjEcMBoGA1UEAwwTKi5henVyZXdlYnNpdGVzLm5ldDCCASIwDQYJ" + "KoZIhvcNAQEBBQADggEPADCCAQoCggEBAM3heDMqn7v8cmh4A9vECuEfuiUnKBIw" + "7y0Sf499Z7WW92HDkIvV3eJ6jcyq41f2UJcG8ivCu30eMnYyyI+aRHIedkvOBA2i" + "PqG78e99qGTuKCj9lrJGVfeTBJ1VIlPvfuHFv/3JaKIBpRtuqxCdlgsGAJQmvHEn" + "vIHUV2jgj4iWNBDoC83ShtWg6qV2ol7yiaClB20Af5byo36jVdMN6vS+/othn3jG" + "pn+NP00DWYbP5y4qhs5XLH9wQZaTUPKIaUxmHewErcM0rMAaWl8wMqQTeNYf3l5D" + "ax50yuEg9VVjtbDdSmvOkslGpVqsOl1NrmyN7gCvcvcRUQcxIiXJQc0CAwEAAaOC" + "BGgwggRkMIIBfwYKKwYBBAHWeQIEAgSCAW8EggFrAWkAdgCt9776fP8QyIudPZwe" + "PhhqtGcpXc+xDCTKhYY069yCigAAAX+Jw/reAAAEAwBHMEUCIE8AAjvwO4AffPn7" + "un67WykJ2hGB4n8qJE7pk4QYjWW+AiEA/pio1E9ALt30Kh/Ga4gRefH1ILbQ8n4h" + "bHFatezIcvYAdwB6MoxU2LcttiDqOOBSHumEFnAyE4VNO9IrwTpXo1LrUgAAAX+J" + "w/qlAAAEAwBIMEYCIQCdbj6FOX6wK+dLoqjWKuCgkKSsZsJKpVik6HjlRgomzQIh" + "AM7mYp5dBFmNLas3fFcP0rMMK+17n8u0GhFH2KpkPr1SAHYA6D7Q2j71BjUy51co" + "vIlryQPTy9ERa+zraeF3fW0GvW4AAAF/icP6jgAABAMARzBFAiAhjTz3PBjqRrpY" + "eH7us44lESC7c0dzdTcehTeAwmEyrgIhAOCaqmqA+ercv+39jzFWkctG36bazRFX" + "4gGNiKU0bctcMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUH" + "AwEwPAYJKwYBBAGCNxUHBC8wLQYlKwYBBAGCNxUIh73XG4Hn60aCgZ0ujtAMh/Da" + "HV2ChOVpgvOnPgIBZAIBJTCBrgYIKwYBBQUHAQEEgaEwgZ4wbQYIKwYBBQUHMAKG" + "YWh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0" + "JTIwQXp1cmUlMjBUTFMlMjBJc3N1aW5nJTIwQ0ElMjAwMSUyMC0lMjB4c2lnbi5j" + "cnQwLQYIKwYBBQUHMAGGIWh0dHA6Ly9vbmVvY3NwLm1pY3Jvc29mdC5jb20vb2Nz" + "cDAdBgNVHQ4EFgQUiiks5RXI6IIQccflfDtgAHndN7owDgYDVR0PAQH/BAQDAgSw" + "MHwGA1UdEQR1MHOCEyouYXp1cmV3ZWJzaXRlcy5uZXSCFyouc2NtLmF6dXJld2Vi" + "c2l0ZXMubmV0ghIqLmF6dXJlLW1vYmlsZS5uZXSCFiouc2NtLmF6dXJlLW1vYmls" + "ZS5uZXSCFyouc3NvLmF6dXJld2Vic2l0ZXMubmV0MAwGA1UdEwEB/wQCMAAwZAYD" + "VR0fBF0wWzBZoFegVYZTaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9j" + "cmwvTWljcm9zb2Z0JTIwQXp1cmUlMjBUTFMlMjBJc3N1aW5nJTIwQ0ElMjAwMS5j" + "cmwwZgYDVR0gBF8wXTBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0" + "cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRt" + "MAgGBmeBDAECAjAfBgNVHSMEGDAWgBQPIF3XoVeV25LPK9DHwncEznKAdjAdBgNV" + "HSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwDQYJKoZIhvcNAQEMBQADggIBAKtk" + "4nEDfqxbP80uaoBoPaeeX4G/tBNcfpR2sf6soW8atAqGOohdLPcE0n5/KJn+H4u7" + "CsZdTJyUVxBxAlpqAc9JABl4urWNbhv4pueGBZXOn5K5Lpup/gp1HhCx4XKFno/7" + "T22NVDol4LRLUTeTkrpNyYLU5QYBQpqlFMAcvem/2seiPPYghFtLr5VWVEikUvnf" + "wSlECNk84PT7mOdbrX7T3CbG9WEZVmSYxMCS4pwcW3caXoSzUzZ0H1sJndCJW8La" + "9tekRKkMVkN558S+FFwaY1yARNqCFeK+yiwvkkkojqHbgwFJgCFWYy37kFR9uPiv" + "3sTHvs8IZ5K8TY7rHk3pSMYqoBTODCs7wKGiByWSDMcfAgGBzjt95SKfq0p6sj0C" + "+HWFiyKR+PTi2esFP9Vr9sC9jfRM6zwa7KnONqLefHauJPdNMt5l1FQGWvyco4IN" + "lwK3Z9FfEOFZA4YcjsqnkNacKZqLjgis3FvD8VPXETgRuffVc75lJxH6WmkwqdXj" + "BlU8wOcJyXTmM1ehYpziCpWvGBSEIsFuK6BC/iBnQEuWKdctAdbHIDlLctGgDWjx" + "xYDPZ/TtORGL8YaDnj6QHeOURIAHCtt6NCWKV6OR2HtMx+tCEvfi5ION1dyJ9hAX" + "+4K9FXc71ab7tdV/GLPkWc8Q0x1nk7ogDYcqKbiF"; + + class TestProxy { + // cspell:enable + + std::unique_ptr m_pipeline; + + public: + struct TestProxyOptions : Azure::Core::_internal::ClientOptions + { + TestProxyOptions() : Azure::Core::_internal::ClientOptions() {} + }; + TestProxy(TestProxyOptions options = TestProxyOptions()) + { + if (options.Transport.ExpectedTlsRootCertificate.empty()) + { + options.Transport.ExpectedTlsRootCertificate = TestProxyHttpsCertificate; + } + std::vector> perRetryPolicies; + std::vector> perCallPolicies; + m_pipeline = std::make_unique( + options, + "Test Proxy", + "2021-11", + std::move(perRetryPolicies), + std::move(perCallPolicies)); + } + + Azure::Response PostStartRecording(std::string const& recordingFile) + { + std::string proxyServerRequest; + proxyServerRequest = "{ \"x-recording-file\": \""; + proxyServerRequest += Azure::Core::Url::Encode(recordingFile); + proxyServerRequest += "\"}"; + std::vector bodyVector{proxyServerRequest.begin(), proxyServerRequest.end()}; + Azure::Core::IO::MemoryBodyStream postBody(bodyVector); + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Post, + Azure::Core::Url("https://localhost:5001/record/start"), + &postBody); + + auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); + auto& responseHeaders = response->GetHeaders(); + auto responseId = responseHeaders.find("x-recording-id"); + return Azure::Response(responseId->second, std::move(response)); + } + Azure::Response PostStopRecording( + std::string const& recordingId) + { + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Post, + Azure::Core::Url("https://localhost:5001/record/stop")); + request.SetHeader("x-recording-id", recordingId); + + auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); + auto responseCode = response->GetStatusCode(); + return Azure::Response(responseCode, std::move(response)); + } + + Azure::Response PostStartPlayback(std::string const& recordingFile) + { + std::string proxyServerRequest; + proxyServerRequest = "{ \"x-recording-file\": \""; + proxyServerRequest += Azure::Core::Url::Encode(recordingFile); + proxyServerRequest += "\"}"; + std::vector bodyVector{proxyServerRequest.begin(), proxyServerRequest.end()}; + Azure::Core::IO::MemoryBodyStream postBody(bodyVector); + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Post, + Azure::Core::Url("https://localhost:5001/playback/start"), + &postBody); + + auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); + auto& responseHeaders = response->GetHeaders(); + auto responseId = responseHeaders.find("x-recording-id"); + return Azure::Response(responseId->second, std::move(response)); + } + + Azure::Response PostStopPlayback( + std::string const& recordingId) + { + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Post, + Azure::Core::Url("https://localhost:5001/playback/stop")); + request.SetHeader("x-recording-id", recordingId); + + auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); + auto responseCode = response->GetStatusCode(); + return Azure::Response(responseCode, std::move(response)); + } + + Azure::Response ProxyServerGetUrl( + std::string const& recordingId, + bool isRecording, + std::string const& urlToRecord) + { + Azure::Core::Url targetUrl{urlToRecord}; + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Get, + Azure::Core::Url("https://localhost:5001/" + targetUrl.GetRelativeUrl())); + request.SetHeader( + "x-recording-upstream-base-uri", targetUrl.GetScheme() + "://" + targetUrl.GetHost()); + request.SetHeader("x-recording-id", recordingId); + request.SetHeader("x-recording-mode", (isRecording ? "record" : "playback")); + + auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); + std::string responseBody(response->GetBody().begin(), response->GetBody().end()); + return Azure::Response(responseBody, std::move(response)); + } + + Azure::Response IsAlive() + { + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Get, + Azure::Core::Url("https://localhost:5001/Admin/IsAlive")); + auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); + auto statusCode = response->GetStatusCode(); + return Azure::Response(statusCode, std::move(response)); + } + + ~TestProxy() {} + }; + + TEST_F(TransportAdapterOptions, AccessTestProxyServer) + { + TestProxy proxyServer; + + EXPECT_EQ(Azure::Core::Http::HttpStatusCode::Ok, proxyServer.IsAlive().Value); + + std::string recordingId; + EXPECT_NO_THROW(recordingId = proxyServer.PostStartRecording("testRecording.json").Value); + + GTEST_LOG_(INFO) << "Started recording with ID " << recordingId; + + std::string response; + EXPECT_NO_THROW( + response + = proxyServer.ProxyServerGetUrl(recordingId, true, AzureSdkHttpbinServer::Get()).Value); + + GTEST_LOG_(INFO) << "Response for recording " << recordingId << "is: " << response; + + EXPECT_NO_THROW(proxyServer.PostStopRecording(recordingId)); + + EXPECT_NO_THROW(recordingId = proxyServer.PostStartPlayback("testRecording.json").Value); + GTEST_LOG_(INFO) << "Started playback with ID " << recordingId; + + EXPECT_NO_THROW( + response + = proxyServer.ProxyServerGetUrl(recordingId, false, AzureSdkHttpbinServer::Get()).Value); + + GTEST_LOG_(INFO) << "Recorded Response for " << recordingId << "is: " << response; + + EXPECT_NO_THROW(proxyServer.PostStopPlayback(recordingId)); + } + + TEST_F(TransportAdapterOptions, TestProxyServerWithInvalidCertificate) + { + TestProxy::TestProxyOptions options; + options.Transport.ExpectedTlsRootCertificate = InvalidTestProxyHttpsCertificate; + TestProxy proxyServer(options); + + EXPECT_THROW(proxyServer.IsAlive(), Azure::Core::Http::TransportException); + } + +}}} // namespace Azure::Core::Test diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 45e6e3e0e2..71fea0a3d9 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -94,6 +94,12 @@ stages: displayName: Verify Proxy Server Working Correctly. condition: and(succeeded(), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + # Start the test proxy tool for testing. Only start it when previous steps had succeeded and we're enabling testing. + - template: /eng/common/testproxy/test-proxy-tool.yml + parameters: + runProxy: true + targetVersion: 1.0.0-dev.20220810.2 + PostTestSteps: # Shut down the test server. This uses curl to send a request to the "terminateserver" websocket endpoint. # When the test server receives a request on terminateserver, it shuts down gracefully. @@ -115,7 +121,7 @@ stages: docker stop $_ ` } displayName: Shutdown Squid Proxy. - condition: and(contains(variables.CmakeArgs, 'BUILD_TESTING=ON'), variables.RunProxyTests, contains(variables['OSVmImage'], 'linux')) + condition: and(variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON'), contains(variables['OSVmImage'], 'linux')) - template: /eng/common/pipelines/templates/steps/publish-artifact.yml parameters: ArtifactPath: '$(Build.SourcesDirectory)/WebSocketServer.log' From 557d836f9e7aee320e10d63668e18f5ad4e22ab1 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 19 Sep 2022 12:28:31 -0700 Subject: [PATCH 08/75] Synced websockets feature branch with main. (#3945) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Stress test (#3820) * mem leak fix * PR comments fix * PR comments * seems to work? * clang * curl again * add first stress test * also update gitignore * missing line * only linux * clang typo format * typo 2 * PR comments * cspell * remove terminator * Fixed the metadata for better handling (#3824) Co-authored-by: sima-zhu * Update attestation core vcpkg dependency to latest GA version that is required. (#3830) * Update attestation core vcpkg dependency to latest GA version that is required. * Update vcpkg config.cmake to match the dependency version needed. * Remove winhttp (#3832) * remove refs to winhttp * this tsst only curl * Move perf.yml to eng/common (#3833) Co-authored-by: Mike Harder * Sync eng/common directory with azure-sdk-tools for PR 3656 (#3834) * someone wants to reference the test-proxy startup scripts externally. to make this easy on them we're parameterizing the root of the eng/common for easy use in that scenario * two leading $ signs on the definition of the certificate path was causing some issues! Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Update casing for 'verison' (#3821) Co-authored-by: Daniel Jurek * Print additional result summary formats to pipelines UI (#3842) Co-authored-by: Mike Harder * Sync eng/common directory with azure-sdk-tools for PR 3702 (#3843) * Add language-service to list of valid sample slugs * Update link to taxonomies Co-authored-by: Heath Stewart * Fix incorrect failure notification in vcpkg publishing (#3838) * Set up for testing of template pipeline * Override branches, set up for template GA release * More TODOs to prevent merging an unintended change * More removal of TestPipeline * Increment template version number * Use script to set package version * Check out the correct branch * branch parameter in the command * Use $(PublishToVcpkg) to determine if we should check for changes * dictionary syntax * Set GA package version to validate GA publish scenario * Update changelog * create-pull-request.yml optionally pushes changes * Output GH PR URI * Macro syntax with a variable set earlier * Move up to 1.2.0-beta.2 * beta.1 * Revert changelog * Revert testing-related changes * Revert vcpkg-clone.yml * Revert eng/common changes, ensure global $(HasChanges) is set properly * Changes to enable testing * 1.1.0-beta.1 * vcpkg clone should clone at configured branch * Clone "main" branch of vcpkg betas * Undo test-specific changes * More PR cleanup * PR cleanup * Helm charts (#3841) * helm chart * first pipe setup * poi * magiks * ewewe * stress * cleanup * pr * QFE and readme * clang * stupid clang , waste of time * ewqwewewrqrewewrqewrqwrqr * stupid clang * cspell * PR * try try again * clang again * Sync eng/common directory with azure-sdk-tools for PR 3661 (#3846) * Add full clone fallback to sparse checkout * Improve clone handling and overrides for sparse checkout * Use SkipSparseCheckout variable name Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3735 (#3845) * Detect API changes using new snadboxinx approach * Added strictmode * Remove unset variable * Changes as per strict mode 3 * Rervert strict mode to allow language level fixes to merge first Co-authored-by: praveenkuttappan * Increment version for keyvault releases (#3809) * Increment package version after release of azure-security-keyvault-keys * Increment package version after release of azure-security-keyvault-secrets * Increment package version after release of azure-security-keyvault-certificates * Removed hard dependency on opentelemetry version (#3844) * Revert "Add full clone fallback to sparse checkout (#3661)" (#3851) This reverts commit 7605ead00308dd20f20f2afe5acc4ec9900a2c47. Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3753 (#3857) * Bump MacOs version to macos-11 * Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 Co-authored-by: Wes Haggard * Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1 Co-authored-by: Wes Haggard Co-authored-by: sima-zhu Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: Wes Haggard * Bump macOs version to macos-11 (#3853) * Update CHANGELOG.md * Fix misleading step name in az module install (#3859) Co-authored-by: Ben Broderick Phillips * Retry poll calls on EINTR (#3858) When signals are delievered to the process, calls here to poll may be interrupted and return with a spurious failure. The call instead should be restarted. * Fix bad path to sample matrix json (#3860) Co-authored-by: Ben Broderick Phillips * Sync eng/common directory with azure-sdk-tools for PR 3826 (#3863) * Add link checking for stress CI * Remove region segment from stress testing links Co-authored-by: Ben Broderick Phillips * Core August releases (#3862) * Core August releases * cspell Co-authored-by: Anton Kolesnyk * Increment version for core releases (#3865) * Increment package version after release of azure-core * Increment package version after release of azure-core-tracing-opentelemetry * Storage Aug GA release (#3864) * CG only runs on internal (#3866) * Condition added and indentation changes * STG 79 80 81 Features (#3850) * Sync eng/common directory with azure-sdk-tools for PR 3860 (#3871) * updating pfx and cert * update the targeted version of the proxy as well Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Storage August Preview Release (#3868) * Storage August Preview Release * update versions * Increment version for storage releases (#3875) * Increment package version after release of azure-storage-common * Increment package version after release of azure-storage-blobs * Fix an issue that reason phrase is missing as expected from HTTP/2 server (#3879) * Fix an issue that reason phrase is missing as expected from HTTP/2 server * reverse the condition * compact comments * fix clang format * Update CODEOWNERS (#3881) * updated targeted proxy version to one that properly allows consumption of TLS certificates (#3888) Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * Fix `azure-storage-blobs-cpp` beta install (#3889) Co-authored-by: Anton Kolesnyk * Fixed #3899 - Handle new OSX version correctly; reformatted platform-matrix JSON files (#3900) * Simpler get-binarysizes check for OSX (#3901) * Simpler get-binarysizes check for OSX * Missed wildcard * Sync eng/common directory with azure-sdk-tools for PR 3874 (#3907) * Add sparse checkout to perf template * Rename base template, add parameters * Add comment * Add TODO * Fix copy/pase bug, add language to artifacts path * Fix language ref * Fix python language * perf.yml extends perf-base.yml * Remove unnecessary base yml * Fetch pull request refs * Fix refs path * Fetch commitish if matches PR syntax * Print command before running * Add PR commitish to remote.origin.fetch * Add pool and vmimage parameters * Map ref under "refs/remotes/origin" * Add ref to refs/remotes/origin Co-authored-by: Mike Harder * File Share Features until STG82 (#3908) * Empty file or existing file won't be created/overwritten if the blob to be downloaded doesn't exist. (#3910) * Remove unnecessary checkout: none that causes conflicts with sparse checkout declarations (#3915) Co-authored-by: Ben Broderick Phillips * Core September Release (#3913) Co-authored-by: Anton Kolesnyk * Increment package version after release of azure-core (#3919) * Migrate SkipDefaultCheckout to SkipCheckoutNone (#3916) Co-authored-by: Ben Broderick Phillips * Storage Sept Release (#3914) * Increment version for storage releases (#3924) * Increment package version after release of azure-storage-common * Increment package version after release of azure-storage-blobs * Increment package version after release of azure-storage-files-shares * Add github actions based check enforcer (#3922) * Add `$schema` to `cgmanifest.json` (#3918) Co-authored-by: Jamie Magee * Remove SkipDefaultCheckout parameter (#3930) Co-authored-by: Ben Broderick Phillips * Compatibility improvement for striped blob (#3932) * add a parameter 'condition' to the test-proxy ci invocations. (#3931) Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> * storage ad-hoc release (#3934) * Increment package version after release of azure-storage-blobs (#3935) Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com> Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: sima-zhu Co-authored-by: Ahson Khan Co-authored-by: Mike Harder Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> Co-authored-by: Daniel Jurek Co-authored-by: Heath Stewart Co-authored-by: Ben Broderick Phillips Co-authored-by: praveenkuttappan Co-authored-by: Ben Broderick Phillips Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Rick Winter Co-authored-by: John Heffner Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Co-authored-by: Anton Kolesnyk Co-authored-by: JinmingHu Co-authored-by: Jonathan Cárdenas Co-authored-by: keshen-msft <53491277+keshen-msft@users.noreply.github.com> Co-authored-by: microzchang <110015819+microzchang@users.noreply.github.com> Co-authored-by: Jamie Magee Co-authored-by: Jamie Magee --- .github/workflows/event.yml | 16 + .vscode/cspell.json | 6 + cmake-modules/FolderList.cmake | 10 +- eng/common/pipelines/templates/jobs/perf.yml | 58 +- .../templates/steps/docs-metadata-release.yml | 2 +- .../templates/steps/sparse-checkout.yml | 15 +- .../steps/update-docsms-metadata.yml | 7 +- eng/common/testproxy/test-proxy-docker.yml | 6 + eng/common/testproxy/test-proxy-tool.yml | 10 +- .../stages/platform-matrix-live.json | 18 + .../cgmanifest.json | 1 + sdk/core/azure-core-test/cgmanifest.json | 45 +- .../cgmanifest.json | 1 + sdk/core/azure-core/CHANGELOG.md | 6 + sdk/core/azure-core/cgmanifest.json | 3 +- sdk/core/perf/cgmanifest.json | 1 + sdk/identity/azure-identity/cgmanifest.json | 4 +- .../cgmanifest.json | 67 +- .../cgmanifest.json | 67 +- .../cgmanifest.json | 67 +- sdk/storage/azure-storage-blobs/CHANGELOG.md | 18 +- .../azure-storage-blobs/CMakeLists.txt | 4 +- .../azure-storage-blobs/cgmanifest.json | 1 + .../azure-storage-blobs/src/blob_client.cpp | 3 +- .../src/private/package_version.hpp | 4 +- .../azure-storage-blobs/src/rest_client.cpp | 21 +- .../azure-storage-blobs/swagger/README.md | 20 + .../test/ut/block_blob_client_test.cpp | 9 + ...bClientTest.DownloadNonExistingToFile.json | 69 + sdk/storage/azure-storage-blobs/vcpkg.json | 4 +- .../azure-storage-blobs/vcpkg/Config.cmake.in | 2 +- .../azure-storage-blobs/vcpkg/vcpkg.json | 2 +- sdk/storage/azure-storage-common/CHANGELOG.md | 8 +- .../azure-storage-common/cgmanifest.json | 1 + .../src/private/package_version.hpp | 2 +- sdk/storage/azure-storage-common/vcpkg.json | 2 +- .../azure-storage-files-datalake/CHANGELOG.md | 1 + .../cgmanifest.json | 1 + .../datalake/datalake_directory_client.hpp | 4 +- .../test/ut/datalake_file_client_test.cpp | 9 + ...eClientTest.DownloadNonExistingToFile.json | 111 ++ .../azure-storage-files-shares/CHANGELOG.md | 20 +- .../azure-storage-files-shares/CMakeLists.txt | 4 +- .../cgmanifest.json | 1 + .../storage/files/shares/rest_client.hpp | 296 ++++- .../files/shares/share_directory_client.hpp | 33 + .../files/shares/share_lease_client.hpp | 44 +- .../storage/files/shares/share_options.hpp | 148 +++ .../storage/files/shares/share_responses.hpp | 4 + .../src/private/package_version.hpp | 2 +- .../src/rest_client.cpp | 618 ++++++++- .../src/share_client.cpp | 3 + .../src/share_directory_client.cpp | 124 ++ .../src/share_file_client.cpp | 41 +- .../swagger/README.md | 102 +- .../recordings/FileShareClientTest.Lease.json | 416 ++++++ .../FileShareClientTest.PremiumShare.json | 453 +++++-- .../FileShareClientTest.SnapshotLease.json | 484 +++++++ ...toryClientTest.DirectorySmbProperties.json | 358 ++--- ...ListFilesAndDirectoriesSinglePageTest.json | 1079 ++++++++++----- ...leShareDirectoryClientTest.RenameFile.json | 1165 +++++++++++++++++ ...irectoryClientTest.RenameSubdirectory.json | 967 ++++++++++++++ ...yClientTest.SmbPropertiesDefaultValue.json | 176 +-- .../FileShareFileClientTest.CopyRelated.json | 216 +-- ...eClientTest.DownloadNonExistingToFile.json | 169 +++ ...ShareFileClientTest.FileSmbProperties.json | 398 +++--- ...areFileClientTest.RangeUploadDownload.json | 582 +++++--- ...eClientTest.SmbPropertiesDefaultValue.json | 216 +-- ...hareFileClientTest.UploadRangeFromUri.json | 486 ++++--- ...withParam-UploadShare.fromBuffer-c1s0.json | 190 +-- ...hParam-UploadShare.fromBuffer-c1s1024.json | 209 +-- ...ram-UploadShare.fromBuffer-c1s1048576.json | 209 +-- ...hParam-UploadShare.fromBuffer-c1s4096.json | 209 +-- ...ram-UploadShare.fromBuffer-c1s4194816.json | 361 ++--- ...thParam-UploadShare.fromBuffer-c1s512.json | 209 +-- ...withParam-UploadShare.fromBuffer-c2s0.json | 190 +-- ...hParam-UploadShare.fromBuffer-c2s1024.json | 209 +-- ...ram-UploadShare.fromBuffer-c2s1048576.json | 209 +-- ...hParam-UploadShare.fromBuffer-c2s4096.json | 209 +-- ...ram-UploadShare.fromBuffer-c2s4194816.json | 361 ++--- ...thParam-UploadShare.fromBuffer-c2s512.json | 209 +-- ...withParam-UploadShare.fromBuffer-c5s0.json | 190 +-- ...hParam-UploadShare.fromBuffer-c5s1024.json | 209 +-- ...ram-UploadShare.fromBuffer-c5s1048576.json | 209 +-- ...hParam-UploadShare.fromBuffer-c5s4096.json | 209 +-- ...ram-UploadShare.fromBuffer-c5s4194816.json | 365 +++--- ...thParam-UploadShare.fromBuffer-c5s512.json | 209 +-- .../test/ut/share_client_test.cpp | 378 ++++-- .../test/ut/share_directory_client_test.cpp | 378 ++++++ .../test/ut/share_file_client_test.cpp | 83 +- .../azure-storage-files-shares/vcpkg.json | 4 +- .../vcpkg/Config.cmake.in | 2 +- .../vcpkg/vcpkg.json | 2 +- .../azure-storage-queues/cgmanifest.json | 1 + sdk/template/azure-template/cgmanifest.json | 67 +- 95 files changed, 10424 insertions(+), 3967 deletions(-) create mode 100644 .github/workflows/event.yml create mode 100644 sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json create mode 100644 sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json create mode 100644 sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.Lease.json create mode 100644 sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.SnapshotLease.json create mode 100644 sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameFile.json create mode 100644 sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameSubdirectory.json create mode 100644 sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json diff --git a/.github/workflows/event.yml b/.github/workflows/event.yml new file mode 100644 index 0000000000..3a88082782 --- /dev/null +++ b/.github/workflows/event.yml @@ -0,0 +1,16 @@ +name: GitHub Event Handler + +on: + check_suite: + types: [completed] + issue_comment: + types: [created] + +jobs: + event-handler: + name: Handle ${{ github.event_name }} ${{ github.event.action }} event + runs-on: ubuntu-latest + steps: + - uses: azure/azure-sdk-actions@main + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.vscode/cspell.json b/.vscode/cspell.json index ec5a6d9b3e..37c27178e6 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -234,6 +234,12 @@ "numofmessages" ] }, + { + "filename": "**/sdk/storage/azure-storage-files-shares/**/*", + "words": [ + "mibps" + ] + }, { "filename": "**/cmake-modules/**/*", "words": [ diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index eb1946395a..5837920d7e 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -13,17 +13,17 @@ macro(GetFolderList project) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/identity azure-identity 1.1.0) elseif(${project} STREQUAL STORAGE_COMMON) - DownloadDepVersion(sdk/core azure-core 1.5.0) + DownloadDepVersion(sdk/core azure-core 1.7.1) elseif(${project} STREQUAL STORAGE_BLOBS) - DownloadDepVersion(sdk/core azure-core 1.5.0) - DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.4) + DownloadDepVersion(sdk/core azure-core 1.7.1) + DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.3.0) elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) elseif(${project} STREQUAL STORAGE_FILES_SHARES) - DownloadDepVersion(sdk/core azure-core 1.3.1) - DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) + DownloadDepVersion(sdk/core azure-core 1.7.1) + DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.3.0) elseif(${project} STREQUAL STORAGE_QUEUES) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index 3d3a3f6e31..7f0c7f8755 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -1,4 +1,31 @@ parameters: +- name: JobName + type: string + default: 'Perf' +- name: LinuxPool + type: string + default: 'azsdk-pool-mms-ubuntu-2004-perf' +- name: LinuxVmImage + type: string + default: 'MMSUbuntu20.04' +- name: WindowsPool + type: string + default: 'azsdk-pool-mms-win-2019-perf' +- name: WindowsVmImage + type: string + default: 'MMS2019' +- name: Language + type: string + default: '' +- name: LanguageRepoName + type: string + default: $(Build.Repository.Name) +- name: LanguageRepoCommitish + type: string + default: $(Build.SourceVersion) +- name: ToolsRepoCommitish + type: string + default: 'main' - name: Variables type: object default: [] @@ -54,23 +81,36 @@ jobs: matrix: ${{ if contains(parameters.OperatingSystems, 'Linux') }}: Linux: - Pool: 'azsdk-pool-mms-ubuntu-2004-perf' - OsVmImage: 'MMSUbuntu20.04' + Pool: ${{ parameters.LinuxPool }} + OsVmImage: ${{ parameters.LinuxVmImage }} MatrixName: 'Linux' ${{ if contains(parameters.OperatingSystems, 'Windows') }}: Windows: - Pool: 'azsdk-pool-mms-win-2019-perf' - OsVmImage: 'MMS2019' + Pool: ${{ parameters.WindowsPool }} + OsVmImage: ${{ parameters.WindowsVmImage }} MatrixName: 'Windows' + variables: + - ${{ parameters.Variables }} pool: name: $(Pool) vmImage: $(OSVmImage) steps: - - checkout: self - path: s - - checkout: azure-sdk-tools - path: s/azure-sdk-tools + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + parameters: + Paths: + - '/*' + - '!sdk/**/test-recordings/*' + - '!sdk/**/recordings/*' + - '!sdk/**/SessionRecords/*' + - '!sdk/**/session-records/*' + Repositories: + - Name: ${{ parameters.LanguageRepoName }} + Commitish: ${{ parameters.LanguageRepoCommitish }} + WorkingDirectory: $(System.DefaultWorkingDirectory) + - Name: Azure/azure-sdk-tools + Commitish: ${{ parameters.ToolsRepoCommitish }} + WorkingDirectory: $(System.DefaultWorkingDirectory)/azure-sdk-tools - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml parameters: @@ -133,7 +173,7 @@ jobs: - task: PublishPipelineArtifact@1 inputs: targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results - artifactName: results-$(MatrixName) + artifactName: results-${{ parameters.Language }}-$(MatrixName) condition: always() - template: /eng/common/TestResources/remove-test-resources.yml diff --git a/eng/common/pipelines/templates/steps/docs-metadata-release.yml b/eng/common/pipelines/templates/steps/docs-metadata-release.yml index 2f58b90d4d..7b6fb183a5 100644 --- a/eng/common/pipelines/templates/steps/docs-metadata-release.yml +++ b/eng/common/pipelines/templates/steps/docs-metadata-release.yml @@ -81,7 +81,7 @@ steps: - ${{ if parameters.SparseCheckoutPaths }}: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: - SkipDefaultCheckout: true + SkipCheckoutNone: true Repositories: - Name: ${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }} WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index a3b553b3a7..cee1fbb2d5 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -8,13 +8,13 @@ parameters: - Name: $(Build.Repository.Name) Commitish: $(Build.SourceVersion) WorkingDirectory: $(System.DefaultWorkingDirectory) - - name: SkipDefaultCheckout + - name: SkipCheckoutNone type: boolean default: false steps: - - ${{ if not(parameters.SkipDefaultCheckout) }}: - - checkout: none + - ${{ if not(parameters.SkipCheckoutNone) }}: + - checkout: none - task: PowerShell@2 displayName: 'Sparse checkout repositories' @@ -38,8 +38,13 @@ steps: } else { Write-Host "Repository $($repository.Name) is being initialized." - Write-Host "git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) ." - git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) . + if ($repository.Commitish -match '^refs/pull/\d+/merge$') { + Write-Host "git clone --no-checkout --filter=tree:0 -c remote.origin.fetch='+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)' https://github.com/$($repository.Name) ." + git clone --no-checkout --filter=tree:0 -c remote.origin.fetch=''+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)'' https://github.com/$($repository.Name) . + } else { + Write-Host "git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) ." + git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) . + } Write-Host "git sparse-checkout init" git sparse-checkout init diff --git a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml index 66d8335de8..2635ad4794 100644 --- a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml +++ b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml @@ -34,7 +34,6 @@ parameters: default: '' steps: - ${{ if eq(length(parameters.PackageInfoLocations), 0) }}: - - checkout: none - pwsh: | Write-Host "Skipping DocsMS Update because package list was empty." displayName: Skip DocsMS Update @@ -47,7 +46,7 @@ steps: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: - SkipDefaultCheckout: true + SkipCheckoutNone: true Repositories: - Name: ${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }} WorkingDirectory: $(DocRepoLocation) @@ -77,7 +76,7 @@ steps: displayName: Checkout daily docs branch if it exists workingDirectory: $(DocRepoLocation) - # If NOT performing a daily docs build, set the $(TargetBranchName) to the + # If NOT performing a daily docs build, set the $(TargetBranchName) to the # default branch of the documentation repository. - ${{ if ne(parameters.DailyDocsBuild, 'true') }}: - template: /eng/common/pipelines/templates/steps/set-default-branch.yml @@ -104,7 +103,7 @@ steps: -PackageSourceOverride '${{ parameters.PackageSourceOverride }}' ` -TenantId '$(opensource-aad-tenant-id)' ` -ClientId '$(opensource-aad-app-id)' ` - -ClientSecret '$(opensource-aad-secret)' + -ClientSecret '$(opensource-aad-secret)' displayName: Apply Documentation Updates - template: /eng/common/pipelines/templates/steps/git-push-changes.yml diff --git a/eng/common/testproxy/test-proxy-docker.yml b/eng/common/testproxy/test-proxy-docker.yml index 52a7c807a3..71a03d1be3 100644 --- a/eng/common/testproxy/test-proxy-docker.yml +++ b/eng/common/testproxy/test-proxy-docker.yml @@ -2,24 +2,30 @@ parameters: rootFolder: '$(Build.SourcesDirectory)' targetVersion: '' templateRoot: '$(Build.SourcesDirectory)' + condition: true steps: - pwsh: | ${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' + condition: and(succeeded(), ${{ parameters.condition }}) - pwsh: | docker info displayName: 'Dump active docker information' + condition: and(succeeded(), ${{ parameters.condition }}) - pwsh: | ${{ parameters.templateRoot }}/eng/common/testproxy/docker-start-proxy.ps1 -Mode start -TargetFolder "${{ parameters.rootFolder }}" -VersionOverride="${{ parameters.targetVersion }}" displayName: 'Run the docker container' + condition: and(succeeded(), ${{ parameters.condition }}) - pwsh: | docker container ls -a displayName: Check running container + condition: and(succeeded(), ${{ parameters.condition }}) - pwsh: | Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" displayName: 'Set PROXY_MANUAL_START' + condition: and(succeeded(), ${{ parameters.condition }}) diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index 679ad2108d..293848da12 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -3,11 +3,13 @@ parameters: runProxy: true targetVersion: '' templateRoot: '$(Build.SourcesDirectory)' + condition: true steps: - pwsh: | ${{ parameters.templateRoot }}/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' + condition: and(succeeded(), ${{ parameters.condition }}) - pwsh: | $version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim() @@ -23,6 +25,7 @@ steps: --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json ` --version $version displayName: "Install test-proxy" + condition: and(succeeded(), ${{ parameters.condition }}) - pwsh: | Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy" @@ -34,19 +37,20 @@ steps: Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables' + condition: and(succeeded(), ${{ parameters.condition }}) - pwsh: | Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe ` -ArgumentList "--storage-location ${{ parameters.rootFolder }}" ` -NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.templateRoot }}/test-proxy.log displayName: 'Run the testproxy - windows' - condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) + condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }}) # nohup does NOT continue beyond the current session if you use it within powershell - bash: | nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > ${{ parameters.templateRoot }}/test-proxy.log & displayName: "Run the testproxy - linux/mac" - condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) + condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }}) workingDirectory: "${{ parameters.rootFolder }}" - pwsh: | @@ -62,4 +66,4 @@ steps: Write-Error "Could not connect to test proxy." exit 1 displayName: Test Proxy IsAlive - + condition: and(succeeded(), ${{ parameters.condition }}) diff --git a/eng/pipelines/templates/stages/platform-matrix-live.json b/eng/pipelines/templates/stages/platform-matrix-live.json index 1c0264d892..ceb385618d 100644 --- a/eng/pipelines/templates/stages/platform-matrix-live.json +++ b/eng/pipelines/templates/stages/platform-matrix-live.json @@ -165,6 +165,24 @@ "BuildArgs": "-v --parallel 8 --config Release", "RunSamples": 1, "WindowsCtestConfig": "-C Release" + }, + "HSM_Win_x64_with_unit_test_libcurl": { + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DMSVC_USE_STATIC_CRT=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "WindowsCtestConfig": "-C Release", + "KVLocation": "eastus2", + "EnableHSM": 1 + }, + "x64_with_unit_samples_libcurl": { + "VcpkgInstall": "curl[winssl] openssl", + "VCPKG_DEFAULT_TRIPLET": "x64-windows-static", + "CMAKE_GENERATOR_PLATFORM": "x64", + "CmakeArgs": " -DBUILD_TRANSPORT_CURL=ON -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DMSVC_USE_STATIC_CRT=ON ", + "BuildArgs": "-v --parallel 8 --config Release", + "RunSamples": 1, + "WindowsCtestConfig": "-C Release" } } } diff --git a/sdk/attestation/azure-security-attestation/cgmanifest.json b/sdk/attestation/azure-security-attestation/cgmanifest.json index d4b0875a5c..648f67628c 100644 --- a/sdk/attestation/azure-security-attestation/cgmanifest.json +++ b/sdk/attestation/azure-security-attestation/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/core/azure-core-test/cgmanifest.json b/sdk/core/azure-core-test/cgmanifest.json index 7348d592f0..00dd915e65 100644 --- a/sdk/core/azure-core-test/cgmanifest.json +++ b/sdk/core/azure-core-test/cgmanifest.json @@ -1,25 +1,26 @@ { - "Registrations": [ - { - "Component": { - "Type": "git", - "git": { - "RepositoryUrl": "https://github.com/google/googletest", - "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "clang-format", - "Version": "9.0.0-2", - "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" - } - }, - "DevelopmentDependency": true + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "Registrations": [ + { + "Component": { + "Type": "git", + "git": { + "RepositoryUrl": "https://github.com/google/googletest", + "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" } - ] + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "clang-format", + "Version": "9.0.0-2", + "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" + } + }, + "DevelopmentDependency": true + } + ] } diff --git a/sdk/core/azure-core-tracing-opentelemetry/cgmanifest.json b/sdk/core/azure-core-tracing-opentelemetry/cgmanifest.json index 698c2a9558..1e4219e5c9 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/cgmanifest.json +++ b/sdk/core/azure-core-tracing-opentelemetry/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index c7f91f9f98..e7add57eed 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -13,6 +13,12 @@ ### Other Changes +## 1.7.2 (2022-09-01) + +### Bugs Fixed + +- WinHTTP Transport Adapter: Fixed missing reason phrase handling for HTTP/2 responses. + ## 1.7.1 (2022-08-04) ### Bugs Fixed diff --git a/sdk/core/azure-core/cgmanifest.json b/sdk/core/azure-core/cgmanifest.json index 5e418d475b..a84431c793 100644 --- a/sdk/core/azure-core/cgmanifest.json +++ b/sdk/core/azure-core/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { @@ -94,4 +95,4 @@ "DevelopmentDependency": true } ] -} \ No newline at end of file +} diff --git a/sdk/core/perf/cgmanifest.json b/sdk/core/perf/cgmanifest.json index 244dcec184..7b765a74ad 100644 --- a/sdk/core/perf/cgmanifest.json +++ b/sdk/core/perf/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/identity/azure-identity/cgmanifest.json b/sdk/identity/azure-identity/cgmanifest.json index 819cdc37e6..f16d4d85ac 100644 --- a/sdk/identity/azure-identity/cgmanifest.json +++ b/sdk/identity/azure-identity/cgmanifest.json @@ -1,4 +1,4 @@ { - "Registrations": [ - ] + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "Registrations": [] } diff --git a/sdk/keyvault/azure-security-keyvault-certificates/cgmanifest.json b/sdk/keyvault/azure-security-keyvault-certificates/cgmanifest.json index 7f2901e706..1b872bc72d 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/cgmanifest.json +++ b/sdk/keyvault/azure-security-keyvault-certificates/cgmanifest.json @@ -1,36 +1,37 @@ { - "Registrations": [ - { - "Component": { - "Type": "git", - "git": { - "RepositoryUrl": "https://github.com/google/googletest", - "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "clang-format", - "Version": "9.0.0-2", - "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "doxygen", - "Version": "1.8.20", - "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" - } - }, - "DevelopmentDependency": true + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "Registrations": [ + { + "Component": { + "Type": "git", + "git": { + "RepositoryUrl": "https://github.com/google/googletest", + "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" } - ] + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "clang-format", + "Version": "9.0.0-2", + "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" + } + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "doxygen", + "Version": "1.8.20", + "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" + } + }, + "DevelopmentDependency": true + } + ] } diff --git a/sdk/keyvault/azure-security-keyvault-keys/cgmanifest.json b/sdk/keyvault/azure-security-keyvault-keys/cgmanifest.json index 7f2901e706..1b872bc72d 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/cgmanifest.json +++ b/sdk/keyvault/azure-security-keyvault-keys/cgmanifest.json @@ -1,36 +1,37 @@ { - "Registrations": [ - { - "Component": { - "Type": "git", - "git": { - "RepositoryUrl": "https://github.com/google/googletest", - "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "clang-format", - "Version": "9.0.0-2", - "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "doxygen", - "Version": "1.8.20", - "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" - } - }, - "DevelopmentDependency": true + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "Registrations": [ + { + "Component": { + "Type": "git", + "git": { + "RepositoryUrl": "https://github.com/google/googletest", + "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" } - ] + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "clang-format", + "Version": "9.0.0-2", + "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" + } + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "doxygen", + "Version": "1.8.20", + "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" + } + }, + "DevelopmentDependency": true + } + ] } diff --git a/sdk/keyvault/azure-security-keyvault-secrets/cgmanifest.json b/sdk/keyvault/azure-security-keyvault-secrets/cgmanifest.json index 7f2901e706..1b872bc72d 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/cgmanifest.json +++ b/sdk/keyvault/azure-security-keyvault-secrets/cgmanifest.json @@ -1,36 +1,37 @@ { - "Registrations": [ - { - "Component": { - "Type": "git", - "git": { - "RepositoryUrl": "https://github.com/google/googletest", - "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "clang-format", - "Version": "9.0.0-2", - "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "doxygen", - "Version": "1.8.20", - "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" - } - }, - "DevelopmentDependency": true + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "Registrations": [ + { + "Component": { + "Type": "git", + "git": { + "RepositoryUrl": "https://github.com/google/googletest", + "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" } - ] + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "clang-format", + "Version": "9.0.0-2", + "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" + } + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "doxygen", + "Version": "1.8.20", + "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" + } + }, + "DevelopmentDependency": true + } + ] } diff --git a/sdk/storage/azure-storage-blobs/CHANGELOG.md b/sdk/storage/azure-storage-blobs/CHANGELOG.md index 09af321dd0..bbc3e87f8a 100644 --- a/sdk/storage/azure-storage-blobs/CHANGELOG.md +++ b/sdk/storage/azure-storage-blobs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.6.0-beta.2 (Unreleased) +## 12.7.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,22 @@ ### Other Changes +## 12.6.1 (2022-09-16) + +### Other changes + +- No public changes in this release. + +## 12.6.0 (2022-09-06) + +### Features Added + +- Features in `12.6.0.beta.1` are now generally available. + +### Bugs Fixed + +- Empty file or existing file won't be created/overwritten if the blob to be downloaded doesn't exist. + ## 12.6.0-beta.1 (2022-08-09) ### Features Added diff --git a/sdk/storage/azure-storage-blobs/CMakeLists.txt b/sdk/storage/azure-storage-blobs/CMakeLists.txt index 9cb06ad5b6..5507355f01 100644 --- a/sdk/storage/azure-storage-blobs/CMakeLists.txt +++ b/sdk/storage/azure-storage-blobs/CMakeLists.txt @@ -32,9 +32,9 @@ if(FETCH_SOURCE_DEPS) add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL) endforeach() elseif(NOT AZ_ALL_LIBRARIES) - find_package(azure-storage-common-cpp CONFIG QUIET) + find_package(azure-storage-common-cpp "12.3.0" CONFIG QUIET) if(NOT azure-storage-common-cpp_FOUND) - find_package(azure-storage-common-cpp REQUIRED) + find_package(azure-storage-common-cpp "12.3.0" REQUIRED) endif() endif() diff --git a/sdk/storage/azure-storage-blobs/cgmanifest.json b/sdk/storage/azure-storage-blobs/cgmanifest.json index 728e7b7085..4ac5c618a3 100644 --- a/sdk/storage/azure-storage-blobs/cgmanifest.json +++ b/sdk/storage/azure-storage-blobs/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/storage/azure-storage-blobs/src/blob_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_client.cpp index e391f3e376..9ee05b2c7f 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_client.cpp @@ -419,8 +419,6 @@ namespace Azure { namespace Storage { namespace Blobs { firstChunkOptions.Range.Value().Length = firstChunkLength; } - _internal::FileWriter fileWriter(fileName); - auto firstChunk = Download(firstChunkOptions, context); const Azure::ETag eTag = firstChunk.Value.Details.ETag; @@ -461,6 +459,7 @@ namespace Azure { namespace Storage { namespace Blobs { } }; + _internal::FileWriter fileWriter(fileName); bodyStreamToFile(*(firstChunk.Value.BodyStream), fileWriter, 0, firstChunkLength, context); firstChunk.Value.BodyStream.reset(); diff --git a/sdk/storage/azure-storage-blobs/src/private/package_version.hpp b/sdk/storage/azure-storage-blobs/src/private/package_version.hpp index 86c7dd8e07..6f21bf905b 100644 --- a/sdk/storage/azure-storage-blobs/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-blobs/src/private/package_version.hpp @@ -9,9 +9,9 @@ #pragma once #define AZURE_STORAGE_BLOBS_VERSION_MAJOR 12 -#define AZURE_STORAGE_BLOBS_VERSION_MINOR 6 +#define AZURE_STORAGE_BLOBS_VERSION_MINOR 7 #define AZURE_STORAGE_BLOBS_VERSION_PATCH 0 -#define AZURE_STORAGE_BLOBS_VERSION_PRERELEASE "beta.2" +#define AZURE_STORAGE_BLOBS_VERSION_PRERELEASE "beta.1" #define AZURE_STORAGE_BLOBS_VERSION_ITOA_HELPER(i) #i #define AZURE_STORAGE_BLOBS_VERSION_ITOA(i) AZURE_STORAGE_BLOBS_VERSION_ITOA_HELPER(i) diff --git a/sdk/storage/azure-storage-blobs/src/rest_client.cpp b/sdk/storage/azure-storage-blobs/src/rest_client.cpp index 1678ac9b72..22277f0397 100644 --- a/sdk/storage/azure-storage-blobs/src/rest_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/rest_client.cpp @@ -6023,8 +6023,11 @@ namespace Azure { namespace Storage { namespace Blobs { = Core::Convert::Base64Decode(pRawResponse->GetHeaders().at("x-ms-content-crc64")); response.TransactionalContentHash.Value().Algorithm = HashAlgorithm::Crc64; } - response.SequenceNumber - = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); + if (pRawResponse->GetHeaders().count("x-ms-blob-sequence-number") != 0) + { + response.SequenceNumber + = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); + } response.IsServerEncrypted = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0) @@ -6132,8 +6135,11 @@ namespace Azure { namespace Storage { namespace Blobs { response.LastModified = DateTime::Parse( pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); } - response.SequenceNumber - = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); + if (pRawResponse->GetHeaders().count("x-ms-blob-sequence-number") != 0) + { + response.SequenceNumber + = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); + } return Response(std::move(response), std::move(pRawResponse)); } Response PageBlobClient::UploadPagesFromUri( @@ -6292,8 +6298,11 @@ namespace Azure { namespace Storage { namespace Blobs { = Core::Convert::Base64Decode(pRawResponse->GetHeaders().at("x-ms-content-crc64")); response.TransactionalContentHash.Value().Algorithm = HashAlgorithm::Crc64; } - response.SequenceNumber - = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); + if (pRawResponse->GetHeaders().count("x-ms-blob-sequence-number") != 0) + { + response.SequenceNumber + = std::stoll(pRawResponse->GetHeaders().at("x-ms-blob-sequence-number")); + } response.IsServerEncrypted = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0) diff --git a/sdk/storage/azure-storage-blobs/swagger/README.md b/sdk/storage/azure-storage-blobs/swagger/README.md index 2b34011ca2..66b8270fd4 100644 --- a/sdk/storage/azure-storage-blobs/swagger/README.md +++ b/sdk/storage/azure-storage-blobs/swagger/README.md @@ -515,6 +515,26 @@ directive: }); } } + - from: swagger-document + where: $ + transform: > + const operations = [ + "PageBlob_UploadPages", + "PageBlob_ClearPages", + "PageBlob_UploadPagesFromUri", + ]; + for (const url in $["x-ms-paths"]) { + for (const verb in $["x-ms-paths"][url]) { + if (!operations.includes($["x-ms-paths"][url][verb].operationId)) continue; + const operation = $["x-ms-paths"][url][verb]; + + const status_codes = Object.keys(operation.responses).filter(s => s !== "default"); + status_codes.forEach((status_code, i) => { + operation.responses[status_code].headers["x-ms-blob-sequence-number"]["x-ms-client-default"] = "int64_t()"; + operation.responses[status_code].headers["x-ms-blob-sequence-number"]["x-nullable"] = true; + }); + } + } ``` ### GetBlobServiceProperties diff --git a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp index 5e7b2e28f1..2caf96652e 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp @@ -1387,6 +1387,15 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_TRUE(exceptionCaught); } + TEST_F(BlockBlobClientTest, DownloadNonExistingToFile) + { + const auto testName(GetTestName()); + auto blockBlobClient = GetBlockBlobClient(testName); + + EXPECT_THROW(blockBlobClient.DownloadTo(testName), StorageException); + EXPECT_THROW(ReadFile(testName), std::runtime_error); + } + TEST_F(BlockBlobClientTest, DeleteIfExists) { auto const testName(GetTestName()); diff --git a/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json new file mode 100644 index 0000000000..8cee2024bb --- /dev/null +++ b/sdk/storage/azure-storage-blobs/test/ut/recordings/BlockBlobClientTest.DownloadNonExistingToFile.json @@ -0,0 +1,69 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6a753b0a-bcac-4076-6909-4141c56901df", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:39 GMT", + "etag": "\"0x8DA89AB0E7605FE\"", + "last-modified": "Mon, 29 Aug 2022 10:41:40 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6a753b0a-bcac-4076-6909-4141c56901df", + "x-ms-request-id": "0a7e509f-001e-0034-4d93-bbe90a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestdownloadnonexistingtofile?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3b4bb7fa-3c30-4c2c-5fb9-693daa5a8fa2", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "BlobNotFoundThe specified blob does not exist.\nRequestId:0a7e5112-001e-0034-2c93-bbe90a000000\nTime:2022-08-29T10:41:41.1529398Z", + "REASON_PHRASE": "The specified blob does not exist.", + "STATUS_CODE": "404", + "content-length": "215", + "content-type": "application/xml", + "date": "Mon, 29 Aug 2022 10:41:40 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "3b4bb7fa-3c30-4c2c-5fb9-693daa5a8fa2", + "x-ms-error-code": "BlobNotFound", + "x-ms-request-id": "0a7e5112-001e-0034-2c93-bbe90a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestdownloadnonexistingtofile/DownloadNonExistingToFile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "fbed990d-4365-423a-718f-b1d64df6aa49", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:40 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "fbed990d-4365-423a-718f-b1d64df6aa49", + "x-ms-request-id": "0a7e52c7-001e-0034-2993-bbe90a000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/blockblobclienttestdownloadnonexistingtofile?restype=container" + } + ] +} diff --git a/sdk/storage/azure-storage-blobs/vcpkg.json b/sdk/storage/azure-storage-blobs/vcpkg.json index 2fc9d767eb..ae37d635b5 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg.json +++ b/sdk/storage/azure-storage-blobs/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-blobs-cpp", - "version-semver": "12.6.0-beta.1", + "version-semver": "12.6.1", "description": [ "Microsoft Azure Storage Blobs SDK for C++", "This library provides Azure Storage Blobs SDK." @@ -11,7 +11,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.3.0-beta.1" + "version>=": "12.3.0" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in index 99a32a3442..fdb76b47cb 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in +++ b/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in @@ -4,7 +4,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(azure-storage-common-cpp "12.3.0-beta.1") +find_dependency(azure-storage-common-cpp "12.3.0") include("${CMAKE_CURRENT_LIST_DIR}/azure-storage-blobs-cppTargets.cmake") diff --git a/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json b/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json index 8b020d6eff..7f52fd3919 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json +++ b/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.3.0-beta.1" + "version>=": "12.3.0" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-common/CHANGELOG.md b/sdk/storage/azure-storage-common/CHANGELOG.md index 10404b2873..00e7917d36 100644 --- a/sdk/storage/azure-storage-common/CHANGELOG.md +++ b/sdk/storage/azure-storage-common/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.3.0-beta.2 (Unreleased) +## 12.4.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 12.3.0 (2022-09-06) + +### Features Added + +- Features in `12.3.0-beta.1` are now generally available. + ## 12.3.0-beta.1 (2022-08-09) ### Features Added diff --git a/sdk/storage/azure-storage-common/cgmanifest.json b/sdk/storage/azure-storage-common/cgmanifest.json index 568ceec412..5a5f148d9c 100644 --- a/sdk/storage/azure-storage-common/cgmanifest.json +++ b/sdk/storage/azure-storage-common/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/storage/azure-storage-common/src/private/package_version.hpp b/sdk/storage/azure-storage-common/src/private/package_version.hpp index 009cfc55f3..2c728abf54 100644 --- a/sdk/storage/azure-storage-common/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-common/src/private/package_version.hpp @@ -11,7 +11,7 @@ #include #define AZURE_STORAGE_COMMON_VERSION_MAJOR 12 -#define AZURE_STORAGE_COMMON_VERSION_MINOR 3 +#define AZURE_STORAGE_COMMON_VERSION_MINOR 4 #define AZURE_STORAGE_COMMON_VERSION_PATCH 0 #define AZURE_STORAGE_COMMON_VERSION_PRERELEASE "beta.2" diff --git a/sdk/storage/azure-storage-common/vcpkg.json b/sdk/storage/azure-storage-common/vcpkg.json index 10a5ae49ec..ec2e2bcc10 100644 --- a/sdk/storage/azure-storage-common/vcpkg.json +++ b/sdk/storage/azure-storage-common/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-common-cpp", - "version-semver": "12.3.0-beta.1", + "version-semver": "12.3.0", "description": [ "Microsoft Azure Common Storage SDK for C++", "This library provides common Azure Storage-related abstractions for Azure SDK." diff --git a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md index bb58111746..befcee05ce 100644 --- a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md @@ -9,6 +9,7 @@ ### Bugs Fixed - Fixed a bug where file/directory renaming cannot be authenticated with SAS. +- Empty file or existing file won't be created/overwritten if the file to be downloaded doesn't exist. ### Other Changes diff --git a/sdk/storage/azure-storage-files-datalake/cgmanifest.json b/sdk/storage/azure-storage-files-datalake/cgmanifest.json index 728e7b7085..4ac5c618a3 100644 --- a/sdk/storage/azure-storage-files-datalake/cgmanifest.json +++ b/sdk/storage/azure-storage-files-datalake/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp index cc4c6c5a70..05aaf8de74 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp @@ -123,7 +123,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * @brief Renames a file. By default, the destination is overwritten and * if the destination already exists and has a lease the lease is broken. * @param fileName The file that gets renamed. - * @param destinationFilePath The path of the file the source file is renaming to. + * @param destinationFilePath The path of the file the source file is renaming to. The + * destination is an absolute path under the root of the file system, without leading slash. * @param options Optional parameters to rename a file. * @param context Context for cancelling long running operations. * @return Azure::Response The client targets the renamed file. @@ -140,6 +141,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * if the destination already exists and has a lease the lease is broken. * @param subdirectoryName The subdirectory that gets renamed. * @param destinationDirectoryPath The destinationPath the source subdirectory is renaming to. + * The destination is an absolute path under the root of the file system, without leading slash. * @param options Optional parameters to rename a directory. * @param context Context for cancelling long running operations. * @return Azure::Response The client targets the renamed diff --git a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp index abceb5f32b..099135cd54 100644 --- a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_file_client_test.cpp @@ -349,6 +349,15 @@ namespace Azure { namespace Storage { namespace Test { fileClient.Delete(); } + TEST_F(DataLakeFileClientTest, DownloadNonExistingToFile) + { + const auto testName(GetTestName()); + auto fileClient = m_fileSystemClient->GetFileClient(testName); + + EXPECT_THROW(fileClient.DownloadTo(testName), StorageException); + EXPECT_THROW(ReadFile(testName), std::runtime_error); + } + TEST_F(DataLakeFileClientTest, ScheduleForDeletion) { { diff --git a/sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json b/sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json new file mode 100644 index 0000000000..924992437a --- /dev/null +++ b/sdk/storage/azure-storage-files-datalake/test/ut/recordings/DataLakeFileClientTest.DownloadNonExistingToFile.json @@ -0,0 +1,111 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "22f683cd-fbdf-4223-51dd-a86271428dfc", + "x-ms-version": "2021-04-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:59 GMT", + "etag": "\"0x8DA89AAF65783FA\"", + "last-modified": "Mon, 29 Aug 2022 10:40:59 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "22f683cd-fbdf-4223-51dd-a86271428dfc", + "x-ms-request-id": "30e6f346-101e-0047-3093-bb26fb000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/datalakefileclienttestdownloadnonexistingtofile?restype=container" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-datalake/12.4.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "88ef55a1-2b5f-41a6-74eb-54a5bdfe93cf", + "x-ms-version": "2020-02-10" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:00 GMT", + "etag": "\"0x8DA89AAF74A9F21\"", + "last-modified": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "88ef55a1-2b5f-41a6-74eb-54a5bdfe93cf", + "x-ms-request-id": "774068d3-e01f-0021-5e93-bb69db000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2020-02-10" + }, + "Url": "https://REDACTED.dfs.core.windows.net/datalakefileclienttestdownloadnonexistingtofile/datalakefileclienttestdownloadnonexistingtofile?resource=file" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b096b2d7-898d-4e0b-4595-0d12d95f44cb", + "x-ms-version": "2021-04-10" + }, + "Method": "GET", + "Response": { + "BODY": "BlobNotFoundThe specified blob does not exist.\nRequestId:30e6f409-101e-0047-5193-bb26fb000000\nTime:2022-08-29T10:41:01.6071578Z", + "REASON_PHRASE": "The specified blob does not exist.", + "STATUS_CODE": "404", + "content-length": "215", + "content-type": "application/xml", + "date": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b096b2d7-898d-4e0b-4595-0d12d95f44cb", + "x-ms-error-code": "BlobNotFound", + "x-ms-request-id": "30e6f409-101e-0047-5193-bb26fb000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/datalakefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-datalake/12.4.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b55f5684-ae63-4d44-6556-b675337f7d74", + "x-ms-version": "2020-02-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b55f5684-ae63-4d44-6556-b675337f7d74", + "x-ms-request-id": "7740698c-e01f-0021-1693-bb69db000000", + "x-ms-version": "2020-02-10" + }, + "Url": "https://REDACTED.dfs.core.windows.net/datalakefileclienttestdownloadnonexistingtofile/datalakefileclienttestdownloadnonexistingtofile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-blobs/12.6.0-beta.2 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6dae38d5-428b-49c8-6de2-bfea67acb620", + "x-ms-version": "2021-04-10" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:41:01 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6dae38d5-428b-49c8-6de2-bfea67acb620", + "x-ms-request-id": "30e6f436-101e-0047-7c93-bb26fb000000", + "x-ms-version": "2021-04-10" + }, + "Url": "https://REDACTED.blob.core.windows.net/datalakefileclienttestdownloadnonexistingtofile?restype=container" + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/CHANGELOG.md b/sdk/storage/azure-storage-files-shares/CHANGELOG.md index 4c3a1c762c..dd7a4f26f6 100644 --- a/sdk/storage/azure-storage-files-shares/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-shares/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.3.0-beta.1 (Unreleased) +## 12.3.0-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,24 @@ ### Other Changes +## 12.3.0-beta.1 (2022-09-06) + +### Features Added + +- Bumped up API version to `2021-06-08`. +- Added fields `ProvisionedBandwidthMBps`, `EnabledProtocols` and `RootSquash` in `ShareItemDetails` and `ShareProperties`. +- Added support for listing files with extended information. +- Added new APIs: + - ShareDirectoryClient::RenameFile() + - ShareDirectoryClient::RenameSubdirectory() + - ShareLeaseClient::Renew() +- Added support for specifying last written time when uploading file range. +- Added support for specifying file changed time when creating/copying file or setting file properties. + +### Bugs Fixed + +- Empty file or existing file won't be created/overwritten if the file to be downloaded doesn't exist. + ## 12.2.1 (2022-03-09) ### Other Changes diff --git a/sdk/storage/azure-storage-files-shares/CMakeLists.txt b/sdk/storage/azure-storage-files-shares/CMakeLists.txt index dd8e913086..130a753804 100644 --- a/sdk/storage/azure-storage-files-shares/CMakeLists.txt +++ b/sdk/storage/azure-storage-files-shares/CMakeLists.txt @@ -32,9 +32,9 @@ if(FETCH_SOURCE_DEPS) add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL) endforeach() elseif(NOT AZ_ALL_LIBRARIES) - find_package(azure-storage-common-cpp "12.2.2" CONFIG QUIET) + find_package(azure-storage-common-cpp "12.3.0" CONFIG QUIET) if(NOT azure-storage-common-cpp_FOUND) - find_package(azure-storage-common-cpp "12.2.2" REQUIRED) + find_package(azure-storage-common-cpp "12.3.0" REQUIRED) endif() endif() diff --git a/sdk/storage/azure-storage-files-shares/cgmanifest.json b/sdk/storage/azure-storage-files-shares/cgmanifest.json index 728e7b7085..4ac5c618a3 100644 --- a/sdk/storage/azure-storage-files-shares/cgmanifest.json +++ b/sdk/storage/azure-storage-files-shares/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp index d5881956ac..92e0068eab 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp @@ -31,7 +31,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * The version used for the operations to Azure storage services. */ - constexpr static const char* ApiVersion = "2020-02-10"; + constexpr static const char* ApiVersion = "2021-06-08"; } // namespace _detail namespace Models { /** @@ -232,6 +232,39 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { AZ_STORAGE_FILES_SHARES_DLLEXPORT const static LeaseDurationType Infinite; AZ_STORAGE_FILES_SHARES_DLLEXPORT const static LeaseDurationType Fixed; + private: + std::string m_value; + }; + /** + * @brief The protocols that have been enabled on the share. + */ + class ShareProtocols final { + public: + ShareProtocols() = default; + explicit ShareProtocols(std::string value) : m_value(std::move(value)) {} + bool operator==(const ShareProtocols& other) const { return m_value == other.m_value; } + bool operator!=(const ShareProtocols& other) const { return !(*this == other); } + const std::string& ToString() const { return m_value; } + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareProtocols Smb; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareProtocols Nfs; + + private: + std::string m_value; + }; + /** + * @brief Root squash to set on the share. Only valid for NFS shares. + */ + class ShareRootSquash final { + public: + ShareRootSquash() = default; + explicit ShareRootSquash(std::string value) : m_value(std::move(value)) {} + bool operator==(const ShareRootSquash& other) const { return m_value == other.m_value; } + bool operator!=(const ShareRootSquash& other) const { return !(*this == other); } + const std::string& ToString() const { return m_value; } + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareRootSquash NoRootSquash; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareRootSquash RootSquash; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareRootSquash AllSquash; + private: std::string m_value; }; @@ -246,6 +279,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable ProvisionedIops; Nullable ProvisionedIngressMBps; Nullable ProvisionedEgressMBps; + Nullable ProvisionedBandwidthMBps; Nullable NextAllowedQuotaDowngradeTime; Nullable DeletedOn; int32_t RemainingRetentionDays = int32_t(); @@ -267,6 +301,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * When a share is leased, specifies whether the lease is of infinite or fixed duration. */ LeaseDurationType LeaseDuration; + Nullable EnabledProtocols; + Nullable RootSquash; }; /** * @brief A listed Azure Storage share item. @@ -408,6 +444,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * Returns the current share next allowed quota downgrade time. */ Nullable NextAllowedQuotaDowngradeTime; + /** + * Returns the current share provisioned bandwidth in megabits per second. + */ + Nullable ProvisionedBandwidthMBps; /** * When a share is leased, specifies whether the lease is of infinite or fixed duration. */ @@ -428,6 +468,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * Returns the transition state between access tiers, when present. */ Nullable AccessTierTransitionState; + /** + * The protocols that have been enabled on the share. + */ + Nullable EnabledProtocols; + /** + * Valid for NFS shares only. + */ + Nullable RootSquash; }; /** * @brief Specifies the option include to delete the base share and all of its snapshots. @@ -555,10 +603,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * Approximate time remaining in the lease period, in seconds. */ int32_t LeaseTime = int32_t(); - /** - * Uniquely identifies a share's lease. - */ - std::string LeaseId; }; } // namespace _detail /** @@ -912,12 +956,29 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { */ bool IsServerEncrypted = bool(); }; + /** + * @brief File properties. + */ + struct DirectoryItemDetails final + { + Nullable LastAccessedOn; + DateTime LastModified; + ETag Etag; + /** + * The SMB related properties for the file. + */ + FileSmbProperties SmbProperties; + }; /** * @brief A listed directory item. */ struct DirectoryItem final { std::string Name; + /** + * File properties. + */ + DirectoryItemDetails Details; }; /** * @brief File properties. @@ -931,6 +992,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * File Properties. */ int64_t FileSize = int64_t(); + Nullable LastAccessedOn; + DateTime LastModified; + ETag Etag; + /** + * The SMB related properties for the file. + */ + FileSmbProperties SmbProperties; }; /** * @brief A listed file item. @@ -958,6 +1026,39 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { */ std::vector FileItems; }; + } // namespace _detail + /** + * @brief Include this parameter to specify one or more datasets to include in the response. + */ + enum class ListFilesIncludeFlags + { + None = 0, + Timestamps = 1, + ETag = 2, + Attributes = 4, + PermissionKey = 8, + }; + inline ListFilesIncludeFlags operator|(ListFilesIncludeFlags lhs, ListFilesIncludeFlags rhs) + { + using type = std::underlying_type_t; + return static_cast(static_cast(lhs) | static_cast(rhs)); + } + inline ListFilesIncludeFlags& operator|=(ListFilesIncludeFlags& lhs, ListFilesIncludeFlags rhs) + { + lhs = lhs | rhs; + return lhs; + } + inline ListFilesIncludeFlags operator&(ListFilesIncludeFlags lhs, ListFilesIncludeFlags rhs) + { + using type = std::underlying_type_t; + return static_cast(static_cast(lhs) & static_cast(rhs)); + } + inline ListFilesIncludeFlags& operator&=(ListFilesIncludeFlags& lhs, ListFilesIncludeFlags rhs) + { + lhs = lhs & rhs; + return lhs; + } + namespace _detail { /** * @brief An enumeration of directories and files. */ @@ -975,6 +1076,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { */ FilesAndDirectoriesListSegment Segment; std::string NextMarker; + Nullable DirectoryId; }; } // namespace _detail /** @@ -1036,6 +1138,55 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { */ int32_t NumberOfHandlesFailedToClose = int32_t(); }; + /** + * @brief Response type for #Azure::Storage::Files::Shares::DirectoryClient::Rename. + */ + struct RenameDirectoryResult final + { + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * directory or its properties updates the last modified time. Operations on files do not + * affect the last modified time of the directory. + */ + DateTime LastModified; + /** + * The value of this header is set to true if the contents of the request are successfully + * encrypted using the specified algorithm, and false otherwise. + */ + bool IsServerEncrypted = bool(); + /** + * Key of the permission set for the file. + */ + std::string FilePermissionKey; + /** + * Attributes set for the file. + */ + std::string FileAttributes; + /** + * Creation time for the file. + */ + DateTime FileCreationTime; + /** + * Last write time for the file. + */ + DateTime FileLastWriteTime; + /** + * Change time for the file. + */ + DateTime FileChangeTime; + /** + * The fileId of the file. + */ + std::string FileId; + /** + * The parent fileId of the directory. + */ + std::string FileParentId; + }; } // namespace _detail /** * @brief Response type for #Azure::Storage::Files::Shares::FileClient::Create. @@ -1438,6 +1589,22 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { DateTime LastModified; }; } // namespace _detail + /** + * @brief If the file last write time should be preserved or overwritten. + */ + class FileLastWrittenMode final { + public: + FileLastWrittenMode() = default; + explicit FileLastWrittenMode(std::string value) : m_value(std::move(value)) {} + bool operator==(const FileLastWrittenMode& other) const { return m_value == other.m_value; } + bool operator!=(const FileLastWrittenMode& other) const { return !(*this == other); } + const std::string& ToString() const { return m_value; } + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileLastWrittenMode Now; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileLastWrittenMode Preserve; + + private: + std::string m_value; + }; /** * @brief Response type for #Azure::Storage::Files::Shares::FileClient::UploadRange. */ @@ -1602,6 +1769,55 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { */ int32_t NumberOfHandlesFailedToClose = int32_t(); }; + /** + * @brief Response type for #Azure::Storage::Files::Shares::FileClient::Rename. + */ + struct RenameFileResult final + { + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * directory or its properties updates the last modified time. Operations on files do not + * affect the last modified time of the directory. + */ + DateTime LastModified; + /** + * The value of this header is set to true if the contents of the request are successfully + * encrypted using the specified algorithm, and false otherwise. + */ + bool IsServerEncrypted = bool(); + /** + * Key of the permission set for the file. + */ + std::string FilePermissionKey; + /** + * Attributes set for the file. + */ + std::string FileAttributes; + /** + * Creation time for the file. + */ + DateTime FileCreationTime; + /** + * Last write time for the file. + */ + DateTime FileLastWriteTime; + /** + * Change time for the file. + */ + DateTime FileChangeTime; + /** + * The fileId of the file. + */ + std::string FileId; + /** + * The parent fileId of the directory. + */ + std::string FileParentId; + }; } // namespace _detail } // namespace Models namespace _detail { @@ -1644,6 +1860,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::map Metadata; Nullable Quota; Nullable AccessTier; + Nullable EnabledProtocols; + Nullable RootSquash; }; static Response Create( Core::Http::_internal::HttpPipeline& pipeline, @@ -1756,6 +1974,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable Quota; Nullable AccessTier; Nullable LeaseId; + Nullable RootSquash; }; static Response SetProperties( Core::Http::_internal::HttpPipeline& pipeline, @@ -1809,8 +2028,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FilePermission; Nullable FilePermissionKey; std::string FileAttributes; - std::string FileCreationTime; - std::string FileLastWriteTime; + Nullable FileCreationTime; + Nullable FileLastWriteTime; + Nullable FileChangeTime; }; static Response Create( Core::Http::_internal::HttpPipeline& pipeline, @@ -1839,8 +2059,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FilePermission; Nullable FilePermissionKey; std::string FileAttributes; - std::string FileCreationTime; - std::string FileLastWriteTime; + Nullable FileCreationTime; + Nullable FileLastWriteTime; + Nullable FileChangeTime; }; static Response SetProperties( Core::Http::_internal::HttpPipeline& pipeline, @@ -1862,6 +2083,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable Sharesnapshot; Nullable Marker; Nullable MaxResults; + Nullable Include; + Nullable IncludeExtendedInfo; }; static Response ListFilesAndDirectoriesSegment( @@ -1893,6 +2116,26 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Url& url, const ForceDirectoryCloseHandlesOptions& options, const Core::Context& context); + struct RenameDirectoryOptions final + { + std::string RenameSource; + Nullable ReplaceIfExists; + Nullable IgnoreReadOnly; + Nullable SourceLeaseId; + Nullable DestinationLeaseId; + Nullable FileAttributes; + Nullable FileCreationTime; + Nullable FileLastWriteTime; + Nullable FileChangeTime; + Nullable FilePermission; + Nullable FilePermissionKey; + std::map Metadata; + }; + static Response Rename( + Core::Http::_internal::HttpPipeline& pipeline, + const Core::Url& url, + const RenameDirectoryOptions& options, + const Core::Context& context); }; class FileClient final { public: @@ -1909,8 +2152,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FilePermission; Nullable FilePermissionKey; std::string FileAttributes; - std::string FileCreationTime; - std::string FileLastWriteTime; + Nullable FileCreationTime; + Nullable FileLastWriteTime; + Nullable FileChangeTime; Nullable LeaseId; }; static Response Create( @@ -1960,8 +2204,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FilePermission; Nullable FilePermissionKey; std::string FileAttributes; - std::string FileCreationTime; - std::string FileLastWriteTime; + Nullable FileCreationTime; + Nullable FileLastWriteTime; + Nullable FileChangeTime; Nullable LeaseId; }; static Response SetHttpHeaders( @@ -2023,6 +2268,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string FileRangeWrite; Nullable> ContentMD5; Nullable LeaseId; + Nullable FileLastWrittenMode; }; static Response UploadRange( Core::Http::_internal::HttpPipeline& pipeline, @@ -2039,6 +2285,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable> SourceIfMatchCrc64; Nullable> SourceIfNoneMatchCrc64; Nullable LeaseId; + Nullable CopySourceAuthorization; + Nullable FileLastWrittenMode; }; static Response UploadRangeFromUri( Core::Http::_internal::HttpPipeline& pipeline, @@ -2068,6 +2316,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FileAttributes; Nullable FileCreationTime; Nullable FileLastWriteTime; + Nullable FileChangeTime; Nullable SetArchiveAttribute; Nullable LeaseId; }; @@ -2108,6 +2357,27 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Url& url, const ForceFileCloseHandlesOptions& options, const Core::Context& context); + struct RenameFileOptions final + { + std::string RenameSource; + Nullable ReplaceIfExists; + Nullable IgnoreReadOnly; + Nullable SourceLeaseId; + Nullable DestinationLeaseId; + Nullable FileAttributes; + Nullable FileCreationTime; + Nullable FileLastWriteTime; + Nullable FileChangeTime; + Nullable FilePermission; + Nullable FilePermissionKey; + std::map Metadata; + Nullable FileContentType; + }; + static Response Rename( + Core::Http::_internal::HttpPipeline& pipeline, + const Core::Url& url, + const RenameFileOptions& options, + const Core::Context& context); }; } // namespace _detail }}}} // namespace Azure::Storage::Files::Shares \ No newline at end of file diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp index ef3f2f61ab..2c4b88032e 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp @@ -113,6 +113,39 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const CreateDirectoryOptions& options = CreateDirectoryOptions(), const Azure::Core::Context& context = Azure::Core::Context()) const; + /** + * @brief Renames a file. This API does not support renaming a file + * from one share to another, or between storage accounts. + * @param fileName The file that gets renamed. + * @param destinationFilePath The path of the file the source file is renaming to. The + * destination is an absolute path under the root of the share, without leading slash. + * @param options Optional parameters to rename a file. + * @param context Context for cancelling long running operations. + * @return Azure::Response The client targets the renamed file. + */ + Azure::Response RenameFile( + const std::string& fileName, + const std::string& destinationFilePath, + const RenameFileOptions& options = RenameFileOptions(), + const Azure::Core::Context& context = Azure::Core::Context()) const; + + /** + * @brief Renames a directory. This API does not support renaming a directory + * from one share to another, or between storage accounts. + * @param subdirectoryName The subdirectory that gets renamed. + * @param destinationDirectoryPath The destinationPath the source subdirectory is renaming to. + * The destination is an absolute path under the root of the share, without leading slash. + * @param options Optional parameters to rename a directory. + * @param context Context for cancelling long running operations. + * @return Azure::Response The client targets the renamed + * directory. + */ + Azure::Response RenameSubdirectory( + const std::string& subdirectoryName, + const std::string& destinationDirectoryPath, + const RenameDirectoryOptions& options = RenameDirectoryOptions(), + const Azure::Core::Context& context = Azure::Core::Context()) const; + /** * @brief Deletes the directory. * @param options Optional parameters to delete this directory. diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_lease_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_lease_client.hpp index 27f4944ea0..44b4a19632 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_lease_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_lease_client.hpp @@ -28,6 +28,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { } + /** + * @brief Initializes a new instance of the ShareLeaseClient. + * + * @param shareClient A ShareClient representing the share being leased. + * @param leaseId A lease ID. This is not required for break operation. + */ + explicit ShareLeaseClient(ShareClient shareClient, std::string leaseId) + : m_shareClient(std::move(shareClient)), m_leaseId(std::move(leaseId)) + { + } + /** * @brief Gets a unique lease ID. * @@ -66,6 +77,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const AcquireLeaseOptions& options = AcquireLeaseOptions(), const Azure::Core::Context& context = Azure::Core::Context()); + /** + * @brief Renews the share's previously-acquired lease. + * + * @param options Optional parameters to execute this function. + * @param context Context for cancelling long running operations. + * @return A RenewLeaseResult describing the lease. + */ + Azure::Response Renew( + const RenewLeaseOptions& options = RenewLeaseOptions(), + const Azure::Core::Context& context = Azure::Core::Context()); + /** * @brief Releases the file or share's previously-acquired lease. * @@ -103,28 +125,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Azure::Core::Context& context = Azure::Core::Context()); private: - /** - * @brief Initializes a new instance of the ShareLeaseClient. - * - * @param shareClient A ShareClient representing the share being leased. - * @param leaseId A lease ID. This is not required for break operation. - */ - explicit ShareLeaseClient(ShareClient shareClient, std::string leaseId) - : m_shareClient(std::move(shareClient)), m_leaseId(std::move(leaseId)) - { - } - - /** - * @brief Renews the file or share's previously-acquired lease. - * - * @param options Optional parameters to execute this function. - * @param context Context for cancelling long running operations. - * @return A RenewLeaseResult describing the lease. - */ - Azure::Response Renew( - const RenewLeaseOptions& options = RenewLeaseOptions(), - const Azure::Core::Context& context = Azure::Core::Context()); - Azure::Nullable m_fileClient; Azure::Nullable m_shareClient; std::mutex m_mutex; diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp index ac87d8d82d..43d453be44 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp @@ -97,6 +97,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * Specifies the maximum size of the share, in gigabytes. */ Azure::Nullable ShareQuotaInGiB; + + /** + * Specifies the enabled protocols on the share. If they're not specified, the default is SMB. + */ + Azure::Nullable EnabledProtocols; + + /** + * Specifies the root squashing behavior on the share when NFS is enabled. If it's not + * specified, the default is NoRootSquash. + */ + Azure::Nullable RootSquash; }; /** @@ -143,6 +154,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * Specifies the maximum size of the share, in gigabytes. */ Azure::Nullable ShareQuotaInGiB; + + /** + * Specifies the root squashing behavior on the share when NFS is enabled. If it's not + * specified, the default is NoRootSquash. + */ + Azure::Nullable RootSquash; }; /** @@ -209,6 +226,108 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Models::FileSmbProperties SmbProperties; }; + /** + * @brief Optional parameters for + * #Azure::Storage::Files::Shares::ShareDirectoryClient::RenameFile. + */ + struct RenameFileOptions final + { + /** + * A boolean value for if the destination file already exists, whether this request will + * overwrite the file or not. If true, the rename will succeed and will overwrite the + * destination file. If not provided or if false and the destination file does exist, the + * request will not overwrite the destination file. If provided and the destination file doesn’t + * exist, the rename will succeed. + */ + Azure::Nullable ReplaceIfExists; + + /** + * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination + * file should be respected. If true, the rename will succeed, otherwise, a previous file at the + * destination with the ReadOnly attribute set will cause the rename to fail. ReplaceIfExists + * must also be true. + */ + Azure::Nullable IgnoreReadOnly; + + /** + * Specify the access condition for the path. + */ + LeaseAccessConditions AccessConditions; + + /** + * The access condition for source path. + */ + LeaseAccessConditions SourceAccessConditions; + + /** + * SMB properties to set for the directory. + */ + Models::FileSmbProperties SmbProperties; + + /** + * If specified the permission (security descriptor) shall be set for the directory. + * This option can be used if Permission size is <= 8KB, else SmbProperties.PermissionKey + * shall be used.A value of preserve may be passed to keep an existing value unchanged. + */ + Azure::Nullable FilePermission; + + /** + * A name-value pair to associate with a file storage object. + */ + Storage::Metadata Metadata; + }; + + /** + * @brief Optional parameters for + * #Azure::Storage::Files::Shares::ShareDirectoryClient::RenameSubdirectory. + */ + struct RenameDirectoryOptions final + { + /** + * A boolean value for if the destination directory already exists, whether this request will + * overwrite the file or not. If true, the rename will succeed and will overwrite the + * destination directory. If not provided or if false and the destination directory does exist, + * the request will not overwrite the destination directory. If provided and the destination + * file doesn’t exist, the rename will succeed. + */ + Azure::Nullable ReplaceIfExists; + + /** + * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination + * directory should be respected. If true, the rename will succeed, otherwise, a previous file + * at the destination with the ReadOnly attribute set will cause the rename to fail. + * ReplaceIfExists must also be true. + */ + Azure::Nullable IgnoreReadOnly; + + /** + * Specify the access condition for the path. + */ + LeaseAccessConditions AccessConditions; + + /** + * The access condition for source path. + */ + LeaseAccessConditions SourceAccessConditions; + + /** + * SMB properties to set for the directory. + */ + Models::FileSmbProperties SmbProperties; + + /** + * If specified the permission (security descriptor) shall be set for the directory. + * This option can be used if Permission size is <= 8KB, else SmbProperties.PermissionKey + * shall be used.A value of preserve may be passed to keep an existing value unchanged. + */ + Azure::Nullable FilePermission; + + /** + * A name-value pair to associate with a file storage object. + */ + Storage::Metadata Metadata; + }; + /** * @brief Optional parameters for #Azure::Storage::Files::Shares::ShareDirectoryClient::Delete. */ @@ -273,6 +392,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * items. */ Azure::Nullable PageSizeHint; + + /** + * Include this parameter to specify one or more datasets to include in the response. + */ + Models::ListFilesIncludeFlags Include = Models::ListFilesIncludeFlags ::None; + + /** + * This header is implicitly assumed to be true if include query parameter is not empty. If + * true, the Content-Length property will be up to date. + */ + Nullable IncludeExtendedInfo; }; /** @@ -514,6 +644,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * The operation will only succeed if the access condition is met. */ LeaseAccessConditions AccessConditions; + + /** + * Specifies if the file last write time should be set to the current time, + * or the last write time currently associated with the file should be preserved. + */ + Azure::Nullable FileLastWrittenMode; }; /** @@ -525,6 +661,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * The operation will only succeed if the access condition is met. */ LeaseAccessConditions AccessConditions; + + /** + * Specifies if the file last write time should be set to the current time, + * or the last write time currently associated with the file should be preserved. + */ + Azure::Nullable FileLastWrittenMode; }; /** @@ -548,6 +690,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * The operation will only succeed if the lease access condition is met. */ LeaseAccessConditions AccessConditions; + + /** + * Specifies if the file last write time should be set to the current time, + * or the last write time currently associated with the file should be preserved. + */ + Azure::Nullable FileLastWrittenMode; }; /** diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp index 4a48f4cff7..e8289b2299 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp @@ -296,6 +296,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * File items. */ std::vector Files; + /** + * FileId of the directory. + */ + std::string DirectoryId; private: void OnNextPage(const Azure::Core::Context& context); diff --git a/sdk/storage/azure-storage-files-shares/src/private/package_version.hpp b/sdk/storage/azure-storage-files-shares/src/private/package_version.hpp index 8acadbcf6a..f6b599c768 100644 --- a/sdk/storage/azure-storage-files-shares/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-files-shares/src/private/package_version.hpp @@ -11,7 +11,7 @@ #define AZURE_STORAGE_FILES_SHARES_VERSION_MAJOR 12 #define AZURE_STORAGE_FILES_SHARES_VERSION_MINOR 3 #define AZURE_STORAGE_FILES_SHARES_VERSION_PATCH 0 -#define AZURE_STORAGE_FILES_SHARES_VERSION_PRERELEASE "beta.1" +#define AZURE_STORAGE_FILES_SHARES_VERSION_PRERELEASE "beta.2" #define AZURE_STORAGE_FILES_SHARES_VERSION_ITOA_HELPER(i) #i #define AZURE_STORAGE_FILES_SHARES_VERSION_ITOA(i) AZURE_STORAGE_FILES_SHARES_VERSION_ITOA_HELPER(i) diff --git a/sdk/storage/azure-storage-files-shares/src/rest_client.cpp b/sdk/storage/azure-storage-files-shares/src/rest_client.cpp index 9b3635e327..7100363a17 100644 --- a/sdk/storage/azure-storage-files-shares/src/rest_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/rest_client.cpp @@ -55,6 +55,35 @@ std::string ListSharesIncludeFlagsToString( } return ret; } +std::string ListFilesIncludeFlagsToString( + const Azure::Storage::Files::Shares::Models::ListFilesIncludeFlags& val) +{ + const Azure::Storage::Files::Shares::Models::ListFilesIncludeFlags valueList[] = { + Azure::Storage::Files::Shares::Models::ListFilesIncludeFlags::Timestamps, + Azure::Storage::Files::Shares::Models::ListFilesIncludeFlags::ETag, + Azure::Storage::Files::Shares::Models::ListFilesIncludeFlags::Attributes, + Azure::Storage::Files::Shares::Models::ListFilesIncludeFlags::PermissionKey, + }; + const char* stringList[] = { + "Timestamps", + "Etag", + "Attributes", + "PermissionKey", + }; + std::string ret; + for (size_t i = 0; i < 4; ++i) + { + if ((val & valueList[i]) == valueList[i]) + { + if (!ret.empty()) + { + ret += ","; + } + ret += stringList[i]; + } + } + return ret; +} } // namespace namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models { @@ -71,6 +100,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const LeaseState LeaseState::Broken("broken"); const LeaseDurationType LeaseDurationType::Infinite("infinite"); const LeaseDurationType LeaseDurationType::Fixed("fixed"); + const ShareProtocols ShareProtocols::Smb("SMB"); + const ShareProtocols ShareProtocols::Nfs("NFS"); + const ShareRootSquash ShareRootSquash::NoRootSquash("NoRootSquash"); + const ShareRootSquash ShareRootSquash::RootSquash("RootSquash"); + const ShareRootSquash ShareRootSquash::AllSquash("AllSquash"); const DeleteSnapshotsOption DeleteSnapshotsOption::Include("include"); FileAttributes::FileAttributes(const std::string& value) { @@ -153,6 +187,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const CopyStatus CopyStatus::Success("success"); const CopyStatus CopyStatus::Aborted("aborted"); const CopyStatus CopyStatus::Failed("failed"); + const FileLastWrittenMode FileLastWrittenMode::Now("now"); + const FileLastWrittenMode FileLastWrittenMode::Preserve("preserve"); const PermissionCopyMode PermissionCopyMode::Source("source"); const PermissionCopyMode PermissionCopyMode::Override("override"); } // namespace Models @@ -276,7 +312,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -296,7 +332,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -528,7 +564,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { _internal::UrlEncodeQueryParameter( ListSharesIncludeFlagsToString(options.Include.Value()))); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -561,6 +597,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { kProvisionedIops, kProvisionedIngressMBps, kProvisionedEgressMBps, + kProvisionedBandwidthMiBps, kNextAllowedQuotaDowngradeTime, kDeletedTime, kRemainingRetentionDays, @@ -570,6 +607,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { kLeaseStatus, kLeaseState, kLeaseDuration, + kEnabledProtocols, + kRootSquash, kNextMarker, }; const std::unordered_map XmlTagEnumMap{ @@ -591,6 +630,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { {"ProvisionedIops", XmlTagEnum::kProvisionedIops}, {"ProvisionedIngressMBps", XmlTagEnum::kProvisionedIngressMBps}, {"ProvisionedEgressMBps", XmlTagEnum::kProvisionedEgressMBps}, + {"ProvisionedBandwidthMiBps", XmlTagEnum::kProvisionedBandwidthMiBps}, {"NextAllowedQuotaDowngradeTime", XmlTagEnum::kNextAllowedQuotaDowngradeTime}, {"DeletedTime", XmlTagEnum::kDeletedTime}, {"RemainingRetentionDays", XmlTagEnum::kRemainingRetentionDays}, @@ -600,6 +640,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { {"LeaseStatus", XmlTagEnum::kLeaseStatus}, {"LeaseState", XmlTagEnum::kLeaseState}, {"LeaseDuration", XmlTagEnum::kLeaseDuration}, + {"EnabledProtocols", XmlTagEnum::kEnabledProtocols}, + {"RootSquash", XmlTagEnum::kRootSquash}, {"NextMarker", XmlTagEnum::kNextMarker}, }; std::vector xmlPath; @@ -724,6 +766,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { vectorElement1.Details.ProvisionedEgressMBps = std::stoi(node.Value); } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kShares && xmlPath[2] == XmlTagEnum::kShare + && xmlPath[3] == XmlTagEnum::kProperties + && xmlPath[4] == XmlTagEnum::kProvisionedBandwidthMiBps) + { + vectorElement1.Details.ProvisionedBandwidthMBps = std::stoi(node.Value); + } else if ( xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults && xmlPath[1] == XmlTagEnum::kShares && xmlPath[2] == XmlTagEnum::kShare @@ -795,6 +845,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { vectorElement1.Details.LeaseDuration = Models::LeaseDurationType(node.Value); } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kShares && xmlPath[2] == XmlTagEnum::kShare + && xmlPath[3] == XmlTagEnum::kProperties + && xmlPath[4] == XmlTagEnum::kEnabledProtocols) + { + vectorElement1.Details.EnabledProtocols = Models::ShareProtocols(node.Value); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kShares && xmlPath[2] == XmlTagEnum::kShare + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kRootSquash) + { + vectorElement1.Details.RootSquash = Models::ShareRootSquash(node.Value); + } else if ( xmlPath.size() == 2 && xmlPath[0] == XmlTagEnum::kEnumerationResults && xmlPath[1] == XmlTagEnum::kNextMarker) @@ -852,7 +917,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-access-tier", options.AccessTier.Value().ToString()); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); + if (options.EnabledProtocols.HasValue() + && !options.EnabledProtocols.Value().ToString().empty()) + { + request.SetHeader("x-ms-enabled-protocols", options.EnabledProtocols.Value().ToString()); + } + if (options.RootSquash.HasValue() && !options.RootSquash.Value().ToString().empty()) + { + request.SetHeader("x-ms-root-squash", options.RootSquash.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -878,7 +952,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -921,6 +995,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { pRawResponse->GetHeaders().at("x-ms-share-next-allowed-quota-downgrade-time"), Azure::DateTime::DateFormat::Rfc1123); } + if (pRawResponse->GetHeaders().count("x-ms-share-provisioned-bandwidth-mibps") != 0) + { + response.ProvisionedBandwidthMBps + = std::stoi(pRawResponse->GetHeaders().at("x-ms-share-provisioned-bandwidth-mibps")); + } if (pRawResponse->GetHeaders().count("x-ms-lease-duration") != 0) { response.LeaseDuration @@ -950,6 +1029,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { response.AccessTierTransitionState = pRawResponse->GetHeaders().at("x-ms-access-tier-transition-state"); } + if (pRawResponse->GetHeaders().count("x-ms-enabled-protocols") != 0) + { + response.EnabledProtocols + = Models::ShareProtocols(pRawResponse->GetHeaders().at("x-ms-enabled-protocols")); + } + if (pRawResponse->GetHeaders().count("x-ms-root-squash") != 0) + { + response.RootSquash + = Models::ShareRootSquash(pRawResponse->GetHeaders().at("x-ms-root-squash")); + } return Response(std::move(response), std::move(pRawResponse)); } Response ShareClient::Delete( @@ -965,7 +1054,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.DeleteSnapshots.HasValue() && !options.DeleteSnapshots.Value().ToString().empty()) { request.SetHeader("x-ms-delete-snapshots", options.DeleteSnapshots.Value().ToString()); @@ -1001,7 +1090,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1035,7 +1124,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1072,7 +1161,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1106,7 +1195,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1144,7 +1233,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1161,7 +1250,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { response.LastModified = DateTime::Parse( pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); response.LeaseTime = std::stoi(pRawResponse->GetHeaders().at("x-ms-lease-time")); - response.LeaseId = pRawResponse->GetHeaders().at("x-ms-lease-id"); return Response( std::move(response), std::move(pRawResponse)); } @@ -1178,7 +1266,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -1212,7 +1300,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "filepermission"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -1237,7 +1325,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-permission-key", options.FilePermissionKey); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1263,7 +1351,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Quota.HasValue()) { request.SetHeader("x-ms-share-quota", std::to_string(options.Quota.Value())); @@ -1276,6 +1364,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.RootSquash.HasValue() && !options.RootSquash.Value().ToString().empty()) + { + request.SetHeader("x-ms-root-squash", options.RootSquash.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1302,7 +1394,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1328,7 +1420,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "acl"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1475,7 +1567,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "acl"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1502,7 +1594,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "stats"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1577,7 +1669,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.FilePermission.HasValue() && !options.FilePermission.Value().empty()) { request.SetHeader("x-ms-file-permission", options.FilePermission.Value()); @@ -1590,13 +1682,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-attributes", options.FileAttributes); } - if (!options.FileCreationTime.empty()) + if (options.FileCreationTime.HasValue() && !options.FileCreationTime.Value().empty()) { - request.SetHeader("x-ms-file-creation-time", options.FileCreationTime); + request.SetHeader("x-ms-file-creation-time", options.FileCreationTime.Value()); } - if (!options.FileLastWriteTime.empty()) + if (options.FileLastWriteTime.HasValue() && !options.FileLastWriteTime.Value().empty()) { - request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime); + request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime.Value()); + } + if (options.FileChangeTime.HasValue() && !options.FileChangeTime.Value().empty()) + { + request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -1652,7 +1748,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1708,7 +1804,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto request = Core::Http::Request(Core::Http::HttpMethod::Delete, url); request.GetUrl().AppendQueryParameter("restype", "directory"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -1728,7 +1824,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "directory"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.FilePermission.HasValue() && !options.FilePermission.Value().empty()) { request.SetHeader("x-ms-file-permission", options.FilePermission.Value()); @@ -1741,13 +1837,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-attributes", options.FileAttributes); } - if (!options.FileCreationTime.empty()) + if (options.FileCreationTime.HasValue() && !options.FileCreationTime.Value().empty()) { - request.SetHeader("x-ms-file-creation-time", options.FileCreationTime); + request.SetHeader("x-ms-file-creation-time", options.FileCreationTime.Value()); + } + if (options.FileLastWriteTime.HasValue() && !options.FileLastWriteTime.Value().empty()) + { + request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime.Value()); } - if (!options.FileLastWriteTime.empty()) + if (options.FileChangeTime.HasValue() && !options.FileChangeTime.Value().empty()) { - request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime); + request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -1804,7 +1904,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1848,7 +1948,20 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "maxresults", std::to_string(options.MaxResults.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); + if (options.Include.HasValue() + && !ListFilesIncludeFlagsToString(options.Include.Value()).empty()) + { + request.GetUrl().AppendQueryParameter( + "include", + _internal::UrlEncodeQueryParameter( + ListFilesIncludeFlagsToString(options.Include.Value()))); + } + if (options.IncludeExtendedInfo.HasValue()) + { + request.SetHeader( + "x-ms-file-extended-info", options.IncludeExtendedInfo.Value() ? "true" : "false"); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1870,10 +1983,20 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { kEntries, kDirectory, kName, - kFile, kProperties, + kLastAccessTime, + kLastModified, + kEtag, + kPermissionKey, + kAttributes, + kCreationTime, + kLastWriteTime, + kChangeTime, + kFileId, + kFile, kContentLength, kNextMarker, + kDirectoryId, }; const std::unordered_map XmlTagEnumMap{ {"EnumerationResults", XmlTagEnum::kEnumerationResults}, @@ -1883,10 +2006,20 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { {"Entries", XmlTagEnum::kEntries}, {"Directory", XmlTagEnum::kDirectory}, {"Name", XmlTagEnum::kName}, - {"File", XmlTagEnum::kFile}, {"Properties", XmlTagEnum::kProperties}, + {"LastAccessTime", XmlTagEnum::kLastAccessTime}, + {"Last-Modified", XmlTagEnum::kLastModified}, + {"Etag", XmlTagEnum::kEtag}, + {"PermissionKey", XmlTagEnum::kPermissionKey}, + {"Attributes", XmlTagEnum::kAttributes}, + {"CreationTime", XmlTagEnum::kCreationTime}, + {"LastWriteTime", XmlTagEnum::kLastWriteTime}, + {"ChangeTime", XmlTagEnum::kChangeTime}, + {"FileId", XmlTagEnum::kFileId}, + {"File", XmlTagEnum::kFile}, {"Content-Length", XmlTagEnum::kContentLength}, {"NextMarker", XmlTagEnum::kNextMarker}, + {"DirectoryId", XmlTagEnum::kDirectoryId}, }; std::vector xmlPath; Models::DirectoryItem vectorElement1; @@ -1929,6 +2062,76 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { vectorElement1.Name = node.Value; } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kProperties + && xmlPath[4] == XmlTagEnum::kLastAccessTime) + { + vectorElement1.Details.LastAccessedOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kLastModified) + { + vectorElement1.Details.LastModified + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc1123); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kEtag) + { + vectorElement1.Details.Etag = ETag(node.Value); + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kPermissionKey) + { + vectorElement1.Details.SmbProperties.PermissionKey = node.Value; + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kAttributes) + { + vectorElement1.Details.SmbProperties.Attributes = Models::FileAttributes(node.Value); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kCreationTime) + { + vectorElement1.Details.SmbProperties.CreatedOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kProperties + && xmlPath[4] == XmlTagEnum::kLastWriteTime) + { + vectorElement1.Details.SmbProperties.LastWrittenOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kChangeTime) + { + vectorElement1.Details.SmbProperties.ChangedOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kDirectory + && xmlPath[3] == XmlTagEnum::kFileId) + { + vectorElement1.Details.SmbProperties.FileId = node.Value; + } else if ( xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile @@ -1944,12 +2147,88 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { vectorElement2.Details.FileSize = std::stoll(node.Value); } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kProperties + && xmlPath[4] == XmlTagEnum::kLastAccessTime) + { + vectorElement2.Details.LastAccessedOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kLastModified) + { + vectorElement2.Details.LastModified + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc1123); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kEtag) + { + vectorElement2.Details.Etag = ETag(node.Value); + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kPermissionKey) + { + vectorElement2.Details.SmbProperties.PermissionKey = node.Value; + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kAttributes) + { + vectorElement2.Details.SmbProperties.Attributes = Models::FileAttributes(node.Value); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kCreationTime) + { + vectorElement2.Details.SmbProperties.CreatedOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kProperties + && xmlPath[4] == XmlTagEnum::kLastWriteTime) + { + vectorElement2.Details.SmbProperties.LastWrittenOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 5 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kProperties && xmlPath[4] == XmlTagEnum::kChangeTime) + { + vectorElement2.Details.SmbProperties.ChangedOn + = DateTime::Parse(node.Value, Azure::DateTime::DateFormat::Rfc3339); + } + else if ( + xmlPath.size() == 4 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kEntries && xmlPath[2] == XmlTagEnum::kFile + && xmlPath[3] == XmlTagEnum::kFileId) + { + vectorElement2.Details.SmbProperties.FileId = node.Value; + } else if ( xmlPath.size() == 2 && xmlPath[0] == XmlTagEnum::kEnumerationResults && xmlPath[1] == XmlTagEnum::kNextMarker) { response.NextMarker = node.Value; } + else if ( + xmlPath.size() == 2 && xmlPath[0] == XmlTagEnum::kEnumerationResults + && xmlPath[1] == XmlTagEnum::kDirectoryId) + { + response.DirectoryId = node.Value; + } } else if (node.Type == _internal::XmlNodeType::Attribute) { @@ -2026,7 +2305,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-recursive", options.Recursive.Value() ? "true" : "false"); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2192,7 +2471,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-recursive", options.Recursive.Value() ? "true" : "false"); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2211,6 +2490,95 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return Response( std::move(response), std::move(pRawResponse)); } + Response DirectoryClient::Rename( + Core::Http::_internal::HttpPipeline& pipeline, + const Core::Url& url, + const RenameDirectoryOptions& options, + const Core::Context& context) + { + auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); + request.GetUrl().AppendQueryParameter("restype", "directory"); + request.GetUrl().AppendQueryParameter("comp", "rename"); + request.SetHeader("x-ms-version", "2021-06-08"); + if (!options.RenameSource.empty()) + { + request.SetHeader("x-ms-file-rename-source", options.RenameSource); + } + if (options.ReplaceIfExists.HasValue()) + { + request.SetHeader( + "x-ms-file-rename-replace-if-exists", + options.ReplaceIfExists.Value() ? "true" : "false"); + } + if (options.IgnoreReadOnly.HasValue()) + { + request.SetHeader( + "x-ms-file-rename-ignore-readonly", options.IgnoreReadOnly.Value() ? "true" : "false"); + } + if (options.SourceLeaseId.HasValue() && !options.SourceLeaseId.Value().empty()) + { + request.SetHeader("x-ms-source-lease-id", options.SourceLeaseId.Value()); + } + if (options.DestinationLeaseId.HasValue() && !options.DestinationLeaseId.Value().empty()) + { + request.SetHeader("x-ms-destination-lease-id", options.DestinationLeaseId.Value()); + } + if (options.FileAttributes.HasValue() && !options.FileAttributes.Value().empty()) + { + request.SetHeader("x-ms-file-attributes", options.FileAttributes.Value()); + } + if (options.FileCreationTime.HasValue() && !options.FileCreationTime.Value().empty()) + { + request.SetHeader("x-ms-file-creation-time", options.FileCreationTime.Value()); + } + if (options.FileLastWriteTime.HasValue() && !options.FileLastWriteTime.Value().empty()) + { + request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime.Value()); + } + if (options.FileChangeTime.HasValue() && !options.FileChangeTime.Value().empty()) + { + request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); + } + if (options.FilePermission.HasValue() && !options.FilePermission.Value().empty()) + { + request.SetHeader("x-ms-file-permission", options.FilePermission.Value()); + } + if (options.FilePermissionKey.HasValue() && !options.FilePermissionKey.Value().empty()) + { + request.SetHeader("x-ms-file-permission-key", options.FilePermissionKey.Value()); + } + for (const auto& p : options.Metadata) + { + request.SetHeader("x-ms-meta-" + p.first, p.second); + } + auto pRawResponse = pipeline.Send(request, context); + auto httpStatusCode = pRawResponse->GetStatusCode(); + if (httpStatusCode != Core::Http::HttpStatusCode::Ok) + { + throw StorageException::CreateFromResponse(std::move(pRawResponse)); + } + Models::_detail::RenameDirectoryResult response; + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + response.IsServerEncrypted + = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); + response.FilePermissionKey = pRawResponse->GetHeaders().at("x-ms-file-permission-key"); + response.FileAttributes = pRawResponse->GetHeaders().at("x-ms-file-attributes"); + response.FileCreationTime = DateTime::Parse( + pRawResponse->GetHeaders().at("x-ms-file-creation-time"), + Azure::DateTime::DateFormat::Rfc3339); + response.FileLastWriteTime = DateTime::Parse( + pRawResponse->GetHeaders().at("x-ms-file-last-write-time"), + Azure::DateTime::DateFormat::Rfc3339); + response.FileChangeTime = DateTime::Parse( + pRawResponse->GetHeaders().at("x-ms-file-change-time"), + Azure::DateTime::DateFormat::Rfc3339); + response.FileId = pRawResponse->GetHeaders().at("x-ms-file-id"); + response.FileParentId = pRawResponse->GetHeaders().at("x-ms-file-parent-id"); + return Response( + std::move(response), std::move(pRawResponse)); + } Response FileClient::Create( Core::Http::_internal::HttpPipeline& pipeline, const Core::Url& url, @@ -2218,7 +2586,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); request.SetHeader("x-ms-content-length", std::to_string(options.FileContentLength)); request.SetHeader("x-ms-type", "file"); if (options.FileContentType.HasValue() && !options.FileContentType.Value().empty()) @@ -2264,13 +2632,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-attributes", options.FileAttributes); } - if (!options.FileCreationTime.empty()) + if (options.FileCreationTime.HasValue() && !options.FileCreationTime.Value().empty()) { - request.SetHeader("x-ms-file-creation-time", options.FileCreationTime); + request.SetHeader("x-ms-file-creation-time", options.FileCreationTime.Value()); + } + if (options.FileLastWriteTime.HasValue() && !options.FileLastWriteTime.Value().empty()) + { + request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime.Value()); } - if (!options.FileLastWriteTime.empty()) + if (options.FileChangeTime.HasValue() && !options.FileChangeTime.Value().empty()) { - request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime); + request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); } if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { @@ -2324,7 +2696,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url, false); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Range.HasValue() && !options.Range.Value().empty()) { request.SetHeader("x-ms-range", options.Range.Value()); @@ -2499,7 +2871,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -2627,7 +2999,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Delete, url); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -2649,7 +3021,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.FileContentLength.HasValue()) { request.SetHeader("x-ms-content-length", std::to_string(options.FileContentLength.Value())); @@ -2693,13 +3065,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-attributes", options.FileAttributes); } - if (!options.FileCreationTime.empty()) + if (options.FileCreationTime.HasValue() && !options.FileCreationTime.Value().empty()) { - request.SetHeader("x-ms-file-creation-time", options.FileCreationTime); + request.SetHeader("x-ms-file-creation-time", options.FileCreationTime.Value()); + } + if (options.FileLastWriteTime.HasValue() && !options.FileLastWriteTime.Value().empty()) + { + request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime.Value()); } - if (!options.FileLastWriteTime.empty()) + if (options.FileChangeTime.HasValue() && !options.FileChangeTime.Value().empty()) { - request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime); + request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); } if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { @@ -2759,7 +3135,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -2793,7 +3169,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -2821,7 +3197,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2852,7 +3228,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2880,7 +3256,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -2917,11 +3293,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("Content-MD5", Core::Convert::Base64Encode(options.ContentMD5.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.FileLastWrittenMode.HasValue() + && !options.FileLastWrittenMode.Value().ToString().empty()) + { + request.SetHeader( + "x-ms-file-last-write-time", options.FileLastWrittenMode.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -2988,11 +3370,23 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { "x-ms-source-if-none-match-crc64", Core::Convert::Base64Encode(options.SourceIfNoneMatchCrc64.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.CopySourceAuthorization.HasValue() + && !options.CopySourceAuthorization.Value().empty()) + { + request.SetHeader( + "x-ms-copy-source-authorization", options.CopySourceAuthorization.Value()); + } + if (options.FileLastWrittenMode.HasValue() + && !options.FileLastWrittenMode.Value().ToString().empty()) + { + request.SetHeader( + "x-ms-file-last-write-time", options.FileLastWrittenMode.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -3036,7 +3430,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { "prevsharesnapshot", _internal::UrlEncodeQueryParameter(options.Prevsharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.Range.HasValue() && !options.Range.Value().empty()) { request.SetHeader("x-ms-range", options.Range.Value()); @@ -3150,7 +3544,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); for (const auto& p : options.Metadata) { request.SetHeader("x-ms-meta-" + p.first, p.second); @@ -3176,7 +3570,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (options.IgnoreReadOnly.HasValue()) { request.SetHeader( - "x-ms-file-copy-ignore-read-only", options.IgnoreReadOnly.Value() ? "true" : "false"); + "x-ms-file-copy-ignore-readonly", options.IgnoreReadOnly.Value() ? "true" : "false"); } if (options.FileAttributes.HasValue() && !options.FileAttributes.Value().empty()) { @@ -3190,6 +3584,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime.Value()); } + if (options.FileChangeTime.HasValue() && !options.FileChangeTime.Value().empty()) + { + request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); + } if (options.SetArchiveAttribute.HasValue()) { request.SetHeader( @@ -3228,7 +3626,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { "copyid", _internal::UrlEncodeQueryParameter(options.CopyId)); } request.SetHeader("x-ms-copy-action", "abort"); - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -3265,7 +3663,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3427,7 +3825,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-handle-id", options.HandleId); } - request.SetHeader("x-ms-version", "2020-02-10"); + request.SetHeader("x-ms-version", "2021-06-08"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3446,5 +3844,97 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return Response( std::move(response), std::move(pRawResponse)); } + Response FileClient::Rename( + Core::Http::_internal::HttpPipeline& pipeline, + const Core::Url& url, + const RenameFileOptions& options, + const Core::Context& context) + { + auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); + request.GetUrl().AppendQueryParameter("comp", "rename"); + request.SetHeader("x-ms-version", "2021-06-08"); + if (!options.RenameSource.empty()) + { + request.SetHeader("x-ms-file-rename-source", options.RenameSource); + } + if (options.ReplaceIfExists.HasValue()) + { + request.SetHeader( + "x-ms-file-rename-replace-if-exists", + options.ReplaceIfExists.Value() ? "true" : "false"); + } + if (options.IgnoreReadOnly.HasValue()) + { + request.SetHeader( + "x-ms-file-rename-ignore-readonly", options.IgnoreReadOnly.Value() ? "true" : "false"); + } + if (options.SourceLeaseId.HasValue() && !options.SourceLeaseId.Value().empty()) + { + request.SetHeader("x-ms-source-lease-id", options.SourceLeaseId.Value()); + } + if (options.DestinationLeaseId.HasValue() && !options.DestinationLeaseId.Value().empty()) + { + request.SetHeader("x-ms-destination-lease-id", options.DestinationLeaseId.Value()); + } + if (options.FileAttributes.HasValue() && !options.FileAttributes.Value().empty()) + { + request.SetHeader("x-ms-file-attributes", options.FileAttributes.Value()); + } + if (options.FileCreationTime.HasValue() && !options.FileCreationTime.Value().empty()) + { + request.SetHeader("x-ms-file-creation-time", options.FileCreationTime.Value()); + } + if (options.FileLastWriteTime.HasValue() && !options.FileLastWriteTime.Value().empty()) + { + request.SetHeader("x-ms-file-last-write-time", options.FileLastWriteTime.Value()); + } + if (options.FileChangeTime.HasValue() && !options.FileChangeTime.Value().empty()) + { + request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); + } + if (options.FilePermission.HasValue() && !options.FilePermission.Value().empty()) + { + request.SetHeader("x-ms-file-permission", options.FilePermission.Value()); + } + if (options.FilePermissionKey.HasValue() && !options.FilePermissionKey.Value().empty()) + { + request.SetHeader("x-ms-file-permission-key", options.FilePermissionKey.Value()); + } + for (const auto& p : options.Metadata) + { + request.SetHeader("x-ms-meta-" + p.first, p.second); + } + if (options.FileContentType.HasValue() && !options.FileContentType.Value().empty()) + { + request.SetHeader("x-ms-content-type", options.FileContentType.Value()); + } + auto pRawResponse = pipeline.Send(request, context); + auto httpStatusCode = pRawResponse->GetStatusCode(); + if (httpStatusCode != Core::Http::HttpStatusCode::Ok) + { + throw StorageException::CreateFromResponse(std::move(pRawResponse)); + } + Models::_detail::RenameFileResult response; + response.ETag = ETag(pRawResponse->GetHeaders().at("ETag")); + response.LastModified = DateTime::Parse( + pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); + response.IsServerEncrypted + = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); + response.FilePermissionKey = pRawResponse->GetHeaders().at("x-ms-file-permission-key"); + response.FileAttributes = pRawResponse->GetHeaders().at("x-ms-file-attributes"); + response.FileCreationTime = DateTime::Parse( + pRawResponse->GetHeaders().at("x-ms-file-creation-time"), + Azure::DateTime::DateFormat::Rfc3339); + response.FileLastWriteTime = DateTime::Parse( + pRawResponse->GetHeaders().at("x-ms-file-last-write-time"), + Azure::DateTime::DateFormat::Rfc3339); + response.FileChangeTime = DateTime::Parse( + pRawResponse->GetHeaders().at("x-ms-file-change-time"), + Azure::DateTime::DateFormat::Rfc3339); + response.FileId = pRawResponse->GetHeaders().at("x-ms-file-id"); + response.FileParentId = pRawResponse->GetHeaders().at("x-ms-file-parent-id"); + return Response( + std::move(response), std::move(pRawResponse)); + } } // namespace _detail }}}} // namespace Azure::Storage::Files::Shares \ No newline at end of file diff --git a/sdk/storage/azure-storage-files-shares/src/share_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_client.cpp index 4fd5fa3017..684976d226 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_client.cpp @@ -107,6 +107,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { = std::map(options.Metadata.begin(), options.Metadata.end()); protocolLayerOptions.Quota = options.ShareQuotaInGiB; protocolLayerOptions.AccessTier = options.AccessTier; + protocolLayerOptions.EnabledProtocols = options.EnabledProtocols; + protocolLayerOptions.RootSquash = options.RootSquash; auto result = _detail::ShareClient::Create(*m_pipeline, m_shareUrl, protocolLayerOptions, context); Models::CreateShareResult ret; @@ -202,6 +204,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto protocolLayerOptions = _detail::ShareClient::SetSharePropertiesOptions(); protocolLayerOptions.Quota = options.ShareQuotaInGiB; protocolLayerOptions.AccessTier = options.AccessTier; + protocolLayerOptions.RootSquash = options.RootSquash; return _detail::ShareClient::SetProperties( *m_pipeline, m_shareUrl, protocolLayerOptions, context); } diff --git a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp index 4097042cce..ada8cbe57f 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp @@ -146,6 +146,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { protocolLayerOptions.FileLastWriteTime = std::string(FileDefaultTimeValue); } + if (options.SmbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = options.SmbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } if (options.DirectoryPermission.HasValue()) { protocolLayerOptions.FilePermission = options.DirectoryPermission.Value(); @@ -192,6 +197,117 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { throw; } } + Azure::Response ShareDirectoryClient::RenameFile( + const std::string& fileName, + const std::string& destinationFilePath, + const RenameFileOptions& options, + const Azure::Core::Context& context) const + { + auto sourceFileUrl = m_shareDirectoryUrl; + sourceFileUrl.AppendPath(_internal::UrlEncodePath(fileName)); + + const std::string& currentPath = m_shareDirectoryUrl.GetPath(); + std::string destinationFileShare = currentPath.substr(0, currentPath.find('/')); + auto destinationFileUrl = m_shareDirectoryUrl; + destinationFileUrl.SetPath(_internal::UrlEncodePath(destinationFileShare)); + destinationFileUrl.AppendPath(_internal::UrlEncodePath(destinationFilePath)); + + auto protocolLayerOptions = _detail::FileClient::RenameFileOptions(); + protocolLayerOptions.RenameSource = sourceFileUrl.GetAbsoluteUrl(); + protocolLayerOptions.ReplaceIfExists = options.ReplaceIfExists; + protocolLayerOptions.IgnoreReadOnly = options.IgnoreReadOnly; + protocolLayerOptions.DestinationLeaseId = options.AccessConditions.LeaseId; + protocolLayerOptions.SourceLeaseId = options.SourceAccessConditions.LeaseId; + protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString(); + protocolLayerOptions.Metadata + = std::map(options.Metadata.begin(), options.Metadata.end()); + if (options.SmbProperties.CreatedOn.HasValue()) + { + protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } + if (options.SmbProperties.LastWrittenOn.HasValue()) + { + protocolLayerOptions.FileLastWriteTime = options.SmbProperties.LastWrittenOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } + if (options.SmbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = options.SmbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } + if (options.FilePermission.HasValue()) + { + protocolLayerOptions.FilePermission = options.FilePermission.Value(); + } + else if (options.SmbProperties.PermissionKey.HasValue()) + { + protocolLayerOptions.FilePermissionKey = options.SmbProperties.PermissionKey; + } + + auto response = _detail::FileClient::Rename( + *m_pipeline, destinationFileUrl, protocolLayerOptions, context); + + auto renamedFileClient = ShareFileClient(destinationFileUrl, m_pipeline); + return Azure::Response( + std::move(renamedFileClient), std::move(response.RawResponse)); + } + + Azure::Response ShareDirectoryClient::RenameSubdirectory( + const std::string& subdirectoryName, + const std::string& destinationDirectoryPath, + const RenameDirectoryOptions& options, + const Azure::Core::Context& context) const + { + auto sourceDirectoryUrl = m_shareDirectoryUrl; + sourceDirectoryUrl.AppendPath(_internal::UrlEncodePath(subdirectoryName)); + + const std::string& currentPath = m_shareDirectoryUrl.GetPath(); + std::string destinationFileShare = currentPath.substr(0, currentPath.find('/')); + auto destinationDirectoryUrl = m_shareDirectoryUrl; + destinationDirectoryUrl.SetPath(_internal::UrlEncodePath(destinationFileShare)); + destinationDirectoryUrl.AppendPath(_internal::UrlEncodePath(destinationDirectoryPath)); + + auto protocolLayerOptions = _detail::DirectoryClient::RenameDirectoryOptions(); + protocolLayerOptions.RenameSource = sourceDirectoryUrl.GetAbsoluteUrl(); + protocolLayerOptions.ReplaceIfExists = options.ReplaceIfExists; + protocolLayerOptions.IgnoreReadOnly = options.IgnoreReadOnly; + protocolLayerOptions.DestinationLeaseId = options.AccessConditions.LeaseId; + protocolLayerOptions.SourceLeaseId = options.SourceAccessConditions.LeaseId; + protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString(); + protocolLayerOptions.Metadata + = std::map(options.Metadata.begin(), options.Metadata.end()); + if (options.SmbProperties.CreatedOn.HasValue()) + { + protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } + if (options.SmbProperties.LastWrittenOn.HasValue()) + { + protocolLayerOptions.FileLastWriteTime = options.SmbProperties.LastWrittenOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } + if (options.SmbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = options.SmbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } + if (options.FilePermission.HasValue()) + { + protocolLayerOptions.FilePermission = options.FilePermission.Value(); + } + else if (options.SmbProperties.PermissionKey.HasValue()) + { + protocolLayerOptions.FilePermissionKey = options.SmbProperties.PermissionKey; + } + + auto response = _detail::DirectoryClient::Rename( + *m_pipeline, destinationDirectoryUrl, protocolLayerOptions, context); + + auto renamedFileClient = ShareDirectoryClient(destinationDirectoryUrl, m_pipeline); + return Azure::Response( + std::move(renamedFileClient), std::move(response.RawResponse)); + } Azure::Response ShareDirectoryClient::Delete( const DeleteDirectoryOptions& options, @@ -268,6 +384,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { protocolLayerOptions.FileLastWriteTime = FilePreserveSmbProperties; } + if (smbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = smbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } if (options.FilePermission.HasValue()) { protocolLayerOptions.FilePermission = options.FilePermission.Value(); @@ -306,6 +427,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { protocolLayerOptions.Prefix = options.Prefix; protocolLayerOptions.Marker = options.ContinuationToken; protocolLayerOptions.MaxResults = options.PageSizeHint; + protocolLayerOptions.Include = options.Include; + protocolLayerOptions.IncludeExtendedInfo = options.IncludeExtendedInfo; auto response = _detail::DirectoryClient::ListFilesAndDirectoriesSegment( *m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context); @@ -318,6 +441,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { pagedResponse.Prefix = std::move(response.Value.Prefix); pagedResponse.Directories = std::move(response.Value.Segment.DirectoryItems); pagedResponse.Files = std::move(response.Value.Segment.FileItems); + pagedResponse.DirectoryId = response.Value.DirectoryId.ValueOr(std::string()); pagedResponse.m_shareDirectoryClient = std::make_shared(*this); pagedResponse.m_operationOptions = options; pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string()); diff --git a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp index 7c5df0047e..766b0778a0 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp @@ -133,6 +133,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { protocolLayerOptions.FileLastWriteTime = std::string(FileDefaultTimeValue); } + if (options.SmbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = options.SmbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } if (options.Permission.HasValue()) { protocolLayerOptions.FilePermission = options.Permission; @@ -346,6 +351,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { protocolLayerOptions.FileLastWriteTime = std::string(FileCopySourceTime); } + if (options.SmbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = options.SmbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } if (options.PermissionCopyMode.HasValue()) { protocolLayerOptions.FilePermissionCopyMode = options.PermissionCopyMode.Value(); @@ -433,6 +443,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { protocolLayerOptions.FileLastWriteTime = FilePreserveSmbProperties; } + if (smbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = smbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } protocolLayerOptions.FileContentLength = options.Size; protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId; if (options.Permission.HasValue()) @@ -504,6 +519,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { protocolLayerOptions.ContentMD5 = options.TransactionalContentHash.Value().Value; } protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId; + protocolLayerOptions.FileLastWrittenMode = options.FileLastWrittenMode; return _detail::FileClient::UploadRange( *m_pipeline, m_shareFileUrl, content, protocolLayerOptions, context); } @@ -520,6 +536,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { + std::to_string(offset + length - 1); protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId; + protocolLayerOptions.FileLastWrittenMode = options.FileLastWrittenMode; auto response = _detail::FileClient::UploadRange( *m_pipeline, m_shareFileUrl, @@ -784,8 +801,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { firstChunkOptions.Range.Value().Length = firstChunkLength; } - _internal::FileWriter fileWriter(fileName); - auto firstChunk = Download(firstChunkOptions, context); const Azure::ETag etag = firstChunk.Value.Details.ETag; @@ -828,6 +843,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } }; + _internal::FileWriter fileWriter(fileName); bodyStreamToFile(*(firstChunk.Value.BodyStream), fileWriter, 0, firstChunkLength, context); firstChunk.Value.BodyStream.reset(); @@ -912,6 +928,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { protocolLayerOptions.FileLastWriteTime = std::string(FileDefaultTimeValue); } + if (options.SmbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = options.SmbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } if (options.FilePermission.HasValue()) { protocolLayerOptions.FilePermission = options.FilePermission; @@ -964,6 +985,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { // for some reason. Azure::Core::IO::MemoryBodyStream contentStream(buffer + offset, static_cast(length)); UploadFileRangeOptions uploadRangeOptions; + if (options.SmbProperties.LastWrittenOn.HasValue()) + { + uploadRangeOptions.FileLastWrittenMode + = Azure::Storage::Files::Shares::Models::FileLastWrittenMode::Preserve; + } UploadRange(offset, contentStream, uploadRangeOptions, context); }; @@ -1017,6 +1043,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { protocolLayerOptions.FileLastWriteTime = std::string(FileDefaultTimeValue); } + if (options.SmbProperties.ChangedOn.HasValue()) + { + protocolLayerOptions.FileChangeTime = options.SmbProperties.ChangedOn.Value().ToString( + Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); + } if (options.FilePermission.HasValue()) { protocolLayerOptions.FilePermission = options.FilePermission; @@ -1068,6 +1099,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Core::IO::_internal::RandomAccessFileBodyStream contentStream( fileReader.GetHandle(), offset, length); UploadFileRangeOptions uploadRangeOptions; + if (options.SmbProperties.LastWrittenOn.HasValue()) + { + uploadRangeOptions.FileLastWrittenMode + = Azure::Storage::Files::Shares::Models::FileLastWrittenMode::Preserve; + } UploadRange(offset, contentStream, uploadRangeOptions, context); }; @@ -1105,6 +1141,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { + std::string("-") + std::to_string(destinationOffset + rangeLength - 1); protocolLayerOptions.CopySource = sourceUri; protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId; + protocolLayerOptions.FileLastWrittenMode = options.FileLastWrittenMode; if (options.TransactionalContentHash.HasValue()) { AZURE_ASSERT_MSG( diff --git a/sdk/storage/azure-storage-files-shares/swagger/README.md b/sdk/storage/azure-storage-files-shares/swagger/README.md index e4ce1a8d9e..3c6784af8a 100644 --- a/sdk/storage/azure-storage-files-shares/swagger/README.md +++ b/sdk/storage/azure-storage-files-shares/swagger/README.md @@ -9,7 +9,7 @@ package-name: azure-storage-files-shares namespace: Azure::Storage::Files::Shares output-folder: generated clear-output-folder: true -input-file: https://raw.githubusercontent.com/Jinming-Hu/azure-storage-api-specs/main/Microsoft.FileStorage/preview/2020-02-10/file.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.FileStorage/preview/2021-06-08/file.json ``` ## ModelFour Options @@ -79,13 +79,13 @@ directive: "name": "ApiVersion", "modelAsString": false }, - "enum": ["2020-02-10"], + "enum": ["2021-06-08"], "description": "The version used for the operations to Azure storage services." }; - from: swagger-document where: $.parameters transform: > - $.ApiVersionParameter.enum[0] = "2020-02-10"; + $.ApiVersionParameter.enum[0] = "2021-06-08"; ``` ### Rename Operations @@ -159,6 +159,8 @@ directive: "File_StartCopy", "Directory_ForceCloseHandles", "File_ForceCloseHandles", + "Directory_Rename", + "File_Rename", ]; for (const url in $["x-ms-paths"]) { for (const verb in $["x-ms-paths"][url]) { @@ -205,6 +207,7 @@ directive: where: $.parameters transform: > $.ListSharesInclude.items["x-ms-enum"].name = "ListSharesIncludeFlags"; + $.ListFilesInclude.items["x-ms-enum"].name = "ListFilesIncludeFlags"; $.AccessTierOptional.enum.push("Premium"); $.AccessTierOptional["x-ms-enum"].name = "AccessTier"; $.AccessTierOptional["x-ms-enum"].modelAsString = false; @@ -214,6 +217,11 @@ directive: $.MaxResults["x-ms-client-name"] = "MaxResults"; delete $.FileCreationTime.format; delete $.FileLastWriteTime.format; + $.ShareEnabledProtocols["enum"] = ["Smb", "Nfs"]; + $.ShareEnabledProtocols["x-ms-enum"] = {"name": "ShareProtocols", "modelAsString": false}; + $.ShareEnabledProtocols["x-ms-enum"]["values"] = [{"value": "SMB", "name": "Smb"},{"value": "NFS", "name": "Nfs"}]; + delete $.FileChangeTime.format; + $.FileLastWriteTimeMode["x-ms-enum"]["values"] = [{"value": "now", "name": "Now"},{"value": "preserve", "name": "Preserve"}]; - from: swagger-document where: $.definitions transform: > @@ -296,6 +304,9 @@ directive: "description": "Standard HTTP properties supported files." }; $.SharePermission["x-namespace"] = "_detail"; + $.ShareEnabledProtocols["enum"] = ["Smb", "Nfs"]; + $.ShareEnabledProtocols["x-ms-enum"] = {"name": "ShareProtocols", "modelAsString": false}; + $.ShareEnabledProtocols["x-ms-enum"]["values"] = [{"value": "SMB", "name": "Smb"},{"value": "NFS", "name": "Nfs"}]; - from: swagger-document where: $["x-ms-paths"].*.*.responses.*.headers transform: > @@ -388,16 +399,18 @@ directive: where: $.definitions transform: > $.ListSharesResponse.properties["ShareItems"]["x-ms-xml"] = {"name": "Shares"}; - $.ShareItemDetails = $.ShareProperties; - delete $.ShareProperties; + $.ShareItemDetails = $.SharePropertiesInternal; + delete $.SharePropertiesInternal; $.ShareItemDetails.properties["Quota"]["format"] = "int64"; $.ShareItemDetails.properties["AccessTierChangeTime"]["x-ms-client-name"] = "AccessTierChangedOn"; $.ShareItemDetails.properties["AccessTier"] = {"$ref": "#/definitions/AccessTier"}; $.ShareItemDetails.properties["DeletedTime"]["x-ms-client-name"] = "DeletedOn"; $.ShareItemDetails.required.push("RemainingRetentionDays", "LeaseStatus", "LeaseState", "LeaseDuration"); - $.ShareItem.properties["Details"] = {"$ref": "#/definitions/ShareItemDetails", "x-ms-xml": {"name": "Properties"}}; - delete $.ShareItem.properties["Properties"]; - delete $.ShareItem.required; + $.ShareItemInternal.properties["Details"] = {"$ref": "#/definitions/ShareItemDetails", "x-ms-xml": {"name": "Properties"}}; + $.ShareItemInternal["x-ms-client-name"] = "ShareItem"; + $.ShareItemDetails.properties["ProvisionedBandwidthMiBps"]["x-ms-client-name"] = "ProvisionedBandwidthMBps"; + delete $.ShareItemInternal.properties["Properties"]; + delete $.ShareItemInternal.required; ``` ### CreateShare @@ -441,6 +454,13 @@ directive: $["x-ms-access-tier-transition-state"]["x-nullable"] = true; $["x-ms-access-tier-transition-state"].description = "Returns the transition state between access tiers, when present."; $["x-ms-share-provisioned-iops"].description = "Returns the current share provisioned IOPS."; + $["x-ms-share-provisioned-bandwidth-mibps"]["x-nullable"] = true; + $["x-ms-share-provisioned-bandwidth-mibps"]["x-ms-client-name"] = "ProvisionedBandwidthMBps"; + $["x-ms-enabled-protocols"]["x-nullable"] = true; + $["x-ms-root-squash"]["x-nullable"] = true; + $["x-ms-enabled-protocols"]["enum"] = ["Smb", "Nfs"]; + $["x-ms-enabled-protocols"]["x-ms-enum"] = {"name": "ShareProtocols", "modelAsString": false}; + $["x-ms-enabled-protocols"]["x-ms-enum"]["values"] = [{"value": "SMB", "name": "Smb"},{"value": "NFS", "name": "Nfs"}]; - from: swagger-document where: $["x-ms-paths"]["/{shareName}?restype=share"].get.responses["200"] transform: > @@ -502,19 +522,49 @@ directive: ```yaml directive: + - from: swagger-document + where: $.parameters + transform: > + $.ListFilesInclude["items"]["x-ms-enum"]["values"] = [{"name": "Timestamps", "value": "Timestamps"}, {"name": "ETag", "value": "Etag"}, {"name": "Attributes", "value": "Attributes"}, {"name": "PermissionKey", "value": "PermissionKey"},]; - from: swagger-document where: $.definitions transform: > $.ListFilesAndDirectoriesSegmentResponse.properties["Segment"]["x-ms-xml"] = {"name": "Entries"}; $.FileItemDetails = $.FileProperty; $.FileItemDetails.properties["Content-Length"]["x-ms-client-name"] = "FileSize"; + $.FileItemDetails.properties["SmbProperties"] = {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": "."}}; + $.FileItemDetails.properties["LastAccessTime"]["x-ms-client-name"] = "LastAccessedOn"; + $.FileItemDetails.properties["LastAccessTime"]["x-nullable"] = true; + $.FileSmbProperties.properties["PermissionKey"]["x-ms-xml"] = {"name": "../PermissionKey"}; + $.FileSmbProperties.properties["Attributes"]["x-ms-xml"] = {"name": "../Attributes"}; + $.FileSmbProperties.properties["CreatedOn"]["x-ms-xml"] = {"name": "CreationTime"}; + $.FileSmbProperties.properties["LastWrittenOn"]["x-ms-xml"] = {"name": "LastWriteTime"}; + $.FileSmbProperties.properties["ChangedOn"]["x-ms-xml"] = {"name": "ChangeTime"}; + $.FileSmbProperties.properties["FileId"]["x-ms-xml"] = {"name": "../FileId"}; + $.FileSmbProperties.properties["ParentFileId"]["x-ms-xml"] = {"name": ""}; + delete $.FileItemDetails.properties["CreationTime"]; + delete $.FileItemDetails.properties["LastWriteTime"]; + delete $.FileItemDetails.properties["ChangeTime"]; + delete $.FileItemDetails.required; delete $.FileProperty; - $.FileItem.properties["Details"] = {"$ref": "#/definitions/FileItemDetails"}; delete $.FileItem.properties["Properties"]; + delete $.FileItem.properties["FileId"]; + delete $.FileItem.properties["Attributes"]; + delete $.FileItem.properties["PermissionKey"]; delete $.FileItem.required; + $.FileItem.properties["Details"] = {"$ref": "#/definitions/FileItemDetails", "x-ms-xml" : {"name": "Properties"}}; + + delete $.DirectoryItem.properties["Properties"]; + delete $.DirectoryItem.properties["FileId"]; + delete $.DirectoryItem.properties["Attributes"]; + delete $.DirectoryItem.properties["PermissionKey"]; + delete $.DirectoryItem.required; + $.DirectoryItemDetails = JSON.parse(JSON.stringify($.FileItemDetails)); + delete $.DirectoryItemDetails.properties["Content-Length"]; + $.DirectoryItem.properties["Details"] = {"$ref": "#/definitions/DirectoryItemDetails", "x-ms-xml" : {"name": "Properties"}}; + $.FilesAndDirectoriesListSegment.properties["DirectoryItems"]["x-ms-xml"] = {"name": "."}; $.FilesAndDirectoriesListSegment.properties["FileItems"]["x-ms-xml"] = {"name": "."}; - $.FileItem.properties["Details"]["x-ms-xml"] = {"name": "Properties"}; ``` ### ListHandles @@ -862,6 +912,7 @@ directive: $["Content-MD5"]["x-nullable"] = true; $["x-ms-request-server-encrypted"]["x-ms-client-default"] = false; $["x-ms-request-server-encrypted"]["x-nullable"] = true; + delete $["x-ms-file-last-write-time"]; ``` ### UploadFileRangeFromUri @@ -876,6 +927,7 @@ directive: $["x-ms-content-crc64"]["x-nullable"] = true; $["x-ms-request-server-encrypted"]["x-ms-client-default"] = false; $["x-ms-request-server-encrypted"]["x-nullable"] = true; + delete $["x-ms-file-last-write-time"]; ``` ### GetFileRangeList @@ -916,4 +968,32 @@ directive: where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=lease&break"].put.responses["202"].headers transform: > delete $["x-ms-lease-id"]; -``` \ No newline at end of file +``` + +### BreakShareLease + +```yaml +directive: + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share&comp=lease&break"].put.responses["202"].headers + transform: > + delete $["x-ms-lease-id"]; +``` + +### RenameFile/Directory + +```yaml +directive: + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=rename"].put.responses["200"].headers + transform: > + $["x-ms-file-creation-time"].format = "date-time"; + $["x-ms-file-last-write-time"].format = "date-time"; + $["x-ms-file-change-time"].format = "date-time"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory&comp=rename"].put.responses["200"].headers + transform: > + $["x-ms-file-creation-time"].format = "date-time"; + $["x-ms-file-last-write-time"].format = "date-time"; + $["x-ms-file-change-time"].format = "date-time"; +``` diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.Lease.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.Lease.json new file mode 100644 index 0000000000..dae17f89c2 --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.Lease.json @@ -0,0 +1,416 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "865c7afd-233a-4719-7953-f60fcb5864a4", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:29 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "865c7afd-233a-4719-7953-f60fcb5864a4", + "x-ms-request-id": "a253a293-701a-0044-6cd2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a3ec13c3-8d04-4cc8-508a-d4dd8c7b005a", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:29 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:29 GMT", + "x-ms-client-request-id": "a3ec13c3-8d04-4cc8-508a-d4dd8c7b005a", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "a253a297-701a-0044-6dd2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9f779426-285a-4b26-42a9-370b59bf0aff", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:29 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9f779426-285a-4b26-42a9-370b59bf0aff", + "x-ms-lease-id": "b5d200d3-5a1e-45a6-7a37-c4382fd74868", + "x-ms-request-id": "a253a298-701a-0044-6ed2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?comp=lease&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f778f1b2-7742-46a7-72ff-d5b33bdc7f77", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:30 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:29 GMT", + "x-ms-client-request-id": "f778f1b2-7742-46a7-72ff-d5b33bdc7f77", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "fixed", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a299-701a-0044-6fd2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b2ff8952-725f-4131-7bfc-bc17e1327d6f", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:30 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b2ff8952-725f-4131-7bfc-bc17e1327d6f", + "x-ms-lease-id": "b5d200d3-5a1e-45a6-7a37-c4382fd74868", + "x-ms-request-id": "a253a29a-701a-0044-70d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?comp=lease&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e3fad572-8871-4efe-424e-304215b0a283", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:30 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:29 GMT", + "x-ms-client-request-id": "e3fad572-8871-4efe-424e-304215b0a283", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a29b-701a-0044-71d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ec276f41-a7c9-437e-4d48-5d3a2dcc085a", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:30 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:29 GMT", + "x-ms-client-request-id": "ec276f41-a7c9-437e-4d48-5d3a2dcc085a", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a29c-701a-0044-72d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "89d56f52-a528-4ff9-7bce-963f30435b35", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:31 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "89d56f52-a528-4ff9-7bce-963f30435b35", + "x-ms-lease-id": "b5d200d3-5a1e-45a6-7a37-c4382fd74868", + "x-ms-request-id": "a253a29d-701a-0044-73d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?comp=lease&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "beb3e640-92ff-4cf2-7847-a44991f5da61", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:31 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:29 GMT", + "x-ms-client-request-id": "beb3e640-92ff-4cf2-7847-a44991f5da61", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2a0-701a-0044-74d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e70ce540-62fc-4a8f-6dfb-f84d6e8c4b7a", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:31 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e70ce540-62fc-4a8f-6dfb-f84d6e8c4b7a", + "x-ms-lease-id": "49c22105-c889-4f1b-405c-79361eb87fdb", + "x-ms-request-id": "a253a2a2-701a-0044-75d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?comp=lease&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "48f5a5fd-7257-4f7d-5168-f89c7a64f88d", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:32 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:29 GMT", + "x-ms-client-request-id": "48f5a5fd-7257-4f7d-5168-f89c7a64f88d", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2a4-701a-0044-76d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "afb18ed9-1b03-4c97-798c-5d77b89e0d85", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:32 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "afb18ed9-1b03-4c97-798c-5d77b89e0d85", + "x-ms-lease-time": "0", + "x-ms-request-id": "a253a2a5-701a-0044-77d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?comp=lease&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1e8e3670-d1b0-4b49-6b13-6d426dd48536", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:32 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1e8e3670-d1b0-4b49-6b13-6d426dd48536", + "x-ms-lease-id": "b5b2e3ec-7129-4330-7e90-72dd6cd539d4", + "x-ms-request-id": "a253a2a7-701a-0044-78d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?comp=lease&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2e58ffdf-a9a1-46c1-62d0-faf39a9e45b1", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:32 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:29 GMT", + "x-ms-client-request-id": "2e58ffdf-a9a1-46c1-62d0-faf39a9e45b1", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2a8-701a-0044-79d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d6b58ce7-3827-4a78-6dc1-3a58fcc7172b", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:33 GMT", + "etag": "\"0x8DA80E94A905682\"", + "last-modified": "Thu, 18 Aug 2022 07:14:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d6b58ce7-3827-4a78-6dc1-3a58fcc7172b", + "x-ms-lease-time": "0", + "x-ms-request-id": "a253a2aa-701a-0044-7ad2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?comp=lease&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d23bbabb-a058-47db-626c-4b9949f17ee7", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:33 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d23bbabb-a058-47db-626c-4b9949f17ee7", + "x-ms-request-id": "a253a2ab-701a-0044-7bd2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestlease?restype=share" + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.PremiumShare.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.PremiumShare.json index 42244c13e7..9d4ff2f59e 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.PremiumShare.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.PremiumShare.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "7578973b-1466-4073-7dd0-4d0805c4bf24", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "923181de-d189-4d4f-4ccc-bfe979e3154f", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Fri, 25 Feb 2022 09:37:12 GMT", - "etag": "\"0x8D9F84266BCB14B\"", - "last-modified": "Fri, 25 Feb 2022 09:37:12 GMT", + "date": "Wed, 17 Aug 2022 08:48:03 GMT", + "etag": "\"0x8DA802D32D9B204\"", + "last-modified": "Wed, 17 Aug 2022 08:48:04 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7578973b-1466-4073-7dd0-4d0805c4bf24", - "x-ms-request-id": "185c5f07-e01a-003c-622b-2af305000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "923181de-d189-4d4f-4ccc-bfe979e3154f", + "x-ms-request-id": "6ecb2ebf-601a-0093-1216-b2b5ac000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestpremiumshare?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "d05b4197-b142-4d5c-44d4-27c1fd4a532a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "708af5f3-e63d-486f-7d42-1cd27be7c738", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,21 +34,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Fri, 25 Feb 2022 09:37:13 GMT", - "etag": "\"0x8D9F842677996FF\"", - "last-modified": "Fri, 25 Feb 2022 09:37:13 GMT", + "date": "Wed, 17 Aug 2022 08:48:04 GMT", + "etag": "\"0x8DA802D33A4BA48\"", + "last-modified": "Wed, 17 Aug 2022 08:48:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d05b4197-b142-4d5c-44d4-27c1fd4a532a", - "x-ms-request-id": "61aed4d1-401a-0059-052b-2ade65000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "708af5f3-e63d-486f-7d42-1cd27be7c738", + "x-ms-request-id": "6b9f0978-f01a-0073-2c16-b20175000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/premiumshare?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "baf0fbc5-e307-4e85-4515-9dfc00d32773", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "69a8833b-c0e8-41aa-790f-515679d6c559", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -56,119 +56,120 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Fri, 25 Feb 2022 09:37:14 GMT", - "etag": "\"0x8D9F842677996FF\"", - "last-modified": "Fri, 25 Feb 2022 09:37:13 GMT", + "date": "Wed, 17 Aug 2022 08:48:05 GMT", + "etag": "\"0x8DA802D33A4BA48\"", + "last-modified": "Wed, 17 Aug 2022 08:48:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "x-ms-access-tier": "Premium", - "x-ms-client-request-id": "baf0fbc5-e307-4e85-4515-9dfc00d32773", + "x-ms-client-request-id": "69a8833b-c0e8-41aa-790f-515679d6c559", "x-ms-enabled-protocols": "SMB", "x-ms-has-immutability-policy": "false", "x-ms-has-legal-hold": "false", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "da56bb13-f01a-005c-422b-2a0cbe000000", - "x-ms-share-next-allowed-quota-downgrade-time": "Fri, 25 Feb 2022 09:37:13 GMT", + "x-ms-request-id": "6b9f0982-f01a-0073-3116-b20175000000", + "x-ms-share-next-allowed-quota-downgrade-time": "Wed, 17 Aug 2022 08:48:05 GMT", + "x-ms-share-provisioned-bandwidth-mibps": "110", "x-ms-share-provisioned-egress-mbps": "110", "x-ms-share-provisioned-ingress-mbps": "110", "x-ms-share-provisioned-iops": "3100", "x-ms-share-quota": "100", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/premiumshare?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "6b7e87b5-05e9-48dc-40dd-bfb66f501495", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a8ca5823-27ed-46d6-6675-06e9ec91ed63", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { - "BODY": "premiumsharepremiumshareFri, 25 Feb 2022 09:37:13 GMT\"0x8D9F842677996FF\"unlockedavailable100SMBPremium3100110110Fri, 25 Feb 2022 09:37:13 GMT$account-encryption-keyfalse", + "BODY": "premiumsharepremiumshareWed, 17 Aug 2022 08:48:05 GMT\"0x8DA802D33A4BA48\"unlockedavailable100SMBPremium3100110110110Wed, 17 Aug 2022 08:48:05 GMT$account-encryption-keyfalse", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Fri, 25 Feb 2022 09:37:15 GMT", + "date": "Wed, 17 Aug 2022 08:48:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "6b7e87b5-05e9-48dc-40dd-bfb66f501495", - "x-ms-request-id": "9b7e8b0e-c01a-009c-322b-2af480000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "a8ca5823-27ed-46d6-6675-06e9ec91ed63", + "x-ms-request-id": "6b9f0996-f01a-0073-4416-b20175000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net?comp=list&prefix=premiumshare" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "f76fa7c6-636f-48ff-42ec-e5e9bb4c94d4", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d4d866e9-3029-44e7-7355-519af7a6e16f", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { - "BODY": "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:ff9ff323-301a-00c5-462b-2a7303000000\nTime:2022-02-25T09:37:17.0122004Zx-ms-access-tierHot", + "BODY": "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:6b9f09a2-f01a-0073-4c16-b20175000000\nTime:2022-08-17T08:48:06.3278838Zx-ms-access-tierHot", "REASON_PHRASE": "The value for one of the HTTP headers is not in the correct format.", "STATUS_CODE": "400", "content-length": "325", "content-type": "application/xml", - "date": "Fri, 25 Feb 2022 09:37:16 GMT", + "date": "Wed, 17 Aug 2022 08:48:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f76fa7c6-636f-48ff-42ec-e5e9bb4c94d4", + "x-ms-client-request-id": "d4d866e9-3029-44e7-7355-519af7a6e16f", "x-ms-error-code": "InvalidHeaderValue", - "x-ms-request-id": "ff9ff323-301a-00c5-462b-2a7303000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "6b9f09a2-f01a-0073-4c16-b20175000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "c4bb8d41-6d36-448a-799f-244fc932bcad", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "721397f6-717a-4041-4693-91708a71ff18", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { - "BODY": "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:01dca1be-b01a-0062-4b2b-2a9bc1000000\nTime:2022-02-25T09:37:18.1177573Zx-ms-access-tierCool", + "BODY": "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:1edf6a83-701a-0099-3716-b2265b000000\nTime:2022-08-17T08:48:07.5681595Zx-ms-access-tierCool", "REASON_PHRASE": "The value for one of the HTTP headers is not in the correct format.", "STATUS_CODE": "400", "content-length": "326", "content-type": "application/xml", - "date": "Fri, 25 Feb 2022 09:37:17 GMT", + "date": "Wed, 17 Aug 2022 08:48:07 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c4bb8d41-6d36-448a-799f-244fc932bcad", + "x-ms-client-request-id": "721397f6-717a-4041-4693-91708a71ff18", "x-ms-error-code": "InvalidHeaderValue", - "x-ms-request-id": "01dca1be-b01a-0062-4b2b-2a9bc1000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "1edf6a83-701a-0099-3716-b2265b000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "d23cf134-4906-445e-625d-c34b21131650", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1c910319-3bf6-4f76-6b05-08d2a7bb0b8d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { - "BODY": "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:f3cdb96f-e01a-008b-5f2b-2a5d8b000000\nTime:2022-02-25T09:37:19.1856618Zx-ms-access-tierTransactionOptimized", + "BODY": "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:f67cc101-d01a-0006-3516-b26a59000000\nTime:2022-08-17T08:48:08.7554023Zx-ms-access-tierTransactionOptimized", "REASON_PHRASE": "The value for one of the HTTP headers is not in the correct format.", "STATUS_CODE": "400", "content-length": "342", "content-type": "application/xml", - "date": "Fri, 25 Feb 2022 09:37:18 GMT", + "date": "Wed, 17 Aug 2022 08:48:08 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d23cf134-4906-445e-625d-c34b21131650", + "x-ms-client-request-id": "1c910319-3bf6-4f76-6b05-08d2a7bb0b8d", "x-ms-error-code": "InvalidHeaderValue", - "x-ms-request-id": "f3cdb96f-e01a-008b-5f2b-2a5d8b000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "f67cc101-d01a-0006-3516-b26a59000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "ed077086-1073-4051-7c3c-5ae3dca33ba4", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d103c99d-1f51-4c80-53a8-da4b177b75b7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -176,21 +177,55 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Fri, 25 Feb 2022 09:37:20 GMT", - "etag": "\"0x8D9F8426B5895E9\"", - "last-modified": "Fri, 25 Feb 2022 09:37:20 GMT", + "date": "Wed, 17 Aug 2022 08:48:09 GMT", + "etag": "\"0x8DA802D3650AD98\"", + "last-modified": "Wed, 17 Aug 2022 08:48:09 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ed077086-1073-4051-7c3c-5ae3dca33ba4", - "x-ms-request-id": "04df7bb3-701a-001f-3a2b-2aeae2000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d103c99d-1f51-4c80-53a8-da4b177b75b7", + "x-ms-request-id": "01b9d087-601a-0085-2316-b2743b000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "13de348f-7f41-4526-4668-cf9b1c273d81", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "45a2e0d3-3571-4643-602c-8e55e24b154c", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:10 GMT", + "etag": "\"0x8DA802D3650AD98\"", + "last-modified": "Wed, 17 Aug 2022 08:48:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Premium", + "x-ms-client-request-id": "45a2e0d3-3571-4643-602c-8e55e24b154c", + "x-ms-enabled-protocols": "SMB", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "01b9d097-601a-0085-3016-b2743b000000", + "x-ms-share-next-allowed-quota-downgrade-time": "Wed, 17 Aug 2022 08:48:05 GMT", + "x-ms-share-provisioned-bandwidth-mibps": "110", + "x-ms-share-provisioned-egress-mbps": "110", + "x-ms-share-provisioned-ingress-mbps": "110", + "x-ms-share-provisioned-iops": "3100", + "x-ms-share-quota": "100", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4f93c35b-f0df-47f0-6ef0-212fe305c9da", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -198,19 +233,271 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Fri, 25 Feb 2022 09:37:20 GMT", + "date": "Wed, 17 Aug 2022 08:48:10 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "13de348f-7f41-4526-4668-cf9b1c273d81", - "x-ms-request-id": "7d4642bc-401a-0076-402b-2ad3ae000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "4f93c35b-f0df-47f0-6ef0-212fe305c9da", + "x-ms-request-id": "01b9d0a0-601a-0085-3616-b2743b000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/premiumshare?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)", - "x-ms-client-request-id": "d29d41fb-cad2-4af8-7b44-7ddc461da6d6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5f4a87ea-15e3-42ac-60a6-41df7c474623", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:10 GMT", + "etag": "\"0x8DA802D36D4EE41\"", + "last-modified": "Wed, 17 Aug 2022 08:48:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5f4a87ea-15e3-42ac-60a6-41df7c474623", + "x-ms-request-id": "01b9d0aa-601a-0085-3c16-b2743b000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare1?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a71744dc-dcb9-48d0-629c-ab6d97fef1b5", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:10 GMT", + "etag": "\"0x8DA802D36D4EE41\"", + "last-modified": "Wed, 17 Aug 2022 08:48:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Premium", + "x-ms-client-request-id": "a71744dc-dcb9-48d0-629c-ab6d97fef1b5", + "x-ms-enabled-protocols": "NFS", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "01b9d0be-601a-0085-4716-b2743b000000", + "x-ms-root-squash": "AllSquash", + "x-ms-share-next-allowed-quota-downgrade-time": "Wed, 17 Aug 2022 08:48:10 GMT", + "x-ms-share-provisioned-bandwidth-mibps": "110", + "x-ms-share-provisioned-egress-mbps": "110", + "x-ms-share-provisioned-ingress-mbps": "110", + "x-ms-share-provisioned-iops": "3100", + "x-ms-share-quota": "100", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare1?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6847aa03-22d4-46a2-44f7-9830682de22b", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "premiumshare1premiumshare1Wed, 17 Aug 2022 08:48:10 GMT\"0x8DA802D36D4EE41\"unlockedavailable100NFSAllSquashPremium3100110110110Wed, 17 Aug 2022 08:48:10 GMT$account-encryption-keyfalse", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-type": "application/xml", + "date": "Wed, 17 Aug 2022 08:48:11 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "6847aa03-22d4-46a2-44f7-9830682de22b", + "x-ms-request-id": "01b9d0c5-601a-0085-4d16-b2743b000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net?comp=list&prefix=premiumshare1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a607e5a7-23ce-409c-4a97-29ff46569678", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:11 GMT", + "etag": "\"0x8DA802D375D622E\"", + "last-modified": "Wed, 17 Aug 2022 08:48:11 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "a607e5a7-23ce-409c-4a97-29ff46569678", + "x-ms-request-id": "01b9d0d3-601a-0085-5916-b2743b000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare1?comp=properties&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7ba216d1-7ae6-417b-5b3d-fb85425c9f1e", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:11 GMT", + "etag": "\"0x8DA802D375D622E\"", + "last-modified": "Wed, 17 Aug 2022 08:48:11 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Premium", + "x-ms-client-request-id": "7ba216d1-7ae6-417b-5b3d-fb85425c9f1e", + "x-ms-enabled-protocols": "NFS", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "01b9d0da-601a-0085-5f16-b2743b000000", + "x-ms-root-squash": "NoRootSquash", + "x-ms-share-next-allowed-quota-downgrade-time": "Wed, 17 Aug 2022 08:48:10 GMT", + "x-ms-share-provisioned-bandwidth-mibps": "110", + "x-ms-share-provisioned-egress-mbps": "110", + "x-ms-share-provisioned-ingress-mbps": "110", + "x-ms-share-provisioned-iops": "3100", + "x-ms-share-quota": "100", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare1?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "712579d1-03b6-4252-6713-0a6b307b8c99", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:12 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "712579d1-03b6-4252-6713-0a6b307b8c99", + "x-ms-request-id": "01b9d0e6-601a-0085-6716-b2743b000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare1?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ab013095-b3a5-4dd5-52b6-57f60394f7f3", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:12 GMT", + "etag": "\"0x8DA802D37E43AA8\"", + "last-modified": "Wed, 17 Aug 2022 08:48:12 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ab013095-b3a5-4dd5-52b6-57f60394f7f3", + "x-ms-request-id": "01b9d0f9-601a-0085-7616-b2743b000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare2?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7c26f324-4c45-4332-53e5-a226ca1df957", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:12 GMT", + "etag": "\"0x8DA802D37E43AA8\"", + "last-modified": "Wed, 17 Aug 2022 08:48:12 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Premium", + "x-ms-client-request-id": "7c26f324-4c45-4332-53e5-a226ca1df957", + "x-ms-enabled-protocols": "SMB", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "01b9d108-601a-0085-7e16-b2743b000000", + "x-ms-share-next-allowed-quota-downgrade-time": "Wed, 17 Aug 2022 08:48:12 GMT", + "x-ms-share-provisioned-bandwidth-mibps": "110", + "x-ms-share-provisioned-egress-mbps": "110", + "x-ms-share-provisioned-ingress-mbps": "110", + "x-ms-share-provisioned-iops": "3100", + "x-ms-share-quota": "100", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare2?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "432e8752-fda5-459a-6ba3-56ee36dc3b71", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "premiumshare2premiumshare2Wed, 17 Aug 2022 08:48:12 GMT\"0x8DA802D37E43AA8\"unlockedavailable100SMBPremium3100110110110Wed, 17 Aug 2022 08:48:12 GMT$account-encryption-keyfalse", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-type": "application/xml", + "date": "Wed, 17 Aug 2022 08:48:12 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "432e8752-fda5-459a-6ba3-56ee36dc3b71", + "x-ms-request-id": "01b9d111-601a-0085-0616-b2743b000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net?comp=list&prefix=premiumshare2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4118ea00-6880-4f76-6dc8-28e0995a88ef", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Wed, 17 Aug 2022 08:48:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "4118ea00-6880-4f76-6dc8-28e0995a88ef", + "x-ms-request-id": "01b9d118-601a-0085-0c16-b2743b000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/premiumshare2?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "be68090f-7c4f-4c31-4bd2-11530499d4f6", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -218,11 +505,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Fri, 25 Feb 2022 09:37:22 GMT", + "date": "Wed, 17 Aug 2022 08:48:13 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d29d41fb-cad2-4af8-7b44-7ddc461da6d6", - "x-ms-request-id": "eaddb71a-d01a-007a-092b-2ac782000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "be68090f-7c4f-4c31-4bd2-11530499d4f6", + "x-ms-request-id": "6ecb2ecf-601a-0093-1716-b2b5ac000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestpremiumshare?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.SnapshotLease.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.SnapshotLease.json new file mode 100644 index 0000000000..73d6a1aba0 --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareClientTest.SnapshotLease.json @@ -0,0 +1,484 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6cdadf04-fb62-4de3-4b69-69ea320ab9e9", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:33 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6cdadf04-fb62-4de3-4b69-69ea320ab9e9", + "x-ms-request-id": "a253a2ac-701a-0044-7cd2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "50174530-4676-4ddc-42e4-7f713c4f1994", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:34 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "50174530-4676-4ddc-42e4-7f713c4f1994", + "x-ms-request-id": "a253a2b2-701a-0044-7fd2-b2e499000000", + "x-ms-snapshot": "2022-08-18T07:14:34.0000000Z", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=snapshot&restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "11fff7a7-3800-4b73-617e-3c0ea16b6057", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:34 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:34 GMT", + "x-ms-client-request-id": "11fff7a7-3800-4b73-617e-3c0ea16b6057", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "a253a2b3-701a-0044-80d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ad2f8310-94fa-4b10-4b31-f84a61e0b58c", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:34 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ad2f8310-94fa-4b10-4b31-f84a61e0b58c", + "x-ms-lease-id": "af32e18c-7117-488a-7a60-c4ff5d7281d3", + "x-ms-request-id": "a253a2b4-701a-0044-01d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "03997271-fb36-4de8-6f6f-83d67aa2e49a", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:35 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:34 GMT", + "x-ms-client-request-id": "03997271-fb36-4de8-6f6f-83d67aa2e49a", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "fixed", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2b5-701a-0044-02d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "403ff85d-7150-49f9-4c8c-623dc8dc2437", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:35 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "403ff85d-7150-49f9-4c8c-623dc8dc2437", + "x-ms-lease-id": "af32e18c-7117-488a-7a60-c4ff5d7281d3", + "x-ms-request-id": "a253a2b7-701a-0044-03d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b7ab9fd9-1ff3-456c-6735-e5b311a08291", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:35 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:34 GMT", + "x-ms-client-request-id": "b7ab9fd9-1ff3-456c-6735-e5b311a08291", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2b8-701a-0044-04d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b1a6dcf5-7a0f-447a-4cbe-0133b5c78025", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:36 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:34 GMT", + "x-ms-client-request-id": "b1a6dcf5-7a0f-447a-4cbe-0133b5c78025", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2b9-701a-0044-05d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c280450c-1e40-4b6a-5b4a-dd89c6e741de", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:36 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c280450c-1e40-4b6a-5b4a-dd89c6e741de", + "x-ms-lease-id": "af32e18c-7117-488a-7a60-c4ff5d7281d3", + "x-ms-request-id": "a253a2ba-701a-0044-06d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b926ef36-2f3d-470e-5434-53e74db01339", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:36 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:34 GMT", + "x-ms-client-request-id": "b926ef36-2f3d-470e-5434-53e74db01339", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2bb-701a-0044-07d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6c1c0127-8800-4af3-4eb1-52867442b830", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:36 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6c1c0127-8800-4af3-4eb1-52867442b830", + "x-ms-lease-id": "a45b29e6-1957-4b1b-54bb-1b1795911a32", + "x-ms-request-id": "a253a2bd-701a-0044-08d2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cc5073eb-2162-40e5-6fa7-2881a256e7fd", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:37 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:34 GMT", + "x-ms-client-request-id": "cc5073eb-2162-40e5-6fa7-2881a256e7fd", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2be-701a-0044-09d2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b654af1f-5401-4122-6260-9c6fc8a604be", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:37 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b654af1f-5401-4122-6260-9c6fc8a604be", + "x-ms-lease-time": "0", + "x-ms-request-id": "a253a2bf-701a-0044-0ad2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c447ed4f-5b95-4a9f-55a3-f7499e44f743", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:37 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c447ed4f-5b95-4a9f-55a3-f7499e44f743", + "x-ms-lease-id": "45ae04e9-e868-476d-7493-e03b687e52af", + "x-ms-request-id": "a253a2c0-701a-0044-0bd2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "17be3b9e-7ff7-42b9-4442-a906394e7d78", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:38 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Thu, 18 Aug 2022 07:14:34 GMT", + "x-ms-client-request-id": "17be3b9e-7ff7-42b9-4442-a906394e7d78", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "infinite", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "a253a2c1-701a-0044-0cd2-b2e499000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "033ccaf8-eafb-4cb8-74af-880a87a99ef1", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:38 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "033ccaf8-eafb-4cb8-74af-880a87a99ef1", + "x-ms-lease-time": "0", + "x-ms-request-id": "a253a2c2-701a-0044-0dd2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "356bcfe1-9edd-4153-7cb0-cdc8d292f2d4", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:38 GMT", + "etag": "\"0x8DA80E94D5D8DEF\"", + "last-modified": "Thu, 18 Aug 2022 07:14:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "356bcfe1-9edd-4153-7cb0-cdc8d292f2d4", + "x-ms-lease-time": "0", + "x-ms-request-id": "a253a2c3-701a-0044-0ed2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?comp=lease&restype=share&sharesnapshot=2022-08-18T07:14:34.0000000Z" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "654230ed-9c28-4e54-73c1-ef9a226dcf0b", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "ShareHasSnapshotsThe share has snapshots and the operation requires no snapshots.\nRequestId:a253a2c4-701a-0044-0fd2-b2e499000000\nTime:2022-08-18T07:14:39.0590129Z", + "REASON_PHRASE": "The share has snapshots and the operation requires no snapshots.", + "STATUS_CODE": "409", + "content-length": "250", + "content-type": "application/xml", + "date": "Thu, 18 Aug 2022 07:14:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "654230ed-9c28-4e54-73c1-ef9a226dcf0b", + "x-ms-error-code": "ShareHasSnapshots", + "x-ms-request-id": "a253a2c4-701a-0044-0fd2-b2e499000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cf55dd6c-831e-4b07-6644-c6bd92bbff49", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Thu, 18 Aug 2022 07:14:39 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cf55dd6c-831e-4b07-6644-c6bd92bbff49", + "x-ms-request-id": "6c3151a3-501a-0021-3bd2-b24add000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsnapshotlease?restype=share" + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.DirectorySmbProperties.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.DirectorySmbProperties.json index 5fe121dd3e..55e04dc575 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.DirectorySmbProperties.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.DirectorySmbProperties.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "23b44fbf-c7b8-4be8-68c2-5962d98b7f35", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6375da66-b792-49bb-7936-b87aec42b5c1", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DA1125C\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:31 GMT", + "etag": "\"0x8DA7C0EF5CB48D3\"", + "last-modified": "Fri, 12 Aug 2022 03:01:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "23b44fbf-c7b8-4be8-68c2-5962d98b7f35", - "x-ms-request-id": "1ae27804-901a-005c-16b7-01ea5f000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "6375da66-b792-49bb-7936-b87aec42b5c1", + "x-ms-request-id": "5a2c55e7-d01a-005d-24f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3ed04606-8ff4-496a-6e07-c9a590322e94", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "005b87d7-754b-4b94-77e5-135dfeb0e6fe", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DA4F025\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:32 GMT", + "etag": "\"0x8DA7C0EF5F9F869\"", + "last-modified": "Fri, 12 Aug 2022 03:01:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3ed04606-8ff4-496a-6e07-c9a590322e94", + "x-ms-client-request-id": "005b87d7-754b-4b94-77e5-135dfeb0e6fe", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.4068005Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4068005Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.4532841Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.4532841Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4068005Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.4532841Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae27807-901a-005c-17b7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c55f9-d01a-005d-33f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbPropertiesbase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ed342000-a8e6-45ec-78bd-738c8b3e7692", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5d6eb2c7-5391-47d6-4a76-04c462c19620", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DA4F025\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:32 GMT", + "etag": "\"0x8DA7C0EF5F9F869\"", + "last-modified": "Fri, 12 Aug 2022 03:01:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ed342000-a8e6-45ec-78bd-738c8b3e7692", + "x-ms-client-request-id": "5d6eb2c7-5391-47d6-4a76-04c462c19620", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.4068005Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4068005Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.4532841Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.4532841Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4068005Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.4532841Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae27809-901a-005c-18b7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c55fa-d01a-005d-34f7-ad6422000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbPropertiesbase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ded94ec4-8e70-4191-7d6f-006817a941a0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "dfe52271-5592-4020-70f6-cfe629c7adb3", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DA6ECC6\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:32 GMT", + "etag": "\"0x8DA7C0EF631DACC\"", + "last-modified": "Fri, 12 Aug 2022 03:01:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ded94ec4-8e70-4191-7d6f-006817a941a0", + "x-ms-client-request-id": "dfe52271-5592-4020-70f6-cfe629c7adb3", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.4198214Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae2780a-901a-005c-19b7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c55fb-d01a-005d-35f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties1?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6d1ee3ad-445c-4da7-6d4e-d0b2a0b88469", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fb3cab6c-d3e1-4610-76f6-591b4c873eb4", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -124,29 +124,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DA6ECC6\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:32 GMT", + "etag": "\"0x8DA7C0EF631DACC\"", + "last-modified": "Fri, 12 Aug 2022 03:01:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6d1ee3ad-445c-4da7-6d4e-d0b2a0b88469", + "x-ms-client-request-id": "fb3cab6c-d3e1-4610-76f6-591b4c873eb4", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.4198214Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae2780b-901a-005c-1ab7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c55fc-d01a-005d-36f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties2?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "764ab5a2-cd33-441a-7654-69b04c53815d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "082fd2a0-643f-4da6-5ada-aa08ae2c0e44", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -154,29 +154,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DA6ECC6\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:33 GMT", + "etag": "\"0x8DA7C0EF631DACC\"", + "last-modified": "Fri, 12 Aug 2022 03:01:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "764ab5a2-cd33-441a-7654-69b04c53815d", + "x-ms-client-request-id": "082fd2a0-643f-4da6-5ada-aa08ae2c0e44", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.4198214Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae2780c-901a-005c-1bb7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c55fd-d01a-005d-37f7-ad6422000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties1?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "cd932b47-1b4a-44f7-5f55-272e7f40e567", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d11d7a30-18af-47cd-744f-5122a9750be7", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -184,29 +184,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DA6ECC6\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:33 GMT", + "etag": "\"0x8DA7C0EF631DACC\"", + "last-modified": "Fri, 12 Aug 2022 03:01:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "cd932b47-1b4a-44f7-5f55-272e7f40e567", + "x-ms-client-request-id": "d11d7a30-18af-47cd-744f-5122a9750be7", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.4198214Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae2780d-901a-005c-1cb7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c560b-d01a-005d-38f7-ad6422000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties2?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6c51f4f8-b310-423e-4227-5b4217797fe6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "81dc368a-bc9e-4368-63d6-76d166d67dca", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -214,29 +214,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DB1E690\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:33 GMT", + "etag": "\"0x8DA7C0EF7043CE0\"", + "last-modified": "Fri, 12 Aug 2022 03:01:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6c51f4f8-b310-423e-4227-5b4217797fe6", + "x-ms-client-request-id": "81dc368a-bc9e-4368-63d6-76d166d67dca", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.4917520Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4917520Z", + "x-ms-file-change-time": "2022-08-12T03:01:34.1982944Z", + "x-ms-file-creation-time": "2022-08-12T03:01:34.1982944Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4917520Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:34.1982944Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae2780e-901a-005c-1db7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c560c-d01a-005d-39f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties3?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7f6d965f-bf15-4025-6a00-d831d1d018fe", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "64e99ac7-0ce2-43a1-63d6-d5bb7add6631", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -244,29 +244,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DB4091E\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:34 GMT", + "etag": "\"0x8DA7C0EF7309D99\"", + "last-modified": "Fri, 12 Aug 2022 03:01:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7f6d965f-bf15-4025-6a00-d831d1d018fe", + "x-ms-client-request-id": "64e99ac7-0ce2-43a1-63d6-d5bb7add6631", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.5057438Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.5057438Z", + "x-ms-file-change-time": "2022-08-12T03:01:34.4891289Z", + "x-ms-file-creation-time": "2022-08-12T03:01:34.4891289Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.5057438Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:34.4891289Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1ae2780f-901a-005c-1eb7-01ea5f000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c560d-d01a-005d-3af7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties4?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "975edcc0-308b-46a7-4e23-51e4dce7d318", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c9390b52-6075-46b2-524f-b1565d5af7c5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -274,29 +274,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DB652BC\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:34 GMT", + "etag": "\"0x8DA7C0EF75D4C6D\"", + "last-modified": "Fri, 12 Aug 2022 03:01:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "975edcc0-308b-46a7-4e23-51e4dce7d318", + "x-ms-client-request-id": "c9390b52-6075-46b2-524f-b1565d5af7c5", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.5207356Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "5409028745771974529*10343500956293103928", - "x-ms-request-id": "1ae27810-901a-005c-1fb7-01ea5f000000", + "x-ms-file-permission-key": "1976883472164499290*16137673612980802019", + "x-ms-request-id": "5a2c5610-d01a-005d-3bf7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties3?comp=properties&restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1a2dce59-bd83-42d3-4ffd-2cf09ce02146", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "51875008-9178-4616-6fe5-c6821d04b18c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -304,29 +304,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DB82737\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:34 GMT", + "etag": "\"0x8DA7C0EF789AD2C\"", + "last-modified": "Fri, 12 Aug 2022 03:01:35 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1a2dce59-bd83-42d3-4ffd-2cf09ce02146", + "x-ms-client-request-id": "51875008-9178-4616-6fe5-c6821d04b18c", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.5327287Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "5409028745771974529*10343500956293103928", - "x-ms-request-id": "1ae27811-901a-005c-20b7-01ea5f000000", + "x-ms-file-permission-key": "1976883472164499290*16137673612980802019", + "x-ms-request-id": "5a2c5611-d01a-005d-3cf7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties4?comp=properties&restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8419ac78-48c2-425b-51d7-d09de81388ae", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2cda3996-6a62-45bb-7cac-d44ed0aa2610", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -334,29 +334,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DB652BC\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:34 GMT", + "etag": "\"0x8DA7C0EF75D4C6D\"", + "last-modified": "Fri, 12 Aug 2022 03:01:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8419ac78-48c2-425b-51d7-d09de81388ae", + "x-ms-client-request-id": "2cda3996-6a62-45bb-7cac-d44ed0aa2610", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.5207356Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "5409028745771974529*10343500956293103928", - "x-ms-request-id": "1ae27812-901a-005c-21b7-01ea5f000000", + "x-ms-file-permission-key": "1976883472164499290*16137673612980802019", + "x-ms-request-id": "5a2c5612-d01a-005d-3df7-ad6422000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties3?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2ae91414-4a07-4177-7821-1e80cdc77f14", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a6a9a192-eedf-4000-59e3-8c7ab0e1e1ea", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -364,29 +364,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DB82737\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:35 GMT", + "etag": "\"0x8DA7C0EF789AD2C\"", + "last-modified": "Fri, 12 Aug 2022 03:01:35 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2ae91414-4a07-4177-7821-1e80cdc77f14", + "x-ms-client-request-id": "a6a9a192-eedf-4000-59e3-8c7ab0e1e1ea", "x-ms-file-attributes": "Directory | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:04:55.5327287Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.4198214Z", + "x-ms-file-change-time": "2022-08-12T03:01:32.8195279Z", + "x-ms-file-creation-time": "2022-08-12T03:01:32.8195276Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.4198216Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:32.8195278Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "5409028745771974529*10343500956293103928", - "x-ms-request-id": "1ae27813-901a-005c-22b7-01ea5f000000", + "x-ms-file-permission-key": "1976883472164499290*16137673612980802019", + "x-ms-request-id": "5a2c5613-d01a-005d-3ef7-ad6422000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties/DirectorySmbProperties4?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "353a48b0-be63-47e3-6032-6a30b0aeef1d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6485eefa-9d3d-4981-63dc-0126994bf647", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -394,19 +394,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:35 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "353a48b0-be63-47e3-6032-6a30b0aeef1d", - "x-ms-request-id": "1ae27814-901a-005c-23b7-01ea5f000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "6485eefa-9d3d-4981-63dc-0126994bf647", + "x-ms-request-id": "5a2c5614-d01a-005d-3ff7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3414c7f6-1d04-4544-633b-0d9640b1c541", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "241cb71b-da8f-4952-4b94-8f606db8e71d", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -414,11 +414,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:35 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3414c7f6-1d04-4544-633b-0d9640b1c541", - "x-ms-request-id": "1ae27815-901a-005c-24b7-01ea5f000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "241cb71b-da8f-4952-4b94-8f606db8e71d", + "x-ms-request-id": "5a2c5615-d01a-005d-40f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestdirectorysmbproperties?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.ListFilesAndDirectoriesSinglePageTest.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.ListFilesAndDirectoriesSinglePageTest.json index 89924935a7..ee7ea3f700 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.ListFilesAndDirectoriesSinglePageTest.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.ListFilesAndDirectoriesSinglePageTest.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ef0e834b-7961-405b-697c-c188b31a912b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "180cb488-1e1e-42c0-49a6-761de0a903b4", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DE289F7\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:02 GMT", + "etag": "\"0x8DA81A51FE70AB2\"", + "last-modified": "Fri, 19 Aug 2022 05:39:03 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ef0e834b-7961-405b-697c-c188b31a912b", - "x-ms-request-id": "b5341805-801a-001d-5ab7-01b2bb000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "180cb488-1e1e-42c0-49a6-761de0a903b4", + "x-ms-request-id": "6bfd2888-e01a-00a2-348d-b354bf000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6c705406-5ca5-4bc7-443b-e0c89954e1ef", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "99ea3efd-ec41-4d45-6792-00b4a3530e39", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DE63565\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:02 GMT", + "etag": "\"0x8DA81A52015EE36\"", + "last-modified": "Fri, 19 Aug 2022 05:39:03 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6c705406-5ca5-4bc7-443b-e0c89954e1ef", + "x-ms-client-request-id": "99ea3efd-ec41-4d45-6792-00b4a3530e39", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.8345573Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.8345573Z", + "x-ms-file-change-time": "2022-08-19T05:39:03.4241590Z", + "x-ms-file-creation-time": "2022-08-19T05:39:03.4241590Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.8345573Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:03.4241590Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b5341808-801a-001d-5bb7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd288b-e01a-00a2-358d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/ListFilesAndDirectoriesSinglePageTestbase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "174617cf-0941-42d4-6d47-2061662747d5", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c2076128-872e-41a4-4283-e4e54297c4cf", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DE857F9\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:03 GMT", + "etag": "\"0x8DA81A520436053\"", + "last-modified": "Fri, 19 Aug 2022 05:39:03 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "174617cf-0941-42d4-6d47-2061662747d5", + "x-ms-client-request-id": "c2076128-872e-41a4-4283-e4e54297c4cf", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.8485497Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.8485497Z", + "x-ms-file-change-time": "2022-08-19T05:39:03.7219923Z", + "x-ms-file-creation-time": "2022-08-19T05:39:03.7219923Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.8485497Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:03.7219923Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b5341809-801a-001d-5cb7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd288d-e01a-00a2-368d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d110c3c8-a39d-43b7-769f-2bd8f83d5f00", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2642a112-06b8-44be-5078-4d93f1215791", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DEA7A90\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:03 GMT", + "etag": "\"0x8DA81A520708459\"", + "last-modified": "Fri, 19 Aug 2022 05:39:04 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d110c3c8-a39d-43b7-769f-2bd8f83d5f00", + "x-ms-client-request-id": "2642a112-06b8-44be-5078-4d93f1215791", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.8625424Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.8625424Z", + "x-ms-file-change-time": "2022-08-19T05:39:04.0178265Z", + "x-ms-file-creation-time": "2022-08-19T05:39:04.0178265Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.8625424Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:04.0178265Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b534180a-801a-001d-5db7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd2893-e01a-00a2-3b8d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "96fced3f-e993-43f8-4880-730c67d26805", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "55421c2b-f292-45c9-4ac2-a2922cddea0c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -124,29 +124,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DEC760D\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:03 GMT", + "etag": "\"0x8DA81A5209D5A56\"", + "last-modified": "Fri, 19 Aug 2022 05:39:04 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "96fced3f-e993-43f8-4880-730c67d26805", + "x-ms-client-request-id": "55421c2b-f292-45c9-4ac2-a2922cddea0c", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.8755341Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.8755341Z", + "x-ms-file-change-time": "2022-08-19T05:39:04.3116630Z", + "x-ms-file-creation-time": "2022-08-19T05:39:04.3116630Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.8755341Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:04.3116630Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b534180b-801a-001d-5eb7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd2896-e01a-00a2-3c8d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest0?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0c3403c4-51f5-4167-5866-eef9e7f60708", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2e756f22-b337-4b79-787c-4e9ab8967414", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -154,29 +154,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DEEBFA7\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:04 GMT", + "etag": "\"0x8DA81A520CACC6F\"", + "last-modified": "Fri, 19 Aug 2022 05:39:04 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0c3403c4-51f5-4167-5866-eef9e7f60708", + "x-ms-client-request-id": "2e756f22-b337-4b79-787c-4e9ab8967414", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:55.8905255Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.8905255Z", + "x-ms-file-change-time": "2022-08-19T05:39:04.6094959Z", + "x-ms-file-creation-time": "2022-08-19T05:39:04.6094959Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.8905255Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:04.6094959Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b534180c-801a-001d-5fb7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd2898-e01a-00a2-3e8d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "249df312-9d1c-4fb8-5d4d-4911a27bb22f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2ef39397-a056-4caa-451b-a98c37594f80", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -184,29 +184,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DF0E23B\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:04 GMT", + "etag": "\"0x8DA81A520F77B59\"", + "last-modified": "Fri, 19 Aug 2022 05:39:04 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "249df312-9d1c-4fb8-5d4d-4911a27bb22f", + "x-ms-client-request-id": "2ef39397-a056-4caa-451b-a98c37594f80", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.9045179Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.9045179Z", + "x-ms-file-change-time": "2022-08-19T05:39:04.9023321Z", + "x-ms-file-creation-time": "2022-08-19T05:39:04.9023321Z", "x-ms-file-id": "12682206919419494400", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.9045179Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:04.9023321Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b534180d-801a-001d-60b7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd2899-e01a-00a2-3f8d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/ListFilesAndDirectoriesSinglePageTestB0?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "02866160-5e80-4ce8-68dd-173b1fd3841a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b2fb1ec6-7321-4af8-6260-a76b70736e2d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -214,29 +214,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DF304C9\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:04 GMT", + "etag": "\"0x8DA81A52124C66A\"", + "last-modified": "Fri, 19 Aug 2022 05:39:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "02866160-5e80-4ce8-68dd-173b1fd3841a", + "x-ms-client-request-id": "b2fb1ec6-7321-4af8-6260-a76b70736e2d", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:55.9185097Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.9185097Z", + "x-ms-file-change-time": "2022-08-19T05:39:05.1991658Z", + "x-ms-file-creation-time": "2022-08-19T05:39:05.1991658Z", "x-ms-file-id": "17293892937846882304", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.9185097Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:05.1991658Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b534180e-801a-001d-61b7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd289a-e01a-00a2-408d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/fileB0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3e8fff5c-0196-42ee-5372-f4585596d1c0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9e282171-c384-4ae4-78ea-0148c6e0db4b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -244,29 +244,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DF5004D\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:05 GMT", + "etag": "\"0x8DA81A52152D4B2\"", + "last-modified": "Fri, 19 Aug 2022 05:39:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3e8fff5c-0196-42ee-5372-f4585596d1c0", + "x-ms-client-request-id": "9e282171-c384-4ae4-78ea-0148c6e0db4b", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.9315021Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.9315021Z", + "x-ms-file-change-time": "2022-08-19T05:39:05.5009970Z", + "x-ms-file-creation-time": "2022-08-19T05:39:05.5009970Z", "x-ms-file-id": "9799903157902376960", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.9315021Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:05.5009970Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b534180f-801a-001d-62b7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd289c-e01a-00a2-428d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest1?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1069751b-ca79-47a8-5a87-4e57ba0baa60", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cf4e1758-54f3-4baf-795f-4910c9f68e39", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -274,29 +274,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DF749E9\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:05 GMT", + "etag": "\"0x8DA81A5218046D1\"", + "last-modified": "Fri, 19 Aug 2022 05:39:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1069751b-ca79-47a8-5a87-4e57ba0baa60", + "x-ms-client-request-id": "cf4e1758-54f3-4baf-795f-4910c9f68e39", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:55.9464937Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.9464937Z", + "x-ms-file-change-time": "2022-08-19T05:39:05.7988305Z", + "x-ms-file-creation-time": "2022-08-19T05:39:05.7988305Z", "x-ms-file-id": "14411589176329764864", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.9464937Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:05.7988305Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b5341810-801a-001d-63b7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd289d-e01a-00a2-438d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file1" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7263d59a-7d61-447c-6a7d-34968ca97086", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ecb06e3c-686e-451d-6721-4ec0736187e6", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -304,29 +304,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:54 GMT", - "etag": "\"0x8D9CFCE3DF96C7C\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:05 GMT", + "etag": "\"0x8DA81A521AE7C1F\"", + "last-modified": "Fri, 19 Aug 2022 05:39:06 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7263d59a-7d61-447c-6a7d-34968ca97086", + "x-ms-client-request-id": "ecb06e3c-686e-451d-6721-4ec0736187e6", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.9604860Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.9604860Z", + "x-ms-file-change-time": "2022-08-19T05:39:06.1016607Z", + "x-ms-file-creation-time": "2022-08-19T05:39:06.1016607Z", "x-ms-file-id": "12105746167116070912", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.9604860Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:06.1016607Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b5341811-801a-001d-64b7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd289e-e01a-00a2-448d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/ListFilesAndDirectoriesSinglePageTestB1?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b305145f-630e-43a5-5e0a-247a16d6091d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "57c037ed-10b2-416a-7e63-64e8c5becd08", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -334,29 +334,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DFB6803\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:05 GMT", + "etag": "\"0x8DA81A521DB2B0C\"", + "last-modified": "Fri, 19 Aug 2022 05:39:06 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b305145f-630e-43a5-5e0a-247a16d6091d", + "x-ms-client-request-id": "57c037ed-10b2-416a-7e63-64e8c5becd08", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:55.9734787Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.9734787Z", + "x-ms-file-change-time": "2022-08-19T05:39:06.3944972Z", + "x-ms-file-creation-time": "2022-08-19T05:39:06.3944972Z", "x-ms-file-id": "16717432185543458816", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.9734787Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:06.3944972Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b5341812-801a-001d-65b7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd28a0-e01a-00a2-468d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/fileB1" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e1c8e423-42ef-40da-5dbf-467fc58cf03b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a87825a8-178f-401e-535f-a25f687ae212", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -364,29 +364,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DFD8A92\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:06 GMT", + "etag": "\"0x8DA81A522082807\"", + "last-modified": "Fri, 19 Aug 2022 05:39:06 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e1c8e423-42ef-40da-5dbf-467fc58cf03b", + "x-ms-client-request-id": "a87825a8-178f-401e-535f-a25f687ae212", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.9874706Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.9874706Z", + "x-ms-file-change-time": "2022-08-19T05:39:06.6893319Z", + "x-ms-file-creation-time": "2022-08-19T05:39:06.6893319Z", "x-ms-file-id": "10952824662509223936", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.9874706Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:06.6893319Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b5341813-801a-001d-66b7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28a2-e01a-00a2-478d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest2?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3a17506e-3c16-4d35-61c7-03658347f822", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4087d7ca-4b5b-428d-5b6f-fac6148f393a", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -394,29 +394,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DFFD431\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:06 GMT", + "etag": "\"0x8DA81A522359A26\"", + "last-modified": "Fri, 19 Aug 2022 05:39:06 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3a17506e-3c16-4d35-61c7-03658347f822", + "x-ms-client-request-id": "4087d7ca-4b5b-428d-5b6f-fac6148f393a", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:56.0024625Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.0024625Z", + "x-ms-file-change-time": "2022-08-19T05:39:06.9871654Z", + "x-ms-file-creation-time": "2022-08-19T05:39:06.9871654Z", "x-ms-file-id": "15564510680936611840", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.0024625Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:06.9871654Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b5341814-801a-001d-67b7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd28a3-e01a-00a2-488d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "62d13673-16f1-4d94-7c09-dc40163587e3", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f6df262e-8a11-4dac-52ff-6dc26d47a861", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -424,29 +424,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E01F6BE\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:06 GMT", + "etag": "\"0x8DA81A522624914\"", + "last-modified": "Fri, 19 Aug 2022 05:39:07 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "62d13673-16f1-4d94-7c09-dc40163587e3", + "x-ms-client-request-id": "f6df262e-8a11-4dac-52ff-6dc26d47a861", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:56.0164542Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.0164542Z", + "x-ms-file-change-time": "2022-08-19T05:39:07.2800020Z", + "x-ms-file-creation-time": "2022-08-19T05:39:07.2800020Z", "x-ms-file-id": "13258667671722917888", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.0164542Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:07.2800020Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b5341815-801a-001d-68b7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28a4-e01a-00a2-498d-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/ListFilesAndDirectoriesSinglePageTestB2?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "dc78852c-0945-4675-481c-242fd43add0b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b0a10004-7f7f-4aec-420d-8e45c2e0e17a", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -454,29 +454,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E04194F\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:07 GMT", + "etag": "\"0x8DA81A5228F1F09\"", + "last-modified": "Fri, 19 Aug 2022 05:39:07 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "dc78852c-0945-4675-481c-242fd43add0b", + "x-ms-client-request-id": "b0a10004-7f7f-4aec-420d-8e45c2e0e17a", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:56.0304463Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.0304463Z", + "x-ms-file-change-time": "2022-08-19T05:39:07.5738377Z", + "x-ms-file-creation-time": "2022-08-19T05:39:07.5738377Z", "x-ms-file-id": "17870353690150305792", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.0304463Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:07.5738377Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b5341816-801a-001d-69b7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd28a5-e01a-00a2-4a8e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/fileB2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3168234e-2348-43d1-40ff-9620446d04ab", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "78632b89-26c6-460e-6ead-5d1cd50e4429", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -484,29 +484,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E063BDE\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:07 GMT", + "etag": "\"0x8DA81A522BCB833\"", + "last-modified": "Fri, 19 Aug 2022 05:39:07 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3168234e-2348-43d1-40ff-9620446d04ab", + "x-ms-client-request-id": "78632b89-26c6-460e-6ead-5d1cd50e4429", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:56.0444382Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.0444382Z", + "x-ms-file-change-time": "2022-08-19T05:39:07.8726707Z", + "x-ms-file-creation-time": "2022-08-19T05:39:07.8726707Z", "x-ms-file-id": "9511672781750665216", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.0444382Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:07.8726707Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b5341817-801a-001d-6ab7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28a6-e01a-00a2-4b8e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest3?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "008eae2f-d5e6-434e-6b9d-ced9ee42a75a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ab4513a9-7503-482f-55b5-f8cd56f57e40", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -514,29 +514,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E08857A\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:07 GMT", + "etag": "\"0x8DA81A522EA0343\"", + "last-modified": "Fri, 19 Aug 2022 05:39:08 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "008eae2f-d5e6-434e-6b9d-ced9ee42a75a", + "x-ms-client-request-id": "ab4513a9-7503-482f-55b5-f8cd56f57e40", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:56.0594298Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.0594298Z", + "x-ms-file-change-time": "2022-08-19T05:39:08.1695043Z", + "x-ms-file-creation-time": "2022-08-19T05:39:08.1695043Z", "x-ms-file-id": "14123358800178053120", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.0594298Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:08.1695043Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b5341818-801a-001d-6bb7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd28a7-e01a-00a2-4c8e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file3" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7c0756e1-1ef7-4ed9-7375-d0c17baaf05c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ff5dff68-c7ac-43fa-4552-0e4f199ac58d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -544,29 +544,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E0AF621\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:08 GMT", + "etag": "\"0x8DA81A52317C37E\"", + "last-modified": "Fri, 19 Aug 2022 05:39:08 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7c0756e1-1ef7-4ed9-7375-d0c17baaf05c", + "x-ms-client-request-id": "ff5dff68-c7ac-43fa-4552-0e4f199ac58d", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:56.0754209Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.0754209Z", + "x-ms-file-change-time": "2022-08-19T05:39:08.4693374Z", + "x-ms-file-creation-time": "2022-08-19T05:39:08.4693374Z", "x-ms-file-id": "11817515790964359168", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.0754209Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:08.4693374Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b5341819-801a-001d-6cb7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28a8-e01a-00a2-4d8e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/ListFilesAndDirectoriesSinglePageTestB3?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "78e3ebbb-04c3-4574-7179-777332213aaf", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1af07d16-6a16-40a1-630f-fbe9510115ff", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -574,29 +574,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E0D18B3\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:08 GMT", + "etag": "\"0x8DA81A52344E77D\"", + "last-modified": "Fri, 19 Aug 2022 05:39:08 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "78e3ebbb-04c3-4574-7179-777332213aaf", + "x-ms-client-request-id": "1af07d16-6a16-40a1-630f-fbe9510115ff", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:56.0894131Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.0894131Z", + "x-ms-file-change-time": "2022-08-19T05:39:08.7651709Z", + "x-ms-file-creation-time": "2022-08-19T05:39:08.7651709Z", "x-ms-file-id": "16429201809391747072", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.0894131Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:08.7651709Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b534181a-801a-001d-6db7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd28a9-e01a-00a2-4e8e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/fileB3" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "84ea62d0-516d-4e2d-5a64-3f45ea874a5d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4241079d-d304-4fb8-7a33-9b1360fd19c8", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -604,29 +604,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E0F1433\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:08 GMT", + "etag": "\"0x8DA81A5237280A3\"", + "last-modified": "Fri, 19 Aug 2022 05:39:09 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "84ea62d0-516d-4e2d-5a64-3f45ea874a5d", + "x-ms-client-request-id": "4241079d-d304-4fb8-7a33-9b1360fd19c8", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:56.1024051Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.1024051Z", + "x-ms-file-change-time": "2022-08-19T05:39:09.0640035Z", + "x-ms-file-creation-time": "2022-08-19T05:39:09.0640035Z", "x-ms-file-id": "10664594286357512192", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.1024051Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:09.0640035Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b534181b-801a-001d-6eb7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28aa-e01a-00a2-4f8e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest4?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b3902def-1a24-4086-763b-7b368568d1e6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cedbc9a2-5764-45f3-49e1-7d003ecdab1a", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -634,29 +634,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E115DD3\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:08 GMT", + "etag": "\"0x8DA81A523A040D9\"", + "last-modified": "Fri, 19 Aug 2022 05:39:09 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b3902def-1a24-4086-763b-7b368568d1e6", + "x-ms-client-request-id": "cedbc9a2-5764-45f3-49e1-7d003ecdab1a", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:56.1173971Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.1173971Z", + "x-ms-file-change-time": "2022-08-19T05:39:09.3638361Z", + "x-ms-file-creation-time": "2022-08-19T05:39:09.3638361Z", "x-ms-file-id": "15276280304784900096", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.1173971Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:09.3638361Z", "x-ms-file-parent-id": "11529285414812647424", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b534181c-801a-001d-6fb7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd28ad-e01a-00a2-508e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file4" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "18fa4213-7af0-4c17-48a4-2ed549f25e8c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "745891c6-9c05-4dd3-4245-d483f2183596", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -664,29 +664,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E138068\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:09 GMT", + "etag": "\"0x8DA81A523CD64DF\"", + "last-modified": "Fri, 19 Aug 2022 05:39:09 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "18fa4213-7af0-4c17-48a4-2ed549f25e8c", + "x-ms-client-request-id": "745891c6-9c05-4dd3-4245-d483f2183596", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:56.1313896Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.1313896Z", + "x-ms-file-change-time": "2022-08-19T05:39:09.6596703Z", + "x-ms-file-creation-time": "2022-08-19T05:39:09.6596703Z", "x-ms-file-id": "12970437295571206144", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.1313896Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:09.6596703Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b534181d-801a-001d-70b7-01b2bb000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28ae-e01a-00a2-518e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/ListFilesAndDirectoriesSinglePageTestB4?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d1c7db57-39d7-4ab8-7fc2-7daa4dc91322", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ea737d66-ef5e-41ac-6cbf-1c01adb111c9", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -694,113 +694,484 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3E15A2F5\"", - "last-modified": "Tue, 04 Jan 2022 22:04:56 GMT", + "date": "Fri, 19 Aug 2022 05:39:09 GMT", + "etag": "\"0x8DA81A523FA61DC\"", + "last-modified": "Fri, 19 Aug 2022 05:39:09 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d1c7db57-39d7-4ab8-7fc2-7daa4dc91322", + "x-ms-client-request-id": "ea737d66-ef5e-41ac-6cbf-1c01adb111c9", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:04:56.1453813Z", - "x-ms-file-creation-time": "2022-01-04T22:04:56.1453813Z", + "x-ms-file-change-time": "2022-08-19T05:39:09.9545052Z", + "x-ms-file-creation-time": "2022-08-19T05:39:09.9545052Z", "x-ms-file-id": "17582123313998594048", - "x-ms-file-last-write-time": "2022-01-04T22:04:56.1453813Z", + "x-ms-file-last-write-time": "2022-08-19T05:39:09.9545052Z", "x-ms-file-parent-id": "16140971433240035328", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b534181e-801a-001d-71b7-01b2bb000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "6bfd28af-e01a-00a2-528e-b354bf000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirB/fileB4" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a8b9b0d1-136e-4efd-4ec0-f221c0c6d0ab", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "448f3a00-ab88-4d42-782c-c0eb8706eb42", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { - "BODY": "dirAdirBListFilesAndDirectoriesSinglePageTestbase", + "BODY": "0dirA11529285414812647424dirB16140971433240035328ListFilesAndDirectoriesSinglePageTestbase13835128424026341376", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:09 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "a8b9b0d1-136e-4efd-4ec0-f221c0c6d0ab", - "x-ms-request-id": "b534181f-801a-001d-72b7-01b2bb000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "448f3a00-ab88-4d42-782c-c0eb8706eb42", + "x-ms-request-id": "6bfd28b0-e01a-00a2-538e-b354bf000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/?comp=list&restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e756f830-10d8-4395-7987-3a538be0e5b6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "127a425c-8f38-445b-50d1-1ef041110ebf", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { - "BODY": "file01024file11024file21024file31024file41024ListFilesAndDirectoriesSinglePageTest0ListFilesAndDirectoriesSinglePageTest1ListFilesAndDirectoriesSinglePageTest2ListFilesAndDirectoriesSinglePageTest3ListFilesAndDirectoriesSinglePageTest4", + "BODY": "11529285414812647424file0149880499286331883521024file1144115891763297648641024file2155645106809366118401024file3141233588001780531201024file4152762803047849000961024ListFilesAndDirectoriesSinglePageTest010376363910205800448ListFilesAndDirectoriesSinglePageTest19799903157902376960ListFilesAndDirectoriesSinglePageTest210952824662509223936ListFilesAndDirectoriesSinglePageTest39511672781750665216ListFilesAndDirectoriesSinglePageTest410664594286357512192", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:10 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "e756f830-10d8-4395-7987-3a538be0e5b6", - "x-ms-request-id": "b5341820-801a-001d-73b7-01b2bb000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "127a425c-8f38-445b-50d1-1ef041110ebf", + "x-ms-request-id": "6bfd28b1-e01a-00a2-548e-b354bf000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA?comp=list&restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6ef19892-6a1b-4d87-44f9-a4ff7e99461f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "63bcadb9-13ea-4802-746c-e9b97feabcfe", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { - "BODY": "dirAdirA", + "BODY": "dirA0dirA11529285414812647424", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:10 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "6ef19892-6a1b-4d87-44f9-a4ff7e99461f", - "x-ms-request-id": "b5341821-801a-001d-74b7-01b2bb000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "63bcadb9-13ea-4802-746c-e9b97feabcfe", + "x-ms-request-id": "6bfd28b2-e01a-00a2-558e-b354bf000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/?comp=list&prefix=dirA&restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "cd1904c3-4d64-4a05-6b7f-acba58f4b3e4", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "725f2aef-c188-4e3a-550e-eb748c2f4842", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { - "BODY": "2file01024file110241!8!ZmlsZTI-", + "BODY": "211529285414812647424file0149880499286331883521024file11441158917632976486410241!8!ZmlsZTI-", "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:10 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "cd1904c3-4d64-4a05-6b7f-acba58f4b3e4", - "x-ms-request-id": "b5341822-801a-001d-75b7-01b2bb000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "725f2aef-c188-4e3a-550e-eb748c2f4842", + "x-ms-request-id": "6bfd28b3-e01a-00a2-568e-b354bf000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA?comp=list&maxresults=2&restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1f8160eb-8844-41f2-65c0-94e2ce9faaf3", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "96c69688-7480-4194-6b05-9c5549a039c5", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "11529285414812647424file01498804992863318835210242022-08-19T05:39:04.6094959Z2022-08-19T05:39:04.6094959Z2022-08-19T05:39:04.6094959Z2022-08-19T05:39:04.6094959ZFri, 19 Aug 2022 05:39:04 GMT\"0x8DA81A520CACC6F\"Archive8598604137816897901*16137673612980802019file11441158917632976486410242022-08-19T05:39:05.7988305Z2022-08-19T05:39:05.7988305Z2022-08-19T05:39:05.7988305Z2022-08-19T05:39:05.7988305ZFri, 19 Aug 2022 05:39:05 GMT\"0x8DA81A5218046D1\"Archive8598604137816897901*16137673612980802019file21556451068093661184010242022-08-19T05:39:06.9871654Z2022-08-19T05:39:06.9871654Z2022-08-19T05:39:06.9871654Z2022-08-19T05:39:06.9871654ZFri, 19 Aug 2022 05:39:06 GMT\"0x8DA81A522359A26\"Archive8598604137816897901*16137673612980802019file31412335880017805312010242022-08-19T05:39:08.1695043Z2022-08-19T05:39:08.1695043Z2022-08-19T05:39:08.1695043Z2022-08-19T05:39:08.1695043ZFri, 19 Aug 2022 05:39:08 GMT\"0x8DA81A522EA0343\"Archive8598604137816897901*16137673612980802019file41527628030478490009610242022-08-19T05:39:09.3638361Z2022-08-19T05:39:09.3638361Z2022-08-19T05:39:09.3638361Z2022-08-19T05:39:09.3638361ZFri, 19 Aug 2022 05:39:09 GMT\"0x8DA81A523A040D9\"Archive8598604137816897901*16137673612980802019ListFilesAndDirectoriesSinglePageTest0103763639102058004482022-08-19T05:39:04.3116630Z2022-08-19T05:39:04.3116630Z2022-08-19T05:39:04.3116630Z2022-08-19T05:39:04.3116630ZFri, 19 Aug 2022 05:39:04 GMT\"0x8DA81A5209D5A56\"Directory13199961128260716138*16137673612980802019ListFilesAndDirectoriesSinglePageTest197999031579023769602022-08-19T05:39:05.5009970Z2022-08-19T05:39:05.5009970Z2022-08-19T05:39:05.5009970Z2022-08-19T05:39:05.5009970ZFri, 19 Aug 2022 05:39:05 GMT\"0x8DA81A52152D4B2\"Directory13199961128260716138*16137673612980802019ListFilesAndDirectoriesSinglePageTest2109528246625092239362022-08-19T05:39:06.6893319Z2022-08-19T05:39:06.6893319Z2022-08-19T05:39:06.6893319Z2022-08-19T05:39:06.6893319ZFri, 19 Aug 2022 05:39:06 GMT\"0x8DA81A522082807\"Directory13199961128260716138*16137673612980802019ListFilesAndDirectoriesSinglePageTest395116727817506652162022-08-19T05:39:07.8726707Z2022-08-19T05:39:07.8726707Z2022-08-19T05:39:07.8726707Z2022-08-19T05:39:07.8726707ZFri, 19 Aug 2022 05:39:07 GMT\"0x8DA81A522BCB833\"Directory13199961128260716138*16137673612980802019ListFilesAndDirectoriesSinglePageTest4106645942863575121922022-08-19T05:39:09.0640035Z2022-08-19T05:39:09.0640035Z2022-08-19T05:39:09.0640035Z2022-08-19T05:39:09.0640035ZFri, 19 Aug 2022 05:39:09 GMT\"0x8DA81A5237280A3\"Directory13199961128260716138*16137673612980802019", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-type": "application/xml", + "date": "Fri, 19 Aug 2022 05:39:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "96c69688-7480-4194-6b05-9c5549a039c5", + "x-ms-request-id": "6bfd28b4-e01a-00a2-578e-b354bf000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA?comp=list&include=Timestamps,Etag,Attributes,PermissionKey&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6aaae692-683b-468f-6dc3-89e1f38977cf", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Fri, 19 Aug 2022 05:39:11 GMT", + "etag": "\"0x8DA81A5209D5A56\"", + "last-modified": "Fri, 19 Aug 2022 05:39:04 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6aaae692-683b-468f-6dc3-89e1f38977cf", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-19T05:39:04.3116630Z", + "x-ms-file-creation-time": "2022-08-19T05:39:04.3116630Z", + "x-ms-file-id": "10376363910205800448", + "x-ms-file-last-write-time": "2022-08-19T05:39:04.3116630Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28b6-e01a-00a2-588e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest0?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ff04aa1d-90e9-4768-57ba-d58def05f22c", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Fri, 19 Aug 2022 05:39:11 GMT", + "etag": "\"0x8DA81A52152D4B2\"", + "last-modified": "Fri, 19 Aug 2022 05:39:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ff04aa1d-90e9-4768-57ba-d58def05f22c", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-19T05:39:05.5009970Z", + "x-ms-file-creation-time": "2022-08-19T05:39:05.5009970Z", + "x-ms-file-id": "9799903157902376960", + "x-ms-file-last-write-time": "2022-08-19T05:39:05.5009970Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28b7-e01a-00a2-598e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest1?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "26936080-d58a-4bf4-76d2-bc5518cedbfe", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Fri, 19 Aug 2022 05:39:12 GMT", + "etag": "\"0x8DA81A522082807\"", + "last-modified": "Fri, 19 Aug 2022 05:39:06 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "26936080-d58a-4bf4-76d2-bc5518cedbfe", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-19T05:39:06.6893319Z", + "x-ms-file-creation-time": "2022-08-19T05:39:06.6893319Z", + "x-ms-file-id": "10952824662509223936", + "x-ms-file-last-write-time": "2022-08-19T05:39:06.6893319Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28b8-e01a-00a2-5a8e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest2?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "19512616-6d65-4242-6483-8416f4ed635e", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Fri, 19 Aug 2022 05:39:12 GMT", + "etag": "\"0x8DA81A522BCB833\"", + "last-modified": "Fri, 19 Aug 2022 05:39:07 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "19512616-6d65-4242-6483-8416f4ed635e", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-19T05:39:07.8726707Z", + "x-ms-file-creation-time": "2022-08-19T05:39:07.8726707Z", + "x-ms-file-id": "9511672781750665216", + "x-ms-file-last-write-time": "2022-08-19T05:39:07.8726707Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28b9-e01a-00a2-5b8e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest3?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8bacab29-f88a-436b-61a4-2f7f9d91b52c", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Fri, 19 Aug 2022 05:39:12 GMT", + "etag": "\"0x8DA81A5237280A3\"", + "last-modified": "Fri, 19 Aug 2022 05:39:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8bacab29-f88a-436b-61a4-2f7f9d91b52c", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-19T05:39:09.0640035Z", + "x-ms-file-creation-time": "2022-08-19T05:39:09.0640035Z", + "x-ms-file-id": "10664594286357512192", + "x-ms-file-last-write-time": "2022-08-19T05:39:09.0640035Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28ba-e01a-00a2-5c8e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/ListFilesAndDirectoriesSinglePageTest4?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "84fbf15a-30eb-4521-763c-43b9fb85cd64", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "1024", + "content-type": "application/octet-stream", + "date": "Fri, 19 Aug 2022 05:39:13 GMT", + "etag": "\"0x8DA81A520CACC6F\"", + "last-modified": "Fri, 19 Aug 2022 05:39:04 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "84fbf15a-30eb-4521-763c-43b9fb85cd64", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-19T05:39:04.6094959Z", + "x-ms-file-creation-time": "2022-08-19T05:39:04.6094959Z", + "x-ms-file-id": "14988049928633188352", + "x-ms-file-last-write-time": "2022-08-19T05:39:04.6094959Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6bfd28bc-e01a-00a2-5d8e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file0" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d42e4360-4e35-434d-77fe-a9ec6d346313", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "1024", + "content-type": "application/octet-stream", + "date": "Fri, 19 Aug 2022 05:39:13 GMT", + "etag": "\"0x8DA81A5218046D1\"", + "last-modified": "Fri, 19 Aug 2022 05:39:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d42e4360-4e35-434d-77fe-a9ec6d346313", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-19T05:39:05.7988305Z", + "x-ms-file-creation-time": "2022-08-19T05:39:05.7988305Z", + "x-ms-file-id": "14411589176329764864", + "x-ms-file-last-write-time": "2022-08-19T05:39:05.7988305Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6bfd28be-e01a-00a2-5f8e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "72f09a84-c9bb-496d-6fa1-70b020d3b6b9", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "1024", + "content-type": "application/octet-stream", + "date": "Fri, 19 Aug 2022 05:39:13 GMT", + "etag": "\"0x8DA81A522359A26\"", + "last-modified": "Fri, 19 Aug 2022 05:39:06 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "72f09a84-c9bb-496d-6fa1-70b020d3b6b9", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-19T05:39:06.9871654Z", + "x-ms-file-creation-time": "2022-08-19T05:39:06.9871654Z", + "x-ms-file-id": "15564510680936611840", + "x-ms-file-last-write-time": "2022-08-19T05:39:06.9871654Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6bfd28bf-e01a-00a2-608e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9b182a49-a8b6-4a9a-4de4-47f031f53f6b", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "1024", + "content-type": "application/octet-stream", + "date": "Fri, 19 Aug 2022 05:39:13 GMT", + "etag": "\"0x8DA81A522EA0343\"", + "last-modified": "Fri, 19 Aug 2022 05:39:08 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9b182a49-a8b6-4a9a-4de4-47f031f53f6b", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-19T05:39:08.1695043Z", + "x-ms-file-creation-time": "2022-08-19T05:39:08.1695043Z", + "x-ms-file-id": "14123358800178053120", + "x-ms-file-last-write-time": "2022-08-19T05:39:08.1695043Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6bfd28c2-e01a-00a2-618e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file3" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f42f3cba-892c-4fbe-40d5-7d0dbe841c45", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "1024", + "content-type": "application/octet-stream", + "date": "Fri, 19 Aug 2022 05:39:14 GMT", + "etag": "\"0x8DA81A523A040D9\"", + "last-modified": "Fri, 19 Aug 2022 05:39:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f42f3cba-892c-4fbe-40d5-7d0dbe841c45", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-19T05:39:09.3638361Z", + "x-ms-file-creation-time": "2022-08-19T05:39:09.3638361Z", + "x-ms-file-id": "15276280304784900096", + "x-ms-file-last-write-time": "2022-08-19T05:39:09.3638361Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6bfd28c4-e01a-00a2-638e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA/file4" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "69b608e8-f31a-49f7-69c7-7dc467a34c66", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Fri, 19 Aug 2022 05:39:14 GMT", + "etag": "\"0x8DA81A520436053\"", + "last-modified": "Fri, 19 Aug 2022 05:39:03 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "69b608e8-f31a-49f7-69c7-7dc467a34c66", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-19T05:39:03.7219923Z", + "x-ms-file-creation-time": "2022-08-19T05:39:03.7219923Z", + "x-ms-file-id": "11529285414812647424", + "x-ms-file-last-write-time": "2022-08-19T05:39:03.7219923Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "6bfd28c5-e01a-00a2-648e-b354bf000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest/dirA?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b98d7457-e268-4877-548a-2e6ceb8adaaf", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -808,19 +1179,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1f8160eb-8844-41f2-65c0-94e2ce9faaf3", - "x-ms-request-id": "b5341823-801a-001d-76b7-01b2bb000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "b98d7457-e268-4877-548a-2e6ceb8adaaf", + "x-ms-request-id": "6bfd28c6-e01a-00a2-658e-b354bf000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "76ef38e7-fe05-4a1f-4465-c12c423d4933", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8be8c3cb-1d0f-4e54-435f-0212de26914c", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -828,11 +1199,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 19 Aug 2022 05:39:15 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "76ef38e7-fe05-4a1f-4465-c12c423d4933", - "x-ms-request-id": "b5341824-801a-001d-77b7-01b2bb000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "8be8c3cb-1d0f-4e54-435f-0212de26914c", + "x-ms-request-id": "6bfd28c8-e01a-00a2-668e-b354bf000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/lesharedirectoryclienttestlistfilesanddirectoriessinglepagetest?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameFile.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameFile.json new file mode 100644 index 0000000000..d664d0a185 --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameFile.json @@ -0,0 +1,1165 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "60288fef-aebb-44b5-41a7-3c35cf3f547e", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:14 GMT", + "etag": "\"0x8DA7E9D68565E0D\"", + "last-modified": "Mon, 15 Aug 2022 09:06:15 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "60288fef-aebb-44b5-41a7-3c35cf3f547e", + "x-ms-request-id": "05eb88bd-d01a-004d-3186-b0a14a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d12b1937-a99e-4516-4ee6-b47d30b3ced2", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:14 GMT", + "etag": "\"0x8DA7E9D688B122F\"", + "last-modified": "Mon, 15 Aug 2022 09:06:15 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d12b1937-a99e-4516-4ee6-b47d30b3ced2", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:15.5256367Z", + "x-ms-file-creation-time": "2022-08-15T09:06:15.5256367Z", + "x-ms-file-id": "13835128424026341376", + "x-ms-file-last-write-time": "2022-08-15T09:06:15.5256367Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "05eb88c3-d01a-004d-3486-b0a14a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFilebase?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3789ac79-2fd9-4091-401c-41420b804eed", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:14 GMT", + "etag": "\"0x8DA7E9D68B7C109\"", + "last-modified": "Mon, 15 Aug 2022 09:06:15 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3789ac79-2fd9-4091-401c-41420b804eed", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:15.8184713Z", + "x-ms-file-creation-time": "2022-08-15T09:06:15.8184713Z", + "x-ms-file-id": "11529285414812647424", + "x-ms-file-last-write-time": "2022-08-15T09:06:15.8184713Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "05eb88c4-d01a-004d-3586-b0a14a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1e645442-b8d7-468b-57bf-6705c9cf7bfb", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:15 GMT", + "etag": "\"0x8DA7E9D68E50C08\"", + "last-modified": "Mon, 15 Aug 2022 09:06:16 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1e645442-b8d7-468b-57bf-6705c9cf7bfb", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:16.1153032Z", + "x-ms-file-creation-time": "2022-08-15T09:06:16.1153032Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-15T09:06:16.1153032Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "05eb88c5-d01a-004d-3686-b0a14a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "717d2ed2-6f37-42d5-6d4e-8a2a036984df", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:15 GMT", + "etag": "\"0x8DA7E9D69123002\"", + "last-modified": "Mon, 15 Aug 2022 09:06:16 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "717d2ed2-6f37-42d5-6d4e-8a2a036984df", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:16.4111362Z", + "x-ms-file-creation-time": "2022-08-15T09:06:16.1153032Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-15T09:06:16.1153032Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "05eb88c7-d01a-004d-3786-b0a14a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile3?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c541a088-981d-48c4-6375-b13b0e71f45b", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "512", + "content-type": "application/octet-stream", + "date": "Mon, 15 Aug 2022 09:06:15 GMT", + "etag": "\"0x8DA7E9D69123002\"", + "last-modified": "Mon, 15 Aug 2022 09:06:16 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c541a088-981d-48c4-6375-b13b0e71f45b", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:16.4111362Z", + "x-ms-file-creation-time": "2022-08-15T09:06:16.1153032Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-15T09:06:16.1153032Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "05eb88ca-d01a-004d-3a86-b0a14a000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile3" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "718287bd-c3e8-4670-5eac-43d40105f1f9", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "date": "Mon, 15 Aug 2022 09:06:16 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "718287bd-c3e8-4670-5eac-43d40105f1f9", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "05eb88cb-d01a-004d-3b86-b0a14a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "10cc3fcf-a9ba-4876-5e42-54880a4fc1de", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:17 GMT", + "etag": "\"0x8DA7E9D6A26856B\"", + "last-modified": "Mon, 15 Aug 2022 09:06:18 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "10cc3fcf-a9ba-4876-5e42-54880a4fc1de", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:18.2221163Z", + "x-ms-file-creation-time": "2022-08-15T09:06:18.2221163Z", + "x-ms-file-id": "13835093239654252544", + "x-ms-file-last-write-time": "2022-08-15T09:06:18.2221163Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "aad72956-a01a-008c-7086-b006a8000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile4" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b0625fc2-64d4-4366-55cc-c8a0a5da520a", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:17 GMT", + "etag": "\"0x8DA7E9D6A538256\"", + "last-modified": "Mon, 15 Aug 2022 09:06:18 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b0625fc2-64d4-4366-55cc-c8a0a5da520a", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:18.5169494Z", + "x-ms-file-creation-time": "2022-08-15T09:06:18.5169494Z", + "x-ms-file-id": "11529250230440558592", + "x-ms-file-last-write-time": "2022-08-15T09:06:18.5169494Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "aad72959-a01a-008c-7186-b006a8000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile5" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "884adec8-4956-4ef7-5d6f-171b1f45a4b9", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "ResourceAlreadyExistsThe specified resource already exists.\nRequestId:aad7295c-a01a-008c-7486-b006a8000000\nTime:2022-08-15T09:06:18.8814670Z", + "REASON_PHRASE": "The specified resource already exists.", + "STATUS_CODE": "409", + "content-length": "228", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:18 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "884adec8-4956-4ef7-5d6f-171b1f45a4b9", + "x-ms-error-code": "ResourceAlreadyExists", + "x-ms-request-id": "aad7295c-a01a-008c-7486-b006a8000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile5?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "450effbf-9a7f-4d12-4392-e81421056fec", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:19 GMT", + "etag": "\"0x8DA7E9D6B3C3A2B\"", + "last-modified": "Mon, 15 Aug 2022 09:06:20 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "450effbf-9a7f-4d12-4392-e81421056fec", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:20.0420907Z", + "x-ms-file-creation-time": "2022-08-15T09:06:18.2221163Z", + "x-ms-file-id": "13835093239654252544", + "x-ms-file-last-write-time": "2022-08-15T09:06:18.2221163Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "27621f5a-201a-0059-0186-b0e925000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile5?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f88a4009-f337-4d72-5a6d-cfa14f77bb51", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "512", + "content-type": "application/octet-stream", + "date": "Mon, 15 Aug 2022 09:06:19 GMT", + "etag": "\"0x8DA7E9D6B3C3A2B\"", + "last-modified": "Mon, 15 Aug 2022 09:06:20 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f88a4009-f337-4d72-5a6d-cfa14f77bb51", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:20.0420907Z", + "x-ms-file-creation-time": "2022-08-15T09:06:18.2221163Z", + "x-ms-file-id": "13835093239654252544", + "x-ms-file-last-write-time": "2022-08-15T09:06:18.2221163Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "27621f5f-201a-0059-0486-b0e925000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile5" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cbbf8182-a201-4d08-415e-0d237ebdab81", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "date": "Mon, 15 Aug 2022 09:06:19 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "cbbf8182-a201-4d08-415e-0d237ebdab81", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "27621f6a-201a-0059-0d86-b0e925000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile4" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b7d2224c-6d6f-4801-474e-1ba767d14ae4", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:20 GMT", + "etag": "\"0x8DA7E9D6C4B1206\"", + "last-modified": "Mon, 15 Aug 2022 09:06:21 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b7d2224c-6d6f-4801-474e-1ba767d14ae4", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:21.8170886Z", + "x-ms-file-creation-time": "2022-08-15T09:06:21.8170886Z", + "x-ms-file-id": "13835163608398430208", + "x-ms-file-last-write-time": "2022-08-15T09:06:21.8170886Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "07f7d9f5-b01a-0064-3c86-b09f3e000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile6" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cdd51661-d7bd-4af5-6c4d-75c533e07cc8", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:21 GMT", + "etag": "\"0x8DA7E9D6C785D18\"", + "last-modified": "Mon, 15 Aug 2022 09:06:22 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cdd51661-d7bd-4af5-6c4d-75c533e07cc8", + "x-ms-file-attributes": "ReadOnly | Archive", + "x-ms-file-change-time": "2022-08-15T09:06:22.1139224Z", + "x-ms-file-creation-time": "2022-08-15T09:06:22.1139224Z", + "x-ms-file-id": "11529320599184736256", + "x-ms-file-last-write-time": "2022-08-15T09:06:22.1139224Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "07f7d9f8-b01a-0064-3d86-b09f3e000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile7" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "436c2c4e-92f2-453c-645c-9646571d3e59", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "ReadOnlyAttributeThe specified resource is read-only and cannot be modified at this time.\nRequestId:07f7d9fb-b01a-0064-4086-b09f3e000000\nTime:2022-08-15T09:06:22.4862220Z", + "REASON_PHRASE": "The specified resource is read-only and cannot be modified at this time.", + "STATUS_CODE": "409", + "content-length": "258", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:21 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "436c2c4e-92f2-453c-645c-9646571d3e59", + "x-ms-error-code": "ReadOnlyAttribute", + "x-ms-request-id": "07f7d9fb-b01a-0064-4086-b09f3e000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile7?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5f30060c-2ab7-4daa-5b3e-c7e09945166d", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:23 GMT", + "etag": "\"0x8DA7E9D6D6A3B41\"", + "last-modified": "Mon, 15 Aug 2022 09:06:23 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5f30060c-2ab7-4daa-5b3e-c7e09945166d", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:23.6990273Z", + "x-ms-file-creation-time": "2022-08-15T09:06:21.8170886Z", + "x-ms-file-id": "13835163608398430208", + "x-ms-file-last-write-time": "2022-08-15T09:06:21.8170886Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "f75d432a-701a-008f-2386-b0e7cc000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile7?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8f61802a-a639-42e3-5231-af44e003a7a2", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "512", + "content-type": "application/octet-stream", + "date": "Mon, 15 Aug 2022 09:06:23 GMT", + "etag": "\"0x8DA7E9D6D6A3B41\"", + "last-modified": "Mon, 15 Aug 2022 09:06:23 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8f61802a-a639-42e3-5231-af44e003a7a2", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:23.6990273Z", + "x-ms-file-creation-time": "2022-08-15T09:06:21.8170886Z", + "x-ms-file-id": "13835163608398430208", + "x-ms-file-last-write-time": "2022-08-15T09:06:21.8170886Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "f75d432e-701a-008f-2486-b0e7cc000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile7" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "13b2d4e1-325b-4785-4e6c-40b82afd57d2", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "date": "Mon, 15 Aug 2022 09:06:23 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "13b2d4e1-325b-4785-4e6c-40b82afd57d2", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "f75d432f-701a-008f-2586-b0e7cc000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile6" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "798d8048-b9c4-445a-66ac-fc26aae4458c", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:25 GMT", + "etag": "\"0x8DA7E9D6E81C477\"", + "last-modified": "Mon, 15 Aug 2022 09:06:25 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "798d8048-b9c4-445a-66ac-fc26aae4458c", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:25.5309943Z", + "x-ms-file-creation-time": "2022-08-15T09:06:25.5309943Z", + "x-ms-file-id": "13835075647468208128", + "x-ms-file-last-write-time": "2022-08-15T09:06:25.5309943Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "34bd0edb-801a-001d-3a86-b0631a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile8" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1f4c7013-1a74-4507-4d23-b5c7c046c538", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:25 GMT", + "etag": "\"0x8DA7E9D6EBBB7D7\"", + "last-modified": "Mon, 15 Aug 2022 09:06:25 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1f4c7013-1a74-4507-4d23-b5c7c046c538", + "x-ms-file-attributes": "None", + "x-ms-file-change-time": "2022-08-15T09:06:21.5395401Z", + "x-ms-file-creation-time": "2022-08-15T09:06:21.5395407Z", + "x-ms-file-id": "13835075647468208128", + "x-ms-file-last-write-time": "2022-08-15T09:06:21.5395409Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8661341311694537746*16137673612980802019", + "x-ms-request-id": "34bd0ee1-801a-001d-3b86-b0631a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile9?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0dec12ef-36d3-4060-5b7f-13e15ed7d0e2", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "512", + "content-type": "application/octet-stream", + "date": "Mon, 15 Aug 2022 09:06:26 GMT", + "etag": "\"0x8DA7E9D6EBBB7D7\"", + "last-modified": "Mon, 15 Aug 2022 09:06:25 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0dec12ef-36d3-4060-5b7f-13e15ed7d0e2", + "x-ms-file-attributes": "None", + "x-ms-file-change-time": "2022-08-15T09:06:21.5395401Z", + "x-ms-file-creation-time": "2022-08-15T09:06:21.5395407Z", + "x-ms-file-id": "13835075647468208128", + "x-ms-file-last-write-time": "2022-08-15T09:06:21.5395409Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8661341311694537746*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-meta-meta0": "value", + "x-ms-meta-meta1": "value", + "x-ms-meta-meta2": "value", + "x-ms-meta-meta3": "value", + "x-ms-meta-meta4": "value", + "x-ms-request-id": "34bd0ee8-801a-001d-3d86-b0631a000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile9" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3bc123ea-9782-44bd-6580-05af58ce46ec", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "date": "Mon, 15 Aug 2022 09:06:26 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "3bc123ea-9782-44bd-6580-05af58ce46ec", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "34bd0eea-801a-001d-3e86-b0631a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile8" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4d7f4448-d68e-4f08-7e89-18b5c117ba37", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:27 GMT", + "etag": "\"0x8DA7E9D6FD1939E\"", + "last-modified": "Mon, 15 Aug 2022 09:06:27 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "4d7f4448-d68e-4f08-7e89-18b5c117ba37", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:27.7317534Z", + "x-ms-file-creation-time": "2022-08-15T09:06:27.7317534Z", + "x-ms-file-id": "13835146016212385792", + "x-ms-file-last-write-time": "2022-08-15T09:06:27.7317534Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "bc6322f0-901a-003e-2e86-b0f9d9000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile10?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "bfee59e5-e37c-476e-4202-ba1fec41988b", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:27 GMT", + "etag": "\"0x8DA7E9D6FFF53C3\"", + "last-modified": "Mon, 15 Aug 2022 09:06:28 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "bfee59e5-e37c-476e-4202-ba1fec41988b", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:28.0315843Z", + "x-ms-file-creation-time": "2022-08-15T09:06:28.0315843Z", + "x-ms-file-id": "11529303006998691840", + "x-ms-file-last-write-time": "2022-08-15T09:06:28.0315843Z", + "x-ms-file-parent-id": "13835146016212385792", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "bc6322f6-901a-003e-2f86-b0f9d9000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile10/RenameFile11" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "761afeab-810b-4959-4141-936f0f38488c", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:27 GMT", + "etag": "\"0x8DA7E9D702CC5DA\"", + "last-modified": "Mon, 15 Aug 2022 09:06:28 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "761afeab-810b-4959-4141-936f0f38488c", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:28.3294170Z", + "x-ms-file-creation-time": "2022-08-15T09:06:28.3294170Z", + "x-ms-file-id": "16140989025426079744", + "x-ms-file-last-write-time": "2022-08-15T09:06:28.3294170Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "bc6322fb-901a-003e-3286-b0f9d9000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile12?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4a739765-17d3-44bd-62eb-342baa84a99b", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:28 GMT", + "etag": "\"0x8DA7E9D7063374E\"", + "last-modified": "Mon, 15 Aug 2022 09:06:28 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "4a739765-17d3-44bd-62eb-342baa84a99b", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:28.6862158Z", + "x-ms-file-creation-time": "2022-08-15T09:06:28.0315843Z", + "x-ms-file-id": "11529303006998691840", + "x-ms-file-last-write-time": "2022-08-15T09:06:28.0315843Z", + "x-ms-file-parent-id": "16140989025426079744", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "bc6322fe-901a-003e-3386-b0f9d9000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile12/RenameFile13?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f4df1ba2-1bd1-494b-7260-f80b14cdf6eb", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "512", + "content-type": "application/octet-stream", + "date": "Mon, 15 Aug 2022 09:06:28 GMT", + "etag": "\"0x8DA7E9D7063374E\"", + "last-modified": "Mon, 15 Aug 2022 09:06:28 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f4df1ba2-1bd1-494b-7260-f80b14cdf6eb", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:28.6862158Z", + "x-ms-file-creation-time": "2022-08-15T09:06:28.0315843Z", + "x-ms-file-id": "11529303006998691840", + "x-ms-file-last-write-time": "2022-08-15T09:06:28.0315843Z", + "x-ms-file-parent-id": "16140989025426079744", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "bc632303-901a-003e-3486-b0f9d9000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile12/RenameFile13" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "833f23da-d712-460d-4ab3-09e13fb347b5", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "date": "Mon, 15 Aug 2022 09:06:28 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "833f23da-d712-460d-4ab3-09e13fb347b5", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "bc632306-901a-003e-3586-b0f9d9000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile10/RenameFile11" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "75f20732-ec4c-4b63-77ac-84f0ebbcb7cd", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:30 GMT", + "etag": "\"0x8DA7E9D71762D48\"", + "last-modified": "Mon, 15 Aug 2022 09:06:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "75f20732-ec4c-4b63-77ac-84f0ebbcb7cd", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:30.4881992Z", + "x-ms-file-creation-time": "2022-08-15T09:06:30.4881992Z", + "x-ms-file-id": "11529232638254514176", + "x-ms-file-last-write-time": "2022-08-15T09:06:30.4881992Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "34bd0f0d-801a-001d-3f86-b0631a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile14" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0af60c9c-52a1-4800-4bd0-62bf83284561", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:30 GMT", + "etag": "\"0x8DA7E9D71A3514B\"", + "last-modified": "Mon, 15 Aug 2022 09:06:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0af60c9c-52a1-4800-4bd0-62bf83284561", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:30.7840331Z", + "x-ms-file-creation-time": "2022-08-15T09:06:30.4881992Z", + "x-ms-file-id": "11529232638254514176", + "x-ms-file-last-write-time": "2022-08-15T09:06:30.4881992Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "34bd0f11-801a-001d-4086-b0631a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile15?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ffe9a30e-97bb-4e13-4ef8-ffff5f1546b6", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "512", + "content-type": "application/octet-stream", + "date": "Mon, 15 Aug 2022 09:06:30 GMT", + "etag": "\"0x8DA7E9D71A3514B\"", + "last-modified": "Mon, 15 Aug 2022 09:06:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ffe9a30e-97bb-4e13-4ef8-ffff5f1546b6", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:30.7840331Z", + "x-ms-file-creation-time": "2022-08-15T09:06:30.4881992Z", + "x-ms-file-id": "11529232638254514176", + "x-ms-file-last-write-time": "2022-08-15T09:06:30.4881992Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "34bd0f14-801a-001d-4186-b0631a000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile15" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9bc8f317-7f1d-473b-49b0-f815e8fa569b", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "date": "Mon, 15 Aug 2022 09:06:31 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "9bc8f317-7f1d-473b-49b0-f815e8fa569b", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "34bd0f16-801a-001d-4286-b0631a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile14" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "59597f9f-27c0-438b-7341-ca3da44ffb3a", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:31 GMT", + "etag": "\"0x8DA7E9D72B31368\"", + "last-modified": "Mon, 15 Aug 2022 09:06:32 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "59597f9f-27c0-438b-7341-ca3da44ffb3a", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:32.5650280Z", + "x-ms-file-creation-time": "2022-08-15T09:06:32.5650280Z", + "x-ms-file-id": "13835110831840296960", + "x-ms-file-last-write-time": "2022-08-15T09:06:32.5650280Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "1664d6d0-e01a-009d-2586-b09c1c000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile16" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b4a15673-830f-4426-591f-609abce4f0e5", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "date": "Mon, 15 Aug 2022 09:06:32 GMT", + "etag": "\"0x8DA7E9D72B31368\"", + "last-modified": "Mon, 15 Aug 2022 09:06:32 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "b4a15673-830f-4426-591f-609abce4f0e5", + "x-ms-lease-id": "37ba46e0-a196-4c3c-7dce-0ac567f425c9", + "x-ms-request-id": "1664d6d9-e01a-009d-2786-b09c1c000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile16?comp=lease" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "015d63ea-805d-448f-7e27-dd9e8085f843", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:32 GMT", + "etag": "\"0x8DA7E9D730FA504\"", + "last-modified": "Mon, 15 Aug 2022 09:06:33 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "015d63ea-805d-448f-7e27-dd9e8085f843", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:33.1716868Z", + "x-ms-file-creation-time": "2022-08-15T09:06:33.1716868Z", + "x-ms-file-id": "11529267822626603008", + "x-ms-file-last-write-time": "2022-08-15T09:06:33.1716868Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "1664d6de-e01a-009d-2986-b09c1c000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile17" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c8736a3e-6595-4b45-56bd-1062b88f8203", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "date": "Mon, 15 Aug 2022 09:06:32 GMT", + "etag": "\"0x8DA7E9D730FA504\"", + "last-modified": "Mon, 15 Aug 2022 09:06:33 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "c8736a3e-6595-4b45-56bd-1062b88f8203", + "x-ms-lease-id": "ee271a13-3d96-4ca6-41f2-5166a1937d5a", + "x-ms-request-id": "1664d6e1-e01a-009d-2a86-b09c1c000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile17?comp=lease" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "088e7383-2959-428c-5666-f1cc09699e1d", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "LeaseIdMissingThere is currently a lease on the file and no lease ID was specified in the request.\nRequestId:1664d6e4-e01a-009d-2b86-b09c1c000000\nTime:2022-08-15T09:06:33.7656338Z", + "REASON_PHRASE": "There is currently a lease on the file and no lease ID was specified in the request.", + "STATUS_CODE": "412", + "content-length": "267", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:32 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "088e7383-2959-428c-5666-f1cc09699e1d", + "x-ms-error-code": "LeaseIdMissing", + "x-ms-request-id": "1664d6e4-e01a-009d-2b86-b09c1c000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile17?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c36f145a-4c62-4b1f-550f-9f835a472137", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:34 GMT", + "etag": "\"0x8DA7E9D742902AB\"", + "last-modified": "Mon, 15 Aug 2022 09:06:35 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c36f145a-4c62-4b1f-550f-9f835a472137", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:35.0156459Z", + "x-ms-file-creation-time": "2022-08-15T09:06:32.5650280Z", + "x-ms-file-id": "13835110831840296960", + "x-ms-file-last-write-time": "2022-08-15T09:06:32.5650280Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "4f765dbc-101a-0030-6686-b0d069000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile17?comp=rename" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c12da4ab-b2a7-4350-4d6f-08019a24f78e", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "date": "Mon, 15 Aug 2022 09:06:34 GMT", + "etag": "\"0x8DA7E9D742902AB\"", + "last-modified": "Mon, 15 Aug 2022 09:06:35 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "c12da4ab-b2a7-4350-4d6f-08019a24f78e", + "x-ms-request-id": "4f765dc3-101a-0030-6786-b0d069000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile/RenameFile1/RenameFile17?comp=lease" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6ecad06c-45c7-4f4c-43c3-3bcf5cbee58c", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6ecad06c-45c7-4f4c-43c3-3bcf5cbee58c", + "x-ms-request-id": "4f765dc5-101a-0030-6886-b0d069000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e22a4173-610a-40d1-58c4-bcd2529316e4", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:35 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e22a4173-610a-40d1-58c4-bcd2529316e4", + "x-ms-request-id": "4f765dc6-101a-0030-6986-b0d069000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamefile?restype=share" + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameSubdirectory.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameSubdirectory.json new file mode 100644 index 0000000000..3c860b0ead --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.RenameSubdirectory.json @@ -0,0 +1,967 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ab467ec1-a465-444c-64bb-6bf75859f195", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:35 GMT", + "etag": "\"0x8DA7E9D74E725A2\"", + "last-modified": "Mon, 15 Aug 2022 09:06:36 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ab467ec1-a465-444c-64bb-6bf75859f195", + "x-ms-request-id": "4f765dc7-101a-0030-6a86-b0d069000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7fea9151-c5e9-42eb-7780-b9bb6d4e3513", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:35 GMT", + "etag": "\"0x8DA7E9D7515D888\"", + "last-modified": "Mon, 15 Aug 2022 09:06:36 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "7fea9151-c5e9-42eb-7780-b9bb6d4e3513", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:36.5677704Z", + "x-ms-file-creation-time": "2022-08-15T09:06:36.5677704Z", + "x-ms-file-id": "13835128424026341376", + "x-ms-file-last-write-time": "2022-08-15T09:06:36.5677704Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "4f765dc9-101a-0030-6b86-b0d069000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectorybase?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "822eb592-b862-47b0-47fa-d7b3800202a0", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:36 GMT", + "etag": "\"0x8DA7E9D7543238D\"", + "last-modified": "Mon, 15 Aug 2022 09:06:36 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "822eb592-b862-47b0-47fa-d7b3800202a0", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:36.8646029Z", + "x-ms-file-creation-time": "2022-08-15T09:06:36.8646029Z", + "x-ms-file-id": "11529285414812647424", + "x-ms-file-last-write-time": "2022-08-15T09:06:36.8646029Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "4f765dcb-101a-0030-6c86-b0d069000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "913245e3-e51e-4341-5598-0224c9437d93", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:36 GMT", + "etag": "\"0x8DA7E9D756FD277\"", + "last-modified": "Mon, 15 Aug 2022 09:06:37 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "913245e3-e51e-4341-5598-0224c9437d93", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:37.1574391Z", + "x-ms-file-creation-time": "2022-08-15T09:06:37.1574391Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-15T09:06:37.1574391Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "4f765dce-101a-0030-6d86-b0d069000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory2?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "298c6b9f-6eaa-4d7e-7750-4a929a513c49", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:36 GMT", + "etag": "\"0x8DA7E9D759D1D73\"", + "last-modified": "Mon, 15 Aug 2022 09:06:37 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "298c6b9f-6eaa-4d7e-7750-4a929a513c49", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:37.4542707Z", + "x-ms-file-creation-time": "2022-08-15T09:06:37.4542707Z", + "x-ms-file-id": "10376363910205800448", + "x-ms-file-last-write-time": "2022-08-15T09:06:37.4542707Z", + "x-ms-file-parent-id": "16140971433240035328", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "4f765dcf-101a-0030-6e86-b0d069000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory2/RenameSubdirectoryFile1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8b80229d-3ab2-4876-6101-a8d4a8e64ff4", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:36 GMT", + "etag": "\"0x8DA7E9D75CADD9D\"", + "last-modified": "Mon, 15 Aug 2022 09:06:37 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8b80229d-3ab2-4876-6101-a8d4a8e64ff4", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:37.7541021Z", + "x-ms-file-creation-time": "2022-08-15T09:06:37.1574391Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-15T09:06:37.1574391Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "4f765dd1-101a-0030-6f86-b0d069000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory3?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "402f1ff4-ec8b-4338-64ac-df8df58a2f0e", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:37 GMT", + "etag": "\"0x8DA7E9D75CADD9D\"", + "last-modified": "Mon, 15 Aug 2022 09:06:37 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "402f1ff4-ec8b-4338-64ac-df8df58a2f0e", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:37.7541021Z", + "x-ms-file-creation-time": "2022-08-15T09:06:37.1574391Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-15T09:06:37.1574391Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "4f765dd6-101a-0030-7186-b0d069000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory3?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "33cafae0-850e-48bf-6ce5-4f5e70cc812e", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:4f765dd7-101a-0030-7286-b0d069000000\nTime:2022-08-15T09:06:38.3395537Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:37 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "33cafae0-850e-48bf-6ce5-4f5e70cc812e", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "4f765dd7-101a-0030-7286-b0d069000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory2?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "46d75d79-b356-4482-77e9-f28efdcfbd35", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:38 GMT", + "etag": "\"0x8DA7E9D76D5976A\"", + "last-modified": "Mon, 15 Aug 2022 09:06:39 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "46d75d79-b356-4482-77e9-f28efdcfbd35", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:39.5021162Z", + "x-ms-file-creation-time": "2022-08-15T09:06:39.5021162Z", + "x-ms-file-id": "13835093239654252544", + "x-ms-file-last-write-time": "2022-08-15T09:06:39.5021162Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "db8613e8-001a-0013-7986-b04aaa000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory4?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "793c53af-3f31-4f44-5553-f8353d8e7aeb", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:39 GMT", + "etag": "\"0x8DA7E9D7702945D\"", + "last-modified": "Mon, 15 Aug 2022 09:06:39 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "793c53af-3f31-4f44-5553-f8353d8e7aeb", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:39.7969501Z", + "x-ms-file-creation-time": "2022-08-15T09:06:39.7969501Z", + "x-ms-file-id": "11529250230440558592", + "x-ms-file-last-write-time": "2022-08-15T09:06:39.7969501Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "db8613ec-001a-0013-7a86-b04aaa000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory5" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "12b96359-8683-41d1-440f-428fc166cae9", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "ResourceAlreadyExistsThe specified resource already exists.\nRequestId:db8613ed-001a-0013-7b86-b04aaa000000\nTime:2022-08-15T09:06:40.1854088Z", + "REASON_PHRASE": "The specified resource already exists.", + "STATUS_CODE": "409", + "content-length": "228", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:39 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "12b96359-8683-41d1-440f-428fc166cae9", + "x-ms-error-code": "ResourceAlreadyExists", + "x-ms-request-id": "db8613ed-001a-0013-7b86-b04aaa000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory5?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1936a6d7-2df6-4f4a-7197-dca8f1ffc638", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:41 GMT", + "etag": "\"0x8DA7E9D77FC39A3\"", + "last-modified": "Mon, 15 Aug 2022 09:06:41 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1936a6d7-2df6-4f4a-7197-dca8f1ffc638", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:41.4330275Z", + "x-ms-file-creation-time": "2022-08-15T09:06:39.5021162Z", + "x-ms-file-id": "13835093239654252544", + "x-ms-file-last-write-time": "2022-08-15T09:06:39.5021162Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "a4650d83-701a-0009-6586-b02b75000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory5?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7f3708ee-8d74-469c-4a10-7ed1c9be7dd3", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:a4650d87-701a-0009-6686-b02b75000000\nTime:2022-08-15T09:06:41.7393595Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:41 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "7f3708ee-8d74-469c-4a10-7ed1c9be7dd3", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "a4650d87-701a-0009-6686-b02b75000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory4?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8c23a2af-526d-4a54-709e-3454fedc52c8", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:42 GMT", + "etag": "\"0x8DA7E9D78DFE912\"", + "last-modified": "Mon, 15 Aug 2022 09:06:42 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8c23a2af-526d-4a54-709e-3454fedc52c8", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:42.9251858Z", + "x-ms-file-creation-time": "2022-08-15T09:06:42.9251858Z", + "x-ms-file-id": "13835163608398430208", + "x-ms-file-last-write-time": "2022-08-15T09:06:42.9251858Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "94c1fb45-101a-0020-5586-b01501000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory6?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3865eff3-9b01-465d-4bbd-ee1b212afee3", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:42 GMT", + "etag": "\"0x8DA7E9D790D822A\"", + "last-modified": "Mon, 15 Aug 2022 09:06:43 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3865eff3-9b01-465d-4bbd-ee1b212afee3", + "x-ms-file-attributes": "ReadOnly | Archive", + "x-ms-file-change-time": "2022-08-15T09:06:43.2240170Z", + "x-ms-file-creation-time": "2022-08-15T09:06:43.2240170Z", + "x-ms-file-id": "11529320599184736256", + "x-ms-file-last-write-time": "2022-08-15T09:06:43.2240170Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "94c1fb49-101a-0020-5686-b01501000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory7" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8ba26513-86f6-456f-5c57-3f1568ee7e55", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "ReadOnlyAttributeThe specified resource is read-only and cannot be modified at this time.\nRequestId:94c1fb4a-101a-0020-5786-b01501000000\nTime:2022-08-15T09:06:43.5208335Z", + "REASON_PHRASE": "The specified resource is read-only and cannot be modified at this time.", + "STATUS_CODE": "409", + "content-length": "258", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:42 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8ba26513-86f6-456f-5c57-3f1568ee7e55", + "x-ms-error-code": "ReadOnlyAttribute", + "x-ms-request-id": "94c1fb4a-101a-0020-5786-b01501000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory7?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f39e4809-e62b-45fc-7626-11a04838b551", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:43 GMT", + "etag": "\"0x8DA7E9D79F2DF15\"", + "last-modified": "Mon, 15 Aug 2022 09:06:44 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f39e4809-e62b-45fc-7626-11a04838b551", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:44.7271701Z", + "x-ms-file-creation-time": "2022-08-15T09:06:42.9251858Z", + "x-ms-file-id": "13835163608398430208", + "x-ms-file-last-write-time": "2022-08-15T09:06:42.9251858Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "7c27f62a-601a-003a-4686-b074de000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory7?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "dc62a085-f1ad-4288-429c-cb9a7a184904", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:7c27f62e-601a-003a-4786-b074de000000\nTime:2022-08-15T09:06:45.0241817Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:44 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "dc62a085-f1ad-4288-429c-cb9a7a184904", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "7c27f62e-601a-003a-4786-b074de000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory6?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c99153e3-6f16-4b86-5ed8-37904fdbfab5", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:45 GMT", + "etag": "\"0x8DA7E9D7AD83BF1\"", + "last-modified": "Mon, 15 Aug 2022 09:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c99153e3-6f16-4b86-5ed8-37904fdbfab5", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:46.2303217Z", + "x-ms-file-creation-time": "2022-08-15T09:06:46.2303217Z", + "x-ms-file-id": "13835075647468208128", + "x-ms-file-last-write-time": "2022-08-15T09:06:46.2303217Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "c50ba776-401a-0094-6286-b0d9cf000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory8?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a55472f1-421a-4353-6827-4e67315bc139", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:46 GMT", + "etag": "\"0x8DA7E9D7B100CCC\"", + "last-modified": "Mon, 15 Aug 2022 09:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "a55472f1-421a-4353-6827-4e67315bc139", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:42.2404745Z", + "x-ms-file-creation-time": "2022-08-15T09:06:42.2404754Z", + "x-ms-file-id": "13835075647468208128", + "x-ms-file-last-write-time": "2022-08-15T09:06:42.2404756Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8661341311694537746*16137673612980802019", + "x-ms-request-id": "c50ba77b-401a-0094-6386-b0d9cf000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory9?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d375a738-24d7-4f2a-4479-06dbd154e694", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:46 GMT", + "etag": "\"0x8DA7E9D7B100CCC\"", + "last-modified": "Mon, 15 Aug 2022 09:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d375a738-24d7-4f2a-4479-06dbd154e694", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:42.2404745Z", + "x-ms-file-creation-time": "2022-08-15T09:06:42.2404754Z", + "x-ms-file-id": "13835075647468208128", + "x-ms-file-last-write-time": "2022-08-15T09:06:42.2404756Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "8661341311694537746*16137673612980802019", + "x-ms-meta-meta0": "value", + "x-ms-meta-meta1": "value", + "x-ms-meta-meta2": "value", + "x-ms-meta-meta3": "value", + "x-ms-meta-meta4": "value", + "x-ms-request-id": "c50ba77c-401a-0094-6486-b0d9cf000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory9?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6da81755-f72c-4368-4e33-bfe64a08f3e9", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:c50ba77d-401a-0094-6586-b0d9cf000000\nTime:2022-08-15T09:06:47.1932888Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6da81755-f72c-4368-4e33-bfe64a08f3e9", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "c50ba77d-401a-0094-6586-b0d9cf000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory8?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2519721c-aed4-48c4-79c2-7e5caebf8d80", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:47 GMT", + "etag": "\"0x8DA7E9D7C22188F\"", + "last-modified": "Mon, 15 Aug 2022 09:06:48 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "2519721c-aed4-48c4-79c2-7e5caebf8d80", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:48.3921039Z", + "x-ms-file-creation-time": "2022-08-15T09:06:48.3921039Z", + "x-ms-file-id": "13835146016212385792", + "x-ms-file-last-write-time": "2022-08-15T09:06:48.3921039Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5c3b7958-301a-007a-0686-b073e6000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory10?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "72b9eb33-e2f4-415d-4911-4cbc9a9301a5", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:47 GMT", + "etag": "\"0x8DA7E9D7C4F3C8D\"", + "last-modified": "Mon, 15 Aug 2022 09:06:48 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "72b9eb33-e2f4-415d-4911-4cbc9a9301a5", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:48.6879373Z", + "x-ms-file-creation-time": "2022-08-15T09:06:48.6879373Z", + "x-ms-file-id": "11529303006998691840", + "x-ms-file-last-write-time": "2022-08-15T09:06:48.6879373Z", + "x-ms-file-parent-id": "13835146016212385792", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5c3b795c-301a-007a-0786-b073e6000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory10/RenameSubdirectory11?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fa75a7f8-f27e-417e-77b6-f29572703f80", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:48 GMT", + "etag": "\"0x8DA7E9D7C7C3987\"", + "last-modified": "Mon, 15 Aug 2022 09:06:48 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "fa75a7f8-f27e-417e-77b6-f29572703f80", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:48.9827719Z", + "x-ms-file-creation-time": "2022-08-15T09:06:48.9827719Z", + "x-ms-file-id": "16140989025426079744", + "x-ms-file-last-write-time": "2022-08-15T09:06:48.9827719Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5c3b795d-301a-007a-0886-b073e6000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory12?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "38f74d21-e7c4-4423-7857-1c12a5691595", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:48 GMT", + "etag": "\"0x8DA7E9D7CB25CE1\"", + "last-modified": "Mon, 15 Aug 2022 09:06:49 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "38f74d21-e7c4-4423-7857-1c12a5691595", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:49.3375713Z", + "x-ms-file-creation-time": "2022-08-15T09:06:48.6879373Z", + "x-ms-file-id": "11529303006998691840", + "x-ms-file-last-write-time": "2022-08-15T09:06:48.6879373Z", + "x-ms-file-parent-id": "16140989025426079744", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5c3b795e-301a-007a-0986-b073e6000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory12/RenameSubdirectory13?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "04cca97b-0c60-425f-441b-3a57de9dba9e", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:48 GMT", + "etag": "\"0x8DA7E9D7CB25CE1\"", + "last-modified": "Mon, 15 Aug 2022 09:06:49 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "04cca97b-0c60-425f-441b-3a57de9dba9e", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:49.3375713Z", + "x-ms-file-creation-time": "2022-08-15T09:06:48.6879373Z", + "x-ms-file-id": "11529303006998691840", + "x-ms-file-last-write-time": "2022-08-15T09:06:48.6879373Z", + "x-ms-file-parent-id": "16140989025426079744", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5c3b795f-301a-007a-0a86-b073e6000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory12/RenameSubdirectory13?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cc93286f-3d90-4d09-4f0b-bd9b6c24208b", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:5c3b7962-301a-007a-0d86-b073e6000000\nTime:2022-08-15T09:06:49.9294954Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:49 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cc93286f-3d90-4d09-4f0b-bd9b6c24208b", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "5c3b7962-301a-007a-0d86-b073e6000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory10/RenameSubdirectory11?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "713201fb-bbf1-489c-5591-1cebdfafa9c5", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:50 GMT", + "etag": "\"0x8DA7E9D7DC1F7F8\"", + "last-modified": "Mon, 15 Aug 2022 09:06:51 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "713201fb-bbf1-489c-5591-1cebdfafa9c5", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:51.1175672Z", + "x-ms-file-creation-time": "2022-08-15T09:06:51.1175672Z", + "x-ms-file-id": "13835110831840296960", + "x-ms-file-last-write-time": "2022-08-15T09:06:51.1175672Z", + "x-ms-file-parent-id": "11529285414812647424", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "669ebf6b-b01a-0090-1086-b054c8000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory14?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4ee47aac-f956-4c5d-4dd6-ea8a4854b3bc", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:51 GMT", + "etag": "\"0x8DA7E9D7DEF910E\"", + "last-modified": "Mon, 15 Aug 2022 09:06:51 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "4ee47aac-f956-4c5d-4dd6-ea8a4854b3bc", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-15T09:06:51.4163982Z", + "x-ms-file-creation-time": "2022-08-15T09:06:51.4163982Z", + "x-ms-file-id": "11529267822626603008", + "x-ms-file-last-write-time": "2022-08-15T09:06:51.4163982Z", + "x-ms-file-parent-id": "13835110831840296960", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "669ebf71-b01a-0090-1386-b054c8000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory14/RenameSubdirectoryFile1" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5646dd52-03d4-47a7-6c22-4ab4f1b6a469", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:51 GMT", + "etag": "\"0x8DA7E9D7E2761E4\"", + "last-modified": "Mon, 15 Aug 2022 09:06:51 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5646dd52-03d4-47a7-6c22-4ab4f1b6a469", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:51.7821924Z", + "x-ms-file-creation-time": "2022-08-15T09:06:51.1175672Z", + "x-ms-file-id": "13835110831840296960", + "x-ms-file-last-write-time": "2022-08-15T09:06:51.1175672Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "669ebf72-b01a-0090-1486-b054c8000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory15?comp=rename&restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "80119ef8-4ca6-4245-7d6e-6bfe43150f26", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:51 GMT", + "etag": "\"0x8DA7E9D7E2761E4\"", + "last-modified": "Mon, 15 Aug 2022 09:06:51 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "80119ef8-4ca6-4245-7d6e-6bfe43150f26", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-15T09:06:51.7821924Z", + "x-ms-file-creation-time": "2022-08-15T09:06:51.1175672Z", + "x-ms-file-id": "13835110831840296960", + "x-ms-file-last-write-time": "2022-08-15T09:06:51.1175672Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "669ebf73-b01a-0090-1586-b054c8000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory15?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8f8bc195-4a56-4d65-72eb-e16dbdd0497a", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:669ebf75-b01a-0090-1786-b054c8000000\nTime:2022-08-15T09:06:52.3777799Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 15 Aug 2022 09:06:52 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8f8bc195-4a56-4d65-72eb-e16dbdd0497a", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "669ebf75-b01a-0090-1786-b054c8000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory/RenameSubdirectory1/RenameSubdirectory14?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "24875bd8-1d95-4fba-5f43-bc1f7bb4809a", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:52 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "24875bd8-1d95-4fba-5f43-bc1f7bb4809a", + "x-ms-request-id": "81a0815c-901a-004c-1786-b0fe96000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5771abb0-aefa-44b9-77b7-7905c2372edc", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 15 Aug 2022 09:06:53 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5771abb0-aefa-44b9-77b7-7905c2372edc", + "x-ms-request-id": "81a0815f-901a-004c-1986-b0fe96000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestrenamesubdirectory?restype=share" + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.SmbPropertiesDefaultValue.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.SmbPropertiesDefaultValue.json index 36270dcd2b..dd702b1c9f 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.SmbPropertiesDefaultValue.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareDirectoryClientTest.SmbPropertiesDefaultValue.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "582bb742-dc44-4840-4b93-48bea06228d6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "437ab57a-3445-4ac2-4018-6460d85ea60c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DC8FE01\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:36 GMT", + "etag": "\"0x8DA7C0EF8682876\"", + "last-modified": "Fri, 12 Aug 2022 03:01:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "582bb742-dc44-4840-4b93-48bea06228d6", - "x-ms-request-id": "04c3e8eb-801a-000d-41b7-0177d3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "437ab57a-3445-4ac2-4018-6460d85ea60c", + "x-ms-request-id": "5a2c5616-d01a-005d-41f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "99654ea9-4329-4137-6210-3d4e084c5a03", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b77f043b-8597-4d46-74d4-934956d9d22f", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DCD32CC\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:36 GMT", + "etag": "\"0x8DA7C0EF896B056\"", + "last-modified": "Fri, 12 Aug 2022 03:01:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "99654ea9-4329-4137-6210-3d4e084c5a03", + "x-ms-client-request-id": "b77f043b-8597-4d46-74d4-934956d9d22f", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.6706508Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.6706508Z", + "x-ms-file-change-time": "2022-08-12T03:01:36.8357974Z", + "x-ms-file-creation-time": "2022-08-12T03:01:36.8357974Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.6706508Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:36.8357974Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "04c3e8ee-801a-000d-42b7-0177d3000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c5618-d01a-005d-42f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValuebase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d453073f-16a8-4ca4-546d-74161eef3898", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6af9b22f-71c4-4120-652c-3dca25c3c894", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DCF555B\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:36 GMT", + "etag": "\"0x8DA7C0EF8C35F29\"", + "last-modified": "Fri, 12 Aug 2022 03:01:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d453073f-16a8-4ca4-546d-74161eef3898", + "x-ms-client-request-id": "6af9b22f-71c4-4120-652c-3dca25c3c894", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.6846427Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-change-time": "2022-08-12T03:01:37.1286313Z", + "x-ms-file-creation-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "04c3e8f0-801a-000d-43b7-0177d3000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c5619-d01a-005d-43f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "24441966-581a-4ca5-68cb-cec79afea526", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b47a3924-c041-4859-65f7-2ceb936fd263", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DCF555B\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:36 GMT", + "etag": "\"0x8DA7C0EF8C35F29\"", + "last-modified": "Fri, 12 Aug 2022 03:01:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "24441966-581a-4ca5-68cb-cec79afea526", + "x-ms-client-request-id": "b47a3924-c041-4859-65f7-2ceb936fd263", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.6846427Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-change-time": "2022-08-12T03:01:37.1286313Z", + "x-ms-file-creation-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "04c3e8f1-801a-000d-44b7-0177d3000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c561b-d01a-005d-44f7-ad6422000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "12e0514a-8f70-41fa-62cf-37aabad0dd92", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3721e9a9-94da-4832-5455-d46744f5bb92", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -124,29 +124,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DD2893F\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:37 GMT", + "etag": "\"0x8DA7C0EF91BAB7B\"", + "last-modified": "Fri, 12 Aug 2022 03:01:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "12e0514a-8f70-41fa-62cf-37aabad0dd92", + "x-ms-client-request-id": "3721e9a9-94da-4832-5455-d46744f5bb92", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.7056319Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-change-time": "2022-08-12T03:01:37.7073019Z", + "x-ms-file-creation-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "04c3e8f2-801a-000d-45b7-0177d3000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c561c-d01a-005d-45f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue?comp=properties&restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b0d09fe3-a4be-44ae-5873-3ef99cf174df", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c06386c8-b467-4c2e-6ce3-4d6a5c401a62", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -154,29 +154,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", - "etag": "\"0x8D9CFCE3DD2893F\"", - "last-modified": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:37 GMT", + "etag": "\"0x8DA7C0EF91BAB7B\"", + "last-modified": "Fri, 12 Aug 2022 03:01:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b0d09fe3-a4be-44ae-5873-3ef99cf174df", + "x-ms-client-request-id": "c06386c8-b467-4c2e-6ce3-4d6a5c401a62", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:04:55.7056319Z", - "x-ms-file-creation-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-change-time": "2022-08-12T03:01:37.7073019Z", + "x-ms-file-creation-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:04:55.6846427Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:37.1286313Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "04c3e8f3-801a-000d-46b7-0177d3000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c561d-d01a-005d-46f7-ad6422000000", "x-ms-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "08bc68e4-cf8d-4bec-69a5-557e79546971", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "10cb93cc-a156-4069-6010-ada17ba74a96", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -184,19 +184,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "08bc68e4-cf8d-4bec-69a5-557e79546971", - "x-ms-request-id": "04c3e8f4-801a-000d-47b7-0177d3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "10cb93cc-a156-4069-6010-ada17ba74a96", + "x-ms-request-id": "5a2c561e-d01a-005d-47f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "794ec126-8626-4ec5-5414-264e74094e73", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3b13f543-cbf9-4793-45d7-20b165ccea73", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -204,11 +204,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:04:55 GMT", + "date": "Fri, 12 Aug 2022 03:01:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "794ec126-8626-4ec5-5414-264e74094e73", - "x-ms-request-id": "04c3e8f5-801a-000d-48b7-0177d3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "3b13f543-cbf9-4793-45d7-20b165ccea73", + "x-ms-request-id": "5a2c5620-d01a-005d-48f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharedirectoryclienttestsmbpropertiesdefaultvalue?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.CopyRelated.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.CopyRelated.json index 6c8767671a..b5c115e899 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.CopyRelated.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.CopyRelated.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0ceff78c-6271-4057-452e-3bf0813787d7", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9b86fc00-d0fa-4a16-73d6-62a5dce09af6", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACC1D952\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:58 GMT", + "etag": "\"0x8DA7C0F05895E27\"", + "last-modified": "Fri, 12 Aug 2022 03:01:58 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0ceff78c-6271-4057-452e-3bf0813787d7", - "x-ms-request-id": "88453cfe-701a-0044-7ebd-013538000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "9b86fc00-d0fa-4a16-73d6-62a5dce09af6", + "x-ms-request-id": "d26c20ec-f01a-0038-11f7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "21ef5833-8fe7-460b-68b3-4e6a78786770", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3f3130da-9546-4156-59ac-f07279a182d6", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACCE386C\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:58 GMT", + "etag": "\"0x8DA7C0F05B73529\"", + "last-modified": "Fri, 12 Aug 2022 03:01:58 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "21ef5833-8fe7-460b-68b3-4e6a78786770", + "x-ms-client-request-id": "3f3130da-9546-4156-59ac-f07279a182d6", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:50:58.8848236Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.8848236Z", + "x-ms-file-change-time": "2022-08-12T03:01:58.8592937Z", + "x-ms-file-creation-time": "2022-08-12T03:01:58.8592937Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.8848236Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:58.8592937Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "88453d01-701a-0044-7fbd-013538000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "d26c20f2-f01a-0038-16f7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelatedbase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2a8be0a7-d336-41af-781d-32fedc566750", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "bbe4b89b-265e-4e0b-6ae1-b2e8563c43d4", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACD16C48\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:58 GMT", + "etag": "\"0x8DA7C0F05E4A730\"", + "last-modified": "Fri, 12 Aug 2022 03:01:59 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2a8be0a7-d336-41af-781d-32fedc566750", + "x-ms-client-request-id": "bbe4b89b-265e-4e0b-6ae1-b2e8563c43d4", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.9058120Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.9058120Z", + "x-ms-file-change-time": "2022-08-12T03:01:59.1571248Z", + "x-ms-file-creation-time": "2022-08-12T03:01:59.1571248Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.9058120Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:59.1571248Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "88453d03-701a-0044-80bd-013538000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "d26c20f5-f01a-0038-19f7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelatedbase/CopyRelatedbasefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "02626a6f-77bc-4b35-752d-f888e7d5309b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "eada7f4d-2efd-41f0-6b59-599a98333556", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACD3B5DF\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:59 GMT", + "etag": "\"0x8DA7C0F0611CB1B\"", + "last-modified": "Fri, 12 Aug 2022 03:01:59 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "02626a6f-77bc-4b35-752d-f888e7d5309b", + "x-ms-client-request-id": "eada7f4d-2efd-41f0-6b59-599a98333556", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.9208031Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.9208031Z", + "x-ms-file-change-time": "2022-08-12T03:01:59.4529563Z", + "x-ms-file-creation-time": "2022-08-12T03:01:59.4529563Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.9208031Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:59.4529563Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "88453d04-701a-0044-01bd-013538000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "d26c20f6-f01a-0038-1af7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelated1" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e3f448dc-7ac0-4a72-53e4-22dca389f34e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "263010c4-aa16-49f8-5078-95f29be2ac3c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -124,23 +124,23 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACF82881\"", - "last-modified": "Tue, 04 Jan 2022 22:50:59 GMT", + "date": "Fri, 12 Aug 2022 03:01:59 GMT", + "etag": "\"0x8DA7C0F0665D255\"", + "last-modified": "Fri, 12 Aug 2022 03:02:00 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e3f448dc-7ac0-4a72-53e4-22dca389f34e", - "x-ms-copy-id": "8442e149-6cf1-4500-9de8-4c1569ddf53a", + "x-ms-client-request-id": "263010c4-aa16-49f8-5078-95f29be2ac3c", + "x-ms-copy-id": "32a1cc89-7725-42e6-b887-488d94aa65e4", "x-ms-copy-status": "success", - "x-ms-request-id": "88453d05-701a-0044-02bd-013538000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "d26c20fa-f01a-0038-1ef7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelated2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "4097f32f-fa8b-4b80-7b2b-ced8ab930a22", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9e90e679-d26e-4aab-74f5-554c91eead57", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -149,37 +149,37 @@ "STATUS_CODE": "200", "content-length": "1048576", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACF82881\"", - "last-modified": "Tue, 04 Jan 2022 22:50:59 GMT", + "date": "Fri, 12 Aug 2022 03:02:00 GMT", + "etag": "\"0x8DA7C0F0665D255\"", + "last-modified": "Fri, 12 Aug 2022 03:02:00 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "4097f32f-fa8b-4b80-7b2b-ced8ab930a22", - "x-ms-copy-completion-time": "Tue, 04 Jan 2022 22:50:59 GMT", - "x-ms-copy-id": "8442e149-6cf1-4500-9de8-4c1569ddf53a", + "x-ms-client-request-id": "9e90e679-d26e-4aab-74f5-554c91eead57", + "x-ms-copy-completion-time": "Fri, 12 Aug 2022 03:01:59 GMT", + "x-ms-copy-id": "32a1cc89-7725-42e6-b887-488d94aa65e4", "x-ms-copy-progress": "1048576/1048576", - "x-ms-copy-source": "https://sharesrecording.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelated1", + "x-ms-copy-source": "https://zchang.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelated1", "x-ms-copy-status": "success", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:59.1596673Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.9208031Z", + "x-ms-file-change-time": "2022-08-12T03:02:00.0036437Z", + "x-ms-file-creation-time": "2022-08-12T03:01:59.4529563Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.9208031Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:59.4529563Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "88453d06-701a-0044-03bd-013538000000", + "x-ms-request-id": "d26c20fd-f01a-0038-21f7-adca66000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelated2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d46bcbbc-a8fd-4c1f-469b-d46864c4d8cc", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "af962ed5-567e-470c-53cc-ecd593daad6d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -187,29 +187,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4AD03E6A5\"", - "last-modified": "Tue, 04 Jan 2022 22:50:59 GMT", + "date": "Fri, 12 Aug 2022 03:02:00 GMT", + "etag": "\"0x8DA7C0F06C263C9\"", + "last-modified": "Fri, 12 Aug 2022 03:02:00 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d46bcbbc-a8fd-4c1f-469b-d46864c4d8cc", + "x-ms-client-request-id": "af962ed5-567e-470c-53cc-ecd593daad6d", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:59.2366245Z", - "x-ms-file-creation-time": "2022-01-04T22:50:59.2366245Z", + "x-ms-file-change-time": "2022-08-12T03:02:00.6102985Z", + "x-ms-file-creation-time": "2022-08-12T03:02:00.6102985Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:50:59.2366245Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:00.6102985Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "88453d07-701a-0044-04bd-013538000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "d26c20fe-f01a-0038-22f7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated/CopyRelated3" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5a22ada6-d967-47a6-7935-8b19735358a5", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "55f67862-8936-4a12-5b57-29a77a5bf039", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -217,19 +217,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:59 GMT", + "date": "Fri, 12 Aug 2022 03:02:00 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5a22ada6-d967-47a6-7935-8b19735358a5", - "x-ms-request-id": "88453d08-701a-0044-05bd-013538000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "55f67862-8936-4a12-5b57-29a77a5bf039", + "x-ms-request-id": "d26c2102-f01a-0038-25f7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1364db6e-a32e-4e80-7db3-b71f4fb551db", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f1672c44-4495-417b-6075-224151a3b8ac", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -237,19 +237,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:59 GMT", + "date": "Fri, 12 Aug 2022 03:02:00 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1364db6e-a32e-4e80-7db3-b71f4fb551db", - "x-ms-request-id": "88453d09-701a-0044-06bd-013538000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "f1672c44-4495-417b-6075-224151a3b8ac", + "x-ms-request-id": "d26c2104-f01a-0038-27f7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "985e4f10-7edd-4c9c-4efc-ab0528818f34", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8f30b57c-9a81-4093-5d72-3de5c3ebaeb2", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -257,11 +257,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:59 GMT", + "date": "Fri, 12 Aug 2022 03:02:01 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "985e4f10-7edd-4c9c-4efc-ab0528818f34", - "x-ms-request-id": "88453d0a-701a-0044-07bd-013538000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "8f30b57c-9a81-4093-5d72-3de5c3ebaeb2", + "x-ms-request-id": "d26c2106-f01a-0038-29f7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestcopyrelated?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json new file mode 100644 index 0000000000..54adbde038 --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.DownloadNonExistingToFile.json @@ -0,0 +1,169 @@ +{ + "networkCallRecords": [ + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "6edfef4b-894f-4b59-40b3-8207f3ba4b4c", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:09 GMT", + "etag": "\"0x8DA89AAD8AFFAF7\"", + "last-modified": "Mon, 29 Aug 2022 10:40:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6edfef4b-894f-4b59-40b3-8207f3ba4b4c", + "x-ms-request-id": "2c18eab3-401a-0078-5593-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "9ad657f0-6082-467c-4455-e9b75aa48941", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:09 GMT", + "etag": "\"0x8DA89AAD8E06427\"", + "last-modified": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9ad657f0-6082-467c-4455-e9b75aa48941", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2022-08-29T10:40:10.2376487Z", + "x-ms-file-creation-time": "2022-08-29T10:40:10.2376487Z", + "x-ms-file-id": "13835128424026341376", + "x-ms-file-last-write-time": "2022-08-29T10:40:10.2376487Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "14799134079974362488*11941910252504767217", + "x-ms-request-id": "2c18eaca-401a-0078-6993-bb793a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFilebase?restype=directory" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "f062410c-713f-470d-426f-990d3f03ff74", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "etag": "\"0x8DA89AAD90D6101\"", + "last-modified": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f062410c-713f-470d-426f-990d3f03ff74", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-29T10:40:10.5324801Z", + "x-ms-file-creation-time": "2022-08-29T10:40:10.5324801Z", + "x-ms-file-id": "11529285414812647424", + "x-ms-file-last-write-time": "2022-08-29T10:40:10.5324801Z", + "x-ms-file-parent-id": "13835128424026341376", + "x-ms-file-permission-key": "944304957241799295*11941910252504767217", + "x-ms-request-id": "2c18eade-401a-0078-7c93-bb793a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFilebase/DownloadNonExistingToFilebasefile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "92d10ba7-5cce-4bf5-4ec3-f2242990b412", + "x-ms-version": "2021-06-08" + }, + "Method": "GET", + "Response": { + "BODY": "ResourceNotFoundThe specified resource does not exist.\nRequestId:2c18eae2-401a-0078-8093-bb793a000000\nTime:2022-08-29T10:40:10.7988819Z", + "REASON_PHRASE": "The specified resource does not exist.", + "STATUS_CODE": "404", + "content-length": "223", + "content-type": "application/xml", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "vary": "Origin", + "x-ms-client-request-id": "92d10ba7-5cce-4bf5-4ec3-f2242990b412", + "x-ms-error-code": "ResourceNotFound", + "x-ms-request-id": "2c18eae2-401a-0078-8093-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile/DownloadNonExistingToFilebase/DownloadNonExistingToFile" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b9b912c5-3a77-4008-4ef4-daedeafc4f8a", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b9b912c5-3a77-4008-4ef4-daedeafc4f8a", + "x-ms-request-id": "2c18eae5-401a-0078-0393-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "3996664f-a9c3-4e5d-5cd7-25f8cfa58215", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:10 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3996664f-a9c3-4e5d-5cd7-25f8cfa58215", + "x-ms-request-id": "2c18eae9-401a-0078-0693-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 19044 19041.1.amd64fre.vb_release.191206-1406)", + "x-ms-client-request-id": "b4aa936b-5d9e-445c-4a86-914acb77413b", + "x-ms-version": "2021-06-08" + }, + "Method": "DELETE", + "Response": { + "BODY": "", + "REASON_PHRASE": "Accepted", + "STATUS_CODE": "202", + "content-length": "0", + "date": "Mon, 29 Aug 2022 10:40:11 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b4aa936b-5d9e-445c-4a86-914acb77413b", + "x-ms-request-id": "2c18eaec-401a-0078-0893-bb793a000000", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestdownloadnonexistingtofile?restype=share" + } + ] +} diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.FileSmbProperties.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.FileSmbProperties.json index 005ef46982..f464fab67f 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.FileSmbProperties.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.FileSmbProperties.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "02bf79c6-26f0-4a80-71fc-13ea5986fc74", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ff81be69-e51c-4ed5-563c-f45a9834ac27", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABBBB869\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:38 GMT", + "etag": "\"0x8DA7C0EF9CD9F69\"", + "last-modified": "Fri, 12 Aug 2022 03:01:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "02bf79c6-26f0-4a80-71fc-13ea5986fc74", - "x-ms-request-id": "4625ad49-e01a-0069-21bd-01864b000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "ff81be69-e51c-4ed5-563c-f45a9834ac27", + "x-ms-request-id": "5a2c5623-d01a-005d-4bf7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "59dc5730-4e23-4df7-7e28-c625e7275e4f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "bd17a3bf-85cf-4b2c-4ac6-0d8184b3b2f8", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABBFD5F9\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:38 GMT", + "etag": "\"0x8DA7C0EF9FB63AE\"", + "last-modified": "Fri, 12 Aug 2022 03:01:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "59dc5730-4e23-4df7-7e28-c625e7275e4f", + "x-ms-client-request-id": "bd17a3bf-85cf-4b2c-4ac6-0d8184b3b2f8", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:50:57.1128313Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1128313Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.1734702Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.1734702Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1128313Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.1734702Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "4625ad4c-e01a-0069-22bd-01864b000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c5626-d01a-005d-4cf7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "97ab0a7d-b11e-4299-7ba0-91ee8f93fcce", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "efd99547-df99-4b25-7f0b-28d0e0ee3186", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABC21F96\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:39 GMT", + "etag": "\"0x8DA7C0EFA28127A\"", + "last-modified": "Fri, 12 Aug 2022 03:01:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "97ab0a7d-b11e-4299-7ba0-91ee8f93fcce", + "x-ms-client-request-id": "efd99547-df99-4b25-7f0b-28d0e0ee3186", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.1278230Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1278230Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.4663034Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.4663034Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1278230Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.4663034Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "4625ad4e-e01a-0069-23bd-01864b000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c563c-d01a-005d-4ff7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbPropertiesbasefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3d71ffef-ba44-416f-66ae-f48daf1c51d8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c1c19694-9328-442e-7ec0-d47ddee7f892", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -95,32 +95,32 @@ "STATUS_CODE": "200", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABC21F96\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:39 GMT", + "etag": "\"0x8DA7C0EFA28127A\"", + "last-modified": "Fri, 12 Aug 2022 03:01:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3d71ffef-ba44-416f-66ae-f48daf1c51d8", + "x-ms-client-request-id": "c1c19694-9328-442e-7ec0-d47ddee7f892", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.1278230Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1278230Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.4663034Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.4663034Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1278230Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.4663034Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "4625ad4f-e01a-0069-24bd-01864b000000", + "x-ms-request-id": "5a2c563f-d01a-005d-50f7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbPropertiesbasefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "21fc90ff-8ec8-4abe-4e32-c8c686c0f187", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ee3b78d9-ea55-4024-4120-6aea4b28e41c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -128,29 +128,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABC3F6A1\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:39 GMT", + "etag": "\"0x8DA7C0EFA5FEE38\"", + "last-modified": "Fri, 12 Aug 2022 03:01:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "21fc90ff-8ec8-4abe-4e32-c8c686c0f187", + "x-ms-client-request-id": "ee3b78d9-ea55-4024-4120-6aea4b28e41c", "x-ms-file-attributes": "System | Archive | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.1398817Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "4625ad50-e01a-0069-25bd-01864b000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5640-d01a-005d-51f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties1" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "438e0037-a8b0-420e-7b31-1d2f43fa4685", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e451960b-d6ef-444b-6f48-7222705fa35c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -158,29 +158,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABC3F6A1\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:39 GMT", + "etag": "\"0x8DA7C0EFA5FEE38\"", + "last-modified": "Fri, 12 Aug 2022 03:01:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "438e0037-a8b0-420e-7b31-1d2f43fa4685", + "x-ms-client-request-id": "e451960b-d6ef-444b-6f48-7222705fa35c", "x-ms-file-attributes": "System | Archive | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.1398817Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "4625ad51-e01a-0069-26bd-01864b000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5641-d01a-005d-52f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0f4f721d-1661-4046-670c-88b8e96fcd80", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "51cfc15f-6199-4b2e-4c83-a9d557b30b84", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -189,32 +189,32 @@ "STATUS_CODE": "200", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABC3F6A1\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:40 GMT", + "etag": "\"0x8DA7C0EFA5FEE38\"", + "last-modified": "Fri, 12 Aug 2022 03:01:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0f4f721d-1661-4046-670c-88b8e96fcd80", + "x-ms-client-request-id": "51cfc15f-6199-4b2e-4c83-a9d557b30b84", "x-ms-file-attributes": "System | Archive | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.1398817Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "4625ad52-e01a-0069-27bd-01864b000000", + "x-ms-request-id": "5a2c5643-d01a-005d-53f7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties1" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "46f38fcc-0e12-434a-55ac-e8c01c0a26fd", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "768f5fe0-ed78-4185-7691-410ddaf3bba0", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -223,32 +223,32 @@ "STATUS_CODE": "200", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABC3F6A1\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:40 GMT", + "etag": "\"0x8DA7C0EFA5FEE38\"", + "last-modified": "Fri, 12 Aug 2022 03:01:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "46f38fcc-0e12-434a-55ac-e8c01c0a26fd", + "x-ms-client-request-id": "768f5fe0-ed78-4185-7691-410ddaf3bba0", "x-ms-file-attributes": "System | Archive | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.1398817Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "4625ad53-e01a-0069-28bd-01864b000000", + "x-ms-request-id": "5a2c5644-d01a-005d-54f7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b739eb1f-a4ce-4f3a-436a-0b911c04b700", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "55d5c23d-773f-4633-7505-86cf7d89c9e7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -256,29 +256,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABCF1601\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:40 GMT", + "etag": "\"0x8DA7C0EFB32F314\"", + "last-modified": "Fri, 12 Aug 2022 03:01:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b739eb1f-a4ce-4f3a-436a-0b911c04b700", + "x-ms-client-request-id": "55d5c23d-773f-4633-7505-86cf7d89c9e7", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.2127745Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.2127745Z", + "x-ms-file-change-time": "2022-08-12T03:01:41.2153108Z", + "x-ms-file-creation-time": "2022-08-12T03:01:41.2153108Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.2127745Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:41.2153108Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "4625ad54-e01a-0069-29bd-01864b000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5645-d01a-005d-55f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties3" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0b2a74fe-f973-433c-58ca-f0818e4338a2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2216c1b1-c2bb-4a2b-73da-4772b550754c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -286,29 +286,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABD13894\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:41 GMT", + "etag": "\"0x8DA7C0EFB5FC8F6\"", + "last-modified": "Fri, 12 Aug 2022 03:01:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0b2a74fe-f973-433c-58ca-f0818e4338a2", + "x-ms-client-request-id": "2216c1b1-c2bb-4a2b-73da-4772b550754c", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.2267668Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.2267668Z", + "x-ms-file-change-time": "2022-08-12T03:01:41.5091446Z", + "x-ms-file-creation-time": "2022-08-12T03:01:41.5091446Z", "x-ms-file-id": "12682206919419494400", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.2267668Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:41.5091446Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "4625ad55-e01a-0069-2abd-01864b000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5646-d01a-005d-56f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties4" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "74fc32ed-cbe4-43bf-7f19-fb0ecb46d64e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d097ed4f-43bf-4d14-73d5-74a779eee4aa", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -316,29 +316,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABD3822F\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:41 GMT", + "etag": "\"0x8DA7C0EFB8E4C3C\"", + "last-modified": "Fri, 12 Aug 2022 03:01:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "74fc32ed-cbe4-43bf-7f19-fb0ecb46d64e", + "x-ms-client-request-id": "d097ed4f-43bf-4d14-73d5-74a779eee4aa", "x-ms-file-attributes": "System | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.2417583Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "15790440386765357382*10343500956293103928", - "x-ms-request-id": "4625ad56-e01a-0069-2bbd-01864b000000", + "x-ms-file-permission-key": "10042215909827301789*16137673612980802019", + "x-ms-request-id": "5a2c5649-d01a-005d-58f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties3?comp=properties" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5b029360-eef4-49b4-64dc-24a492600f5b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8284c514-884b-4b1f-7c8c-29b82c909d15", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -346,29 +346,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABD57DB3\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:41 GMT", + "etag": "\"0x8DA7C0EFBBAACF1\"", + "last-modified": "Fri, 12 Aug 2022 03:01:42 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5b029360-eef4-49b4-64dc-24a492600f5b", + "x-ms-client-request-id": "8284c514-884b-4b1f-7c8c-29b82c909d15", "x-ms-file-attributes": "System | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.2547507Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "12682206919419494400", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "15790440386765357382*10343500956293103928", - "x-ms-request-id": "4625ad57-e01a-0069-2cbd-01864b000000", + "x-ms-file-permission-key": "10042215909827301789*16137673612980802019", + "x-ms-request-id": "5a2c564d-d01a-005d-5af7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties4?comp=properties" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7fb9b7d1-f208-4d27-5b03-bdc1d9dcd6e9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "992e69db-f6b9-4a26-6d26-d14d0431176d", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -381,32 +381,32 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABD3822F\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:41 GMT", + "etag": "\"0x8DA7C0EFB8E4C3C\"", + "last-modified": "Fri, 12 Aug 2022 03:01:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7fb9b7d1-f208-4d27-5b03-bdc1d9dcd6e9", + "x-ms-client-request-id": "992e69db-f6b9-4a26-6d26-d14d0431176d", "x-ms-file-attributes": "System | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.2417583Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "14988049928633188352", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "15790440386765357382*10343500956293103928", + "x-ms-file-permission-key": "10042215909827301789*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "4625ad58-e01a-0069-2dbd-01864b000000", + "x-ms-request-id": "5a2c564f-d01a-005d-5bf7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties3" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ec1ab245-1d47-418c-7365-c8f4631f685b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f719281f-2b7d-4fd4-6c2a-464760077a1c", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -419,32 +419,32 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", - "etag": "\"0x8D9CFD4ABD57DB3\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:42 GMT", + "etag": "\"0x8DA7C0EFBBAACF1\"", + "last-modified": "Fri, 12 Aug 2022 03:01:42 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ec1ab245-1d47-418c-7365-c8f4631f685b", + "x-ms-client-request-id": "f719281f-2b7d-4fd4-6c2a-464760077a1c", "x-ms-file-attributes": "System | NotContentIndexed", - "x-ms-file-change-time": "2022-01-04T22:50:57.2547507Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.1398817Z", + "x-ms-file-change-time": "2022-08-12T03:01:39.8323770Z", + "x-ms-file-creation-time": "2022-08-12T03:01:39.8323768Z", "x-ms-file-id": "12682206919419494400", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.1398819Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:39.8323770Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "15790440386765357382*10343500956293103928", + "x-ms-file-permission-key": "10042215909827301789*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "4625ad59-e01a-0069-2ebd-01864b000000", + "x-ms-request-id": "5a2c5650-d01a-005d-5cf7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties/FileSmbPropertiesbase/FileSmbProperties4" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1fa9d141-e6a9-433b-6da5-2a4be03058f6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "43af410f-9773-482d-483b-1d88d2931115", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -452,19 +452,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", + "date": "Fri, 12 Aug 2022 03:01:42 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1fa9d141-e6a9-433b-6da5-2a4be03058f6", - "x-ms-request-id": "4625ad5a-e01a-0069-2fbd-01864b000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "43af410f-9773-482d-483b-1d88d2931115", + "x-ms-request-id": "5a2c5653-d01a-005d-5ff7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "996ccd17-e676-457a-776f-77273f62e321", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6c34398b-8f8b-4c88-64f9-7c54ab906320", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -472,19 +472,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", + "date": "Fri, 12 Aug 2022 03:01:42 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "996ccd17-e676-457a-776f-77273f62e321", - "x-ms-request-id": "4625ad5b-e01a-0069-30bd-01864b000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "6c34398b-8f8b-4c88-64f9-7c54ab906320", + "x-ms-request-id": "5a2c5654-d01a-005d-60f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "34ebd2fb-4627-4f35-7a44-95b8ad6c45ed", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d86bdb88-f7a4-4559-6484-c14056c21c48", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -492,11 +492,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:56 GMT", + "date": "Fri, 12 Aug 2022 03:01:43 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "34ebd2fb-4627-4f35-7a44-95b8ad6c45ed", - "x-ms-request-id": "4625ad5c-e01a-0069-31bd-01864b000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d86bdb88-f7a4-4559-6484-c14056c21c48", + "x-ms-request-id": "5a2c5657-d01a-005d-63f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestfilesmbproperties?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.RangeUploadDownload.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.RangeUploadDownload.json index e8d90e9b20..362ca6c82b 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.RangeUploadDownload.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.RangeUploadDownload.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e22c42cd-e363-432a-757e-5bcb7a8162ba", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "82b09393-fe24-4575-67c8-330d6d27e97b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC6B94FA\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:46 GMT", + "etag": "\"0x8DA7C0EFE82D864\"", + "last-modified": "Fri, 12 Aug 2022 03:01:46 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e22c42cd-e363-432a-757e-5bcb7a8162ba", - "x-ms-request-id": "d26b0774-a01a-0047-7abd-01d45c000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "82b09393-fe24-4575-67c8-330d6d27e97b", + "x-ms-request-id": "5a2c566d-d01a-005d-73f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "07db59ee-0c4b-4d07-607d-ac29f1fa4cd2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "776d93d0-329e-492a-7879-fd2119d632d5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC70BCB9\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:46 GMT", + "etag": "\"0x8DA7C0EFEB07463\"", + "last-modified": "Fri, 12 Aug 2022 03:01:47 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "07db59ee-0c4b-4d07-607d-ac29f1fa4cd2", + "x-ms-client-request-id": "776d93d0-329e-492a-7879-fd2119d632d5", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:50:58.2721721Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.2721721Z", + "x-ms-file-change-time": "2022-08-12T03:01:47.0709859Z", + "x-ms-file-creation-time": "2022-08-12T03:01:47.0709859Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.2721721Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:47.0709859Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "d26b0777-a01a-0047-7bbd-01d45c000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c5670-d01a-005d-75f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownloadbase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8f3f6c1b-33d8-4fa3-4dec-ace86bd9b7e3", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5995ac69-8da5-4344-7779-97707ce7cd19", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC735469\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:46 GMT", + "etag": "\"0x8DA7C0EFEDCD52E\"", + "last-modified": "Fri, 12 Aug 2022 03:01:47 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8f3f6c1b-33d8-4fa3-4dec-ace86bd9b7e3", + "x-ms-client-request-id": "5995ac69-8da5-4344-7779-97707ce7cd19", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.2891625Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.2891625Z", + "x-ms-file-change-time": "2022-08-12T03:01:47.3618222Z", + "x-ms-file-creation-time": "2022-08-12T03:01:47.3618222Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.2891625Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:47.3618222Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "d26b0779-a01a-0047-7cbd-01d45c000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5673-d01a-005d-77f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownloadbase/RangeUploadDownloadbasefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a69d5fb8-48b1-4a29-5011-4359a8082131", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c35c689b-dc05-4cc2-598b-0c1a9fec4871", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC75C510\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:47 GMT", + "etag": "\"0x8DA7C0EFF0935DE\"", + "last-modified": "Fri, 12 Aug 2022 03:01:47 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a69d5fb8-48b1-4a29-5011-4359a8082131", + "x-ms-client-request-id": "c35c689b-dc05-4cc2-598b-0c1a9fec4871", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.3051536Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-change-time": "2022-08-12T03:01:47.6526558Z", + "x-ms-file-creation-time": "2022-08-12T03:01:47.6526558Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:47.6526558Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "d26b077a-a01a-0047-7dbd-01d45c000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5675-d01a-005d-79f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "17f58d97-dc95-4865-74ba-3e6ee8c66a62", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a0c76ddc-3705-42a4-4919-cc482fa57158", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC7E2846\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:48 GMT", + "etag": "\"0x8DA7C0EFFE3E5B5\"", + "last-modified": "Fri, 12 Aug 2022 03:01:49 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "17f58d97-dc95-4865-74ba-3e6ee8c66a62", - "x-ms-request-id": "d26b077b-a01a-0047-7ebd-01d45c000000", + "x-ms-client-request-id": "a0c76ddc-3705-42a4-4919-cc482fa57158", + "x-ms-file-last-write-time": "2022-08-12T03:01:49.0858421Z", + "x-ms-request-id": "5a2c5677-d01a-005d-7bf7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "14f9427f-0a57-450f-7849-ec4c89583fae", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a665ff8f-cef2-475e-5a4b-7e192bb43a5f", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -149,22 +150,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC8468E9\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:49 GMT", + "etag": "\"0x8DA7C0F003DDF84\"", + "last-modified": "Fri, 12 Aug 2022 03:01:49 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "14f9427f-0a57-450f-7849-ec4c89583fae", - "x-ms-request-id": "d26b077c-a01a-0047-7fbd-01d45c000000", + "x-ms-client-request-id": "a665ff8f-cef2-475e-5a4b-7e192bb43a5f", + "x-ms-file-last-write-time": "2022-08-12T03:01:49.6755076Z", + "x-ms-request-id": "5a2c5680-d01a-005d-04f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6056a1da-afe4-4a71-5a3b-23c50ff45d59", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "527bc4b4-c32b-4d62-5a06-a64178775a24", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -173,22 +175,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC8C08F0\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:49 GMT", + "etag": "\"0x8DA7C0F0097161E\"", + "last-modified": "Fri, 12 Aug 2022 03:01:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6056a1da-afe4-4a71-5a3b-23c50ff45d59", - "x-ms-request-id": "d26b077d-a01a-0047-80bd-01d45c000000", + "x-ms-client-request-id": "527bc4b4-c32b-4d62-5a06-a64178775a24", + "x-ms-file-last-write-time": "2022-08-12T03:01:50.2601758Z", + "x-ms-request-id": "5a2c568f-d01a-005d-0df7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7877b57c-5199-45cb-67ca-6e135d26a5e8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4d8fd711-126d-4a15-7a57-68edfe37c3fb", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -199,32 +202,32 @@ "content-length": "1048576", "content-range": "bytes 0-1048575/3145728", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4AC8C08F0\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:50 GMT", + "etag": "\"0x8DA7C0F0097161E\"", + "last-modified": "Fri, 12 Aug 2022 03:01:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7877b57c-5199-45cb-67ca-6e135d26a5e8", + "x-ms-client-request-id": "4d8fd711-126d-4a15-7a57-68edfe37c3fb", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.3051536Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-change-time": "2022-08-12T03:01:50.2601758Z", + "x-ms-file-creation-time": "2022-08-12T03:01:47.6526558Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:50.2601758Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "d26b077e-a01a-0047-01bd-01d45c000000", + "x-ms-request-id": "5a2c5696-d01a-005d-14f7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0284d9c4-251c-4086-579b-68442b903cc1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a251e215-6a90-430b-519c-604b2a810643", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -235,32 +238,32 @@ "content-length": "1048576", "content-range": "bytes 1048576-2097151/3145728", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4AC8C08F0\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:51 GMT", + "etag": "\"0x8DA7C0F0097161E\"", + "last-modified": "Fri, 12 Aug 2022 03:01:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0284d9c4-251c-4086-579b-68442b903cc1", + "x-ms-client-request-id": "a251e215-6a90-430b-519c-604b2a810643", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.3051536Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-change-time": "2022-08-12T03:01:50.2601758Z", + "x-ms-file-creation-time": "2022-08-12T03:01:47.6526558Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:50.2601758Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "d26b077f-a01a-0047-02bd-01d45c000000", + "x-ms-request-id": "5a2c56ab-d01a-005d-29f7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ef25535e-10cc-4304-5905-b73d45a40d00", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "70c73a0f-e604-44e8-58fa-f617436807e7", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -271,32 +274,32 @@ "content-length": "1048576", "content-range": "bytes 2097152-3145727/3145728", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4AC8C08F0\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:52 GMT", + "etag": "\"0x8DA7C0F0097161E\"", + "last-modified": "Fri, 12 Aug 2022 03:01:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ef25535e-10cc-4304-5905-b73d45a40d00", + "x-ms-client-request-id": "70c73a0f-e604-44e8-58fa-f617436807e7", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.3051536Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-change-time": "2022-08-12T03:01:50.2601758Z", + "x-ms-file-creation-time": "2022-08-12T03:01:47.6526558Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.3051536Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:50.2601758Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "d26b0780-a01a-0047-03bd-01d45c000000", + "x-ms-request-id": "5a2c56ad-d01a-005d-2af7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "135b0b87-5bb8-4eab-6a6a-481372078c36", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9561c079-0fb4-4177-406a-111797ab1d23", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -304,29 +307,275 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACA13B88\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:52 GMT", + "etag": "\"0x8DA7C0F022BAC22\"", + "last-modified": "Fri, 12 Aug 2022 03:01:52 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "135b0b87-5bb8-4eab-6a6a-481372078c36", + "x-ms-client-request-id": "9561c079-0fb4-4177-406a-111797ab1d23", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:58.5899912Z", - "x-ms-file-creation-time": "2022-01-04T22:50:58.5899912Z", - "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:50:58.5899912Z", + "x-ms-file-change-time": "2022-08-12T03:01:52.9116706Z", + "x-ms-file-creation-time": "2022-08-12T03:01:52.9116706Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-12T03:01:52.9116706Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c56af-d01a-005d-2cf7-ad6422000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "74a12feb-f682-4ee3-690c-33318ad29bba", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "3145728", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:01:52 GMT", + "etag": "\"0x8DA7C0F022BAC22\"", + "last-modified": "Fri, 12 Aug 2022 03:01:52 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "74a12feb-f682-4ee3-690c-33318ad29bba", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:01:52.9116706Z", + "x-ms-file-creation-time": "2022-08-12T03:01:52.9116706Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-12T03:01:52.9116706Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "5a2c56b0-d01a-005d-2df7-ad6422000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "236ba9a8-272a-4b12-6487-6f4419556546", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", + "date": "Fri, 12 Aug 2022 03:01:53 GMT", + "etag": "\"0x8DA7C0F02B1918A\"", + "last-modified": "Fri, 12 Aug 2022 03:01:53 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "236ba9a8-272a-4b12-6487-6f4419556546", + "x-ms-file-last-write-time": "2022-08-12T03:01:53.7891722Z", + "x-ms-request-id": "5a2c56b1-d01a-005d-2ef7-ad6422000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload?comp=range" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b15bcd73-e63f-4f88-69d6-9fe4564c10d3", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "3145728", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:01:53 GMT", + "etag": "\"0x8DA7C0F02B1918A\"", + "last-modified": "Fri, 12 Aug 2022 03:01:53 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b15bcd73-e63f-4f88-69d6-9fe4564c10d3", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:01:53.7891722Z", + "x-ms-file-creation-time": "2022-08-12T03:01:52.9116706Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-12T03:01:53.7891722Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "5a2c56b2-d01a-005d-2ff7-ad6422000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "529de710-9447-4ca0-4423-df47c0da5659", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Fri, 12 Aug 2022 03:01:53 GMT", + "etag": "\"0x8DA7C0F030AEF2B\"", + "last-modified": "Fri, 12 Aug 2022 03:01:54 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "529de710-9447-4ca0-4423-df47c0da5659", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-creation-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c56b3-d01a-005d-30f7-ad6422000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f3466e53-b0ba-44fb-40e2-bf6cf84e5dd9", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "3145728", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:01:54 GMT", + "etag": "\"0x8DA7C0F030AEF2B\"", + "last-modified": "Fri, 12 Aug 2022 03:01:54 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f3466e53-b0ba-44fb-40e2-bf6cf84e5dd9", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-creation-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "5a2c56b6-d01a-005d-31f7-ad6422000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6effbd3e-fa41-42c1-6bff-8ed67296dbc9", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", + "date": "Fri, 12 Aug 2022 03:01:54 GMT", + "etag": "\"0x8DA7C0F03666F58\"", + "last-modified": "Fri, 12 Aug 2022 03:01:54 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6effbd3e-fa41-42c1-6bff-8ed67296dbc9", + "x-ms-file-last-write-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-request-id": "5a2c56b7-d01a-005d-32f7-ad6422000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload?comp=range" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fe350b31-1b90-4c7a-4ee4-26ce57c334df", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "3145728", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:01:54 GMT", + "etag": "\"0x8DA7C0F03666F58\"", + "last-modified": "Fri, 12 Aug 2022 03:01:54 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "fe350b31-1b90-4c7a-4ee4-26ce57c334df", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:01:54.9744984Z", + "x-ms-file-creation-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-id": "16140971433240035328", + "x-ms-file-last-write-time": "2022-08-12T03:01:54.3748395Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "5a2c56b8-d01a-005d-33f7-ad6422000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8dbe4f65-356e-4d27-63ba-98acf2c1b3f9", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Fri, 12 Aug 2022 03:01:55 GMT", + "etag": "\"0x8DA7C0F03BF30E2\"", + "last-modified": "Fri, 12 Aug 2022 03:01:55 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8dbe4f65-356e-4d27-63ba-98acf2c1b3f9", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:01:55.5561698Z", + "x-ms-file-creation-time": "2022-08-12T03:01:55.5561698Z", + "x-ms-file-id": "12682206919419494400", + "x-ms-file-last-write-time": "2022-08-12T03:01:55.5561698Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "d26b0781-a01a-0047-04bd-01d45c000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c56b9-d01a-005d-34f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0593e0b3-cc5e-49e4-7d06-e2eb16370ff6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "604e0576-bd4f-451d-6446-677252641aa5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -335,44 +584,45 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", - "etag": "\"0x8D9CFD4ACA75526\"", - "last-modified": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:55 GMT", + "etag": "\"0x8DA7C0F03EE5054\"", + "last-modified": "Fri, 12 Aug 2022 03:01:55 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0593e0b3-cc5e-49e4-7d06-e2eb16370ff6", - "x-ms-request-id": "d26b0782-a01a-0047-05bd-01d45c000000", + "x-ms-client-request-id": "604e0576-bd4f-451d-6446-677252641aa5", + "x-ms-file-last-write-time": "2022-08-12T03:01:55.8649940Z", + "x-ms-request-id": "5a2c56ba-d01a-005d-35f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload2?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "eaa30f34-a13e-4b58-77b2-5f76075d4993", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6f82a009-5764-4bfe-550f-95d4ad98c717", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { - "BODY": "Md5MismatchThe MD5 value specified in the request did not match with the MD5 value calculated by the server.\nRequestId:d26b0783-a01a-0047-06bd-01d45c000000\nTime:2022-01-04T22:50:58.6691413ZtQbD1aMPeB+LiPffUwFQJQ==tWH4cgLQSVnjdYjuBc9bEA==", + "BODY": "Md5MismatchThe MD5 value specified in the request did not match with the MD5 value calculated by the server.\nRequestId:5a2c56bb-d01a-005d-36f7-ad6422000000\nTime:2022-08-12T03:01:56.4406279ZtQbD1aMPeB+LiPffUwFQJQ==tWH4cgLQSVnjdYjuBc9bEA==", "REASON_PHRASE": "The MD5 value specified in the request did not match with the MD5 value calculated by the server.", "STATUS_CODE": "400", "content-length": "405", "content-type": "application/xml", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:55 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "eaa30f34-a13e-4b58-77b2-5f76075d4993", + "x-ms-client-request-id": "6f82a009-5764-4bfe-550f-95d4ad98c717", "x-ms-error-code": "Md5Mismatch", - "x-ms-request-id": "d26b0783-a01a-0047-06bd-01d45c000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "5a2c56bb-d01a-005d-36f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload/RangeUploadDownload2?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2b7e2424-0dfb-451d-7d96-3360feb8a4f0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ed6eb052-7ed3-4483-7e91-4d174e56a8ca", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -380,19 +630,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:57 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2b7e2424-0dfb-451d-7d96-3360feb8a4f0", - "x-ms-request-id": "dab9e038-201a-0049-7dbd-01fdec000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "ed6eb052-7ed3-4483-7e91-4d174e56a8ca", + "x-ms-request-id": "d26c20d8-f01a-0038-80f7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "da3f4452-8193-48f0-669a-08ecdb9f344d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "05aa7308-b7fa-44b0-7352-2b0f51dc87ae", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -400,19 +650,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:57 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "da3f4452-8193-48f0-669a-08ecdb9f344d", - "x-ms-request-id": "dab9e03a-201a-0049-7ebd-01fdec000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "05aa7308-b7fa-44b0-7352-2b0f51dc87ae", + "x-ms-request-id": "d26c20e1-f01a-0038-08f7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b92c23ea-67ba-4561-5c2a-7c92aa913e01", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ccb7eb73-e439-49e7-4b7f-4405d6b6eda2", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -420,11 +670,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:58 GMT", + "date": "Fri, 12 Aug 2022 03:01:57 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b92c23ea-67ba-4561-5c2a-7c92aa913e01", - "x-ms-request-id": "dab9e03b-201a-0049-7fbd-01fdec000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "ccb7eb73-e439-49e7-4b7f-4405d6b6eda2", + "x-ms-request-id": "d26c20e6-f01a-0038-0df7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestrangeuploaddownload?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.SmbPropertiesDefaultValue.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.SmbPropertiesDefaultValue.json index 00c9e6a103..dc723cb2d7 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.SmbPropertiesDefaultValue.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.SmbPropertiesDefaultValue.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "63156db3-ab98-4dae-5df0-4282116bdf5e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5558b3cc-25de-4be3-6beb-ed132d01383c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4ABE89CCB\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:43 GMT", + "etag": "\"0x8DA7C0EFCC5D842\"", + "last-modified": "Fri, 12 Aug 2022 03:01:43 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "63156db3-ab98-4dae-5df0-4282116bdf5e", - "x-ms-request-id": "6986a669-e01a-0024-12bd-0149a7000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "5558b3cc-25de-4be3-6beb-ed132d01383c", + "x-ms-request-id": "5a2c5658-d01a-005d-64f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d826f34d-7f6c-4c6d-4e16-6eecd56cc8f2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "bdb642d6-0255-4937-6280-e9a94ef42dbb", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4ABEC5DBE\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:43 GMT", + "etag": "\"0x8DA7C0EFCF32697\"", + "last-modified": "Fri, 12 Aug 2022 03:01:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d826f34d-7f6c-4c6d-4e16-6eecd56cc8f2", + "x-ms-client-request-id": "bdb642d6-0255-4937-6280-e9a94ef42dbb", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:50:57.4046654Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.4046654Z", + "x-ms-file-change-time": "2022-08-12T03:01:44.1526423Z", + "x-ms-file-creation-time": "2022-08-12T03:01:44.1526423Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.4046654Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:44.1526423Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "6986a66c-e01a-0024-13bd-0149a7000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "5a2c565a-d01a-005d-65f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValuebase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "defb942a-3a7f-46bd-6cd4-ba560b87e05e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "98a4f22b-1a36-46c5-779f-85259a1d805f", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4ABEE8050\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:44 GMT", + "etag": "\"0x8DA7C0EFD202381\"", + "last-modified": "Fri, 12 Aug 2022 03:01:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "defb942a-3a7f-46bd-6cd4-ba560b87e05e", + "x-ms-client-request-id": "98a4f22b-1a36-46c5-779f-85259a1d805f", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.4186576Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.4186576Z", + "x-ms-file-change-time": "2022-08-12T03:01:44.4474753Z", + "x-ms-file-creation-time": "2022-08-12T03:01:44.4474753Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.4186576Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:44.4474753Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "6986a66d-e01a-0024-14bd-0149a7000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c565b-d01a-005d-66f7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValuebase/SmbPropertiesDefaultValuebasefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0bb15c8b-f08f-4c05-522f-f093a106edd4", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cb256d8c-fc17-4667-413d-02cded0adb70", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4ABF054CA\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:44 GMT", + "etag": "\"0x8DA7C0EFD4D2069\"", + "last-modified": "Fri, 12 Aug 2022 03:01:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0bb15c8b-f08f-4c05-522f-f093a106edd4", + "x-ms-client-request-id": "cb256d8c-fc17-4667-413d-02cded0adb70", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.4306506Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-change-time": "2022-08-12T03:01:44.7423081Z", + "x-ms-file-creation-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "6986a66e-e01a-0024-15bd-0149a7000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5661-d01a-005d-6af7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "aef88de9-f709-4f81-4235-1551e5fc6699", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "afde4e7c-2098-41a1-5140-9fb939927d4c", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -125,32 +125,32 @@ "STATUS_CODE": "200", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4ABF054CA\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:44 GMT", + "etag": "\"0x8DA7C0EFD4D2069\"", + "last-modified": "Fri, 12 Aug 2022 03:01:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "aef88de9-f709-4f81-4235-1551e5fc6699", + "x-ms-client-request-id": "afde4e7c-2098-41a1-5140-9fb939927d4c", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.4306506Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-change-time": "2022-08-12T03:01:44.7423081Z", + "x-ms-file-creation-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "6986a66f-e01a-0024-16bd-0149a7000000", + "x-ms-request-id": "5a2c5662-d01a-005d-6bf7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "29f5faa2-746a-4aa3-6f9d-d782405b39f4", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8a963703-59c5-4330-60c8-44d544ca8a64", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -158,29 +158,29 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4ABF388A1\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:44 GMT", + "etag": "\"0x8DA7C0EFDA56CC4\"", + "last-modified": "Fri, 12 Aug 2022 03:01:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "29f5faa2-746a-4aa3-6f9d-d782405b39f4", + "x-ms-client-request-id": "8a963703-59c5-4330-60c8-44d544ca8a64", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.4516385Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-change-time": "2022-08-12T03:01:45.3209796Z", + "x-ms-file-creation-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "6986a670-e01a-0024-17bd-0149a7000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "5a2c5663-d01a-005d-6cf7-ad6422000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue?comp=properties" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "489544d1-c4e3-4405-64d9-89712beec2df", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9f53097a-8abf-4473-45a2-32cc82868b7e", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -188,32 +188,32 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-length": "1024", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", - "etag": "\"0x8D9CFD4ABF388A1\"", - "last-modified": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:45 GMT", + "etag": "\"0x8DA7C0EFDA56CC4\"", + "last-modified": "Fri, 12 Aug 2022 03:01:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "489544d1-c4e3-4405-64d9-89712beec2df", + "x-ms-client-request-id": "9f53097a-8abf-4473-45a2-32cc82868b7e", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:50:57.4516385Z", - "x-ms-file-creation-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-change-time": "2022-08-12T03:01:45.3209796Z", + "x-ms-file-creation-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:50:57.4306506Z", + "x-ms-file-last-write-time": "2022-08-12T03:01:44.7423081Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "6986a671-e01a-0024-18bd-0149a7000000", + "x-ms-request-id": "5a2c5666-d01a-005d-6df7-ad6422000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue/SmbPropertiesDefaultValue" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "59445ff3-e22f-434f-7310-12e5b83fd748", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8dbd240f-cac1-486e-76a5-d31418fc72d0", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -221,19 +221,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "59445ff3-e22f-434f-7310-12e5b83fd748", - "x-ms-request-id": "6986a672-e01a-0024-19bd-0149a7000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "8dbd240f-cac1-486e-76a5-d31418fc72d0", + "x-ms-request-id": "5a2c5668-d01a-005d-6ef7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "746fec30-6599-4f1a-58bb-7fd24be1d76c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2e8f3361-df5e-4b6c-457b-2a74d4d39830", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -241,19 +241,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "746fec30-6599-4f1a-58bb-7fd24be1d76c", - "x-ms-request-id": "6986a673-e01a-0024-1abd-0149a7000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "2e8f3361-df5e-4b6c-457b-2a74d4d39830", + "x-ms-request-id": "5a2c5669-d01a-005d-6ff7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "674b387a-890c-41d0-5616-61aa0b62c22e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "784e9031-4580-4b2d-54c0-2cb11a2b5287", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -261,11 +261,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:50:57 GMT", + "date": "Fri, 12 Aug 2022 03:01:46 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "674b387a-890c-41d0-5616-61aa0b62c22e", - "x-ms-request-id": "6986a674-e01a-0024-1bbd-0149a7000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "784e9031-4580-4b2d-54c0-2cb11a2b5287", + "x-ms-request-id": "5a2c566a-d01a-005d-70f7-ad6422000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestsmbpropertiesdefaultvalue?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.UploadRangeFromUri.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.UploadRangeFromUri.json index 1f0c1d8ea7..500bb2c013 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.UploadRangeFromUri.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/FileShareFileClientTest.UploadRangeFromUri.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b7f7ce51-4e89-4cac-4dd3-6e3ca76c7325", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9267e419-c37e-4b6f-4197-007d9e9d0cfa", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE4AC892\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:01 GMT", + "etag": "\"0x8DA7C0F0776B4E9\"", + "last-modified": "Fri, 12 Aug 2022 03:02:01 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b7f7ce51-4e89-4cac-4dd3-6e3ca76c7325", - "x-ms-request-id": "2eb26875-c01a-006e-22bd-01ea28000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "9267e419-c37e-4b6f-4197-007d9e9d0cfa", + "x-ms-request-id": "d26c210a-f01a-0038-2cf7-adca66000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "59d796df-0ebe-4736-72d5-797210a700ff", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b387f0ec-e732-401b-6826-8e911fcfe798", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE4EAD0C\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:01 GMT", + "etag": "\"0x8DA7C0F07A501C6\"", + "last-modified": "Fri, 12 Aug 2022 03:02:02 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "59d796df-0ebe-4736-72d5-797210a700ff", + "x-ms-client-request-id": "b387f0ec-e732-401b-6826-8e911fcfe798", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-04T22:51:01.4043916Z", - "x-ms-file-creation-time": "2022-01-04T22:51:01.4043916Z", + "x-ms-file-change-time": "2022-08-12T03:02:02.0954566Z", + "x-ms-file-creation-time": "2022-08-12T03:02:02.0954566Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-04T22:51:01.4043916Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:02.0954566Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "2eb26878-c01a-006e-23bd-01ea28000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "d26c2119-f01a-0038-2ef7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUribase?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "35b1f8b0-dab8-4de1-44b2-90f7ca658233", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8318d8cc-b640-48d0-5f44-a0ddc9772e33", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE5192C9\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:02 GMT", + "etag": "\"0x8DA7C0F07D24CB9\"", + "last-modified": "Fri, 12 Aug 2022 03:02:02 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "35b1f8b0-dab8-4de1-44b2-90f7ca658233", + "x-ms-client-request-id": "8318d8cc-b640-48d0-5f44-a0ddc9772e33", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:51:01.4233801Z", - "x-ms-file-creation-time": "2022-01-04T22:51:01.4233801Z", + "x-ms-file-change-time": "2022-08-12T03:02:02.3922873Z", + "x-ms-file-creation-time": "2022-08-12T03:02:02.3922873Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-04T22:51:01.4233801Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:02.3922873Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "2eb26879-c01a-006e-24bd-01ea28000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "d26c211a-f01a-0038-2ff7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUribase/UploadRangeFromUribasefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3d949c79-97cb-401c-5816-e866f77910c0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fe15e798-6e42-4b9e-688a-4399353dccd5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE53DC65\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:02 GMT", + "etag": "\"0x8DA7C0F07FF49A3\"", + "last-modified": "Fri, 12 Aug 2022 03:02:02 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3d949c79-97cb-401c-5816-e866f77910c0", + "x-ms-client-request-id": "fe15e798-6e42-4b9e-688a-4399353dccd5", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:51:01.4383717Z", - "x-ms-file-creation-time": "2022-01-04T22:51:01.4383717Z", + "x-ms-file-change-time": "2022-08-12T03:02:02.6871203Z", + "x-ms-file-creation-time": "2022-08-12T03:02:02.6871203Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-04T22:51:01.4383717Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:02.6871203Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "2eb2687a-c01a-006e-25bd-01ea28000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "d26c211c-f01a-0038-31f7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrifile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b35b955c-b43e-433f-7844-e6f5cef5d4b8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a560311d-14cf-40c2-6fba-e208f436b0ec", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE5D29D9\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:04 GMT", + "etag": "\"0x8DA7C0F09098E0C\"", + "last-modified": "Fri, 12 Aug 2022 03:02:04 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b35b955c-b43e-433f-7844-e6f5cef5d4b8", - "x-ms-request-id": "2eb2687b-c01a-006e-26bd-01ea28000000", + "x-ms-client-request-id": "a560311d-14cf-40c2-6fba-e208f436b0ec", + "x-ms-file-last-write-time": "2022-08-12T03:02:04.4321292Z", + "x-ms-request-id": "d26c2120-f01a-0038-35f7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrifile?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5c7211ab-0fe5-4090-79a2-877285d3430f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b2e49716-7f74-4205-5c86-3b56797d0cf5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -148,29 +149,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE6084BD\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:04 GMT", + "etag": "\"0x8DA7C0F0936B1F8\"", + "last-modified": "Fri, 12 Aug 2022 03:02:04 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5c7211ab-0fe5-4090-79a2-877285d3430f", + "x-ms-client-request-id": "b2e49716-7f74-4205-5c86-3b56797d0cf5", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:51:01.5213245Z", - "x-ms-file-creation-time": "2022-01-04T22:51:01.5213245Z", + "x-ms-file-change-time": "2022-08-12T03:02:04.7279608Z", + "x-ms-file-creation-time": "2022-08-12T03:02:04.7279608Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:51:01.5213245Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:04.7279608Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "2eb2687c-c01a-006e-27bd-01ea28000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "d26c212c-f01a-0038-3ff7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c21d586b-521b-41a1-54dc-ffe64391a680", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3b3f4fe6-ec1b-441e-4dcf-4f2123d9eece", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -178,23 +179,24 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE7DF385\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:04 GMT", + "etag": "\"0x8DA7C0F096E34AF\"", + "last-modified": "Fri, 12 Aug 2022 03:02:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c21d586b-521b-41a1-54dc-ffe64391a680", + "x-ms-client-request-id": "3b3f4fe6-ec1b-441e-4dcf-4f2123d9eece", "x-ms-content-crc64": "EC00phK3Kqg=", - "x-ms-request-id": "2eb2687d-c01a-006e-28bd-01ea28000000", + "x-ms-file-last-write-time": "2022-08-12T03:02:05.0917551Z", + "x-ms-request-id": "d26c212e-f01a-0038-41f7-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "edced076-63fe-489d-68ef-1e3b95fa1cf2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ce23fe69-195d-45a9-6121-c23d76997964", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -205,32 +207,32 @@ "content-length": "1048576", "content-range": "bytes 1048576-2097151/4194304", "content-type": "application/octet-stream", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE7DF385\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:05 GMT", + "etag": "\"0x8DA7C0F096E34AF\"", + "last-modified": "Fri, 12 Aug 2022 03:02:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "edced076-63fe-489d-68ef-1e3b95fa1cf2", + "x-ms-client-request-id": "ce23fe69-195d-45a9-6121-c23d76997964", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-04T22:51:01.5213245Z", - "x-ms-file-creation-time": "2022-01-04T22:51:01.5213245Z", + "x-ms-file-change-time": "2022-08-12T03:02:05.0917551Z", + "x-ms-file-creation-time": "2022-08-12T03:02:04.7279608Z", "x-ms-file-id": "10376363910205800448", - "x-ms-file-last-write-time": "2022-01-04T22:51:01.5213245Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:05.0917551Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "2eb2687e-c01a-006e-29bd-01ea28000000", + "x-ms-request-id": "d26c212f-f01a-0038-42f7-adca66000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "9a4746bb-089a-4c62-7005-4a87e1ab44dd", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fd9b24c7-001c-49d3-5f3c-ea89fc2eca25", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -238,45 +240,231 @@ "REASON_PHRASE": "OK", "STATUS_CODE": "200", "content-type": "application/xml", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AE7DF385\"", - "last-modified": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:07 GMT", + "etag": "\"0x8DA7C0F096E34AF\"", + "last-modified": "Fri, 12 Aug 2022 03:02:05 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "9a4746bb-089a-4c62-7005-4a87e1ab44dd", + "x-ms-client-request-id": "fd9b24c7-001c-49d3-5f3c-ea89fc2eca25", "x-ms-content-length": "4194304", - "x-ms-request-id": "688e7a4b-a01a-0035-69bd-01d313000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "195a699b-501a-0098-4ef7-ad4ec7000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2?comp=rangelist" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "262372f1-c3c5-4db9-4093-c09ef1c69e60", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "664367fd-871b-42ed-5dae-7adfa89a9e29", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "4194304", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:02:07 GMT", + "etag": "\"0x8DA7C0F096E34AF\"", + "last-modified": "Fri, 12 Aug 2022 03:02:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "664367fd-871b-42ed-5dae-7adfa89a9e29", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:02:05.0917551Z", + "x-ms-file-creation-time": "2022-08-12T03:02:04.7279608Z", + "x-ms-file-id": "10376363910205800448", + "x-ms-file-last-write-time": "2022-08-12T03:02:05.0917551Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "195a69b1-501a-0098-4ff7-ad4ec7000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "662f669e-17a3-4518-6606-878b8613ca2d", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Fri, 12 Aug 2022 03:02:08 GMT", + "etag": "\"0x8DA7C0F0B916164\"", + "last-modified": "Fri, 12 Aug 2022 03:02:08 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "662f669e-17a3-4518-6606-878b8613ca2d", + "x-ms-content-crc64": "EC00phK3Kqg=", + "x-ms-file-last-write-time": "2022-08-12T03:02:08.6777188Z", + "x-ms-request-id": "195a69b2-501a-0098-50f7-ad4ec7000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2?comp=range" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8734643d-2dc0-4666-6474-4011ad073cdf", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "4194304", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:02:08 GMT", + "etag": "\"0x8DA7C0F0B916164\"", + "last-modified": "Fri, 12 Aug 2022 03:02:08 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8734643d-2dc0-4666-6474-4011ad073cdf", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:02:08.6777188Z", + "x-ms-file-creation-time": "2022-08-12T03:02:04.7279608Z", + "x-ms-file-id": "10376363910205800448", + "x-ms-file-last-write-time": "2022-08-12T03:02:08.6777188Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "195a69b4-501a-0098-51f7-ad4ec7000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2b2f81fb-e70b-496f-535f-d3974ccafff7", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "4194304", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:02:08 GMT", + "etag": "\"0x8DA7C0F0B916164\"", + "last-modified": "Fri, 12 Aug 2022 03:02:08 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "2b2f81fb-e70b-496f-535f-d3974ccafff7", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:02:08.6777188Z", + "x-ms-file-creation-time": "2022-08-12T03:02:04.7279608Z", + "x-ms-file-id": "10376363910205800448", + "x-ms-file-last-write-time": "2022-08-12T03:02:08.6777188Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "195a69b5-501a-0098-52f7-ad4ec7000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fdec4b96-246b-4f31-4ccf-cfc8164f0a10", + "x-ms-version": "2021-06-08" + }, + "Method": "PUT", + "Response": { + "BODY": "", + "REASON_PHRASE": "Created", + "STATUS_CODE": "201", + "content-length": "0", + "date": "Fri, 12 Aug 2022 03:02:09 GMT", + "etag": "\"0x8DA7C0F0C1CC441\"", + "last-modified": "Fri, 12 Aug 2022 03:02:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "fdec4b96-246b-4f31-4ccf-cfc8164f0a10", + "x-ms-content-crc64": "EC00phK3Kqg=", + "x-ms-file-last-write-time": "2022-08-12T03:02:08.6777188Z", + "x-ms-request-id": "195a69b6-501a-0098-53f7-ad4ec7000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2?comp=range" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c5d159b2-48d6-45ca-538c-4f3b2812477d", + "x-ms-version": "2021-06-08" + }, + "Method": "HEAD", + "Response": { + "BODY": "", + "REASON_PHRASE": "OK", + "STATUS_CODE": "200", + "content-length": "4194304", + "content-type": "application/octet-stream", + "date": "Fri, 12 Aug 2022 03:02:09 GMT", + "etag": "\"0x8DA7C0F0C1CC441\"", + "last-modified": "Fri, 12 Aug 2022 03:02:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c5d159b2-48d6-45ca-538c-4f3b2812477d", + "x-ms-file-attributes": "Archive", + "x-ms-file-change-time": "2022-08-12T03:02:09.5912001Z", + "x-ms-file-creation-time": "2022-08-12T03:02:04.7279608Z", + "x-ms-file-id": "10376363910205800448", + "x-ms-file-last-write-time": "2022-08-12T03:02:08.6777188Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "195a69b7-501a-0098-54f7-ad4ec7000000", + "x-ms-server-encrypted": "true", + "x-ms-type": "File", + "x-ms-version": "2021-06-08" + }, + "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2" + }, + { + "Headers": { + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "183d1daf-218d-471d-4b2d-86e27829e847", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { - "BODY": "Crc64ConditionNotMetThe Crc64 condition specified was not met.\nRequestId:688e7a4e-a01a-0035-6abd-01d313000000\nTime:2022-01-04T22:51:02.0382896ZEC00phK3Kqg=EC00phK3Kqg=", + "BODY": "Crc64ConditionNotMetThe Crc64 condition specified was not met.\nRequestId:195a69ba-501a-0098-56f7-ad4ec7000000\nTime:2022-08-12T03:02:10.2067180ZEC00phK3Kqg=EC00phK3Kqg=", "REASON_PHRASE": "The Crc64 condition specified was not met.", "STATUS_CODE": "412", "content-length": "335", "content-type": "application/xml", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", + "date": "Fri, 12 Aug 2022 03:02:09 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "262372f1-c3c5-4db9-4093-c09ef1c69e60", + "x-ms-client-request-id": "183d1daf-218d-471d-4b2d-86e27829e847", "x-ms-error-code": "Crc64ConditionNotMet", - "x-ms-request-id": "688e7a4e-a01a-0035-6abd-01d313000000", - "x-ms-version": "2020-02-10" + "x-ms-request-id": "195a69ba-501a-0098-56f7-ad4ec7000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e7534c60-f67d-4f7c-4026-79566e2f0b1a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e59fa33a-3244-4536-579a-5a729c1f9a1e", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -284,23 +472,24 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AECFFF31\"", - "last-modified": "Tue, 04 Jan 2022 22:51:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:11 GMT", + "etag": "\"0x8DA7C0F0D4958C6\"", + "last-modified": "Fri, 12 Aug 2022 03:02:11 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e7534c60-f67d-4f7c-4026-79566e2f0b1a", + "x-ms-client-request-id": "e59fa33a-3244-4536-579a-5a729c1f9a1e", "x-ms-content-crc64": "EC00phK3Kqg=", - "x-ms-request-id": "5084a416-301a-0037-69bd-016dab000000", + "x-ms-file-last-write-time": "2022-08-12T03:02:11.5610822Z", + "x-ms-request-id": "9ae87a6a-d01a-0062-68f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ad5c8dab-fce7-41f1-4bf1-92a0a7acc33a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a7f14d4d-3d51-4546-6629-4843b707f93e", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -308,23 +497,24 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:01 GMT", - "etag": "\"0x8D9CFD4AED7C645\"", - "last-modified": "Tue, 04 Jan 2022 22:51:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:11 GMT", + "etag": "\"0x8DA7C0F0D7B0FEE\"", + "last-modified": "Fri, 12 Aug 2022 03:02:11 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ad5c8dab-fce7-41f1-4bf1-92a0a7acc33a", + "x-ms-client-request-id": "a7f14d4d-3d51-4546-6629-4843b707f93e", "x-ms-content-crc64": "EC00phK3Kqg=", - "x-ms-request-id": "5084a41a-301a-0037-6abd-016dab000000", + "x-ms-file-last-write-time": "2022-08-12T03:02:11.8868974Z", + "x-ms-request-id": "9ae87a6f-d01a-0062-69f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri/UploadRangeFromUrif2?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8be13c09-1bdf-4323-62d7-20440b54a07a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "044be96f-ee19-4b3b-5032-1b929c7370cc", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -332,19 +522,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:11 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8be13c09-1bdf-4323-62d7-20440b54a07a", - "x-ms-request-id": "2eb2687f-c01a-006e-2abd-01ea28000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "044be96f-ee19-4b3b-5032-1b929c7370cc", + "x-ms-request-id": "9ae87a70-d01a-0062-6af7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "454e7895-ed8d-49e5-44c0-7565ff8c65b7", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6e95eca0-036b-4f36-5a84-11649f31c623", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -352,19 +542,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:12 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "454e7895-ed8d-49e5-44c0-7565ff8c65b7", - "x-ms-request-id": "2eb26880-c01a-006e-2bbd-01ea28000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "6e95eca0-036b-4f36-5a84-11649f31c623", + "x-ms-request-id": "9ae87a71-d01a-0062-6bf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "27a1edf2-c0b3-4f45-58df-22913bb4126d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "83f8a9f8-3d16-4dd1-6349-6be413d31c5c", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -372,11 +562,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Tue, 04 Jan 2022 22:51:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:12 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "27a1edf2-c0b3-4f45-58df-22913bb4126d", - "x-ms-request-id": "2eb26881-c01a-006e-2cbd-01ea28000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "83f8a9f8-3d16-4dd1-6349-6be413d31c5c", + "x-ms-request-id": "9ae87a72-d01a-0062-6cf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/filesharefileclienttestuploadrangefromuri?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s0.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s0.json index 5ca0ffbc3f..e622a6ded5 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s0.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s0.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "cf9dc664-2f9f-403a-41c7-e0fa0351d240", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d01de74f-4d3c-4042-6aa8-9bf5d052e2fa", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A58B330\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:12 GMT", + "etag": "\"0x8DA7C0F0E3380FE\"", + "last-modified": "Fri, 12 Aug 2022 03:02:13 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "cf9dc664-2f9f-403a-41c7-e0fa0351d240", - "x-ms-request-id": "727bb980-801a-0022-6e6a-027a18000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d01de74f-4d3c-4042-6aa8-9bf5d052e2fa", + "x-ms-request-id": "9ae87a73-d01a-0062-6df7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "da606b63-a877-48fa-5f01-3f8dfa359a1b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "cf7ddcb3-626e-40f4-5e39-aa2243123d73", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A5C7EC0\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:13 GMT", + "etag": "\"0x8DA7C0F0E606C93\"", + "last-modified": "Fri, 12 Aug 2022 03:02:13 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "da606b63-a877-48fa-5f01-3f8dfa359a1b", + "x-ms-client-request-id": "cf7ddcb3-626e-40f4-5e39-aa2243123d73", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:03.5005632Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.5005632Z", + "x-ms-file-change-time": "2022-08-12T03:02:13.3900435Z", + "x-ms-file-creation-time": "2022-08-12T03:02:13.3900435Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.5005632Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:13.3900435Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "727bb983-801a-0022-6f6a-027a18000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87a75-d01a-0062-6ef7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0/fromBuffer-c1s0base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "fa21baac-5f9b-4136-6dee-149c63e2fd85", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "75830fca-7ca0-45de-5767-9bc5a2a79c1d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A5F8B8B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:13 GMT", + "etag": "\"0x8DA7C0F0E8E059E\"", + "last-modified": "Fri, 12 Aug 2022 03:02:13 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "fa21baac-5f9b-4136-6dee-149c63e2fd85", + "x-ms-client-request-id": "75830fca-7ca0-45de-5767-9bc5a2a79c1d", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.5205515Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.5205515Z", + "x-ms-file-change-time": "2022-08-12T03:02:13.6888734Z", + "x-ms-file-creation-time": "2022-08-12T03:02:13.6888734Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.5205515Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:13.6888734Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "727bb985-801a-0022-706a-027a18000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87a76-d01a-0062-6ff7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0/fromBuffer-c1s0base/fromBuffer-c1s0basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c11b1e94-d5d8-4781-7b71-2541232c5601", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1dc1c997-e141-41f3-6a98-c70e8e984d24", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A61D523\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:13 GMT", + "etag": "\"0x8DA7C0F0EBBECC0\"", + "last-modified": "Fri, 12 Aug 2022 03:02:13 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c11b1e94-d5d8-4781-7b71-2541232c5601", + "x-ms-client-request-id": "1dc1c997-e141-41f3-6a98-c70e8e984d24", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.5355427Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.5355427Z", + "x-ms-file-change-time": "2022-08-12T03:02:13.9897024Z", + "x-ms-file-creation-time": "2022-08-12T03:02:13.9897024Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.5355427Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:13.9897024Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "727bb986-801a-0022-716a-027a18000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87a79-d01a-0062-70f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0/fromBuffer-c1s0base/fromBuffer-c1s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5f3c1269-9dbc-4f40-558a-6d1b5156f3a2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a158ed0d-1824-40fc-640b-04a95a7fe927", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -129,18 +129,18 @@ "content-language": "en-US", "content-length": "0", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A61D523\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:14 GMT", + "etag": "\"0x8DA7C0F0EBBECC0\"", + "last-modified": "Fri, 12 Aug 2022 03:02:13 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5f3c1269-9dbc-4f40-558a-6d1b5156f3a2", + "x-ms-client-request-id": "a158ed0d-1824-40fc-640b-04a95a7fe927", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.5355427Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.5355427Z", + "x-ms-file-change-time": "2022-08-12T03:02:13.9897024Z", + "x-ms-file-creation-time": "2022-08-12T03:02:13.9897024Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.5355427Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:13.9897024Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -148,18 +148,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "727bb987-801a-0022-726a-027a18000000", + "x-ms-request-id": "9ae87a80-d01a-0062-77f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0/fromBuffer-c1s0base/fromBuffer-c1s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f18338c6-b26d-4785-401a-05610e91c964", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "bd7c7f44-4af6-4453-6559-a434903b5edc", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -173,18 +173,18 @@ "content-language": "en-US", "content-length": "0", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A61D523\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:14 GMT", + "etag": "\"0x8DA7C0F0EBBECC0\"", + "last-modified": "Fri, 12 Aug 2022 03:02:13 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f18338c6-b26d-4785-401a-05610e91c964", + "x-ms-client-request-id": "bd7c7f44-4af6-4453-6559-a434903b5edc", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.5355427Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.5355427Z", + "x-ms-file-change-time": "2022-08-12T03:02:13.9897024Z", + "x-ms-file-creation-time": "2022-08-12T03:02:13.9897024Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.5355427Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:13.9897024Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -192,18 +192,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "727bb988-801a-0022-736a-027a18000000", + "x-ms-request-id": "9ae87a81-d01a-0062-78f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0/fromBuffer-c1s0base/fromBuffer-c1s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6f8f5adb-499e-407c-5885-d18da740e687", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c1079cf2-05a5-4c3e-4afd-2737064b7efc", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -211,19 +211,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6f8f5adb-499e-407c-5885-d18da740e687", - "x-ms-request-id": "727bb989-801a-0022-746a-027a18000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "c1079cf2-05a5-4c3e-4afd-2737064b7efc", + "x-ms-request-id": "9ae87a82-d01a-0062-79f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "411ebf03-c75a-4c90-615c-bfb7a4f7bbf8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "15b0b3fd-1368-4a38-4c7f-64b16e6dd043", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -231,19 +231,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "411ebf03-c75a-4c90-615c-bfb7a4f7bbf8", - "x-ms-request-id": "727bb98a-801a-0022-756a-027a18000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "15b0b3fd-1368-4a38-4c7f-64b16e6dd043", + "x-ms-request-id": "9ae87a83-d01a-0062-7af7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2b9a31fd-b30e-4d13-4227-80aba7d52c57", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5ee0a203-feab-417d-65ea-b3d41d89efcf", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -251,11 +251,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:15 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2b9a31fd-b30e-4d13-4227-80aba7d52c57", - "x-ms-request-id": "727bb98b-801a-0022-766a-027a18000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "5ee0a203-feab-417d-65ea-b3d41d89efcf", + "x-ms-request-id": "9ae87a86-d01a-0062-7df7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s0?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1024.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1024.json index 3e6eaeaf91..c59e554614 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1024.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1024.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b8082e40-71d2-4041-7a54-d708b7f5c612", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "37a2515d-70a7-4faa-6bcf-66a0ba160f03", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815A9180D1\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:18 GMT", + "etag": "\"0x8DA7C0F119453E5\"", + "last-modified": "Fri, 12 Aug 2022 03:02:18 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b8082e40-71d2-4041-7a54-d708b7f5c612", - "x-ms-request-id": "18216c91-a01a-001a-286a-02ded8000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "37a2515d-70a7-4faa-6bcf-66a0ba160f03", + "x-ms-request-id": "9ae87aba-d01a-0062-0df7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a22d18fb-2742-4365-6234-aaba8c2d2322", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "be8a3009-207b-48a7-6ffd-32a46a711860", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815A9512A1\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:18 GMT", + "etag": "\"0x8DA7C0F11C27A9F\"", + "last-modified": "Fri, 12 Aug 2022 03:02:19 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a22d18fb-2742-4365-6234-aaba8c2d2322", + "x-ms-client-request-id": "be8a3009-207b-48a7-6ffd-32a46a711860", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:03.8713505Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.8713505Z", + "x-ms-file-change-time": "2022-08-12T03:02:19.0658207Z", + "x-ms-file-creation-time": "2022-08-12T03:02:19.0658207Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.8713505Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:19.0658207Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "18216c94-a01a-001a-296a-02ded8000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87ac0-d01a-0062-0ef7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024/fromBuffer-c1s1024base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c08efcdf-f834-4ab0-5810-884c66195fff", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0ecee979-fb20-4496-736d-604f733d858e", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815A975C39\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:19 GMT", + "etag": "\"0x8DA7C0F11F03ABC\"", + "last-modified": "Fri, 12 Aug 2022 03:02:19 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c08efcdf-f834-4ab0-5810-884c66195fff", + "x-ms-client-request-id": "0ecee979-fb20-4496-736d-604f733d858e", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.8863417Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.8863417Z", + "x-ms-file-change-time": "2022-08-12T03:02:19.3656508Z", + "x-ms-file-creation-time": "2022-08-12T03:02:19.3656508Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.8863417Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:19.3656508Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "18216c96-a01a-001a-2a6a-02ded8000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87ac1-d01a-0062-0ff7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024/fromBuffer-c1s1024base/fromBuffer-c1s1024basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "226f9692-0d63-4ac4-4ee5-ac82ed858276", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f140e749-870f-4992-7553-c60ba6d982c7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815A997EC9\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:19 GMT", + "etag": "\"0x8DA7C0F121D379E\"", + "last-modified": "Fri, 12 Aug 2022 03:02:19 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "226f9692-0d63-4ac4-4ee5-ac82ed858276", + "x-ms-client-request-id": "f140e749-870f-4992-7553-c60ba6d982c7", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.9003337Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.9003337Z", + "x-ms-file-change-time": "2022-08-12T03:02:19.6604830Z", + "x-ms-file-creation-time": "2022-08-12T03:02:19.6604830Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.9003337Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:19.6604830Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "18216c97-a01a-001a-2b6a-02ded8000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87ac2-d01a-0062-10f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024/fromBuffer-c1s1024base/fromBuffer-c1s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c2648fc0-ad1e-4d50-7bbd-af9d4c948438", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3bbb747c-208e-482d-7773-b498009142fb", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "cmX00hG1aHOjgdMh9YbkqQ==", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815A9C6490\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:19 GMT", + "etag": "\"0x8DA7C0F124AD0A7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:19 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c2648fc0-ad1e-4d50-7bbd-af9d4c948438", - "x-ms-request-id": "18216c98-a01a-001a-2c6a-02ded8000000", + "x-ms-client-request-id": "3bbb747c-208e-482d-7773-b498009142fb", + "x-ms-file-last-write-time": "2022-08-12T03:02:19.9593127Z", + "x-ms-request-id": "9ae87ac8-d01a-0062-15f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024/fromBuffer-c1s1024base/fromBuffer-c1s1024?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e9b06a69-d28c-4e8d-5c9a-76588521b22b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a7798851-b408-4944-5759-55a5314b50c5", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815A9C6490\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:20 GMT", + "etag": "\"0x8DA7C0F124AD0A7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:19 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e9b06a69-d28c-4e8d-5c9a-76588521b22b", + "x-ms-client-request-id": "a7798851-b408-4944-5759-55a5314b50c5", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.9003337Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.9003337Z", + "x-ms-file-change-time": "2022-08-12T03:02:19.9593127Z", + "x-ms-file-creation-time": "2022-08-12T03:02:19.6604830Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.9003337Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:19.9593127Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "18216c99-a01a-001a-2d6a-02ded8000000", + "x-ms-request-id": "9ae87ac9-d01a-0062-16f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024/fromBuffer-c1s1024base/fromBuffer-c1s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ac470ce6-9674-46c1-7833-c79d43eb1462", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "38eb3e98-9f19-4fa0-4ae2-527d1e154dd8", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815A9C6490\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:20 GMT", + "etag": "\"0x8DA7C0F124AD0A7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:19 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ac470ce6-9674-46c1-7833-c79d43eb1462", + "x-ms-client-request-id": "38eb3e98-9f19-4fa0-4ae2-527d1e154dd8", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.9003337Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.9003337Z", + "x-ms-file-change-time": "2022-08-12T03:02:19.9593127Z", + "x-ms-file-creation-time": "2022-08-12T03:02:19.6604830Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.9003337Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:19.9593127Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "18216c9a-a01a-001a-2e6a-02ded8000000", + "x-ms-request-id": "9ae87acc-d01a-0062-19f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024/fromBuffer-c1s1024base/fromBuffer-c1s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f9aed91b-3e29-4224-78ab-b696c3763535", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "49f66b6b-9efe-459e-52d1-e7203c184184", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:20 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f9aed91b-3e29-4224-78ab-b696c3763535", - "x-ms-request-id": "18216c9b-a01a-001a-2f6a-02ded8000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "49f66b6b-9efe-459e-52d1-e7203c184184", + "x-ms-request-id": "9ae87acd-d01a-0062-1af7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "10f5e976-3514-46c6-58d2-f56852b99e6d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fb8ed44d-7e93-4a52-5ea8-ad0c7f814714", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:20 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "10f5e976-3514-46c6-58d2-f56852b99e6d", - "x-ms-request-id": "18216c9c-a01a-001a-306a-02ded8000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "fb8ed44d-7e93-4a52-5ea8-ad0c7f814714", + "x-ms-request-id": "9ae87ace-d01a-0062-1bf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "125cc220-833f-4c25-6822-8f4e91374ee0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0179624b-3de7-480c-4c04-6ae8b5f5f1b8", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:21 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "125cc220-833f-4c25-6822-8f4e91374ee0", - "x-ms-request-id": "18216c9d-a01a-001a-316a-02ded8000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "0179624b-3de7-480c-4c04-6ae8b5f5f1b8", + "x-ms-request-id": "9ae87ad2-d01a-0062-1ef7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1024?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1048576.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1048576.json index b0e4328588..42634e6238 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1048576.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s1048576.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ad0ab46c-d833-4ef9-6b53-aecf238ed3dd", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "63961b4c-28ef-43cb-762e-424c51b2d0dc", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AD6E1AC\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:24 GMT", + "etag": "\"0x8DA7C0F1521AE7F\"", + "last-modified": "Fri, 12 Aug 2022 03:02:24 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ad0ab46c-d833-4ef9-6b53-aecf238ed3dd", - "x-ms-request-id": "ca4a57c4-901a-0063-236a-0222fc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "63961b4c-28ef-43cb-762e-424c51b2d0dc", + "x-ms-request-id": "9ae87aea-d01a-0062-30f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bc7e5bf8-e00b-4de0-5078-5c6da9e434e3", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "30068ca9-4fa1-402e-4c30-9bfb07db8bb6", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815ADA9CF1\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:24 GMT", + "etag": "\"0x8DA7C0F154F62F9\"", + "last-modified": "Fri, 12 Aug 2022 03:02:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bc7e5bf8-e00b-4de0-5078-5c6da9e434e3", + "x-ms-client-request-id": "30068ca9-4fa1-402e-4c30-9bfb07db8bb6", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:04.3270897Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.3270897Z", + "x-ms-file-change-time": "2022-08-12T03:02:25.0224377Z", + "x-ms-file-creation-time": "2022-08-12T03:02:25.0224377Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.3270897Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:25.0224377Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "ca4a57c7-901a-0063-246a-0222fc000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87aec-d01a-0062-31f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576/fromBuffer-c1s1048576base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "71ac4f38-7762-49ec-4c7d-66cf0f38f907", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2da5daeb-baa4-4af8-7f4c-a24ac9c57bb6", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815ADD0D91\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:25 GMT", + "etag": "\"0x8DA7C0F157D4A1B\"", + "last-modified": "Fri, 12 Aug 2022 03:02:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "71ac4f38-7762-49ec-4c7d-66cf0f38f907", + "x-ms-client-request-id": "2da5daeb-baa4-4af8-7f4c-a24ac9c57bb6", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.3430801Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.3430801Z", + "x-ms-file-change-time": "2022-08-12T03:02:25.3232667Z", + "x-ms-file-creation-time": "2022-08-12T03:02:25.3232667Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.3430801Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:25.3232667Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "ca4a57c8-901a-0063-256a-0222fc000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87aed-d01a-0062-32f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576/fromBuffer-c1s1048576base/fromBuffer-c1s1048576basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "9392ea75-c4b1-41cc-51e3-a20b532e28b9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "11580ab5-a8d5-4c19-676f-dc1b4f623f27", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AE43882\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:25 GMT", + "etag": "\"0x8DA7C0F15AB0A36\"", + "last-modified": "Fri, 12 Aug 2022 03:02:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "9392ea75-c4b1-41cc-51e3-a20b532e28b9", + "x-ms-client-request-id": "11580ab5-a8d5-4c19-676f-dc1b4f623f27", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.3900546Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.3900546Z", + "x-ms-file-change-time": "2022-08-12T03:02:25.6230966Z", + "x-ms-file-creation-time": "2022-08-12T03:02:25.6230966Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.3900546Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:25.6230966Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "ca4a57cc-901a-0063-276a-0222fc000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87aee-d01a-0062-33f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576/fromBuffer-c1s1048576base/fromBuffer-c1s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0a8aef4d-1bec-4283-6086-fc4652816840", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b6492f5d-2067-4f53-50f6-13321b40faf0", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AF0E0C9\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:26 GMT", + "etag": "\"0x8DA7C0F168851B5\"", + "last-modified": "Fri, 12 Aug 2022 03:02:27 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0a8aef4d-1bec-4283-6086-fc4652816840", - "x-ms-request-id": "ca4a57cd-901a-0063-286a-0222fc000000", + "x-ms-client-request-id": "b6492f5d-2067-4f53-50f6-13321b40faf0", + "x-ms-file-last-write-time": "2022-08-12T03:02:27.0732725Z", + "x-ms-request-id": "9ae87aef-d01a-0062-34f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576/fromBuffer-c1s1048576base/fromBuffer-c1s1048576?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e1462609-4f94-4afc-4ae8-02dea01c16cd", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "09ae278a-695f-4b14-6aff-4e3bc737e205", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "1048576", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AF0E0C9\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:27 GMT", + "etag": "\"0x8DA7C0F168851B5\"", + "last-modified": "Fri, 12 Aug 2022 03:02:27 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e1462609-4f94-4afc-4ae8-02dea01c16cd", + "x-ms-client-request-id": "09ae278a-695f-4b14-6aff-4e3bc737e205", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.3900546Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.3900546Z", + "x-ms-file-change-time": "2022-08-12T03:02:27.0732725Z", + "x-ms-file-creation-time": "2022-08-12T03:02:25.6230966Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.3900546Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:27.0732725Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "ca4a57d2-901a-0063-2b6a-0222fc000000", + "x-ms-request-id": "9ae87af1-d01a-0062-35f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576/fromBuffer-c1s1048576base/fromBuffer-c1s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5edde2b7-56c2-4d2b-68ad-a7bd9a1808bc", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ec56991d-d0f5-4afc-5ee3-b07fb89ce3c0", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "1048576", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AF0E0C9\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:27 GMT", + "etag": "\"0x8DA7C0F168851B5\"", + "last-modified": "Fri, 12 Aug 2022 03:02:27 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5edde2b7-56c2-4d2b-68ad-a7bd9a1808bc", + "x-ms-client-request-id": "ec56991d-d0f5-4afc-5ee3-b07fb89ce3c0", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.3900546Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.3900546Z", + "x-ms-file-change-time": "2022-08-12T03:02:27.0732725Z", + "x-ms-file-creation-time": "2022-08-12T03:02:25.6230966Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.3900546Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:27.0732725Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "ca4a57d3-901a-0063-2c6a-0222fc000000", + "x-ms-request-id": "9ae87af2-d01a-0062-36f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576/fromBuffer-c1s1048576base/fromBuffer-c1s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "43778455-fc64-451a-7655-2bed0cfae3a3", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d8612b7e-8053-4d2a-4281-317a0d0fb751", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:28 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "43778455-fc64-451a-7655-2bed0cfae3a3", - "x-ms-request-id": "ca4a57d4-901a-0063-2d6a-0222fc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d8612b7e-8053-4d2a-4281-317a0d0fb751", + "x-ms-request-id": "9ae87af8-d01a-0062-39f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5d8342bd-1398-45fe-53b6-1c130a76b6ca", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7272650c-c146-4284-62d8-f032e17c6d0b", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:29 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5d8342bd-1398-45fe-53b6-1c130a76b6ca", - "x-ms-request-id": "ca4a57d6-901a-0063-2f6a-0222fc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "7272650c-c146-4284-62d8-f032e17c6d0b", + "x-ms-request-id": "9ae87afa-d01a-0062-3af7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b9d7ede8-ecb5-4ce4-508e-9bafe6c26b58", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a0623c4c-46cd-4d98-57d1-dcdf19d1fffc", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:29 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b9d7ede8-ecb5-4ce4-508e-9bafe6c26b58", - "x-ms-request-id": "ca4a57d7-901a-0063-306a-0222fc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "a0623c4c-46cd-4d98-57d1-dcdf19d1fffc", + "x-ms-request-id": "9ae87afb-d01a-0062-3bf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s1048576?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4096.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4096.json index 509529dcac..781310b411 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4096.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4096.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "78dc5141-6474-4895-6cde-71f5090c8ee8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3e90218b-83d3-4c13-4999-8960e3d04361", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AB4A188\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:21 GMT", + "etag": "\"0x8DA7C0F135A036A\"", + "last-modified": "Fri, 12 Aug 2022 03:02:21 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "78dc5141-6474-4895-6cde-71f5090c8ee8", - "x-ms-request-id": "9b07e793-201a-0059-4b6a-023884000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "3e90218b-83d3-4c13-4999-8960e3d04361", + "x-ms-request-id": "9ae87ad3-d01a-0062-1ff7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0a4a5f47-21eb-4889-4114-f93d71a88c46", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "45f90420-d87b-4fb8-4991-80182f9aca48", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815ABD553C\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:21 GMT", + "etag": "\"0x8DA7C0F13878F6B\"", + "last-modified": "Fri, 12 Aug 2022 03:02:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0a4a5f47-21eb-4889-4114-f93d71a88c46", + "x-ms-client-request-id": "45f90420-d87b-4fb8-4991-80182f9aca48", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:04.1351996Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.1351996Z", + "x-ms-file-change-time": "2022-08-12T03:02:22.0351339Z", + "x-ms-file-creation-time": "2022-08-12T03:02:22.0351339Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.1351996Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:22.0351339Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "9b07e796-201a-0059-4c6a-023884000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87ad5-d01a-0062-20f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096/fromBuffer-c1s4096base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "cafe17b2-0da2-4f71-7802-25b06d70a0aa", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "24ab5fe7-e054-464b-7e5e-e558fb3cfc25", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815ABFC5DF\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:22 GMT", + "etag": "\"0x8DA7C0F13B612B3\"", + "last-modified": "Fri, 12 Aug 2022 03:02:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "cafe17b2-0da2-4f71-7802-25b06d70a0aa", + "x-ms-client-request-id": "24ab5fe7-e054-464b-7e5e-e558fb3cfc25", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.1511903Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.1511903Z", + "x-ms-file-change-time": "2022-08-12T03:02:22.3399603Z", + "x-ms-file-creation-time": "2022-08-12T03:02:22.3399603Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.1511903Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:22.3399603Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "9b07e797-201a-0059-4d6a-023884000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87ad9-d01a-0062-24f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096/fromBuffer-c1s4096base/fromBuffer-c1s4096basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d0395de1-07af-46cb-5185-1fa5d8fc836c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "238d5a57-817c-4fbd-7211-c6e3db4b0e4e", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AC1E86B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:22 GMT", + "etag": "\"0x8DA7C0F13E3D2DC\"", + "last-modified": "Fri, 12 Aug 2022 03:02:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d0395de1-07af-46cb-5185-1fa5d8fc836c", + "x-ms-client-request-id": "238d5a57-817c-4fbd-7211-c6e3db4b0e4e", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.1651819Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.1651819Z", + "x-ms-file-change-time": "2022-08-12T03:02:22.6397916Z", + "x-ms-file-creation-time": "2022-08-12T03:02:22.6397916Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.1651819Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:22.6397916Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "9b07e798-201a-0059-4e6a-023884000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87ada-d01a-0062-25f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096/fromBuffer-c1s4096base/fromBuffer-c1s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5fff71d0-d4c4-4c8a-5862-1202db2ba68a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e645928b-b340-42b7-7fe4-eb1f3c51c7a5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "IEOfeeTp3JW+NLIQKSIfgA==", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AC56A5F\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:22 GMT", + "etag": "\"0x8DA7C0F141144D4\"", + "last-modified": "Fri, 12 Aug 2022 03:02:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5fff71d0-d4c4-4c8a-5862-1202db2ba68a", - "x-ms-request-id": "9b07e799-201a-0059-4f6a-023884000000", + "x-ms-client-request-id": "e645928b-b340-42b7-7fe4-eb1f3c51c7a5", + "x-ms-file-last-write-time": "2022-08-12T03:02:22.9376212Z", + "x-ms-request-id": "9ae87adb-d01a-0062-26f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096/fromBuffer-c1s4096base/fromBuffer-c1s4096?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a9d51cbe-4fc3-4ae3-7cfb-159f92f73c46", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8f559c2c-997f-4337-5e59-116da055b7aa", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "4096", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AC56A5F\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:23 GMT", + "etag": "\"0x8DA7C0F141144D4\"", + "last-modified": "Fri, 12 Aug 2022 03:02:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a9d51cbe-4fc3-4ae3-7cfb-159f92f73c46", + "x-ms-client-request-id": "8f559c2c-997f-4337-5e59-116da055b7aa", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.1651819Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.1651819Z", + "x-ms-file-change-time": "2022-08-12T03:02:22.9376212Z", + "x-ms-file-creation-time": "2022-08-12T03:02:22.6397916Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.1651819Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:22.9376212Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "9b07e79a-201a-0059-506a-023884000000", + "x-ms-request-id": "9ae87adc-d01a-0062-27f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096/fromBuffer-c1s4096base/fromBuffer-c1s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a5215604-39ab-46cb-4ea5-e10ac4325e07", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f6212ee8-dc75-4e3b-66c6-cd86ddf98603", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "4096", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", - "etag": "\"0x8D9D0815AC56A5F\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:23 GMT", + "etag": "\"0x8DA7C0F141144D4\"", + "last-modified": "Fri, 12 Aug 2022 03:02:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a5215604-39ab-46cb-4ea5-e10ac4325e07", + "x-ms-client-request-id": "f6212ee8-dc75-4e3b-66c6-cd86ddf98603", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.1651819Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.1651819Z", + "x-ms-file-change-time": "2022-08-12T03:02:22.9376212Z", + "x-ms-file-creation-time": "2022-08-12T03:02:22.6397916Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.1651819Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:22.9376212Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "9b07e79b-201a-0059-516a-023884000000", + "x-ms-request-id": "9ae87ae3-d01a-0062-2bf7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096/fromBuffer-c1s4096base/fromBuffer-c1s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6156496a-32b4-434a-64fd-73ca282c2a05", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "71eb430c-698c-42a5-555b-8a1f46e1f2eb", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:23 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6156496a-32b4-434a-64fd-73ca282c2a05", - "x-ms-request-id": "9b07e79c-201a-0059-526a-023884000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "71eb430c-698c-42a5-555b-8a1f46e1f2eb", + "x-ms-request-id": "9ae87ae4-d01a-0062-2cf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3e46345d-75af-4aa6-589f-c78587f89a92", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ced67093-6ad4-4bcd-59e5-cc1a3edacdc8", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:23 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3e46345d-75af-4aa6-589f-c78587f89a92", - "x-ms-request-id": "9b07e79d-201a-0059-536a-023884000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "ced67093-6ad4-4bcd-59e5-cc1a3edacdc8", + "x-ms-request-id": "9ae87ae7-d01a-0062-2df7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "80f569ac-30b7-482f-63d3-cdc5ac2943c6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "be89a2d9-3462-4805-51dd-1af112fb2de0", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:24 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "80f569ac-30b7-482f-63d3-cdc5ac2943c6", - "x-ms-request-id": "9b07e79e-201a-0059-546a-023884000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "be89a2d9-3462-4805-51dd-1af112fb2de0", + "x-ms-request-id": "9ae87ae8-d01a-0062-2ef7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4096?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4194816.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4194816.json index bd39fe9b34..bc987e9c60 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4194816.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s4194816.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ca1536c0-f8e1-4ba1-5961-65623d509ccc", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fc13d0f4-571d-421a-7310-1ada1aaaf869", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", - "etag": "\"0x8D9D0815B124E12\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:29 GMT", + "etag": "\"0x8DA7C0F185277E7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ca1536c0-f8e1-4ba1-5961-65623d509ccc", - "x-ms-request-id": "1610af73-801a-000d-386a-0277d3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "fc13d0f4-571d-421a-7310-1ada1aaaf869", + "x-ms-request-id": "9ae87afc-d01a-0062-3cf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "cd45a0e4-fdc8-4bf5-6cf5-73ce978cd69e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "49cab5a9-e1f5-4151-5d10-97ff828a8859", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", - "etag": "\"0x8D9D0815B1EEEED\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:30 GMT", + "etag": "\"0x8DA7C0F187FB9E0\"", + "last-modified": "Fri, 12 Aug 2022 03:02:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "cd45a0e4-fdc8-4bf5-6cf5-73ce978cd69e", + "x-ms-client-request-id": "49cab5a9-e1f5-4151-5d10-97ff828a8859", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:04.7748333Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.7748333Z", + "x-ms-file-change-time": "2022-08-12T03:02:30.3724000Z", + "x-ms-file-creation-time": "2022-08-12T03:02:30.3724000Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.7748333Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:30.3724000Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1610af76-801a-000d-396a-0277d3000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87aff-d01a-0062-3ef7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b243ba2d-41de-41af-7562-81b242c20f11", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "799ca6ba-8016-4a2e-4eee-0b1f2f172fb4", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", - "etag": "\"0x8D9D0815B2249CB\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:30 GMT", + "etag": "\"0x8DA7C0F18AD52F0\"", + "last-modified": "Fri, 12 Aug 2022 03:02:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b243ba2d-41de-41af-7562-81b242c20f11", + "x-ms-client-request-id": "799ca6ba-8016-4a2e-4eee-0b1f2f172fb4", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.7968203Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.7968203Z", + "x-ms-file-change-time": "2022-08-12T03:02:30.6712304Z", + "x-ms-file-creation-time": "2022-08-12T03:02:30.6712304Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.7968203Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:30.6712304Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "1610af77-801a-000d-3a6a-0277d3000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87b00-d01a-0062-3ff7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "65fa90b5-4cf5-44a1-5f63-5352b9375365", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1002b9e1-a228-4ca4-4a3b-713663f13af1", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", - "etag": "\"0x8D9D0815B255698\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:30 GMT", + "etag": "\"0x8DA7C0F18DAC4F1\"", + "last-modified": "Fri, 12 Aug 2022 03:02:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "65fa90b5-4cf5-44a1-5f63-5352b9375365", + "x-ms-client-request-id": "1002b9e1-a228-4ca4-4a3b-713663f13af1", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.8168088Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.8168088Z", + "x-ms-file-change-time": "2022-08-12T03:02:30.9690609Z", + "x-ms-file-creation-time": "2022-08-12T03:02:30.9690609Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.8168088Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:30.9690609Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "1610af79-801a-000d-3c6a-0277d3000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87b01-d01a-0062-40f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3cc0aa7f-99d0-4ff6-67c1-962314ce95d6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0ac7346e-01a0-4969-43a8-c6d8468571ca", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", - "etag": "\"0x8D9D0815B302A78\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:31 GMT", + "etag": "\"0x8DA7C0F1909483E\"", + "last-modified": "Fri, 12 Aug 2022 03:02:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3cc0aa7f-99d0-4ff6-67c1-962314ce95d6", - "x-ms-request-id": "1610af7a-801a-000d-3d6a-0277d3000000", + "x-ms-client-request-id": "0ac7346e-01a0-4969-43a8-c6d8468571ca", + "x-ms-file-last-write-time": "2022-08-12T03:02:31.2738878Z", + "x-ms-request-id": "9ae87b02-d01a-0062-41f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a52c900c-c840-4057-702e-1f2b13f5a30e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "598a5c05-ba4e-43fd-7016-4861da80e2a2", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -149,22 +150,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", - "etag": "\"0x8D9D0815B39C5FB\"", - "last-modified": "Wed, 05 Jan 2022 19:27:04 GMT", + "date": "Fri, 12 Aug 2022 03:02:31 GMT", + "etag": "\"0x8DA7C0F1937CB85\"", + "last-modified": "Fri, 12 Aug 2022 03:02:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a52c900c-c840-4057-702e-1f2b13f5a30e", - "x-ms-request-id": "1610af7c-801a-000d-3f6a-0277d3000000", + "x-ms-client-request-id": "598a5c05-ba4e-43fd-7016-4861da80e2a2", + "x-ms-file-last-write-time": "2022-08-12T03:02:31.5787141Z", + "x-ms-request-id": "9ae87b13-d01a-0062-4ff7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "36166d04-9ac7-4638-413d-092fa7185825", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "738ccc68-1fd5-4146-4227-67dfeeca7d6c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -173,22 +175,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:04 GMT", - "etag": "\"0x8D9D0815B47F4B5\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:31 GMT", + "etag": "\"0x8DA7C0F19919E51\"", + "last-modified": "Fri, 12 Aug 2022 03:02:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "36166d04-9ac7-4638-413d-092fa7185825", - "x-ms-request-id": "1610af7d-801a-000d-406a-0277d3000000", + "x-ms-client-request-id": "738ccc68-1fd5-4146-4227-67dfeeca7d6c", + "x-ms-file-last-write-time": "2022-08-12T03:02:32.1673809Z", + "x-ms-request-id": "9ae87b18-d01a-0062-54f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "86b5c8ee-f268-477c-7cda-d59f89d2fcb6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f64e8971-8cd5-4a1c-709b-86dd6b78ff85", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -197,22 +200,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B5A1A7B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:32 GMT", + "etag": "\"0x8DA7C0F19EBBF17\"", + "last-modified": "Fri, 12 Aug 2022 03:02:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "86b5c8ee-f268-477c-7cda-d59f89d2fcb6", - "x-ms-request-id": "1610af7f-801a-000d-426a-0277d3000000", + "x-ms-client-request-id": "f64e8971-8cd5-4a1c-709b-86dd6b78ff85", + "x-ms-file-last-write-time": "2022-08-12T03:02:32.7580439Z", + "x-ms-request-id": "9ae87b28-d01a-0062-64f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1761ade2-736e-4530-430a-56cc3bc8675b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9ad17039-ff3d-4ed6-6df7-4bcd89b329b8", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -221,22 +225,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B69A893\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:33 GMT", + "etag": "\"0x8DA7C0F1A44F5B7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:33 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1761ade2-736e-4530-430a-56cc3bc8675b", - "x-ms-request-id": "1610af80-801a-000d-436a-0277d3000000", + "x-ms-client-request-id": "9ad17039-ff3d-4ed6-6df7-4bcd89b329b8", + "x-ms-file-last-write-time": "2022-08-12T03:02:33.3427127Z", + "x-ms-request-id": "9ae87b31-d01a-0062-6df7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5995e25c-523d-4fe3-590c-1c11f74a0159", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9a658478-f2e7-4f43-5664-af4ea4c96235", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -245,22 +250,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B75DBD2\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:33 GMT", + "etag": "\"0x8DA7C0F1A73A00B\"", + "last-modified": "Fri, 12 Aug 2022 03:02:33 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5995e25c-523d-4fe3-590c-1c11f74a0159", - "x-ms-request-id": "1610af81-801a-000d-446a-0277d3000000", + "x-ms-client-request-id": "9a658478-f2e7-4f43-5664-af4ea4c96235", + "x-ms-file-last-write-time": "2022-08-12T03:02:33.6485387Z", + "x-ms-request-id": "9ae87b41-d01a-0062-7df7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6adeb655-bb89-495d-5f75-530f4b565b54", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3ba9df63-0e05-4bab-7c0c-2186034adc68", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -269,22 +275,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B80AFAD\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:33 GMT", + "etag": "\"0x8DA7C0F1AA1872B\"", + "last-modified": "Fri, 12 Aug 2022 03:02:33 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6adeb655-bb89-495d-5f75-530f4b565b54", - "x-ms-request-id": "1610af82-801a-000d-456a-0277d3000000", + "x-ms-client-request-id": "3ba9df63-0e05-4bab-7c0c-2186034adc68", + "x-ms-file-last-write-time": "2022-08-12T03:02:33.9493675Z", + "x-ms-request-id": "9ae87b4b-d01a-0062-05f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f6843dc8-9b5a-4638-6a9d-7c65ae3eed78", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2d9a892e-a4fd-4ec2-580a-59df5652ccb4", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -293,22 +300,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B8B0E5D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:34 GMT", + "etag": "\"0x8DA7C0F1ACF6E5B\"", + "last-modified": "Fri, 12 Aug 2022 03:02:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f6843dc8-9b5a-4638-6a9d-7c65ae3eed78", - "x-ms-request-id": "1610af83-801a-000d-466a-0277d3000000", + "x-ms-client-request-id": "2d9a892e-a4fd-4ec2-580a-59df5652ccb4", + "x-ms-file-last-write-time": "2022-08-12T03:02:34.2501979Z", + "x-ms-request-id": "9ae87b51-d01a-0062-0bf7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "649370ed-8e7c-4fc0-6431-305387f00285", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1bdb1009-c244-452c-7c3f-dd3d649a9c70", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -317,22 +325,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "kUe8Hw8g6K4ZMuYWtRJA+w==", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B8DF421\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:34 GMT", + "etag": "\"0x8DA7C0F1AFC1D2A\"", + "last-modified": "Fri, 12 Aug 2022 03:02:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "649370ed-8e7c-4fc0-6431-305387f00285", - "x-ms-request-id": "1610af84-801a-000d-476a-0277d3000000", + "x-ms-client-request-id": "1bdb1009-c244-452c-7c3f-dd3d649a9c70", + "x-ms-file-last-write-time": "2022-08-12T03:02:34.5430314Z", + "x-ms-request-id": "9ae87b58-d01a-0062-12f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d0fe459e-d048-4b26-488f-a30147f5cdbd", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8abce008-394a-4626-44cc-1a4c3736e28c", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -345,18 +354,18 @@ "content-language": "en-US", "content-length": "4194816", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B8DF421\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:34 GMT", + "etag": "\"0x8DA7C0F1AFC1D2A\"", + "last-modified": "Fri, 12 Aug 2022 03:02:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d0fe459e-d048-4b26-488f-a30147f5cdbd", + "x-ms-client-request-id": "8abce008-394a-4626-44cc-1a4c3736e28c", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.8168088Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.8168088Z", + "x-ms-file-change-time": "2022-08-12T03:02:34.5430314Z", + "x-ms-file-creation-time": "2022-08-12T03:02:30.9690609Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.8168088Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:34.5430314Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -364,18 +373,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "1610af85-801a-000d-486a-0277d3000000", + "x-ms-request-id": "9ae87b61-d01a-0062-1bf7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f24409b8-2f14-4348-45e7-aa7a191aac02", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "85e88ed4-1071-4f5e-4ebf-d43bed71273b", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -389,18 +398,18 @@ "content-language": "en-US", "content-length": "4194816", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815B8DF421\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:34 GMT", + "etag": "\"0x8DA7C0F1AFC1D2A\"", + "last-modified": "Fri, 12 Aug 2022 03:02:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f24409b8-2f14-4348-45e7-aa7a191aac02", + "x-ms-client-request-id": "85e88ed4-1071-4f5e-4ebf-d43bed71273b", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:04.8168088Z", - "x-ms-file-creation-time": "2022-01-05T19:27:04.8168088Z", + "x-ms-file-change-time": "2022-08-12T03:02:34.5430314Z", + "x-ms-file-creation-time": "2022-08-12T03:02:30.9690609Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:04.8168088Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:34.5430314Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -408,18 +417,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "1610af86-801a-000d-496a-0277d3000000", + "x-ms-request-id": "9ae87b6c-d01a-0062-26f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816/fromBuffer-c1s4194816base/fromBuffer-c1s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1b08586f-545d-4ca5-6aa2-99adb5cd68b1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3a2f3493-9869-4940-7d7c-10b33ee9dfce", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -427,19 +436,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:35 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1b08586f-545d-4ca5-6aa2-99adb5cd68b1", - "x-ms-request-id": "1610af87-801a-000d-4a6a-0277d3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "3a2f3493-9869-4940-7d7c-10b33ee9dfce", + "x-ms-request-id": "9ae87b77-d01a-0062-31f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5cfbdd11-1564-4bb9-7414-6e294f52dc12", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a6ea6259-c957-48ca-6e78-1bf404e4114c", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -447,19 +456,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5cfbdd11-1564-4bb9-7414-6e294f52dc12", - "x-ms-request-id": "1610af88-801a-000d-4b6a-0277d3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "a6ea6259-c957-48ca-6e78-1bf404e4114c", + "x-ms-request-id": "9ae87b81-d01a-0062-39f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "348bbb7b-1441-45bc-496c-3f34e1a97edb", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e57f52c6-4b24-4cc0-7306-e6ab1316b440", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -467,11 +476,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "348bbb7b-1441-45bc-496c-3f34e1a97edb", - "x-ms-request-id": "1610af89-801a-000d-4c6a-0277d3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "e57f52c6-4b24-4cc0-7306-e6ab1316b440", + "x-ms-request-id": "9ae87b8b-d01a-0062-42f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s4194816?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s512.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s512.json index d5ca82abe8..4518739e7c 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s512.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c1s512.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ce595aad-fce5-4fdc-6c3c-a9d4d8d39115", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9a385ccc-3257-461f-7d01-1975087fdbe5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A73DE98\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:15 GMT", + "etag": "\"0x8DA7C0F0FCC33C3\"", + "last-modified": "Fri, 12 Aug 2022 03:02:15 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ce595aad-fce5-4fdc-6c3c-a9d4d8d39115", - "x-ms-request-id": "04ff30c6-201a-0014-676a-02f768000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "9a385ccc-3257-461f-7d01-1975087fdbe5", + "x-ms-request-id": "9ae87a8a-d01a-0062-80f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e62b445a-d524-4ade-69ba-ac91a89e707d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "10ac0cdd-6032-4cae-56ca-224626e9c4f0", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A77A3E0\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:15 GMT", + "etag": "\"0x8DA7C0F0FF995CB\"", + "last-modified": "Fri, 12 Aug 2022 03:02:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e62b445a-d524-4ade-69ba-ac91a89e707d", + "x-ms-client-request-id": "10ac0cdd-6032-4cae-56ca-224626e9c4f0", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:03.6784608Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.6784608Z", + "x-ms-file-change-time": "2022-08-12T03:02:16.0715211Z", + "x-ms-file-creation-time": "2022-08-12T03:02:16.0715211Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.6784608Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:16.0715211Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "04ff30c9-201a-0014-686a-02f768000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87a8c-d01a-0062-01f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512/fromBuffer-c1s512base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d45ac73f-ee8a-4ee0-4564-417b61d7080c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8d2d4bfa-8500-429a-409a-3643c283d411", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A79ED7C\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:16 GMT", + "etag": "\"0x8DA7C0F1027F203\"", + "last-modified": "Fri, 12 Aug 2022 03:02:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d45ac73f-ee8a-4ee0-4564-417b61d7080c", + "x-ms-client-request-id": "8d2d4bfa-8500-429a-409a-3643c283d411", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.6934524Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.6934524Z", + "x-ms-file-change-time": "2022-08-12T03:02:16.3753475Z", + "x-ms-file-creation-time": "2022-08-12T03:02:16.3753475Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.6934524Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:16.3753475Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "04ff30cb-201a-0014-696a-02f768000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87a8d-d01a-0062-02f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512/fromBuffer-c1s512base/fromBuffer-c1s512basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6b996022-139b-42c4-786e-ff3a6f8374a9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "005bf2ea-36bf-4694-5b4e-0d6a92d65ac7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A7C100A\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:16 GMT", + "etag": "\"0x8DA7C0F10567558\"", + "last-modified": "Fri, 12 Aug 2022 03:02:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6b996022-139b-42c4-786e-ff3a6f8374a9", + "x-ms-client-request-id": "005bf2ea-36bf-4694-5b4e-0d6a92d65ac7", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.7074442Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.7074442Z", + "x-ms-file-change-time": "2022-08-12T03:02:16.6801752Z", + "x-ms-file-creation-time": "2022-08-12T03:02:16.6801752Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.7074442Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:16.6801752Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "04ff30cc-201a-0014-6a6a-02f768000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87a8f-d01a-0062-03f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512/fromBuffer-c1s512base/fromBuffer-c1s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "873c6e89-2d68-4005-77c8-6cbebf062232", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ef392dee-2aba-4b28-4b38-a11ec890b852", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "kUe8Hw8g6K4ZMuYWtRJA+w==", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A7F1CD7\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:16 GMT", + "etag": "\"0x8DA7C0F10839942\"", + "last-modified": "Fri, 12 Aug 2022 03:02:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "873c6e89-2d68-4005-77c8-6cbebf062232", - "x-ms-request-id": "04ff30cd-201a-0014-6b6a-02f768000000", + "x-ms-client-request-id": "ef392dee-2aba-4b28-4b38-a11ec890b852", + "x-ms-file-last-write-time": "2022-08-12T03:02:16.9760066Z", + "x-ms-request-id": "9ae87a90-d01a-0062-04f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512/fromBuffer-c1s512base/fromBuffer-c1s512?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "7b654120-4de5-4abc-4fd4-62cc903c9ebb", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ddd0facf-6ad7-4279-5391-191f71dcc1ea", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "512", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A7F1CD7\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:17 GMT", + "etag": "\"0x8DA7C0F10839942\"", + "last-modified": "Fri, 12 Aug 2022 03:02:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7b654120-4de5-4abc-4fd4-62cc903c9ebb", + "x-ms-client-request-id": "ddd0facf-6ad7-4279-5391-191f71dcc1ea", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.7074442Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.7074442Z", + "x-ms-file-change-time": "2022-08-12T03:02:16.9760066Z", + "x-ms-file-creation-time": "2022-08-12T03:02:16.6801752Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.7074442Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:16.9760066Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "04ff30ce-201a-0014-6c6a-02f768000000", + "x-ms-request-id": "9ae87a91-d01a-0062-05f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512/fromBuffer-c1s512base/fromBuffer-c1s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e4b5e477-19d8-4b90-4164-7909c0819c77", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "62e11286-3fe4-424e-5af0-98a52869e230", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "512", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", - "etag": "\"0x8D9D0815A7F1CD7\"", - "last-modified": "Wed, 05 Jan 2022 19:27:03 GMT", + "date": "Fri, 12 Aug 2022 03:02:17 GMT", + "etag": "\"0x8DA7C0F10839942\"", + "last-modified": "Fri, 12 Aug 2022 03:02:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e4b5e477-19d8-4b90-4164-7909c0819c77", + "x-ms-client-request-id": "62e11286-3fe4-424e-5af0-98a52869e230", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:03.7074442Z", - "x-ms-file-creation-time": "2022-01-05T19:27:03.7074442Z", + "x-ms-file-change-time": "2022-08-12T03:02:16.9760066Z", + "x-ms-file-creation-time": "2022-08-12T03:02:16.6801752Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:03.7074442Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:16.9760066Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "04ff30cf-201a-0014-6d6a-02f768000000", + "x-ms-request-id": "9ae87a92-d01a-0062-06f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512/fromBuffer-c1s512base/fromBuffer-c1s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "fe6c6d7e-d885-4f73-6c82-44a5e2487eaa", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a163dcf1-7f1f-473b-6e33-8c2a7273f78d", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:17 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "fe6c6d7e-d885-4f73-6c82-44a5e2487eaa", - "x-ms-request-id": "04ff30d0-201a-0014-6e6a-02f768000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "a163dcf1-7f1f-473b-6e33-8c2a7273f78d", + "x-ms-request-id": "9ae87a93-d01a-0062-07f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5e4dfd4c-2d7b-43a2-582c-19ac27cf6044", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e09113a8-9dbc-45fe-6a40-e9616ed63716", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:17 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5e4dfd4c-2d7b-43a2-582c-19ac27cf6044", - "x-ms-request-id": "04ff30d1-201a-0014-6f6a-02f768000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "e09113a8-9dbc-45fe-6a40-e9616ed63716", + "x-ms-request-id": "9ae87a94-d01a-0062-08f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "3667ed3f-f6ea-4855-724c-32c8ed923c2b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "415eefb0-a2ec-4934-42cd-bf6e04ccfb95", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:02 GMT", + "date": "Fri, 12 Aug 2022 03:02:18 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "3667ed3f-f6ea-4855-724c-32c8ed923c2b", - "x-ms-request-id": "04ff30d2-201a-0014-706a-02f768000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "415eefb0-a2ec-4934-42cd-bf6e04ccfb95", + "x-ms-request-id": "9ae87a9a-d01a-0062-0cf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c1s512?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s0.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s0.json index 21e26658c1..d3589b2ba1 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s0.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s0.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a9088f0b-e9eb-4ff5-5a61-39b63aa1898a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5eb91c5e-781f-4df1-52ae-b50bed37d7ac", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BAFB23C\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:36 GMT", + "etag": "\"0x8DA7C0F1C6A4AB1\"", + "last-modified": "Fri, 12 Aug 2022 03:02:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a9088f0b-e9eb-4ff5-5a61-39b63aa1898a", - "x-ms-request-id": "a853b636-301a-0045-1d6a-026ae4000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "5eb91c5e-781f-4df1-52ae-b50bed37d7ac", + "x-ms-request-id": "9ae87b92-d01a-0062-49f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ef418434-cc26-431a-7945-81b3065b0757", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "6e1eb352-db5e-4882-6788-ba575ac0905b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BB3C619\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:37 GMT", + "etag": "\"0x8DA7C0F1C9768ED\"", + "last-modified": "Fri, 12 Aug 2022 03:02:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ef418434-cc26-431a-7945-81b3065b0757", + "x-ms-client-request-id": "6e1eb352-db5e-4882-6788-ba575ac0905b", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:05.7502745Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.7502745Z", + "x-ms-file-change-time": "2022-08-12T03:02:37.2385005Z", + "x-ms-file-creation-time": "2022-08-12T03:02:37.2385005Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.7502745Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:37.2385005Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "a853b639-301a-0045-1e6a-026ae4000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87b96-d01a-0062-4cf7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0/fromBuffer-c2s0base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "661ada6a-9634-4bfe-4627-64ff8fe9fd01", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "de34e168-094b-42b1-7f03-d5d60912cc59", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BB60FAF\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:37 GMT", + "etag": "\"0x8DA7C0F1CC4B3E2\"", + "last-modified": "Fri, 12 Aug 2022 03:02:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "661ada6a-9634-4bfe-4627-64ff8fe9fd01", + "x-ms-client-request-id": "de34e168-094b-42b1-7f03-d5d60912cc59", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.7652655Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.7652655Z", + "x-ms-file-change-time": "2022-08-12T03:02:37.5353314Z", + "x-ms-file-creation-time": "2022-08-12T03:02:37.5353314Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.7652655Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:37.5353314Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "a853b63a-301a-0045-1f6a-026ae4000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87b9e-d01a-0062-54f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0/fromBuffer-c2s0base/fromBuffer-c2s0basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bf1760d2-4333-4740-7b28-378afcf2526f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "4f4073ce-7721-4ac6-4cc0-718636472e37", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BB8A75E\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:37 GMT", + "etag": "\"0x8DA7C0F1CF1D7CE\"", + "last-modified": "Fri, 12 Aug 2022 03:02:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bf1760d2-4333-4740-7b28-378afcf2526f", + "x-ms-client-request-id": "4f4073ce-7721-4ac6-4cc0-718636472e37", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.7822558Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.7822558Z", + "x-ms-file-change-time": "2022-08-12T03:02:37.8311630Z", + "x-ms-file-creation-time": "2022-08-12T03:02:37.8311630Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.7822558Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:37.8311630Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "a853b63b-301a-0045-206a-026ae4000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87baf-d01a-0062-65f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0/fromBuffer-c2s0base/fromBuffer-c2s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b2f53400-b549-4f93-475c-464419e70a9d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a480a453-f036-4a8a-72ad-ce3616a7dfab", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -129,18 +129,18 @@ "content-language": "en-US", "content-length": "0", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BB8A75E\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:37 GMT", + "etag": "\"0x8DA7C0F1CF1D7CE\"", + "last-modified": "Fri, 12 Aug 2022 03:02:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b2f53400-b549-4f93-475c-464419e70a9d", + "x-ms-client-request-id": "a480a453-f036-4a8a-72ad-ce3616a7dfab", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.7822558Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.7822558Z", + "x-ms-file-change-time": "2022-08-12T03:02:37.8311630Z", + "x-ms-file-creation-time": "2022-08-12T03:02:37.8311630Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.7822558Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:37.8311630Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -148,18 +148,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "a853b63d-301a-0045-226a-026ae4000000", + "x-ms-request-id": "9ae87bce-d01a-0062-04f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0/fromBuffer-c2s0base/fromBuffer-c2s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c38b19c7-c380-4345-7f53-88c96b5d75a1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "160ab874-bf63-4424-49d6-1f00b7b34ed4", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -173,18 +173,18 @@ "content-language": "en-US", "content-length": "0", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BB8A75E\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:38 GMT", + "etag": "\"0x8DA7C0F1CF1D7CE\"", + "last-modified": "Fri, 12 Aug 2022 03:02:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c38b19c7-c380-4345-7f53-88c96b5d75a1", + "x-ms-client-request-id": "160ab874-bf63-4424-49d6-1f00b7b34ed4", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.7822558Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.7822558Z", + "x-ms-file-change-time": "2022-08-12T03:02:37.8311630Z", + "x-ms-file-creation-time": "2022-08-12T03:02:37.8311630Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.7822558Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:37.8311630Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -192,18 +192,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "a853b63e-301a-0045-236a-026ae4000000", + "x-ms-request-id": "9ae87be7-d01a-0062-1df7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0/fromBuffer-c2s0base/fromBuffer-c2s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d38c250c-081b-4468-6a59-4aa29d187a2a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "326927f8-8213-46ce-497a-36e3fc7ffd6d", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -211,19 +211,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d38c250c-081b-4468-6a59-4aa29d187a2a", - "x-ms-request-id": "a853b63f-301a-0045-246a-026ae4000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "326927f8-8213-46ce-497a-36e3fc7ffd6d", + "x-ms-request-id": "9ae87bf6-d01a-0062-2cf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a8ae0606-39df-40d7-556f-1ee75a7c40a2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "60226238-3061-459e-5da7-8cb3b8489d25", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -231,19 +231,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a8ae0606-39df-40d7-556f-1ee75a7c40a2", - "x-ms-request-id": "a853b640-301a-0045-256a-026ae4000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "60226238-3061-459e-5da7-8cb3b8489d25", + "x-ms-request-id": "9ae87c0b-d01a-0062-3ff7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6ade892f-5baf-4540-65c4-af809059701a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "741a6cf6-d8db-4a05-7122-4a946b7d92a2", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -251,11 +251,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6ade892f-5baf-4540-65c4-af809059701a", - "x-ms-request-id": "a853b641-301a-0045-266a-026ae4000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "741a6cf6-d8db-4a05-7122-4a946b7d92a2", + "x-ms-request-id": "9ae87c1e-d01a-0062-52f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s0?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1024.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1024.json index 3504fdd92e..e3550b376a 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1024.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1024.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2aa9f374-5038-49f0-6099-3e1f3984d5ad", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b738cb4a-dd10-447f-7323-1838aa643a9b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815BEF598E\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:42 GMT", + "etag": "\"0x8DA7C0F1FC7C2C6\"", + "last-modified": "Fri, 12 Aug 2022 03:02:42 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2aa9f374-5038-49f0-6099-3e1f3984d5ad", - "x-ms-request-id": "395b1151-501a-0021-626a-029b7c000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "b738cb4a-dd10-447f-7323-1838aa643a9b", + "x-ms-request-id": "9ae87cd9-d01a-0062-09f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "4906787c-d04b-4b77-4a5b-8eabb9e27e18", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "14c0c3e2-9aa8-4d70-45b1-2907f685e440", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815BFA88B4\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:42 GMT", + "etag": "\"0x8DA7C0F1FF70652\"", + "last-modified": "Fri, 12 Aug 2022 03:02:42 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "4906787c-d04b-4b77-4a5b-8eabb9e27e18", + "x-ms-client-request-id": "14c0c3e2-9aa8-4d70-45b1-2907f685e440", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:06.2140084Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.2140084Z", + "x-ms-file-change-time": "2022-08-12T03:02:42.8982866Z", + "x-ms-file-creation-time": "2022-08-12T03:02:42.8982866Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.2140084Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:42.8982866Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "395b1154-501a-0021-636a-029b7c000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87cdf-d01a-0062-0ef7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024/fromBuffer-c2s1024base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "38beb8b9-6a5a-4a6a-7489-dc5f9eca5088", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "86b29b14-3dff-41b8-7fa3-167397b0b1f8", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815BFCF959\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:42 GMT", + "etag": "\"0x8DA7C0F20245149\"", + "last-modified": "Fri, 12 Aug 2022 03:02:43 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "38beb8b9-6a5a-4a6a-7489-dc5f9eca5088", + "x-ms-client-request-id": "86b29b14-3dff-41b8-7fa3-167397b0b1f8", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.2299993Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.2299993Z", + "x-ms-file-change-time": "2022-08-12T03:02:43.1951177Z", + "x-ms-file-creation-time": "2022-08-12T03:02:43.1951177Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.2299993Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:43.1951177Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "395b1155-501a-0021-646a-029b7c000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87ce4-d01a-0062-13f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024/fromBuffer-c2s1024base/fromBuffer-c2s1024basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "541deecc-e65d-4d9d-42d1-bacbef0d109f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0d22ce6e-9c4c-4bb9-5401-8818da0c5893", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815BFF42F3\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:43 GMT", + "etag": "\"0x8DA7C0F2051271D\"", + "last-modified": "Fri, 12 Aug 2022 03:02:43 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "541deecc-e65d-4d9d-42d1-bacbef0d109f", + "x-ms-client-request-id": "0d22ce6e-9c4c-4bb9-5401-8818da0c5893", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.2449907Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.2449907Z", + "x-ms-file-change-time": "2022-08-12T03:02:43.4889501Z", + "x-ms-file-creation-time": "2022-08-12T03:02:43.4889501Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.2449907Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:43.4889501Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "395b1156-501a-0021-656a-029b7c000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87ced-d01a-0062-1cf7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024/fromBuffer-c2s1024base/fromBuffer-c2s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "76b2d417-5915-409c-7873-5165a25dc813", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e2bc63a5-b623-4a55-5e41-0164ff2a1926", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "cmX00hG1aHOjgdMh9YbkqQ==", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C024FC1\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:43 GMT", + "etag": "\"0x8DA7C0F207EE73E\"", + "last-modified": "Fri, 12 Aug 2022 03:02:43 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "76b2d417-5915-409c-7873-5165a25dc813", - "x-ms-request-id": "395b1157-501a-0021-666a-029b7c000000", + "x-ms-client-request-id": "e2bc63a5-b623-4a55-5e41-0164ff2a1926", + "x-ms-file-last-write-time": "2022-08-12T03:02:43.7887806Z", + "x-ms-request-id": "9ae87cf9-d01a-0062-28f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024/fromBuffer-c2s1024base/fromBuffer-c2s1024?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bfa721eb-d3af-40fb-6e73-f3469f66d777", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "481fb686-8349-4ea8-65e0-ff9c170d0246", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C024FC1\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:43 GMT", + "etag": "\"0x8DA7C0F207EE73E\"", + "last-modified": "Fri, 12 Aug 2022 03:02:43 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bfa721eb-d3af-40fb-6e73-f3469f66d777", + "x-ms-client-request-id": "481fb686-8349-4ea8-65e0-ff9c170d0246", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.2449907Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.2449907Z", + "x-ms-file-change-time": "2022-08-12T03:02:43.7887806Z", + "x-ms-file-creation-time": "2022-08-12T03:02:43.4889501Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.2449907Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:43.7887806Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "395b1158-501a-0021-676a-029b7c000000", + "x-ms-request-id": "9ae87d03-d01a-0062-30f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024/fromBuffer-c2s1024base/fromBuffer-c2s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8dfff953-c9e9-432a-54de-70cb1ce96e0c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "291c3b16-3267-42b4-4800-870b6675d9a7", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C024FC1\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:44 GMT", + "etag": "\"0x8DA7C0F207EE73E\"", + "last-modified": "Fri, 12 Aug 2022 03:02:43 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8dfff953-c9e9-432a-54de-70cb1ce96e0c", + "x-ms-client-request-id": "291c3b16-3267-42b4-4800-870b6675d9a7", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.2449907Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.2449907Z", + "x-ms-file-change-time": "2022-08-12T03:02:43.7887806Z", + "x-ms-file-creation-time": "2022-08-12T03:02:43.4889501Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.2449907Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:43.7887806Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "395b1159-501a-0021-686a-029b7c000000", + "x-ms-request-id": "9ae87d07-d01a-0062-34f7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024/fromBuffer-c2s1024base/fromBuffer-c2s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "db3f4dbb-92a2-4981-5e8f-459c10fcbdb5", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "594e03f8-413c-481f-7e74-f9388942d700", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "db3f4dbb-92a2-4981-5e8f-459c10fcbdb5", - "x-ms-request-id": "395b115c-501a-0021-6a6a-029b7c000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "594e03f8-413c-481f-7e74-f9388942d700", + "x-ms-request-id": "9ae87d09-d01a-0062-36f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b6d5e069-99a8-4d7a-7e2a-29e0cf9e30b2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5f277998-23c2-4f4c-7208-bce819b24896", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b6d5e069-99a8-4d7a-7e2a-29e0cf9e30b2", - "x-ms-request-id": "395b115d-501a-0021-6b6a-029b7c000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "5f277998-23c2-4f4c-7208-bce819b24896", + "x-ms-request-id": "9ae87d10-d01a-0062-3df7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "67dfdece-8b83-4bed-488d-e652ebf92be2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1e9111d0-89ac-4320-6c5f-1fbfae10c225", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "67dfdece-8b83-4bed-488d-e652ebf92be2", - "x-ms-request-id": "395b115e-501a-0021-6c6a-029b7c000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "1e9111d0-89ac-4320-6c5f-1fbfae10c225", + "x-ms-request-id": "9ae87d14-d01a-0062-41f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1024?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1048576.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1048576.json index a27501d4fc..98802b4845 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1048576.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s1048576.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c779132c-f7c4-42c1-69fa-eeab347e923a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d35224c0-3f41-4b18-614d-c7b7387cce27", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C542F9F\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:48 GMT", + "etag": "\"0x8DA7C0F2356F1E6\"", + "last-modified": "Fri, 12 Aug 2022 03:02:48 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c779132c-f7c4-42c1-69fa-eeab347e923a", - "x-ms-request-id": "b88c39a1-101a-0052-0e6a-02c3ef000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d35224c0-3f41-4b18-614d-c7b7387cce27", + "x-ms-request-id": "9ae87d7a-d01a-0062-18f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d223f3c8-6523-4569-5b97-97c1f3eb6a94", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f97c4e73-b350-490c-7bee-19f19751ff9f", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C580453\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:48 GMT", + "etag": "\"0x8DA7C0F238415AD\"", + "last-modified": "Fri, 12 Aug 2022 03:02:48 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d223f3c8-6523-4569-5b97-97c1f3eb6a94", + "x-ms-client-request-id": "f97c4e73-b350-490c-7bee-19f19751ff9f", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:06.8266579Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.8266579Z", + "x-ms-file-change-time": "2022-08-12T03:02:48.8559021Z", + "x-ms-file-creation-time": "2022-08-12T03:02:48.8559021Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.8266579Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:48.8559021Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "b88c39a4-101a-0052-0f6a-02c3ef000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87d87-d01a-0062-24f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576/fromBuffer-c2s1048576base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "af712fb5-7619-4181-69f4-eb13c4285164", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "195ccc70-e4eb-4258-59d3-195135222caf", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C5A4DF2\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:48 GMT", + "etag": "\"0x8DA7C0F23B271FC\"", + "last-modified": "Fri, 12 Aug 2022 03:02:49 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "af712fb5-7619-4181-69f4-eb13c4285164", + "x-ms-client-request-id": "195ccc70-e4eb-4258-59d3-195135222caf", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.8416498Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.8416498Z", + "x-ms-file-change-time": "2022-08-12T03:02:49.1597308Z", + "x-ms-file-creation-time": "2022-08-12T03:02:49.1597308Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.8416498Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:49.1597308Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b88c39a5-101a-0052-106a-02c3ef000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87d90-d01a-0062-2bf8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576/fromBuffer-c2s1048576base/fromBuffer-c2s1048576basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "84da313d-fbe2-4026-5371-d97539370874", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "45c0fd59-d660-48a1-4148-500164b8c240", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C5C707C\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:49 GMT", + "etag": "\"0x8DA7C0F23DF6ED4\"", + "last-modified": "Fri, 12 Aug 2022 03:02:49 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "84da313d-fbe2-4026-5371-d97539370874", + "x-ms-client-request-id": "45c0fd59-d660-48a1-4148-500164b8c240", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.8556412Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.8556412Z", + "x-ms-file-change-time": "2022-08-12T03:02:49.4545620Z", + "x-ms-file-creation-time": "2022-08-12T03:02:49.4545620Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.8556412Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:49.4545620Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "b88c39a6-101a-0052-116a-02c3ef000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87d95-d01a-0062-2ff8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576/fromBuffer-c2s1048576base/fromBuffer-c2s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "96d3ab08-80e6-4773-5e2a-3cb8ee586d3f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f17a8577-7253-4c80-4d0f-06857b078eef", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C6CE8D2\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:49 GMT", + "etag": "\"0x8DA7C0F2439B6C3\"", + "last-modified": "Fri, 12 Aug 2022 03:02:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "96d3ab08-80e6-4773-5e2a-3cb8ee586d3f", - "x-ms-request-id": "b88c39a7-101a-0052-126a-02c3ef000000", + "x-ms-client-request-id": "f17a8577-7253-4c80-4d0f-06857b078eef", + "x-ms-file-last-write-time": "2022-08-12T03:02:50.0462275Z", + "x-ms-request-id": "9ae87da4-d01a-0062-3df8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576/fromBuffer-c2s1048576base/fromBuffer-c2s1048576?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6de1d1fc-ba78-4bb5-6496-e4ae5359deb1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1ada5d24-64f0-4bfa-5640-43010836c156", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "1048576", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C6CE8D2\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:50 GMT", + "etag": "\"0x8DA7C0F2439B6C3\"", + "last-modified": "Fri, 12 Aug 2022 03:02:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6de1d1fc-ba78-4bb5-6496-e4ae5359deb1", + "x-ms-client-request-id": "1ada5d24-64f0-4bfa-5640-43010836c156", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.8556412Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.8556412Z", + "x-ms-file-change-time": "2022-08-12T03:02:50.0462275Z", + "x-ms-file-creation-time": "2022-08-12T03:02:49.4545620Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.8556412Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:50.0462275Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "b88c39a8-101a-0052-136a-02c3ef000000", + "x-ms-request-id": "9ae87dab-d01a-0062-44f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576/fromBuffer-c2s1048576base/fromBuffer-c2s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "eff5ba83-01e6-45a7-5bef-a2f8fc382f72", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "453cc0a4-842c-48e5-7a21-28220f03841c", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "1048576", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C6CE8D2\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:50 GMT", + "etag": "\"0x8DA7C0F2439B6C3\"", + "last-modified": "Fri, 12 Aug 2022 03:02:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "eff5ba83-01e6-45a7-5bef-a2f8fc382f72", + "x-ms-client-request-id": "453cc0a4-842c-48e5-7a21-28220f03841c", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.8556412Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.8556412Z", + "x-ms-file-change-time": "2022-08-12T03:02:50.0462275Z", + "x-ms-file-creation-time": "2022-08-12T03:02:49.4545620Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.8556412Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:50.0462275Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "b88c39a9-101a-0052-146a-02c3ef000000", + "x-ms-request-id": "9ae87daf-d01a-0062-48f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576/fromBuffer-c2s1048576base/fromBuffer-c2s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "044ef25d-0f59-466d-6026-235b536e023a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b3453b25-47bf-4100-76fe-cf7c9068bca3", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:50 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "044ef25d-0f59-466d-6026-235b536e023a", - "x-ms-request-id": "b88c39aa-101a-0052-156a-02c3ef000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "b3453b25-47bf-4100-76fe-cf7c9068bca3", + "x-ms-request-id": "9ae87db1-d01a-0062-4af8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e1d29234-755c-4ee5-4397-4295f8a55c08", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "48cc47da-ba10-436e-717d-9253832c0e61", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:51 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e1d29234-755c-4ee5-4397-4295f8a55c08", - "x-ms-request-id": "b88c39ab-101a-0052-166a-02c3ef000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "48cc47da-ba10-436e-717d-9253832c0e61", + "x-ms-request-id": "9ae87db4-d01a-0062-4df8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "95837c9d-5865-4fb2-5fd8-fe2d2eea7cd6", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "09ad8d92-fec9-4a29-69ae-1a494ff8f112", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:51 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "95837c9d-5865-4fb2-5fd8-fe2d2eea7cd6", - "x-ms-request-id": "b88c39ac-101a-0052-176a-02c3ef000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "09ad8d92-fec9-4a29-69ae-1a494ff8f112", + "x-ms-request-id": "9ae87db8-d01a-0062-50f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s1048576?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4096.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4096.json index dbf9b636bc..9b725bf40f 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4096.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4096.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1d5b39f9-d06f-4c5c-5d03-db44d19afc81", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "13dca19e-b74c-4186-6db3-003b8249874b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C375F1A\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:45 GMT", + "etag": "\"0x8DA7C0F218F46DD\"", + "last-modified": "Fri, 12 Aug 2022 03:02:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1d5b39f9-d06f-4c5c-5d03-db44d19afc81", - "x-ms-request-id": "191b7768-001a-003c-5e6a-0296c0000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "13dca19e-b74c-4186-6db3-003b8249874b", + "x-ms-request-id": "9ae87d1e-d01a-0062-4bf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "877ec12a-70a1-4803-4e11-e37aea7f1cc2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "341da484-fec3-4f76-5eff-7fc30d32151a", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C3B58C7\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:45 GMT", + "etag": "\"0x8DA7C0F21BD2C64\"", + "last-modified": "Fri, 12 Aug 2022 03:02:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "877ec12a-70a1-4803-4e11-e37aea7f1cc2", + "x-ms-client-request-id": "341da484-fec3-4f76-5eff-7fc30d32151a", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:06.6387655Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.6387655Z", + "x-ms-file-change-time": "2022-08-12T03:02:45.8745956Z", + "x-ms-file-creation-time": "2022-08-12T03:02:45.8745956Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.6387655Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:45.8745956Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "191b776b-001a-003c-5f6a-0296c0000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87d25-d01a-0062-51f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096/fromBuffer-c2s4096base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1f2b384d-a200-403b-6360-9f2f0d94cab0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "850f5ef6-ecdf-4e1f-560a-a6f82b716e68", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C3E1788\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:45 GMT", + "etag": "\"0x8DA7C0F21EB88B2\"", + "last-modified": "Fri, 12 Aug 2022 03:02:46 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1f2b384d-a200-403b-6360-9f2f0d94cab0", + "x-ms-client-request-id": "850f5ef6-ecdf-4e1f-560a-a6f82b716e68", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.6567560Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.6567560Z", + "x-ms-file-change-time": "2022-08-12T03:02:46.1784242Z", + "x-ms-file-creation-time": "2022-08-12T03:02:46.1784242Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.6567560Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:46.1784242Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "191b776d-001a-003c-606a-0296c0000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87d2d-d01a-0062-59f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096/fromBuffer-c2s4096base/fromBuffer-c2s4096basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b9fcbe6a-51c1-4256-697b-7fbccbb696dd", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9cb391b2-2b6e-43c9-5fb2-16c25617fcd4", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C403A0D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:46 GMT", + "etag": "\"0x8DA7C0F2218AC9C\"", + "last-modified": "Fri, 12 Aug 2022 03:02:46 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b9fcbe6a-51c1-4256-697b-7fbccbb696dd", + "x-ms-client-request-id": "9cb391b2-2b6e-43c9-5fb2-16c25617fcd4", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.6707469Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.6707469Z", + "x-ms-file-change-time": "2022-08-12T03:02:46.4742556Z", + "x-ms-file-creation-time": "2022-08-12T03:02:46.4742556Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.6707469Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:46.4742556Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "191b776e-001a-003c-616a-0296c0000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87d42-d01a-0062-61f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096/fromBuffer-c2s4096base/fromBuffer-c2s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bc2bf9c3-503f-43e0-52df-aca7b2a50824", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b7c05ea2-1ce4-4365-5c92-8a2a770e48aa", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "IEOfeeTp3JW+NLIQKSIfgA==", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C4346E0\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:46 GMT", + "etag": "\"0x8DA7C0F224645A7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:46 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bc2bf9c3-503f-43e0-52df-aca7b2a50824", - "x-ms-request-id": "191b776f-001a-003c-626a-0296c0000000", + "x-ms-client-request-id": "b7c05ea2-1ce4-4365-5c92-8a2a770e48aa", + "x-ms-file-last-write-time": "2022-08-12T03:02:46.7730855Z", + "x-ms-request-id": "9ae87d4b-d01a-0062-69f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096/fromBuffer-c2s4096base/fromBuffer-c2s4096?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8626e426-db54-4a7d-512b-175ca67a84c2", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a5b396f8-0f9e-42c0-6e05-c541ac25e9ac", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "4096", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C4346E0\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:46 GMT", + "etag": "\"0x8DA7C0F224645A7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:46 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8626e426-db54-4a7d-512b-175ca67a84c2", + "x-ms-client-request-id": "a5b396f8-0f9e-42c0-6e05-c541ac25e9ac", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.6707469Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.6707469Z", + "x-ms-file-change-time": "2022-08-12T03:02:46.7730855Z", + "x-ms-file-creation-time": "2022-08-12T03:02:46.4742556Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.6707469Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:46.7730855Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "191b7770-001a-003c-636a-0296c0000000", + "x-ms-request-id": "9ae87d4e-d01a-0062-6cf7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096/fromBuffer-c2s4096base/fromBuffer-c2s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c4143775-e4ab-4eea-7240-7ff66232d300", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f783fad3-e947-4313-64ba-d0905356c392", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "4096", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C4346E0\"", - "last-modified": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:47 GMT", + "etag": "\"0x8DA7C0F224645A7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:46 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c4143775-e4ab-4eea-7240-7ff66232d300", + "x-ms-client-request-id": "f783fad3-e947-4313-64ba-d0905356c392", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:06.6707469Z", - "x-ms-file-creation-time": "2022-01-05T19:27:06.6707469Z", + "x-ms-file-change-time": "2022-08-12T03:02:46.7730855Z", + "x-ms-file-creation-time": "2022-08-12T03:02:46.4742556Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:06.6707469Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:46.7730855Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "191b7771-001a-003c-646a-0296c0000000", + "x-ms-request-id": "9ae87d5e-d01a-0062-7cf8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096/fromBuffer-c2s4096base/fromBuffer-c2s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "49441d17-cd9b-4381-7f0a-41dd193af324", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1b04f69c-eaf6-4c17-743b-ef4a51662b21", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:47 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "49441d17-cd9b-4381-7f0a-41dd193af324", - "x-ms-request-id": "191b7772-001a-003c-656a-0296c0000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "1b04f69c-eaf6-4c17-743b-ef4a51662b21", + "x-ms-request-id": "9ae87d64-d01a-0062-02f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b21e189b-364d-4390-50b8-7287834cf400", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0903e571-259b-4554-4f85-501115b8a884", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:47 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b21e189b-364d-4390-50b8-7287834cf400", - "x-ms-request-id": "191b7773-001a-003c-666a-0296c0000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "0903e571-259b-4554-4f85-501115b8a884", + "x-ms-request-id": "9ae87d6a-d01a-0062-08f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "60fb8279-c0f6-4913-6b4a-b5804e9f4b24", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d002c388-a730-424f-5d18-e56940892a2b", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:02:48 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "60fb8279-c0f6-4913-6b4a-b5804e9f4b24", - "x-ms-request-id": "191b7774-001a-003c-676a-0296c0000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d002c388-a730-424f-5d18-e56940892a2b", + "x-ms-request-id": "9ae87d76-d01a-0062-14f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4096?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4194816.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4194816.json index f3e79924c5..a214071b63 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4194816.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s4194816.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "59fc4c8d-92b3-4493-5ef3-9d39ec14647a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "51901653-1b4d-42b6-5258-e46ec7504150", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815C862C10\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:51 GMT", + "etag": "\"0x8DA7C0F254AD696\"", + "last-modified": "Fri, 12 Aug 2022 03:02:51 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "59fc4c8d-92b3-4493-5ef3-9d39ec14647a", - "x-ms-request-id": "6c74efcf-101a-007d-056a-02ce24000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "51901653-1b4d-42b6-5258-e46ec7504150", + "x-ms-request-id": "9ae87dbb-d01a-0062-53f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "97e3dca3-a91b-4d71-45d4-b3d9280c4313", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0b41672c-1aa2-43bc-54ed-6d1a5aeb64ff", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815C89E26F\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:51 GMT", + "etag": "\"0x8DA7C0F2577FBE0\"", + "last-modified": "Fri, 12 Aug 2022 03:02:52 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "97e3dca3-a91b-4d71-45d4-b3d9280c4313", + "x-ms-client-request-id": "0b41672c-1aa2-43bc-54ed-6d1a5aeb64ff", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:07.1534703Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.1534703Z", + "x-ms-file-change-time": "2022-08-12T03:02:52.1320416Z", + "x-ms-file-creation-time": "2022-08-12T03:02:52.1320416Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.1534703Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:52.1320416Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "6c74efd2-101a-007d-066a-02ce24000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87dbe-d01a-0062-55f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "42d7e114-000a-459f-6c69-adba80b7f267", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b18bdba8-543b-4136-70d2-6f3d5251ba45", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815C8C2C0A\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:52 GMT", + "etag": "\"0x8DA7C0F25A546D9\"", + "last-modified": "Fri, 12 Aug 2022 03:02:52 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "42d7e114-000a-459f-6c69-adba80b7f267", + "x-ms-client-request-id": "b18bdba8-543b-4136-70d2-6f3d5251ba45", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.1684618Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.1684618Z", + "x-ms-file-change-time": "2022-08-12T03:02:52.4288729Z", + "x-ms-file-creation-time": "2022-08-12T03:02:52.4288729Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.1684618Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:52.4288729Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "6c74efd4-101a-007d-076a-02ce24000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87dc4-d01a-0062-59f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ffc8dd0e-88d0-4136-6eb5-ad01ae3bd2de", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "86c99937-097e-42c3-6e87-57e2130cd823", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815C8E4E99\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:52 GMT", + "etag": "\"0x8DA7C0F25D26AC7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:52 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ffc8dd0e-88d0-4136-6eb5-ad01ae3bd2de", + "x-ms-client-request-id": "86c99937-097e-42c3-6e87-57e2130cd823", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.1824537Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.1824537Z", + "x-ms-file-change-time": "2022-08-12T03:02:52.7247047Z", + "x-ms-file-creation-time": "2022-08-12T03:02:52.7247047Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.1824537Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:52.7247047Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "6c74efd5-101a-007d-086a-02ce24000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87dd7-d01a-0062-5bf8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bc6165b8-4b0d-4000-5d66-74251c0f4d1f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7d239cc0-9fdf-4271-4378-da309d81864a", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815C9AF6F3\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:52 GMT", + "etag": "\"0x8DA7C0F26018A3F\"", + "last-modified": "Fri, 12 Aug 2022 03:02:53 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bc6165b8-4b0d-4000-5d66-74251c0f4d1f", - "x-ms-request-id": "6c74efd7-101a-007d-0a6a-02ce24000000", + "x-ms-client-request-id": "7d239cc0-9fdf-4271-4378-da309d81864a", + "x-ms-file-last-write-time": "2022-08-12T03:02:53.0335295Z", + "x-ms-request-id": "9ae87dda-d01a-0062-5ef8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2c446e2f-9790-413d-635b-4828c7e53bc3", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "66a9a65e-72c2-45a7-5363-310093fe91cd", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -149,22 +150,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815C9E2AC6\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:53 GMT", + "etag": "\"0x8DA7C0F26300D93\"", + "last-modified": "Fri, 12 Aug 2022 03:02:53 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2c446e2f-9790-413d-635b-4828c7e53bc3", - "x-ms-request-id": "65911882-b01a-0016-436a-0249d0000000", + "x-ms-client-request-id": "66a9a65e-72c2-45a7-5363-310093fe91cd", + "x-ms-file-last-write-time": "2022-08-12T03:02:53.3383571Z", + "x-ms-request-id": "9ae87ddb-d01a-0062-5ff8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "aef273a0-96e8-402b-71e5-a94166d637a8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "dbd258de-2549-47ab-63d4-326feca3e07c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -173,22 +175,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CA296F1\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:53 GMT", + "etag": "\"0x8DA7C0F268A556C\"", + "last-modified": "Fri, 12 Aug 2022 03:02:53 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "aef273a0-96e8-402b-71e5-a94166d637a8", - "x-ms-request-id": "6c74efd8-101a-007d-0b6a-02ce24000000", + "x-ms-client-request-id": "dbd258de-2549-47ab-63d4-326feca3e07c", + "x-ms-file-last-write-time": "2022-08-12T03:02:53.9300204Z", + "x-ms-request-id": "9ae87ddf-d01a-0062-60f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "26623e5d-b5c0-4e69-6120-6406da2d6894", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3fe888d8-37e9-4875-6260-9c2f88c65b00", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -197,22 +200,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815CA5F1D2\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:54 GMT", + "etag": "\"0x8DA7C0F26B8FFC8\"", + "last-modified": "Fri, 12 Aug 2022 03:02:54 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "26623e5d-b5c0-4e69-6120-6406da2d6894", - "x-ms-request-id": "65911886-b01a-0016-446a-0249d0000000", + "x-ms-client-request-id": "3fe888d8-37e9-4875-6260-9c2f88c65b00", + "x-ms-file-last-write-time": "2022-08-12T03:02:54.2358472Z", + "x-ms-request-id": "9ae87de2-d01a-0062-61f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8dc0edcc-8009-4d22-4de0-a3e710c9672a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "096669a3-e388-406f-7a21-f7abf6bc57ce", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -221,22 +225,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CA925AA\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:54 GMT", + "etag": "\"0x8DA7C0F26E78314\"", + "last-modified": "Fri, 12 Aug 2022 03:02:54 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8dc0edcc-8009-4d22-4de0-a3e710c9672a", - "x-ms-request-id": "6c74efd9-101a-007d-0c6a-02ce24000000", + "x-ms-client-request-id": "096669a3-e388-406f-7a21-f7abf6bc57ce", + "x-ms-file-last-write-time": "2022-08-12T03:02:54.5406740Z", + "x-ms-request-id": "9ae87de3-d01a-0062-62f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "92931d54-3fc0-45ed-7079-eee2cca0fd9b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "302556a0-c9e7-4a2e-473f-74cc11034bbc", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -245,22 +250,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815CACA797\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:54 GMT", + "etag": "\"0x8DA7C0F2715913B\"", + "last-modified": "Fri, 12 Aug 2022 03:02:54 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "92931d54-3fc0-45ed-7079-eee2cca0fd9b", - "x-ms-request-id": "65911887-b01a-0016-456a-0249d0000000", + "x-ms-client-request-id": "302556a0-c9e7-4a2e-473f-74cc11034bbc", + "x-ms-file-last-write-time": "2022-08-12T03:02:54.8425019Z", + "x-ms-request-id": "9ae87de4-d01a-0062-63f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "44a249f2-4779-4104-6a8c-758c5d115a46", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c5c1f2bf-a9ed-4e6a-735f-8f43b3fdbbb1", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -269,22 +275,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CAF183E\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:54 GMT", + "etag": "\"0x8DA7C0F2743ED85\"", + "last-modified": "Fri, 12 Aug 2022 03:02:55 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "44a249f2-4779-4104-6a8c-758c5d115a46", - "x-ms-request-id": "6c74efdb-101a-007d-0e6a-02ce24000000", + "x-ms-client-request-id": "c5c1f2bf-a9ed-4e6a-735f-8f43b3fdbbb1", + "x-ms-file-last-write-time": "2022-08-12T03:02:55.1463301Z", + "x-ms-request-id": "9ae87de6-d01a-0062-64f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e9dd9b93-291b-4afb-717e-5e528a778854", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b95c0ed2-469e-4ab1-64e5-92222f65d48b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -293,22 +300,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "kUe8Hw8g6K4ZMuYWtRJA+w==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CB188E7\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:02:55 GMT", + "etag": "\"0x8DA7C0F27711170\"", + "last-modified": "Fri, 12 Aug 2022 03:02:55 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e9dd9b93-291b-4afb-717e-5e528a778854", - "x-ms-request-id": "6c74efdc-101a-007d-0f6a-02ce24000000", + "x-ms-client-request-id": "b95c0ed2-469e-4ab1-64e5-92222f65d48b", + "x-ms-file-last-write-time": "2022-08-12T03:02:55.4421616Z", + "x-ms-request-id": "9ae87de7-d01a-0062-65f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "73a173c4-62d4-4b91-7158-bd3ac6663ea1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "411c4c74-b5c1-430c-5440-994afa360cff", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -317,22 +325,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815CB2C132\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:16 GMT", + "etag": "\"0x8DA7C0F343AD023\"", + "last-modified": "Fri, 12 Aug 2022 03:03:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "73a173c4-62d4-4b91-7158-bd3ac6663ea1", - "x-ms-request-id": "65911888-b01a-0016-466a-0249d0000000", + "x-ms-client-request-id": "411c4c74-b5c1-430c-5440-994afa360cff", + "x-ms-file-last-write-time": "2022-08-12T03:03:16.8969763Z", + "x-ms-request-id": "9ae87e15-d01a-0062-03f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e84095e0-2ddb-4cf4-6d5e-d2c29de66c79", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "875acc87-8c6c-40b4-6074-d191af829d73", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -345,18 +354,18 @@ "content-language": "en-US", "content-length": "4194816", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815CB2C132\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:16 GMT", + "etag": "\"0x8DA7C0F343AD023\"", + "last-modified": "Fri, 12 Aug 2022 03:03:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e84095e0-2ddb-4cf4-6d5e-d2c29de66c79", + "x-ms-client-request-id": "875acc87-8c6c-40b4-6074-d191af829d73", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.1824537Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.1824537Z", + "x-ms-file-change-time": "2022-08-12T03:03:16.8969763Z", + "x-ms-file-creation-time": "2022-08-12T03:02:52.7247047Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.1824537Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:16.8969763Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -364,18 +373,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "65911889-b01a-0016-476a-0249d0000000", + "x-ms-request-id": "9ae87e18-d01a-0062-04f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8ac92bcb-7de2-4ddb-5cea-37ddb3447cd7", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b60cd286-b696-4081-4575-38bcc81aa032", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -389,18 +398,18 @@ "content-language": "en-US", "content-length": "4194816", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", - "etag": "\"0x8D9D0815CB2C132\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:17 GMT", + "etag": "\"0x8DA7C0F343AD023\"", + "last-modified": "Fri, 12 Aug 2022 03:03:16 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8ac92bcb-7de2-4ddb-5cea-37ddb3447cd7", + "x-ms-client-request-id": "b60cd286-b696-4081-4575-38bcc81aa032", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.1824537Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.1824537Z", + "x-ms-file-change-time": "2022-08-12T03:03:16.8969763Z", + "x-ms-file-creation-time": "2022-08-12T03:02:52.7247047Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.1824537Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:16.8969763Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -408,18 +417,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "6591188a-b01a-0016-486a-0249d0000000", + "x-ms-request-id": "9ae87e1c-d01a-0062-08f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816/fromBuffer-c2s4194816base/fromBuffer-c2s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a4881daf-47c5-477b-46a9-38101ce98b27", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5b51c1c6-0eba-469f-4d7b-b3e855ac520b", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -427,19 +436,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:03:20 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a4881daf-47c5-477b-46a9-38101ce98b27", - "x-ms-request-id": "6591188c-b01a-0016-496a-0249d0000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "5b51c1c6-0eba-469f-4d7b-b3e855ac520b", + "x-ms-request-id": "9ae87e45-d01a-0062-0cf8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e8466d6c-fb98-4d81-6e45-44fcc435bfa8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3aff0281-c289-4e3f-4aff-a7437e609bac", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -447,19 +456,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:03:20 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e8466d6c-fb98-4d81-6e45-44fcc435bfa8", - "x-ms-request-id": "6591188d-b01a-0016-4a6a-0249d0000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "3aff0281-c289-4e3f-4aff-a7437e609bac", + "x-ms-request-id": "9ae87e46-d01a-0062-0df8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2c56ed79-5499-4f07-6b84-50ebd4823d8a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d5a13eea-0e95-42d4-7ae4-3c87142ed7e4", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -467,11 +476,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:06 GMT", + "date": "Fri, 12 Aug 2022 03:03:20 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2c56ed79-5499-4f07-6b84-50ebd4823d8a", - "x-ms-request-id": "6591188e-b01a-0016-4b6a-0249d0000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d5a13eea-0e95-42d4-7ae4-3c87142ed7e4", + "x-ms-request-id": "9ae87e47-d01a-0062-0ef8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s4194816?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s512.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s512.json index fe44314b30..08893744f2 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s512.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c2s512.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "280c15f2-8b4c-4433-559e-f9c1d7904da0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "83492eb9-618c-49e6-5da3-696c8b5986fe", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BCB3FFE\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:39 GMT", + "etag": "\"0x8DA7C0F1E01770F\"", + "last-modified": "Fri, 12 Aug 2022 03:02:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "280c15f2-8b4c-4433-559e-f9c1d7904da0", - "x-ms-request-id": "f94915b4-301a-0027-6b6a-02a8c3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "83492eb9-618c-49e6-5da3-696c8b5986fe", + "x-ms-request-id": "9ae87c2f-d01a-0062-63f7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "01c4db1e-b86c-4b97-42e7-9546e4e1a274", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3813ecdb-3c5e-4f29-6277-5ee97a2d81a7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BCF1247\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:39 GMT", + "etag": "\"0x8DA7C0F1E2EBDA5\"", + "last-modified": "Fri, 12 Aug 2022 03:02:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "01c4db1e-b86c-4b97-42e7-9546e4e1a274", + "x-ms-client-request-id": "3813ecdb-3c5e-4f29-6277-5ee97a2d81a7", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:05.9291719Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.9291719Z", + "x-ms-file-change-time": "2022-08-12T03:02:39.9079845Z", + "x-ms-file-creation-time": "2022-08-12T03:02:39.9079845Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.9291719Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:39.9079845Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "f94915b7-301a-0027-6c6a-02a8c3000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87c46-d01a-0062-79f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512/fromBuffer-c2s512base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8e4a3f5b-6804-454a-64a4-fe7ff02ee39f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8f96b159-65a9-4144-55be-1cd69a67ee50", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BD1A9F3\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:39 GMT", + "etag": "\"0x8DA7C0F1E5C7DC7\"", + "last-modified": "Fri, 12 Aug 2022 03:02:40 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8e4a3f5b-6804-454a-64a4-fe7ff02ee39f", + "x-ms-client-request-id": "8f96b159-65a9-4144-55be-1cd69a67ee50", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.9461619Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.9461619Z", + "x-ms-file-change-time": "2022-08-12T03:02:40.2078151Z", + "x-ms-file-creation-time": "2022-08-12T03:02:40.2078151Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.9461619Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:40.2078151Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "f94915b9-301a-0027-6d6a-02a8c3000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87c66-d01a-0062-19f7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512/fromBuffer-c2s512base/fromBuffer-c2s512basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d7f20d4d-7545-49f1-5b19-071cc9c74b72", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0114e020-fa01-43fc-583d-4aff3c289800", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BD3CC89\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:40 GMT", + "etag": "\"0x8DA7C0F1E89EFBC\"", + "last-modified": "Fri, 12 Aug 2022 03:02:40 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d7f20d4d-7545-49f1-5b19-071cc9c74b72", + "x-ms-client-request-id": "0114e020-fa01-43fc-583d-4aff3c289800", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.9601545Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.9601545Z", + "x-ms-file-change-time": "2022-08-12T03:02:40.5056444Z", + "x-ms-file-creation-time": "2022-08-12T03:02:40.5056444Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.9601545Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:40.5056444Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "f94915ba-301a-0027-6e6a-02a8c3000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87c77-d01a-0062-2af7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512/fromBuffer-c2s512base/fromBuffer-c2s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "9470a5c3-9150-4074-5e45-713c8b64199f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fbb6c8a6-060e-4015-6f99-36f5f03c6185", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "kUe8Hw8g6K4ZMuYWtRJA+w==", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BD70061\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:40 GMT", + "etag": "\"0x8DA7C0F1EB73AB6\"", + "last-modified": "Fri, 12 Aug 2022 03:02:40 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "9470a5c3-9150-4074-5e45-713c8b64199f", - "x-ms-request-id": "f94915bb-301a-0027-6f6a-02a8c3000000", + "x-ms-client-request-id": "fbb6c8a6-060e-4015-6f99-36f5f03c6185", + "x-ms-file-last-write-time": "2022-08-12T03:02:40.8024758Z", + "x-ms-request-id": "9ae87c8a-d01a-0062-3df7-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512/fromBuffer-c2s512base/fromBuffer-c2s512?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f7b14fce-c5e8-41f4-520f-70a57b3a3e6f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3aee8f8e-0f6a-4904-4d31-47b4cc6d60e9", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "512", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BD70061\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:40 GMT", + "etag": "\"0x8DA7C0F1EB73AB6\"", + "last-modified": "Fri, 12 Aug 2022 03:02:40 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f7b14fce-c5e8-41f4-520f-70a57b3a3e6f", + "x-ms-client-request-id": "3aee8f8e-0f6a-4904-4d31-47b4cc6d60e9", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.9601545Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.9601545Z", + "x-ms-file-change-time": "2022-08-12T03:02:40.8024758Z", + "x-ms-file-creation-time": "2022-08-12T03:02:40.5056444Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.9601545Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:40.8024758Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "f94915bc-301a-0027-706a-02a8c3000000", + "x-ms-request-id": "9ae87c9b-d01a-0062-4ef7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512/fromBuffer-c2s512base/fromBuffer-c2s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "03f169de-487a-490f-65d0-b1f86c4a30da", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d2e94ea2-4740-4b5f-700a-7c6973839796", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "512", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", - "etag": "\"0x8D9D0815BD70061\"", - "last-modified": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:41 GMT", + "etag": "\"0x8DA7C0F1EB73AB6\"", + "last-modified": "Fri, 12 Aug 2022 03:02:40 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "03f169de-487a-490f-65d0-b1f86c4a30da", + "x-ms-client-request-id": "d2e94ea2-4740-4b5f-700a-7c6973839796", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:05.9601545Z", - "x-ms-file-creation-time": "2022-01-05T19:27:05.9601545Z", + "x-ms-file-change-time": "2022-08-12T03:02:40.8024758Z", + "x-ms-file-creation-time": "2022-08-12T03:02:40.5056444Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:05.9601545Z", + "x-ms-file-last-write-time": "2022-08-12T03:02:40.8024758Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "f94915be-301a-0027-726a-02a8c3000000", + "x-ms-request-id": "9ae87ca8-d01a-0062-5bf7-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512/fromBuffer-c2s512base/fromBuffer-c2s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1afce64e-1796-48dd-6811-cdf5665d8dcc", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "098200a6-a583-4b5b-4457-abca797c8c74", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1afce64e-1796-48dd-6811-cdf5665d8dcc", - "x-ms-request-id": "f94915bf-301a-0027-736a-02a8c3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "098200a6-a583-4b5b-4457-abca797c8c74", + "x-ms-request-id": "9ae87cbc-d01a-0062-6cf7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0f92b4b8-b9c9-44ba-7874-d14b19ad91ad", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9f7f56ec-af32-42ba-4949-5695e12bcd4a", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0f92b4b8-b9c9-44ba-7874-d14b19ad91ad", - "x-ms-request-id": "f94915c0-301a-0027-746a-02a8c3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "9f7f56ec-af32-42ba-4949-5695e12bcd4a", + "x-ms-request-id": "9ae87cca-d01a-0062-7af7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d32dbb60-087d-4e83-7d14-4ff4ae2d08bc", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "310c8c39-d2fc-4bc7-5a5f-8d00d997aebf", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:05 GMT", + "date": "Fri, 12 Aug 2022 03:02:42 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d32dbb60-087d-4e83-7d14-4ff4ae2d08bc", - "x-ms-request-id": "f94915c1-301a-0027-756a-02a8c3000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "310c8c39-d2fc-4bc7-5a5f-8d00d997aebf", + "x-ms-request-id": "9ae87ccf-d01a-0062-7ff7-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c2s512?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s0.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s0.json index 659afdab65..185a9ff735 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s0.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s0.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "51106c1d-fe89-416b-4800-1b2831e4e63a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7912c25c-1a21-43ef-647a-affc4e024541", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CDB739A\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:21 GMT", + "etag": "\"0x8DA7C0F36F1DB01\"", + "last-modified": "Fri, 12 Aug 2022 03:03:21 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "51106c1d-fe89-416b-4800-1b2831e4e63a", - "x-ms-request-id": "77f7fe0f-601a-0005-7f6a-026ddc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "7912c25c-1a21-43ef-647a-affc4e024541", + "x-ms-request-id": "9ae87e49-d01a-0062-0ff8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5963f770-0061-4299-7d87-79507c18504f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e0b46b75-2c9b-4c9d-5a98-abcc7cb5abf7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CDED3CC\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:21 GMT", + "etag": "\"0x8DA7C0F371FD10C\"", + "last-modified": "Fri, 12 Aug 2022 03:03:21 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5963f770-0061-4299-7d87-79507c18504f", + "x-ms-client-request-id": "e0b46b75-2c9b-4c9d-5a98-abcc7cb5abf7", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:07.7101516Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.7101516Z", + "x-ms-file-change-time": "2022-08-12T03:03:21.7532172Z", + "x-ms-file-creation-time": "2022-08-12T03:03:21.7532172Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.7101516Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:21.7532172Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "77f7fe12-601a-0005-806a-026ddc000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87e4b-d01a-0062-10f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0/fromBuffer-c5s0base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bf726faf-a1e7-428d-76d7-cbaa5b2f5475", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2fe17beb-e71d-490a-5145-0813f7bd3224", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CE1E098\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:21 GMT", + "etag": "\"0x8DA7C0F374DDF3C\"", + "last-modified": "Fri, 12 Aug 2022 03:03:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bf726faf-a1e7-428d-76d7-cbaa5b2f5475", + "x-ms-client-request-id": "2fe17beb-e71d-490a-5145-0813f7bd3224", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.7301400Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.7301400Z", + "x-ms-file-change-time": "2022-08-12T03:03:22.0550460Z", + "x-ms-file-creation-time": "2022-08-12T03:03:22.0550460Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.7301400Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:22.0550460Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "77f7fe13-601a-0005-016a-026ddc000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e4c-d01a-0062-11f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0/fromBuffer-c5s0base/fromBuffer-c5s0basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8bae3f3b-1d14-47cd-5c28-0f43e59ad0bd", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1d6ec1e7-c64c-42d4-5382-32185490f5cf", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CE40329\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:22 GMT", + "etag": "\"0x8DA7C0F377B033E\"", + "last-modified": "Fri, 12 Aug 2022 03:03:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8bae3f3b-1d14-47cd-5c28-0f43e59ad0bd", + "x-ms-client-request-id": "1d6ec1e7-c64c-42d4-5382-32185490f5cf", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.7441321Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.7441321Z", + "x-ms-file-change-time": "2022-08-12T03:03:22.3508798Z", + "x-ms-file-creation-time": "2022-08-12T03:03:22.3508798Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.7441321Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:22.3508798Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "77f7fe14-601a-0005-026a-026ddc000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e50-d01a-0062-14f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0/fromBuffer-c5s0base/fromBuffer-c5s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "4d501674-0b73-4430-7d01-d66c1aceeb39", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "079c9fdc-ab7f-437d-6b0c-7b0bbff64d8a", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -129,18 +129,18 @@ "content-language": "en-US", "content-length": "0", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CE40329\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:22 GMT", + "etag": "\"0x8DA7C0F377B033E\"", + "last-modified": "Fri, 12 Aug 2022 03:03:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "4d501674-0b73-4430-7d01-d66c1aceeb39", + "x-ms-client-request-id": "079c9fdc-ab7f-437d-6b0c-7b0bbff64d8a", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.7441321Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.7441321Z", + "x-ms-file-change-time": "2022-08-12T03:03:22.3508798Z", + "x-ms-file-creation-time": "2022-08-12T03:03:22.3508798Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.7441321Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:22.3508798Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -148,18 +148,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "77f7fe15-601a-0005-036a-026ddc000000", + "x-ms-request-id": "9ae87e51-d01a-0062-15f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0/fromBuffer-c5s0base/fromBuffer-c5s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d7a06f74-42d2-44cd-74d7-434759d70f3b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f6c3d26a-70fa-4277-676b-639f5384fcf9", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -173,18 +173,18 @@ "content-language": "en-US", "content-length": "0", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CE40329\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:22 GMT", + "etag": "\"0x8DA7C0F377B033E\"", + "last-modified": "Fri, 12 Aug 2022 03:03:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d7a06f74-42d2-44cd-74d7-434759d70f3b", + "x-ms-client-request-id": "f6c3d26a-70fa-4277-676b-639f5384fcf9", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.7441321Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.7441321Z", + "x-ms-file-change-time": "2022-08-12T03:03:22.3508798Z", + "x-ms-file-creation-time": "2022-08-12T03:03:22.3508798Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.7441321Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:22.3508798Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -192,18 +192,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "77f7fe16-601a-0005-046a-026ddc000000", + "x-ms-request-id": "9ae87e52-d01a-0062-16f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0/fromBuffer-c5s0base/fromBuffer-c5s0" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bee6c63a-47df-4c38-56e4-d32aac4eb1f7", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fb1524a7-5857-4a23-71db-6a5954830d2b", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -211,19 +211,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:22 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bee6c63a-47df-4c38-56e4-d32aac4eb1f7", - "x-ms-request-id": "77f7fe17-601a-0005-056a-026ddc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "fb1524a7-5857-4a23-71db-6a5954830d2b", + "x-ms-request-id": "9ae87e53-d01a-0062-17f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f33f725b-fc91-435d-68d2-e427f730701a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f709e409-69c0-4fd7-6666-aa320aded08b", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -231,19 +231,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:23 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f33f725b-fc91-435d-68d2-e427f730701a", - "x-ms-request-id": "77f7fe18-601a-0005-066a-026ddc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "f709e409-69c0-4fd7-6666-aa320aded08b", + "x-ms-request-id": "9ae87e57-d01a-0062-18f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f9bb8532-007a-461e-4a2c-eba3cda86f21", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "70373504-1178-4ce1-6020-1fbbf5572b59", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -251,11 +251,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:23 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f9bb8532-007a-461e-4a2c-eba3cda86f21", - "x-ms-request-id": "77f7fe19-601a-0005-076a-026ddc000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "70373504-1178-4ce1-6020-1fbbf5572b59", + "x-ms-request-id": "9ae87e58-d01a-0062-19f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s0?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1024.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1024.json index 470bf5ffad..927e406dcd 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1024.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1024.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6c48d217-25d1-40a8-535a-28118d609041", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "0b76f80c-e52a-4689-6a56-cd99d55aec95", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D140D2B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:26 GMT", + "etag": "\"0x8DA7C0F3A534A54\"", + "last-modified": "Fri, 12 Aug 2022 03:03:27 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6c48d217-25d1-40a8-535a-28118d609041", - "x-ms-request-id": "498ef470-501a-001e-376a-0253df000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "0b76f80c-e52a-4689-6a56-cd99d55aec95", + "x-ms-request-id": "9ae87e71-d01a-0062-2ef8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1b6149e4-93ab-4d38-7480-3522e0d86ce4", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "221fdad3-4a49-4c18-6e4e-1b7beeb10611", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D178EB9\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:27 GMT", + "etag": "\"0x8DA7C0F3A80A6AC\"", + "last-modified": "Fri, 12 Aug 2022 03:03:27 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1b6149e4-93ab-4d38-7480-3522e0d86ce4", + "x-ms-client-request-id": "221fdad3-4a49-4c18-6e4e-1b7beeb10611", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:08.0819385Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.0819385Z", + "x-ms-file-change-time": "2022-08-12T03:03:27.4209964Z", + "x-ms-file-creation-time": "2022-08-12T03:03:27.4209964Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.0819385Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:27.4209964Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "498ef473-501a-001e-386a-0253df000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87e73-d01a-0062-2ff8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024/fromBuffer-c5s1024base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a9e4e746-9e53-41ee-7e0b-5b8757d87e16", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "14103357-44c4-4cef-74f3-bb6336349253", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D19D853\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:27 GMT", + "etag": "\"0x8DA7C0F3AAE66CC\"", + "last-modified": "Fri, 12 Aug 2022 03:03:27 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a9e4e746-9e53-41ee-7e0b-5b8757d87e16", + "x-ms-client-request-id": "14103357-44c4-4cef-74f3-bb6336349253", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.0969299Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.0969299Z", + "x-ms-file-change-time": "2022-08-12T03:03:27.7208268Z", + "x-ms-file-creation-time": "2022-08-12T03:03:27.7208268Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.0969299Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:27.7208268Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "498ef475-501a-001e-396a-0253df000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e75-d01a-0062-31f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024/fromBuffer-c5s1024base/fromBuffer-c5s1024basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0d07b229-9370-4ef1-4dea-b9ccff2db053", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5041dc9f-44d4-40bd-60bc-00a7dc1ea18f", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D1BFAE7\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:27 GMT", + "etag": "\"0x8DA7C0F3ADB3CA6\"", + "last-modified": "Fri, 12 Aug 2022 03:03:28 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0d07b229-9370-4ef1-4dea-b9ccff2db053", + "x-ms-client-request-id": "5041dc9f-44d4-40bd-60bc-00a7dc1ea18f", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.1109223Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.1109223Z", + "x-ms-file-change-time": "2022-08-12T03:03:28.0146598Z", + "x-ms-file-creation-time": "2022-08-12T03:03:28.0146598Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.1109223Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:28.0146598Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "498ef476-501a-001e-3a6a-0253df000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e76-d01a-0062-32f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024/fromBuffer-c5s1024base/fromBuffer-c5s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "4168757f-5898-461d-7db0-2e21c444d554", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "068e09a6-2434-4b43-738f-5da7ebc482c5", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "cmX00hG1aHOjgdMh9YbkqQ==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D1EE0A6\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:28 GMT", + "etag": "\"0x8DA7C0F3B08D5B3\"", + "last-modified": "Fri, 12 Aug 2022 03:03:28 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "4168757f-5898-461d-7db0-2e21c444d554", - "x-ms-request-id": "498ef477-501a-001e-3b6a-0253df000000", + "x-ms-client-request-id": "068e09a6-2434-4b43-738f-5da7ebc482c5", + "x-ms-file-last-write-time": "2022-08-12T03:03:28.3134899Z", + "x-ms-request-id": "9ae87e77-d01a-0062-33f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024/fromBuffer-c5s1024base/fromBuffer-c5s1024?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6bec9a8d-d95d-4fb8-734e-b3742da4620d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "48316272-9b22-4811-60cc-262031881132", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D1EE0A6\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:28 GMT", + "etag": "\"0x8DA7C0F3B08D5B3\"", + "last-modified": "Fri, 12 Aug 2022 03:03:28 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6bec9a8d-d95d-4fb8-734e-b3742da4620d", + "x-ms-client-request-id": "48316272-9b22-4811-60cc-262031881132", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.1109223Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.1109223Z", + "x-ms-file-change-time": "2022-08-12T03:03:28.3134899Z", + "x-ms-file-creation-time": "2022-08-12T03:03:28.0146598Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.1109223Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:28.3134899Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "498ef478-501a-001e-3c6a-0253df000000", + "x-ms-request-id": "9ae87e78-d01a-0062-34f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024/fromBuffer-c5s1024base/fromBuffer-c5s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "8851cd93-2de5-4e00-51a4-0c45b3490b49", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ceb51b18-956f-4f2d-4a4a-7e090fc2c99f", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "1024", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D1EE0A6\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:28 GMT", + "etag": "\"0x8DA7C0F3B08D5B3\"", + "last-modified": "Fri, 12 Aug 2022 03:03:28 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "8851cd93-2de5-4e00-51a4-0c45b3490b49", + "x-ms-client-request-id": "ceb51b18-956f-4f2d-4a4a-7e090fc2c99f", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.1109223Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.1109223Z", + "x-ms-file-change-time": "2022-08-12T03:03:28.3134899Z", + "x-ms-file-creation-time": "2022-08-12T03:03:28.0146598Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.1109223Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:28.3134899Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "498ef479-501a-001e-3d6a-0253df000000", + "x-ms-request-id": "9ae87e79-d01a-0062-35f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024/fromBuffer-c5s1024base/fromBuffer-c5s1024" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ad1024fa-df3f-4b47-45a7-33d01ff85380", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ce4844e3-3219-4a3d-793a-7476cdaa6164", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:28 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ad1024fa-df3f-4b47-45a7-33d01ff85380", - "x-ms-request-id": "498ef47a-501a-001e-3e6a-0253df000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "ce4844e3-3219-4a3d-793a-7476cdaa6164", + "x-ms-request-id": "9ae87e7c-d01a-0062-36f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "e5340984-d1b3-437c-6a7e-50f2ca0546be", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "313f9a28-1676-483c-4ba5-d7f8a5a7c524", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:29 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "e5340984-d1b3-437c-6a7e-50f2ca0546be", - "x-ms-request-id": "498ef47b-501a-001e-3f6a-0253df000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "313f9a28-1676-483c-4ba5-d7f8a5a7c524", + "x-ms-request-id": "9ae87e7e-d01a-0062-37f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2c4d917e-cde5-4216-4c54-d7df157eef1d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "76bd506e-27d0-4280-43f6-51e20ede46ad", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:29 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2c4d917e-cde5-4216-4c54-d7df157eef1d", - "x-ms-request-id": "498ef47c-501a-001e-406a-0253df000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "76bd506e-27d0-4280-43f6-51e20ede46ad", + "x-ms-request-id": "9ae87e7f-d01a-0062-38f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1024?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1048576.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1048576.json index ddf1875e77..b800dfa46a 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1048576.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s1048576.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "d6624cb1-550e-4db8-54f5-c93e4fa543f9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2d564ea9-c4a3-4ea5-4bb8-dc6d33fa1a76", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", - "etag": "\"0x8D9D0815D50D3B9\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:32 GMT", + "etag": "\"0x8DA7C0F3DDCFC29\"", + "last-modified": "Fri, 12 Aug 2022 03:03:33 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "d6624cb1-550e-4db8-54f5-c93e4fa543f9", - "x-ms-request-id": "a20512b0-901a-003e-346a-022878000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "2d564ea9-c4a3-4ea5-4bb8-dc6d33fa1a76", + "x-ms-request-id": "9ae87e8c-d01a-0062-43f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6341c41e-047d-4c8b-77d0-ace25fb03142", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b78e520c-a888-4d49-5ddb-e482a7cb7ab6", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", - "etag": "\"0x8D9D0815D54B5D2\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:33 GMT", + "etag": "\"0x8DA7C0F3E0A5B2D\"", + "last-modified": "Fri, 12 Aug 2022 03:03:33 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6341c41e-047d-4c8b-77d0-ace25fb03142", + "x-ms-client-request-id": "b78e520c-a888-4d49-5ddb-e482a7cb7ab6", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:08.4827090Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.4827090Z", + "x-ms-file-change-time": "2022-08-12T03:03:33.3566253Z", + "x-ms-file-creation-time": "2022-08-12T03:03:33.3566253Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.4827090Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:33.3566253Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "a20512b3-901a-003e-356a-022878000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87e8e-d01a-0062-44f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576/fromBuffer-c5s1048576base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "82466bd1-7610-4018-7141-292f51c14c54", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3f835cbf-86af-4267-7876-ad55207c7dba", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", - "etag": "\"0x8D9D0815D57267B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:33 GMT", + "etag": "\"0x8DA7C0F3E37F430\"", + "last-modified": "Fri, 12 Aug 2022 03:03:33 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "82466bd1-7610-4018-7141-292f51c14c54", + "x-ms-client-request-id": "3f835cbf-86af-4267-7876-ad55207c7dba", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.4987003Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.4987003Z", + "x-ms-file-change-time": "2022-08-12T03:03:33.6554544Z", + "x-ms-file-creation-time": "2022-08-12T03:03:33.6554544Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.4987003Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:33.6554544Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "a20512b4-901a-003e-366a-022878000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e8f-d01a-0062-45f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576/fromBuffer-c5s1048576base/fromBuffer-c5s1048576basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "07381446-cb03-48a3-56d0-fd2bddd8ad43", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a0d90a9e-cfb3-4995-6d20-bd0a3e04ee1d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", - "etag": "\"0x8D9D0815D597010\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:33 GMT", + "etag": "\"0x8DA7C0F3E651834\"", + "last-modified": "Fri, 12 Aug 2022 03:03:33 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "07381446-cb03-48a3-56d0-fd2bddd8ad43", + "x-ms-client-request-id": "a0d90a9e-cfb3-4995-6d20-bd0a3e04ee1d", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.5136912Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.5136912Z", + "x-ms-file-change-time": "2022-08-12T03:03:33.9512884Z", + "x-ms-file-creation-time": "2022-08-12T03:03:33.9512884Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.5136912Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:33.9512884Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "a20512b5-901a-003e-376a-022878000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e92-d01a-0062-46f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576/fromBuffer-c5s1048576base/fromBuffer-c5s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2f44193b-8e91-44b9-7163-db78e337d3dc", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "73aa4396-2a32-443f-4b36-36bbeb08546c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "tWH4cgLQSVnjdYjuBc9bEA==", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", - "etag": "\"0x8D9D0815D65071D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:34 GMT", + "etag": "\"0x8DA7C0F3EBF870F\"", + "last-modified": "Fri, 12 Aug 2022 03:03:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2f44193b-8e91-44b9-7163-db78e337d3dc", - "x-ms-request-id": "a20512b6-901a-003e-386a-022878000000", + "x-ms-client-request-id": "73aa4396-2a32-443f-4b36-36bbeb08546c", + "x-ms-file-last-write-time": "2022-08-12T03:03:34.5439503Z", + "x-ms-request-id": "9ae87e93-d01a-0062-47f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576/fromBuffer-c5s1048576base/fromBuffer-c5s1048576?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "931e6048-44cd-4ef2-7bcb-93acf12f89f1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "70772db3-07e2-41c7-5bf7-cf53e0162e50", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "1048576", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", - "etag": "\"0x8D9D0815D65071D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:34 GMT", + "etag": "\"0x8DA7C0F3EBF870F\"", + "last-modified": "Fri, 12 Aug 2022 03:03:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "931e6048-44cd-4ef2-7bcb-93acf12f89f1", + "x-ms-client-request-id": "70772db3-07e2-41c7-5bf7-cf53e0162e50", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.5136912Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.5136912Z", + "x-ms-file-change-time": "2022-08-12T03:03:34.5439503Z", + "x-ms-file-creation-time": "2022-08-12T03:03:33.9512884Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.5136912Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:34.5439503Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "a20512b7-901a-003e-396a-022878000000", + "x-ms-request-id": "9ae87e94-d01a-0062-48f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576/fromBuffer-c5s1048576base/fromBuffer-c5s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0fdb64b2-d595-4944-5eaf-2c22a977f57e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c1ce072d-d423-45c2-5242-2be0de87758b", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "1048576", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", - "etag": "\"0x8D9D0815D65071D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:34 GMT", + "etag": "\"0x8DA7C0F3EBF870F\"", + "last-modified": "Fri, 12 Aug 2022 03:03:34 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0fdb64b2-d595-4944-5eaf-2c22a977f57e", + "x-ms-client-request-id": "c1ce072d-d423-45c2-5242-2be0de87758b", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.5136912Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.5136912Z", + "x-ms-file-change-time": "2022-08-12T03:03:34.5439503Z", + "x-ms-file-creation-time": "2022-08-12T03:03:33.9512884Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.5136912Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:34.5439503Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "a20512b8-901a-003e-3a6a-022878000000", + "x-ms-request-id": "9ae87e98-d01a-0062-4cf8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576/fromBuffer-c5s1048576base/fromBuffer-c5s1048576" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "ee4c0565-4bea-4415-6312-41a9838e32f7", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7ab5d30c-081f-4c13-42bf-091091805172", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ee4c0565-4bea-4415-6312-41a9838e32f7", - "x-ms-request-id": "a20512b9-901a-003e-3b6a-022878000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "7ab5d30c-081f-4c13-42bf-091091805172", + "x-ms-request-id": "9ae87e9d-d01a-0062-51f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6682da30-37dc-4437-497d-d52925cdff70", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "53c1624e-0a4b-4425-7308-b141c04dbe00", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6682da30-37dc-4437-497d-d52925cdff70", - "x-ms-request-id": "a20512ba-901a-003e-3c6a-022878000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "53c1624e-0a4b-4425-7308-b141c04dbe00", + "x-ms-request-id": "9ae87ea0-d01a-0062-53f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2f161f70-9061-4db2-53ff-1943f4ee75e0", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "50a72d50-5606-449e-6469-032375670484", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:36 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2f161f70-9061-4db2-53ff-1943f4ee75e0", - "x-ms-request-id": "a20512bb-901a-003e-3d6a-022878000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "50a72d50-5606-449e-6469-032375670484", + "x-ms-request-id": "9ae87ea3-d01a-0062-56f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s1048576?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4096.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4096.json index 8ecec2481a..0483c4d0bc 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4096.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4096.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "9e09abba-f22e-4592-6b8d-e98e608599d7", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ff700968-3caf-417d-4644-098fb8ea182d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D32D143\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:29 GMT", + "etag": "\"0x8DA7C0F3C179A9B\"", + "last-modified": "Fri, 12 Aug 2022 03:03:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "9e09abba-f22e-4592-6b8d-e98e608599d7", - "x-ms-request-id": "762dd829-d01a-0062-426a-027d20000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "ff700968-3caf-417d-4644-098fb8ea182d", + "x-ms-request-id": "9ae87e80-d01a-0062-39f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "25258700-40fe-4a12-6146-900021eab8be", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "99983846-ca1e-48e4-45ac-748ebe2d043b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D36AAEA\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:30 GMT", + "etag": "\"0x8DA7C0F3C44D13F\"", + "last-modified": "Fri, 12 Aug 2022 03:03:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "25258700-40fe-4a12-6146-900021eab8be", + "x-ms-client-request-id": "99983846-ca1e-48e4-45ac-748ebe2d043b", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:08.2858218Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.2858218Z", + "x-ms-file-change-time": "2022-08-12T03:03:30.3843135Z", + "x-ms-file-creation-time": "2022-08-12T03:03:30.3843135Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.2858218Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:30.3843135Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "762dd82c-d01a-0062-436a-027d20000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87e82-d01a-0062-3af8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096/fromBuffer-c5s4096base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b87dd199-3645-4bff-75de-7cb40e08782f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "015341c7-9dd4-4a6d-4d2e-77fe54e5a71b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D3A53E4\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:30 GMT", + "etag": "\"0x8DA7C0F3C726A54\"", + "last-modified": "Fri, 12 Aug 2022 03:03:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b87dd199-3645-4bff-75de-7cb40e08782f", + "x-ms-client-request-id": "015341c7-9dd4-4a6d-4d2e-77fe54e5a71b", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.3098084Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.3098084Z", + "x-ms-file-change-time": "2022-08-12T03:03:30.6831444Z", + "x-ms-file-creation-time": "2022-08-12T03:03:30.6831444Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.3098084Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:30.6831444Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "762dd82e-d01a-0062-446a-027d20000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e83-d01a-0062-3bf8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096/fromBuffer-c5s4096base/fromBuffer-c5s4096basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "48c48820-0cef-4d53-5efc-c0cdb913e837", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "12813815-23f2-4a78-5457-f395d48ba08b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D3C7670\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:30 GMT", + "etag": "\"0x8DA7C0F3C9FB550\"", + "last-modified": "Fri, 12 Aug 2022 03:03:30 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "48c48820-0cef-4d53-5efc-c0cdb913e837", + "x-ms-client-request-id": "12813815-23f2-4a78-5457-f395d48ba08b", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.3238000Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.3238000Z", + "x-ms-file-change-time": "2022-08-12T03:03:30.9799760Z", + "x-ms-file-creation-time": "2022-08-12T03:03:30.9799760Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.3238000Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:30.9799760Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "762dd830-d01a-0062-456a-027d20000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e84-d01a-0062-3cf8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096/fromBuffer-c5s4096base/fromBuffer-c5s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "419ac644-3c9c-4277-5565-9f08caf973e5", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "2824f8fa-3111-461d-6d24-d69d4b3cf020", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "IEOfeeTp3JW+NLIQKSIfgA==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D3F833D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:31 GMT", + "etag": "\"0x8DA7C0F3CCD9C66\"", + "last-modified": "Fri, 12 Aug 2022 03:03:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "419ac644-3c9c-4277-5565-9f08caf973e5", - "x-ms-request-id": "762dd831-d01a-0062-466a-027d20000000", + "x-ms-client-request-id": "2824f8fa-3111-461d-6d24-d69d4b3cf020", + "x-ms-file-last-write-time": "2022-08-12T03:03:31.2808038Z", + "x-ms-request-id": "9ae87e85-d01a-0062-3df8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096/fromBuffer-c5s4096base/fromBuffer-c5s4096?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b6ecaa2b-be0d-4351-6cd9-2a73cd2ceb01", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a8cb3e80-05fd-41ed-402e-2574752a7528", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "4096", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D3F833D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:31 GMT", + "etag": "\"0x8DA7C0F3CCD9C66\"", + "last-modified": "Fri, 12 Aug 2022 03:03:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b6ecaa2b-be0d-4351-6cd9-2a73cd2ceb01", + "x-ms-client-request-id": "a8cb3e80-05fd-41ed-402e-2574752a7528", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.3238000Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.3238000Z", + "x-ms-file-change-time": "2022-08-12T03:03:31.2808038Z", + "x-ms-file-creation-time": "2022-08-12T03:03:30.9799760Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.3238000Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:31.2808038Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "762dd832-d01a-0062-476a-027d20000000", + "x-ms-request-id": "9ae87e87-d01a-0062-3ef8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096/fromBuffer-c5s4096base/fromBuffer-c5s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "031799f5-028a-406a-5f1f-719de3f83181", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "43fc6d2f-79cc-4b27-7a11-17acdae88563", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "4096", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D3F833D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:08 GMT", + "date": "Fri, 12 Aug 2022 03:03:31 GMT", + "etag": "\"0x8DA7C0F3CCD9C66\"", + "last-modified": "Fri, 12 Aug 2022 03:03:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "031799f5-028a-406a-5f1f-719de3f83181", + "x-ms-client-request-id": "43fc6d2f-79cc-4b27-7a11-17acdae88563", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:08.3238000Z", - "x-ms-file-creation-time": "2022-01-05T19:27:08.3238000Z", + "x-ms-file-change-time": "2022-08-12T03:03:31.2808038Z", + "x-ms-file-creation-time": "2022-08-12T03:03:30.9799760Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:08.3238000Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:31.2808038Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "762dd833-d01a-0062-486a-027d20000000", + "x-ms-request-id": "9ae87e88-d01a-0062-3ff8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096/fromBuffer-c5s4096base/fromBuffer-c5s4096" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "da6f5742-7eb3-458c-6037-b09ac0421d4e", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5e4b5c8f-7d32-4d99-7790-58d70ba1ea5e", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "da6f5742-7eb3-458c-6037-b09ac0421d4e", - "x-ms-request-id": "762dd834-d01a-0062-496a-027d20000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "5e4b5c8f-7d32-4d99-7790-58d70ba1ea5e", + "x-ms-request-id": "9ae87e89-d01a-0062-40f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6afe800d-c77a-41e7-5d75-a6b5f8bd4400", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fdf045ea-e2c0-4423-5d5b-fb1a3d671f58", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6afe800d-c77a-41e7-5d75-a6b5f8bd4400", - "x-ms-request-id": "762dd835-d01a-0062-4a6a-027d20000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "fdf045ea-e2c0-4423-5d5b-fb1a3d671f58", + "x-ms-request-id": "9ae87e8a-d01a-0062-41f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "40a6b8ae-860c-4ba3-6c0e-a0c8139794a1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1d37e727-ec3c-4b10-72e0-884d784511e1", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:32 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "40a6b8ae-860c-4ba3-6c0e-a0c8139794a1", - "x-ms-request-id": "762dd836-d01a-0062-4b6a-027d20000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "1d37e727-ec3c-4b10-72e0-884d784511e1", + "x-ms-request-id": "9ae87e8b-d01a-0062-42f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4096?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4194816.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4194816.json index f5e9404877..e017015fd2 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4194816.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s4194816.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "22d07204-e0e7-42f1-483d-ae77a04274c1", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d648cf57-2701-4856-4810-3e6062610006", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173A32A02\"", - "last-modified": "Wed, 05 Jan 2022 19:27:45 GMT", + "date": "Fri, 12 Aug 2022 03:03:36 GMT", + "etag": "\"0x8DA7C0F40534403\"", + "last-modified": "Fri, 12 Aug 2022 03:03:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "22d07204-e0e7-42f1-483d-ae77a04274c1", - "x-ms-request-id": "245de71c-401a-0002-666a-0201bf000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "d648cf57-2701-4856-4810-3e6062610006", + "x-ms-request-id": "9ae87ea4-d01a-0062-57f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f4bb2e28-6559-4df2-6cda-bfd73fd15294", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "400ab649-ca65-48bf-46c2-e533d914643b", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173ABC914\"", - "last-modified": "Wed, 05 Jan 2022 19:27:45 GMT", + "date": "Fri, 12 Aug 2022 03:03:37 GMT", + "etag": "\"0x8DA7C0F4080A4C8\"", + "last-modified": "Fri, 12 Aug 2022 03:03:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f4bb2e28-6559-4df2-6cda-bfd73fd15294", + "x-ms-client-request-id": "400ab649-ca65-48bf-46c2-e533d914643b", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:45.9632404Z", - "x-ms-file-creation-time": "2022-01-05T19:27:45.9632404Z", + "x-ms-file-change-time": "2022-08-12T03:03:37.4872776Z", + "x-ms-file-creation-time": "2022-08-12T03:03:37.4872776Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:45.9632404Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:37.4872776Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "245de71f-401a-0002-676a-0201bf000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87ea6-d01a-0062-58f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1d918874-3e9d-435a-55f9-051e67955b20", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ad3f3a57-967b-44c9-5373-e9e6dd28215d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173ADEBA3\"", - "last-modified": "Wed, 05 Jan 2022 19:27:45 GMT", + "date": "Fri, 12 Aug 2022 03:03:37 GMT", + "etag": "\"0x8DA7C0F40AE64E3\"", + "last-modified": "Fri, 12 Aug 2022 03:03:37 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1d918874-3e9d-435a-55f9-051e67955b20", + "x-ms-client-request-id": "ad3f3a57-967b-44c9-5373-e9e6dd28215d", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:45.9772323Z", - "x-ms-file-creation-time": "2022-01-05T19:27:45.9772323Z", + "x-ms-file-change-time": "2022-08-12T03:03:37.7871075Z", + "x-ms-file-creation-time": "2022-08-12T03:03:37.7871075Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:45.9772323Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:37.7871075Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "245de721-401a-0002-686a-0201bf000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87eac-d01a-0062-5ef8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "9a11235b-b3ad-4db5-670c-4bf5a58e02b9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "13478e47-3d65-4881-6e66-36b4fe4c2f73", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173B47A5D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:37 GMT", + "etag": "\"0x8DA7C0F40DBFE01\"", + "last-modified": "Fri, 12 Aug 2022 03:03:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "9a11235b-b3ad-4db5-670c-4bf5a58e02b9", + "x-ms-client-request-id": "13478e47-3d65-4881-6e66-36b4fe4c2f73", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:46.0202077Z", - "x-ms-file-creation-time": "2022-01-05T19:27:46.0202077Z", + "x-ms-file-change-time": "2022-08-12T03:03:38.0859393Z", + "x-ms-file-creation-time": "2022-08-12T03:03:38.0859393Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:46.0202077Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:38.0859393Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "245de722-401a-0002-696a-0201bf000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87ead-d01a-0062-5ff8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1b243036-b087-4f6b-5c75-33dda014b425", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "e2fd0d33-9ebd-485a-72e4-96b98eabcf88", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173BCB688\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:38 GMT", + "etag": "\"0x8DA7C0F410CA3D7\"", + "last-modified": "Fri, 12 Aug 2022 03:03:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1b243036-b087-4f6b-5c75-33dda014b425", - "x-ms-request-id": "245de723-401a-0002-6a6a-0201bf000000", + "x-ms-client-request-id": "e2fd0d33-9ebd-485a-72e4-96b98eabcf88", + "x-ms-file-last-write-time": "2022-08-12T03:03:38.4047575Z", + "x-ms-request-id": "9ae87eae-d01a-0062-60f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "c1ecab79-1372-4234-5559-38773639592f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fd7ccfdc-e2a4-4dab-5e8b-e8b8b693d155", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -149,22 +150,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C197DB\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:38 GMT", + "etag": "\"0x8DA7C0F4136BAF9\"", + "last-modified": "Fri, 12 Aug 2022 03:03:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "c1ecab79-1372-4234-5559-38773639592f", - "x-ms-request-id": "0215947e-401a-003d-246a-02c91c000000", + "x-ms-client-request-id": "fd7ccfdc-e2a4-4dab-5e8b-e8b8b693d155", + "x-ms-file-last-write-time": "2022-08-12T03:03:38.6806009Z", + "x-ms-request-id": "d26c23bb-f01a-0038-75f8-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "33586d36-c792-432d-58e0-b67c1bb03ac9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "ed371223-f5ac-438e-4768-a5e5009c52e3", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -173,22 +175,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C233FB\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:38 GMT", + "etag": "\"0x8DA7C0F4165B366\"", + "last-modified": "Fri, 12 Aug 2022 03:03:38 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "33586d36-c792-432d-58e0-b67c1bb03ac9", - "x-ms-request-id": "245de724-401a-0002-6b6a-0201bf000000", + "x-ms-client-request-id": "ed371223-f5ac-438e-4768-a5e5009c52e3", + "x-ms-file-last-write-time": "2022-08-12T03:03:38.9884262Z", + "x-ms-request-id": "9ae87eb2-d01a-0062-64f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "bca42a19-14eb-48f1-517a-0af53c6c56f7", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "d47de087-fa67-4fe3-453f-a7e456579f70", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -197,22 +200,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C25B05\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:39 GMT", + "etag": "\"0x8DA7C0F41939A88\"", + "last-modified": "Fri, 12 Aug 2022 03:03:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bca42a19-14eb-48f1-517a-0af53c6c56f7", - "x-ms-request-id": "5ee351a6-401a-004f-216a-02ce53000000", + "x-ms-client-request-id": "d47de087-fa67-4fe3-453f-a7e456579f70", + "x-ms-file-last-write-time": "2022-08-12T03:03:39.2892552Z", + "x-ms-request-id": "9ae87eb5-d01a-0062-65f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a826e88c-ed1e-496d-7650-c113a58d4c60", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "7f744a75-ca4b-4e0f-5073-2092c048be7d", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -221,22 +225,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C2D023\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:38 GMT", + "etag": "\"0x8DA7C0F41940FA1\"", + "last-modified": "Fri, 12 Aug 2022 03:03:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a826e88c-ed1e-496d-7650-c113a58d4c60", - "x-ms-request-id": "beacc3c2-b01a-0074-196a-028bf7000000", + "x-ms-client-request-id": "7f744a75-ca4b-4e0f-5073-2092c048be7d", + "x-ms-file-last-write-time": "2022-08-12T03:03:39.2922529Z", + "x-ms-request-id": "d26c23be-f01a-0038-76f8-adca66000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5b8056cf-82b3-47eb-717c-a921a446b85d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "fc0ed3ff-4315-4a4f-7888-8cf78f2061e7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -244,23 +249,24 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C34547\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "content-md5": "kUe8Hw8g6K4ZMuYWtRJA+w==", + "date": "Fri, 12 Aug 2022 03:03:39 GMT", + "etag": "\"0x8DA7C0F41C0977A\"", + "last-modified": "Fri, 12 Aug 2022 03:03:39 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5b8056cf-82b3-47eb-717c-a921a446b85d", - "x-ms-request-id": "fd59e191-c01a-0023-5b6a-0225c4000000", + "x-ms-client-request-id": "fc0ed3ff-4315-4a4f-7888-8cf78f2061e7", + "x-ms-file-last-write-time": "2022-08-12T03:03:39.5840890Z", + "x-ms-request-id": "9ae87eba-d01a-0062-69f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2583b5c3-d9a7-482a-4b96-4a2da39655f9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "9bde06a5-2d2f-48f0-445c-943d7b272362", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -268,23 +274,24 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "content-md5": "kUe8Hw8g6K4ZMuYWtRJA+w==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C4F2B3\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", + "date": "Fri, 12 Aug 2022 03:03:40 GMT", + "etag": "\"0x8DA7C0F42696908\"", + "last-modified": "Fri, 12 Aug 2022 03:03:40 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2583b5c3-d9a7-482a-4b96-4a2da39655f9", - "x-ms-request-id": "245de725-401a-0002-6c6a-0201bf000000", + "x-ms-client-request-id": "9bde06a5-2d2f-48f0-445c-943d7b272362", + "x-ms-file-last-write-time": "2022-08-12T03:03:40.6904584Z", + "x-ms-request-id": "df72445c-f01a-005a-55f8-ad0841000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "30c7e3ed-ef8c-470a-7377-1dda81ed2db3", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c6227f94-f326-4d16-5d64-a0ef981156bc", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -293,22 +300,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C73C4D\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:40 GMT", + "etag": "\"0x8DA7C0F427045D6\"", + "last-modified": "Fri, 12 Aug 2022 03:03:40 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "30c7e3ed-ef8c-470a-7377-1dda81ed2db3", - "x-ms-request-id": "02159482-401a-003d-256a-02c91c000000", + "x-ms-client-request-id": "c6227f94-f326-4d16-5d64-a0ef981156bc", + "x-ms-file-last-write-time": "2022-08-12T03:03:40.7354326Z", + "x-ms-request-id": "fd87a0b3-001a-0095-23f8-ad8613000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "6d147f7c-bdaf-47da-713f-e519166fdcba", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "a2bf1dce-cf28-4d17-709e-a4c7a51400b8", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -317,22 +325,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "nFkLbTKd2Z20QGQK8HKyjA==", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C7B16C\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:41 GMT", + "etag": "\"0x8DA7C0F429B4738\"", + "last-modified": "Fri, 12 Aug 2022 03:03:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "6d147f7c-bdaf-47da-713f-e519166fdcba", - "x-ms-request-id": "5ee351a9-401a-004f-226a-02ce53000000", + "x-ms-client-request-id": "a2bf1dce-cf28-4d17-709e-a4c7a51400b8", + "x-ms-file-last-write-time": "2022-08-12T03:03:41.0172728Z", + "x-ms-request-id": "3d0ce9bf-101a-0042-77f8-add726000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "71dd79be-eaea-4353-61c1-c3be9c868831", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "32de7ad1-4e7b-463b-5976-89f7e2ebb884", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -345,18 +354,18 @@ "content-language": "en-US", "content-length": "4194816", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C7B16C\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:41 GMT", + "etag": "\"0x8DA7C0F429B4738\"", + "last-modified": "Fri, 12 Aug 2022 03:03:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "71dd79be-eaea-4353-61c1-c3be9c868831", + "x-ms-client-request-id": "32de7ad1-4e7b-463b-5976-89f7e2ebb884", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:46.0202077Z", - "x-ms-file-creation-time": "2022-01-05T19:27:46.0202077Z", + "x-ms-file-change-time": "2022-08-12T03:03:41.0172728Z", + "x-ms-file-creation-time": "2022-08-12T03:03:38.0859393Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:46.0202077Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:41.0172728Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -364,18 +373,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "5ee351aa-401a-004f-236a-02ce53000000", + "x-ms-request-id": "3d0ce9cb-101a-0042-7cf8-add726000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "f8dd70db-509c-4aca-671a-36365883103a", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "1b08fb57-60a0-47bc-460d-04c56ca05857", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -389,18 +398,18 @@ "content-language": "en-US", "content-length": "4194816", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", - "etag": "\"0x8D9D08173C7B16C\"", - "last-modified": "Wed, 05 Jan 2022 19:27:46 GMT", + "date": "Fri, 12 Aug 2022 03:03:41 GMT", + "etag": "\"0x8DA7C0F429B4738\"", + "last-modified": "Fri, 12 Aug 2022 03:03:41 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "f8dd70db-509c-4aca-671a-36365883103a", + "x-ms-client-request-id": "1b08fb57-60a0-47bc-460d-04c56ca05857", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:46.0202077Z", - "x-ms-file-creation-time": "2022-01-05T19:27:46.0202077Z", + "x-ms-file-change-time": "2022-08-12T03:03:41.0172728Z", + "x-ms-file-creation-time": "2022-08-12T03:03:38.0859393Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:46.0202077Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:41.0172728Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -408,18 +417,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "5ee351ab-401a-004f-246a-02ce53000000", + "x-ms-request-id": "3d0ce9cf-101a-0042-80f8-add726000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816/fromBuffer-c5s4194816base/fromBuffer-c5s4194816" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "1c565646-be83-4bd7-4cf0-b5128393d236", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "521eefe2-df8c-4617-43a4-b04739243cde", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -427,19 +436,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", + "date": "Fri, 12 Aug 2022 03:03:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "1c565646-be83-4bd7-4cf0-b5128393d236", - "x-ms-request-id": "5ee351ac-401a-004f-256a-02ce53000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "521eefe2-df8c-4617-43a4-b04739243cde", + "x-ms-request-id": "3d0ce9e1-101a-0042-0ef8-add726000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "265718ef-197a-4555-7d1f-dd91462e531c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "5d530e32-aed9-4778-5045-432c13625811", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -447,19 +456,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", + "date": "Fri, 12 Aug 2022 03:03:44 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "265718ef-197a-4555-7d1f-dd91462e531c", - "x-ms-request-id": "5ee351ad-401a-004f-266a-02ce53000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "5d530e32-aed9-4778-5045-432c13625811", + "x-ms-request-id": "3d0ce9e3-101a-0042-0ff8-add726000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "41726814-3a21-492e-439c-a00f996bdf90", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "db490b5c-7aa6-4bcd-5029-adf784f3b4d6", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -467,11 +476,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:45 GMT", + "date": "Fri, 12 Aug 2022 03:03:45 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "41726814-3a21-492e-439c-a00f996bdf90", - "x-ms-request-id": "5ee351ae-401a-004f-276a-02ce53000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "db490b5c-7aa6-4bcd-5029-adf784f3b4d6", + "x-ms-request-id": "3d0ce9e7-101a-0042-11f8-add726000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s4194816?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s512.json b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s512.json index 014d71481e..5b08117234 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s512.json +++ b/sdk/storage/azure-storage-files-shares/test/ut/recordings/withParam-UploadShare.fromBuffer-c5s512.json @@ -2,9 +2,9 @@ "networkCallRecords": [ { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "5bc77781-b445-4964-786c-db033d01bbb9", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "8cecdfc5-26be-45b2-4655-3fa30fdf21b7", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -12,21 +12,21 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CF6F74F\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:23 GMT", + "etag": "\"0x8DA7C0F388B7823\"", + "last-modified": "Fri, 12 Aug 2022 03:03:24 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5bc77781-b445-4964-786c-db033d01bbb9", - "x-ms-request-id": "1c106bd5-801a-0050-5f6a-027d57000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "8cecdfc5-26be-45b2-4655-3fa30fdf21b7", + "x-ms-request-id": "9ae87e5d-d01a-0062-1cf8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "687b47bf-bfe0-455b-471f-b08fcc14386f", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "b070db40-9607-4cd0-5744-044d3cd3727c", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -34,29 +34,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CFB3147\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:24 GMT", + "etag": "\"0x8DA7C0F38B8FA32\"", + "last-modified": "Fri, 12 Aug 2022 03:03:24 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "687b47bf-bfe0-455b-471f-b08fcc14386f", + "x-ms-client-request-id": "b070db40-9607-4cd0-5744-044d3cd3727c", "x-ms-file-attributes": "Directory", - "x-ms-file-change-time": "2022-01-05T19:27:07.8960455Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.8960455Z", + "x-ms-file-change-time": "2022-08-12T03:03:24.4346930Z", + "x-ms-file-creation-time": "2022-08-12T03:03:24.4346930Z", "x-ms-file-id": "13835128424026341376", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.8960455Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:24.4346930Z", "x-ms-file-parent-id": "0", - "x-ms-file-permission-key": "16667920363481994929*10343500956293103928", - "x-ms-request-id": "1c106bd8-801a-0050-606a-027d57000000", + "x-ms-file-permission-key": "13199961128260716138*16137673612980802019", + "x-ms-request-id": "9ae87e5f-d01a-0062-1df8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512/fromBuffer-c5s512base?restype=directory" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "a668881d-8807-49fd-6752-77eaec8e2057", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "75b3b595-c259-4b0a-57d4-56411f147f60", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -64,29 +64,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815CFDC8F0\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:24 GMT", + "etag": "\"0x8DA7C0F38E69344\"", + "last-modified": "Fri, 12 Aug 2022 03:03:24 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "a668881d-8807-49fd-6752-77eaec8e2057", + "x-ms-client-request-id": "75b3b595-c259-4b0a-57d4-56411f147f60", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.9130352Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.9130352Z", + "x-ms-file-change-time": "2022-08-12T03:03:24.7335236Z", + "x-ms-file-creation-time": "2022-08-12T03:03:24.7335236Z", "x-ms-file-id": "11529285414812647424", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.9130352Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:24.7335236Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "1c106bd9-801a-0050-616a-027d57000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e62-d01a-0062-20f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512/fromBuffer-c5s512base/fromBuffer-c5s512basefile" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "0431abff-0285-4e9b-521d-7a85ecbd6814", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "16a870ca-53c8-456c-4113-eb72e5286f0a", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -94,29 +94,29 @@ "REASON_PHRASE": "Created", "STATUS_CODE": "201", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D0060A0\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:24 GMT", + "etag": "\"0x8DA7C0F3914535A\"", + "last-modified": "Fri, 12 Aug 2022 03:03:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "0431abff-0285-4e9b-521d-7a85ecbd6814", + "x-ms-client-request-id": "16a870ca-53c8-456c-4113-eb72e5286f0a", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.9300256Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.9300256Z", + "x-ms-file-change-time": "2022-08-12T03:03:25.0333530Z", + "x-ms-file-creation-time": "2022-08-12T03:03:25.0333530Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.9300256Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:25.0333530Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", - "x-ms-request-id": "1c106bda-801a-0050-626a-027d57000000", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", + "x-ms-request-id": "9ae87e64-d01a-0062-22f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512/fromBuffer-c5s512base/fromBuffer-c5s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "9fd1f5f3-e474-433e-481f-bb1900ff167d", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "c970b450-94e7-433e-5de3-3d1c0e192fcd", + "x-ms-version": "2021-06-08" }, "Method": "PUT", "Response": { @@ -125,22 +125,23 @@ "STATUS_CODE": "201", "content-length": "0", "content-md5": "kUe8Hw8g6K4ZMuYWtRJA+w==", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D03947B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:25 GMT", + "etag": "\"0x8DA7C0F39419E65\"", + "last-modified": "Fri, 12 Aug 2022 03:03:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "9fd1f5f3-e474-433e-481f-bb1900ff167d", - "x-ms-request-id": "1c106bdb-801a-0050-636a-027d57000000", + "x-ms-client-request-id": "c970b450-94e7-433e-5de3-3d1c0e192fcd", + "x-ms-file-last-write-time": "2022-08-12T03:03:25.3301861Z", + "x-ms-request-id": "9ae87e67-d01a-0062-25f8-adac81000000", "x-ms-request-server-encrypted": "true", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512/fromBuffer-c5s512base/fromBuffer-c5s512?comp=range" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "b6021c07-a485-4d34-7e94-36be8e2a19b8", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "3402ef59-4131-4e4c-52d0-666d6a10f62d", + "x-ms-version": "2021-06-08" }, "Method": "HEAD", "Response": { @@ -153,18 +154,18 @@ "content-language": "en-US", "content-length": "512", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D03947B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:25 GMT", + "etag": "\"0x8DA7C0F39419E65\"", + "last-modified": "Fri, 12 Aug 2022 03:03:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b6021c07-a485-4d34-7e94-36be8e2a19b8", + "x-ms-client-request-id": "3402ef59-4131-4e4c-52d0-666d6a10f62d", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.9300256Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.9300256Z", + "x-ms-file-change-time": "2022-08-12T03:03:25.3301861Z", + "x-ms-file-creation-time": "2022-08-12T03:03:25.0333530Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.9300256Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:25.3301861Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -172,18 +173,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "1c106bdd-801a-0050-656a-027d57000000", + "x-ms-request-id": "9ae87e68-d01a-0062-26f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512/fromBuffer-c5s512base/fromBuffer-c5s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "2d2523a6-b6c2-4aba-56ea-16445d6aba1c", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "58e8b3f8-a9cf-47ad-6894-3344123a6dc3", + "x-ms-version": "2021-06-08" }, "Method": "GET", "Response": { @@ -197,18 +198,18 @@ "content-language": "en-US", "content-length": "512", "content-type": "application/octet-stream", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", - "etag": "\"0x8D9D0815D03947B\"", - "last-modified": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:25 GMT", + "etag": "\"0x8DA7C0F39419E65\"", + "last-modified": "Fri, 12 Aug 2022 03:03:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "2d2523a6-b6c2-4aba-56ea-16445d6aba1c", + "x-ms-client-request-id": "58e8b3f8-a9cf-47ad-6894-3344123a6dc3", "x-ms-file-attributes": "Archive", - "x-ms-file-change-time": "2022-01-05T19:27:07.9300256Z", - "x-ms-file-creation-time": "2022-01-05T19:27:07.9300256Z", + "x-ms-file-change-time": "2022-08-12T03:03:25.3301861Z", + "x-ms-file-creation-time": "2022-08-12T03:03:25.0333530Z", "x-ms-file-id": "16140971433240035328", - "x-ms-file-last-write-time": "2022-01-05T19:27:07.9300256Z", + "x-ms-file-last-write-time": "2022-08-12T03:03:25.3301861Z", "x-ms-file-parent-id": "13835128424026341376", - "x-ms-file-permission-key": "2822515689773754806*10343500956293103928", + "x-ms-file-permission-key": "8598604137816897901*16137673612980802019", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-meta-meta0": "value", @@ -216,18 +217,18 @@ "x-ms-meta-meta2": "value", "x-ms-meta-meta3": "value", "x-ms-meta-meta4": "value", - "x-ms-request-id": "1c106be3-801a-0050-686a-027d57000000", + "x-ms-request-id": "9ae87e69-d01a-0062-27f8-adac81000000", "x-ms-server-encrypted": "true", "x-ms-type": "File", - "x-ms-version": "2020-02-10" + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512/fromBuffer-c5s512base/fromBuffer-c5s512" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "466ca54d-7016-4736-5122-c8e5accbef7b", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "57947173-e5c9-473d-5e20-8e6bcee7932c", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -235,19 +236,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:25 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "466ca54d-7016-4736-5122-c8e5accbef7b", - "x-ms-request-id": "1c106be4-801a-0050-696a-027d57000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "57947173-e5c9-473d-5e20-8e6bcee7932c", + "x-ms-request-id": "9ae87e6a-d01a-0062-28f8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "fc4a21e6-67ee-4ef1-75b6-925b46a1e0de", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "545d4e88-44ff-4cae-4cf3-faf0de9ee78a", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -255,19 +256,19 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:26 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "fc4a21e6-67ee-4ef1-75b6-925b46a1e0de", - "x-ms-request-id": "1c106be5-801a-0050-6a6a-027d57000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "545d4e88-44ff-4cae-4cf3-faf0de9ee78a", + "x-ms-request-id": "9ae87e6f-d01a-0062-2cf8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512?restype=share" }, { "Headers": { - "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)", - "x-ms-client-request-id": "32b12d2a-e3de-4d23-7130-b7cef8911261", - "x-ms-version": "2020-02-10" + "user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Enterprise 6.3 22000 22000.1.amd64fre.co_release.210604-1628)", + "x-ms-client-request-id": "f1ac0eb7-e072-4de6-48c0-ceb74ddd5082", + "x-ms-version": "2021-06-08" }, "Method": "DELETE", "Response": { @@ -275,11 +276,11 @@ "REASON_PHRASE": "Accepted", "STATUS_CODE": "202", "content-length": "0", - "date": "Wed, 05 Jan 2022 19:27:07 GMT", + "date": "Fri, 12 Aug 2022 03:03:26 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "32b12d2a-e3de-4d23-7130-b7cef8911261", - "x-ms-request-id": "1c106be6-801a-0050-6b6a-027d57000000", - "x-ms-version": "2020-02-10" + "x-ms-client-request-id": "f1ac0eb7-e072-4de6-48c0-ceb74ddd5082", + "x-ms-request-id": "9ae87e70-d01a-0062-2df8-adac81000000", + "x-ms-version": "2021-06-08" }, "Url": "https://REDACTED.file.core.windows.net/withparam-uploadsharefrombuffer-c5s512?restype=share" } diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp index d1dbeeb9bb..46e88b5612 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_client_test.cpp @@ -282,115 +282,125 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ(expectedPermission, ret2.Value); } - // TEST_F(FileShareClientTest, Lease) - //{ - // std::string leaseId1 = CreateUniqueLeaseId(); - // std::chrono::seconds leaseDuration(20); - // auto leaseClient = Files::Shares::ShareLeaseClient(*m_shareClient, leaseId1); - - // auto aLease = *leaseClient.Acquire(leaseDuration); - // EXPECT_FALSE(aLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), aLease.LastModified); - // EXPECT_EQ(aLease.LeaseId, leaseId1); - // aLease = *leaseClient.Acquire(leaseDuration); - // EXPECT_FALSE(aLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), aLease.LastModified); - // EXPECT_EQ(aLease.LeaseId, leaseId1); - - // auto properties = *m_shareClient->GetProperties(); - // EXPECT_EQ(properties.LeaseState.Value(), Files::Shares::Models::LeaseStateType::Leased); - // EXPECT_EQ(properties.LeaseStatus.Value(), Files::Shares::Models::LeaseStatusType::Locked); - // EXPECT_EQ(Files::Shares::Models::LeaseDurationType::Fixed, - // properties.LeaseDuration.Value()); - - // auto rLease = *leaseClient.Renew(); - // EXPECT_FALSE(rLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), rLease.LastModified); - // EXPECT_EQ(rLease.LeaseId, leaseId1); - - // std::string leaseId2 = CreateUniqueLeaseId(); - // EXPECT_NE(leaseId1, leaseId2); - // auto cLease = *leaseClient.Change(leaseId2); - // EXPECT_FALSE(cLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), cLease.LastModified); - // EXPECT_EQ(cLease.LeaseId, leaseId2); - - // auto relLease = *leaseClient.Release(); - // EXPECT_FALSE(relLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), relLease.LastModified); - - // leaseClient = Files::Shares::ShareLeaseClient(*m_shareClient, CreateUniqueLeaseId()); - // aLease = *leaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration); - // properties = *m_shareClient->GetProperties(); - // EXPECT_EQ( - // Files::Shares::Models::LeaseDurationType::Infinite, properties.LeaseDuration.Value()); - // auto brokenLease = *leaseClient.Break(); - // EXPECT_FALSE(brokenLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), brokenLease.LastModified); - // EXPECT_EQ(brokenLease.LeaseTime, 0); - - // Files::Shares::BreakLeaseOptions options; - // options.BreakPeriod = 0; - // leaseClient.Break(options); - //} - - // TEST_F(FileShareClientTest, SnapshotLease) - //{ - // std::string leaseId1 = CreateUniqueLeaseId(); - // std::chrono::seconds leaseDuration(20); - // auto snapshotResult = m_shareClient->CreateSnapshot(); - // auto shareSnapshot = m_shareClient->WithSnapshot(snapshotResult.Value.Snapshot); - // auto shareSnapshotLeaseClient = Files::Shares::ShareLeaseClient(shareSnapshot, leaseId1); - // auto aLease = *shareSnapshotLeaseClient.Acquire(leaseDuration); - // EXPECT_FALSE(aLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), aLease.LastModified); - // EXPECT_EQ(aLease.LeaseId, leaseId1); - // aLease = *shareSnapshotLeaseClient.Acquire(leaseDuration); - // EXPECT_FALSE(aLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), aLease.LastModified); - // EXPECT_EQ(aLease.LeaseId, leaseId1); - - // auto properties = *shareSnapshot.GetProperties(); - // EXPECT_EQ(properties.LeaseState.Value(), Files::Shares::Models::LeaseStateType::Leased); - // EXPECT_EQ(properties.LeaseStatus.Value(), Files::Shares::Models::LeaseStatusType::Locked); - // EXPECT_EQ(Files::Shares::Models::LeaseDurationType::Fixed, - // properties.LeaseDuration.Value()); - - // auto rLease = *shareSnapshotLeaseClient.Renew(); - // EXPECT_FALSE(rLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), rLease.LastModified); - // EXPECT_EQ(rLease.LeaseId, leaseId1); - - // std::string leaseId2 = CreateUniqueLeaseId(); - // EXPECT_NE(leaseId1, leaseId2); - // auto cLease = *shareSnapshotLeaseClient.Change(leaseId2); - // EXPECT_FALSE(cLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), cLease.LastModified); - // EXPECT_EQ(cLease.LeaseId, leaseId2); - - // auto relLease = *shareSnapshotLeaseClient.Release(); - // EXPECT_FALSE(relLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), relLease.LastModified); - - // shareSnapshotLeaseClient - // = Files::Shares::ShareLeaseClient(shareSnapshot, CreateUniqueLeaseId()); - // aLease - // = - // *shareSnapshotLeaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration); - // properties = *shareSnapshot.GetProperties(); - // EXPECT_EQ( - // Files::Shares::Models::LeaseDurationType::Infinite, properties.LeaseDuration.Value()); - // auto brokenLease = *shareSnapshotLeaseClient.Break(); - // EXPECT_FALSE(brokenLease.ETag.empty()); - // EXPECT_NE(Azure::DateTime(), brokenLease.LastModified); - // EXPECT_EQ(brokenLease.LeaseTime, 0); - - // Files::Shares::BreakLeaseOptions options; - // options.BreakPeriod = 0; - // shareSnapshotLeaseClient.Break(options); - - // EXPECT_THROW(m_shareClient->Delete(), StorageException); - //} + TEST_F(FileShareClientTest, Lease) + { + { + std::string leaseId1 = Files::Shares::ShareLeaseClient::CreateUniqueLeaseId(); + auto lastModified = m_shareClient->GetProperties().Value.LastModified; + std::chrono::seconds leaseDuration(20); + Files::Shares::ShareLeaseClient leaseClient(*m_shareClient, leaseId1); + auto aLease = leaseClient.Acquire(leaseDuration).Value; + EXPECT_TRUE(aLease.ETag.HasValue()); + EXPECT_TRUE(aLease.LastModified >= lastModified); + EXPECT_EQ(aLease.LeaseId, leaseId1); + lastModified = m_shareClient->GetProperties().Value.LastModified; + aLease = leaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration).Value; + EXPECT_TRUE(aLease.ETag.HasValue()); + EXPECT_TRUE(aLease.LastModified >= lastModified); + EXPECT_EQ(aLease.LeaseId, leaseId1); + + auto properties = m_shareClient->GetProperties().Value; + EXPECT_EQ(properties.LeaseState.Value(), Files::Shares::Models::LeaseState::Leased); + EXPECT_EQ(properties.LeaseStatus.Value(), Files::Shares::Models::LeaseStatus::Locked); + + lastModified = m_shareClient->GetProperties().Value.LastModified; + auto rLease = leaseClient.Renew().Value; + EXPECT_TRUE(aLease.ETag.HasValue()); + EXPECT_TRUE(aLease.LastModified >= lastModified); + EXPECT_EQ(rLease.LeaseId, leaseId1); + + lastModified = m_shareClient->GetProperties().Value.LastModified; + std::string leaseId2 = Files::Shares::ShareLeaseClient::CreateUniqueLeaseId(); + EXPECT_NE(leaseId1, leaseId2); + auto cLease = leaseClient.Change(leaseId2).Value; + EXPECT_TRUE(cLease.ETag.HasValue()); + EXPECT_TRUE(cLease.LastModified >= lastModified); + EXPECT_EQ(cLease.LeaseId, leaseId2); + EXPECT_EQ(leaseClient.GetLeaseId(), leaseId2); + + lastModified = m_shareClient->GetProperties().Value.LastModified; + auto relLease = leaseClient.Release().Value; + EXPECT_TRUE(relLease.ETag.HasValue()); + EXPECT_TRUE(relLease.LastModified >= lastModified); + } + + { + Files::Shares::ShareLeaseClient leaseClient( + *m_shareClient, Files::Shares::ShareLeaseClient::CreateUniqueLeaseId()); + auto aLease + = leaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration).Value; + auto properties = m_shareClient->GetProperties().Value; + EXPECT_EQ( + Files::Shares::Models::LeaseDurationType::Infinite, properties.LeaseDuration.Value()); + auto brokenLease = leaseClient.Break().Value; + EXPECT_TRUE(brokenLease.ETag.HasValue()); + EXPECT_TRUE(brokenLease.LastModified >= properties.LastModified); + } + } + + TEST_F(FileShareClientTest, SnapshotLease) + { + auto snapshotResult = m_shareClient->CreateSnapshot(); + auto shareSnapshot = m_shareClient->WithSnapshot(snapshotResult.Value.Snapshot); + { + std::string leaseId1 = Files::Shares::ShareLeaseClient::CreateUniqueLeaseId(); + auto lastModified = m_shareClient->GetProperties().Value.LastModified; + std::chrono::seconds leaseDuration(20); + Files::Shares::ShareLeaseClient shareSnapshotLeaseClient(shareSnapshot, leaseId1); + auto aLease = shareSnapshotLeaseClient.Acquire(leaseDuration).Value; + EXPECT_TRUE(aLease.ETag.HasValue()); + EXPECT_TRUE(aLease.LastModified >= lastModified); + EXPECT_EQ(aLease.LeaseId, leaseId1); + lastModified = shareSnapshot.GetProperties().Value.LastModified; + aLease + = shareSnapshotLeaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration) + .Value; + EXPECT_TRUE(aLease.ETag.HasValue()); + EXPECT_TRUE(aLease.LastModified >= lastModified); + EXPECT_EQ(aLease.LeaseId, leaseId1); + + auto properties = shareSnapshot.GetProperties().Value; + EXPECT_EQ(properties.LeaseState.Value(), Files::Shares::Models::LeaseState::Leased); + EXPECT_EQ(properties.LeaseStatus.Value(), Files::Shares::Models::LeaseStatus::Locked); + + lastModified = shareSnapshot.GetProperties().Value.LastModified; + auto rLease = shareSnapshotLeaseClient.Renew().Value; + EXPECT_TRUE(aLease.ETag.HasValue()); + EXPECT_TRUE(aLease.LastModified >= lastModified); + EXPECT_EQ(rLease.LeaseId, leaseId1); + + lastModified = shareSnapshot.GetProperties().Value.LastModified; + std::string leaseId2 = Files::Shares::ShareLeaseClient::CreateUniqueLeaseId(); + EXPECT_NE(leaseId1, leaseId2); + auto cLease = shareSnapshotLeaseClient.Change(leaseId2).Value; + EXPECT_TRUE(cLease.ETag.HasValue()); + EXPECT_TRUE(cLease.LastModified >= lastModified); + EXPECT_EQ(cLease.LeaseId, leaseId2); + EXPECT_EQ(shareSnapshotLeaseClient.GetLeaseId(), leaseId2); + + lastModified = shareSnapshot.GetProperties().Value.LastModified; + auto relLease = shareSnapshotLeaseClient.Release().Value; + EXPECT_TRUE(relLease.ETag.HasValue()); + EXPECT_TRUE(relLease.LastModified >= lastModified); + } + + { + Files::Shares::ShareLeaseClient shareSnapshotLeaseClient( + shareSnapshot, Files::Shares::ShareLeaseClient::CreateUniqueLeaseId()); + auto aLease + = shareSnapshotLeaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration) + .Value; + auto properties = shareSnapshot.GetProperties().Value; + EXPECT_EQ( + Files::Shares::Models::LeaseDurationType::Infinite, properties.LeaseDuration.Value()); + auto brokenLease = shareSnapshotLeaseClient.Break().Value; + EXPECT_TRUE(brokenLease.ETag.HasValue()); + EXPECT_TRUE(brokenLease.LastModified >= properties.LastModified); + shareSnapshotLeaseClient.Release(); + } + + EXPECT_THROW(m_shareClient->Delete(), StorageException); + } TEST_F(FileShareClientTest, UnencodedDirectoryFileNameWorks) { @@ -520,44 +530,122 @@ namespace Azure { namespace Storage { namespace Test { TEST_F(FileShareClientTest, PremiumShare) { - auto shareName = m_testNameLowercase; - auto shareClient = Files::Shares::ShareClient::CreateFromConnectionString( - PremiumFileConnectionString(), shareName, m_options); - EXPECT_NO_THROW(shareClient.Create()); - Files::Shares::Models::ShareProperties properties; - EXPECT_NO_THROW(properties = shareClient.GetProperties().Value); - EXPECT_EQ(Files::Shares::Models::AccessTier::Premium, properties.AccessTier.Value()); - EXPECT_FALSE(properties.AccessTierTransitionState.HasValue()); - EXPECT_FALSE(properties.AccessTierChangedOn.HasValue()); + { + auto shareName = m_testNameLowercase; + auto shareClient = Files::Shares::ShareClient::CreateFromConnectionString( + PremiumFileConnectionString(), shareName, m_options); + // create works + EXPECT_NO_THROW(shareClient.Create()); + Files::Shares::Models::ShareProperties properties; + EXPECT_NO_THROW(properties = shareClient.GetProperties().Value); + EXPECT_EQ(Files::Shares::Models::AccessTier::Premium, properties.AccessTier.Value()); + EXPECT_FALSE(properties.AccessTierTransitionState.HasValue()); + EXPECT_FALSE(properties.AccessTierChangedOn.HasValue()); + EXPECT_TRUE(properties.ProvisionedBandwidthMBps.HasValue()); + + // list shares works + Files::Shares::ListSharesOptions listOptions; + listOptions.Prefix = shareName; + std::vector shareItems; + for (auto pageResult = Files::Shares::ShareServiceClient::CreateFromConnectionString( + PremiumFileConnectionString(), m_options) + .ListShares(listOptions); + pageResult.HasPage(); + pageResult.MoveToNextPage()) + { + shareItems.insert(shareItems.end(), pageResult.Shares.begin(), pageResult.Shares.end()); + } + EXPECT_EQ(1U, shareItems.size()); + EXPECT_EQ( + Files::Shares::Models::AccessTier::Premium, shareItems[0].Details.AccessTier.Value()); + EXPECT_FALSE(shareItems[0].Details.AccessTierTransitionState.HasValue()); + EXPECT_FALSE(shareItems[0].Details.AccessTierChangedOn.HasValue()); + EXPECT_TRUE(shareItems[0].Details.ProvisionedBandwidthMBps.HasValue()); - Files::Shares::ListSharesOptions listOptions; - listOptions.Prefix = shareName; - std::vector shareItems; - for (auto pageResult = Files::Shares::ShareServiceClient::CreateFromConnectionString( - PremiumFileConnectionString(), m_options) - .ListShares(listOptions); - pageResult.HasPage(); - pageResult.MoveToNextPage()) + // set&get properties works + auto setPropertiesOptions = Files::Shares::SetSharePropertiesOptions(); + setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::Hot; + EXPECT_THROW(shareClient.SetProperties(setPropertiesOptions), StorageException); + setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::Cool; + EXPECT_THROW(shareClient.SetProperties(setPropertiesOptions), StorageException); + setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::TransactionOptimized; + EXPECT_THROW(shareClient.SetProperties(setPropertiesOptions), StorageException); + setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::Premium; + EXPECT_NO_THROW(shareClient.SetProperties(setPropertiesOptions)); + EXPECT_NO_THROW(properties = shareClient.GetProperties().Value); + EXPECT_EQ(Files::Shares::Models::AccessTier::Premium, properties.AccessTier.Value()); + EXPECT_FALSE(properties.AccessTierTransitionState.HasValue()); + EXPECT_FALSE(properties.AccessTierChangedOn.HasValue()); + shareClient.DeleteIfExists(); + } + // nfs protocol works { - shareItems.insert(shareItems.end(), pageResult.Shares.begin(), pageResult.Shares.end()); + auto shareName = m_testNameLowercase + "1"; + auto shareClient = Files::Shares::ShareClient::CreateFromConnectionString( + PremiumFileConnectionString(), shareName, m_options); + // create works + Files::Shares::CreateShareOptions options; + options.EnabledProtocols = Files::Shares::Models::ShareProtocols::Nfs; + options.RootSquash = Files::Shares::Models::ShareRootSquash::AllSquash; + EXPECT_NO_THROW(shareClient.Create(options)); + Files::Shares::Models::ShareProperties properties; + EXPECT_NO_THROW(properties = shareClient.GetProperties().Value); + EXPECT_EQ(options.EnabledProtocols.Value(), properties.EnabledProtocols.Value()); + EXPECT_EQ(options.RootSquash.Value(), properties.RootSquash.Value()); + + // list shares works + Files::Shares::ListSharesOptions listOptions; + listOptions.Prefix = shareName; + std::vector shareItems; + for (auto pageResult = Files::Shares::ShareServiceClient::CreateFromConnectionString( + PremiumFileConnectionString(), m_options) + .ListShares(listOptions); + pageResult.HasPage(); + pageResult.MoveToNextPage()) + { + shareItems.insert(shareItems.end(), pageResult.Shares.begin(), pageResult.Shares.end()); + } + EXPECT_EQ(1U, shareItems.size()); + EXPECT_EQ(options.EnabledProtocols.Value(), shareItems[0].Details.EnabledProtocols.Value()); + EXPECT_EQ(options.RootSquash.Value(), shareItems[0].Details.RootSquash.Value()); + + // set&get properties works + auto setPropertiesOptions = Files::Shares::SetSharePropertiesOptions(); + setPropertiesOptions.RootSquash = Files::Shares::Models::ShareRootSquash::NoRootSquash; + EXPECT_NO_THROW(shareClient.SetProperties(setPropertiesOptions)); + EXPECT_NO_THROW(properties = shareClient.GetProperties().Value); + EXPECT_EQ(setPropertiesOptions.RootSquash.Value(), properties.RootSquash.Value()); + shareClient.DeleteIfExists(); + } + // smb protocol works + { + auto shareName = m_testNameLowercase + "2"; + auto shareClient = Files::Shares::ShareClient::CreateFromConnectionString( + PremiumFileConnectionString(), shareName, m_options); + // create works + Files::Shares::CreateShareOptions options; + options.EnabledProtocols = Files::Shares::Models::ShareProtocols::Smb; + EXPECT_NO_THROW(shareClient.Create(options)); + Files::Shares::Models::ShareProperties properties; + EXPECT_NO_THROW(properties = shareClient.GetProperties().Value); + EXPECT_EQ(options.EnabledProtocols.Value(), properties.EnabledProtocols.Value()); + + // list shares works + Files::Shares::ListSharesOptions listOptions; + listOptions.Prefix = shareName; + std::vector shareItems; + for (auto pageResult = Files::Shares::ShareServiceClient::CreateFromConnectionString( + PremiumFileConnectionString(), m_options) + .ListShares(listOptions); + pageResult.HasPage(); + pageResult.MoveToNextPage()) + { + shareItems.insert(shareItems.end(), pageResult.Shares.begin(), pageResult.Shares.end()); + } + EXPECT_EQ(1U, shareItems.size()); + EXPECT_EQ(options.EnabledProtocols.Value(), shareItems[0].Details.EnabledProtocols.Value()); + shareClient.DeleteIfExists(); } - EXPECT_EQ(1U, shareItems.size()); - EXPECT_EQ(Files::Shares::Models::AccessTier::Premium, shareItems[0].Details.AccessTier.Value()); - EXPECT_FALSE(shareItems[0].Details.AccessTierTransitionState.HasValue()); - EXPECT_FALSE(shareItems[0].Details.AccessTierChangedOn.HasValue()); - - auto setPropertiesOptions = Files::Shares::SetSharePropertiesOptions(); - setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::Hot; - EXPECT_THROW(shareClient.SetProperties(setPropertiesOptions), StorageException); - setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::Cool; - EXPECT_THROW(shareClient.SetProperties(setPropertiesOptions), StorageException); - setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::TransactionOptimized; - EXPECT_THROW(shareClient.SetProperties(setPropertiesOptions), StorageException); - setPropertiesOptions.AccessTier = Files::Shares::Models::AccessTier::Premium; - EXPECT_NO_THROW(shareClient.SetProperties(setPropertiesOptions)); - EXPECT_EQ(Files::Shares::Models::AccessTier::Premium, properties.AccessTier.Value()); - EXPECT_FALSE(properties.AccessTierTransitionState.HasValue()); - EXPECT_FALSE(properties.AccessTierChangedOn.HasValue()); - shareClient.DeleteIfExists(); } + }}} // namespace Azure::Storage::Test diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp index 6fee669c8c..6321ca4f73 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_directory_client_test.cpp @@ -138,6 +138,304 @@ namespace Azure { namespace Storage { namespace Test { } } + TEST_F(FileShareDirectoryClientTest, RenameFile) + { + const std::string testName(GetTestName()); + const std::string baseDirectoryName = testName + "1"; + auto rootDirectoryClient = m_shareClient->GetRootDirectoryClient(); + auto baseDirectoryClient + = m_shareClient->GetRootDirectoryClient().GetSubdirectoryClient(baseDirectoryName); + baseDirectoryClient.Create(); + // base test + { + const std::string oldFilename = testName + "2"; + auto oldFileClient = baseDirectoryClient.GetFileClient(oldFilename); + oldFileClient.Create(512); + const std::string newFilename = testName + "3"; + auto newFileClient + = baseDirectoryClient.RenameFile(oldFilename, baseDirectoryName + "/" + newFilename) + .Value; + EXPECT_NO_THROW(newFileClient.GetProperties()); + EXPECT_THROW(oldFileClient.GetProperties(), StorageException); + } + + // overwrite + { + const std::string oldFilename = testName + "4"; + auto oldFileClient = baseDirectoryClient.GetFileClient(oldFilename); + oldFileClient.Create(512); + const std::string newFilename = testName + "5"; + auto newFileClient = baseDirectoryClient.GetFileClient(newFilename); + newFileClient.Create(512); + EXPECT_THROW( + baseDirectoryClient.RenameFile(oldFilename, baseDirectoryName + "/" + newFilename), + StorageException); + + Files::Shares::RenameFileOptions options; + options.ReplaceIfExists = true; + EXPECT_NO_THROW( + newFileClient + = baseDirectoryClient + .RenameFile(oldFilename, baseDirectoryName + "/" + newFilename, options) + .Value); + EXPECT_NO_THROW(newFileClient.GetProperties()); + EXPECT_THROW(oldFileClient.GetProperties(), StorageException); + } + // overwrite readOnly + { + const std::string oldFilename = testName + "6"; + auto oldFileClient = baseDirectoryClient.GetFileClient(oldFilename); + oldFileClient.Create(512); + const std::string newFilename = testName + "7"; + Files::Shares::CreateFileOptions createOptions; + Files::Shares::Models::FileSmbProperties properties; + properties.Attributes = Files::Shares::Models::FileAttributes::ReadOnly; + createOptions.SmbProperties = properties; + auto newFileClient = baseDirectoryClient.GetFileClient(newFilename); + newFileClient.Create(512, createOptions); + Files::Shares::RenameFileOptions renameOptions; + renameOptions.ReplaceIfExists = true; + EXPECT_THROW( + baseDirectoryClient.RenameFile( + oldFilename, baseDirectoryName + "/" + newFilename, renameOptions), + StorageException); + + renameOptions.IgnoreReadOnly = true; + EXPECT_NO_THROW( + newFileClient + = baseDirectoryClient + .RenameFile(oldFilename, baseDirectoryName + "/" + newFilename, renameOptions) + .Value); + EXPECT_NO_THROW(newFileClient.GetProperties()); + EXPECT_THROW(oldFileClient.GetProperties(), StorageException); + } + // with options + { + std::string permission + = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-" + "2127521184-1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;" + "0x1200a9;;;S-1-5-21-397955417-626881126-188441444-3053964)"; + + const std::string oldFilename = testName + "8"; + auto oldFileClient = baseDirectoryClient.GetFileClient(oldFilename); + oldFileClient.Create(512); + const std::string newFilename = testName + "9"; + Files::Shares::RenameFileOptions renameOptions; + renameOptions.Metadata = GetMetadata(); + renameOptions.FilePermission = permission; + Files::Shares::Models::FileSmbProperties properties; + properties.ChangedOn = std::chrono::system_clock::now(); + properties.CreatedOn = std::chrono::system_clock::now(); + properties.LastWrittenOn = std::chrono::system_clock::now(); + properties.Attributes = Files::Shares::Models::FileAttributes::None; + renameOptions.SmbProperties = properties; + auto newFileClient + = baseDirectoryClient + .RenameFile(oldFilename, baseDirectoryName + "/" + newFilename, renameOptions) + .Value; + Files::Shares::Models::FileProperties newProperties; + EXPECT_NO_THROW(newProperties = newFileClient.GetProperties().Value); + EXPECT_THROW(oldFileClient.GetProperties(), StorageException); + EXPECT_EQ(renameOptions.Metadata, newProperties.Metadata); + EXPECT_EQ(properties.Attributes, newProperties.SmbProperties.Attributes); + } + + // diff directory + { + const std::string oldSubdirectoryName = testName + "10"; + auto oldSubdirectoryClient = baseDirectoryClient.GetSubdirectoryClient(oldSubdirectoryName); + oldSubdirectoryClient.Create(); + const std::string oldFilename = testName + "11"; + auto oldFileClient = oldSubdirectoryClient.GetFileClient(oldFilename); + oldFileClient.Create(512); + + const std::string otherDirectoryname = testName + "12"; + auto otherDirectoryClient = rootDirectoryClient.GetSubdirectoryClient(otherDirectoryname); + otherDirectoryClient.Create(); + const std::string newFilename = testName + "13"; + auto newFileClient + = baseDirectoryClient + .RenameFile( + oldSubdirectoryName + "/" + oldFilename, otherDirectoryname + "/" + newFilename) + .Value; + EXPECT_NO_THROW(newFileClient.GetProperties()); + EXPECT_THROW(oldFileClient.GetProperties(), StorageException); + } + // root directory + { + const std::string oldFilename = testName + "14"; + auto oldFileClient = baseDirectoryClient.GetFileClient(oldFilename); + oldFileClient.Create(512); + const std::string newFilename = testName + "15"; + auto newFileClient = baseDirectoryClient.RenameFile(oldFilename, newFilename).Value; + EXPECT_NO_THROW(newFileClient.GetProperties()); + EXPECT_THROW(oldFileClient.GetProperties(), StorageException); + } + // lease + { + const std::string oldFilename = testName + "16"; + auto oldFileClient = baseDirectoryClient.GetFileClient(oldFilename); + oldFileClient.Create(512); + const std::string oldLeaseId = Files::Shares::ShareLeaseClient::CreateUniqueLeaseId(); + Files::Shares::ShareLeaseClient oldLeaseClient(oldFileClient, oldLeaseId); + oldLeaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration); + const std::string newFilename = testName + "17"; + auto newFileClient = baseDirectoryClient.GetFileClient(newFilename); + newFileClient.Create(512); + const std::string newLeaseId = Files::Shares::ShareLeaseClient::CreateUniqueLeaseId(); + Files::Shares::ShareLeaseClient newLeaseClient(newFileClient, newLeaseId); + newLeaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration); + + Files::Shares::RenameFileOptions options; + options.ReplaceIfExists = true; + EXPECT_THROW( + baseDirectoryClient.RenameFile( + oldFilename, baseDirectoryName + "/" + newFilename, options), + StorageException); + options.SourceAccessConditions.LeaseId = oldLeaseId; + options.AccessConditions.LeaseId = newLeaseId; + EXPECT_NO_THROW(baseDirectoryClient.RenameFile( + oldFilename, baseDirectoryName + "/" + newFilename, options)); + Files::Shares::ShareLeaseClient renamedLeaseClient(newFileClient, oldLeaseId); + renamedLeaseClient.Release(); + } + } + + TEST_F(FileShareDirectoryClientTest, RenameSubdirectory) + { + const std::string testName(GetTestName()); + const std::string baseDirectoryName = testName + "1"; + auto rootDirectoryClient = m_shareClient->GetRootDirectoryClient(); + auto baseDirectoryClient + = m_shareClient->GetRootDirectoryClient().GetSubdirectoryClient(baseDirectoryName); + baseDirectoryClient.Create(); + // base test + { + const std::string oldSubdirectoryName = testName + "2"; + auto oldSubdirectoryClient = baseDirectoryClient.GetSubdirectoryClient(oldSubdirectoryName); + oldSubdirectoryClient.Create(); + oldSubdirectoryClient.GetFileClient(testName + "File1").Create(512); + const std::string newSubdirectoryName = testName + "3"; + auto newSubdirectoryClient + = baseDirectoryClient + .RenameSubdirectory( + oldSubdirectoryName, baseDirectoryName + "/" + newSubdirectoryName) + .Value; + EXPECT_NO_THROW(newSubdirectoryClient.GetProperties()); + EXPECT_THROW(oldSubdirectoryClient.GetProperties(), StorageException); + } + + // overwrite + { + const std::string oldSubdirectoryName = testName + "4"; + auto oldSubdirectoryClient = baseDirectoryClient.GetSubdirectoryClient(oldSubdirectoryName); + oldSubdirectoryClient.Create(); + const std::string existFilename = testName + "5"; + auto existFileClient = baseDirectoryClient.GetFileClient(existFilename); + existFileClient.Create(512); + EXPECT_THROW( + baseDirectoryClient.RenameSubdirectory( + oldSubdirectoryName, baseDirectoryName + "/" + existFilename), + StorageException); + + Files::Shares::RenameDirectoryOptions options; + options.ReplaceIfExists = true; + EXPECT_NO_THROW(baseDirectoryClient.RenameSubdirectory( + oldSubdirectoryName, baseDirectoryName + "/" + existFilename, options)); + EXPECT_THROW(oldSubdirectoryClient.GetProperties(), StorageException); + } + // overwrite readOnly + { + const std::string oldSubdirectoryName = testName + "6"; + auto oldSubdirectoryClient = baseDirectoryClient.GetSubdirectoryClient(oldSubdirectoryName); + oldSubdirectoryClient.Create(); + const std::string existFilename = testName + "7"; + Files::Shares::CreateFileOptions createOptions; + Files::Shares::Models::FileSmbProperties properties; + properties.Attributes = Files::Shares::Models::FileAttributes::ReadOnly; + createOptions.SmbProperties = properties; + auto existFileClient = baseDirectoryClient.GetFileClient(existFilename); + existFileClient.Create(512, createOptions); + Files::Shares::RenameDirectoryOptions renameOptions; + renameOptions.ReplaceIfExists = true; + EXPECT_THROW( + baseDirectoryClient.RenameSubdirectory( + oldSubdirectoryName, baseDirectoryName + "/" + existFilename, renameOptions), + StorageException); + + renameOptions.IgnoreReadOnly = true; + EXPECT_NO_THROW(baseDirectoryClient.RenameSubdirectory( + oldSubdirectoryName, baseDirectoryName + "/" + existFilename, renameOptions)); + EXPECT_THROW(oldSubdirectoryClient.GetProperties(), StorageException); + } + // with options + { + std::string permission + = "O:S-1-5-21-2127521184-1604012920-1887927527-21560751G:S-1-5-21-" + "2127521184-1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;" + "0x1200a9;;;S-1-5-21-397955417-626881126-188441444-3053964)"; + + const std::string oldSubdirectoryName = testName + "8"; + auto oldSubdirectoryClient = baseDirectoryClient.GetSubdirectoryClient(oldSubdirectoryName); + oldSubdirectoryClient.Create(); + const std::string newSubdirectoryName = testName + "9"; + Files::Shares::RenameDirectoryOptions renameOptions; + renameOptions.Metadata = GetMetadata(); + renameOptions.FilePermission = permission; + Files::Shares::Models::FileSmbProperties properties; + properties.ChangedOn = std::chrono::system_clock::now(); + properties.CreatedOn = std::chrono::system_clock::now(); + properties.LastWrittenOn = std::chrono::system_clock::now(); + renameOptions.SmbProperties = properties; + auto newSubdirectoryClient = baseDirectoryClient + .RenameSubdirectory( + oldSubdirectoryName, + baseDirectoryName + "/" + newSubdirectoryName, + renameOptions) + .Value; + Files::Shares::Models::DirectoryProperties newProperties; + EXPECT_NO_THROW(newProperties = newSubdirectoryClient.GetProperties().Value); + EXPECT_THROW(oldSubdirectoryClient.GetProperties(), StorageException); + EXPECT_EQ(renameOptions.Metadata, newProperties.Metadata); + } + + // diff directory + { + const std::string oldMiddleDirectoryName = testName + "10"; + auto oldMiddleDirectoryClient + = baseDirectoryClient.GetSubdirectoryClient(oldMiddleDirectoryName); + oldMiddleDirectoryClient.Create(); + const std::string oldSubdirectoryName = testName + "11"; + auto oldSubdirectoryClient + = oldMiddleDirectoryClient.GetSubdirectoryClient(oldSubdirectoryName); + oldSubdirectoryClient.Create(); + + const std::string otherDirectoryName = testName + "12"; + auto otherDirectoryClient = rootDirectoryClient.GetSubdirectoryClient(otherDirectoryName); + otherDirectoryClient.Create(); + const std::string newSubdirectoryName = testName + "13"; + auto newSubdirectoryClient = baseDirectoryClient + .RenameSubdirectory( + oldMiddleDirectoryName + "/" + oldSubdirectoryName, + otherDirectoryName + "/" + newSubdirectoryName) + .Value; + EXPECT_NO_THROW(newSubdirectoryClient.GetProperties()); + EXPECT_THROW(oldSubdirectoryClient.GetProperties(), StorageException); + } + // root directory + { + const std::string oldSubdirectoryName = testName + "14"; + auto oldSubdirectoryClient = baseDirectoryClient.GetSubdirectoryClient(oldSubdirectoryName); + oldSubdirectoryClient.Create(); + oldSubdirectoryClient.GetFileClient(testName + "File1").Create(512); + const std::string newSubdirectoryName = testName + "15"; + auto newSubdirectoryClient + = baseDirectoryClient.RenameSubdirectory(oldSubdirectoryName, newSubdirectoryName).Value; + EXPECT_NO_THROW(newSubdirectoryClient.GetProperties()); + EXPECT_THROW(oldSubdirectoryClient.GetProperties(), StorageException); + } + } + TEST_F(FileShareDirectoryClientTest, DirectoryMetadata) { auto metadata1 = GetMetadata(); @@ -250,6 +548,7 @@ namespace Azure { namespace Storage { namespace Test { | Files::Shares::Models::FileAttributes::NotContentIndexed; properties.CreatedOn = std::chrono::system_clock::now(); properties.LastWrittenOn = std::chrono::system_clock::now(); + properties.ChangedOn = std::chrono::system_clock::now(); properties.PermissionKey = m_fileShareDirectoryClient->GetProperties().Value.SmbProperties.PermissionKey; { @@ -273,6 +572,9 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ( directoryProperties2.Value.SmbProperties.LastWrittenOn.Value(), directoryProperties1.Value.SmbProperties.LastWrittenOn.Value()); + EXPECT_EQ( + directoryProperties2.Value.SmbProperties.ChangedOn.Value(), + directoryProperties1.Value.SmbProperties.ChangedOn.Value()); EXPECT_EQ( directoryProperties2.Value.SmbProperties.Attributes, directoryProperties1.Value.SmbProperties.Attributes); @@ -297,6 +599,9 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ( directoryProperties2.Value.SmbProperties.LastWrittenOn.Value(), directoryProperties1.Value.SmbProperties.LastWrittenOn.Value()); + EXPECT_EQ( + directoryProperties2.Value.SmbProperties.ChangedOn.Value(), + directoryProperties1.Value.SmbProperties.ChangedOn.Value()); EXPECT_EQ( directoryProperties2.Value.SmbProperties.Attributes, directoryProperties1.Value.SmbProperties.Attributes); @@ -440,6 +745,79 @@ namespace Azure { namespace Storage { namespace Test { auto response = directoryNameAClient.ListFilesAndDirectories(options); EXPECT_LE(2U, response.Directories.size() + response.Files.size()); } + { + // List with include option + Files::Shares::ListFilesAndDirectoriesOptions options; + options.Include = Files::Shares::Models::ListFilesIncludeFlags::Timestamps + | Files::Shares::Models::ListFilesIncludeFlags::ETag + | Files::Shares::Models::ListFilesIncludeFlags::Attributes + | Files::Shares::Models::ListFilesIncludeFlags::PermissionKey; + options.IncludeExtendedInfo = true; + auto directoryNameAClient + = m_shareClient->GetRootDirectoryClient().GetSubdirectoryClient(directoryNameA); + auto response = directoryNameAClient.ListFilesAndDirectories(options); + auto directories = response.Directories; + auto files = response.Files; + for (const auto& name : directoryNameSetA) + { + auto iter = std::find_if( + directories.begin(), + directories.end(), + [&name](const Files::Shares::Models::DirectoryItem& item) { + return item.Name == name; + }); + auto directoryProperties = directoryNameAClient.GetSubdirectoryClient(name).GetProperties(); + EXPECT_TRUE(iter->Details.Etag.HasValue()); + EXPECT_TRUE(iter->Details.LastAccessedOn.HasValue()); + EXPECT_EQ(iter->Details.LastModified, directoryProperties.Value.LastModified); + EXPECT_EQ( + iter->Details.SmbProperties.Attributes, + directoryProperties.Value.SmbProperties.Attributes); + EXPECT_EQ( + iter->Details.SmbProperties.FileId, directoryProperties.Value.SmbProperties.FileId); + EXPECT_EQ( + iter->Details.SmbProperties.ChangedOn.Value(), + directoryProperties.Value.SmbProperties.ChangedOn.Value()); + EXPECT_EQ( + iter->Details.SmbProperties.CreatedOn.Value(), + directoryProperties.Value.SmbProperties.CreatedOn.Value()); + EXPECT_EQ( + iter->Details.SmbProperties.LastWrittenOn.Value(), + directoryProperties.Value.SmbProperties.LastWrittenOn.Value()); + EXPECT_EQ( + iter->Details.SmbProperties.PermissionKey.Value(), + directoryProperties.Value.SmbProperties.PermissionKey.Value()); + } + for (const auto& name : fileNameSetA) + { + auto iter = std::find_if( + files.begin(), files.end(), [&name](const Files::Shares::Models::FileItem& item) { + return item.Name == name; + }); + auto fileProperties = directoryNameAClient.GetFileClient(name).GetProperties(); + EXPECT_TRUE(iter->Details.Etag.HasValue()); + EXPECT_TRUE(iter->Details.LastAccessedOn.HasValue()); + EXPECT_EQ(iter->Details.LastModified, fileProperties.Value.LastModified); + EXPECT_EQ( + iter->Details.SmbProperties.Attributes, fileProperties.Value.SmbProperties.Attributes); + EXPECT_EQ(iter->Details.SmbProperties.FileId, fileProperties.Value.SmbProperties.FileId); + EXPECT_EQ( + iter->Details.SmbProperties.ChangedOn.Value(), + fileProperties.Value.SmbProperties.ChangedOn.Value()); + EXPECT_EQ( + iter->Details.SmbProperties.CreatedOn.Value(), + fileProperties.Value.SmbProperties.CreatedOn.Value()); + EXPECT_EQ( + iter->Details.SmbProperties.LastWrittenOn.Value(), + fileProperties.Value.SmbProperties.LastWrittenOn.Value()); + EXPECT_EQ( + iter->Details.SmbProperties.PermissionKey.Value(), + fileProperties.Value.SmbProperties.PermissionKey.Value()); + EXPECT_EQ(1024, iter->Details.FileSize); + } + EXPECT_EQ( + response.DirectoryId, directoryNameAClient.GetProperties().Value.SmbProperties.FileId); + } } TEST_F(FileShareDirectoryClientTest, HandlesFunctionalityWorks) diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp index 0701c450c9..eae7c2a7ca 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp @@ -111,6 +111,15 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_NO_THROW(fileClient.DownloadTo(buff.data(), 0)); } + TEST_F(FileShareFileClientTest, DownloadNonExistingToFile) + { + const auto testName(GetTestName()); + auto fileClient = m_fileShareDirectoryClient->GetFileClient(m_testName); + + EXPECT_THROW(fileClient.DownloadTo(testName), StorageException); + EXPECT_THROW(ReadFile(testName), std::runtime_error); + } + TEST_F(FileShareFileClientTest, FileMetadata) { auto metadata1 = GetMetadata(); @@ -219,6 +228,7 @@ namespace Azure { namespace Storage { namespace Test { | Files::Shares::Models::FileAttributes::NotContentIndexed; properties.CreatedOn = std::chrono::system_clock::now(); properties.LastWrittenOn = std::chrono::system_clock::now(); + properties.ChangedOn = std::chrono::system_clock::now(); properties.PermissionKey = m_fileClient->GetProperties().Value.SmbProperties.PermissionKey; { // Create directory with SmbProperties works @@ -239,6 +249,9 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ( directoryProperties2.Value.SmbProperties.LastWrittenOn.Value(), directoryProperties1.Value.SmbProperties.LastWrittenOn.Value()); + EXPECT_EQ( + directoryProperties2.Value.SmbProperties.ChangedOn.Value(), + directoryProperties1.Value.SmbProperties.ChangedOn.Value()); EXPECT_EQ( directoryProperties2.Value.SmbProperties.Attributes, directoryProperties1.Value.SmbProperties.Attributes); @@ -261,6 +274,9 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ( directoryProperties2.Value.SmbProperties.LastWrittenOn.Value(), directoryProperties1.Value.SmbProperties.LastWrittenOn.Value()); + EXPECT_EQ( + directoryProperties2.Value.SmbProperties.ChangedOn.Value(), + directoryProperties1.Value.SmbProperties.ChangedOn.Value()); EXPECT_EQ( directoryProperties2.Value.SmbProperties.Attributes, directoryProperties1.Value.SmbProperties.Attributes); @@ -883,7 +899,35 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_EQ(static_cast(numOfChunks) * rangeSize, result.FileSize); } } - + // last write time + { + memBodyStream.Rewind(); + auto fileClient = m_shareClient->GetRootDirectoryClient().GetFileClient(m_testName); + fileClient.Create(static_cast(numOfChunks) * rangeSize); + auto lastWriteTimeBeforeUpload + = fileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + Files::Shares::UploadFileRangeOptions uploadOptions; + uploadOptions.FileLastWrittenMode + = Azure::Storage::Files::Shares::Models::FileLastWrittenMode::Now; + EXPECT_NO_THROW(fileClient.UploadRange(0, memBodyStream, uploadOptions)); + auto lastWriteTimeAfterUpload + = fileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + EXPECT_NE(lastWriteTimeBeforeUpload, lastWriteTimeAfterUpload); + } + { + memBodyStream.Rewind(); + auto fileClient = m_shareClient->GetRootDirectoryClient().GetFileClient(m_testName); + fileClient.Create(static_cast(numOfChunks) * rangeSize); + auto lastWriteTimeBeforeUpload + = fileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + Files::Shares::UploadFileRangeOptions uploadOptions; + uploadOptions.FileLastWrittenMode + = Azure::Storage::Files::Shares::Models::FileLastWrittenMode::Preserve; + EXPECT_NO_THROW(fileClient.UploadRange(0, memBodyStream, uploadOptions)); + auto lastWriteTimeAfterUpload + = fileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + EXPECT_EQ(lastWriteTimeBeforeUpload, lastWriteTimeAfterUpload); + } { // MD5 works. memBodyStream.Rewind(); @@ -1119,6 +1163,43 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_TRUE(getRangeResult.Ranges[0].Length.HasValue()); EXPECT_EQ(static_cast(fileSize), getRangeResult.Ranges[0].Length.Value()); + // last write time + { + auto lastWriteTimeBeforeUpload + = destFileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + Files::Shares::UploadFileRangeFromUriOptions uploadRangeOptions; + uploadRangeOptions.FileLastWrittenMode + = Azure::Storage::Files::Shares::Models::FileLastWrittenMode::Now; + EXPECT_NO_THROW( + uploadResult = destFileClient + .UploadRangeFromUri( + destRange.Offset, + sourceFileClient.GetUrl() + sourceSas, + sourceRange, + uploadRangeOptions) + .Value); + auto lastWriteTimeAfterUpload + = destFileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + EXPECT_NE(lastWriteTimeBeforeUpload, lastWriteTimeAfterUpload); + } + { + auto lastWriteTimeBeforeUpload + = destFileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + Files::Shares::UploadFileRangeFromUriOptions uploadRangeOptions; + uploadRangeOptions.FileLastWrittenMode + = Azure::Storage::Files::Shares::Models::FileLastWrittenMode::Preserve; + EXPECT_NO_THROW( + uploadResult = destFileClient + .UploadRangeFromUri( + destRange.Offset, + sourceFileClient.GetUrl() + sourceSas, + sourceRange, + uploadRangeOptions) + .Value); + auto lastWriteTimeAfterUpload + = destFileClient.GetProperties().Value.SmbProperties.LastWrittenOn.Value(); + EXPECT_EQ(lastWriteTimeBeforeUpload, lastWriteTimeAfterUpload); + } // source access condition works. std::vector invalidCrc64( uploadResult.TransactionalContentHash.Value.begin(), diff --git a/sdk/storage/azure-storage-files-shares/vcpkg.json b/sdk/storage/azure-storage-files-shares/vcpkg.json index 0d0d853eb5..bbfaff5bf9 100644 --- a/sdk/storage/azure-storage-files-shares/vcpkg.json +++ b/sdk/storage/azure-storage-files-shares/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-files-shares-cpp", - "version-semver": "12.2.1", + "version-semver": "12.3.0-beta.1", "description": [ "Microsoft Azure Storage Files Shares SDK for C++", "This library provides Azure Storage Files Shares SDK." @@ -11,7 +11,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.2" + "version>=": "12.3.0" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-files-shares/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-files-shares/vcpkg/Config.cmake.in index f98b4830f0..94ccc02083 100644 --- a/sdk/storage/azure-storage-files-shares/vcpkg/Config.cmake.in +++ b/sdk/storage/azure-storage-files-shares/vcpkg/Config.cmake.in @@ -4,7 +4,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(azure-storage-common-cpp "12.2.2") +find_dependency(azure-storage-common-cpp "12.3.0") include("${CMAKE_CURRENT_LIST_DIR}/azure-storage-files-shares-cppTargets.cmake") diff --git a/sdk/storage/azure-storage-files-shares/vcpkg/vcpkg.json b/sdk/storage/azure-storage-files-shares/vcpkg/vcpkg.json index aea8969650..9874bac3cf 100644 --- a/sdk/storage/azure-storage-files-shares/vcpkg/vcpkg.json +++ b/sdk/storage/azure-storage-files-shares/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.2" + "version>=": "12.3.0" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-queues/cgmanifest.json b/sdk/storage/azure-storage-queues/cgmanifest.json index 728e7b7085..4ac5c618a3 100644 --- a/sdk/storage/azure-storage-queues/cgmanifest.json +++ b/sdk/storage/azure-storage-queues/cgmanifest.json @@ -1,4 +1,5 @@ { + "$schema": "https://json.schemastore.org/component-detection-manifest.json", "Registrations": [ { "Component": { diff --git a/sdk/template/azure-template/cgmanifest.json b/sdk/template/azure-template/cgmanifest.json index 7f2901e706..1b872bc72d 100644 --- a/sdk/template/azure-template/cgmanifest.json +++ b/sdk/template/azure-template/cgmanifest.json @@ -1,36 +1,37 @@ { - "Registrations": [ - { - "Component": { - "Type": "git", - "git": { - "RepositoryUrl": "https://github.com/google/googletest", - "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "clang-format", - "Version": "9.0.0-2", - "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" - } - }, - "DevelopmentDependency": true - }, - { - "Component": { - "Type": "other", - "Other": { - "Name": "doxygen", - "Version": "1.8.20", - "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" - } - }, - "DevelopmentDependency": true + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "Registrations": [ + { + "Component": { + "Type": "git", + "git": { + "RepositoryUrl": "https://github.com/google/googletest", + "CommitHash": "703bd9caab50b139428cea1aaff9974ebee5742e" } - ] + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "clang-format", + "Version": "9.0.0-2", + "DownloadUrl": "https://ubuntu.pkgs.org/18.04/ubuntu-updates-universe-amd64/clang-format-9_9-2~ubuntu18.04.2_amd64.deb.html" + } + }, + "DevelopmentDependency": true + }, + { + "Component": { + "Type": "other", + "Other": { + "Name": "doxygen", + "Version": "1.8.20", + "DownloadUrl": "http://doxygen.nl/files/doxygen-1.8.20-setup.exe" + } + }, + "DevelopmentDependency": true + } + ] } From 99208c2bf51d232bb688fbadc6ab4c86cb1a2028 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 20 Sep 2022 12:10:08 -0700 Subject: [PATCH 09/75] Removed websocket in preparation for main commit --- sdk/core/azure-core/CMakeLists.txt | 12 +- .../websockets/curl_websockets_transport.hpp | 155 --- .../azure/core/http/websockets/websockets.hpp | 404 -------- .../http/websockets/websockets_transport.hpp | 204 ---- .../win_http_websockets_transport.hpp | 140 --- .../src/http/curl/curl_websockets.cpp | 82 -- .../src/http/websockets/websockets.cpp | 106 --- .../src/http/websockets/websockets_impl.cpp | 879 ----------------- .../src/http/websockets/websockets_impl.hpp | 372 -------- .../src/http/winhttp/win_http_websockets.cpp | 221 ----- sdk/core/azure-core/test/ut/CMakeLists.txt | 5 +- .../azure-core/test/ut/websocket_server.py | 155 --- .../azure-core/test/ut/websocket_test.cpp | 885 ------------------ sdk/core/ci.yml | 47 - 14 files changed, 6 insertions(+), 3661 deletions(-) delete mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp delete mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp delete mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp delete mode 100644 sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp delete mode 100644 sdk/core/azure-core/src/http/curl/curl_websockets.cpp delete mode 100644 sdk/core/azure-core/src/http/websockets/websockets.cpp delete mode 100644 sdk/core/azure-core/src/http/websockets/websockets_impl.cpp delete mode 100644 sdk/core/azure-core/src/http/websockets/websockets_impl.hpp delete mode 100644 sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp delete mode 100644 sdk/core/azure-core/test/ut/websocket_server.py delete mode 100644 sdk/core/azure-core/test/ut/websocket_test.cpp diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index 4cf4415ad1..f631da4215 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -42,20 +42,18 @@ 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 - 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( @@ -80,8 +78,6 @@ 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 @@ -140,8 +136,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 diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp deleted file mode 100644 index d3b1ecb1ad..0000000000 --- a/sdk/core/azure-core/inc/azure/core/http/websockets/curl_websockets_transport.hpp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -/** - * @file - * @brief #Azure::Core::Http::WebSockets::WebSocketTransport implementation via CURL. - */ - -#pragma once - -#include "azure/core/context.hpp" -#include "azure/core/http/curl_transport.hpp" -#include "azure/core/http/http.hpp" -#include "azure/core/http/transport.hpp" -#include "azure/core/http/websockets/websockets_transport.hpp" -#include - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { - - struct CurlWebSocketTransportOptions : public Azure::Core::Http::CurlTransportOptions - { - }; - /** - * @brief Concrete implementation of a WebSocket Transport that uses libcurl. - */ - class CurlWebSocketTransport : public CurlTransport, public WebSocketTransport { - public: - /** - * @brief Construct a new CurlWebSocketTransport object. - * - * @param options Optional parameter to override the default options. - */ - CurlWebSocketTransport( - CurlWebSocketTransportOptions const& options = CurlWebSocketTransportOptions()) - : CurlTransport(options) - { - } - - /** - * @brief Implements interface to send an HTTP Request and produce an HTTP RawResponse - * - * @param request an HTTP Request to be send. - * @param context A context to control the request lifetime. - * - * @return unique ptr to an HTTP RawResponse. - */ - virtual std::unique_ptr Send(Request& request, Context const& context) override; - - /** - * @brief Indicates if the transport natively supports websockets or not. - * - * @details For the CURL websocket transport, the transport does NOT support native websockets - - * it is the responsibility of the client of the WebSocketTransport to format WebSocket protocol - * elements. - */ - virtual bool HasBuiltInWebSocketSupport() override { return false; } - - /** - * @brief Closes the WebSocket handle. - * - */ - virtual void Close() override; - - // Native WebSocket support methods. - /** - * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. - * - * @details Not implemented for CURL websockets because CURL does not support native websockets. - * - * The first param is the close reason, the second is descriptive text. - */ - virtual void NativeCloseSocket(uint16_t, std::string const&, Azure::Core::Context const&) - override - { - throw std::runtime_error("Not implemented."); - } - - /** - * @brief Retrieve the status of the close socket operation. - * - * @details Not implemented for CURL websockets because CURL does not support native websockets. - * - */ - NativeWebSocketCloseInformation NativeGetCloseSocketInformation( - const Azure::Core::Context&) override - { - throw std::runtime_error("Not implemented"); - } - - /** - * @brief Send a frame of data to the remote node. - * - * @details Not implemented for CURL websockets because CURL does not support native websockets. - * - */ - virtual void NativeSendFrame( - NativeWebSocketFrameType, - std::vector const&, - Azure::Core::Context const&) override - { - throw std::runtime_error("Not implemented."); - } - - /** - * @brief Receive a frame of data from the remote node. - * - * @details Not implemented for CURL websockets because CURL does not support native websockets. - * - */ - virtual NativeWebSocketReceiveInformation NativeReceiveFrame( - Azure::Core::Context const&) override - { - throw std::runtime_error("Not implemented"); - } - - // Non-Native WebSocket support. - /** - * @brief This function is used when working with streams to pull more data from the wire. - * Function will try to keep pulling data from socket until the buffer is all written or until - * there is no more data to get from the socket. - * - * @param buffer Buffer to fill with data. - * @param bufferSize Size of buffer. - * @param context Context to control the request lifetime. - * - * @returns Buffer data received. - * - */ - virtual size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) - override; - - /** - * @brief This method will use libcurl socket to write all the bytes from buffer. - * - * @param buffer Buffer to send. - * @param bufferSize Number of bytes to write. - * @param context Context for the operation. - */ - virtual int SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) - override; - - /** - * @brief returns true if this transport supports WebSockets, false otherwise. - */ - bool HasWebSocketSupport() const override { return true; } - - private: - // std::unique_ptr cannot be constructed on an incomplete type (CurlNetworkConnection), but - // std::shared_ptr can be. - std::shared_ptr m_upgradedConnection; - void OnUpgradedConnection( - std::unique_ptr&& upgradedConnection) override; - }; - -}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp deleted file mode 100644 index a0a55d3bd4..0000000000 --- a/sdk/core/azure-core/inc/azure/core/http/websockets/websockets.hpp +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -/** - * @file - * @brief Azure Core APIs implementing the WebSocket protocol [RFC 6455] - * (https://www.rfc-editor.org/rfc/rfc6455.html). - */ - -#pragma once - -#include "azure/core/context.hpp" -#include "azure/core/http/http.hpp" -#include "azure/core/http/transport.hpp" -#include "azure/core/internal/client_options.hpp" -#include -#include - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { - namespace _detail { - class WebSocketImplementation; - } - namespace _internal { - - enum class WebSocketFrameType : int - { - Unknown, - TextFrameReceived, - BinaryFrameReceived, - PeerClosedReceived, - }; - - enum class WebSocketErrorCode : uint16_t - { - OK = 1000, - EndpointDisappearing = 1001, - ProtocolError = 1002, - UnknownDataType = 1003, - Reserved1 = 1004, - NoStatusCodePresent = 1005, - ConnectionClosedWithoutCloseFrame = 1006, - InvalidMessageData = 1007, - PolicyViolation = 1008, - MessageTooLarge = 1009, - ExtensionNotFound = 1010, - UnexpectedError = 1011, - TlsHandshakeFailure = 1015, - }; - - class WebSocketTextFrame; - class WebSocketBinaryFrame; - class WebSocketPeerCloseFrame; - - namespace _detail { - class WebSocketImplementation; - } - /** @brief Statistics about data sent and received by the WebSocket. - * - * @remarks This class is primarily intended for test collateral and debugging to allow - * a caller to determine information about the status of a WebSocket. - * - * Note: Some of these statistics are not available if the underlying transport supports native - * websockets. - */ - struct WebSocketStatistics - { - /** @brief The number of WebSocket frames sent on this WebSocket. */ - uint32_t FramesSent; - - /** @brief The number of bytes of data sent to the peer on this WebSocket. */ - uint32_t BytesSent; - - /** @brief The number of WebSocket frames received from the peer. */ - uint32_t FramesReceived; - - /** @brief The number of bytes received from the peer. */ - uint32_t BytesReceived; - - /** @brief The number of "Ping" frames received from the peer. */ - uint32_t PingFramesReceived; - - /** @brief The number of "Ping" frames sent to the peer. */ - uint32_t PingFramesSent; - - /** @brief The number of "Pong" frames received from the peer. */ - uint32_t PongFramesReceived; - - /** @brief The number of "Pong" frames sent to the peer. */ - uint32_t PongFramesSent; - - /** @brief The number of "Text" frames received from the peer. */ - uint32_t TextFramesReceived; - - /** @brief The number of "Text" frames sent to the peer. */ - uint32_t TextFramesSent; - - /** @brief The number of "Binary" frames received from the peer. */ - uint32_t BinaryFramesReceived; - - /** @brief The number of "Binary" frames sent to the peer. */ - uint32_t BinaryFramesSent; - - /** @brief The number of "Continuation" frames sent to the peer. */ - uint32_t ContinuationFramesSent; - - /** @brief The number of "Continuation" frames received from the peer. */ - uint32_t ContinuationFramesReceived; - - /** @brief The number of "Close" frames received from the peer. */ - uint32_t CloseFramesReceived; - - /** @brief The number of frames received which were not processed. */ - uint32_t FramesDropped; - - /** @brief The number of frames received which were not returned because they were received - * after the Close() method was called. */ - - uint32_t FramesDroppedByClose; - /** @brief The number of frames dropped because they were over the maximum payload size. */ - - uint32_t FramesDroppedByPayloadSizeLimit; - /** @brief The number of frames dropped because they were out of compliance with the protocol. - */ - uint32_t FramesDroppedByProtocolError; - - /** @brief The number of reads performed on the transport.*/ - uint32_t TransportReads; - - /** @brief The number of bytes read from the transport. */ - uint32_t TransportReadBytes; - }; - - /** @brief A frame of data received from a WebSocket. - */ - class WebSocketFrame { - public: - /** @brief The type of frame received: Text, Binary or Close. */ - WebSocketFrameType FrameType{}; - - /** @brief True if the frame received is a "final" frame */ - bool IsFinalFrame{false}; - - /** @brief Returns the contents of the frame as a Text frame. - * @returns A WebSocketTextFrame containing the contents of the frame. - */ - std::shared_ptr AsTextFrame(); - - /** @brief Returns the contents of the frame as a Binary frame. - * @returns A WebSocketBinaryFrame containing the contents of the frame. - */ - - std::shared_ptr AsBinaryFrame(); - /** @brief Returns the contents of the frame as a Peer Close frame. - * @returns A WebSocketPeerCloseFrame containing the contents of the frame. - */ - std::shared_ptr AsPeerCloseFrame(); - - /** @brief Construct a new instance of a WebSocketFrame.*/ - WebSocketFrame() = default; - - /** @brief Construct a new instance of a WebSocketFrame with a specific frame type. - * @param frameType The type of frame received. - */ - WebSocketFrame(WebSocketFrameType frameType) : FrameType{frameType} {} - - /** @brief Construct a new instance of a WebSocketFrame with a specific frame type and final - * flag. - * @param frameType The type of frame received. - * @param isFinalFrame true if the frame is the final frame. - */ - WebSocketFrame(WebSocketFrameType frameType, bool isFinalFrame) - : FrameType{frameType}, IsFinalFrame{isFinalFrame} - { - } - }; - - /** @brief Contains the contents of a WebSocket Text frame.*/ - class WebSocketTextFrame : public WebSocketFrame, - public std::enable_shared_from_this { - friend Azure::Core::Http::WebSockets::_detail::WebSocketImplementation; - - private: - public: - /** @brief Constructs a new WebSocketTextFrame */ - WebSocketTextFrame() : WebSocketFrame(WebSocketFrameType::TextFrameReceived){}; - - /** @brief Text of the frame received from the remote peer. */ - std::string Text; - - private: - /** @brief Constructs a new WebSocketTextFrame - * @param isFinalFrame True if this is the final frame in a multi-frame message. - * @param body UTF-8 encoded text of the frame data. - * @param size Length in bytes of the frame body. - */ - WebSocketTextFrame(bool isFinalFrame, uint8_t const* body, size_t size) - : WebSocketFrame{WebSocketFrameType::TextFrameReceived, isFinalFrame}, - Text(body, body + size) - { - } - }; - - /** @brief Contains the contents of a WebSocket Binary frame.*/ - class WebSocketBinaryFrame : public WebSocketFrame, - public std::enable_shared_from_this { - friend Azure::Core::Http::WebSockets::_detail::WebSocketImplementation; - - private: - public: - /** @brief Constructs a new WebSocketBinaryFrame */ - WebSocketBinaryFrame() : WebSocketFrame(WebSocketFrameType::BinaryFrameReceived){}; - - /** @brief Binary frame data received from the remote peer. */ - std::vector Data; - - /** @brief Constructs a new WebSocketBinaryFrame - * @param isFinal True if this is the final frame in a multi-frame message. - * @param body binary of the frame data. - * @param size Length in bytes of the frame body. - */ - private: - WebSocketBinaryFrame(bool isFinal, uint8_t const* body, size_t size) - : WebSocketFrame{WebSocketFrameType::BinaryFrameReceived, isFinal}, - Data(body, body + size) - { - } - }; - - /** @brief Contains the contents of a WebSocket Close frame.*/ - class WebSocketPeerCloseFrame : public WebSocketFrame, - public std::enable_shared_from_this { - friend Azure::Core::Http::WebSockets::_detail::WebSocketImplementation; - - public: - /** @brief Constructs a new WebSocketPeerCloseFrame */ - WebSocketPeerCloseFrame() : WebSocketFrame(WebSocketFrameType::PeerClosedReceived){}; - - /** @brief Status code sent from the remote peer. Typically a member of the WebSocketErrorCode - * enumeration */ - uint16_t RemoteStatusCode{}; - - /** @brief Optional text sent from the remote peer. */ - std::string RemoteCloseReason; - - private: - /** @brief Constructs a new WebSocketBinaryFrame - * @param remoteStatusCode Status code sent by the remote peer. - * @param remoteCloseReason Optional reason sent by the remote peer. - */ - WebSocketPeerCloseFrame(uint16_t remoteStatusCode, std::string const& remoteCloseReason) - : WebSocketFrame{WebSocketFrameType::PeerClosedReceived}, - RemoteStatusCode(remoteStatusCode), RemoteCloseReason(remoteCloseReason) - { - } - }; - - struct WebSocketOptions : Azure::Core::_internal::ClientOptions - { - /** - * @brief The set of protocols which are supported by this client - */ - std::vector Protocols = {}; - - /** - * @brief The protocol name of the service client. Used for the User-Agent header - * in the initial WebSocket handshake. - */ - std::string ServiceName; - - /** - * @brief The version of the service client. Used for the User-Agent header in the - * initial WebSocket handshake - */ - std::string ServiceVersion; - - /** - * @brief The period of time between ping operations, default is 60 seconds. - */ - std::chrono::duration PingInterval{std::chrono::seconds{60}}; - - /** - * @brief Construct an instance of a WebSocketOptions type. - * - * @param protocols Supported protocols for this websocket client. - */ - explicit WebSocketOptions(std::vector protocols) - : Azure::Core::_internal::ClientOptions{}, Protocols(protocols) - { - } - WebSocketOptions() = default; - }; - - class WebSocket { - public: - /** @brief Constructs a new instance of a WebSocket with the specified WebSocket options. - * - * @param remoteUrl The URL of the remote WebSocket server. - * @param options The options to use for the WebSocket. - */ - explicit WebSocket( - Azure::Core::Url const& remoteUrl, - WebSocketOptions const& options = WebSocketOptions{}); - - /** @brief Destroys an instance of a WebSocket. - */ - ~WebSocket(); - - /** @brief Opens a WebSocket connection to a remote server. - * - * @param context Context for the operation, used for cancellation and timeout. - */ - void Open(Azure::Core::Context const& context = Azure::Core::Context{}); - - /** @brief Closes a WebSocket connection to the remote server gracefully. - * - * @param context Context for the operation. - */ - void Close(Azure::Core::Context const& context = Azure::Core::Context{}); - - /** @brief Closes a WebSocket connection to the remote server with additional context. - * - * @param closeStatus 16 bit WebSocket error code. - * @param closeReason String describing the reason for closing the socket. - * @param context Context for the operation. - */ - void Close( - uint16_t closeStatus, - std::string const& closeReason = {}, - Azure::Core::Context const& context = Azure::Core::Context{}); - - /** @brief Sends a String frame to the remote server. - * - * @param textFrame UTF-8 encoded text to send. - * @param isFinalFrame if True, this is the final frame in a multi-frame message. - * @param context Context for the operation. - */ - void SendFrame( - std::string const& textFrame, - bool isFinalFrame = false, - Azure::Core::Context const& context = Azure::Core::Context{}); - - /** @brief Sends a Binary frame to the remote server. - * - * @param binaryFrame Binary data to send. - * @param isFinalFrame if True, this is the final frame in a multi-frame message. - * @param context Context for the operation. - */ - void SendFrame( - std::vector const& binaryFrame, - bool isFinalFrame = false, - Azure::Core::Context const& context = Azure::Core::Context{}); - - /** @brief Receive a frame from the remote server. - * - * @param context Context for the operation. - * - * @returns The received WebSocket frame. - * - */ - std::shared_ptr ReceiveFrame( - Azure::Core::Context const& context = Azure::Core::Context{}); - - /** @brief AddHeader - Adds a header to the initial handshake. - * - * @note This API is ignored after the WebSocket is opened. - * - * @param headerName Name of header to add to the initial handshake request. - * @param headerValue Value of header to add. - */ - void AddHeader(std::string const& headerName, std::string const& headerValue); - - /** @brief Determine if the WebSocket is open. - * - * @returns true if the WebSocket is open, false otherwise. - */ - bool IsOpen() const; - - /** @brief Returns "true" if the configured websocket transport - * supports websockets in the transport, or if the websocket implementation - * is providing websocket protocol support. - * - * @returns true if the HTTP transport used for WebSocket support directly supports the - * WebSocket API. - */ - bool HasBuiltInWebSocketSupport() const; - - /** @brief Returns the protocol chosen by the remote server during the initial handshake. - * - * @returns The protocol negotiated between client and server. - */ - std::string const& GetNegotiatedProtocol() const; - - /** @brief Returns statistics about the WebSocket. - * - * @returns The statistics about the WebSocket. - */ - WebSocketStatistics GetStatistics() const; - - private: - std::unique_ptr - m_socketImplementation; - }; - } // namespace _internal -}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp deleted file mode 100644 index 1afda3c0d2..0000000000 --- a/sdk/core/azure-core/inc/azure/core/http/websockets/websockets_transport.hpp +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -/** - * @file - * @brief Utilities to be used by HTTP WebSocket transport implementations. - */ - -#pragma once - -#include "azure/core/context.hpp" -#include "azure/core/http/http.hpp" - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { - - /** - * @brief Base class for all WebSocket transport implementations. - */ - class WebSocketTransport { - public: - /** - * @brief Web Socket Frame type, one of Text or Binary. - */ - enum class NativeWebSocketFrameType - { - /** - * @brief Indicates that the frame is a partial UTF-8 encoded text frame - it is NOT the - * complete frame to be sent to the remote node. - */ - TextFragment, - /** - * @brief Indicates that the frame is either the complete UTF-8 encoded text frame to be sent - * to the remote node or the final frame of a multipart message. - */ - Text, - /** - * @brief Indicates that the frame is either the complete binary frame to be sent - * to the remote node or the final frame of a multipart message. - */ - Binary, - /** - * @brief Indicates that the frame is a partial binary frame - it is NOT the - * complete frame to be sent to the remote node. - */ - BinaryFragment, - - /** - * @brief Indicates that the frame is a "close" frame - the remote node - * sent a close frame. - */ - Closed, - }; - - /** @brief Close information returned from a WebSocket transport that has builtin support - * for WebSockets. - */ - struct NativeWebSocketCloseInformation - { - /** - * @brief Close response code. - */ - uint16_t CloseReason; - /** - * @brief Close reason. - */ - std::string CloseReasonDescription; - }; - /** @brief Frame information returned from a WebSocket transport that has builtin support - * for WebSockets. - */ - struct NativeWebSocketReceiveInformation - { - /** - * @brief Type of frame received. - */ - NativeWebSocketFrameType FrameType; - /** - * @brief Data received. - */ - std::vector FrameData; - }; - /** - * @brief Destructs `%WebSocketTransport`. - * - */ - virtual ~WebSocketTransport() {} - - /** - * @brief Indicates whether the transport natively supports WebSockets. - * - * @returns true if the transport has native websocket support, false otherwise. - */ - virtual bool HasBuiltInWebSocketSupport() = 0; - - /** - * @brief Closes the WebSocket. - * - * Does not notify the remote endpoint that the socket is being closed. - * - */ - virtual void Close() = 0; - - /**************/ - /* Native WebSocket support functions*/ - /**************/ - /** - * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. - * - * @param status Status value to be sent to the remote node. Application defined. - * @param disconnectReason UTF-8 encoded reason for the disconnection. Optional. - * @param context Context for the operation. - */ - virtual void NativeCloseSocket( - uint16_t status, - std::string const& disconnectReason, - Azure::Core::Context const& context) - = 0; - - /** - * @brief Retrieve the information associated with a WebSocket close response. - * - * @param context Context for the operation. - * - * @returns a tuple containing the status code and string. - */ - virtual NativeWebSocketCloseInformation NativeGetCloseSocketInformation( - Azure::Core::Context const& context) - = 0; - - /** - * @brief Send a frame of data to the remote node. - * - * @param frameType Frame type sent to the server, Text or Binary. - * @param frameData Frame data to be sent to the server. - * @param context Context for the operation. - */ - virtual void NativeSendFrame( - NativeWebSocketFrameType frameType, - std::vector const& frameData, - Azure::Core::Context const& context) - = 0; - - /** - * @brief Receive a frame from the remote WebSocket server. - * - * @param context Context for the operation. - * - * @returns a tuple containing the Frame data received from the remote server and the type of - * data returned from the remote endpoint - */ - virtual NativeWebSocketReceiveInformation NativeReceiveFrame( - Azure::Core::Context const& context) - = 0; - - /**************/ - /* Non Native WebSocket support functions */ - /**************/ - - /** - * @brief This function is used when working with streams to pull more data from the wire. - * Function will try to keep pulling data from socket until the buffer is all written or until - * there is no more data to get from the socket. - * - */ - virtual size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) = 0; - - /** - * @brief This method will use the raw socket to write all the bytes from buffer. - * - */ - virtual int SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) = 0; - - protected: - /** - * @brief Constructs a default instance of `%WebSocketTransport`. - * - */ - WebSocketTransport() = default; - - /** - * @brief Constructs `%HttpTransport` by copying another instance of `%HttpTransport`. - * - * @param other An instance to copy. - */ - WebSocketTransport(const WebSocketTransport& other) = default; - - /** - * @brief Constructs a WebSocketTransport from another WebSocketTransport. - * - * @param other An instance to move in. - */ - WebSocketTransport(WebSocketTransport&& other) = default; - - /** - * @brief Assigns one WebSocketTransport to another. - * - * @param other An instance to assign. - * - * @return A reference to this instance. - */ - WebSocketTransport& operator=(const WebSocketTransport& other) = default; - }; - -}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp deleted file mode 100644 index 8fdf5b533c..0000000000 --- a/sdk/core/azure-core/inc/azure/core/http/websockets/win_http_websockets_transport.hpp +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -/** - * @file - * @brief #Azure::Core::Http::WebSockets::WebSocketTransport implementation via WInHTTP. - */ - -#pragma once - -#include "azure/core/context.hpp" -#include "azure/core/http/http.hpp" -#include "azure/core/http/transport.hpp" -#include "azure/core/http/websockets/websockets_transport.hpp" -#include "azure/core/http/win_http_transport.hpp" -#include -#include - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { - - /** - * @brief Concrete implementation of a WebSocket Transport that uses WinHTTP. - */ - class WinHttpWebSocketTransport : public WebSocketTransport, public WinHttpTransport { - - Azure::Core::Http::_detail::unique_HINTERNET m_socketHandle; - std::mutex m_sendMutex; - std::mutex m_receiveMutex; - - // Called by the - void OnUpgradedConnection( - Azure::Core::Http::_detail::unique_HINTERNET const& requestHandle) override; - - public: - /** - * @brief Construct a new WinHTTP WebSocket Transport. - * - * @param options Optional parameter to override the default options. - */ - WinHttpWebSocketTransport(WinHttpTransportOptions const& options = WinHttpTransportOptions()) - : WinHttpTransport(options) - { - } - - /** - * @brief Implements interface to send an HTTP Request and produce an HTTP RawResponse - * - * @param request an HTTP Request to be send. - * @param context A context to control the request lifetime. - * - * @return unique ptr to an HTTP RawResponse. - */ - virtual std::unique_ptr Send(Request& request, Context const& context) override; - - /** - * @brief Indicates if the transports natively websockets or not. - * - * @details For the WinHTTP websocket transport, the WinHTTP API supports websockets. - */ - virtual bool HasBuiltInWebSocketSupport() override { return true; } - - /** - * @brief Close the underlying WebSocket handle. - * - */ - virtual void Close() override; - - // Native WebSocket support methods. - /** - * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. - * - * @details Not implemented for CURL websockets because CURL does not support native websockets. - * - * @param status Status value to be sent to the remote node. Application defined. - * @param disconnectReason UTF-8 encoded reason for the disconnection. Optional. - * @param context Context for the operation. - * - */ - virtual void NativeCloseSocket(uint16_t, std::string const&, Azure::Core::Context const&) - override; - - /** - * @brief Retrieve the information associated with a WebSocket close response. - * - * Should only be called when a Receive operation returns WebSocketFrameType::CloseFrameType - * - * @param context Context for the operation. - * - * @returns a tuple containing the status code and string. - */ - virtual NativeWebSocketCloseInformation NativeGetCloseSocketInformation( - Azure::Core::Context const& context) override; - - /** - * @brief Send a frame of data to the remote node. - * - * @details Not implemented for CURL websockets because CURL does not support native - * websockets. - * - * @brief frameType Frame type sent to the server, Text or Binary. - * @brief frameData Frame data to be sent to the server. - */ - virtual void NativeSendFrame( - NativeWebSocketFrameType, - std::vector const&, - Azure::Core::Context const&) override; - - virtual NativeWebSocketReceiveInformation NativeReceiveFrame( - Azure::Core::Context const&) override; - - // Non-Native WebSocket support. - /** - * @brief This function is used when working with streams to pull more data from the wire. - * Function will try to keep pulling data from socket until the buffer is all written or - * until there is no more data to get from the socket. - * - * @details Not implemented for WinHTTP websockets because WinHTTP implements websockets - * natively. - */ - virtual size_t ReadFromSocket(uint8_t*, size_t, Context const&) override - { - throw std::runtime_error("Not implemented."); - } - - /** - * @brief This method will use sockets to write all the bytes from buffer. - * - * @details Not implemented for WinHTTP websockets because WinHTTP implements websockets - * natively. - * - */ - virtual int SendBuffer(uint8_t const*, size_t, Context const&) override - { - throw std::runtime_error("Not implemented."); - } - - bool HasWebSocketSupport() const override { return true; } - }; - -}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/src/http/curl/curl_websockets.cpp b/sdk/core/azure-core/src/http/curl/curl_websockets.cpp deleted file mode 100644 index 49e182caee..0000000000 --- a/sdk/core/azure-core/src/http/curl/curl_websockets.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -#include "azure/core/http/http.hpp" -#include "azure/core/http/policies/policy.hpp" -#include "azure/core/http/transport.hpp" -#include "azure/core/http/websockets/curl_websockets_transport.hpp" -#include "azure/core/internal/diagnostics/log.hpp" -#include "azure/core/platform.hpp" - -// Private include -#include "curl_connection_private.hpp" - -#if defined(AZ_PLATFORM_POSIX) -#include // for poll() -#include // for socket shutdown -#elif defined(AZ_PLATFORM_WINDOWS) -#if !defined(WIN32_LEAN_AND_MEAN) -#define WIN32_LEAN_AND_MEAN -#endif -#if !defined(NOMINMAX) -#define NOMINMAX -#endif -#include -#include // for WSAPoll(); -#endif - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { - - void CurlWebSocketTransport::Close() { m_upgradedConnection->Shutdown(); } - - // Send an HTTP request to the remote server. - std::unique_ptr CurlWebSocketTransport::Send( - Request& request, - Context const& context) - { - // CURL doesn't understand the ws and wss protocols, so change the URL to be http based. - std::string requestScheme(request.GetUrl().GetScheme()); - if (requestScheme == "wss" || requestScheme == "ws") - { - if (requestScheme == "wss") - { - request.GetUrl().SetScheme("https"); - } - else - { - request.GetUrl().SetScheme("http"); - } - } - return CurlTransport::Send(request, context); - } - - size_t CurlWebSocketTransport::ReadFromSocket( - uint8_t* buffer, - size_t bufferSize, - Context const& context) - { - return m_upgradedConnection->ReadFromSocket(buffer, bufferSize, context); - } - - /** - * @brief This method will use libcurl socket to write all the bytes from buffer. - * - */ - int CurlWebSocketTransport::SendBuffer( - uint8_t const* buffer, - size_t bufferSize, - Context const& context) - { - return m_upgradedConnection->SendBuffer(buffer, bufferSize, context); - } - - void CurlWebSocketTransport::OnUpgradedConnection( - std::unique_ptr&& upgradedConnection) - { - // Note that m_upgradedConnection is a std::shared_ptr. We define it as a std::shared_ptr - // because a std::shared_ptr can be declared on an incomplete type, while a std::unique_ptr - // cannot. - m_upgradedConnection = std::move(upgradedConnection); - } - -}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/src/http/websockets/websockets.cpp b/sdk/core/azure-core/src/http/websockets/websockets.cpp deleted file mode 100644 index 65102f31ab..0000000000 --- a/sdk/core/azure-core/src/http/websockets/websockets.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -#include "azure/core/http/websockets/websockets.hpp" -#include "azure/core/context.hpp" -#include "websockets_impl.hpp" - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { namespace _internal { - - WebSocket::WebSocket(Azure::Core::Url const& remoteUrl, WebSocketOptions const& options) - : m_socketImplementation( - std::make_unique( - remoteUrl, - options)) - - { - } - WebSocket::~WebSocket() {} - - void WebSocket::Open(Azure::Core::Context const& context) - { - m_socketImplementation->Open(context); - } - void WebSocket::Close(Azure::Core::Context const& context) - { - m_socketImplementation->Close( - static_cast(WebSocketErrorCode::EndpointDisappearing), {}, context); - } - void WebSocket::Close( - uint16_t closeStatus, - std::string const& closeReason, - Azure::Core::Context const& context) - { - m_socketImplementation->Close(closeStatus, closeReason, context); - } - - void WebSocket::SendFrame( - std::string const& textFrame, - bool isFinalFrame, - Azure::Core::Context const& context) - { - m_socketImplementation->SendFrame(textFrame, isFinalFrame, context); - } - - void WebSocket::SendFrame( - std::vector const& binaryFrame, - bool isFinalFrame, - Azure::Core::Context const& context) - { - m_socketImplementation->SendFrame(binaryFrame, isFinalFrame, context); - } - - WebSocketStatistics WebSocket::GetStatistics() const - { - return m_socketImplementation->GetStatistics(); - } - - bool WebSocket::HasBuiltInWebSocketSupport() const - { - return m_socketImplementation->HasBuiltInWebSocketSupport(); - } - - std::shared_ptr WebSocket::ReceiveFrame(Azure::Core::Context const& context) - { - return m_socketImplementation->ReceiveFrame(context); - } - - void WebSocket::AddHeader(std::string const& headerName, std::string const& headerValue) - { - m_socketImplementation->AddHeader(headerName, headerValue); - } - std::string const& WebSocket::GetNegotiatedProtocol() const - { - return m_socketImplementation->GetNegotiatedProtocol(); - } - - bool WebSocket::IsOpen() const { return m_socketImplementation->IsOpen(); } - - std::shared_ptr WebSocketFrame::AsTextFrame() - { - if (FrameType != WebSocketFrameType::TextFrameReceived) - { - throw std::logic_error("Cannot cast to TextFrameReceived."); - } - return static_cast(this)->shared_from_this(); - } - - std::shared_ptr WebSocketFrame::AsBinaryFrame() - { - if (FrameType != WebSocketFrameType::BinaryFrameReceived) - { - throw std::logic_error("Cannot cast to BinaryFrameReceived."); - } - return static_cast(this)->shared_from_this(); - } - - std::shared_ptr WebSocketFrame::AsPeerCloseFrame() - { - if (FrameType != WebSocketFrameType::PeerClosedReceived) - { - throw std::logic_error("Cannot cast to PeerClose."); - } - return static_cast(this)->shared_from_this(); - } - -}}}}} // namespace Azure::Core::Http::WebSockets::_internal diff --git a/sdk/core/azure-core/src/http/websockets/websockets_impl.cpp b/sdk/core/azure-core/src/http/websockets/websockets_impl.cpp deleted file mode 100644 index 90a9a69e33..0000000000 --- a/sdk/core/azure-core/src/http/websockets/websockets_impl.cpp +++ /dev/null @@ -1,879 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT -#include "websockets_impl.hpp" -#include "azure/core/base64.hpp" -#include "azure/core/http/policies/policy.hpp" -#include "azure/core/internal/cryptography/sha_hash.hpp" -// SUPPORT_NATIVE_TRANSPORT indicates if WinHTTP should be compiled with native transport support -// or not. -// Note that this is primarily required to improve the code coverage numbers in the CI pipeline. -#if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) -#include "azure/core/http/websockets/win_http_websockets_transport.hpp" -#define SUPPORT_NATIVE_TRANSPORT 1 -#elif defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) -#include "azure/core/http/websockets/curl_websockets_transport.hpp" -#define SUPPORT_NATIVE_TRANSPORT 0 -#endif -#include "azure/core/internal/diagnostics/log.hpp" -#include -#include -#include -#include -#include -#include -#include - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { namespace _detail { - using namespace Azure::Core::Http::WebSockets::_internal; - using namespace Azure::Core::Diagnostics::_internal; - using namespace Azure::Core::Diagnostics; - using namespace std::chrono_literals; - - namespace { - std::string HexEncode(std::vector const& data, size_t length) - { - std::stringstream ss; - for (size_t i = 0; i < std::min(data.size(), length); i++) - { - ss << std::hex << std::setfill('0') << std::setw(2) << static_cast(data[i]); - } - return ss.str(); - } - } // namespace - - WebSocketImplementation::WebSocketImplementation( - Azure::Core::Url const& remoteUrl, - WebSocketOptions const& options) - : m_remoteUrl(remoteUrl), m_options(options), m_pingThread(this, m_options.PingInterval) - { - } - - void WebSocketImplementation::Open(Azure::Core::Context const& context) - { - if (m_state != SocketState::Invalid && m_state != SocketState::Closed) - { - throw std::runtime_error( - "Socket in unexpected state: " + std::to_string(static_cast(m_state))); - } - m_state = SocketState::Opening; - -#if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) - WinHttpTransportOptions transportOptions; - auto winHttpTransport - = std::make_shared( - transportOptions); - m_transport = std::static_pointer_cast(winHttpTransport); - m_options.Transport.Transport = std::static_pointer_cast(winHttpTransport); -#elif defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) - CurlWebSocketTransportOptions transportOptions; - transportOptions.HttpKeepAlive = false; - auto curlWebSockets - = std::make_shared(transportOptions); - - m_transport = std::static_pointer_cast(curlWebSockets); - m_options.Transport.Transport = std::static_pointer_cast(curlWebSockets); -#endif - - std::vector> perCallPolicies{}; - std::vector> perRetryPolicies{}; - // If the caller has told us a service name, add the telemetry policy to the pipeline to add - // a user agent header to the request. - if (!m_options.ServiceName.empty()) - { - perCallPolicies.push_back( - std::make_unique( - m_options.ServiceName, m_options.ServiceVersion, m_options.Telemetry)); - } - Azure::Core::Http::_internal::HttpPipeline openPipeline( - m_options, std::move(perRetryPolicies), std::move(perCallPolicies)); - - Azure::Core::Http::Request openSocketRequest( - Azure::Core::Http::HttpMethod::Get, m_remoteUrl, false); - - // Generate the random request key. Only used when the transport doesn't support websockets - // natively. - auto randomKey = GenerateRandomKey(); - auto encodedKey = Azure::Core::Convert::Base64Encode(randomKey); - if (!m_transport->HasBuiltInWebSocketSupport()) - { - // If the transport doesn't support WebSockets natively, set the standardized WebSocket - // upgrade headers. - openSocketRequest.SetHeader("Upgrade", "websocket"); - openSocketRequest.SetHeader("Connection", "upgrade"); - openSocketRequest.SetHeader("Sec-WebSocket-Version", "13"); - openSocketRequest.SetHeader("Sec-WebSocket-Key", encodedKey); - } - if (!m_options.Protocols.empty()) - { - - std::string protocols; - for (auto const& protocol : m_options.Protocols) - { - protocols += protocol; - protocols += ", "; - } - protocols = protocols.substr(0, protocols.size() - 2); - openSocketRequest.SetHeader("Sec-WebSocket-Protocol", protocols); - } - for (auto const& additionalHeader : m_headers) - { - openSocketRequest.SetHeader(additionalHeader.first, additionalHeader.second); - } - std::string remoteOrigin; - remoteOrigin = m_remoteUrl.GetScheme(); - remoteOrigin += "://"; - remoteOrigin += m_remoteUrl.GetHost(); - openSocketRequest.SetHeader("Origin", remoteOrigin); - - // Send the connect request to the WebSocket server. - auto response = openPipeline.Send(openSocketRequest, context); - - // Ensure that the server thinks we're switching protocols. If it doesn't, - // fail immediately. - if (response->GetStatusCode() != Azure::Core::Http::HttpStatusCode::SwitchingProtocols) - { - throw Azure::Core::Http::TransportException("Unexpected handshake response"); - } - - // Prove that the server received this socket request. - auto& responseHeaders = response->GetHeaders(); - if (!m_transport->HasBuiltInWebSocketSupport()) - { - auto socketAccept(responseHeaders.find("Sec-WebSocket-Accept")); - if (socketAccept == responseHeaders.end()) - { - throw Azure::Core::Http::TransportException("Missing Sec-WebSocket-Accept header"); - } - // Verify that the WebSocket server received *this* open request. - else - { - VerifySocketAccept(encodedKey, socketAccept->second); - } - m_initialBodyStream = response->ExtractBodyStream(); - m_pingThread.Start(m_transport); - } - - // Remember the protocol that the client chose. - auto chosenProtocol = responseHeaders.find("Sec-WebSocket-Protocol"); - if (chosenProtocol != responseHeaders.end()) - { - m_chosenProtocol = chosenProtocol->second; - } - - m_state = SocketState::Open; - } - bool WebSocketImplementation::HasBuiltInWebSocketSupport() - { - std::lock_guard lock(m_stateMutex); - m_stateOwner = std::this_thread::get_id(); - if (m_state != SocketState::Open) - { - throw std::runtime_error( - "Socket is not open." + std::to_string(static_cast(m_state))); - } - return m_transport->HasBuiltInWebSocketSupport(); - } - - std::string const& WebSocketImplementation::GetNegotiatedProtocol() - { - std::lock_guard lock(m_stateMutex); - m_stateOwner = std::this_thread::get_id(); - if (m_state != SocketState::Open) - { - throw std::runtime_error( - "Socket is not open." + std::to_string(static_cast(m_state))); - } - return m_chosenProtocol; - } - - void WebSocketImplementation::AddHeader(std::string const& header, std::string const& headerValue) - { - std::lock_guard lock(m_stateMutex); - m_stateOwner = std::this_thread::get_id(); - if (m_state != SocketState::Closed && m_state != SocketState::Invalid) - { - throw std::runtime_error("AddHeader can only be called on closed sockets."); - } - m_headers.emplace(std::make_pair(header, headerValue)); - } - - void WebSocketImplementation::Close( - uint16_t closeStatus, - std::string const& closeReason, - Azure::Core::Context const& context) - { - std::unique_lock lock(m_stateMutex); - m_stateOwner = std::this_thread::get_id(); - - // If we're closing an already closed socket, we're done. - if (m_state == SocketState::Closed) - { - return; - } - if (m_state != SocketState::Open) - { - throw std::runtime_error( - "Socket is not open." + std::to_string(static_cast(m_state))); - } - m_state = SocketState::Closing; -#if SUPPORT_NATIVE_TRANSPORT - if (m_transport->HasBuiltInWebSocketSupport()) - { - m_transport->NativeCloseSocket(closeStatus, closeReason.c_str(), context); - } - else -#endif - { - // Send a going away message to the server. - std::vector closePayload; - closePayload.push_back(closeStatus >> 8); - closePayload.push_back(closeStatus & 0xff); - closePayload.insert(closePayload.end(), closeReason.begin(), closeReason.end()); - std::vector closeFrame = EncodeFrame(SocketOpcode::Close, true, closePayload); - SendTransportBuffer(closeFrame, context); - - // Unlock the state mutex before waiting for the close response to be received. - lock.unlock(); - // Drain the incoming series of frames from the server. - // Note that there might be in-flight frames that were sent from the other end of the - // WebSocket that we don't care about any more (since we're closing the WebSocket). So - // drain those frames. - auto closeResponse = ReceiveTransportFrame(context); - while (closeResponse && closeResponse->Opcode != SocketOpcode::Close) - { - m_receiveStatistics.FramesDroppedByClose++; - Log::Write( - Logger::Level::Warning, - "Received unexpected frame during close. Opcode: " - + std::to_string(static_cast(closeResponse->Opcode))); - closeResponse = ReceiveTransportFrame(context); - } - - // Re-acquire the state lock once we've received the close response. - lock.lock(); - m_stateOwner = std::this_thread::get_id(); - } - // Close the socket - after this point, the m_transport is invalid. - m_pingThread.Shutdown(); - m_transport->Close(); - m_state = SocketState::Closed; - } - - void WebSocketImplementation::SendFrame( - std::string const& textFrame, - bool isFinalFrame, - Azure::Core::Context const& context) - { - std::lock_guard lock(m_stateMutex); - m_stateOwner = std::this_thread::get_id(); - if (m_state != SocketState::Open) - { - throw std::runtime_error( - "Socket is not open." + std::to_string(static_cast(m_state))); - } - std::vector utf8text(textFrame.begin(), textFrame.end()); - m_receiveStatistics.TextFramesSent++; -#if SUPPORT_NATIVE_TRANSPORT - if (m_transport->HasBuiltInWebSocketSupport()) - { - m_transport->NativeSendFrame( - (isFinalFrame ? WebSocketTransport::NativeWebSocketFrameType::Text - : WebSocketTransport::NativeWebSocketFrameType::TextFragment), - utf8text, - context); - } - else -#endif - { - std::vector sendFrame = EncodeFrame(SocketOpcode::TextFrame, isFinalFrame, utf8text); - SendTransportBuffer(sendFrame, context); - } - } - - void WebSocketImplementation::SendFrame( - std::vector const& binaryFrame, - bool isFinalFrame, - Azure::Core::Context const& context) - { - std::lock_guard lock(m_stateMutex); - m_stateOwner = std::this_thread::get_id(); - - if (m_state != SocketState::Open) - { - throw std::runtime_error( - "Socket is not open." + std::to_string(static_cast(m_state))); - } - m_receiveStatistics.BinaryFramesSent++; -#if SUPPORT_NATIVE_TRANSPORT - if (m_transport->HasBuiltInWebSocketSupport()) - { - m_transport->NativeSendFrame( - (isFinalFrame ? WebSocketTransport::NativeWebSocketFrameType::Binary - : WebSocketTransport::NativeWebSocketFrameType::BinaryFragment), - binaryFrame, - context); - } - else -#endif - { - std::vector sendFrame - = EncodeFrame(SocketOpcode::BinaryFrame, isFinalFrame, binaryFrame); - - SendTransportBuffer(sendFrame, context); - } - } - - std::shared_ptr WebSocketImplementation::ReceiveFrame( - Azure::Core::Context const& context) - { - std::unique_lock lock(m_stateMutex); - m_stateOwner = std::this_thread::get_id(); - - if (m_state != SocketState::Open && m_state != SocketState::Closing) - { - throw std::runtime_error( - "Socket is not open." + std::to_string(static_cast(m_state))); - } - - // Unlock the state lock to allow other threads to run. If we don't, we might end up in in a - // situation where the server won't respond to the this client because all the client threads - // are blocked on the state lock. - lock.unlock(); - - std::shared_ptr frame; - // Loop until we receive an returnable incoming frame. - // If the incoming frame is returnable, we return the value from the frame. - while (true) - { - frame = ReceiveTransportFrame(context); - if (frame) - { - switch (frame->Opcode) - { - // When we receive a "ping" frame, we want to send a Pong frame back to the server. - case SocketOpcode::Ping: - Log::Write( - Logger::Level::Verbose, "Received Ping frame: " + HexEncode(frame->Payload, 16)); - SendPong(frame->Payload, context); - break; - - // We want to ignore all incoming "Pong" frames. - case SocketOpcode::Pong: - Log::Write( - Logger::Level::Verbose, "Received Pong frame: " + HexEncode(frame->Payload, 16)); - break; - - case SocketOpcode::BinaryFrame: - m_currentMessageType = SocketMessageType::Binary; - return std::shared_ptr(new WebSocketBinaryFrame( - frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); - - case SocketOpcode::TextFrame: - m_currentMessageType = SocketMessageType::Text; - return std::shared_ptr(new WebSocketTextFrame( - frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); - - case SocketOpcode::Close: { - if (frame->Payload.size() < 2) - { - throw std::runtime_error("Close response buffer is too short."); - } - // Encode the payload for close according to RFC 6455 - // section 5.5.1. The first two bytes of the payload contain the status code. - // The remainder of the payload is a UTF-8 encoded string. - uint16_t errorCode = 0; - errorCode |= (frame->Payload[0] << 8) & 0xff00; - errorCode |= (frame->Payload[1] & 0x00ff); - - // We received a close frame, mark the socket as closed. Make sure we - // reacquire the state lock before setting the state to closed. - lock.lock(); - m_stateOwner = std::this_thread::get_id(); - m_state = SocketState::Closed; - - return std::shared_ptr(new WebSocketPeerCloseFrame( - errorCode, std::string(frame->Payload.begin() + 2, frame->Payload.end()))); - } - - // Continuation frames need to be treated somewhat specially. - // We depend on the fact that the protocol requires that a Continuation frame - // only be sent if it is part of a multi-frame message whose previous frame was a Text - // or Binary frame. - case SocketOpcode::Continuation: - if (m_currentMessageType == SocketMessageType::Text) - { - if (frame->IsFinalFrame) - { - m_currentMessageType = SocketMessageType::Unknown; - } - return std::shared_ptr(new WebSocketTextFrame( - frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); - } - else if (m_currentMessageType == SocketMessageType::Binary) - { - if (frame->IsFinalFrame) - { - m_currentMessageType = SocketMessageType::Unknown; - } - return std::shared_ptr(new WebSocketBinaryFrame( - frame->IsFinalFrame, frame->Payload.data(), frame->Payload.size())); - } - else - { - m_receiveStatistics.FramesDroppedByProtocolError++; - throw std::runtime_error("Unknown message type and received continuation opcode"); - } - default: - throw std::runtime_error("Unknown frame type received."); - } - } - else - { - if (m_state != SocketState::Closed && m_state != SocketState::Closing) - { - throw std::runtime_error("Transport is at EOF, no frame to receive."); - } - // The socket was closed, most likely locally, so fake a close frame response. - return std::shared_ptr(new WebSocketPeerCloseFrame()); - } - - context.ThrowIfCancelled(); - } - } - - std::shared_ptr - WebSocketImplementation::ReceiveTransportFrame(Azure::Core::Context const& context) - { -#if SUPPORT_NATIVE_TRANSPORT - if (m_transport->HasBuiltInWebSocketSupport()) - { - auto payload = m_transport->NativeReceiveFrame(context); - m_receiveStatistics.FramesReceived++; - switch (payload.FrameType) - { - case WebSocketTransport::NativeWebSocketFrameType::Binary: - m_receiveStatistics.BinaryFramesReceived++; - return std::make_shared( - SocketOpcode::BinaryFrame, true, payload.FrameData); - case WebSocketTransport::NativeWebSocketFrameType::BinaryFragment: - m_receiveStatistics.BinaryFramesReceived++; - return std::make_shared( - SocketOpcode::BinaryFrame, false, payload.FrameData); - case WebSocketTransport::NativeWebSocketFrameType::Text: - m_receiveStatistics.TextFramesReceived++; - return std::make_shared( - SocketOpcode::TextFrame, true, payload.FrameData); - case WebSocketTransport::NativeWebSocketFrameType::TextFragment: - m_receiveStatistics.TextFramesReceived++; - return std::make_shared( - SocketOpcode::TextFrame, false, payload.FrameData); - case WebSocketTransport::NativeWebSocketFrameType::Closed: { - m_receiveStatistics.CloseFramesReceived++; - auto closeResult = m_transport->NativeGetCloseSocketInformation(context); - std::vector closePayload; - closePayload.push_back(closeResult.CloseReason >> 8); - closePayload.push_back(closeResult.CloseReason & 0xff); - closePayload.insert( - closePayload.end(), - closeResult.CloseReasonDescription.begin(), - closeResult.CloseReasonDescription.end()); - return std::make_shared(SocketOpcode::Close, true, closePayload); - } - default: - throw std::runtime_error("Unexpected frame type received."); - } - } - else -#endif - { - std::shared_ptr frame = DecodeFrame(context); - if (frame) - { - - // Handle statistics for the incoming frame. - m_receiveStatistics.FramesReceived++; - switch (frame->Opcode) - { - case SocketOpcode::Ping: { - m_receiveStatistics.PingFramesReceived++; - break; - } - case SocketOpcode::Pong: { - m_receiveStatistics.PongFramesReceived++; - break; - } - case SocketOpcode::TextFrame: { - m_receiveStatistics.TextFramesReceived++; - break; - } - case SocketOpcode::BinaryFrame: { - m_receiveStatistics.BinaryFramesReceived++; - break; - } - case SocketOpcode::Close: { - m_receiveStatistics.CloseFramesReceived++; - break; - } - case SocketOpcode::Continuation: { - m_receiveStatistics.ContinuationFramesReceived++; - break; - } - default: { - m_receiveStatistics.UnknownFramesReceived++; - break; - } - } - } - else - { - m_receiveStatistics.FramesDropped++; - } - return frame; - } - } - - WebSocketStatistics WebSocketImplementation::GetStatistics() const - { - WebSocketStatistics returnValue{}; - returnValue.FramesSent = m_receiveStatistics.FramesSent.load(); - returnValue.FramesReceived = m_receiveStatistics.FramesReceived.load(); - returnValue.BinaryFramesReceived = m_receiveStatistics.BinaryFramesReceived.load(); - returnValue.TextFramesReceived = m_receiveStatistics.TextFramesReceived.load(); - returnValue.BinaryFramesSent = m_receiveStatistics.BinaryFramesSent.load(); - returnValue.TextFramesSent = m_receiveStatistics.TextFramesSent.load(); - returnValue.PingFramesReceived = m_receiveStatistics.PingFramesReceived.load(); - returnValue.PongFramesReceived = m_receiveStatistics.PongFramesReceived.load(); - returnValue.PingFramesSent = m_receiveStatistics.PingFramesSent.load(); - returnValue.PongFramesSent = m_receiveStatistics.PongFramesSent.load(); - - returnValue.BytesSent = m_receiveStatistics.BytesSent.load(); - returnValue.BytesReceived = m_receiveStatistics.BytesReceived.load(); - returnValue.FramesDropped = m_receiveStatistics.FramesDropped.load(); - returnValue.FramesDroppedByClose = m_receiveStatistics.FramesDroppedByClose.load(); - returnValue.FramesDroppedByPayloadSizeLimit - = m_receiveStatistics.FramesDroppedByPayloadSizeLimit.load(); - returnValue.FramesDroppedByProtocolError - = m_receiveStatistics.FramesDroppedByProtocolError.load(); - returnValue.TransportReadBytes = m_receiveStatistics.TransportReadBytes.load(); - returnValue.TransportReads = m_receiveStatistics.TransportReads.load(); - return returnValue; - } - - std::vector WebSocketImplementation::EncodeFrame( - SocketOpcode opcode, - bool isFinal, - std::vector const& payload) - { - std::vector encodedFrame; - // Add opcode+fin. - encodedFrame.push_back(static_cast(opcode) | (isFinal ? 0x80 : 0)); - uint8_t maskAndLength = 0; - maskAndLength |= 0x80; - - // Payloads smaller than 125 bytes are encoded directly in the maskAndLength field. - uint64_t payloadSize = static_cast(payload.size()); - if (payloadSize <= 125) - { - maskAndLength |= static_cast(payload.size()); - } - else if (payloadSize <= 65535) - { - // Payloads greater than 125 whose size can fit in a 16 bit integer bytes - // are encoded as a 16 bit unsigned integer in network byte order. - maskAndLength |= 126; - } - else - { - // Payloads greater than 65536 have their length are encoded as a 64 bit unsigned integer - // in network byte order. - maskAndLength |= 127; - } - encodedFrame.push_back(maskAndLength); - // Encode a 16 bit length. - if (payloadSize > 125 && payloadSize <= 65535) - { - encodedFrame.push_back(static_cast(payload.size()) >> 8); - encodedFrame.push_back(static_cast(payload.size()) & 0xff); - } - // Encode a 64 bit length. - else if (payloadSize >= 65536) - { - - encodedFrame.push_back((payloadSize >> 56) & 0xff); - encodedFrame.push_back((payloadSize >> 48) & 0xff); - encodedFrame.push_back((payloadSize >> 40) & 0xff); - encodedFrame.push_back((payloadSize >> 32) & 0xff); - encodedFrame.push_back((payloadSize >> 24) & 0xff); - encodedFrame.push_back((payloadSize >> 16) & 0xff); - encodedFrame.push_back((payloadSize >> 8) & 0xff); - encodedFrame.push_back(payloadSize & 0xff); - } - // Calculate the masking key. This MUST be 4 bytes of high entropy random numbers used to - // mask the input data. - { - // Start by generating the mask - 4 bytes of random data. - std::vector mask = GenerateRandomBytes(4); - - // Append the mask to the payload. - encodedFrame.insert(encodedFrame.end(), mask.begin(), mask.end()); - - // And mask the payload before transmitting it. - size_t index = 0; - for (auto ch : payload) - { - encodedFrame.push_back(ch ^ mask[index % 4]); - index += 1; - } - } - - return encodedFrame; - } - std::shared_ptr - WebSocketImplementation::DecodeFrame(Azure::Core::Context const& context) - { - // Ensure single threaded access to receive this frame. - std::unique_lock lock(m_transportMutex); - if (IsTransportEof()) - { - throw std::runtime_error("Frame buffer is too small."); - } - uint8_t payloadByte = ReadTransportByte(context); - // If the transport is at EOF, then there is no payload data, so just return null. - if (IsTransportEof()) - { - return nullptr; - } - SocketOpcode opcode = static_cast(payloadByte & 0x7f); - bool isFinal = (payloadByte & 0x80) != 0; - payloadByte = ReadTransportByte(context); - if (IsTransportEof()) - { - return nullptr; - } - if (payloadByte & 0x80) - { - throw std::runtime_error("Server sent a frame with a reserved bit set."); - } - int64_t payloadLength = payloadByte & 0x7f; - if (payloadLength <= 125) - { - payloadByte += 1; - } - else if (payloadLength == 126) - { - payloadLength = ReadTransportShort(context); - } - else if (payloadLength == 127) - { - payloadLength = ReadTransportInt64(context); - } - else - { - throw std::logic_error("Unexpected payload length."); - } - if (IsTransportEof()) - { - return nullptr; - } - - std::vector payload(ReadTransportBytes(static_cast(payloadLength), context)); - if (IsTransportEof()) - { - return nullptr; - } - return std::make_shared(opcode, isFinal, payload); - } - - uint8_t WebSocketImplementation::ReadTransportByte(Azure::Core::Context const& context) - { - if (m_bufferPos >= m_bufferLen) - { - // Start by reading data from our initial body stream. - m_bufferLen = m_initialBodyStream->ReadToCount(m_buffer, m_bufferSize, context); - if (m_bufferLen == 0) - { - // If we run out of the initial stream, we need to read from the transport. - m_bufferLen = m_transport->ReadFromSocket(m_buffer, m_bufferSize, context); - m_receiveStatistics.TransportReads++; - m_receiveStatistics.TransportReadBytes += static_cast(m_bufferLen); - } - else - { - Azure::Core::Diagnostics::_internal::Log::Write( - Azure::Core::Diagnostics::Logger::Level::Informational, - "Read data from initial stream"); - } - m_bufferPos = 0; - if (m_bufferLen == 0) - { - m_eof = true; - return 0; - } - } - - m_receiveStatistics.BytesReceived++; - return m_buffer[m_bufferPos++]; - } - uint16_t WebSocketImplementation::ReadTransportShort(Azure::Core::Context const& context) - { - uint16_t result = ReadTransportByte(context); - result <<= 8; - result |= ReadTransportByte(context); - return result; - } - uint64_t WebSocketImplementation::ReadTransportInt64(Azure::Core::Context const& context) - { - uint64_t result = 0; - - result |= (static_cast(ReadTransportByte(context)) << 56 & 0xff00000000000000); - result |= (static_cast(ReadTransportByte(context)) << 48 & 0x00ff000000000000); - result |= (static_cast(ReadTransportByte(context)) << 40 & 0x0000ff0000000000); - result |= (static_cast(ReadTransportByte(context)) << 32 & 0x000000ff00000000); - result |= (static_cast(ReadTransportByte(context)) << 24 & 0x00000000ff000000); - result |= (static_cast(ReadTransportByte(context)) << 16 & 0x0000000000ff0000); - result |= (static_cast(ReadTransportByte(context)) << 8 & 0x000000000000ff00); - result |= static_cast(ReadTransportByte(context)); - return result; - } - std::vector WebSocketImplementation::ReadTransportBytes( - size_t readLength, - Azure::Core::Context const& context) - { - std::vector result; - size_t index = 0; - while (index < readLength) - { - uint8_t byte = ReadTransportByte(context); - result.push_back(byte); - index += 1; - } - return result; - } - - void WebSocketImplementation::SendTransportBuffer( - std::vector const& sendFrame, - Azure::Core::Context const& context) - { - std::unique_lock transportLock(m_transportMutex); - m_receiveStatistics.BytesSent += static_cast(sendFrame.size()); - m_receiveStatistics.FramesSent += 1; - m_transport->SendBuffer(sendFrame.data(), sendFrame.size(), context); - } - - // Verify the Sec-WebSocket-Accept header as defined in RFC 6455 Section 1.3, which defines - // the opening handshake used for establishing the WebSocket connection. - std::string acceptHeaderGuid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; - void WebSocketImplementation::VerifySocketAccept( - std::string const& encodedKey, - std::string const& acceptHeader) - { - std::string concatenatedKey(encodedKey); - concatenatedKey += acceptHeaderGuid; - Azure::Core::Cryptography::_internal::Sha1Hash sha1hash; - - sha1hash.Append( - reinterpret_cast(concatenatedKey.data()), concatenatedKey.size()); - auto keyHash = sha1hash.Final(); - std::string encodedHash = Azure::Core::Convert::Base64Encode(keyHash); - if (encodedHash != acceptHeader) - { - throw std::runtime_error( - "Hash returned by WebSocket server does not match expected hash. Aborting"); - } - } - - WebSocketImplementation::PingThread::PingThread( - WebSocketImplementation* socketImplementation, - std::chrono::duration pingInterval) - : m_webSocketImplementation(socketImplementation), m_pingInterval(pingInterval) - { - } - void WebSocketImplementation::PingThread::Start(std::shared_ptr transport) - { - m_stop = false; - // Spin up a thread to receive data from the transport. - if (!transport->HasBuiltInWebSocketSupport()) - { - std::unique_lock lock(m_pingThreadStarted); - m_pingThread = std::thread{&PingThread::PingThreadLoop, this}; - m_pingThreadReady.wait(lock); - } - } - - WebSocketImplementation::PingThread::~PingThread() - { - // Ensure that the receive thread is stopped. - Shutdown(); - } - void WebSocketImplementation::PingThread::Shutdown() - { - if (m_pingThread.joinable()) - { - std::unique_lock lock(m_stopMutex); - m_stop = true; - lock.unlock(); - m_pingThreadStopped.notify_all(); - - m_pingThread.join(); - } - } - - void WebSocketImplementation::PingThread::PingThreadLoop() - { - Log::Write(Logger::Level::Verbose, "Start Ping Thread Loop."); - { - std::unique_lock lock(m_pingThreadStarted); - m_pingThreadReady.notify_all(); - } - while (true) - { - std::unique_lock lock(m_stopMutex); - if (this->m_pingThreadStopped.wait_for(lock, m_pingInterval) == std::cv_status::timeout) - { - Log::Write(Logger::Level::Verbose, "Send Ping to peer."); - - // The receiveContext timed out, this means we timed out our "ping" timeout. - // Send a "Ping" request to the remote node. - auto pingData = GenerateRandomBytes(4); - SendPing(pingData, Azure::Core::Context{}); - } - if (m_stop) - { - Log::Write(Logger::Level::Verbose, "Exiting ping thread"); - return; - } - } - } - - bool WebSocketImplementation::PingThread::SendPing( - std::vector const& pingData, - Azure::Core::Context const& context) - { - std::vector pingFrame = EncodeFrame(SocketOpcode::Ping, true, pingData); - m_webSocketImplementation->m_receiveStatistics.PingFramesSent++; - m_webSocketImplementation->SendTransportBuffer(pingFrame, context); - return true; - } - - void WebSocketImplementation::SendPong( - std::vector const& pongData, - Azure::Core::Context const& context) - { - std::vector pongFrame = EncodeFrame(SocketOpcode::Pong, true, pongData); - - m_receiveStatistics.PongFramesSent++; - SendTransportBuffer(pongFrame, context); - } - - // Generator for random bytes. Used in WebSocketImplementation and tests. - std::vector GenerateRandomBytes(size_t vectorSize) - { - std::random_device randomEngine; - - std::vector rv(vectorSize); - std::generate(begin(rv), end(rv), [&randomEngine]() mutable { - return static_cast(randomEngine() % UINT8_MAX); - }); - return rv; - } -}}}}} // namespace Azure::Core::Http::WebSockets::_detail diff --git a/sdk/core/azure-core/src/http/websockets/websockets_impl.hpp b/sdk/core/azure-core/src/http/websockets/websockets_impl.hpp deleted file mode 100644 index 73a10ec143..0000000000 --- a/sdk/core/azure-core/src/http/websockets/websockets_impl.hpp +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT -#include "azure/core/http/websockets/websockets.hpp" -#include "azure/core/http/websockets/websockets_transport.hpp" -#include "azure/core/internal/diagnostics/log.hpp" -#include "azure/core/internal/http/pipeline.hpp" -#include -#include -#include -#include -#include - -// Implementation of WebSocket protocol. -namespace Azure { namespace Core { namespace Http { namespace WebSockets { namespace _detail { - - // Generator for random bytes. Used in WebSocketImplementation and tests. - std::vector GenerateRandomBytes(size_t vectorSize); - - class WebSocketImplementation { - enum class SocketState - { - Invalid, - Closed, - Opening, - Open, - Closing, - }; - - public: - WebSocketImplementation( - Azure::Core::Url const& remoteUrl, - _internal::WebSocketOptions const& options); - - void Open(Azure::Core::Context const& context); - void Close( - uint16_t closeStatus, - std::string const& closeReason, - Azure::Core::Context const& context); - void SendFrame( - std::string const& textFrame, - bool isFinalFrame, - Azure::Core::Context const& context); - void SendFrame( - std::vector const& binaryFrame, - bool isFinalFrame, - Azure::Core::Context const& context); - - std::shared_ptr<_internal::WebSocketFrame> ReceiveFrame(Azure::Core::Context const& context); - - void AddHeader(std::string const& headerName, std::string const& headerValue); - - std::string const& GetNegotiatedProtocol(); - bool IsOpen() { return m_state == SocketState::Open; } - bool HasBuiltInWebSocketSupport(); - - _internal::WebSocketStatistics GetStatistics() const; - - private: - // WebSocket opcodes. - enum class SocketOpcode : uint8_t - { - Continuation = 0x00, - TextFrame = 0x01, - BinaryFrame = 0x02, - Close = 0x08, - Ping = 0x09, - Pong = 0x0a - }; - - /** - * Indicates the type of the message currently being processed. Used when processing - * Continuation Opcode frames. - */ - enum class SocketMessageType : int - { - Unknown, - Text, - Binary, - }; - - class WebSocketInternalFrame { - public: - SocketOpcode Opcode{}; - bool IsFinalFrame{false}; - std::vector Payload; - std::exception_ptr Exception; - WebSocketInternalFrame( - SocketOpcode opcode, - bool isFinalFrame, - std::vector const& payload) - : Opcode(opcode), IsFinalFrame(isFinalFrame), Payload(payload) - { - } - WebSocketInternalFrame(std::exception_ptr exception) : Exception(exception) {} - }; - - struct ReceiveStatistics - { - std::atomic FramesSent; - std::atomic FramesReceived; - std::atomic BytesSent; - std::atomic BytesReceived; - std::atomic PingFramesSent; - std::atomic PingFramesReceived; - std::atomic PongFramesSent; - std::atomic PongFramesReceived; - std::atomic TextFramesReceived; - std::atomic BinaryFramesReceived; - std::atomic ContinuationFramesReceived; - std::atomic CloseFramesReceived; - std::atomic UnknownFramesReceived; - std::atomic FramesDropped; - std::atomic FramesDroppedByPayloadSizeLimit; - std::atomic FramesDroppedByProtocolError; - std::atomic TransportReads; - std::atomic TransportReadBytes; - std::atomic BinaryFramesSent; - std::atomic TextFramesSent; - std::atomic FramesDroppedByClose; - - void Reset() - { - FramesSent = 0; - BytesSent = 0; - FramesReceived = 0; - BytesReceived = 0; - PingFramesReceived = 0; - PingFramesSent = 0; - PongFramesReceived = 0; - PongFramesSent = 0; - TextFramesReceived = 0; - TextFramesSent = 0; - BinaryFramesReceived = 0; - BinaryFramesSent = 0; - ContinuationFramesReceived = 0; - CloseFramesReceived = 0; - UnknownFramesReceived = 0; - FramesDropped = 0; - FramesDroppedByClose = 0; - FramesDroppedByPayloadSizeLimit = 0; - FramesDroppedByProtocolError = 0; - TransportReads = 0; - TransportReadBytes = 0; - } - }; - /** - * @brief The PingThread handles sending Ping operations from the WebSocket server. - * - */ - class PingThread { - public: - /** - * @brief Construct a new ReceiveQueue object. - * - * @param webSocketImplementation Parent object, used to send Ping threads. - * @param pingInterval Interval to wait between sending pings. - */ - PingThread( - WebSocketImplementation* webSocketImplementation, - std::chrono::duration pingInterval); - /** - * @brief Destroys a ReceiveQueue object. Blocks until the queue thread is completed. - */ - ~PingThread(); - - /** - * @brief Start the receive queue. This will start a thread that will process incoming frames. - * - * @param transport The websocket transport to use for receiving frames. - */ - void Start(std::shared_ptr transport); - /** - * @brief Stop the receive queue. This will stop the thread that processes incoming frames. - */ - void Shutdown(); - - private: - /** - * @brief The receive queue thread. - */ - void PingThreadLoop(); - /** - * @brief Send a "ping" frame to the other side of the WebSocket. - * - * @returns True if the ping was sent, false if the underlying transport didn't support "Ping" - * operations. - */ - bool SendPing(std::vector const& pingData, Azure::Core::Context const& context); - - WebSocketImplementation* m_webSocketImplementation; - std::chrono::duration m_pingInterval; - std::thread m_pingThread; - std::mutex m_pingThreadStarted; - std::condition_variable m_pingThreadReady; - - std::mutex m_stopMutex; - std::condition_variable m_pingThreadStopped; - bool m_stop = false; - }; - - /** - * @brief Encode a websocket frame according to RFC 6455 section 5.2. - * - * This wire format for the data transfer part is described by the ABNF - * [RFC5234] given in detail in this section. (Note that, unlike in - * other sections of this document, the ABNF in this section is - * operating on groups of bits. The length of each group of bits is - * indicated in a comment. When encoded on the wire, the most - * significant bit is the leftmost in the ABNF). A high-level overview - * of the framing is given in the following figure. In a case of - * conflict between the figure below and the ABNF specified later in - * this section, the figure is authoritative. - * - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-------+-+-------------+-------------------------------+ - * |F|R|R|R| opcode|M| Payload len | Extended payload length | - * |I|S|S|S| (4) |A| (7) | (16/64) | - * |N|V|V|V| |S| | (if payload len==126/127) | - * | |1|2|3| |K| | | - * +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + - * | Extended payload length continued, if payload len == 127 | - * + - - - - - - - - - - - - - - - +-------------------------------+ - * | |Masking-key, if MASK set to 1 | - * +-------------------------------+-------------------------------+ - * | Masking-key (continued) | Payload Data | - * +-------------------------------- - - - - - - - - - - - - - - - + - * : Payload Data continued ... : - * + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - * | Payload Data continued ... | - * +---------------------------------------------------------------+ - * - * FIN: 1 bit - * - * Indicates that this is the final fragment in a message. The first - * fragment MAY also be the final fragment. - * - * RSV1, RSV2, RSV3: 1 bit each - * - * MUST be 0 unless an extension is negotiated that defines meanings - * for non-zero values. If a nonzero value is received and none of - * the negotiated extensions defines the meaning of such a nonzero - * value, the receiving endpoint MUST _Fail the WebSocket - * Connection_. - * - * Opcode: 4 bits - * - * Defines the interpretation of the "Payload data". If an unknown - * opcode is received, the receiving endpoint MUST _Fail the - * WebSocket Connection_. The following values are defined. - * - * * %x0 denotes a continuation frame - * - * * %x1 denotes a text frame - * - * * %x2 denotes a binary frame - * - * * %x3-7 are reserved for further non-control frames - * - * * %x8 denotes a connection close - * - * * %x9 denotes a ping - * - * * %xA denotes a pong - * - * * %xB-F are reserved for further control frames - * - * Mask: 1 bit - * - * Defines whether the "Payload data" is masked. If set to 1, a - * masking key is present in masking-key, and this is used to unmask - * the "Payload data" as per Section 5.3. All frames sent from - * client to server have this bit set to 1. - * - * Payload length: 7 bits, 7+16 bits, or 7+64 bits - * - * The length of the "Payload data", in bytes: if 0-125, that is the - * payload length. If 126, the following 2 bytes interpreted as a - * 16-bit unsigned integer are the payload length. If 127, the - * following 8 bytes interpreted as a 64-bit unsigned integer (the - * most significant bit MUST be 0) are the payload length. Multibyte - * length quantities are expressed in network byte order. Note that - * in all cases, the minimal number of bytes MUST be used to encode - * the length, for example, the length of a 124-byte-long string - * can't be encoded as the sequence 126, 0, 124. The payload length - * is the length of the "Extension data" + the length of the - * "Application data". The length of the "Extension data" may be - * zero, in which case the payload length is the length of the - * "Application data". - * Masking-key: 0 or 4 bytes - * - * All frames sent from the client to the server are masked by a - * 32-bit value that is contained within the frame. This field is - * present if the mask bit is set to 1 and is absent if the mask bit - * is set to 0. See Section 5.3 for further information on client- - * to-server masking. - * - * Payload data: (x+y) bytes - * - * The "Payload data" is defined as "Extension data" concatenated - * with "Application data". - * - * Extension data: x bytes - * - * The "Extension data" is 0 bytes unless an extension has been - * negotiated. Any extension MUST specify the length of the - * "Extension data", or how that length may be calculated, and how - * the extension use MUST be negotiated during the opening handshake. - * If present, the "Extension data" is included in the total payload - * length. - * - * Application data: y bytes - * - * Arbitrary "Application data", taking up the remainder of the frame - * after any "Extension data". The length of the "Application data" - * is equal to the payload length minus the length of the "Extension - * data". - */ - static std::vector EncodeFrame( - SocketOpcode opcode, - bool isFinal, - std::vector const& payload); - - SocketState m_state{SocketState::Invalid}; - - std::vector GenerateRandomKey() { return GenerateRandomBytes(16); }; - void VerifySocketAccept(std::string const& encodedKey, std::string const& acceptHeader); - - /********* - * Buffered Read Support. Read data from the underlying transport into a buffer. - */ - uint8_t ReadTransportByte(Azure::Core::Context const& context); - uint16_t ReadTransportShort(Azure::Core::Context const& context); - uint64_t ReadTransportInt64(Azure::Core::Context const& context); - std::vector ReadTransportBytes(size_t readLength, Azure::Core::Context const& context); - bool IsTransportEof() const { return m_eof; } - void SendPong(std::vector const& pongData, Azure::Core::Context const& context); - void SendTransportBuffer( - std::vector const& payload, - Azure::Core::Context const& context); - std::shared_ptr ReceiveTransportFrame( - Azure::Core::Context const& context); - - /** - * @brief Decode a frame received from the websocket server. - * - * @returns A pointer to the start of the decoded data. - */ - std::shared_ptr DecodeFrame(Azure::Core::Context const& context); - - Azure::Core::Url m_remoteUrl; - _internal::WebSocketOptions m_options; - std::map m_headers; - std::string m_chosenProtocol; - std::shared_ptr m_transport; - PingThread m_pingThread; - SocketMessageType m_currentMessageType{SocketMessageType::Unknown}; - std::mutex m_stateMutex; - std::thread::id m_stateOwner; - - ReceiveStatistics m_receiveStatistics{}; - - std::mutex m_transportMutex; - - std::unique_ptr m_initialBodyStream; - constexpr static size_t m_bufferSize = 1024; - uint8_t m_buffer[m_bufferSize]{}; - size_t m_bufferPos = 0; - size_t m_bufferLen = 0; - bool m_eof = false; - }; -}}}}} // namespace Azure::Core::Http::WebSockets::_detail diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp deleted file mode 100644 index 7d869ca709..0000000000 --- a/sdk/core/azure-core/src/http/winhttp/win_http_websockets.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -#include "azure/core/http/http.hpp" -#include "azure/core/http/policies/policy.hpp" -#include "azure/core/http/transport.hpp" -#include "azure/core/http/websockets/win_http_websockets_transport.hpp" -#include "azure/core/internal/diagnostics/log.hpp" -#include "azure/core/platform.hpp" - -#if defined(AZ_PLATFORM_POSIX) -#include // for poll() -#include // for socket shutdown -#elif defined(AZ_PLATFORM_WINDOWS) -#if !defined(WIN32_LEAN_AND_MEAN) -#define WIN32_LEAN_AND_MEAN -#endif -#if !defined(NOMINMAX) -#define NOMINMAX -#endif -#include -#include // for WSAPoll(); -#endif -#include - -namespace Azure { namespace Core { namespace Http { namespace WebSockets { - - void WinHttpWebSocketTransport::OnUpgradedConnection( - Azure::Core::Http::_detail::unique_HINTERNET const& requestHandle) - { - // Convert the request handle into a WebSocket handle for us to use later. - m_socketHandle = Azure::Core::Http::_detail::unique_HINTERNET( - WinHttpWebSocketCompleteUpgrade(requestHandle.get(), 0), - Azure::Core::Http::_detail::HINTERNET_deleter{}); - if (!m_socketHandle) - { - GetErrorAndThrow("Error Upgrading HttpRequest handle to WebSocket handle."); - } - } - - std::unique_ptr WinHttpWebSocketTransport::Send( - Azure::Core::Http::Request& request, - Azure::Core::Context const& context) - { - return WinHttpTransport::Send(request, context); - } - - /** - * @brief Close the WebSocket cleanly. - */ - void WinHttpWebSocketTransport::Close() { m_socketHandle.reset(); } - - // Native WebSocket support methods. - /** - * @brief Gracefully closes the WebSocket, notifying the remote node of the close reason. - * - * @details Not implemented for CURL websockets because CURL does not support native websockets. - * - * @param status Status value to be sent to the remote node. Application defined. - * @param disconnectReason UTF-8 encoded reason for the disconnection. Optional. - * @param context Context for the operation. - * - */ - void WinHttpWebSocketTransport::NativeCloseSocket( - uint16_t status, - std::string const& disconnectReason, - Azure::Core::Context const& context) - { - context.ThrowIfCancelled(); - - auto err = WinHttpWebSocketClose( - m_socketHandle.get(), - status, - disconnectReason.empty() - ? nullptr - : reinterpret_cast(const_cast(disconnectReason.c_str())), - static_cast(disconnectReason.size())); - if (err != 0) - { - GetErrorAndThrow("WinHttpWebSocketClose() failed", err); - } - - context.ThrowIfCancelled(); - - // Make sure that the server responds gracefully to the close request. - auto closeInformation = NativeGetCloseSocketInformation(context); - - // The server should return the same status we sent. - if (closeInformation.CloseReason != status) - { - throw std::runtime_error( - "Close status mismatch, got " + std::to_string(closeInformation.CloseReason) - + " expected " + std::to_string(status)); - } - } - /** - * @brief Retrieve the information associated with a WebSocket close response. - * - * Should only be called when a Receive operation returns WebSocketFrameType::CloseFrameType - * - * @param context Context for the operation. - * - * @returns a tuple containing the status code and string. - */ - WinHttpWebSocketTransport::NativeWebSocketCloseInformation - WinHttpWebSocketTransport::NativeGetCloseSocketInformation(Azure::Core::Context const& context) - { - context.ThrowIfCancelled(); - uint16_t closeStatus = 0; - char closeReason[WINHTTP_WEB_SOCKET_MAX_CLOSE_REASON_LENGTH]{}; - DWORD closeReasonLength; - - auto err = WinHttpWebSocketQueryCloseStatus( - m_socketHandle.get(), - &closeStatus, - closeReason, - WINHTTP_WEB_SOCKET_MAX_CLOSE_REASON_LENGTH, - &closeReasonLength); - if (err != 0) - { - GetErrorAndThrow("WinHttpGetCloseStatus() failed", err); - } - return NativeWebSocketCloseInformation{closeStatus, std::string(closeReason)}; - } - - /** - * @brief Send a frame of data to the remote node. - * - * @details Not implemented for CURL websockets because CURL does not support native - * websockets. - * - * @brief frameType Frame type sent to the server, Text or Binary. - * @brief frameData Frame data to be sent to the server. - */ - void WinHttpWebSocketTransport::NativeSendFrame( - NativeWebSocketFrameType frameType, - std::vector const& frameData, - Azure::Core::Context const& context) - { - context.ThrowIfCancelled(); - WINHTTP_WEB_SOCKET_BUFFER_TYPE bufferType; - switch (frameType) - { - case NativeWebSocketFrameType::Text: - bufferType = WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE; - break; - case NativeWebSocketFrameType::Binary: - bufferType = WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE; - break; - case NativeWebSocketFrameType::BinaryFragment: - bufferType = WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE; - break; - case NativeWebSocketFrameType::TextFragment: - bufferType = WINHTTP_WEB_SOCKET_UTF8_FRAGMENT_BUFFER_TYPE; - break; - default: - throw std::runtime_error( - "Unknown frame type: " + std::to_string(static_cast(frameType))); - break; - } - // Lock the socket to prevent concurrent writes. WinHTTP gets annoyed if - // there are multiple WinHttpWebSocketSend requests outstanding. - std::lock_guard lock(m_sendMutex); - auto err = WinHttpWebSocketSend( - m_socketHandle.get(), - bufferType, - reinterpret_cast(const_cast(frameData.data())), - static_cast(frameData.size())); - if (err != 0) - { - GetErrorAndThrow("WinHttpWebSocketSend() failed", err); - } - } - - WinHttpWebSocketTransport::NativeWebSocketReceiveInformation - WinHttpWebSocketTransport::NativeReceiveFrame(Azure::Core::Context const& context) - { - WINHTTP_WEB_SOCKET_BUFFER_TYPE bufferType; - NativeWebSocketFrameType frameTypeReceived; - DWORD bufferBytesRead; - std::vector buffer(128); - context.ThrowIfCancelled(); - std::lock_guard lock(m_receiveMutex); - - auto err = WinHttpWebSocketReceive( - m_socketHandle.get(), - reinterpret_cast(buffer.data()), - static_cast(buffer.size()), - &bufferBytesRead, - &bufferType); - if (err != 0 && err != ERROR_INSUFFICIENT_BUFFER) - { - GetErrorAndThrow("WinHttpWebSocketReceive() failed", err); - } - buffer.resize(bufferBytesRead); - - switch (bufferType) - { - case WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE: - frameTypeReceived = NativeWebSocketFrameType::Text; - break; - case WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE: - frameTypeReceived = NativeWebSocketFrameType::Binary; - break; - case WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE: - frameTypeReceived = NativeWebSocketFrameType::BinaryFragment; - break; - case WINHTTP_WEB_SOCKET_UTF8_FRAGMENT_BUFFER_TYPE: - frameTypeReceived = NativeWebSocketFrameType::TextFragment; - break; - case WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE: - frameTypeReceived = NativeWebSocketFrameType::Closed; - break; - default: - throw std::runtime_error("Unknown frame type: " + std::to_string(bufferType)); - break; - } - return NativeWebSocketReceiveInformation{frameTypeReceived, buffer}; - } - -}}}} // namespace Azure::Core::Http::WebSockets diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index 610962a11c..fb75016b2c 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -86,7 +86,6 @@ add_executable ( transport_policy_options.cpp url_test.cpp uuid_test.cpp - websocket_test.cpp ) if (MSVC) @@ -111,9 +110,9 @@ add_compile_definitions(DISABLE_PROXY_TESTS) endif() # Additional test files to be copied to the output directory. -set(TEST_ADDITIONAL_FILES ${CMAKE_CURRENT_LIST_DIR}/websocket_server.py +set(TEST_ADDITIONAL_FILES ${CMAKE_CURRENT_LIST_DIR}/requirements.txt - ${CMAKE_CURRENT_LIST_DIR}/Start-WebSocketServer.ps1 + ) add_custom_command(TARGET azure-core-test POST_BUILD diff --git a/sdk/core/azure-core/test/ut/websocket_server.py b/sdk/core/azure-core/test/ut/websocket_server.py deleted file mode 100644 index ca7bcc077b..0000000000 --- a/sdk/core/azure-core/test/ut/websocket_server.py +++ /dev/null @@ -1,155 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# SPDX-License-Identifier: MIT -from array import array -import asyncio -from operator import length_hint -import threading -from time import sleep -from urllib.parse import ParseResult, urlparse - -import websockets - -# create handler for each connection -customPaths = {} -stop = False - -async def handleControlPath(websocket): - while (1): - data : str = await websocket.recv() - parsedCommand = data.split(' ') - if (parsedCommand[0] == "close"): - print("Closing control channel") - await websocket.send("ok") - print("Terminating WebSocket server.") - stop.set_result(0) - break - elif parsedCommand[0] == "newPath": - print("Add path") - newPath = parsedCommand[1] - print(" Add path ", newPath) - customPaths[newPath] = {"path": newPath, "delay": int(parsedCommand[2]) } - await websocket.send("ok") - else: - print("Unknown command, echoing it.") - await websocket.send(data) - -async def handleCustomPath(websocket, path:dict): - print("Handle custom path", path) - data : str = await websocket.recv() - print("Received ", data) - if ("delay" in path.keys()): - sleep(path["delay"]) - print("Responding") - await websocket.send(data) - await websocket.close() - -def HexEncode(data: bytes)->str: - rv="" - for val in data: - rv+= '{:02X}'.format(val) - return rv - -def ParseQuery(url : ParseResult) -> dict: - rv={} - if len(url.query)!=0: - args = url.query.split('&') - for arg in args: - vals=arg.split('=') - rv[vals[0]]=vals[1] - return rv - -echo_count_lock = threading.Lock() -echo_count_recv = 0 -echo_count_send = 0 -client_count = 0 -async def handleEcho(websocket, url:ParseResult): - global client_count - global echo_count_recv - global echo_count_send - global echo_count_lock - queryValues = ParseQuery(url) - while websocket.open: - try: - data = await websocket.recv() - with echo_count_lock: - echo_count_recv+=1 - if 'delay' in queryValues: - print(f"sleeping for {queryValues['delay']} seconds") - await asyncio.sleep(float(queryValues['delay'])) - print("woken up.") - - if 'fragment' in queryValues and queryValues['fragment']=='true': - await websocket.send(data.split()) - else: - await websocket.send(data) - with echo_count_lock: - echo_count_send+=1 - except websockets.ConnectionClosedOK: - print("Connection closed ok.") - with echo_count_lock: - client_count -= 1 - print(f"Echo count: {echo_count_recv}, {echo_count_send} client_count {client_count}") - if client_count == 0: - echo_count_send = 0 - echo_count_recv = 0 - return - except websockets.ConnectionClosed as ex: - if (ex.rcvd): - print(f"Connection closed exception: {ex.rcvd.code} {ex.rcvd.reason}") - else: - print(f"Connection closed. No close information.") - with echo_count_lock: - client_count -= 1 - print(f"Echo count: recv: {echo_count_recv}, send: {echo_count_send} client_count {client_count}") - if client_count == 0: - echo_count_send = 0 - echo_count_recv = 0 - return - -async def handler(websocket, path : str): - global client_count - print("Socket handler: ", path) - parsedUrl = urlparse(path) - if (parsedUrl.path == '/openclosetest'): - print("Open/Close Test") - try: - data = await websocket.recv() - print(f"OpenCloseTest: Received {data}") - except websockets.ConnectionClosedOK: - print("OpenCloseTest: Connection closed ok.") - except websockets.ConnectionClosed as ex: - print(f"OpenCloseTest: Connection closed exception: {ex.rcvd.code} {ex.rcvd.reason}") - return - elif (parsedUrl.path == '/echotest'): - with echo_count_lock: - client_count+= 1 - await handleEcho(websocket, parsedUrl) - elif (parsedUrl.path == '/closeduringecho'): - data = await websocket.recv() - await websocket.close(1001, 'closed') - elif (parsedUrl.path =='/control'): - await handleControlPath(websocket) - elif (parsedUrl.path in customPaths.keys()): - print("Found path ", path, "in control paths.") - await handleCustomPath(websocket, customPaths[path]) - elif (parsedUrl.path == '/terminateserver'): - print("Terminating WebSocket server.") - stop.set_result(0) - else: - data = await websocket.recv() - print("Received: ", data) - - reply = f"Data received as: {data}!" - await websocket.send(reply) - -async def main(): - global stop - print("Starting server") - loop = asyncio.get_running_loop() - stop = loop.create_future() - async with websockets.serve(handler, "localhost", 8000, ping_interval=7): - await stop # run forever. - -if __name__=="__main__": - asyncio.run(main()) - print("Ending server") diff --git a/sdk/core/azure-core/test/ut/websocket_test.cpp b/sdk/core/azure-core/test/ut/websocket_test.cpp deleted file mode 100644 index 0227f7ce6d..0000000000 --- a/sdk/core/azure-core/test/ut/websocket_test.cpp +++ /dev/null @@ -1,885 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -#include "../../src/http/websockets/websockets_impl.hpp" -#include "azure/core/http/websockets/websockets.hpp" -#include "azure/core/internal/json/json.hpp" -#include -#include -#include -#include -#include -#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) -#include "azure/core/http/websockets/curl_websockets_transport.hpp" -#endif -// cspell::words closeme flibbityflobbidy - -using namespace Azure::Core; -using namespace Azure::Core::Http::WebSockets; -using namespace Azure::Core::Http::WebSockets::_internal; -using namespace std::chrono_literals; - -constexpr uint16_t UndefinedButLegalCloseReason = 4500; - -class WebSocketTests : public testing::Test { -private: -protected: - // Create - static void SetUpTestSuite() {} - static void TearDownTestSuite() {} -}; - -TEST_F(WebSocketTests, CreateSimpleSocket) -{ - { - WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000")); - defaultSocket.AddHeader("newHeader", "headerValue"); - EXPECT_THROW(defaultSocket.GetNegotiatedProtocol(), std::runtime_error); - } -} - -TEST_F(WebSocketTests, OpenSimpleSocket) -{ - { - WebSocketOptions options; - WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000/openclosetest"), options); - defaultSocket.AddHeader("newHeader", "headerValue"); - - defaultSocket.Open(); - - EXPECT_THROW(defaultSocket.AddHeader("newHeader", "headerValue"), std::runtime_error); - - // Close the socket without notifying the peer. - defaultSocket.Close(); - } - - { - WebSocketOptions options; - WebSocket defaultSocket(Azure::Core::Url("http://www.microsoft.com/"), options); - defaultSocket.AddHeader("newHeader", "headerValue"); - - // When running this test locally, the call times out, so drop in a 5 second timeout on - // the request. - Azure::Core::Context requestContext = Azure::Core::Context::ApplicationContext.WithDeadline( - std::chrono::system_clock::now() + 5s); - EXPECT_THROW(defaultSocket.Open(requestContext), std::runtime_error); - } -} - -TEST_F(WebSocketTests, OpenAndCloseSocket) -{ - if (false) - { - WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000/openclosetest")); - defaultSocket.AddHeader("newHeader", "headerValue"); - - defaultSocket.Open(); - - // Close the socket without notifying the peer. - defaultSocket.Close(UndefinedButLegalCloseReason); - } - - { - WebSocket defaultSocket(Azure::Core::Url("http://localhost:8000/openclosetest")); - - defaultSocket.Open(); - - // Close the socket without notifying the peer. - defaultSocket.Close(UndefinedButLegalCloseReason, "This is a good reason."); - - // - // Now re-open the socket - this should work to reset everything. - defaultSocket.Open(); - EXPECT_THROW(defaultSocket.Open(), std::runtime_error); - defaultSocket.Close(); - } -} - -TEST_F(WebSocketTests, SimpleEcho) -{ - { - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); - - testSocket.Open(); - - testSocket.SendFrame("Test message", true); - - auto response = testSocket.ReceiveFrame(); - EXPECT_EQ(WebSocketFrameType::TextFrameReceived, response->FrameType); - EXPECT_THROW(response->AsBinaryFrame(), std::logic_error); - auto textResult = response->AsTextFrame(); - EXPECT_EQ("Test message", textResult->Text); - - // Close the socket gracefully. - testSocket.Close(); - } - { - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest?delay=5")); - - testSocket.Open(); - - std::vector binaryData{1, 2, 3, 4, 5, 6}; - - testSocket.SendFrame(binaryData, true); - - auto response = testSocket.ReceiveFrame(); - EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); - EXPECT_THROW(response->AsPeerCloseFrame(), std::logic_error); - EXPECT_THROW(response->AsTextFrame(), std::logic_error); - auto textResult = response->AsBinaryFrame(); - EXPECT_EQ(binaryData, textResult->Data); - - // Close the socket gracefully. - testSocket.Close(); - } - - { - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest?fragment=true&delay=5")); - - testSocket.Open(); - - std::vector binaryData{1, 2, 3, 4, 5, 6}; - - testSocket.SendFrame(binaryData, true); - - std::vector responseData; - std::shared_ptr response; - do - { - response = testSocket.ReceiveFrame(); - EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); - auto binaryResult = response->AsBinaryFrame(); - responseData.insert(responseData.end(), binaryResult->Data.begin(), binaryResult->Data.end()); - } while (!response->IsFinalFrame); - - auto textResult = response->AsBinaryFrame(); - EXPECT_EQ(binaryData, responseData); - - // Close the socket gracefully. - testSocket.Close(); - } -} - -template void EchoRandomData(WebSocket& socket) -{ - std::vector sendData = Azure::Core::Http::WebSockets::_detail::GenerateRandomBytes(N); - - socket.SendFrame(sendData, true); - - std::vector receiveData; - - std::shared_ptr response; - do - { - response = socket.ReceiveFrame(); - EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); - auto binaryResult = response->AsBinaryFrame(); - receiveData.insert(receiveData.end(), binaryResult->Data.begin(), binaryResult->Data.end()); - } while (!response->IsFinalFrame); - - // Make sure we get back the data we sent in the echo request. - EXPECT_EQ(sendData.size(), receiveData.size()); - EXPECT_EQ(sendData, receiveData); -} - -TEST_F(WebSocketTests, VariableSizeEcho) -{ - { - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); - - testSocket.Open(); - { - EchoRandomData<100>(testSocket); - EchoRandomData<124>(testSocket); - EchoRandomData<125>(testSocket); - // The websocket protocol treats lengths of 125, 126 and > 127 specially. - EchoRandomData<126>(testSocket); - EchoRandomData<127>(testSocket); - EchoRandomData<128>(testSocket); - EchoRandomData<1020>(testSocket); // 1K-4 - EchoRandomData<1021>(testSocket); // 1K-3 - EchoRandomData<1022>(testSocket); // 1K-2 - EchoRandomData<1023>(testSocket); // 1K-1 - EchoRandomData<1024>(testSocket); // 1K - EchoRandomData<2048>(testSocket); // 2K - EchoRandomData<4096>(testSocket); // 4K - EchoRandomData<8192>(testSocket); // 8K - // The websocket protocol treats lengths of >65536 specially. - EchoRandomData<65535>(testSocket); // 64K-1 - EchoRandomData<65536>(testSocket); // 64K - EchoRandomData<65537>(testSocket); // 64K+1 - EchoRandomData<131072>(testSocket); // 128K - } - // Close the socket gracefully. - testSocket.Close(); - } -} - -// Generator for random bytes. Used in WebSocketImplementation and tests. -std::vector GenerateRandomBytes(size_t index, size_t vectorSize) -{ - std::random_device randomEngine; - - std::vector rv(vectorSize + 4); - rv[0] = index & 0xff; - rv[1] = (index >> 8) & 0xff; - rv[2] = (index >> 16) & 0xff; - rv[3] = (index >> 24) & 0xff; - std::generate(std::begin(rv) + 4, std::end(rv), [&randomEngine]() mutable { - return static_cast(randomEngine() % UINT8_MAX); - }); - return rv; -} - -TEST_F(WebSocketTests, CloseDuringEcho) -{ - { - WebSocket testSocket(Azure::Core::Url("ws://localhost:8000/closeduringecho")); - - testSocket.Open(); - - testSocket.SendFrame("Test message", true); - - auto response = testSocket.ReceiveFrame(); - EXPECT_EQ(WebSocketFrameType::PeerClosedReceived, response->FrameType); - auto PeerClosedReceived = response->AsPeerCloseFrame(); - EXPECT_EQ(1001, PeerClosedReceived->RemoteStatusCode); - - // Close the socket gracefully. - testSocket.Close(); - } - - // Close the websocket while a thread is waiting for a response. - { - WebSocket testSocket(Azure::Core::Url("ws://localhost:8000/echotest?delay=10")); - - testSocket.Open(); - - std::thread testThread([&]() { - try - { - std::vector sendData = GenerateRandomBytes(0, 100); - testSocket.SendFrame(sendData); - GTEST_LOG_(INFO) << "Receive frame."; - auto response = testSocket.ReceiveFrame(); - GTEST_LOG_(INFO) << "Received frame."; - if (response->FrameType == WebSocketFrameType::PeerClosedReceived) - { - GTEST_LOG_(INFO) << "Peer closed the socket; Terminating thread."; - return; - } - else if (response->FrameType != WebSocketFrameType::BinaryFrameReceived) - { - GTEST_LOG_(INFO) << "Unexpected frame type received."; - } - EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); - auto binaryResult = response->AsBinaryFrame(); - } - catch (Azure::Core::OperationCancelledException& ex) - { - GTEST_LOG_(ERROR) << "Cancelled Exception: " << ex.what() - << " Current Thread: " << std::this_thread::get_id() << std::endl; - } - catch (std::exception const& ex) - { - GTEST_LOG_(ERROR) << "Exception: " << ex.what() << std::endl; - } - }); - - std::this_thread::sleep_for(100ms); - - // Close the socket gracefully. - GTEST_LOG_(INFO) << "Closing Socket."; - EXPECT_NO_THROW(testSocket.Close(UndefinedButLegalCloseReason, "Close Reason.")); - GTEST_LOG_(INFO) << "Closed Socket."; - testThread.join(); - } -} - -TEST_F(WebSocketTests, ExpectThrow) -{ - { - WebSocket testSocket(Azure::Core::Url("ws://localhost:8000/closeduringecho")); - - EXPECT_THROW(testSocket.SendFrame("Foo", true), std::runtime_error); - std::vector data{1, 2, 3, 4}; - EXPECT_THROW(testSocket.SendFrame(data, true), std::runtime_error); - EXPECT_THROW(testSocket.ReceiveFrame(), std::runtime_error); - } -} - -std::string ToHexString(std::vector const& data) -{ - std::stringstream ss; - for (auto const& byte : data) - { - ss << std::hex << std::setfill('0') << std::setw(2) << static_cast(byte); - } - return ss.str(); -} - -TEST_F(WebSocketTests, PingReceiveTest) -{ - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); - - testSocket.Open(); - if (!testSocket.HasBuiltInWebSocketSupport()) - { - - GTEST_LOG_(INFO) << "Sleeping for 15 seconds to collect pings."; - Azure::Core::Context receiveContext = Azure::Core::Context::ApplicationContext.WithDeadline( - Azure::DateTime{std::chrono::system_clock::now() + 15s}); - EXPECT_THROW(testSocket.ReceiveFrame(receiveContext), Azure::Core::OperationCancelledException); - auto statistics = testSocket.GetStatistics(); - GTEST_LOG_(INFO) << "Total bytes sent: " << std::dec << statistics.BytesSent; - GTEST_LOG_(INFO) << "Total bytes received: " << std::dec << statistics.BytesReceived; - GTEST_LOG_(INFO) << "Ping Frames received: " << std::dec << statistics.PingFramesReceived; - GTEST_LOG_(INFO) << "Ping Frames sent: " << std::dec << statistics.PingFramesSent; - GTEST_LOG_(INFO) << "Pong Frames received: " << std::dec << statistics.PongFramesReceived; - GTEST_LOG_(INFO) << "Pong Frames sent: " << std::dec << statistics.PongFramesSent; - GTEST_LOG_(INFO) << "Binary frames sent: " << std::dec << statistics.BinaryFramesSent; - GTEST_LOG_(INFO) << "Binary frames received: " << std::dec << statistics.BinaryFramesReceived; - GTEST_LOG_(INFO) << "Total frames lost: " << std::dec << statistics.FramesDropped; - GTEST_LOG_(INFO) << "Transport Reads " << std::dec << statistics.TransportReads; - GTEST_LOG_(INFO) << "Transport Bytes Read " << std::dec << statistics.TransportReadBytes; - EXPECT_NE(0, statistics.PingFramesReceived); - EXPECT_NE(0, statistics.PongFramesSent); - } -} - -TEST_F(WebSocketTests, PingSendTest) -{ - // Configure the socket to ping every second. - WebSocketOptions socketOptions; - socketOptions.PingInterval = std::chrono::seconds(1); - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest"), socketOptions); - - testSocket.Open(); - if (!testSocket.HasBuiltInWebSocketSupport()) - { - - GTEST_LOG_(INFO) << "Sleeping for 10 seconds to collect pings."; - // Note that we cannot collect incoming pings or outgoing pongs unless we are receiving - // data from the server. - Azure::Core::Context receiveContext = Azure::Core::Context::ApplicationContext.WithDeadline( - Azure::DateTime{std::chrono::system_clock::now() + 10s}); - EXPECT_THROW(testSocket.ReceiveFrame(receiveContext), Azure::Core::OperationCancelledException); - - // The python websocket implementation sometimes has to be "kicked" to process operations, it's - // possible that the "pong" is queued up and has not been sent until the python server receives - // a request from the client. This is permitted because the protocol only requires that the - // server send a pong when it's convenient. - std::vector sendData = GenerateRandomBytes(0, 10); - testSocket.SendFrame(sendData, true /*, context*/); - auto response = testSocket.ReceiveFrame(); - EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); - - auto statistics = testSocket.GetStatistics(); - GTEST_LOG_(INFO) << "Total bytes sent: " << std::dec << statistics.BytesSent; - GTEST_LOG_(INFO) << "Total bytes received: " << std::dec << statistics.BytesReceived; - GTEST_LOG_(INFO) << "Ping Frames received: " << std::dec << statistics.PingFramesReceived; - GTEST_LOG_(INFO) << "Ping Frames sent: " << std::dec << statistics.PingFramesSent; - GTEST_LOG_(INFO) << "Pong Frames received: " << std::dec << statistics.PongFramesReceived; - GTEST_LOG_(INFO) << "Pong Frames sent: " << std::dec << statistics.PongFramesSent; - GTEST_LOG_(INFO) << "Binary frames sent: " << std::dec << statistics.BinaryFramesSent; - GTEST_LOG_(INFO) << "Binary frames received: " << std::dec << statistics.BinaryFramesReceived; - GTEST_LOG_(INFO) << "Total frames lost: " << std::dec << statistics.FramesDropped; - GTEST_LOG_(INFO) << "Transport Reads " << std::dec << statistics.TransportReads; - GTEST_LOG_(INFO) << "Transport Bytes Read " << std::dec << statistics.TransportReadBytes; - EXPECT_NE(0, statistics.PingFramesSent); - EXPECT_NE(0, statistics.PongFramesReceived); - EXPECT_NE(0, statistics.PingFramesReceived); - EXPECT_NE(0, statistics.PongFramesSent); - } -} - -TEST_F(WebSocketTests, MultiThreadedTestOnSingleSocket) -{ - constexpr size_t threadCount = 50; - constexpr size_t testDataLength = 275000; - constexpr size_t testDataSize = 100; - constexpr auto testDuration = 10s; - - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); - - testSocket.Open(); - - // seed test data for the operations. - std::vector> testData(testDataLength); - std::vector> receivedData(testDataLength); - std::atomic iterationCount(0); - - // Spin up threadCount threads and hammer the echo server for 10 seconds. - std::vector threads; - std::atomic cancellationExceptions{0}; - std::atomic exceptions{0}; - for (size_t threadIndex = 0; threadIndex < threadCount; threadIndex += 1) - { - threads.push_back(std::thread([&]() { - std::chrono::time_point startTime - = std::chrono::system_clock::now(); - // Set the context to expire *after* the test is supposed to finish. - Azure::Core::Context context = Azure::Core::Context::ApplicationContext.WithDeadline( - Azure::DateTime{startTime} + testDuration + 10s); - size_t iteration = 0; - try - { - do - { - iteration = iterationCount++; - std::vector sendData = GenerateRandomBytes(iteration, testDataSize); - { - if (iteration < testData.size()) - { - if (testData[iteration].size() != 0) - { - GTEST_LOG_(ERROR) << "Overwriting send frame at offset " << iteration << std::endl; - } - EXPECT_EQ(0, testData[iteration].size()); - testData[iteration] = sendData; - } - } - - testSocket.SendFrame(sendData, true /*, context*/); - auto response = testSocket.ReceiveFrame(context); - EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); - auto binaryResult = response->AsBinaryFrame(); - - // Make sure we get back the data we sent in the echo request. - if (binaryResult->Data.size() == 0) - { - GTEST_LOG_(ERROR) << "Received empty frame at offset " << iteration << std::endl; - } - EXPECT_EQ(sendData.size(), binaryResult->Data.size()); - { - // There is no ordering expectation on the results, so we just remember the data - // as it comes in. We'll make sure we received everything later on. - if (iteration < receivedData.size()) - { - if (receivedData[iteration].size() != 0) - { - GTEST_LOG_(ERROR) << "Overwriting receive frame at offset " << iteration - << std::endl; - } - - EXPECT_EQ(0, receivedData[iteration].size()); - receivedData[iteration] = binaryResult->Data; - } - } - } while (std::chrono::system_clock::now() - startTime < testDuration); - } - catch (Azure::Core::OperationCancelledException& ex) - { - GTEST_LOG_(ERROR) << "Cancelled Exception: " << ex.what() << " at index " << iteration - << " Current Thread: " << std::this_thread::get_id() << std::endl; - cancellationExceptions++; - } - catch (std::exception const& ex) - { - GTEST_LOG_(ERROR) << "Exception: " << ex.what() << std::endl; - exceptions++; - } - })); - } - - // Wait for all the threads to exit. - for (auto& thread : threads) - { - thread.join(); - } - - // We no longer need to worry about synchronization since all the worker threads are done. - GTEST_LOG_(INFO) << "Total server requests: " << iterationCount.load() << std::endl; - GTEST_LOG_(INFO) << "Estimated " << std::dec << testData.size() << " iterations (0x" << std::hex - << testData.size() << ")" << std::endl; - EXPECT_GE(testDataLength, iterationCount.load()); - - auto statistics = testSocket.GetStatistics(); - GTEST_LOG_(INFO) << "Total bytes sent: " << std::dec << statistics.BytesSent; - GTEST_LOG_(INFO) << "Total bytes received: " << std::dec << statistics.BytesReceived; - GTEST_LOG_(INFO) << "Ping Frames received: " << std::dec << statistics.PingFramesReceived; - GTEST_LOG_(INFO) << "Ping Frames sent: " << std::dec << statistics.PingFramesSent; - GTEST_LOG_(INFO) << "Pong Frames received: " << std::dec << statistics.PongFramesReceived; - GTEST_LOG_(INFO) << "Pong Frames sent: " << std::dec << statistics.PongFramesSent; - GTEST_LOG_(INFO) << "Binary frames sent: " << std::dec << statistics.BinaryFramesSent; - GTEST_LOG_(INFO) << "Binary frames received: " << std::dec << statistics.BinaryFramesReceived; - GTEST_LOG_(INFO) << "Total frames lost: " << std::dec << statistics.FramesDropped; - GTEST_LOG_(INFO) << "Transport Reads " << std::dec << statistics.TransportReads; - GTEST_LOG_(INFO) << "Transport Bytes Read " << std::dec << statistics.TransportReadBytes; - - // Close the socket gracefully. - testSocket.Close(); - - EXPECT_EQ(iterationCount.load(), statistics.BinaryFramesSent); - EXPECT_EQ(iterationCount.load(), statistics.BinaryFramesReceived); - - // Resize the test data to the number of actual iterations. - testData.resize(iterationCount.load()); - receivedData.resize(iterationCount.load()); - - // If we've processed every iteration, let's make sure that we received everything we sent. - // If we dropped some results, then we can't check to ensure that we have received everything - // because we can't account for everything sent. - std::multiset testDataStrings; - std::multiset receivedDataStrings; - for (auto const& data : testData) - { - testDataStrings.emplace(ToHexString(data)); - } - for (auto const& data : receivedData) - { - receivedDataStrings.emplace(ToHexString(data)); - } - - EXPECT_EQ(testDataStrings, receivedDataStrings); - for (auto const& data : testDataStrings) - { - if (receivedDataStrings.count(data) != testDataStrings.count(data)) - { - GTEST_LOG_(INFO) << "Missing data. TestDataCount: " << testDataStrings.count(data) - << " ReceivedDataCount: " << receivedDataStrings.count(data) - << " Missing Data: " << data << std::endl; - } - EXPECT_NE(receivedDataStrings.end(), receivedDataStrings.find(data)); - } - for (auto const& data : receivedDataStrings) - { - if (testDataStrings.count(data) != receivedDataStrings.count(data)) - { - GTEST_LOG_(INFO) << "Extra data. TestDataCount: " << testDataStrings.count(data) - << " ReceivedDataCount: " << receivedDataStrings.count(data) - << " Missing Data: " << data << std::endl; - } - - EXPECT_NE(testDataStrings.end(), testDataStrings.find(data)); - } - - // We shouldn't have seen any exceptions during the run. - EXPECT_EQ(0, exceptions.load()); - EXPECT_EQ(0, cancellationExceptions.load()); -} - -TEST_F(WebSocketTests, MultiThreadedTestOnMultipleSockets) -{ - constexpr size_t threadCount = 50; - constexpr size_t testDataLength = 240000; - constexpr size_t testDataSize = 100; - constexpr auto testDuration = 10s; - - // seed test data for the operations. - std::vector> testData(testDataLength); - std::vector> receivedData(testDataLength); - std::atomic iterationCount(0); - - // Spin up threadCount threads and hammer the echo server for 10 seconds. - std::vector threads; - std::atomic cancellationExceptions{0}; - std::atomic exceptions{0}; - for (size_t threadIndex = 0; threadIndex < threadCount; threadIndex += 1) - { - threads.push_back(std::thread([&]() { - std::chrono::time_point startTime - = std::chrono::system_clock::now(); - // Set the context to expire *after* the test is supposed to finish. - Azure::Core::Context context = Azure::Core::Context::ApplicationContext.WithDeadline( - Azure::DateTime{startTime} + testDuration + 10s); - size_t iteration = 0; - try - { - WebSocket testSocket(Azure::Core::Url("http://localhost:8000/echotest")); - - testSocket.Open(); - - do - { - iteration = iterationCount++; - std::vector sendData = GenerateRandomBytes(iteration, testDataSize); - { - if (iteration < testData.size()) - { - if (testData[iteration].size() != 0) - { - GTEST_LOG_(ERROR) << "Overwriting send frame at offset " << iteration << std::endl; - } - EXPECT_EQ(0, testData[iteration].size()); - testData[iteration] = sendData; - } - } - - testSocket.SendFrame(sendData, true /*, context*/); - auto response = testSocket.ReceiveFrame(context); - EXPECT_EQ(WebSocketFrameType::BinaryFrameReceived, response->FrameType); - auto binaryResult = response->AsBinaryFrame(); - - // Make sure we get back the data we sent in the echo request. - if (binaryResult->Data.size() == 0) - { - GTEST_LOG_(ERROR) << "Received empty frame at offset " << iteration << std::endl; - } - EXPECT_EQ(sendData.size(), binaryResult->Data.size()); - { - // There is no ordering expectation on the results, so we just remember the data - // as it comes in. We'll make sure we received everything later on. - if (iteration < receivedData.size()) - { - if (receivedData[iteration].size() != 0) - { - GTEST_LOG_(ERROR) << "Overwriting receive frame at offset " << iteration - << std::endl; - } - - EXPECT_EQ(0, receivedData[iteration].size()); - receivedData[iteration] = binaryResult->Data; - } - } - } while (std::chrono::system_clock::now() - startTime < testDuration); - // Close the socket gracefully. - testSocket.Close(); - } - catch (Azure::Core::OperationCancelledException& ex) - { - GTEST_LOG_(ERROR) << "Cancelled Exception: " << ex.what() << " at index " << iteration - << " Current Thread: " << std::this_thread::get_id() << std::endl; - cancellationExceptions++; - } - catch (std::exception const& ex) - { - GTEST_LOG_(ERROR) << "Exception: " << ex.what() << std::endl; - exceptions++; - } - })); - } - - // Wait for all the threads to exit. - for (auto& thread : threads) - { - thread.join(); - } - - // We no longer need to worry about synchronization since all the worker threads are done. - GTEST_LOG_(INFO) << "Total server requests: " << iterationCount.load() << std::endl; - GTEST_LOG_(INFO) << "Estimated " << std::dec << testData.size() << " iterations (0x" << std::hex - << testData.size() << ")" << std::endl; - EXPECT_GE(testDataLength, iterationCount.load()); - - // Resize the test data to the number of actual iterations. - testData.resize(iterationCount.load()); - receivedData.resize(iterationCount.load()); - - // If we've processed every iteration, let's make sure that we received everything we sent. - // If we dropped some results, then we can't check to ensure that we have received everything - // because we can't account for everything sent. - std::multiset testDataStrings; - std::multiset receivedDataStrings; - for (auto const& data : testData) - { - testDataStrings.emplace(ToHexString(data)); - } - for (auto const& data : receivedData) - { - receivedDataStrings.emplace(ToHexString(data)); - } - - EXPECT_EQ(testDataStrings, receivedDataStrings); - for (auto const& data : testDataStrings) - { - if (receivedDataStrings.count(data) != testDataStrings.count(data)) - { - GTEST_LOG_(INFO) << "Missing data. TestDataCount: " << testDataStrings.count(data) - << " ReceivedDataCount: " << receivedDataStrings.count(data) - << " Missing Data: " << data << std::endl; - } - EXPECT_NE(receivedDataStrings.end(), receivedDataStrings.find(data)); - } - for (auto const& data : receivedDataStrings) - { - if (testDataStrings.count(data) != receivedDataStrings.count(data)) - { - GTEST_LOG_(INFO) << "Extra data. TestDataCount: " << testDataStrings.count(data) - << " ReceivedDataCount: " << receivedDataStrings.count(data) - << " Missing Data: " << data << std::endl; - } - - EXPECT_NE(testDataStrings.end(), testDataStrings.find(data)); - } - - // We shouldn't have seen any exceptions during the run. - EXPECT_EQ(0, exceptions.load()); - EXPECT_EQ(0, cancellationExceptions.load()); -} - -// Does not work because curl rejects the wss: scheme. -class LibWebSocketIncrementProtocol { - WebSocketOptions m_options{{"dumb-increment-protocol"}}; - WebSocket m_socket; - -public: - LibWebSocketIncrementProtocol() : m_socket{Azure::Core::Url("wss://libwebsockets.org"), m_options} - { - } - - void Open() { m_socket.Open(); } - int GetNextNumber() - { - // Time out in 5 seconds if no activity. - Azure::Core::Context contextWithTimeout - = Azure::Core::Context().WithDeadline(std::chrono::system_clock::now() + 10s); - auto work = m_socket.ReceiveFrame(contextWithTimeout); - if (work->FrameType == WebSocketFrameType::TextFrameReceived) - { - auto frame = work->AsTextFrame(); - return std::atoi(frame->Text.c_str()); - } - if (work->FrameType == WebSocketFrameType::BinaryFrameReceived) - { - auto frame = work->AsBinaryFrame(); - throw std::runtime_error("Not implemented"); - } - else if (work->FrameType == WebSocketFrameType::PeerClosedReceived) - { - GTEST_LOG_(INFO) << "Remote server closed connection." << std::endl; - throw std::runtime_error("Remote server closed connection."); - } - else - { - throw std::runtime_error("Unknown result type"); - } - } - - void Reset() { m_socket.SendFrame("reset\n", true); } - void RequestClose() { m_socket.SendFrame("closeme\n", true); } - void Close() { m_socket.Close(); } - void Close(uint16_t closeCode, std::string const& reasonText = {}) - { - m_socket.Close(closeCode, reasonText); - } - void ConsumeUntilClosed() - { - while (m_socket.IsOpen()) - { - auto work = m_socket.ReceiveFrame(); - if (work->FrameType == WebSocketFrameType::PeerClosedReceived) - { - auto peerClose = work->AsPeerCloseFrame(); - GTEST_LOG_(INFO) << "Peer closed. Remote Code: " << std::dec << peerClose->RemoteStatusCode - << " (0x" << std::hex << peerClose->RemoteStatusCode << ")" << std::endl; - if (!peerClose->RemoteCloseReason.empty()) - { - GTEST_LOG_(INFO) << " Peer Closed Data: " << peerClose->RemoteCloseReason; - } - GTEST_LOG_(INFO) << std::endl; - return; - } - else if (work->FrameType == WebSocketFrameType::TextFrameReceived) - { - auto frame = work->AsTextFrame(); - GTEST_LOG_(INFO) << "Ignoring " << frame->Text << std::endl; - } - } - } -}; - -class LibWebSocketStatus { - -public: - std::string GetLWSStatus() - { - WebSocketOptions options; - - options.ServiceName = "websockettest"; - // Send 3 protocols to LWS. - options.Protocols.push_back("brownCow"); - options.Protocols.push_back("lws-status"); - options.Protocols.push_back("flibbityflobbidy"); - WebSocket serverSocket(Azure::Core::Url("wss://libwebsockets.org"), options); - serverSocket.Open(); - - // The server should have chosen the lws-status protocol since it doesn't understand the other - // protocols. - EXPECT_EQ("lws-status", serverSocket.GetNegotiatedProtocol()); - std::string returnValue; - std::shared_ptr lwsStatus; - do - { - - lwsStatus = serverSocket.ReceiveFrame(); - EXPECT_EQ(WebSocketFrameType::TextFrameReceived, lwsStatus->FrameType); - if (lwsStatus->FrameType == WebSocketFrameType::TextFrameReceived) - { - auto textFrame = lwsStatus->AsTextFrame(); - returnValue.insert(returnValue.end(), textFrame->Text.begin(), textFrame->Text.end()); - } - } while (!lwsStatus->IsFinalFrame); - serverSocket.Close(); - return returnValue; - } -}; - -TEST_F(WebSocketTests, LibWebSocketOrgLwsStatus) -{ - { - LibWebSocketStatus lwsStatus; - auto serverStatus = lwsStatus.GetLWSStatus(); - GTEST_LOG_(INFO) << "Server status: " << serverStatus << std::endl; - - Azure::Core::Json::_internal::json status; - EXPECT_NO_THROW(status = Azure::Core::Json::_internal::json::parse(serverStatus)); - EXPECT_TRUE(status["conns"].is_array()); - auto& connections = status["conns"].get_ref&>(); - bool foundOurConnection = false; - - // Scan through the list of connections to find a connection from the websockettest. - for (auto& connection : connections) - { - EXPECT_TRUE(connection["ua"].is_string()); - auto userAgent = connection["ua"].get(); - if (userAgent.find("websockettest") != std::string::npos) - { - foundOurConnection = true; - break; - } - } - EXPECT_TRUE(foundOurConnection); - } -} -TEST_F(WebSocketTests, LibWebSocketOrgIncrement) -{ - { - LibWebSocketIncrementProtocol incrementProtocol; - incrementProtocol.Open(); - - // Note that we cannot practically validate the numbers received from the service because - // they may be in flight at the time the "Reset" call is made. - for (auto i = 0; i < 100; i += 1) - { - if (i % 5 == 0) - { - GTEST_LOG_(INFO) << "Reset" << std::endl; - incrementProtocol.Reset(); - } - int number = incrementProtocol.GetNextNumber(); - GTEST_LOG_(INFO) << "Got next number " << number << std::endl; - } - incrementProtocol.RequestClose(); - incrementProtocol.ConsumeUntilClosed(); - } -} -#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) -TEST_F(WebSocketTests, CurlTransportCoverage) -{ - { - - Azure::Core::Http::WebSockets::CurlWebSocketTransportOptions transportOptions; - transportOptions.HttpKeepAlive = false; - auto transport - = std::make_shared(transportOptions); - - EXPECT_THROW(transport->NativeCloseSocket(1001, {}, {}), std::runtime_error); - EXPECT_THROW(transport->NativeGetCloseSocketInformation({}), std::runtime_error); - EXPECT_THROW( - transport->NativeSendFrame(WebSocketTransport::NativeWebSocketFrameType::Binary, {}, {}), - std::runtime_error); - EXPECT_THROW(transport->NativeReceiveFrame({}), std::runtime_error); - } -} -#endif diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 71fea0a3d9..f23f07d776 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -43,33 +43,6 @@ stages: LineCoverageTarget: 93 BranchCoverageTarget: 55 PreTestSteps: - - task: UsePythonVersion@0 - displayName: 'Use Python 3' - inputs: - versionSpec: '3' - condition: and(succeeded(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) - - - pwsh: | - python --version - pip install -r requirements.txt - workingDirectory: build/sdk/core/azure-core/test/ut - displayName: Install Python requirements. - condition: and(succeeded(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) - - task: PowerShell@2 - displayName: 'Launch python websocket server' - inputs: - pwsh: true - filePath: build/sdk/core/azure-core/test/ut/Start-WebSocketServer.ps1 - arguments: $(Build.SourcesDirectory)/WebSocketServer.log - workingDirectory: build/sdk/core/azure-core/test/ut - condition: and(succeeded(), contains(variables['Agent.OS'], 'windows'), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) - # It would be nice to collapse this branch with the previous one, but nohup doesn't seem to - # behave when called from powershell. - - bash: | - nohup python sdk/core/azure-core/test/ut/websocket_server.py > $(Build.SourcesDirectory)/WebSocketServer.log & - workingDirectory: build - condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows')), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) - displayName: Launch python websocket server (Linux). - pwsh: | docker build -t squid-local $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy docker build -t squid-local.passwd $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd @@ -101,32 +74,12 @@ stages: targetVersion: 1.0.0-dev.20220810.2 PostTestSteps: - # Shut down the test server. This uses curl to send a request to the "terminateserver" websocket endpoint. - # When the test server receives a request on terminateserver, it shuts down gracefully. - - pwsh: | - curl ` - --include ` - --no-buffer ` - --header "Connection: Upgrade" ` - --header "Upgrade: websocket" ` - --header "Host: localhost:8000" ` - --header "Origin: http://localhost:8000" ` - --header "Sec-WebSocket-Key: eaQZ9ed+LnT0zs5EvI04aQ==" ` - --header "Sec-WebSocket-Version: 13" ` - http://localhost:8000/terminateserver - displayName: Shutdown WebSocket server. - condition: contains(variables.CmakeArgs, 'BUILD_TESTING=ON') - pwsh: | docker ps -q -f ancestor=ubuntu/squid | ForEach-Object { ` docker stop $_ ` } displayName: Shutdown Squid Proxy. condition: and(variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON'), contains(variables['OSVmImage'], 'linux')) - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactPath: '$(Build.SourcesDirectory)/WebSocketServer.log' - ArtifactName: 'WebSocketLogs-$(Agent.JobName)_attempt_$(System.JobAttempt)' - CustomCondition: contains(variables.CmakeArgs, 'BUILD_TESTING=ON') Artifacts: - Name: azure-core From c5847e4e94f75fb40d2d6838964d2fab7247dc94 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 20 Sep 2022 16:05:03 -0700 Subject: [PATCH 10/75] Skip proxy tests if proxy isn't running --- .../src/http/curl/curl_connection_private.hpp | 2 +- sdk/core/azure-core/test/ut/CMakeLists.txt | 4 + .../test/ut/transport_policy_options.cpp | 116 ++++++++++++------ 3 files changed, 82 insertions(+), 40 deletions(-) diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index ccf1b217b5..4b99735faa 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -33,7 +33,7 @@ namespace Azure { namespace Core { namespace Http { // libcurl CURL_MAX_WRITE_SIZE is 64k. Using same value for default uploading chunk size. // This can be customizable in the HttpRequest constexpr static size_t DefaultUploadChunkSize = 1024 * 64; - constexpr static size_t DefaultLibcurlReaderSize = 1024; + constexpr static size_t DefaultLibcurlReaderSize = 4*1024; // Run time error template constexpr static const char* DefaultFailedToGetNewConnectionTemplate = "Fail to get a new connection for: "; diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index fb75016b2c..a8cf9a2b98 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -109,6 +109,10 @@ message(STATUS "Disabling proxy tests because they cannot be supported on this e add_compile_definitions(DISABLE_PROXY_TESTS) endif() +if (ENV{BUILD_REASON}) + add_compile_definitions(IN_CI_PIPELINE) +endif() + # Additional test files to be copied to the output directory. set(TEST_ADDITIONAL_FILES ${CMAKE_CURRENT_LIST_DIR}/requirements.txt diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp index 398f40f3c2..6c67547fe3 100644 --- a/sdk/core/azure-core/test/ut/transport_policy_options.cpp +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -4,6 +4,7 @@ #include "azure/core/context.hpp" #include "azure/core/http/curl_transport.hpp" #include "azure/core/http/policies/policy.hpp" +#include "azure/core/http/win_http_transport.hpp" #include "azure/core/internal/client_options.hpp" #include "azure/core/internal/environment.hpp" #include "azure/core/internal/http/pipeline.hpp" @@ -25,13 +26,6 @@ namespace Azure { namespace Core { namespace Test { class TransportAdapterOptions : public ::testing::Test { public: - enum class TestMode - { - UNKNOWN, - RECORD, - LIVE, - PLAYBACK, - }; struct AzureSdkHttpbinServer final { inline static std::string Get() @@ -94,45 +88,66 @@ namespace Azure { namespace Core { namespace Test { std::string HttpProxyServer() { return "http://127.0.0.1:3128"; } std::string HttpProxyServerWithPassword() { return "http://127.0.0.1:3129"; } + static bool ProxyStatusChecked; + static bool IsSquidProxyRunning; + static bool IsTestProxyRunning; protected: // Create - virtual void SetUp() override {} - - TestMode GetTestMode() + virtual void SetUp() override { - auto value = Azure::Core::_internal::Environment::GetVariable("AZURE_TEST_MODE"); - GTEST_LOG_(INFO) << "Azure Test Mode: " << value; - if (value.empty()) - { - GTEST_LOG_(INFO) << "Assume Live Test"; - - return TestMode::LIVE; - } - - if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( - value, "RECORD")) +#if !defined(IN_CI_PIPELINE) + if (!ProxyStatusChecked) { - GTEST_LOG_(INFO) << "TestMode:: Record."; - return TestMode::RECORD; - } - else if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( - value, "PLAYBACK")) - { - GTEST_LOG_(INFO) << "TestMode:: Playback."; - return TestMode::PLAYBACK; - } - else if (Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( - value, "LIVE")) - { - GTEST_LOG_(INFO) << "TestMode:: Live."; - return TestMode::LIVE; + Azure::Core::Http::Policies::TransportOptions options; + { + auto pipeline = CreateHttpPipeline(options); + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(HttpProxyServer()), false); + try + { + auto response = pipeline.Send(request, Azure::Core::Context::ApplicationContext); + IsSquidProxyRunning = true; + } + catch (Azure::Core::RequestFailedException& rfe) + { + IsSquidProxyRunning = false; + std::cout << "Skipping proxy tests. Error: " << rfe.what() << std::endl; + } + } + { +#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) + Azure::Core::Http::CurlTransportOptions curlOptions; + curlOptions.SslVerifyPeer = false; + options.Transport = std::make_shared(curlOptions); +#elif defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) + Azure::Core::Http::WinHttpTransportOptions winHttpOptions; + winHttpOptions.IgnoreUnknownCertificateAuthority = true; + options.Transport = std::make_shared(winHttpOptions); +#endif + auto pipeline = CreateHttpPipeline(options); + auto request = Azure::Core::Http::Request( + Azure::Core::Http::HttpMethod::Get, + Azure::Core::Url("https://localhost:5001/Admin/IsAlive")); + try + { + pipeline.Send(request, Azure::Core::Context::ApplicationContext); + IsTestProxyRunning = true; + } + catch (Azure::Core::RequestFailedException& rfe) + { + IsTestProxyRunning = false; + std::cout << "Skipping TestProxy tests: " << rfe.what() << std::endl; + } + } + ProxyStatusChecked = true; } - - // unexpected variable value - throw std::runtime_error("Invalid environment variable: " + value); +#endif } }; + bool TransportAdapterOptions::ProxyStatusChecked{false}; + bool TransportAdapterOptions::IsSquidProxyRunning{false}; + bool TransportAdapterOptions::IsTestProxyRunning{false}; void TransportAdapterOptions::checkResponseCode( Azure::Core::Http::HttpStatusCode code, @@ -228,6 +243,10 @@ namespace Azure { namespace Core { namespace Test { // constexpr char SocksProxyServer[] = "socks://98.162.96.41:4145"; TEST_F(TransportAdapterOptions, SimpleProxyTests) { + if (!IsSquidProxyRunning) + { + GTEST_SKIP_("Skipping proxy tests because proxy is not running."); + } Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); std::string myIpAddress; { @@ -278,6 +297,10 @@ namespace Azure { namespace Core { namespace Test { TEST_F(TransportAdapterOptions, ProxyWithPasswordHttps) { + if (!IsSquidProxyRunning) + { + GTEST_SKIP_("Skipping proxy tests because proxy is not running."); + } Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); // HTTPS Connections. @@ -323,6 +346,10 @@ namespace Azure { namespace Core { namespace Test { TEST_F(TransportAdapterOptions, ProxyWithPasswordHttp) { + if (!IsSquidProxyRunning) + { + GTEST_SKIP_("Skipping proxy tests because proxy is not running."); + } Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get()); // HTTP Connections. testUrl.SetScheme("http"); @@ -376,6 +403,7 @@ namespace Azure { namespace Core { namespace Test { EXPECT_EQ(response->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Ok); } #if !defined(DISABLE_PROXY_TESTS) + if (IsSquidProxyRunning) { Azure::Core::Http::Policies::TransportOptions transportOptions; @@ -466,7 +494,7 @@ namespace Azure { namespace Core { namespace Test { { std::vector testUrls{ AzureSdkHttpbinServer::Get(), - "https://www.microsoft.com/", + "https://twitter.com/", "https://www.example.com/", "https://www.google.com/", }; @@ -796,6 +824,11 @@ namespace Azure { namespace Core { namespace Test { TEST_F(TransportAdapterOptions, AccessTestProxyServer) { + if (!IsTestProxyRunning) + { + GTEST_SKIP_("Skipping TestProxy tests because TestProxy is not running."); + } + TestProxy proxyServer; EXPECT_EQ(Azure::Core::Http::HttpStatusCode::Ok, proxyServer.IsAlive().Value); @@ -828,6 +861,11 @@ namespace Azure { namespace Core { namespace Test { TEST_F(TransportAdapterOptions, TestProxyServerWithInvalidCertificate) { + if (!IsTestProxyRunning) + { + GTEST_SKIP_("Skipping TestProxy tests because TestProxy is not running."); + } + TestProxy::TestProxyOptions options; options.Transport.ExpectedTlsRootCertificate = InvalidTestProxyHttpsCertificate; TestProxy proxyServer(options); From 20f3abd3afa29234f66a996373f8eeeacc035aa8 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 20 Sep 2022 16:10:55 -0700 Subject: [PATCH 11/75] don't include winhttp if it's not wanted --- sdk/core/azure-core/src/http/curl/curl_connection_private.hpp | 2 +- sdk/core/azure-core/test/ut/transport_policy_options.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index 4b99735faa..3ba221cff3 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -33,7 +33,7 @@ namespace Azure { namespace Core { namespace Http { // libcurl CURL_MAX_WRITE_SIZE is 64k. Using same value for default uploading chunk size. // This can be customizable in the HttpRequest constexpr static size_t DefaultUploadChunkSize = 1024 * 64; - constexpr static size_t DefaultLibcurlReaderSize = 4*1024; + constexpr static size_t DefaultLibcurlReaderSize = 4 * 1024; // Run time error template constexpr static const char* DefaultFailedToGetNewConnectionTemplate = "Fail to get a new connection for: "; diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp index 6c67547fe3..80dfa0be52 100644 --- a/sdk/core/azure-core/test/ut/transport_policy_options.cpp +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -4,7 +4,9 @@ #include "azure/core/context.hpp" #include "azure/core/http/curl_transport.hpp" #include "azure/core/http/policies/policy.hpp" +#if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) #include "azure/core/http/win_http_transport.hpp" +#endif #include "azure/core/internal/client_options.hpp" #include "azure/core/internal/environment.hpp" #include "azure/core/internal/http/pipeline.hpp" @@ -194,7 +196,6 @@ namespace Azure { namespace Core { namespace Test { std::vector bodyVector = body->ReadToEnd(Azure::Core::Context::ApplicationContext); int64_t bodySize = body->Length(); EXPECT_EQ(bodySize, size); - bodySize = bodyVector.size(); if (size > 0) { // only for known body size From 5fa8a4dfd49eca25cd6317f5a21e5909ce31c787 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 20 Sep 2022 16:23:25 -0700 Subject: [PATCH 12/75] Noise reduction --- .github/workflows/event.yml | 1 - eng/common/pipelines/templates/jobs/perf.yml | 2 -- 2 files changed, 3 deletions(-) diff --git a/.github/workflows/event.yml b/.github/workflows/event.yml index 0f6de210a1..76c184c71c 100644 --- a/.github/workflows/event.yml +++ b/.github/workflows/event.yml @@ -1,4 +1,3 @@ - # NOTE: currently azure-sdk-actions only hosts check enforcer code. # If further functionality is added, this name should be updated to reflect # the more generic behavior diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index b1951a8334..ecd794a1f6 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -32,7 +32,6 @@ parameters: - name: OperatingSystems type: string default: 'Linux' - - name: InstallLanguageSteps type: stepList default: [] @@ -61,7 +60,6 @@ parameters: type: object default: {} - jobs: - job: ${{ parameters.JobName }} timeoutInMinutes: 360 From 3b46e08af19aa6e34e4315e32211233612c435d1 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 20 Sep 2022 16:35:34 -0700 Subject: [PATCH 13/75] Noise reduction; copied changelog entries over --- sdk/core/azure-core/CHANGELOG.md | 6 +++++- sdk/core/azure-core/CMakeLists.txt | 2 -- .../azure-storage-common/src/private/package_version.hpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index e7add57eed..90abd4cd58 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -4,8 +4,12 @@ ### Features Added -- Added support for the `WebSockets` protocol via the `Azure::Core::Http::WebSockets::WebSocket` class. - Added support for HTTP proxy servers, both unauthenticated and with Plain authentication. +- Added universal support for several TLS options: + - Added the ability to set the expected TLS root certificate for TLS connection (useful if a proxy server uses a TLS certificate that is not chained to a known root). + - Added the ability to enable TLS certificate revocation list checks (off by default). +- Added LibCURL functionality for TLS functionality + - Allow TLS connection to succeed if CRL retrieval fails. ### Breaking Changes diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index f631da4215..8a2a6e711b 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -136,8 +136,6 @@ set( src/http/transport_policy.cpp src/http/url.cpp src/http/user_agent.cpp - - src/io/body_stream.cpp src/io/random_access_file_body_stream.cpp src/logger.cpp diff --git a/sdk/storage/azure-storage-common/src/private/package_version.hpp b/sdk/storage/azure-storage-common/src/private/package_version.hpp index 2c728abf54..94b97b625e 100644 --- a/sdk/storage/azure-storage-common/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-common/src/private/package_version.hpp @@ -13,7 +13,7 @@ #define AZURE_STORAGE_COMMON_VERSION_MAJOR 12 #define AZURE_STORAGE_COMMON_VERSION_MINOR 4 #define AZURE_STORAGE_COMMON_VERSION_PATCH 0 -#define AZURE_STORAGE_COMMON_VERSION_PRERELEASE "beta.2" +#define AZURE_STORAGE_COMMON_VERSION_PRERELEASE "beta.1" #define AZURE_STORAGE_COMMON_VERSION_ITOA_HELPER(i) #i #define AZURE_STORAGE_COMMON_VERSION_ITOA(i) AZURE_STORAGE_COMMON_VERSION_ITOA_HELPER(i) From c159fd561ee3dc1d41823b5824ebcaece71757ec Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 20 Sep 2022 17:40:58 -0700 Subject: [PATCH 14/75] Improved code coverage numbers --- .../test/ut/request_activity_policy_test.cpp | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/test/ut/request_activity_policy_test.cpp b/sdk/core/azure-core/test/ut/request_activity_policy_test.cpp index e2661f9c76..45b53d3799 100644 --- a/sdk/core/azure-core/test/ut/request_activity_policy_test.cpp +++ b/sdk/core/azure-core/test/ut/request_activity_policy_test.cpp @@ -16,6 +16,7 @@ using namespace Azure::Core::Tracing::_internal; using namespace Azure::Core::Tracing; namespace { + class NoOpPolicy final : public HttpPolicy { std::function(Request&)> m_createResponse{}; @@ -209,7 +210,9 @@ TEST(RequestActivityPolicy, Basic) // Final policy - equivalent to HTTP policy. policies.emplace_back(std::make_unique([&](Request& request) { userAgent = request.GetHeader("user-agent"); // Return success. - return std::make_unique(1, 1, HttpStatusCode::Ok, "Something"); + auto response = std::make_unique(1, 1, HttpStatusCode::Ok, "Something"); + response->SetHeader("x-ms-request-id", request.GetHeader("x-ms-client-request-id").Value()); + return response; })); Azure::Core::Http::_internal::HttpPipeline(policies).Send(request, callContext); @@ -221,6 +224,9 @@ TEST(RequestActivityPolicy, Basic) EXPECT_EQ("My API", tracer->GetSpans()[0]->GetName()); EXPECT_EQ("HTTP GET", tracer->GetSpans()[1]->GetName()); EXPECT_EQ("GET", tracer->GetSpans()[1]->GetAttributes().at("http.method")); + EXPECT_EQ( + request.GetHeaders()["x-ms-client-request-id"], + tracer->GetSpans()[1]->GetAttributes().at("requestId")); std::string expectedUserAgentPrefix{"azsdk-cpp-my-service-cpp/1.0.0.beta-2 ("}; EXPECT_EQ(expectedUserAgentPrefix, userAgent.Value().substr(0, expectedUserAgentPrefix.size())); } @@ -284,3 +290,53 @@ TEST(RequestActivityPolicy, TryRetries) EXPECT_EQ("200", tracer->GetSpans()[3]->GetAttributes().at("http.status_code")); } } + +TEST(RequestActivityPolicy, TryFailures) +{ + { + auto testTracer = std::make_shared(); + + Azure::Core::_internal::ClientOptions clientOptions; + clientOptions.Telemetry.TracingProvider = testTracer; + Azure::Core::Tracing::_internal::TracingContextFactory serviceTrace( + clientOptions, "my-service-cpp", "1.0b2"); + + auto contextAndSpan = serviceTrace.CreateTracingContext("My API", {}); + Azure::Core::Context callContext = std::move(contextAndSpan.Context); + Request request(HttpMethod::Get, Url("https://www.microsoft.com")); + + { + std::vector> policies; + + policies.emplace_back(std::make_unique()); + policies.emplace_back(std::make_unique(RetryOptions{})); + + // Add the request ID policy - this adds the x-ms-request-id attribute to the pipeline. + policies.emplace_back( + std::make_unique(Azure::Core::Http::_internal::HttpSanitizer{})); + // Final policy - equivalent to HTTP policy. + policies.emplace_back( + std::make_unique([&](Request&) -> std::unique_ptr { + throw Azure::Core::Http::TransportException("Throwing exceptions..."); + })); + + Azure::Core::Http::_internal::HttpPipeline pipeline(policies); + // Simulate retrying an HTTP operation 3 times on the pipeline: + EXPECT_THROW(pipeline.Send(request, callContext), Azure::Core::Http::TransportException); + } + + EXPECT_EQ(1ul, testTracer->GetTracers().size()); + auto& tracer = testTracer->GetTracers().front(); + EXPECT_EQ(5ul, tracer->GetSpans().size()); + EXPECT_EQ("My API", tracer->GetSpans()[0]->GetName()); + EXPECT_EQ("HTTP GET", tracer->GetSpans()[1]->GetName()); + EXPECT_EQ("HTTP GET", tracer->GetSpans()[2]->GetName()); + EXPECT_EQ("HTTP GET", tracer->GetSpans()[3]->GetName()); + EXPECT_EQ(1, tracer->GetSpans()[1]->GetEvents().size()); + EXPECT_EQ("Throwing exceptions...", tracer->GetSpans()[1]->GetEvents()[0]); + EXPECT_EQ(1, tracer->GetSpans()[2]->GetEvents().size()); + EXPECT_EQ("Throwing exceptions...", tracer->GetSpans()[2]->GetEvents()[0]); + EXPECT_EQ(1, tracer->GetSpans()[3]->GetEvents().size()); + EXPECT_EQ("Throwing exceptions...", tracer->GetSpans()[3]->GetEvents()[0]); + } +} From a2dcaa1e394ff68b7e88950e50ab65dd0457ce23 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 21 Sep 2022 00:32:22 -0700 Subject: [PATCH 15/75] Exclude crypto internal errors to improve code coverage --- .../azure-core/src/cryptography/sha_hash.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/core/azure-core/src/cryptography/sha_hash.cpp b/sdk/core/azure-core/src/cryptography/sha_hash.cpp index 95b06b7d7a..bc4017ef65 100644 --- a/sdk/core/azure-core/src/cryptography/sha_hash.cpp +++ b/sdk/core/azure-core/src/cryptography/sha_hash.cpp @@ -44,7 +44,7 @@ class SHAWithOpenSSL final : public Azure::Core::Cryptography::Hash { unsigned char finalHash[EVP_MAX_MD_SIZE]; if (1 != EVP_DigestFinal(m_context, finalHash, &size)) { - throw std::runtime_error("Crypto error while computing Sha256Hash."); + throw std::runtime_error("Crypto error while computing Sha256Hash."); // LCOV_EXCL_LINE } return std::vector(std::begin(finalHash), std::begin(finalHash) + size); } @@ -53,7 +53,7 @@ class SHAWithOpenSSL final : public Azure::Core::Cryptography::Hash { { if (1 != EVP_DigestUpdate(m_context, data, length)) { - throw std::runtime_error("Crypto error while updating Sha256Hash."); + throw std::runtime_error("Crypto error while updating Sha256Hash."); // LCOV_EXCL_LINE } } @@ -62,41 +62,41 @@ class SHAWithOpenSSL final : public Azure::Core::Cryptography::Hash { { if ((m_context = EVP_MD_CTX_new()) == NULL) { - throw std::runtime_error("Crypto error while creating EVP context."); + throw std::runtime_error("Crypto error while creating EVP context."); // LCOV_EXCL_LINE } switch (size) { case SHASize::SHA1: { if (1 != EVP_DigestInit_ex(m_context, EVP_sha1(), NULL)) { - throw std::runtime_error("Crypto error while initializing Sha1Hash."); + throw std::runtime_error("Crypto error while initializing Sha1Hash."); // LCOV_EXCL_LINE } break; } case SHASize::SHA256: { if (1 != EVP_DigestInit_ex(m_context, EVP_sha256(), NULL)) { - throw std::runtime_error("Crypto error while init Sha256Hash."); + throw std::runtime_error("Crypto error while init Sha256Hash."); // LCOV_EXCL_LINE } break; } case SHASize::SHA384: { if (1 != EVP_DigestInit_ex(m_context, EVP_sha384(), NULL)) { - throw std::runtime_error("Crypto error while init Sha384Hash."); + throw std::runtime_error("Crypto error while init Sha384Hash."); // LCOV_EXCL_LINE } break; } case SHASize::SHA512: { if (1 != EVP_DigestInit_ex(m_context, EVP_sha512(), NULL)) { - throw std::runtime_error("Crypto error while init Sha512Hash."); + throw std::runtime_error("Crypto error while init Sha512Hash."); // LCOV_EXCL_LINE } break; } default: // imposible to get here - AZURE_UNREACHABLE_CODE(); + AZURE_UNREACHABLE_CODE(); // LCOV_EXCL_LINE } } From 4b113f10621df3d946e4dfc42be3c4becd311c12 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 21 Sep 2022 11:13:50 -0700 Subject: [PATCH 16/75] Cleaned up a few issues in the live platform matrix --- .../templates/stages/platform-matrix-live.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/templates/stages/platform-matrix-live.json b/eng/pipelines/templates/stages/platform-matrix-live.json index ceb385618d..4e225d046e 100644 --- a/eng/pipelines/templates/stages/platform-matrix-live.json +++ b/eng/pipelines/templates/stages/platform-matrix-live.json @@ -1,18 +1,22 @@ { "displayNames": { - "MacOS": "" + "_": "" }, "include": [ { "StaticConfigs": { - "x64_with_unit_test": { + "macOS-11": { "Pool": "Azure Pipelines", "OSVmImage": "macos-11", "VCPKG_DEFAULT_TRIPLET": "x64-osx", - "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DDISABLE_PROXY_TESTS=ON ", - "AZURE_CORE_ENABLE_JSON_TESTS": 1, "BuildArgs": "-j 4" } + }, + "BuildConfig": { + "_x64_with_unit_test": { + "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DDISABLE_PROXY_TESTS=ON ", + "AZURE_CORE_ENABLE_JSON_TESTS": 1 + } } }, { @@ -49,7 +53,7 @@ "RunProxyTests": true } }, - "BuildConfiguration": { + "BuildConfig": { "x64_with_unit_test": { "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON", "AZURE_CORE_ENABLE_JSON_TESTS": 1 From 1c300e80114f0bef859d654f88477e7d444039a5 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 21 Sep 2022 11:14:02 -0700 Subject: [PATCH 17/75] Force CI pipeline to run proxy tests --- sdk/core/azure-core/test/ut/transport_policy_options.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp index 80dfa0be52..3c126165f4 100644 --- a/sdk/core/azure-core/test/ut/transport_policy_options.cpp +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -98,7 +98,12 @@ namespace Azure { namespace Core { namespace Test { // Create virtual void SetUp() override { -#if !defined(IN_CI_PIPELINE) +#if defined(IN_CI_PIPELINE) + // If we're in the CI pipeline, don't probe for the squid or test proxy running - just assume + // they are. + IsSquidProxyRunning = true; + IsTestProxyRunning = true; +#else // !defined(IN_CI_PIPELINE) if (!ProxyStatusChecked) { Azure::Core::Http::Policies::TransportOptions options; From 7f50b91ae599bd522842c2232675cfe6454e345e Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 21 Sep 2022 11:54:14 -0700 Subject: [PATCH 18/75] Test proxy URLs are configurable --- .../test/ut/transport_policy_options.cpp | 56 +++++++++++++++---- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp index 3c126165f4..5d1b1b5ac0 100644 --- a/sdk/core/azure-core/test/ut/transport_policy_options.cpp +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -88,8 +88,34 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Http::HttpStatusCode code, Azure::Core::Http::HttpStatusCode expectedCode = Azure::Core::Http::HttpStatusCode::Ok); - std::string HttpProxyServer() { return "http://127.0.0.1:3128"; } - std::string HttpProxyServerWithPassword() { return "http://127.0.0.1:3129"; } + std::string HttpProxyServer() + { + std::string proxyUrl{Azure::Core::_internal::Environment::GetVariable("SQUID_PROXY_URL")}; + if (proxyUrl.empty()) + { + proxyUrl = "http://127.0.0.1:3128"; + } + return proxyUrl; + } + std::string HttpProxyServerWithPassword() + { + std::string proxyUrl{ + Azure::Core::_internal::Environment::GetVariable("SQUID_AUTH_PROXY_URL")}; + if (proxyUrl.empty()) + { + proxyUrl = "http://127.0.0.1:3129"; + } + return proxyUrl; + } + std::string TestProxyUrl() + { + std::string proxyUrl{Azure::Core::_internal::Environment::GetVariable("PROXY_URL")}; + if (proxyUrl.empty()) + { + proxyUrl = "https://localhost:5001"; + } + return proxyUrl; + } static bool ProxyStatusChecked; static bool IsSquidProxyRunning; static bool IsTestProxyRunning; @@ -135,7 +161,7 @@ namespace Azure { namespace Core { namespace Test { auto pipeline = CreateHttpPipeline(options); auto request = Azure::Core::Http::Request( Azure::Core::Http::HttpMethod::Get, - Azure::Core::Url("https://localhost:5001/Admin/IsAlive")); + Azure::Core::Url(TestProxyUrl() + "/Admin/IsAlive")); try { pipeline.Send(request, Azure::Core::Context::ApplicationContext); @@ -711,6 +737,15 @@ namespace Azure { namespace Core { namespace Test { // cspell:enable std::unique_ptr m_pipeline; + std::string TestProxyUrl() + { + std::string proxyUrl{Azure::Core::_internal::Environment::GetVariable("PROXY_URL")}; + if (proxyUrl.empty()) + { + proxyUrl = "https://localhost:5001"; + } + return proxyUrl; + } public: struct TestProxyOptions : Azure::Core::_internal::ClientOptions @@ -743,7 +778,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::IO::MemoryBodyStream postBody(bodyVector); auto request = Azure::Core::Http::Request( Azure::Core::Http::HttpMethod::Post, - Azure::Core::Url("https://localhost:5001/record/start"), + Azure::Core::Url(TestProxyUrl() + "/record/start"), &postBody); auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); @@ -755,8 +790,7 @@ namespace Azure { namespace Core { namespace Test { std::string const& recordingId) { auto request = Azure::Core::Http::Request( - Azure::Core::Http::HttpMethod::Post, - Azure::Core::Url("https://localhost:5001/record/stop")); + Azure::Core::Http::HttpMethod::Post, Azure::Core::Url(TestProxyUrl() + "/record/stop")); request.SetHeader("x-recording-id", recordingId); auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); @@ -774,7 +808,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::IO::MemoryBodyStream postBody(bodyVector); auto request = Azure::Core::Http::Request( Azure::Core::Http::HttpMethod::Post, - Azure::Core::Url("https://localhost:5001/playback/start"), + Azure::Core::Url(TestProxyUrl() + "/playback/start"), &postBody); auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); @@ -787,8 +821,7 @@ namespace Azure { namespace Core { namespace Test { std::string const& recordingId) { auto request = Azure::Core::Http::Request( - Azure::Core::Http::HttpMethod::Post, - Azure::Core::Url("https://localhost:5001/playback/stop")); + Azure::Core::Http::HttpMethod::Post, Azure::Core::Url(TestProxyUrl() + "/playback/stop")); request.SetHeader("x-recording-id", recordingId); auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); @@ -804,7 +837,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Core::Url targetUrl{urlToRecord}; auto request = Azure::Core::Http::Request( Azure::Core::Http::HttpMethod::Get, - Azure::Core::Url("https://localhost:5001/" + targetUrl.GetRelativeUrl())); + Azure::Core::Url(TestProxyUrl() + "/" + targetUrl.GetRelativeUrl())); request.SetHeader( "x-recording-upstream-base-uri", targetUrl.GetScheme() + "://" + targetUrl.GetHost()); request.SetHeader("x-recording-id", recordingId); @@ -818,8 +851,7 @@ namespace Azure { namespace Core { namespace Test { Azure::Response IsAlive() { auto request = Azure::Core::Http::Request( - Azure::Core::Http::HttpMethod::Get, - Azure::Core::Url("https://localhost:5001/Admin/IsAlive")); + Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(TestProxyUrl() + "/Admin/IsAlive")); auto response = m_pipeline->Send(request, Azure::Core::Context::ApplicationContext); auto statusCode = response->GetStatusCode(); return Azure::Response(statusCode, std::move(response)); From 7ec476e0484b370140664a101810adee36839042 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 21 Sep 2022 11:58:14 -0700 Subject: [PATCH 19/75] Use System.TeamProjectId to be in sync with the new-testresources powershell script --- sdk/core/azure-core/test/ut/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index a8cf9a2b98..995e14b87f 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -109,7 +109,8 @@ message(STATUS "Disabling proxy tests because they cannot be supported on this e add_compile_definitions(DISABLE_PROXY_TESTS) endif() -if (ENV{BUILD_REASON}) +# If the System.TeamProjectId ADO variable is set, we are running in the pipeline, behave accordingly. +if (ENV{SYSTEM_TEAMPROJECTID}) add_compile_definitions(IN_CI_PIPELINE) endif() From 898dacc8150d4fea9201a5203e6a7f045658023c Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 21 Sep 2022 12:47:01 -0700 Subject: [PATCH 20/75] cspell fixes --- .vscode/cspell.json | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 37c27178e6..fbd5d8dda6 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -186,6 +186,12 @@ "SECP" ] }, + { + "filename": "**/sdk/core/azure-core/**", + "words": [ + "TEAMPROJECTID" + ] + }, { "filename": "**/sdk/core/azure-core/README.md", "words": [ @@ -235,10 +241,10 @@ ] }, { - "filename": "**/sdk/storage/azure-storage-files-shares/**/*", - "words": [ - "mibps" - ] + "filename": "**/sdk/storage/azure-storage-files-shares/**/*", + "words": [ + "mibps" + ] }, { "filename": "**/cmake-modules/**/*", From 66d9782beee122b2a562f8db29ed08012501d077 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 21 Sep 2022 12:52:33 -0700 Subject: [PATCH 21/75] Removed explicit default copy cor and explicit assignment --- sdk/core/azure-core/inc/azure/core/context.hpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/context.hpp b/sdk/core/azure-core/inc/azure/core/context.hpp index 68ee8b31cd..b46b01e63c 100644 --- a/sdk/core/azure-core/inc/azure/core/context.hpp +++ b/sdk/core/azure-core/inc/azure/core/context.hpp @@ -146,23 +146,6 @@ namespace Azure { namespace Core { */ Context() : m_contextSharedState(std::make_shared()) {} - /** - * @brief Constructs a `%Context` from another `%Context` instance. - * - * @param that Another instance to copy. - * - */ - Context(Context const& that) = default; - - /** - * @brief Assigns `%Context` to another `%Context` instance. - * - * @param other Another instance to copy. - * - * @return A reference to this `%Context`. - */ - Context& operator=(const Context& other) = default; - /** * @brief Creates a context with a deadline. * From d224125c8b78b30b52472fbc4192ae95a026d38d Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 26 Sep 2022 10:19:58 -0700 Subject: [PATCH 22/75] Pull request feedback --- eng/pipelines/templates/stages/platform-matrix-live.json | 2 +- sdk/core/azure-core/CHANGELOG.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/stages/platform-matrix-live.json b/eng/pipelines/templates/stages/platform-matrix-live.json index 4e225d046e..e2e7f2a803 100644 --- a/eng/pipelines/templates/stages/platform-matrix-live.json +++ b/eng/pipelines/templates/stages/platform-matrix-live.json @@ -13,7 +13,7 @@ } }, "BuildConfig": { - "_x64_with_unit_test": { + "x64_with_unit_test": { "CmakeArgs": " -DBUILD_TESTING=ON -DRUN_LONG_UNIT_TESTS=ON -DBUILD_PERFORMANCE_TESTS=ON -DBUILD_SAMPLES=ON -DDISABLE_PROXY_TESTS=ON ", "AZURE_CORE_ENABLE_JSON_TESTS": 1 } diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 90abd4cd58..3a17f2ca4f 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -8,8 +8,8 @@ - Added universal support for several TLS options: - Added the ability to set the expected TLS root certificate for TLS connection (useful if a proxy server uses a TLS certificate that is not chained to a known root). - Added the ability to enable TLS certificate revocation list checks (off by default). -- Added LibCURL functionality for TLS functionality - - Allow TLS connection to succeed if CRL retrieval fails. + - For LibCURL only: Allow TLS connection to succeed if CRL retrieval fails. + - *NOTE*: This change only applies if LibCURL is built using the OpenSSL crypto backend. It does NOT apply if LibCURL uses the schannel (Windows default) or SecureTransport (Mac/iOS default). ### Breaking Changes From c825dea875d80e289a68b560f0bf84fe4f38b0e3 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 10:51:55 -0700 Subject: [PATCH 23/75] Update sdk/core/azure-core/CHANGELOG.md Co-authored-by: Ahson Khan --- sdk/core/azure-core/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 3a17f2ca4f..b85ac10776 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -9,7 +9,7 @@ - Added the ability to set the expected TLS root certificate for TLS connection (useful if a proxy server uses a TLS certificate that is not chained to a known root). - Added the ability to enable TLS certificate revocation list checks (off by default). - For LibCURL only: Allow TLS connection to succeed if CRL retrieval fails. - - *NOTE*: This change only applies if LibCURL is built using the OpenSSL crypto backend. It does NOT apply if LibCURL uses the schannel (Windows default) or SecureTransport (Mac/iOS default). + - *NOTE*: This change only applies if LibCURL is built using the OpenSSL crypto backend. It does NOT apply if LibCURL uses the schannel (Windows default) or SecureTransport (Mac/iOS default). ### Breaking Changes From 6325b5174362cb4c3da76df6fa75c031ab45e074 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 10:54:02 -0700 Subject: [PATCH 24/75] Update sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp Co-authored-by: Ahson Khan --- sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index cf6ef84ae3..467395c936 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -47,7 +47,7 @@ namespace Azure { namespace Core { namespace Http { * Certificate Revocation List. * * @remark Note that this only works when LibCURL is configured to use openssl as its TLS - * provider. That functionally limits this check to Linux only, and then only when openssl is + * provider. That functionally limits this check to Linux only, and only when openssl is * configured (the default). */ bool AllowFailedCrlRetrieval = false; From 86db9306f23ed50e0395d31c358cb9afff78e645 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 10:56:38 -0700 Subject: [PATCH 25/75] Update sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp Co-authored-by: Ahson Khan --- sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index 467395c936..628b5b7f93 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -89,7 +89,7 @@ namespace Azure { namespace Core { namespace Http { * @brief Username to be used for proxy connections. * * @remark No validation for the string is done by the Azure SDK. More about this option: - * https://curl.haxx.se/libcurl/c/CURLOPT_PROXY_USERNAME.html. + * https://curl.se/libcurl/c/CURLOPT_PROXYUSERNAME.html. * * @remark The default value is an empty string (no proxy). * From 1eee5e14a8783fe910c16da5a94ce3b7f5cfd81d Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 11:14:46 -0700 Subject: [PATCH 26/75] Update sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp Co-authored-by: Ahson Khan --- sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 61e144939d..52dd06d75d 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -159,7 +159,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { /** * @brief Enable TLS Certificate validation against a certificate revocation list. * - * @remark Note that by default CRL validation is *disabled*. + * @remark Note that by default, CRL validation is *disabled*. */ bool EnableCertificateRevocationListCheck{false}; From fea87e6455b888e6058cbfffe5f5e1a2b7a0dc3f Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 11:20:25 -0700 Subject: [PATCH 27/75] Update sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp Co-authored-by: Ahson Khan --- sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 52dd06d75d..6f38fb66aa 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -167,7 +167,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * @brief Base64 encoded DER representation of an X.509 certificate expected in the certificate * chain used in TLS connections. * - * @remark Note that with the schannel and sectransp crypto backends, settting the + * @remark Note that with the schannel and sectransp crypto backends, setting the * expected root certificate disables access to the system certificate store. * This means that the expected root certificate is the only certificate that will be trusted. */ From ab1037f85f231dc83c9dc04bb0be4cb47981993b Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 11:29:25 -0700 Subject: [PATCH 28/75] Update sdk/core/azure-core/test/ut/CMakeLists.txt Co-authored-by: Ahson Khan --- sdk/core/azure-core/test/ut/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index 995e14b87f..dfac01b642 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -34,8 +34,8 @@ endif() include(GoogleTest) if (NOT WIN32) -find_package(OpenSSL REQUIRED) -SET(OPENSSLCRYPTO OpenSSL::Crypto) + find_package(OpenSSL REQUIRED) + SET(OPENSSLCRYPTO OpenSSL::Crypto) endif() add_executable ( From 9744b328fdeacd63e0a78f939ef176d492516511 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 11:30:30 -0700 Subject: [PATCH 29/75] Update sdk/core/azure-core/test/ut/CMakeLists.txt Co-authored-by: Ahson Khan --- sdk/core/azure-core/test/ut/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index dfac01b642..02fdf2ce7d 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -105,8 +105,8 @@ if (MSVC) endif() if (DISABLE_PROXY_TESTS) -message(STATUS "Disabling proxy tests because they cannot be supported on this environment." ) -add_compile_definitions(DISABLE_PROXY_TESTS) + message(STATUS "Disabling proxy tests because they cannot be supported on this environment." ) + add_compile_definitions(DISABLE_PROXY_TESTS) endif() # If the System.TeamProjectId ADO variable is set, we are running in the pipeline, behave accordingly. From bbbc18e759ac8b3ce8077633dd13c438af6b55e9 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 11:30:48 -0700 Subject: [PATCH 30/75] Update sdk/core/azure-core/test/ut/CMakeLists.txt Co-authored-by: Ahson Khan --- sdk/core/azure-core/test/ut/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/core/azure-core/test/ut/CMakeLists.txt b/sdk/core/azure-core/test/ut/CMakeLists.txt index 02fdf2ce7d..540d692e1b 100644 --- a/sdk/core/azure-core/test/ut/CMakeLists.txt +++ b/sdk/core/azure-core/test/ut/CMakeLists.txt @@ -117,7 +117,6 @@ endif() # Additional test files to be copied to the output directory. set(TEST_ADDITIONAL_FILES ${CMAKE_CURRENT_LIST_DIR}/requirements.txt - ) add_custom_command(TARGET azure-core-test POST_BUILD From 84c412e8afad6201b66696656bc1a041545bdde4 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 12:03:36 -0700 Subject: [PATCH 31/75] PR feedback --- .../azure-security-attestation/CMakeLists.txt | 1 + .../inc/azure/core/http/curl_transport.hpp | 30 +++++++++++-------- .../inc/azure/core/http/policies/policy.hpp | 7 +++-- .../azure/core/http/win_http_transport.hpp | 2 +- sdk/core/azure-core/src/http/curl/curl.cpp | 14 ++++----- .../src/http/curl/curl_session_private.hpp | 2 +- .../azure-core/src/http/transport_policy.cpp | 12 ++------ .../src/http/winhttp/win_http_transport.cpp | 4 +-- .../test/ut/proxy_tests/builddocker.ps1 | 3 ++ .../proxy_tests/localproxy.passwd/Dockerfile | 3 +- .../test/ut/proxy_tests/localproxy/Dockerfile | 3 +- .../proxy_tests/remoteproxy.passwd/Dockerfile | 3 +- .../ut/proxy_tests/remoteproxy/Dockerfile | 3 +- .../test/ut/proxy_tests/run_wsl_proxy.ps1 | 3 ++ .../test/ut/proxy_tests/runproxy.ps1 | 3 ++ .../test/ut/proxy_tests/verify_proxy.ps1 | 3 ++ sdk/core/ci.yml | 6 ++-- 17 files changed, 59 insertions(+), 43 deletions(-) diff --git a/sdk/attestation/azure-security-attestation/CMakeLists.txt b/sdk/attestation/azure-security-attestation/CMakeLists.txt index 0fd43b0753..b336ba653d 100644 --- a/sdk/attestation/azure-security-attestation/CMakeLists.txt +++ b/sdk/attestation/azure-security-attestation/CMakeLists.txt @@ -20,6 +20,7 @@ include(AzureConfigRTTI) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if(NOT AZ_ALL_LIBRARIES) find_package(azure-core-cpp "1.5.0" CONFIG QUIET) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index 628b5b7f93..d46d04cb82 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -28,7 +28,7 @@ namespace Azure { namespace Core { namespace Http { * @brief The available options to set libcurl SSL options. * * @remark The SDK will map the enum option to libcurl's specific option. See more info here: - * https://curl.haxx.se/libcurl/c/CURLOPT_SSL_OPTIONS.html + * https://curl.se/libcurl/c/CURLOPT_SSL_OPTIONS.html * */ struct CurlTransportSslOptions final @@ -59,7 +59,7 @@ namespace Azure { namespace Core { namespace Http { * @remark The Azure SDK will not directly validate these certificates. * * @remark More about this option: - * https://curl.haxx.se/libcurl/c/CURLOPT_CAINFO_BLOB.html + * https://curl.se/libcurl/c/CURLOPT_CAINFO_BLOB.html * */ std::string PemEncodedExpectedRootCertificates; @@ -78,7 +78,7 @@ namespace Azure { namespace Core { namespace Http { * proxy settings from the system (use no proxy). * * @remark No validation for the string is done by the Azure SDK. More about this option: - * https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html. + * https://curl.se/libcurl/c/CURLOPT_PROXY.html. * * @remark The default value is an empty string (no proxy). * @@ -100,12 +100,12 @@ namespace Azure { namespace Core { namespace Http { * @brief Password to be used for proxy connections. * * @remark No validation for the string is done by the Azure SDK. More about this option: - * https://curl.haxx.se/libcurl/c/CURLOPT_PROXY_PASSWORD.html. + * https://curl.se/libcurl/c/CURLOPT_PROXYPASSWORD.html. * - * @remark The default value is an empty string (no proxy). + * @remark If a value is provided, the value will be used (this allows the caller to provide an empty password) * */ - std::string ProxyPassword; + Azure::Nullable ProxyPassword; /** * @brief Path to a PEM encoded file containing the certificate authorities sent to libcurl * handle directly. @@ -113,7 +113,7 @@ namespace Azure { namespace Core { namespace Http { * @remark The Azure SDK will not check if the path is valid or not. * * @remark The default is the built-in system specific path. More about this option: - * https://curl.haxx.se/libcurl/c/CURLOPT_CAINFO.html + * https://curl.se/libcurl/c/CURLOPT_CAINFO.html * */ std::string CAInfo; @@ -135,7 +135,7 @@ namespace Azure { namespace Core { namespace Http { * certificate. * * @remark The default value is `true`. More about this option: - * https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html + * https://curl.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html * */ bool SslVerifyPeer = true; @@ -143,7 +143,7 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Define the SSL options for the libcurl handle. * - * @remark See more info here: https://curl.haxx.se/libcurl/c/CURLOPT_SSL_OPTIONS.html. + * @remark See more info here: https://curl.se/libcurl/c/CURLOPT_SSL_OPTIONS.html. * The default option is all options `false`. * */ @@ -199,10 +199,14 @@ 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) + /** + * @brief Destroys a CurlTransport object. + * + * 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; /** diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 6f38fb66aa..65cf3985e3 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -140,9 +140,10 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { #if !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) #if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) || defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) /** - * @brief Http Proxies used when making an HTTP connection. + * @brief The URL for the proxy server to use for this connection. * - * @remark The URL for the proxy server to use for this connection. + * @remark If an empty string is specified, it instructs the transport to disable all proxies, including + * system proxies. */ Azure::Nullable HttpProxy{}; @@ -154,7 +155,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { /** * @brief The password to use when authenticating with the proxy server. */ - std::string ProxyPassword{}; + Azure::Nullable ProxyPassword{}; /** * @brief Enable TLS Certificate validation against a certificate revocation list. diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 9001cbcbb5..864be05d2e 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -204,7 +204,7 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Password for proxy authentication. */ - std::string ProxyPassword; + Azure::Nullable ProxyPassword; /** * @brief Array of Base64 encoded DER encoded X.509 certificate. These certificates should form diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index edc7532ed1..775e1553d7 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -360,14 +360,14 @@ CURLcode CurlSession::Perform(Context const& context) // If we are using an HTTP proxy, connecting to an HTTP resource and it has been configured with a // username and password, we want to set the proxy authentication header. if (m_httpProxy.HasValue() && m_request.GetUrl().GetScheme() == "http" && !m_httpProxyUser.empty() - && !m_httpProxyPassword.empty()) + && m_httpProxyPassword.HasValue()) { Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Setting proxy authentication header"); this->m_request.SetHeader( "Proxy-Authorization", "Basic " + Azure::Core::_internal::Convert::Base64Encode( - m_httpProxyUser + ":" + m_httpProxyPassword)); + m_httpProxyUser + ":" + m_httpProxyPassword.Value())); } // use expect:100 for PUT requests. Server will decide if it can take our request @@ -1200,11 +1200,11 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption key.append(","); key.append(!options.CAInfo.empty() ? options.CAInfo : "0"); key.append(","); - key.append(options.Proxy ? (options.Proxy->empty() ? "NoProxy" : options.Proxy.Value()) : "0"); + key.append(options.Proxy.ValueOr("NoProxy")); key.append(","); key.append(options.ProxyUsername.empty() ? "0" : options.ProxyUsername); key.append(","); - key.append(options.ProxyPassword.empty() ? "0" : options.ProxyPassword); + key.append(options.ProxyPassword.ValueOr("0")); key.append(","); key.append(!options.SslOptions.EnableCertificateRevocationListCheck ? "1" : "0"); key.append(","); @@ -2099,13 +2099,13 @@ CurlConnection::CurlConnection( + std::string(curl_easy_strerror(result))); } } - if (!options.ProxyPassword.empty()) + if (options.ProxyPassword.HasValue()) { - if (!SetLibcurlOption(m_handle, CURLOPT_PROXYPASSWORD, options.ProxyPassword.c_str(), &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_PROXYPASSWORD, options.ProxyPassword.Value().c_str(), &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName - + ". Failed to set proxy password to:" + options.ProxyPassword + ". " + + ". Failed to set proxy password to:" + options.ProxyPassword.Value() + ". " + std::string(curl_easy_strerror(result))); } } diff --git a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp index fb805080fb..d4f50651ac 100644 --- a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp @@ -366,7 +366,7 @@ namespace Azure { namespace Core { namespace Http { Azure::Nullable m_httpProxy; std::string m_httpProxyUser; - std::string m_httpProxyPassword; + Azure::Nullable m_httpProxyPassword; /** * @brief Implement #Azure::Core::IO::BodyStream::OnRead(). Calling this function pulls data diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index f2d9e4eec8..2fa5625dfa 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -26,7 +26,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa bool AnyTransportOptionsSpecified(TransportOptions const& transportOptions) { return ( - transportOptions.HttpProxy.HasValue() || !transportOptions.ProxyPassword.empty() + transportOptions.HttpProxy.HasValue() || transportOptions.ProxyPassword.HasValue() || !transportOptions.ProxyUserName.empty() || transportOptions.EnableCertificateRevocationListCheck || !transportOptions.ExpectedTlsRootCertificate.empty()); @@ -112,18 +112,12 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa { CurlTransportOptions curlOptions; curlOptions.EnableCurlTracing = true; - if (transportOptions.HttpProxy.HasValue()) - { - curlOptions.Proxy = transportOptions.HttpProxy; - } + curlOptions.Proxy = transportOptions.HttpProxy; if (!transportOptions.ProxyUserName.empty()) { curlOptions.ProxyUsername = transportOptions.ProxyUserName; } - if (!transportOptions.ProxyPassword.empty()) - { - curlOptions.ProxyPassword = transportOptions.ProxyPassword; - } + curlOptions.ProxyPassword = transportOptions.ProxyPassword; curlOptions.SslOptions.EnableCertificateRevocationListCheck = transportOptions.EnableCertificateRevocationListCheck; diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index feadd948b2..fc8defea6e 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -613,14 +613,14 @@ _detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( GetErrorAndThrow("Error while setting Proxy information."); } } - if (!m_options.ProxyUserName.empty() || !m_options.ProxyPassword.empty()) + if (!m_options.ProxyUserName.empty() || m_options.ProxyPassword.HasValue()) { if (!WinHttpSetCredentials( request.get(), WINHTTP_AUTH_TARGET_PROXY, WINHTTP_AUTH_SCHEME_BASIC, StringToWideString(m_options.ProxyUserName).c_str(), - StringToWideString(m_options.ProxyPassword).c_str(), + StringToWideString(m_options.ProxyPassword.Value()).c_str(), 0)) { GetErrorAndThrow("Error while setting Proxy credentials."); diff --git a/sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 index 55f3aea841..5b46f90c36 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 +++ b/sdk/core/azure-core/test/ut/proxy_tests/builddocker.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + pushd .\localproxy docker build -t squid-local . popd diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile index 45bd84dfa5..1f6e67252f 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd/Dockerfile @@ -1,5 +1,6 @@ #@# vim: set filetype=dockerfile: -# Code taken from: https://github.com/hinata/nginx-forward-proxy +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT FROM ubuntu/squid LABEL maintainer "Larry Osterman" diff --git a/sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile index dafba7640a..92bc800781 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile +++ b/sdk/core/azure-core/test/ut/proxy_tests/localproxy/Dockerfile @@ -1,5 +1,6 @@ #@# vim: set filetype=dockerfile: -# Code taken from: https://github.com/hinata/nginx-forward-proxy +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT FROM ubuntu/squid LABEL maintainer "Larry Osterman" diff --git a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile index 4bfef7bd1d..b040f26230 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile +++ b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy.passwd/Dockerfile @@ -1,5 +1,6 @@ #@# vim: set filetype=dockerfile: -# Code taken from: https://github.com/hinata/nginx-forward-proxy +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT FROM ubuntu/squid LABEL maintainer "Larry Osterman" diff --git a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile index dafba7640a..92bc800781 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile +++ b/sdk/core/azure-core/test/ut/proxy_tests/remoteproxy/Dockerfile @@ -1,5 +1,6 @@ #@# vim: set filetype=dockerfile: -# Code taken from: https://github.com/hinata/nginx-forward-proxy +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT FROM ubuntu/squid LABEL maintainer "Larry Osterman" diff --git a/sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 index 6d91729520..8de008e4ed 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 +++ b/sdk/core/azure-core/test/ut/proxy_tests/run_wsl_proxy.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + # cspell: words auxf wsl sudo apt-get -y install squid if (!$?) { diff --git a/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 index bb2db511d6..b3ca689f77 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 +++ b/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 @@ -1,2 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + docker run --rm -d -p 3128:3128 squid-local docker run --rm -d -p 3129:3129 squid-local.passwd diff --git a/sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 b/sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 index 1ac3d7b826..49b7ebc131 100644 --- a/sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 +++ b/sdk/core/azure-core/test/ut/proxy_tests/verify_proxy.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + Write-Host 'EnvVar: ' $env:ANONYMOUSCONTAINERIPV4ADDRESS Write-Host 'EnvVar: ' $env:AUTHENTICATEDCONTAINERIPV4ADDRESS if ($env:ANONYMOUSCONTAINERIPV4ADDRESS -ne $null) { diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index f23f07d776..4982f64102 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -46,8 +46,7 @@ stages: - pwsh: | docker build -t squid-local $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy docker build -t squid-local.passwd $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/localproxy.passwd - docker run --rm -d -p 3128:3128 squid-local - docker run --rm -d -p 3129:3129 squid-local.passwd + $(Build.SourcesDirectory)/sdk/core/azure-core/test/ut/proxy_tests/runproxy.ps1 displayName: Launch Linux Docker container proxy # If we're on Ubuntu and running proxy tests, build and launch a local squid proxy condition: and(succeeded(), contains(variables['Agent.OS'], 'linux'), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) @@ -72,7 +71,8 @@ stages: parameters: runProxy: true targetVersion: 1.0.0-dev.20220810.2 - + condition: and(succeeded(), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + PostTestSteps: - pwsh: | docker ps -q -f ancestor=ubuntu/squid | ForEach-Object { ` From be8102bdc611650904704ca1646b4d4a45033854 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 12:17:08 -0700 Subject: [PATCH 32/75] clang-format --- sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp | 5 +++-- sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp | 4 ++-- sdk/core/azure-core/src/http/curl/curl.cpp | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index d46d04cb82..fe814fe692 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -102,7 +102,8 @@ namespace Azure { namespace Core { namespace Http { * @remark No validation for the string is done by the Azure SDK. More about this option: * https://curl.se/libcurl/c/CURLOPT_PROXYPASSWORD.html. * - * @remark If a value is provided, the value will be used (this allows the caller to provide an empty password) + * @remark If a value is provided, the value will be used (this allows the caller to provide an + * empty password) * */ Azure::Nullable ProxyPassword; @@ -206,7 +207,7 @@ namespace Azure { namespace Core { namespace Http { * [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; /** diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 65cf3985e3..82c635ba3d 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -142,8 +142,8 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { /** * @brief The URL for the proxy server to use for this connection. * - * @remark If an empty string is specified, it instructs the transport to disable all proxies, including - * system proxies. + * @remark If an empty string is specified, it instructs the transport to disable all proxies, + * including system proxies. */ Azure::Nullable HttpProxy{}; diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 775e1553d7..978c4986d1 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -2101,7 +2101,8 @@ CurlConnection::CurlConnection( } if (options.ProxyPassword.HasValue()) { - if (!SetLibcurlOption(m_handle, CURLOPT_PROXYPASSWORD, options.ProxyPassword.Value().c_str(), &result)) + if (!SetLibcurlOption( + m_handle, CURLOPT_PROXYPASSWORD, options.ProxyPassword.Value().c_str(), &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName From 7d8333b63b5ade7cbef76880b8407655afc54e90 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 13:01:31 -0700 Subject: [PATCH 33/75] Changed condition for testProxy --- sdk/core/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 4982f64102..f2bdf66a43 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -71,7 +71,7 @@ stages: parameters: runProxy: true targetVersion: 1.0.0-dev.20220810.2 - condition: and(succeeded(), variables.RunProxyTests, contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) + condition: and(succeeded(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON')) PostTestSteps: - pwsh: | From 5d3aaee34d788b8fa531629662d2059b3ffbcae0 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 13:02:48 -0700 Subject: [PATCH 34/75] Update sdk/core/azure-core/CHANGELOG.md Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index b85ac10776..b1d5aeda1f 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -9,7 +9,7 @@ - Added the ability to set the expected TLS root certificate for TLS connection (useful if a proxy server uses a TLS certificate that is not chained to a known root). - Added the ability to enable TLS certificate revocation list checks (off by default). - For LibCURL only: Allow TLS connection to succeed if CRL retrieval fails. - - *NOTE*: This change only applies if LibCURL is built using the OpenSSL crypto backend. It does NOT apply if LibCURL uses the schannel (Windows default) or SecureTransport (Mac/iOS default). + - *NOTE*: This change only applies if libcurl is built using the OpenSSL crypto backend. It does NOT apply if libcurl uses the schannel (Windows default) or SecureTransport (macOS/iOS default). ### Breaking Changes From 324358a96cd492cee25f7fe27a932758fcb6401f Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 13:05:00 -0700 Subject: [PATCH 35/75] Update sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index fe814fe692..8c1268f0de 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -46,7 +46,7 @@ namespace Azure { namespace Core { namespace Http { * @brief This option allows SSL connections to proceed even if there is an error retrieving the * Certificate Revocation List. * - * @remark Note that this only works when LibCURL is configured to use openssl as its TLS + * @remark Note that this only works when libcurl is configured to use OpenSSL as its TLS * provider. That functionally limits this check to Linux only, and only when openssl is * configured (the default). */ From a2e799fca52a7c23d111c722138a7acafd6adb1c Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 13:05:13 -0700 Subject: [PATCH 36/75] Update sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index 8c1268f0de..d5ec9d3c85 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -171,7 +171,7 @@ namespace Azure { namespace Core { namespace Http { std::chrono::milliseconds ConnectionTimeout = _detail::DefaultConnectionTimeout; /** - * @brief If set, enables extended tracing from LibCURL. + * @brief If set, enables extended tracing from libcurl. */ bool EnableCurlTracing = false; }; From d273b0086602ede0d6794a9c3febcd148a134997 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 16:51:14 -0700 Subject: [PATCH 37/75] Update sdk/core/azure-core/CMakeLists.txt Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index 8a2a6e711b..63df092d49 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -42,7 +42,7 @@ 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 - ) + ) SET(CURL_TRANSPORT_ADAPTER_INC inc/azure/core/http/curl_transport.hpp ) From 7da862fa310b4e01fed5b7c14248d14c5c5173fa Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 16:51:38 -0700 Subject: [PATCH 38/75] Update sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index d5ec9d3c85..cb8cd89cb8 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -38,7 +38,7 @@ namespace Azure { namespace Core { namespace Http { * * @remark Libcurl does revocation list check by default for SSL backends that supports this * feature. However, the Azure SDK overrides libcurl's behavior and disables the revocation list - * check by default. This ensures that the LibCURL behavior matches the WinHTTP behavior. + * check by default. This ensures that the libcurl behavior matches the WinHTTP behavior. */ bool EnableCertificateRevocationListCheck = false; From b233fbf0b9bf3a180e18e862047769963f370e74 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Wed, 28 Sep 2022 17:07:19 -0700 Subject: [PATCH 39/75] Code Review feedback --- sdk/core/azure-core/inc/azure/core/base64.hpp | 2 +- .../azure/core/http/win_http_transport.hpp | 21 +++++++++---------- sdk/core/azure-core/src/http/curl/curl.cpp | 16 +++++++------- .../src/http/curl/curl_connection_private.hpp | 5 ++--- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/base64.hpp b/sdk/core/azure-core/inc/azure/core/base64.hpp index b5262e7a94..6f65a0b78d 100644 --- a/sdk/core/azure-core/inc/azure/core/base64.hpp +++ b/sdk/core/azure-core/inc/azure/core/base64.hpp @@ -72,7 +72,7 @@ namespace Azure { namespace Core { * @brief Encodes a string using Base64 encoding. * * @param data The input string that contains data to be encoded. - * @return The Base64 encoded contents of the vector. + * @return The Base64 encoded contents of the string. */ static std::string Base64Encode(const std::string& data); }; diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 864be05d2e..639a3c002b 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -40,7 +40,7 @@ namespace Azure { namespace Core { namespace Http { constexpr static size_t MaximumUploadChunkSize = 1024 * 1024; // unique_ptr class wrapping an HINTERNET handle - class HINTERNET_deleter { + class HINTERNET_Deleter { public: void operator()(HINTERNET handle) noexcept { @@ -50,10 +50,10 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_HINTERNET = std::unique_ptr; + using unique_HINTERNET = std::unique_ptr; // unique_ptr class wrapping a PCCERT_CHAIN_CONTEXT - struct HCERTIFICATECHAIN_deleter + struct HCERTIFICATECHAIN_Deleter { void operator()(PCCERT_CHAIN_CONTEXT handle) { @@ -64,10 +64,10 @@ namespace Azure { namespace Core { namespace Http { } }; using unique_CCERT_CHAIN_CONTEXT - = std::unique_ptr; + = std::unique_ptr; // unique_ptr class wrapping an HCERTCHAINENGINE handle - struct HCERTCHAINENGINE_deleter + struct HCERTCHAINENGINE_Deleter { void operator()(HCERTCHAINENGINE handle) noexcept { @@ -77,10 +77,10 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_HCERTCHAINENGINE = std::unique_ptr; + using unique_HCERTCHAINENGINE = std::unique_ptr; // unique_ptr class wrapping an HCERTSTORE handle - struct HCERTSTORE_deleter + struct HCERTSTORE_Deleter { public: void operator()(HCERTSTORE handle) noexcept @@ -91,10 +91,10 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_HCERTSTORE = std::unique_ptr; + using unique_HCERTSTORE = std::unique_ptr; // unique_ptr class wrapping a PCCERT_CONTEXT - struct CERTCONTEXT_deleter + struct CERTCONTEXT_Deleter { public: void operator()(PCCERT_CONTEXT handle) noexcept @@ -105,7 +105,7 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_PCCERT_CONTEXT = std::unique_ptr; + using unique_PCCERT_CONTEXT = std::unique_ptr; class WinHttpStream final : public Azure::Core::IO::BodyStream { private: @@ -284,7 +284,6 @@ namespace Azure { namespace Core { namespace Http { // Callback to allow a derived transport to extract the request handle. Used for WebSocket // transports. - protected: virtual void OnUpgradedConnection(_detail::unique_HINTERNET const&){}; /** * @brief Throw an exception based on the Win32 Error code diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 978c4986d1..799a44f4b1 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -1118,9 +1118,7 @@ size_t CurlSession::ResponseBufferParser::Parse( { // Should never happen that parser is not statusLIne or Headers and we still try // to parse more. - // LCOV_EXCL_START - AZURE_UNREACHABLE_CODE(); - // LCOV_EXCL_STOP + AZURE_UNREACHABLE_CODE(); // LCOV_EXCL_LINE } // clean internal buffer this->m_internalBuffer.clear(); @@ -1158,9 +1156,7 @@ size_t CurlSession::ResponseBufferParser::Parse( { // Should never happen that parser is not statusLIne or Headers and we still try // to parse more. - // LCOV_EXCL_START - AZURE_UNREACHABLE_CODE(); - // LCOV_EXCL_STOP + AZURE_UNREACHABLE_CODE();// LCOV_EXCL_LINE } } } @@ -1200,7 +1196,9 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption key.append(","); key.append(!options.CAInfo.empty() ? options.CAInfo : "0"); key.append(","); - key.append(options.Proxy.ValueOr("NoProxy")); + key.append( + options.Proxy.HasValue() ? (options.Proxy.Value().empty() ? "NoProxy" : options.Proxy.Value()) + : "0"); key.append(","); key.append(options.ProxyUsername.empty() ? "0" : options.ProxyUsername); key.append(","); @@ -2000,9 +1998,9 @@ CurlConnection::CurlConnection( CurlTransportOptions const& options, std::string const& hostDisplayName, std::string const& connectionPropertiesKey) - : m_connectionKey(std::move(connectionPropertiesKey)) + : m_connectionKey(connectionPropertiesKey) { - m_handle = _detail::unique_CURL(curl_easy_init(), _detail::CURL_deleter{}); + m_handle = _detail::unique_CURL(curl_easy_init(), _detail::CURL_Deleter{}); if (!m_handle) { throw Azure::Core::Http::TransportException( diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index 3ba221cff3..f454d67367 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -53,8 +53,7 @@ namespace Azure { namespace Core { namespace Http { * @brief std::default_delete for the CURL * type , used for std::unique_ptr * */ - class CURL_deleter { - public: + struct CURL_Deleter { void operator()(CURL* handle) noexcept { if (handle != nullptr) @@ -63,7 +62,7 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_CURL = std::unique_ptr; + using unique_CURL = std::unique_ptr; } // namespace _detail From 3e464f791b5429a02bd07230fcc13e36a889c66c Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Thu, 29 Sep 2022 11:25:37 -0700 Subject: [PATCH 40/75] Update sdk/core/azure-core/CHANGELOG.md Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index b1d5aeda1f..c84853d5b4 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -8,7 +8,7 @@ - Added universal support for several TLS options: - Added the ability to set the expected TLS root certificate for TLS connection (useful if a proxy server uses a TLS certificate that is not chained to a known root). - Added the ability to enable TLS certificate revocation list checks (off by default). - - For LibCURL only: Allow TLS connection to succeed if CRL retrieval fails. + - For libcurl only: Allow TLS connection to succeed if CRL retrieval fails. - *NOTE*: This change only applies if libcurl is built using the OpenSSL crypto backend. It does NOT apply if libcurl uses the schannel (Windows default) or SecureTransport (macOS/iOS default). ### Breaking Changes From 36456624909cb58329f19eca6ae73efb2b8bbf32 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Thu, 29 Sep 2022 16:26:51 -0700 Subject: [PATCH 41/75] Renamed _detail::unique_xxx to _detail::Uniquexxx --- .../azure/core/http/win_http_transport.hpp | 71 +++++++++------ sdk/core/azure-core/src/http/curl/curl.cpp | 2 +- .../src/http/curl/curl_connection_private.hpp | 6 +- .../src/http/winhttp/win_http_transport.cpp | 86 +++++++++---------- 4 files changed, 87 insertions(+), 78 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 639a3c002b..d0a08fb917 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -23,7 +23,6 @@ #define NOMINMAX #endif #include - #endif #include @@ -40,7 +39,7 @@ namespace Azure { namespace Core { namespace Http { constexpr static size_t MaximumUploadChunkSize = 1024 * 1024; // unique_ptr class wrapping an HINTERNET handle - class HINTERNET_Deleter { + class DeleteHINTERNET { public: void operator()(HINTERNET handle) noexcept { @@ -50,10 +49,12 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_HINTERNET = std::unique_ptr; - + /** + * @brief unique_ptr class wrapping an HINTERNET handle + */ + using UniqueHINTERNET = std::unique_ptr; // unique_ptr class wrapping a PCCERT_CHAIN_CONTEXT - struct HCERTIFICATECHAIN_Deleter + struct DeleteHCERTIFICATECHAIN { void operator()(PCCERT_CHAIN_CONTEXT handle) { @@ -63,11 +64,15 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_CCERT_CHAIN_CONTEXT - = std::unique_ptr; + + /** + * @brief unique_ptr class wrapping a "const CERT_CHAIN_CONTEXT" pointer. + */ + using UniqueCCERT_CHAIN_CONTEXT + = std::unique_ptr; // unique_ptr class wrapping an HCERTCHAINENGINE handle - struct HCERTCHAINENGINE_Deleter + struct DeleteHCERTCHAINENGINE { void operator()(HCERTCHAINENGINE handle) noexcept { @@ -77,10 +82,14 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_HCERTCHAINENGINE = std::unique_ptr; + + /** + * @brief unique_ptr class wrapping a "HCERTCHAINENGINE" handle. + */ + using UniqueHCERTCHAINENGINE = std::unique_ptr; // unique_ptr class wrapping an HCERTSTORE handle - struct HCERTSTORE_Deleter + struct DeleteHCERTSTORE { public: void operator()(HCERTSTORE handle) noexcept @@ -91,10 +100,13 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_HCERTSTORE = std::unique_ptr; + /** + * @brief unique_ptr class wrapping a "HCERTSTORE" handle. + */ + using UniqueHCERTSTORE = std::unique_ptr; // unique_ptr class wrapping a PCCERT_CONTEXT - struct CERTCONTEXT_Deleter + struct DeleteCERTCONTEXT { public: void operator()(PCCERT_CONTEXT handle) noexcept @@ -105,11 +117,14 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_PCCERT_CONTEXT = std::unique_ptr; + /** + * @brief unique_ptr class wrapping a "PCCERT_CONTEXT" object. + */ + using UniquePCCERT_CONTEXT = std::unique_ptr; class WinHttpStream final : public Azure::Core::IO::BodyStream { private: - _detail::unique_HINTERNET m_requestHandle; + _detail::UniqueHINTERNET m_requestHandle; bool m_isEOF; /** @@ -139,7 +154,7 @@ namespace Azure { namespace Core { namespace Http { size_t OnRead(uint8_t* buffer, size_t count, Azure::Core::Context const& context) override; public: - WinHttpStream(_detail::unique_HINTERNET& requestHandle, int64_t contentLength) + WinHttpStream(_detail::UniqueHINTERNET& requestHandle, int64_t contentLength) : m_requestHandle(std::move(requestHandle)), m_contentLength(contentLength), m_isEOF(false), m_streamTotalRead(0) { @@ -224,34 +239,34 @@ namespace Azure { namespace Core { namespace Http { // This should remain immutable and not be modified after calling the ctor, to avoid threading // issues. - _detail::unique_HINTERNET m_sessionHandle; + _detail::UniqueHINTERNET m_sessionHandle; bool m_requestHandleClosed{false}; - _detail::unique_HINTERNET CreateSessionHandle(); - _detail::unique_HINTERNET CreateConnectionHandle( + _detail::UniqueHINTERNET CreateSessionHandle(); + _detail::UniqueHINTERNET CreateConnectionHandle( Azure::Core::Url const& url, Azure::Core::Context const& context); - _detail::unique_HINTERNET CreateRequestHandle( - _detail::unique_HINTERNET const& connectionHandle, + _detail::UniqueHINTERNET CreateRequestHandle( + _detail::UniqueHINTERNET const& connectionHandle, Azure::Core::Url const& url, Azure::Core::Http::HttpMethod const& method); void Upload( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, Azure::Core::Http::Request& request, Azure::Core::Context const& context); void SendRequest( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, Azure::Core::Http::Request& request, Azure::Core::Context const& context); void ReceiveResponse( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, Azure::Core::Context const& context); int64_t GetContentLength( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, HttpMethod requestMethod, HttpStatusCode responseStatusCode); std::unique_ptr SendRequestAndGetResponse( - _detail::unique_HINTERNET& requestHandle, + _detail::UniqueHINTERNET& requestHandle, HttpMethod requestMethod); /* @@ -274,17 +289,17 @@ namespace Azure { namespace Core { namespace Http { */ bool AddCertificatesToStore( std::vector const& trustedCertificates, - _detail::unique_HCERTSTORE const& hCertStore); + _detail::UniqueHCERTSTORE const& hCertStore); /* * Verifies that the certificate context is in the trustedCertificates set of certificates. */ bool VerifyCertificatesInChain( std::vector const& trustedCertificates, - _detail::unique_PCCERT_CONTEXT const& serverCertificate); + _detail::UniquePCCERT_CONTEXT const& serverCertificate); // Callback to allow a derived transport to extract the request handle. Used for WebSocket // transports. - virtual void OnUpgradedConnection(_detail::unique_HINTERNET const&){}; + virtual void OnUpgradedConnection(_detail::UniqueHINTERNET const&){}; /** * @brief Throw an exception based on the Win32 Error code * diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 799a44f4b1..0b077698e9 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -2000,7 +2000,7 @@ CurlConnection::CurlConnection( std::string const& connectionPropertiesKey) : m_connectionKey(connectionPropertiesKey) { - m_handle = _detail::unique_CURL(curl_easy_init(), _detail::CURL_Deleter{}); + m_handle = _detail::unique_CURL(curl_easy_init(), _detail::CURLDeleter{}); if (!m_handle) { throw Azure::Core::Http::TransportException( diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index f454d67367..b8fe8ed040 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -53,7 +53,8 @@ namespace Azure { namespace Core { namespace Http { * @brief std::default_delete for the CURL * type , used for std::unique_ptr * */ - struct CURL_Deleter { + struct DeleteCURL + { void operator()(CURL* handle) noexcept { if (handle != nullptr) @@ -62,8 +63,7 @@ namespace Azure { namespace Core { namespace Http { } } }; - using unique_CURL = std::unique_ptr; - + using UniqueCURL = std::unique_ptr; } // namespace _detail /** diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index fc8defea6e..e841131723 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -209,7 +209,7 @@ std::string GetHeadersAsString(Azure::Core::Http::Request const& request) // For each certificate specified in trustedCertificate, add to certificateStore. bool WinHttpTransport::AddCertificatesToStore( std::vector const& trustedCertificates, - _detail::unique_HCERTSTORE const& certificateStore) + _detail::UniqueHCERTSTORE const& certificateStore) { for (auto const& trustedCertificate : trustedCertificates) { @@ -233,7 +233,7 @@ bool WinHttpTransport::AddCertificatesToStore( // chains up to the PEM represented by trustedCertificate or not. bool WinHttpTransport::VerifyCertificatesInChain( std::vector const& trustedCertificates, - _detail::unique_PCCERT_CONTEXT const& serverCertificate) + _detail::UniquePCCERT_CONTEXT const& serverCertificate) { if ((trustedCertificates.empty()) || !serverCertificate) { @@ -241,7 +241,7 @@ bool WinHttpTransport::VerifyCertificatesInChain( } // Creates an in-memory certificate store that is destroyed at end of this function. - _detail::unique_HCERTSTORE certificateStore(CertOpenStore( + _detail::UniqueHCERTSTORE certificateStore(CertOpenStore( CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, @@ -259,7 +259,7 @@ bool WinHttpTransport::VerifyCertificatesInChain( return false; } - _detail::unique_HCERTCHAINENGINE certificateChainEngine; + _detail::UniqueHCERTCHAINENGINE certificateChainEngine; { CERT_CHAIN_ENGINE_CONFIG EngineConfig{}; EngineConfig.cbSize = sizeof(EngineConfig); @@ -276,7 +276,7 @@ bool WinHttpTransport::VerifyCertificatesInChain( // Generate a certificate chain using the local chain engine and the certificate store containing // the trusted certificates. - _detail::unique_CCERT_CHAIN_CONTEXT chainContextToVerify; + _detail::UniqueCCERT_CHAIN_CONTEXT chainContextToVerify; { CERT_CHAIN_PARA ChainPara{}; ChainPara.cbSize = sizeof(ChainPara); @@ -386,7 +386,7 @@ void WinHttpTransport::OnHttpStatusOperation(HINTERNET hInternet, DWORD dwIntern AZURE_ASSERT(!m_options.ExpectedTlsRootCertificates.empty()); // Ask WinHTTP for the server certificate - this won't be valid outside a status callback. - _detail::unique_PCCERT_CONTEXT serverCertificate; + _detail::UniquePCCERT_CONTEXT serverCertificate; { PCCERT_CONTEXT certContext; DWORD bufferLength = sizeof(certContext); @@ -442,21 +442,19 @@ void WinHttpTransport::GetErrorAndThrow(const std::string& exceptionMessage, DWO throw Azure::Core::Http::TransportException(errorMessage); } -_detail::unique_HINTERNET WinHttpTransport::CreateSessionHandle() +_detail::UniqueHINTERNET WinHttpTransport::CreateSessionHandle() { // Use WinHttpOpen to obtain a session handle. // The dwFlags is set to 0 - all WinHTTP functions are performed synchronously. - _detail::unique_HINTERNET sessionHandle( - WinHttpOpen( - NULL, // Do not use a fallback user-agent string, and only rely on the header within the - // request itself. - // If the customer asks for it, enable use of the system default HTTP proxy. - (m_options.EnableSystemDefaultProxy ? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY - : WINHTTP_ACCESS_TYPE_NO_PROXY), - WINHTTP_NO_PROXY_NAME, - WINHTTP_NO_PROXY_BYPASS, - 0), - _detail::HINTERNET_deleter{}); + _detail::UniqueHINTERNET sessionHandle(WinHttpOpen( + NULL, // Do not use a fallback user-agent string, and only rely on the header within the + // request itself. + // If the customer asks for it, enable use of the system default HTTP proxy. + (m_options.EnableSystemDefaultProxy ? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY + : WINHTTP_ACCESS_TYPE_NO_PROXY), + WINHTTP_NO_PROXY_NAME, + WINHTTP_NO_PROXY_BYPASS, + 0)); if (!sessionHandle) { @@ -516,7 +514,7 @@ WinHttpTransport::WinHttpTransport(WinHttpTransportOptions const& options) { } -_detail::unique_HINTERNET WinHttpTransport::CreateConnectionHandle( +_detail::UniqueHINTERNET WinHttpTransport::CreateConnectionHandle( Azure::Core::Url const& url, Azure::Core::Context const& context) { @@ -527,13 +525,11 @@ _detail::unique_HINTERNET WinHttpTransport::CreateConnectionHandle( // Specify an HTTP server. // This function always operates synchronously. - _detail::unique_HINTERNET rv( - WinHttpConnect( - m_sessionHandle.get(), - StringToWideString(url.GetHost()).c_str(), - port == 0 ? INTERNET_DEFAULT_PORT : port, - 0), - _detail::HINTERNET_deleter{}); + _detail::UniqueHINTERNET rv(WinHttpConnect( + m_sessionHandle.get(), + StringToWideString(url.GetHost()).c_str(), + port == 0 ? INTERNET_DEFAULT_PORT : port, + 0)); if (!rv) { @@ -550,8 +546,8 @@ _detail::unique_HINTERNET WinHttpTransport::CreateConnectionHandle( return rv; } -_detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( - _detail::unique_HINTERNET const& connectionHandle, +_detail::UniqueHINTERNET WinHttpTransport::CreateRequestHandle( + _detail::UniqueHINTERNET const& connectionHandle, Azure::Core::Url const& url, Azure::Core::Http::HttpMethod const& method) { @@ -564,17 +560,15 @@ _detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( url.GetScheme(), WebSocketScheme)); // Create an HTTP request handle. - _detail::unique_HINTERNET request( - WinHttpOpenRequest( - connectionHandle.get(), - HttpMethodToWideString(requestMethod).c_str(), - path.empty() ? NULL : StringToWideString(path).c_str(), // Name of the target resource of - // the specified HTTP verb - NULL, // Use HTTP/1.1 - WINHTTP_NO_REFERER, - WINHTTP_DEFAULT_ACCEPT_TYPES, // No media types are accepted by the client - requestSecureHttp ? WINHTTP_FLAG_SECURE : 0), - _detail::HINTERNET_deleter{}); // Uses secure transaction semantics (SSL/TLS) + _detail::UniqueHINTERNET request(WinHttpOpenRequest( + connectionHandle.get(), + HttpMethodToWideString(requestMethod).c_str(), + path.empty() ? NULL : StringToWideString(path).c_str(), // Name of the target resource of + // the specified HTTP verb + NULL, // Use HTTP/1.1 + WINHTTP_NO_REFERER, + WINHTTP_DEFAULT_ACCEPT_TYPES, // No media types are accepted by the client + requestSecureHttp ? WINHTTP_FLAG_SECURE : 0)); // Uses secure transaction semantics (SSL/TLS) if (!request) { // Errors include: @@ -661,7 +655,7 @@ _detail::unique_HINTERNET WinHttpTransport::CreateRequestHandle( // For PUT/POST requests, send additional data using WinHttpWriteData. void WinHttpTransport::Upload( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, Azure::Core::Http::Request& request, Azure::Core::Context const& context) { @@ -701,7 +695,7 @@ void WinHttpTransport::Upload( } void WinHttpTransport::SendRequest( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, Azure::Core::Http::Request& request, Azure::Core::Context const& context) { @@ -769,7 +763,7 @@ void WinHttpTransport::SendRequest( } void WinHttpTransport::ReceiveResponse( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, Azure::Core::Context const& context) { context.ThrowIfCancelled(); @@ -792,7 +786,7 @@ void WinHttpTransport::ReceiveResponse( } int64_t WinHttpTransport::GetContentLength( - _detail::unique_HINTERNET const& requestHandle, + _detail::UniqueHINTERNET const& requestHandle, HttpMethod requestMethod, HttpStatusCode responseStatusCode) { @@ -828,7 +822,7 @@ int64_t WinHttpTransport::GetContentLength( } std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( - _detail::unique_HINTERNET& requestHandle, + _detail::UniqueHINTERNET& requestHandle, HttpMethod requestMethod) { // First, use WinHttpQueryHeaders to obtain the size of the buffer. @@ -966,8 +960,8 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( std::unique_ptr WinHttpTransport::Send(Request& request, Context const& context) { - _detail::unique_HINTERNET connectionHandle = CreateConnectionHandle(request.GetUrl(), context); - _detail::unique_HINTERNET requestHandle + _detail::UniqueHINTERNET connectionHandle = CreateConnectionHandle(request.GetUrl(), context); + _detail::UniqueHINTERNET requestHandle = CreateRequestHandle(connectionHandle, request.GetUrl(), request.GetMethod()); try { From 8fe482a85400464027da93fa0f412af77ce0f3ab Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Thu, 29 Sep 2022 16:35:40 -0700 Subject: [PATCH 42/75] Build fix --- sdk/core/azure-core/src/http/curl/curl.cpp | 6 +++--- .../azure-core/src/http/curl/curl_connection_private.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 0b077698e9..2878748354 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -67,7 +67,7 @@ template #pragma warning(disable : 26812) #endif inline bool SetLibcurlOption( - Azure::Core::Http::_detail::unique_CURL const& handle, + Azure::Core::Http::_detail::UniqueCURL const& handle, CURLoption option, T value, CURLcode* outError) @@ -1156,7 +1156,7 @@ size_t CurlSession::ResponseBufferParser::Parse( { // Should never happen that parser is not statusLIne or Headers and we still try // to parse more. - AZURE_UNREACHABLE_CODE();// LCOV_EXCL_LINE + AZURE_UNREACHABLE_CODE(); // LCOV_EXCL_LINE } } } @@ -2000,7 +2000,7 @@ CurlConnection::CurlConnection( std::string const& connectionPropertiesKey) : m_connectionKey(connectionPropertiesKey) { - m_handle = _detail::unique_CURL(curl_easy_init(), _detail::CURLDeleter{}); + m_handle = _detail::UniqueCURL(curl_easy_init()); if (!m_handle) { throw Azure::Core::Http::TransportException( diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index b8fe8ed040..cac6c3e15e 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -139,7 +139,7 @@ namespace Azure { namespace Core { namespace Http { */ class CurlConnection final : public CurlNetworkConnection { private: - _detail::unique_CURL m_handle; + _detail::UniqueCURL m_handle; curl_socket_t m_curlSocket; std::chrono::steady_clock::time_point m_lastUseTime; std::string m_connectionKey; From f8075185b6d0eb5cbed9d758c91930a411f1d12a Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 09:44:02 -0700 Subject: [PATCH 43/75] Update sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index d0a08fb917..0243116ff1 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -4,8 +4,8 @@ /** * @file * @brief #Azure::Core::Http::HttpTransport implementation via WinHTTP. - * cspell:words HCERTIFICATECHAIN PCCERT CCERT HCERTCHAINENGINE HCERTSTORE */ +// cspell:words HCERTIFICATECHAIN PCCERT CCERT HCERTCHAINENGINE HCERTSTORE #pragma once From dcbfad2889b4794fe71e65d962ce0822c135e3b9 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 11:55:13 -0700 Subject: [PATCH 44/75] More code review feedback; Added UniqueHandle to simplify RAII wrappers for native types --- sdk/core/azure-core/CMakeLists.txt | 6 +- .../inc/azure/core/http/curl_transport.hpp | 3 +- .../azure/core/http/win_http_transport.hpp | 475 ++++++------- .../inc/azure/core/internal/unique_handle.hpp | 66 ++ .../src/environment_log_level_listener.cpp | 3 +- sdk/core/azure-core/src/http/curl/curl.cpp | 623 +++++++++--------- .../src/http/curl/curl_connection_private.hpp | 379 +++++------ .../azure-core/src/http/transport_policy.cpp | 8 +- .../src/http/winhttp/win_http_transport.cpp | 73 +- vcpkg.json | 3 + 10 files changed, 826 insertions(+), 813 deletions(-) create mode 100644 sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp diff --git a/sdk/core/azure-core/CMakeLists.txt b/sdk/core/azure-core/CMakeLists.txt index 63df092d49..1cb7ebae1b 100644 --- a/sdk/core/azure-core/CMakeLists.txt +++ b/sdk/core/azure-core/CMakeLists.txt @@ -36,6 +36,10 @@ if(BUILD_TRANSPORT_CURL) message("Libcurl version ${CURL_VERSION_STRING}") endif() +if(BUILD_TRANSPORT_WINHTTP) + find_package(wil CONFIG REQUIRED) +endif() + if(BUILD_TRANSPORT_CURL) SET(CURL_TRANSPORT_ADAPTER_SRC src/http/curl/curl.cpp @@ -176,7 +180,7 @@ if(BUILD_TRANSPORT_CURL) target_link_libraries(azure-core PUBLIC CURL::libcurl) endif() if(BUILD_TRANSPORT_WINHTTP) - target_link_libraries(azure-core PRIVATE winhttp) + target_link_libraries(azure-core PRIVATE winhttp WIL::WIL) endif() get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp") diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index cb8cd89cb8..d817b51d3e 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -171,7 +171,7 @@ namespace Azure { namespace Core { namespace Http { std::chrono::milliseconds ConnectionTimeout = _detail::DefaultConnectionTimeout; /** - * @brief If set, enables extended tracing from libcurl. + * @brief If set, integrates libcurls internal tracing with Azure logging. */ bool EnableCurlTracing = false; }; @@ -183,7 +183,6 @@ namespace Azure { namespace Core { namespace Http { 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. diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index d0a08fb917..b43dee5d13 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -12,6 +12,7 @@ #include "azure/core/context.hpp" #include "azure/core/http/http.hpp" #include "azure/core/http/transport.hpp" +#include "azure/core/internal/unique_handle.hpp" #include @@ -31,306 +32,242 @@ #include #include -namespace Azure { namespace Core { namespace Http { - - namespace _detail { - - constexpr static size_t DefaultUploadChunkSize = 1024 * 64; - constexpr static size_t MaximumUploadChunkSize = 1024 * 1024; - - // unique_ptr class wrapping an HINTERNET handle - class DeleteHINTERNET { - public: - void operator()(HINTERNET handle) noexcept - { - if (handle != nullptr) - { - WinHttpCloseHandle(handle); - } - } - }; +namespace Azure { namespace Core { + namespace _internal { /** - * @brief unique_ptr class wrapping an HINTERNET handle + * @brief Unique handle for WinHTTP HINTERNET handles. + * + * @note HINTERNET is declared as a "void *". THis means that this definition subsumes all other + * `void *` types when used with Azure::Core::_internal::UniqueHandle. + * */ - using UniqueHINTERNET = std::unique_ptr; - // unique_ptr class wrapping a PCCERT_CHAIN_CONTEXT - struct DeleteHCERTIFICATECHAIN + template <> struct UniqueHandleHelper { - void operator()(PCCERT_CHAIN_CONTEXT handle) - { - // unique_ptr class wrapping an HINTERNET handle - { - CertFreeCertificateChain(handle); - } - } - }; - - /** - * @brief unique_ptr class wrapping a "const CERT_CHAIN_CONTEXT" pointer. - */ - using UniqueCCERT_CHAIN_CONTEXT - = std::unique_ptr; + static void FreeHandle(HINTERNET obj) { WinHttpCloseHandle(obj); } - // unique_ptr class wrapping an HCERTCHAINENGINE handle - struct DeleteHCERTCHAINENGINE - { - void operator()(HCERTCHAINENGINE handle) noexcept - { - if (handle != nullptr) - { - CertFreeCertificateChainEngine(handle); - } - } + using type = BasicUniqueHandle; }; - - /** - * @brief unique_ptr class wrapping a "HCERTCHAINENGINE" handle. - */ - using UniqueHCERTCHAINENGINE = std::unique_ptr; - - // unique_ptr class wrapping an HCERTSTORE handle - struct DeleteHCERTSTORE - { - public: - void operator()(HCERTSTORE handle) noexcept - { - if (handle != nullptr) + } // namespace _internal + + namespace Http { + + namespace _detail { + + constexpr static size_t DefaultUploadChunkSize = 1024 * 64; + constexpr static size_t MaximumUploadChunkSize = 1024 * 1024; + + class WinHttpStream final : public Azure::Core::IO::BodyStream { + private: + Azure::Core::_internal::UniqueHandle m_requestHandle; + bool m_isEOF; + + /** + * @brief This is a copy of the value of an HTTP response header `content-length`. The value + * is received as string and parsed to size_t. This field avoids parsing the string header + * every time from HTTP RawResponse. + * + * @remark This value is also used to avoid trying to read more data from network than what + * we are expecting to. + * + * @remark A value of -1 means the transfer encoding was chunked. + * + */ + int64_t m_contentLength; + + int64_t m_streamTotalRead; + + /** + * @brief Implement #Azure::Core::IO::BodyStream::OnRead(). Calling this function pulls data + * from the wire. + * + * @param context A context to control the request lifetime. + * @param buffer Buffer where data from wire is written to. + * @param count The number of bytes to read from the network. + * @return The actual number of bytes read from the network. + */ + size_t OnRead(uint8_t* buffer, size_t count, Azure::Core::Context const& context) override; + + public: + WinHttpStream( + Azure::Core::_internal::UniqueHandle& requestHandle, + int64_t contentLength) + : m_requestHandle(std::move(requestHandle)), m_contentLength(contentLength), + m_isEOF(false), m_streamTotalRead(0) { - CertCloseStore(handle, 0); } - } - }; - /** - * @brief unique_ptr class wrapping a "HCERTSTORE" handle. - */ - using UniqueHCERTSTORE = std::unique_ptr; - // unique_ptr class wrapping a PCCERT_CONTEXT - struct DeleteCERTCONTEXT - { - public: - void operator()(PCCERT_CONTEXT handle) noexcept - { - if (handle != nullptr) - { - CertFreeCertificateContext(handle); - } - } - }; + /** + * @brief Implement #Azure::Core::IO::BodyStream length. + * + * @return The size of the payload. + */ + int64_t Length() const override { return this->m_contentLength; } + }; + } // namespace _detail + /** - * @brief unique_ptr class wrapping a "PCCERT_CONTEXT" object. + * @brief Sets the WinHTTP session and connection options used to customize the behavior of the + * transport. */ - using UniquePCCERT_CONTEXT = std::unique_ptr; + struct WinHttpTransportOptions final + { + /** + * @brief When `true`, allows an invalid certificate authority. + */ + bool IgnoreUnknownCertificateAuthority{false}; - class WinHttpStream final : public Azure::Core::IO::BodyStream { - private: - _detail::UniqueHINTERNET m_requestHandle; - bool m_isEOF; + /** + * Proxy information. + */ /** - * @brief This is a copy of the value of an HTTP response header `content-length`. The value - * is received as string and parsed to size_t. This field avoids parsing the string header - * every time from HTTP RawResponse. - * - * @remark This value is also used to avoid trying to read more data from network than what we - * are expecting to. + * @brief If True, enables the use of the system default proxy. * - * @remark A value of -1 means the transfer encoding was chunked. + * @remarks Set this to "true" if you would like to use a local HTTP proxy like "Fiddler" to + * capture and analyze HTTP traffic. * + * Set to "false" by default because it is not recommended to use a proxy for production and + * Fiddler's proxy interferes with the HTTP functional tests. */ - int64_t m_contentLength; - - int64_t m_streamTotalRead; + bool EnableSystemDefaultProxy{false}; /** - * @brief Implement #Azure::Core::IO::BodyStream::OnRead(). Calling this function pulls data - * from the wire. - * - * @param context A context to control the request lifetime. - * @param buffer Buffer where data from wire is written to. - * @param count The number of bytes to read from the network. - * @return The actual number of bytes read from the network. + * @brief If True, enables checks for certificate revocation. */ - size_t OnRead(uint8_t* buffer, size_t count, Azure::Core::Context const& context) override; - - public: - WinHttpStream(_detail::UniqueHINTERNET& requestHandle, int64_t contentLength) - : m_requestHandle(std::move(requestHandle)), m_contentLength(contentLength), - m_isEOF(false), m_streamTotalRead(0) - { - } + bool EnableCertificateRevocationListCheck{false}; /** - * @brief Implement #Azure::Core::IO::BodyStream length. + * @brief Proxy information. + * + * @remark The Proxy Information string is composed of a set of elements + * formatted as follows: + * ([=]["://"][":"]) * - * @return The size of the payload. + * Each element should be separated with semicolons or whitespace. */ - int64_t Length() const override { return this->m_contentLength; } - }; - } // namespace _detail - - /** - * @brief Sets the WinHTTP session and connection options used to customize the behavior of the - * transport. - */ - struct WinHttpTransportOptions final - { - /** - * @brief When `true`, allows an invalid certificate authority. - */ - bool IgnoreUnknownCertificateAuthority{false}; - - /** - * Proxy information. - */ - - /** - * @brief If True, enables the use of the system default proxy. - * - * @remarks Set this to "true" if you would like to use a local HTTP proxy like "Fiddler" to - * capture and analyze HTTP traffic. - * - * Set to "false" by default because it is not recommended to use a proxy for production and - * Fiddler's proxy interferes with the HTTP functional tests. - */ - bool EnableSystemDefaultProxy{false}; - - /** - * @brief If True, enables checks for certificate revocation. - */ - bool EnableCertificateRevocationListCheck{false}; + std::string ProxyInformation; - /** - * @brief Proxy information. - * - * @remark The Proxy Information string is composed of a set of elements - * formatted as follows: - * ([=]["://"][":"]) - * - * Each element should be separated with semicolons or whitespace. - */ - std::string ProxyInformation; + /** + * @brief User name for proxy authentication. + */ + std::string ProxyUserName; - /** - * @brief User name for proxy authentication. - */ - std::string ProxyUserName; + /** + * @brief Password for proxy authentication. + */ + Azure::Nullable ProxyPassword; - /** - * @brief Password for proxy authentication. - */ - Azure::Nullable ProxyPassword; + /** + * @brief Array of Base64 encoded DER encoded X.509 certificate. These certificates should + * form a chain of certificates which will be used to validate the server certificate sent by + * the server. + */ + std::vector ExpectedTlsRootCertificates; + }; /** - * @brief Array of Base64 encoded DER encoded X.509 certificate. These certificates should form - * a chain of certificates which will be used to validate the server certificate sent by the - * server. - */ - std::vector ExpectedTlsRootCertificates; - }; - - /** - * @brief Concrete implementation of an HTTP transport that uses WinHTTP when sending and - * receiving requests and responses over the wire. - */ - class WinHttpTransport : public HttpTransport { - private: - WinHttpTransportOptions m_options; - - // This should remain immutable and not be modified after calling the ctor, to avoid threading - // issues. - _detail::UniqueHINTERNET m_sessionHandle; - bool m_requestHandleClosed{false}; - - _detail::UniqueHINTERNET CreateSessionHandle(); - _detail::UniqueHINTERNET CreateConnectionHandle( - Azure::Core::Url const& url, - Azure::Core::Context const& context); - _detail::UniqueHINTERNET CreateRequestHandle( - _detail::UniqueHINTERNET const& connectionHandle, - Azure::Core::Url const& url, - Azure::Core::Http::HttpMethod const& method); - void Upload( - _detail::UniqueHINTERNET const& requestHandle, - Azure::Core::Http::Request& request, - Azure::Core::Context const& context); - void SendRequest( - _detail::UniqueHINTERNET const& requestHandle, - Azure::Core::Http::Request& request, - Azure::Core::Context const& context); - void ReceiveResponse( - _detail::UniqueHINTERNET const& requestHandle, - Azure::Core::Context const& context); - int64_t GetContentLength( - _detail::UniqueHINTERNET const& requestHandle, - HttpMethod requestMethod, - HttpStatusCode responseStatusCode); - std::unique_ptr SendRequestAndGetResponse( - _detail::UniqueHINTERNET& requestHandle, - HttpMethod requestMethod); - - /* - * Callback from WinHTTP called after the TLS certificates are received when the caller sets - * expected TLS root certificates. - */ - static void CALLBACK StatusCallback( - HINTERNET hInternet, - DWORD_PTR dwContext, - DWORD dwInternetStatus, - LPVOID lpvStatusInformation, - DWORD dwStatusInformationLength) noexcept; - /* - * Callback from WinHTTP called after the TLS certificates are received when the caller sets - * expected TLS root certificates. - */ - void OnHttpStatusOperation(HINTERNET hInternet, DWORD dwInternetStatus); - /* - * Adds the specified trusted certificates to the specified certificate store. - */ - bool AddCertificatesToStore( - std::vector const& trustedCertificates, - _detail::UniqueHCERTSTORE const& hCertStore); - /* - * Verifies that the certificate context is in the trustedCertificates set of certificates. + * @brief Concrete implementation of an HTTP transport that uses WinHTTP when sending and + * receiving requests and responses over the wire. */ - bool VerifyCertificatesInChain( - std::vector const& trustedCertificates, - _detail::UniquePCCERT_CONTEXT const& serverCertificate); + class WinHttpTransport : public HttpTransport { + private: + WinHttpTransportOptions m_options; + + // This should remain immutable and not be modified after calling the ctor, to avoid threading + // issues. + Azure::Core::_internal::UniqueHandle m_sessionHandle; + bool m_requestHandleClosed{false}; + + Azure::Core::_internal::UniqueHandle CreateSessionHandle(); + Azure::Core::_internal::UniqueHandle CreateConnectionHandle( + Azure::Core::Url const& url, + Azure::Core::Context const& context); + Azure::Core::_internal::UniqueHandle CreateRequestHandle( + Azure::Core::_internal::UniqueHandle const& connectionHandle, + Azure::Core::Url const& url, + Azure::Core::Http::HttpMethod const& method); + void Upload( + Azure::Core::_internal::UniqueHandle const& requestHandle, + Azure::Core::Http::Request& request, + Azure::Core::Context const& context); + void SendRequest( + Azure::Core::_internal::UniqueHandle const& requestHandle, + Azure::Core::Http::Request& request, + Azure::Core::Context const& context); + void ReceiveResponse( + Azure::Core::_internal::UniqueHandle const& requestHandle, + Azure::Core::Context const& context); + int64_t GetContentLength( + Azure::Core::_internal::UniqueHandle const& requestHandle, + HttpMethod requestMethod, + HttpStatusCode responseStatusCode); + std::unique_ptr SendRequestAndGetResponse( + Azure::Core::_internal::UniqueHandle& requestHandle, + HttpMethod requestMethod); + + /* + * Callback from WinHTTP called after the TLS certificates are received when the caller sets + * expected TLS root certificates. + */ + static void CALLBACK StatusCallback( + HINTERNET hInternet, + DWORD_PTR dwContext, + DWORD dwInternetStatus, + LPVOID lpvStatusInformation, + DWORD dwStatusInformationLength) noexcept; + /* + * Callback from WinHTTP called after the TLS certificates are received when the caller sets + * expected TLS root certificates. + */ + void OnHttpStatusOperation(HINTERNET hInternet, DWORD dwInternetStatus); + /* + * Adds the specified trusted certificates to the specified certificate store. + */ + bool AddCertificatesToStore( + std::vector const& trustedCertificates, + HCERTSTORE const hCertStore); + /* + * Verifies that the certificate context is in the trustedCertificates set of certificates. + */ + bool VerifyCertificatesInChain( + std::vector const& trustedCertificates, + PCCERT_CONTEXT serverCertificate); - // Callback to allow a derived transport to extract the request handle. Used for WebSocket - // transports. - virtual void OnUpgradedConnection(_detail::UniqueHINTERNET const&){}; - /** - * @brief Throw an exception based on the Win32 Error code - * - * @param exceptionMessage Message describing error. - * @param error Win32 Error code. - */ - void GetErrorAndThrow(const std::string& exceptionMessage, DWORD error = GetLastError()); + // Callback to allow a derived transport to extract the request handle. Used for WebSocket + // transports. + virtual void OnUpgradedConnection(Azure::Core::_internal::UniqueHandle const&){}; + /** + * @brief Throw an exception based on the Win32 Error code + * + * @param exceptionMessage Message describing error. + * @param error Win32 Error code. + */ + void GetErrorAndThrow(const std::string& exceptionMessage, DWORD error = GetLastError()); - public: - /** - * @brief Constructs `%WinHttpTransport`. - * - * @param options Optional parameter to override the default settings. - */ - WinHttpTransport(WinHttpTransportOptions const& options = WinHttpTransportOptions()); + public: + /** + * @brief Constructs `%WinHttpTransport`. + * + * @param options Optional parameter to override the default settings. + */ + WinHttpTransport(WinHttpTransportOptions const& options = WinHttpTransportOptions()); - /** - * @brief Implements the HTTP transport interface to send an HTTP Request and produce an HTTP - * RawResponse. - * - * @param context A context to control the request lifetime. - * @param request an HTTP request to be send. - * @return A unique pointer to an HTTP RawResponse. - */ - virtual std::unique_ptr Send(Request& request, Context const& context) override; + /** + * @brief Implements the HTTP transport interface to send an HTTP Request and produce an HTTP + * RawResponse. + * + * @param context A context to control the request lifetime. + * @param request an HTTP request to be send. + * @return A unique pointer to an HTTP RawResponse. + */ + virtual std::unique_ptr Send(Request& request, Context const& context) override; - // 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 ~WinHttpTransport() = default; - }; + // 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 ~WinHttpTransport() = default; + }; -}}} // namespace Azure::Core::Http + } // namespace Http +}} // namespace Azure::Core diff --git a/sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp b/sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp new file mode 100644 index 0000000000..a503ed17bf --- /dev/null +++ b/sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT +#pragma once +#include + +namespace Azure { namespace Core { namespace _internal { + + /** + * Helpers to provide RAII wrappers for OpenSSL, WinHTTP, CURL, and other types. + * + * These classes enable callers to wrap std::unique_ptr for arbitrary 3rd party library types. + * + * To add support for a 3rd party type, you need to define a helper structure which lets + * std::unique_ptr know how to delete the underlying object: + * + * template <> struct UniqueHandleHelper + * { + * using type = BasicUniqueHandle; + * }; + * + * Note that for some types (HINTERNET for example), the helper needs to be a bit more + * complicated: template <> struct UniqueHandleHelper + * { + * static void FreeHandle(HINTERNET obj) { WinHttpCloseHandle(obj); } + * using type = BasicUniqueHandle; + * }; + * + * This is because WinHttpCloseHandle returns a BOOL, not void, so we need to wrap the call to + * WinHttpCloseHandle(). In addition, an HINTERNET is a `void *` type, which means that the std::unique_handle + * underlying type needs to be `void`. + * + */ + + /** + * @brief std::unique_ptr deleter class which provides a specialization for a deleter function. + */ + template struct UniqueHandleDeleter + { + void operator()(T* obj) { Deleter(obj); } + }; + + /** + * @brief Inner specialization for std::unique_ptr for the + */ + template + using BasicUniqueHandle = std::unique_ptr>; + + /** + * @brief Helper template structure to wrap the map between the type and free function + * + * template <> struct UniqueHandleHelper + * { + * using type = BasicUniqueHandle; + * }; + * + * template <> struct UniqueHandleHelper + * { + * using type = BasicUniqueHandle; + * }; + */ + // *** Given just T, map it to the corresponding FreeFunc + template struct UniqueHandleHelper; + + // *** Now users can say UniqueHandle if they want: + template using UniqueHandle = typename UniqueHandleHelper::type; +}}} // namespace Azure::Core::_internal diff --git a/sdk/core/azure-core/src/environment_log_level_listener.cpp b/sdk/core/azure-core/src/environment_log_level_listener.cpp index 98ef17dcf3..a79ad911c8 100644 --- a/sdk/core/azure-core/src/environment_log_level_listener.cpp +++ b/sdk/core/azure-core/src/environment_log_level_listener.cpp @@ -115,8 +115,7 @@ EnvironmentLogLevelListener::GetLogListener() << Azure::DateTime(std::chrono::system_clock::now()) .ToString( DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits) - << " T: " << std::this_thread::get_id() << "] " << LogLevelToConsoleString(level) - << " : " << message << std::endl; + << "] " << LogLevelToConsoleString(level) << " : " << message << std::endl; }; return consoleLogger; diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 2878748354..06278b9485 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -67,7 +67,7 @@ template #pragma warning(disable : 26812) #endif inline bool SetLibcurlOption( - Azure::Core::Http::_detail::UniqueCURL const& handle, + Azure::Core::_internal::UniqueHandle const& handle, CURLoption option, T value, CURLcode* outError) @@ -829,7 +829,7 @@ void CurlSession::ReadStatusLineAndHeadersFromRawResponse( auto isTransferEncodingHeaderInResponse = headers.find("transfer-encoding"); if (isTransferEncodingHeaderInResponse != headers.end()) { - auto headerValue = isTransferEncodingHeaderInResponse->second; + auto& headerValue = isTransferEncodingHeaderInResponse->second; auto isChunked = headerValue.find("chunked"); if (isChunked != std::string::npos) @@ -1314,423 +1314,417 @@ int CurlConnection::CurlLoggingCallback(CURL*, curl_infotype type, char* data, s } return 0; } -#if !defined(AZ_PLATFORM_WINDOWS) -namespace Azure { namespace Core { namespace Http { - namespace _detail { - // Helpers to provide RAII wrappers for OpenSSL types. - template struct openssl_deleter - { - void operator()(T* obj) { Deleter(obj); } - }; - template - using basic_openssl_unique_ptr = std::unique_ptr>; +// On Windows and macOS, libcurl uses native crypto backends, this functionality depends on +// the OpenSSL backend. +#if !defined(AZ_PLATFORM_WINDOWS) && !defined(AZ_PLATFORM_MAC) +namespace Azure { namespace Core { + namespace _internal { - // *** Given just T, map it to the corresponding FreeFunc: - template struct type_map_helper; - template <> struct type_map_helper + template <> struct UniqueHandleHelper { - using type = basic_openssl_unique_ptr; + using type = BasicUniqueHandle; }; - template <> struct type_map_helper + template <> struct UniqueHandleHelper { - using type = basic_openssl_unique_ptr; + using type = BasicUniqueHandle; }; - template <> struct type_map_helper + template <> struct UniqueHandleHelper { - using type = basic_openssl_unique_ptr; + using type = BasicUniqueHandle; }; - template <> struct type_map_helper + template <> struct UniqueHandleHelper { static void FreeCrlStack(STACK_OF(X509_CRL) * obj) { sk_X509_CRL_pop_free(obj, X509_CRL_free); } - using type = basic_openssl_unique_ptr; + using type = BasicUniqueHandle; }; - // *** Now users can say openssl_unique_ptr if they want: - template using openssl_unique_ptr = typename type_map_helper::type; - - // *** Or the current solution's convenience aliases: - using openssl_bio = openssl_unique_ptr; - using openssl_x509 = openssl_unique_ptr; - using openssl_x509_crl = openssl_unique_ptr; - using openssl_x509_crl_stack = openssl_unique_ptr; - template - auto make_openssl_unique(Api& OpensslApi, Args&&... args) + auto MakeUniqueHandle(Api& OpensslApi, Args&&... args) { auto raw = OpensslApi(std::forward( args)...); // forwarding is probably unnecessary, could use const Args&... // check raw using T = std::remove_pointer_t; // no need to request T when we can see // what OpensslApi returned - return openssl_unique_ptr{raw}; + return UniqueHandle{raw}; } - - // Disable Code Coverage across GetOpenSSLError because we don't have a good way of forcing - // OpenSSL to fail. - // LCOV_EXCL_START - std::string GetOpenSSLError(std::string const& what) - { - auto bio(make_openssl_unique(BIO_new, BIO_s_mem())); - - BIO_printf(bio.get(), "Error in %hs: ", what.c_str()); - if (ERR_peek_error() != 0) - { - ERR_print_errors(bio.get()); - } - else + } // namespace _internal + namespace Http { + namespace _detail { + + // Disable Code Coverage across GetOpenSSLError because we don't have a good way of forcing + // OpenSSL to fail. + // LCOV_EXCL_START + std::string GetOpenSSLError(std::string const& what) { - BIO_printf(bio.get(), "Unknown error."); - } - - uint8_t* bioData; - long bufferSize = BIO_get_mem_data(bio.get(), &bioData); - std::string returnValue; - returnValue.resize(bufferSize); - memcpy(&returnValue[0], bioData, bufferSize); + auto bio(Azure::Core::_internal::MakeUniqueHandle(BIO_new, BIO_s_mem())); - return returnValue; - } - // LCOV_EXCL_STOP - - } // namespace _detail + BIO_printf(bio.get(), "Error in %hs: ", what.c_str()); + if (ERR_peek_error() != 0) + { + ERR_print_errors(bio.get()); + } + else + { + BIO_printf(bio.get(), "Unknown error."); + } - namespace { - // int g_ssl_crl_max_size_in_kb = 20; - /** - * @brief THe Cryptography class provides a set of basic cryptographic primatives required - * by the attestation samples. - */ + uint8_t* bioData; + long bufferSize = BIO_get_mem_data(bio.get(), &bioData); + std::string returnValue; + returnValue.resize(bufferSize); + memcpy(&returnValue[0], bioData, bufferSize); - _detail::openssl_x509_crl LoadCrlFromUrl(std::string const& url) - { - Log::Write(Logger::Level::Informational, "Load CRL from Url: " + url); - auto crl = _detail::make_openssl_unique(X509_CRL_load_http, url.c_str(), nullptr, nullptr, 5); - if (!crl) - { - Log::Write(Logger::Level::Error, _detail::GetOpenSSLError("Load CRL")); + return returnValue; } + // LCOV_EXCL_STOP - return crl; - } - - enum class CrlFormat : int - { - Http, - Asn1, - PEM, - }; + } // namespace _detail - _detail::openssl_x509_crl LoadCrl(std::string const& source, CrlFormat format) - { - _detail::openssl_x509_crl x; - _detail::openssl_bio in; + namespace { + // int g_ssl_crl_max_size_in_kb = 20; + /** + * @brief THe Cryptography class provides a set of basic cryptographic primatives required + * by the attestation samples. + */ - if (format == CrlFormat::Http) + Azure::Core::_internal::UniqueHandle LoadCrlFromUrl(std::string const& url) { - return LoadCrlFromUrl(source); - } - return x; - } + Log::Write(Logger::Level::Informational, "Load CRL from Url: " + url); + auto crl = Azure::Core::_internal::MakeUniqueHandle( + X509_CRL_load_http, url.c_str(), nullptr, nullptr, 5); + if (!crl) + { + Log::Write(Logger::Level::Error, _detail::GetOpenSSLError("Load CRL")); + } - bool IsCrlValid(X509_CRL* crl) - { - const ASN1_TIME* at = X509_CRL_get0_nextUpdate(crl); + return crl; + } - int day = -1; - int sec = -1; - if (!ASN1_TIME_diff(&day, &sec, nullptr, at)) + enum class CrlFormat : int + { + Http, + Asn1, + PEM, + }; + + Azure::Core::_internal::UniqueHandle LoadCrl( + std::string const& source, + CrlFormat format) { - Log::Write(Logger::Level::Error, "Could not check expiration"); - return false; /* Safe default, invalid */ + Azure::Core::_internal::UniqueHandle x; + Azure::Core::_internal::UniqueHandle in; + + if (format == CrlFormat::Http) + { + return LoadCrlFromUrl(source); + } + return x; } - if (day > 0 || sec > 0) + bool IsCrlValid(X509_CRL* crl) { - return true; /* Later, valid */ - } - return false; /* Before or same, invalid */ - } + const ASN1_TIME* at = X509_CRL_get0_nextUpdate(crl); - const char* GetDistributionPointUrl(DIST_POINT* dp) - { - GENERAL_NAMES* gens; - GENERAL_NAME* gen; - int i, nameType; - ASN1_STRING* uri; + int day = -1; + int sec = -1; + if (!ASN1_TIME_diff(&day, &sec, nullptr, at)) + { + Log::Write(Logger::Level::Error, "Could not check expiration"); + return false; /* Safe default, invalid */ + } - if (!dp->distpoint) - { - Log::Write(Logger::Level::Informational, "returning, dp->distpoint is null"); - return nullptr; + if (day > 0 || sec > 0) + { + return true; /* Later, valid */ + } + return false; /* Before or same, invalid */ } - if (dp->distpoint->type != 0) + const char* GetDistributionPointUrl(DIST_POINT* dp) { - Log::Write( - Logger::Level::Informational, - "returning, dp->distpoint->type is " + std::to_string(dp->distpoint->type)); - return nullptr; - } + GENERAL_NAMES* gens; + GENERAL_NAME* gen; + int i, nameType; + ASN1_STRING* uri; - gens = dp->distpoint->name.fullname; + if (!dp->distpoint) + { + Log::Write(Logger::Level::Informational, "returning, dp->distpoint is null"); + return nullptr; + } - for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) - { - gen = sk_GENERAL_NAME_value(gens, i); - uri = static_cast(GENERAL_NAME_get0_value(gen, &nameType)); + if (dp->distpoint->type != 0) + { + Log::Write( + Logger::Level::Informational, + "returning, dp->distpoint->type is " + std::to_string(dp->distpoint->type)); + return nullptr; + } - if (nameType == GEN_URI && ASN1_STRING_length(uri) > 6) + gens = dp->distpoint->name.fullname; + + for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) { - const char* uptr = reinterpret_cast(ASN1_STRING_get0_data(uri)); - if (strncmp(uptr, "http://", 7) == 0) + gen = sk_GENERAL_NAME_value(gens, i); + uri = static_cast(GENERAL_NAME_get0_value(gen, &nameType)); + + if (nameType == GEN_URI && ASN1_STRING_length(uri) > 6) { - return uptr; + const char* uptr = reinterpret_cast(ASN1_STRING_get0_data(uri)); + if (strncmp(uptr, "http://", 7) == 0) + { + return uptr; + } } } - } - - return nullptr; - } - std::mutex crl_cache_lock; - std::vector crl_cache; + return nullptr; + } - bool SaveCertificateCrlToMemory(X509* cert, _detail::openssl_x509_crl const& crl) - { - std::unique_lock lockResult(crl_cache_lock); + std::mutex crl_cache_lock; + std::vector crl_cache; - // update existing - X509_NAME* cert_issuer = cert ? X509_get_issuer_name(cert) : nullptr; - for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) + bool SaveCertificateCrlToMemory( + X509* cert, + Azure::Core::_internal::UniqueHandle const& crl) { - X509_CRL* cacheEntry = *it; - if (!cacheEntry) - { - continue; - } + std::unique_lock lockResult(crl_cache_lock); - X509_NAME* crl_issuer = X509_CRL_get_issuer(cacheEntry); - if (!crl_issuer || !cert_issuer) + // update existing + X509_NAME* cert_issuer = cert ? X509_get_issuer_name(cert) : nullptr; + for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) { - continue; + X509_CRL* cacheEntry = *it; + if (!cacheEntry) + { + continue; + } + + X509_NAME* crl_issuer = X509_CRL_get_issuer(cacheEntry); + if (!crl_issuer || !cert_issuer) + { + continue; + } + + // If we are getting a new CRL for an existing CRL, update the + // CRL with the new CRL. + if (0 == X509_NAME_cmp(crl_issuer, cert_issuer)) + { + // Bump the refcount on the new CRL before adding it to the cache. + X509_CRL_free(*it); + X509_CRL_up_ref(crl.get()); + *it = crl.get(); + return true; + } } - // If we are getting a new CRL for an existing CRL, update the - // CRL with the new CRL. - if (0 == X509_NAME_cmp(crl_issuer, cert_issuer)) + // not found, so try to find slot by purging outdated + for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) { - // Bump the refcount on the new CRL before adding it to the cache. - X509_CRL_free(*it); - X509_CRL_up_ref(crl.get()); - *it = crl.get(); - return true; + if (!*it) + { + // set new + X509_CRL_free(*it); + X509_CRL_up_ref(crl.get()); + *it = crl.get(); + return true; + } + + if (!IsCrlValid(*it)) + { + // remove stale + X509_CRL_free(*it); + X509_CRL_up_ref(crl.get()); + *it = crl.get(); + return true; + } } + + // Clone the certificate and add it to the cache. + X509_CRL_up_ref(crl.get()); + crl_cache.push_back(crl.get()); + return true; } - // not found, so try to find slot by purging outdated - for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) + Azure::Core::_internal::UniqueHandle LoadCertificateCrlFromMemory(X509* cert) { - if (!*it) - { - // set new - X509_CRL_free(*it); - X509_CRL_up_ref(crl.get()); - *it = crl.get(); - return true; - } + X509_NAME* cert_issuer = cert ? X509_get_issuer_name(cert) : nullptr; - if (!IsCrlValid(*it)) + std::unique_lock lockResult(crl_cache_lock); + + for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) { - // remove stale - X509_CRL_free(*it); - X509_CRL_up_ref(crl.get()); - *it = crl.get(); - return true; - } - } + X509_CRL* crl = *it; + if (!*it) + { + continue; + } - // Clone the certificate and add it to the cache. - X509_CRL_up_ref(crl.get()); - crl_cache.push_back(crl.get()); - return true; - } + // names don't match up. probably a hash collision + // so lets test if there is another crl on disk. + X509_NAME* crl_issuer = X509_CRL_get_issuer(crl); + if (!crl_issuer || !cert_issuer) + { + continue; + } - _detail::openssl_x509_crl LoadCertificateCrlFromMemory(X509* cert) - { - X509_NAME* cert_issuer = cert ? X509_get_issuer_name(cert) : nullptr; + if (0 != X509_NAME_cmp(crl_issuer, cert_issuer)) + { + continue; + } + + if (!IsCrlValid(crl)) + { + Log::Write(Logger::Level::Informational, "Discarding outdated CRL"); + X509_CRL_free(*it); + *it = nullptr; + continue; + } - std::unique_lock lockResult(crl_cache_lock); + X509_CRL_up_ref(crl); + return Azure::Core::_internal::UniqueHandle(crl); + } + return nullptr; + } - for (auto it = crl_cache.begin(); it != crl_cache.end(); ++it) + Azure::Core::_internal::UniqueHandle LoadCrlFromCacheAndDistributionPoint( + X509* cert, + STACK_OF(DIST_POINT) * crlDistributionPointStack) { - X509_CRL* crl = *it; - if (!*it) + int i; + + Azure::Core::_internal::UniqueHandle crl = LoadCertificateCrlFromMemory(cert); + if (crl) { - continue; + return crl; } - // names don't match up. probably a hash collision - // so lets test if there is another crl on disk. - X509_NAME* crl_issuer = X509_CRL_get_issuer(crl); - if (!crl_issuer || !cert_issuer) + // file was not found on disk cache, + // so, now loading from web. + // Walk through the possible CRL distribution points + // looking for one which has a URL that we can download. + const char* urlptr = nullptr; + for (i = 0; i < sk_DIST_POINT_num(crlDistributionPointStack); i++) { - continue; + DIST_POINT* dp = sk_DIST_POINT_value(crlDistributionPointStack, i); + + urlptr = GetDistributionPointUrl(dp); + if (urlptr) + { + // try to load from web, exit loop if + // successfully downloaded + crl = LoadCrl(urlptr, CrlFormat::Http); + if (crl) + break; + } } - if (0 != X509_NAME_cmp(crl_issuer, cert_issuer)) + if (!urlptr) { - continue; + Log::Write(Logger::Level::Error, "No CRL dist point qualified for downloading."); } - if (!IsCrlValid(crl)) + if (crl) { - Log::Write(Logger::Level::Informational, "Discarding outdated CRL"); - X509_CRL_free(*it); - *it = nullptr; - continue; + // save it to memory + SaveCertificateCrlToMemory(cert, crl); } - X509_CRL_up_ref(crl); - return _detail::openssl_x509_crl(crl); - } - return nullptr; - } - - _detail::openssl_x509_crl LoadCrlFromCacheAndDistributionPoint( - X509* cert, - STACK_OF(DIST_POINT) * crlDistributionPointStack) - { - int i; - - _detail::openssl_x509_crl crl = LoadCertificateCrlFromMemory(cert); - if (crl) - { return crl; } - // file was not found on disk cache, - // so, now loading from web. - // Walk through the possible CRL distribution points - // looking for one which has a URL that we can download. - const char* urlptr = nullptr; - for (i = 0; i < sk_DIST_POINT_num(crlDistributionPointStack); i++) + /** + * @brief Retrieve the CRL associated with the provided store context, if available. + * + */ + STACK_OF(X509_CRL) * CrlHttpCallback(const X509_STORE_CTX* context, const X509_NAME*) { - DIST_POINT* dp = sk_DIST_POINT_value(crlDistributionPointStack, i); + Azure::Core::_internal::UniqueHandle crl; + STACK_OF(DIST_POINT) * crlDistributionPoint; - urlptr = GetDistributionPointUrl(dp); - if (urlptr) + Azure::Core::_internal::UniqueHandle crlStack + = Azure::Core::_internal::UniqueHandle(sk_X509_CRL_new_null()); + if (crlStack == nullptr) { - // try to load from web, exit loop if - // successfully downloaded - crl = LoadCrl(urlptr, CrlFormat::Http); - if (crl) - break; + Log::Write(Logger::Level::Error, "Failed to allocate STACK_OF(X509_CRL)"); + return nullptr; } - } - if (!urlptr) - { - Log::Write(Logger::Level::Error, "No CRL dist point qualified for downloading."); - } + X509* currentCertificate = X509_STORE_CTX_get_current_cert(context); - if (crl) - { - // save it to memory - SaveCertificateCrlToMemory(cert, crl); - } - - return crl; - } + // try to download Crl + crlDistributionPoint = static_cast( + X509_get_ext_d2i(currentCertificate, NID_crl_distribution_points, nullptr, nullptr)); + if (!crlDistributionPoint + && X509_NAME_cmp( + X509_get_issuer_name(currentCertificate), + X509_get_subject_name(currentCertificate)) + != 0) + { + Log::Write( + Logger::Level::Error, + "No CRL distribution points defined on non self-issued cert, CRL check may fail."); + return nullptr; + } - /** - * @brief Retrieve the CRL associated with the provided store context, if available. - * - */ - STACK_OF(X509_CRL) * CrlHttpCallback(const X509_STORE_CTX* context, const X509_NAME*) - { - _detail::openssl_x509_crl crl; - STACK_OF(DIST_POINT) * crlDistributionPoint; + crl = LoadCrlFromCacheAndDistributionPoint(currentCertificate, crlDistributionPoint); - _detail::openssl_x509_crl_stack crlStack - = _detail::openssl_x509_crl_stack(sk_X509_CRL_new_null()); - if (crlStack == nullptr) - { - Log::Write(Logger::Level::Error, "Failed to allocate STACK_OF(X509_CRL)"); - return nullptr; - } + sk_DIST_POINT_pop_free(crlDistributionPoint, DIST_POINT_free); + if (!crl) + { + Log::Write(Logger::Level::Error, "Unable to retrieve CRL, CRL check may fail."); + return nullptr; + } - X509* currentCertificate = X509_STORE_CTX_get_current_cert(context); + sk_X509_CRL_push(crlStack.get(), X509_CRL_dup(crl.get())); - // try to download Crl - crlDistributionPoint = static_cast( - X509_get_ext_d2i(currentCertificate, NID_crl_distribution_points, nullptr, nullptr)); - if (!crlDistributionPoint - && X509_NAME_cmp( - X509_get_issuer_name(currentCertificate), - X509_get_subject_name(currentCertificate)) - != 0) - { - Log::Write( - Logger::Level::Error, - "No CRL distribution points defined on non self-issued cert, CRL check may fail."); - return nullptr; - } + // try to download delta Crl + crlDistributionPoint = static_cast( + X509_get_ext_d2i(currentCertificate, NID_freshest_crl, nullptr, nullptr)); + if (crlDistributionPoint != nullptr) + { + crl = LoadCrlFromCacheAndDistributionPoint(currentCertificate, crlDistributionPoint); - crl = LoadCrlFromCacheAndDistributionPoint(currentCertificate, crlDistributionPoint); + sk_DIST_POINT_pop_free(crlDistributionPoint, DIST_POINT_free); + if (crl) + { + sk_X509_CRL_push(crlStack.get(), X509_CRL_dup(crl.get())); + } + } - sk_DIST_POINT_pop_free(crlDistributionPoint, DIST_POINT_free); - if (!crl) - { - Log::Write(Logger::Level::Error, "Unable to retrieve CRL, CRL check may fail."); - return nullptr; + return crlStack.release(); } - sk_X509_CRL_push(crlStack.get(), X509_CRL_dup(crl.get())); - - // try to download delta Crl - crlDistributionPoint = static_cast( - X509_get_ext_d2i(currentCertificate, NID_freshest_crl, nullptr, nullptr)); - if (crlDistributionPoint != nullptr) + int GetOpenSSLContextConnectionIndex() { - crl = LoadCrlFromCacheAndDistributionPoint(currentCertificate, crlDistributionPoint); - - sk_DIST_POINT_pop_free(crlDistributionPoint, DIST_POINT_free); - if (crl) + static int openSslConnectionIndex = -1; + if (openSslConnectionIndex < 0) { - sk_X509_CRL_push(crlStack.get(), X509_CRL_dup(crl.get())); + openSslConnectionIndex + = X509_STORE_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr); } + return openSslConnectionIndex; } - - return crlStack.release(); - } - - int GetOpenSSLContextConnectionIndex() - { - static int openSslConnectionIndex = -1; - if (openSslConnectionIndex < 0) + int GetOpenSSLContextLastVerifyFunction() { - openSslConnectionIndex = X509_STORE_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr); - } - return openSslConnectionIndex; - } - int GetOpenSSLContextLastVerifyFunction() - { - static int openSslLastVerifyFunctionIndex = -1; - if (openSslLastVerifyFunctionIndex < 0) - { - openSslLastVerifyFunctionIndex - = X509_STORE_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr); + static int openSslLastVerifyFunctionIndex = -1; + if (openSslLastVerifyFunctionIndex < 0) + { + openSslLastVerifyFunctionIndex + = X509_STORE_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr); + } + return openSslLastVerifyFunctionIndex; } - return openSslLastVerifyFunctionIndex; - } - } // namespace -}}} // namespace Azure::Core::Http + } // namespace + } // namespace Http +}} // namespace Azure::Core // OpenSSL X509 Certificate Validation function - based off of the example found at: // https://linux.die.net/man/3/x509_store_ctx_set_verify_cb @@ -1740,7 +1734,8 @@ int CurlConnection::VerifyCertificateError(int ok, X509_STORE_CTX* storeContext) X509_STORE* certStore = X509_STORE_CTX_get0_store(storeContext); X509* err_cert; int err, depth; - _detail::openssl_bio bio_err(_detail::make_openssl_unique(BIO_new, BIO_s_mem())); + Azure::Core::_internal::UniqueHandle bio_err( + Azure::Core::_internal::MakeUniqueHandle(BIO_new, BIO_s_mem())); err_cert = X509_STORE_CTX_get_current_cert(storeContext); err = X509_STORE_CTX_get_error(storeContext); @@ -2000,7 +1995,7 @@ CurlConnection::CurlConnection( std::string const& connectionPropertiesKey) : m_connectionKey(connectionPropertiesKey) { - m_handle = _detail::UniqueCURL(curl_easy_init()); + m_handle = Azure::Core::_internal::UniqueHandle(curl_easy_init()); if (!m_handle) { throw Azure::Core::Http::TransportException( diff --git a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp index cac6c3e15e..6dd31f6f78 100644 --- a/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_connection_private.hpp @@ -10,6 +10,7 @@ #pragma once #include "azure/core/http/http.hpp" +#include "azure/core/internal/unique_handle.hpp" #include #include @@ -25,206 +26,214 @@ #pragma warning(pop) #endif +// Stolen from openssl/x509.h to avoid having to include openssl headers typedef struct x509_store_ctx_st X509_STORE_CTX; -namespace Azure { namespace Core { namespace Http { - - namespace _detail { - // libcurl CURL_MAX_WRITE_SIZE is 64k. Using same value for default uploading chunk size. - // This can be customizable in the HttpRequest - constexpr static size_t DefaultUploadChunkSize = 1024 * 64; - constexpr static size_t DefaultLibcurlReaderSize = 4 * 1024; - // Run time error template - constexpr static const char* DefaultFailedToGetNewConnectionTemplate - = "Fail to get a new connection for: "; - constexpr static int32_t DefaultMaxOpenNewConnectionIntentsAllowed = 10; - // After 3 connections are received from the pool and failed to send a request, the next - // connections would ask the pool to be clean and spawn new connection. - constexpr static int32_t RequestPoolResetAfterConnectionFailed = 3; - // 90 sec -> cleaner wait time before next clean routine - constexpr static int32_t DefaultCleanerIntervalMilliseconds = 1000 * 90; - // 60 sec -> expired connection is when it waits for 60 sec or more and it's not re-used - constexpr static int32_t DefaultConnectionExpiredMilliseconds = 1000 * 60; - // Define the maximun allowed connections per host-index in the pool. If this number is reached - // for the host-index, next connections trying to be added to the pool will be ignored. - constexpr static int32_t MaxConnectionsPerIndex = 1024; - - /** - * @brief std::default_delete for the CURL * type , used for std::unique_ptr - * - */ - struct DeleteCURL - { - void operator()(CURL* handle) noexcept - { - if (handle != nullptr) - { - curl_easy_cleanup(handle); - } - } - }; - using UniqueCURL = std::unique_ptr; - } // namespace _detail - - /** - * @brief Interface for the connection to the network with Curl. - * - * @remark This interface enables to mock the communication to the network with any behavior for - * testing. - * - */ - class CurlNetworkConnection { - private: - bool m_isShutDown = false; - - public: +namespace Azure { namespace Core { + namespace _internal { /** - * @brief Allow derived classes calling a destructor. + * @brief Unique handle for WinHTTP HINTERNET handles. * - */ - virtual ~CurlNetworkConnection() = default; - - /** - * @brief Get the Connection Properties Key object - * - */ - virtual std::string const& GetConnectionKey() const = 0; - - /** - * @brief Update last usage time for the connection. + * @note HINTERNET is declared as a "void *". THis means that this definition subsumes all other + * `void *` types when used with Azure::Core::_internal::UniqueHandle. * */ - virtual void UpdateLastUsageTime() = 0; - - /** - * @brief Checks whether this CURL connection is expired. - * - */ - virtual bool IsExpired() = 0; - - /** - * @brief This function is used when working with streams to pull more data from the wire. - * Function will try to keep pulling data from socket until the buffer is all written or until - * there is no more data to get from the socket. - * - */ - virtual size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) = 0; - - /** - * @brief This method will use libcurl socket to write all the bytes from buffer. - * - */ - virtual CURLcode SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) - = 0; + template <> struct UniqueHandleHelper + { + static void FreeHandle(CURL* obj) { curl_free(obj); } - /** - * @brief Set the connection into an invalid and unusable state. - * - * @remark A connection won't be returned to the connection pool if it was shut it down. - * - */ - virtual void Shutdown() { m_isShutDown = true; } + using type = BasicUniqueHandle; + }; + } // namespace _internal + + namespace Http { + namespace _detail { + // libcurl CURL_MAX_WRITE_SIZE is 64k. Using same value for default uploading chunk size. + // This can be customizable in the HttpRequest + constexpr static size_t DefaultUploadChunkSize = 1024 * 64; + constexpr static size_t DefaultLibcurlReaderSize = 4 * 1024; + // Run time error template + constexpr static const char* DefaultFailedToGetNewConnectionTemplate + = "Fail to get a new connection for: "; + constexpr static int32_t DefaultMaxOpenNewConnectionIntentsAllowed = 10; + // After 3 connections are received from the pool and failed to send a request, the next + // connections would ask the pool to be clean and spawn new connection. + constexpr static int32_t RequestPoolResetAfterConnectionFailed = 3; + // 90 sec -> cleaner wait time before next clean routine + constexpr static int32_t DefaultCleanerIntervalMilliseconds = 1000 * 90; + // 60 sec -> expired connection is when it waits for 60 sec or more and it's not re-used + constexpr static int32_t DefaultConnectionExpiredMilliseconds = 1000 * 60; + // Define the maximun allowed connections per host-index in the pool. If this number is + // reached for the host-index, next connections trying to be added to the pool will be + // ignored. + constexpr static int32_t MaxConnectionsPerIndex = 1024; + + } // namespace _detail /** - * @brief Check if the the connection was shut it down. - * - * @return `true` is the connection was shut it down; otherwise, `false`. - */ - bool IsShutdown() const { return m_isShutDown; } - }; - - /** - * @brief CURL HTTP connection. - * - */ - class CurlConnection final : public CurlNetworkConnection { - private: - _detail::UniqueCURL m_handle; - curl_socket_t m_curlSocket; - std::chrono::steady_clock::time_point m_lastUseTime; - std::string m_connectionKey; - // CRL validation is disabled by default to be consistent with WinHTTP behavior - bool m_enableCrlValidation{false}; - // Allow the connection to proceed if retrieving the CRL failed. - bool m_allowFailedCrlRetrieval{true}; - - static int CurlLoggingCallback( - CURL* handle, - curl_infotype type, - char* data, - size_t size, - void* userp); - - static int CurlSslCtxCallback(CURL* curl, void* sslctx, void* parm); - int SslCtxCallback(CURL* curl, void* sslctx); - int VerifyCertificateError(int ok, X509_STORE_CTX* storeContext); - - public: - /** - * @brief Construct CURL HTTP connection. - * - * @param request Remote request - * @param options Connection options. - * @param hostDisplayName Display name for remote host, used for diagnostics. + * @brief Interface for the connection to the network with Curl. * - * @param connectionPropertiesKey CURL connection properties key - */ - CurlConnection( - Azure::Core::Http::Request& request, - Azure::Core::Http::CurlTransportOptions const& options, - std::string const& hostDisplayName, - std::string const& connectionPropertiesKey); - - /** - * @brief Destructor. - * @details Cleans up CURL (invokes `curl_easy_cleanup()`). - */ - ~CurlConnection() override {} - - std::string const& GetConnectionKey() const override { return this->m_connectionKey; } - - /** - * @brief Update last usage time for the connection. + * @remark This interface enables to mock the communication to the network with any behavior for + * testing. * */ - void UpdateLastUsageTime() override { this->m_lastUseTime = std::chrono::steady_clock::now(); } - - /** - * @brief Checks whether this CURL connection is expired. - * @return `true` if this connection is considered expired; otherwise, `false`. - */ - bool IsExpired() override - { - auto connectionOnWaitingTimeMs = std::chrono::duration_cast( - std::chrono::steady_clock::now() - this->m_lastUseTime); - return connectionOnWaitingTimeMs.count() >= _detail::DefaultConnectionExpiredMilliseconds; - } + class CurlNetworkConnection { + private: + bool m_isShutDown = false; + + public: + /** + * @brief Allow derived classes calling a destructor. + * + */ + virtual ~CurlNetworkConnection() = default; + + /** + * @brief Get the Connection Properties Key object + * + */ + virtual std::string const& GetConnectionKey() const = 0; + + /** + * @brief Update last usage time for the connection. + * + */ + virtual void UpdateLastUsageTime() = 0; + + /** + * @brief Checks whether this CURL connection is expired. + * + */ + virtual bool IsExpired() = 0; + + /** + * @brief This function is used when working with streams to pull more data from the wire. + * Function will try to keep pulling data from socket until the buffer is all written or until + * there is no more data to get from the socket. + * + */ + virtual size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) = 0; + + /** + * @brief This method will use libcurl socket to write all the bytes from buffer. + * + */ + virtual CURLcode SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) + = 0; + + /** + * @brief Set the connection into an invalid and unusable state. + * + * @remark A connection won't be returned to the connection pool if it was shut it down. + * + */ + virtual void Shutdown() { m_isShutDown = true; } + + /** + * @brief Check if the the connection was shut it down. + * + * @return `true` is the connection was shut it down; otherwise, `false`. + */ + bool IsShutdown() const { return m_isShutDown; } + }; /** - * @brief This function is used when working with streams to pull more data from the wire. - * Function will try to keep pulling data from socket until the buffer is all written or until - * there is no more data to get from the socket. + * @brief CURL HTTP connection. * - * @param context A context to control the request lifetime. - * @param buffer ptr to buffer where to copy bytes from socket. - * @param bufferSize size of the buffer and the requested bytes to be pulled from wire. - * @return return the numbers of bytes pulled from socket. It can be less than what it was - * requested. */ - size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) override; + class CurlConnection final : public CurlNetworkConnection { + private: + Azure::Core::_internal::UniqueHandle m_handle; + curl_socket_t m_curlSocket; + std::chrono::steady_clock::time_point m_lastUseTime; + std::string m_connectionKey; + // CRL validation is disabled by default to be consistent with WinHTTP behavior + bool m_enableCrlValidation{false}; + // Allow the connection to proceed if retrieving the CRL failed. + bool m_allowFailedCrlRetrieval{true}; + + static int CurlLoggingCallback( + CURL* handle, + curl_infotype type, + char* data, + size_t size, + void* userp); + + static int CurlSslCtxCallback(CURL* curl, void* sslctx, void* parm); + int SslCtxCallback(CURL* curl, void* sslctx); + int VerifyCertificateError(int ok, X509_STORE_CTX* storeContext); + + public: + /** + * @brief Construct CURL HTTP connection. + * + * @param request Remote request + * @param options Connection options. + * @param hostDisplayName Display name for remote host, used for diagnostics. + * + * @param connectionPropertiesKey CURL connection properties key + */ + CurlConnection( + Azure::Core::Http::Request& request, + Azure::Core::Http::CurlTransportOptions const& options, + std::string const& hostDisplayName, + std::string const& connectionPropertiesKey); + + /** + * @brief Destructor. + * @details Cleans up CURL (invokes `curl_easy_cleanup()`). + */ + ~CurlConnection() override {} + + std::string const& GetConnectionKey() const override { return this->m_connectionKey; } + + /** + * @brief Update last usage time for the connection. + * + */ + void UpdateLastUsageTime() override + { + this->m_lastUseTime = std::chrono::steady_clock::now(); + } - /** - * @brief This method will use libcurl socket to write all the bytes from buffer. - * - * @remarks Hardcoded timeout is used in case a socket stop responding. - * - * @param context A context to control the request lifetime. - * @param buffer ptr to the data to be sent to wire. - * @param bufferSize size of the buffer to send. - * @return CURL_OK when response is sent successfully. - */ - CURLcode SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) override; + /** + * @brief Checks whether this CURL connection is expired. + * @return `true` if this connection is considered expired; otherwise, `false`. + */ + bool IsExpired() override + { + auto connectionOnWaitingTimeMs = std::chrono::duration_cast( + std::chrono::steady_clock::now() - this->m_lastUseTime); + return connectionOnWaitingTimeMs.count() >= _detail::DefaultConnectionExpiredMilliseconds; + } - void Shutdown() override; - }; -}}} // namespace Azure::Core::Http + /** + * @brief This function is used when working with streams to pull more data from the wire. + * Function will try to keep pulling data from socket until the buffer is all written or until + * there is no more data to get from the socket. + * + * @param context A context to control the request lifetime. + * @param buffer ptr to buffer where to copy bytes from socket. + * @param bufferSize size of the buffer and the requested bytes to be pulled from wire. + * @return return the numbers of bytes pulled from socket. It can be less than what it was + * requested. + */ + size_t ReadFromSocket(uint8_t* buffer, size_t bufferSize, Context const& context) override; + + /** + * @brief This method will use libcurl socket to write all the bytes from buffer. + * + * @remarks Hardcoded timeout is used in case a socket stop responding. + * + * @param context A context to control the request lifetime. + * @param buffer ptr to the data to be sent to wire. + * @param bufferSize size of the buffer to send. + * @return CURL_OK when response is sent successfully. + */ + CURLcode SendBuffer(uint8_t const* buffer, size_t bufferSize, Context const& context) + override; + + void Shutdown() override; + }; + } // namespace Http +}} // namespace Azure::Core diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index 2fa5625dfa..0b876c423c 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -23,7 +23,7 @@ using namespace Azure::Core::Http::Policies::_internal; namespace Azure { namespace Core { namespace Http { namespace Policies { namespace _detail { namespace { - bool AnyTransportOptionsSpecified(TransportOptions const& transportOptions) + bool AreTransportOptionsSpecified(TransportOptions const& transportOptions) { return ( transportOptions.HttpProxy.HasValue() || transportOptions.ProxyPassword.HasValue() @@ -63,7 +63,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa // concurrently, the initialization occurs exactly once. We depend on this behavior to ensure // that the singleton defaultTransport is correctly initialized. static std::shared_ptr defaultTransport(std::make_shared()); - if (AnyTransportOptionsSpecified(transportOptions)) + if (AreTransportOptionsSpecified(transportOptions)) { WinHttpTransportOptions httpOptions; if (transportOptions.HttpProxy.HasValue()) @@ -108,7 +108,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa } #elif defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) static std::shared_ptr defaultTransport(std::make_shared()); - if (AnyTransportOptionsSpecified(transportOptions)) + if (AreTransportOptionsSpecified(transportOptions)) { CurlTransportOptions curlOptions; curlOptions.EnableCurlTracing = true; @@ -144,7 +144,7 @@ TransportPolicy::TransportPolicy(TransportOptions const& options) : m_options(op if (m_options.Transport) { #if !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) - if (_detail::AnyTransportOptionsSpecified(options)) + if (_detail::AreTransportOptionsSpecified(options)) { AZURE_ASSERT_MSG( false, "Invalid parameter: Proxies cannot be specified when a transport is specified."); diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index e841131723..83f492239f 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -8,15 +8,16 @@ #include "azure/core/diagnostics/logger.hpp" #include "azure/core/internal/diagnostics/log.hpp" #include "azure/core/internal/strings.hpp" +#include "azure/core/internal/unique_handle.hpp" #if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) #include "azure/core/http/win_http_transport.hpp" #endif - #include #include #include #include +#include // definitions for wil::unique_cert_chain_context and other RAII type wrappers for Windows types. #include #include @@ -209,14 +210,14 @@ std::string GetHeadersAsString(Azure::Core::Http::Request const& request) // For each certificate specified in trustedCertificate, add to certificateStore. bool WinHttpTransport::AddCertificatesToStore( std::vector const& trustedCertificates, - _detail::UniqueHCERTSTORE const& certificateStore) + HCERTSTORE certificateStore) { for (auto const& trustedCertificate : trustedCertificates) { auto derCertificate = Azure::Core::Convert::Base64Decode(trustedCertificate); if (!CertAddEncodedCertificateToStore( - certificateStore.get(), + certificateStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, derCertificate.data(), static_cast(derCertificate.size()), @@ -230,10 +231,10 @@ bool WinHttpTransport::AddCertificatesToStore( } // VerifyCertificateInChain determines whether the certificate in serverCertificate -// chains up to the PEM represented by trustedCertificate or not. +// chains up to one of the certificates represented by trustedCertificate or not. bool WinHttpTransport::VerifyCertificatesInChain( std::vector const& trustedCertificates, - _detail::UniquePCCERT_CONTEXT const& serverCertificate) + PCCERT_CONTEXT serverCertificate) { if ((trustedCertificates.empty()) || !serverCertificate) { @@ -241,7 +242,7 @@ bool WinHttpTransport::VerifyCertificatesInChain( } // Creates an in-memory certificate store that is destroyed at end of this function. - _detail::UniqueHCERTSTORE certificateStore(CertOpenStore( + wil::unique_hcertstore certificateStore(CertOpenStore( CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, @@ -253,47 +254,48 @@ bool WinHttpTransport::VerifyCertificatesInChain( } // Add the trusted certificates to that store. - if (!AddCertificatesToStore(trustedCertificates, certificateStore)) + if (!AddCertificatesToStore(trustedCertificates, certificateStore.get())) { Log::Write(Logger::Level::Error, "Cannot add certificates to store"); return false; } - _detail::UniqueHCERTCHAINENGINE certificateChainEngine; + // WIL doesn't declare a convenient wrapper for a HCERTCHAINENGINE, so we define a custom one. + wil::unique_any< + HCERTCHAINENGINE, + decltype(CertFreeCertificateChainEngine), + CertFreeCertificateChainEngine> + certificateChainEngine; { CERT_CHAIN_ENGINE_CONFIG EngineConfig{}; EngineConfig.cbSize = sizeof(EngineConfig); EngineConfig.dwFlags = CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE | CERT_CHAIN_ENABLE_SHARE_STORE; EngineConfig.hExclusiveRoot = certificateStore.get(); - HCERTCHAINENGINE engineHandle; - if (!CertCreateCertificateChainEngine(&EngineConfig, &engineHandle)) + if (!CertCreateCertificateChainEngine(&EngineConfig, certificateChainEngine.addressof())) { GetErrorAndThrow("CertCreateCertificateChainEngine failed"); } - certificateChainEngine.reset(engineHandle); } // Generate a certificate chain using the local chain engine and the certificate store containing // the trusted certificates. - _detail::UniqueCCERT_CHAIN_CONTEXT chainContextToVerify; + wil::unique_cert_chain_context chainContextToVerify; { CERT_CHAIN_PARA ChainPara{}; ChainPara.cbSize = sizeof(ChainPara); - PCCERT_CHAIN_CONTEXT chainContext; if (!CertGetCertificateChain( certificateChainEngine.get(), - serverCertificate.get(), + serverCertificate, nullptr, certificateStore.get(), &ChainPara, 0, nullptr, - &chainContext)) + chainContextToVerify.addressof())) { GetErrorAndThrow("CertGetCertificateChain failed"); } - chainContextToVerify.reset(chainContext); } // And make sure that the certificate chain which was created matches the SSL chain. @@ -386,22 +388,20 @@ void WinHttpTransport::OnHttpStatusOperation(HINTERNET hInternet, DWORD dwIntern AZURE_ASSERT(!m_options.ExpectedTlsRootCertificates.empty()); // Ask WinHTTP for the server certificate - this won't be valid outside a status callback. - _detail::UniquePCCERT_CONTEXT serverCertificate; + wil::unique_cert_context serverCertificate; { - PCCERT_CONTEXT certContext; - DWORD bufferLength = sizeof(certContext); + DWORD bufferLength = sizeof(PCCERT_CONTEXT); if (!WinHttpQueryOption( hInternet, WINHTTP_OPTION_SERVER_CERT_CONTEXT, - reinterpret_cast(&certContext), + reinterpret_cast(serverCertificate.addressof()), &bufferLength)) { GetErrorAndThrow("Could not retrieve TLS server certificate."); } - serverCertificate.reset(certContext); } - if (!VerifyCertificatesInChain(m_options.ExpectedTlsRootCertificates, serverCertificate)) + if (!VerifyCertificatesInChain(m_options.ExpectedTlsRootCertificates, serverCertificate.get())) { Log::Write(Logger::Level::Error, "Server certificate is not trusted. Aborting HTTP request"); @@ -442,11 +442,11 @@ void WinHttpTransport::GetErrorAndThrow(const std::string& exceptionMessage, DWO throw Azure::Core::Http::TransportException(errorMessage); } -_detail::UniqueHINTERNET WinHttpTransport::CreateSessionHandle() +Azure::Core::_internal::UniqueHandle WinHttpTransport::CreateSessionHandle() { // Use WinHttpOpen to obtain a session handle. // The dwFlags is set to 0 - all WinHTTP functions are performed synchronously. - _detail::UniqueHINTERNET sessionHandle(WinHttpOpen( + Azure::Core::_internal::UniqueHandle sessionHandle(WinHttpOpen( NULL, // Do not use a fallback user-agent string, and only rely on the header within the // request itself. // If the customer asks for it, enable use of the system default HTTP proxy. @@ -514,7 +514,7 @@ WinHttpTransport::WinHttpTransport(WinHttpTransportOptions const& options) { } -_detail::UniqueHINTERNET WinHttpTransport::CreateConnectionHandle( +Azure::Core::_internal::UniqueHandle WinHttpTransport::CreateConnectionHandle( Azure::Core::Url const& url, Azure::Core::Context const& context) { @@ -525,7 +525,7 @@ _detail::UniqueHINTERNET WinHttpTransport::CreateConnectionHandle( // Specify an HTTP server. // This function always operates synchronously. - _detail::UniqueHINTERNET rv(WinHttpConnect( + Azure::Core::_internal::UniqueHandle rv(WinHttpConnect( m_sessionHandle.get(), StringToWideString(url.GetHost()).c_str(), port == 0 ? INTERNET_DEFAULT_PORT : port, @@ -546,8 +546,8 @@ _detail::UniqueHINTERNET WinHttpTransport::CreateConnectionHandle( return rv; } -_detail::UniqueHINTERNET WinHttpTransport::CreateRequestHandle( - _detail::UniqueHINTERNET const& connectionHandle, +Azure::Core::_internal::UniqueHandle WinHttpTransport::CreateRequestHandle( + Azure::Core::_internal::UniqueHandle const& connectionHandle, Azure::Core::Url const& url, Azure::Core::Http::HttpMethod const& method) { @@ -560,7 +560,7 @@ _detail::UniqueHINTERNET WinHttpTransport::CreateRequestHandle( url.GetScheme(), WebSocketScheme)); // Create an HTTP request handle. - _detail::UniqueHINTERNET request(WinHttpOpenRequest( + Azure::Core::_internal::UniqueHandle request(WinHttpOpenRequest( connectionHandle.get(), HttpMethodToWideString(requestMethod).c_str(), path.empty() ? NULL : StringToWideString(path).c_str(), // Name of the target resource of @@ -655,7 +655,7 @@ _detail::UniqueHINTERNET WinHttpTransport::CreateRequestHandle( // For PUT/POST requests, send additional data using WinHttpWriteData. void WinHttpTransport::Upload( - _detail::UniqueHINTERNET const& requestHandle, + Azure::Core::_internal::UniqueHandle const& requestHandle, Azure::Core::Http::Request& request, Azure::Core::Context const& context) { @@ -695,7 +695,7 @@ void WinHttpTransport::Upload( } void WinHttpTransport::SendRequest( - _detail::UniqueHINTERNET const& requestHandle, + Azure::Core::_internal::UniqueHandle const& requestHandle, Azure::Core::Http::Request& request, Azure::Core::Context const& context) { @@ -763,7 +763,7 @@ void WinHttpTransport::SendRequest( } void WinHttpTransport::ReceiveResponse( - _detail::UniqueHINTERNET const& requestHandle, + Azure::Core::_internal::UniqueHandle const& requestHandle, Azure::Core::Context const& context) { context.ThrowIfCancelled(); @@ -786,7 +786,7 @@ void WinHttpTransport::ReceiveResponse( } int64_t WinHttpTransport::GetContentLength( - _detail::UniqueHINTERNET const& requestHandle, + Azure::Core::_internal::UniqueHandle const& requestHandle, HttpMethod requestMethod, HttpStatusCode responseStatusCode) { @@ -822,7 +822,7 @@ int64_t WinHttpTransport::GetContentLength( } std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( - _detail::UniqueHINTERNET& requestHandle, + Azure::Core::_internal::UniqueHandle& requestHandle, HttpMethod requestMethod) { // First, use WinHttpQueryHeaders to obtain the size of the buffer. @@ -960,8 +960,9 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( std::unique_ptr WinHttpTransport::Send(Request& request, Context const& context) { - _detail::UniqueHINTERNET connectionHandle = CreateConnectionHandle(request.GetUrl(), context); - _detail::UniqueHINTERNET requestHandle + Azure::Core::_internal::UniqueHandle connectionHandle + = CreateConnectionHandle(request.GetUrl(), context); + Azure::Core::_internal::UniqueHandle requestHandle = CreateRequestHandle(connectionHandle, request.GetUrl(), request.GetMethod()); try { diff --git a/vcpkg.json b/vcpkg.json index 3a5459cca4..69e500019c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -13,6 +13,9 @@ { "name": "openssl" }, + { + "name": "wil" + }, { "name": "opentelemetry-cpp", "platform": "!uwp", From 9c154c45d4ba7a8fbc04bee466e78f4fc1bc719f Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 12:08:16 -0700 Subject: [PATCH 45/75] Wil is windows-only --- vcpkg.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 69e500019c..cae82b4b86 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -14,7 +14,8 @@ "name": "openssl" }, { - "name": "wil" + "name": "wil", + "platform": "windows" }, { "name": "opentelemetry-cpp", From 901f2a4ea7b6c6177af75d51e6f5c68565951dc5 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 12:58:03 -0700 Subject: [PATCH 46/75] clang-format --- sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp | 4 ++-- sdk/core/azure-core/src/http/curl/curl.cpp | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp b/sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp index a503ed17bf..6effbe3396 100644 --- a/sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp +++ b/sdk/core/azure-core/inc/azure/core/internal/unique_handle.hpp @@ -26,8 +26,8 @@ namespace Azure { namespace Core { namespace _internal { * }; * * This is because WinHttpCloseHandle returns a BOOL, not void, so we need to wrap the call to - * WinHttpCloseHandle(). In addition, an HINTERNET is a `void *` type, which means that the std::unique_handle - * underlying type needs to be `void`. + * WinHttpCloseHandle(). In addition, an HINTERNET is a `void *` type, which means that the + * std::unique_handle underlying type needs to be `void`. * */ diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 06278b9485..717af480d9 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -1344,8 +1344,7 @@ namespace Azure { namespace Core { using type = BasicUniqueHandle; }; - template - auto MakeUniqueHandle(Api& OpensslApi, Args&&... args) + template auto MakeUniqueHandle(Api& OpensslApi, Args&&... args) { auto raw = OpensslApi(std::forward( args)...); // forwarding is probably unnecessary, could use const Args&... From 2aec13e55735599b534ad4ff815d99d16fa47ae0 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 14:04:30 -0700 Subject: [PATCH 47/75] CI fixes; changed retry max delay --- CMakeSettings.json | 53 +++++++++++++++++++ .../inc/azure/core/http/policies/policy.hpp | 2 +- .../azure-core/src/http/transport_policy.cpp | 1 - .../src/http/winhttp/win_http_transport.cpp | 4 ++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/CMakeSettings.json b/CMakeSettings.json index c10c6410f7..093d2f651c 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -56,12 +56,65 @@ "buildCommandArgs": "", "ctestCommandArgs": "", "inheritEnvironments": [ "msvc_x86" ], + "variables": [ + { + "name": "BUILD_TESTING", + "value": "True", + "type": "BOOL" + }, + { + "name": "VCPKG_TARGET_TRIPLET", + "value": "x86-windows-static", + "type": "STRING" + }, + { + "name": "MSVC_USE_STATIC_CRT", + "value": "True", + "type": "BOOL" + } + ] + }, + { + "name": "x86-Release-static_curl", + "generator": "Ninja", + "configurationType": "MinSizeRel", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x86" ], "variables": [ { "name": "VCPKG_TARGET_TRIPLET", "value": "x86-windows-static", "type": "STRING" }, + { + "name": "BUILD_TESTING", + "value": "True", + "type": "BOOL" + }, + { + "name": "DISABLE_PROXY_TESTS", + "value": "True", + "type": "BOOL" + }, + { + "name": "BUILD_PERFORMANCE_TESTS", + "value": "True", + "type": "BOOL" + }, + { + "name": "RUN_LONG_UNIT_TESTS", + "value": "True", + "type": "BOOL" + }, + { + "name": "BUILD_TRANSPORT_CURL", + "value": "True", + "type": "BOOL" + }, { "name": "MSVC_USE_STATIC_CRT", "value": "True", diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 82c635ba3d..611a1ed087 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -97,7 +97,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * @note See https://en.cppreference.com/w/cpp/chrono/duration. * */ - std::chrono::milliseconds MaxRetryDelay = std::chrono::minutes(2); + std::chrono::milliseconds MaxRetryDelay = std::chrono::seconds(60); /** * @brief The HTTP status codes that indicate when an operation should be retried. diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index 0b876c423c..c286c05d56 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -111,7 +111,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa if (AreTransportOptionsSpecified(transportOptions)) { CurlTransportOptions curlOptions; - curlOptions.EnableCurlTracing = true; curlOptions.Proxy = transportOptions.HttpProxy; if (!transportOptions.ProxyUserName.empty()) { diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index 83f492239f..c4b17496bc 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -17,7 +17,11 @@ #include #include #include +#pragma warning(push) +#pragma warning(disable : 6553) #include // definitions for wil::unique_cert_chain_context and other RAII type wrappers for Windows types. +#pragma warning(pop) + #include #include From 531371b66970f62a4aa150eb02e3865a60089c8f Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Fri, 30 Sep 2022 14:48:00 -0700 Subject: [PATCH 48/75] Set VCPKG_ROOT to empty string --- eng/pipelines/templates/jobs/cmake-generate.tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml index cbf285a181..cf4ee73e15 100644 --- a/eng/pipelines/templates/jobs/cmake-generate.tests.yml +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -52,6 +52,7 @@ jobs: variables: CMOCKA_XML_FILE: "%g-test-results.xml" + VCPKG_ROOT: '' steps: - checkout: self From acb16a734f7615e1c9636a73160d59d02016c09e Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 14:55:09 -0700 Subject: [PATCH 49/75] Increased code coverage --- sdk/core/azure-core/test/ut/transport_policy_options.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/core/azure-core/test/ut/transport_policy_options.cpp b/sdk/core/azure-core/test/ut/transport_policy_options.cpp index 5d1b1b5ac0..1c930ca7a2 100644 --- a/sdk/core/azure-core/test/ut/transport_policy_options.cpp +++ b/sdk/core/azure-core/test/ut/transport_policy_options.cpp @@ -152,6 +152,7 @@ namespace Azure { namespace Core { namespace Test { #if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) Azure::Core::Http::CurlTransportOptions curlOptions; curlOptions.SslVerifyPeer = false; + curlOptions.EnableCurlTracing = true; options.Transport = std::make_shared(curlOptions); #elif defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) Azure::Core::Http::WinHttpTransportOptions winHttpOptions; @@ -507,6 +508,7 @@ namespace Azure { namespace Core { namespace Test { // the certificate for the test URL doesn't contain a CRL distribution points extension, // and by default there is no platform CRL present. Azure::Core::Http::CurlTransportOptions curlOptions; + curlOptions.EnableCurlTracing = true; curlOptions.SslOptions.AllowFailedCrlRetrieval = true; curlOptions.SslOptions.EnableCertificateRevocationListCheck = true; transportOptions.Transport = std::make_shared(curlOptions); From 1c990c67931fdbc6f7a09114d0697d263c5fd061 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 15:04:53 -0700 Subject: [PATCH 50/75] Allow VCPKG_ROOT to be empty --- cmake-modules/AzureVcpkg.cmake | 4 ++-- eng/pipelines/templates/jobs/cmake-generate.tests.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake-modules/AzureVcpkg.cmake b/cmake-modules/AzureVcpkg.cmake index 2789241fb5..1b62f462d0 100644 --- a/cmake-modules/AzureVcpkg.cmake +++ b/cmake-modules/AzureVcpkg.cmake @@ -10,10 +10,10 @@ macro(az_vcpkg_integrate) # An env var VCPKG_ROOT or VCPKG_INSTALLATION_ROOT can be set to let Azure SDK to set the VCPKG toolchain automatically. # As the last alternative (default case), Azure SDK will automatically clone VCPKG folder and set toolchain from there. if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - if(DEFINED ENV{VCPKG_ROOT}) + if(DEFINED ENV{VCPKG_ROOT} AND NOT EQUAL "$ENV{VCPKG_ROOT}" "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") - elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT}) + elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT EQUAL "$ENV{VCPKG_INSTALLATION_ROOT}" "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") else() diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml index cf4ee73e15..fc99785ac8 100644 --- a/eng/pipelines/templates/jobs/cmake-generate.tests.yml +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -53,6 +53,7 @@ jobs: variables: CMOCKA_XML_FILE: "%g-test-results.xml" VCPKG_ROOT: '' + VCPKG_INSTALLATION_ROOT: '' steps: - checkout: self From 479d4004090d5c8dbc136766485f389c33d183cb Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 15:09:45 -0700 Subject: [PATCH 51/75] Allow VCPKG_ROOT to be empty, take 2 --- cmake-modules/AzureVcpkg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake-modules/AzureVcpkg.cmake b/cmake-modules/AzureVcpkg.cmake index 1b62f462d0..b681d2456a 100644 --- a/cmake-modules/AzureVcpkg.cmake +++ b/cmake-modules/AzureVcpkg.cmake @@ -10,10 +10,10 @@ macro(az_vcpkg_integrate) # An env var VCPKG_ROOT or VCPKG_INSTALLATION_ROOT can be set to let Azure SDK to set the VCPKG toolchain automatically. # As the last alternative (default case), Azure SDK will automatically clone VCPKG folder and set toolchain from there. if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - if(DEFINED ENV{VCPKG_ROOT} AND NOT EQUAL "$ENV{VCPKG_ROOT}" "") + if(DEFINED ENV{VCPKG_ROOT} AND NOT EQUAL ENV{VCPKG_ROOT} "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") - elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT EQUAL "$ENV{VCPKG_INSTALLATION_ROOT}" "") + elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT EQUAL ENV{VCPKG_INSTALLATION_ROOT} "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") else() From 39c3d00736364a78530511fcd1e277dcd00a0a64 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 15:17:38 -0700 Subject: [PATCH 52/75] Allow VCPKG_ROOT to be empty, take 3 --- cmake-modules/AzureVcpkg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake-modules/AzureVcpkg.cmake b/cmake-modules/AzureVcpkg.cmake index b681d2456a..1b62f462d0 100644 --- a/cmake-modules/AzureVcpkg.cmake +++ b/cmake-modules/AzureVcpkg.cmake @@ -10,10 +10,10 @@ macro(az_vcpkg_integrate) # An env var VCPKG_ROOT or VCPKG_INSTALLATION_ROOT can be set to let Azure SDK to set the VCPKG toolchain automatically. # As the last alternative (default case), Azure SDK will automatically clone VCPKG folder and set toolchain from there. if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - if(DEFINED ENV{VCPKG_ROOT} AND NOT EQUAL ENV{VCPKG_ROOT} "") + if(DEFINED ENV{VCPKG_ROOT} AND NOT EQUAL "$ENV{VCPKG_ROOT}" "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") - elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT EQUAL ENV{VCPKG_INSTALLATION_ROOT} "") + elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT EQUAL "$ENV{VCPKG_INSTALLATION_ROOT}" "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") else() From 79d8457cacc74cf37c82cd12e592a04f7e98d0de Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 15:31:15 -0700 Subject: [PATCH 53/75] Allow VCPKG_ROOT to be empty, take 4 --- cmake-modules/AzureVcpkg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake-modules/AzureVcpkg.cmake b/cmake-modules/AzureVcpkg.cmake index 1b62f462d0..e59ac24b51 100644 --- a/cmake-modules/AzureVcpkg.cmake +++ b/cmake-modules/AzureVcpkg.cmake @@ -10,10 +10,10 @@ macro(az_vcpkg_integrate) # An env var VCPKG_ROOT or VCPKG_INSTALLATION_ROOT can be set to let Azure SDK to set the VCPKG toolchain automatically. # As the last alternative (default case), Azure SDK will automatically clone VCPKG folder and set toolchain from there. if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - if(DEFINED ENV{VCPKG_ROOT} AND NOT EQUAL "$ENV{VCPKG_ROOT}" "") + if(DEFINED ENV{VCPKG_ROOT} AND NOT "$ENV{VCPKG_ROOT}" EQUAL "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") - elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT EQUAL "$ENV{VCPKG_INSTALLATION_ROOT}" "") + elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT "$ENV{VCPKG_INSTALLATION_ROOT}" EQUAL "") set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") else() From ce55a224e75a94dfc6f62f5c0826e77be9536972 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 15:47:59 -0700 Subject: [PATCH 54/75] Allow VCPKG_ROOT to be empty, take 5 --- cmake-modules/AzureVcpkg.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake-modules/AzureVcpkg.cmake b/cmake-modules/AzureVcpkg.cmake index e59ac24b51..41e9b039a2 100644 --- a/cmake-modules/AzureVcpkg.cmake +++ b/cmake-modules/AzureVcpkg.cmake @@ -17,6 +17,8 @@ macro(az_vcpkg_integrate) set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") else() + message(STATUS "VCPKG_ROOT or VCPKG_INSTALLATION_ROOT is not defined. Will use VCPKG from submodule.") + message(STATUS "AZURE_SDK_DISABLE_AUTO_VCPKG: " $ENV{AZURE_SDK_DISABLE_AUTO_VCPKG}) # Set AZURE_SDK_DISABLE_AUTO_VCPKG env var to avoid Azure SDK from cloning and setting VCPKG automatically # This option delegate package's dependencies installation to user. if(NOT DEFINED ENV{AZURE_SDK_DISABLE_AUTO_VCPKG}) @@ -39,6 +41,7 @@ macro(az_vcpkg_integrate) endif() # use the vcpkg source path set(CMAKE_TOOLCHAIN_FILE "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") + message(STATUS "Set CMAKE_TOOLCHAIN_FILE to: " $ENV{CMAKE_TOOLCHAIN_FILE }) endif() endif() endif() From ad6c74708187cf73b622a12ddd96b224b37c9dc1 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 15:54:21 -0700 Subject: [PATCH 55/75] Try to see what cmake is thinking --- eng/pipelines/templates/steps/cmake-generate.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/steps/cmake-generate.yml b/eng/pipelines/templates/steps/cmake-generate.yml index f39df26332..e8b0d48ea1 100644 --- a/eng/pipelines/templates/steps/cmake-generate.yml +++ b/eng/pipelines/templates/steps/cmake-generate.yml @@ -17,7 +17,8 @@ steps: displayName: Show current path - script: | - ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. + ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. > cmake.log + cat cmake.log workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: cmake generate env: From b70420f318f94e1a3e9b5987149a933b0952e4e6 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:07:59 -0700 Subject: [PATCH 56/75] Try to see what cmake is thinking --- eng/pipelines/templates/steps/cmake-generate.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/steps/cmake-generate.yml b/eng/pipelines/templates/steps/cmake-generate.yml index e8b0d48ea1..69c3d12705 100644 --- a/eng/pipelines/templates/steps/cmake-generate.yml +++ b/eng/pipelines/templates/steps/cmake-generate.yml @@ -8,7 +8,9 @@ steps: workingDirectory: ${{ parameters.CmakeGeneratePath }} displayName: create working directory - - pwsh: Write-Host "ENVs - ${{ parameters.Env }} " + - pwsh: | + Write-Host "ENVs - ${{ parameters.Env }} " + Get-ChildItem env: workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: ENVs @@ -18,12 +20,18 @@ steps: - script: | ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. > cmake.log - cat cmake.log workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: cmake generate env: VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET) + - script: | + cat cmake.log + workingDirectory: ${{ parameters.CmakeGeneratePath }}/build + displayName: Type cmake log. + env: + VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET) + - script: rm -rf build workingDirectory: ${{ parameters.CmakeGeneratePath }} displayName: clean build folder From a52ff2f914e060975ed81ea86caf4d62e185c5b3 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:23:12 -0700 Subject: [PATCH 57/75] Corrected printfs --- cmake-modules/AzureVcpkg.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake-modules/AzureVcpkg.cmake b/cmake-modules/AzureVcpkg.cmake index 41e9b039a2..68edd3ca23 100644 --- a/cmake-modules/AzureVcpkg.cmake +++ b/cmake-modules/AzureVcpkg.cmake @@ -39,9 +39,11 @@ macro(az_vcpkg_integrate) if(NOT vcpkg_POPULATED) FetchContent_Populate(vcpkg) endif() + message(STATUS "VCPKG_Populated:" ${vcpkg_POPULATED}) + message(STATUS "VCPKG will be used from: " ${vcpkg_SOURCE_DIR}) # use the vcpkg source path set(CMAKE_TOOLCHAIN_FILE "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") - message(STATUS "Set CMAKE_TOOLCHAIN_FILE to: " $ENV{CMAKE_TOOLCHAIN_FILE }) + message(STATUS "Set CMAKE_TOOLCHAIN_FILE to: " ${CMAKE_TOOLCHAIN_FILE}) endif() endif() endif() From d25d85225395816bc08e16d426625091e838bb62 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:47:52 -0700 Subject: [PATCH 58/75] backed out earlier changes --- cmake-modules/AzureVcpkg.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cmake-modules/AzureVcpkg.cmake b/cmake-modules/AzureVcpkg.cmake index 68edd3ca23..2789241fb5 100644 --- a/cmake-modules/AzureVcpkg.cmake +++ b/cmake-modules/AzureVcpkg.cmake @@ -10,15 +10,13 @@ macro(az_vcpkg_integrate) # An env var VCPKG_ROOT or VCPKG_INSTALLATION_ROOT can be set to let Azure SDK to set the VCPKG toolchain automatically. # As the last alternative (default case), Azure SDK will automatically clone VCPKG folder and set toolchain from there. if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - if(DEFINED ENV{VCPKG_ROOT} AND NOT "$ENV{VCPKG_ROOT}" EQUAL "") + if(DEFINED ENV{VCPKG_ROOT}) set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") - elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT "$ENV{VCPKG_INSTALLATION_ROOT}" EQUAL "") + elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT}) set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") else() - message(STATUS "VCPKG_ROOT or VCPKG_INSTALLATION_ROOT is not defined. Will use VCPKG from submodule.") - message(STATUS "AZURE_SDK_DISABLE_AUTO_VCPKG: " $ENV{AZURE_SDK_DISABLE_AUTO_VCPKG}) # Set AZURE_SDK_DISABLE_AUTO_VCPKG env var to avoid Azure SDK from cloning and setting VCPKG automatically # This option delegate package's dependencies installation to user. if(NOT DEFINED ENV{AZURE_SDK_DISABLE_AUTO_VCPKG}) @@ -39,11 +37,8 @@ macro(az_vcpkg_integrate) if(NOT vcpkg_POPULATED) FetchContent_Populate(vcpkg) endif() - message(STATUS "VCPKG_Populated:" ${vcpkg_POPULATED}) - message(STATUS "VCPKG will be used from: " ${vcpkg_SOURCE_DIR}) # use the vcpkg source path set(CMAKE_TOOLCHAIN_FILE "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") - message(STATUS "Set CMAKE_TOOLCHAIN_FILE to: " ${CMAKE_TOOLCHAIN_FILE}) endif() endif() endif() From 32baac1940fee5f593b8269472ceaa3ca01e9846 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:48:09 -0700 Subject: [PATCH 59/75] backed out vcpkg changes --- eng/pipelines/templates/jobs/cmake-generate.tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/pipelines/templates/jobs/cmake-generate.tests.yml b/eng/pipelines/templates/jobs/cmake-generate.tests.yml index fc99785ac8..cbf285a181 100644 --- a/eng/pipelines/templates/jobs/cmake-generate.tests.yml +++ b/eng/pipelines/templates/jobs/cmake-generate.tests.yml @@ -52,8 +52,6 @@ jobs: variables: CMOCKA_XML_FILE: "%g-test-results.xml" - VCPKG_ROOT: '' - VCPKG_INSTALLATION_ROOT: '' steps: - checkout: self From da30a110be416d5124e84f3b0e732a152565f703 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:48:34 -0700 Subject: [PATCH 60/75] BUild fix --- sdk/core/azure-core/vcpkg.json | 122 +++++++++++++++++---------------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/sdk/core/azure-core/vcpkg.json b/sdk/core/azure-core/vcpkg.json index a8f96609de..ecc2bf32ed 100644 --- a/sdk/core/azure-core/vcpkg.json +++ b/sdk/core/azure-core/vcpkg.json @@ -1,69 +1,73 @@ { - "name": "azure-core-cpp", - "version-string": "1.4.0-beta.1", - "dependencies": [ + "name": "azure-core-cpp", + "version-string": "1.4.0-beta.1", + "dependencies": [ + { + "name": "openssl", + "platform": "!windows & !uwp" + }, + { + "name": "wil", + "platform": "windows" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "http" + ], + "features": { + "curl": { + "description": "Libcurl HTTP transport implementation", + "dependencies": [ { - "name": "openssl", - "platform": "!windows & !uwp" + "name": "azure-core-cpp", + "default-features": false }, { - "name": "vcpkg-cmake", - "host": true + "name": "curl", + "default-features": false, + "features": [ + "ssl" + ] + } + ] + }, + "http": { + "description": "All HTTP transport implementations available on the platform", + "dependencies": [ + { + "name": "azure-core-cpp", + "default-features": false, + "features": [ + "curl" + ] }, { - "name": "vcpkg-cmake-config", - "host": true + "name": "azure-core-cpp", + "default-features": false, + "features": [ + "curl", + "winhttp" + ], + "platform": "windows & !uwp" } - ], - "default-features": [ - "http" - ], - "features": { - "curl": { - "description": "Libcurl HTTP transport implementation", - "dependencies": [ - { - "name": "azure-core-cpp", - "default-features": false - }, - { - "name": "curl", - "default-features": false, - "features": [ - "ssl" - ] - } - ] - }, - "http": { - "description": "All HTTP transport implementations available on the platform", - "dependencies": [ - { - "name": "azure-core-cpp", - "default-features": false, - "features": [ - "curl" - ] - }, - { - "name": "azure-core-cpp", - "default-features": false, - "features": [ - "curl", - "winhttp" - ], - "platform": "windows & !uwp" - } - ] - }, - "winhttp": { - "description": "WinHTTP HTTP transport implementation", - "dependencies": [ - { - "name": "azure-core-cpp", - "default-features": false - } - ] + ] + }, + "winhttp": { + "description": "WinHTTP HTTP transport implementation", + "dependencies": [ + { + "name": "azure-core-cpp", + "default-features": false } + ] } + } } From 2f5fd069855e32487122851f247368f7d7ece5bf Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:48:57 -0700 Subject: [PATCH 61/75] Enabled transport options for all scenarios that aren't BUILD_TRANSPORT_CUSTOM_ADAPTER --- sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 611a1ed087..39bf804618 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -138,7 +138,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { struct TransportOptions final { #if !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) -#if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) || defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) /** * @brief The URL for the proxy server to use for this connection. * @@ -173,8 +172,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * This means that the expected root certificate is the only certificate that will be trusted. */ std::string ExpectedTlsRootCertificate{}; - -#endif // defined(CURL_ADAPTER) || defined(WINHTTP_ADAPTER) #endif // !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) /** From 17b674c4f50da4691623c32f4c5151030370a9d8 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:50:19 -0700 Subject: [PATCH 62/75] Noise reduction --- eng/pipelines/templates/steps/cmake-generate.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/eng/pipelines/templates/steps/cmake-generate.yml b/eng/pipelines/templates/steps/cmake-generate.yml index 69c3d12705..a336a2ef0f 100644 --- a/eng/pipelines/templates/steps/cmake-generate.yml +++ b/eng/pipelines/templates/steps/cmake-generate.yml @@ -10,7 +10,6 @@ steps: - pwsh: | Write-Host "ENVs - ${{ parameters.Env }} " - Get-ChildItem env: workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: ENVs @@ -19,19 +18,12 @@ steps: displayName: Show current path - script: | - ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. > cmake.log + ${{ parameters.Env }} cmake ${{ parameters.GenerateArgs }} .. workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: cmake generate env: VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET) - - script: | - cat cmake.log - workingDirectory: ${{ parameters.CmakeGeneratePath }}/build - displayName: Type cmake log. - env: - VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET) - - script: rm -rf build workingDirectory: ${{ parameters.CmakeGeneratePath }} displayName: clean build folder From d41c088da91a604c3a9e0c64c60576cd6aa374d9 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Fri, 30 Sep 2022 16:51:39 -0700 Subject: [PATCH 63/75] More noise reduction --- eng/pipelines/templates/steps/cmake-generate.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/pipelines/templates/steps/cmake-generate.yml b/eng/pipelines/templates/steps/cmake-generate.yml index a336a2ef0f..f39df26332 100644 --- a/eng/pipelines/templates/steps/cmake-generate.yml +++ b/eng/pipelines/templates/steps/cmake-generate.yml @@ -8,8 +8,7 @@ steps: workingDirectory: ${{ parameters.CmakeGeneratePath }} displayName: create working directory - - pwsh: | - Write-Host "ENVs - ${{ parameters.Env }} " + - pwsh: Write-Host "ENVs - ${{ parameters.Env }} " workingDirectory: ${{ parameters.CmakeGeneratePath }}/build displayName: ENVs From dd8de4a68bc6a15b55d511f03b8514cf40779727 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 3 Oct 2022 15:18:51 -0700 Subject: [PATCH 64/75] Added constructor to HTTP transports which takes a Azure::Core::Http::Policies::TransportOptions --- .../inc/azure/core/http/curl_transport.hpp | 8 +++ .../inc/azure/core/http/policies/policy.hpp | 2 - .../azure/core/http/win_http_transport.hpp | 13 ++++ sdk/core/azure-core/src/http/curl/curl.cpp | 47 ++++++++++++ .../azure-core/src/http/transport_policy.cpp | 72 +------------------ .../src/http/winhttp/win_http_transport.cpp | 45 ++++++++++++ .../azure-core/test/ut/azure_core_test.cpp | 9 ++- 7 files changed, 123 insertions(+), 73 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index d817b51d3e..f19f1ff3c2 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -10,6 +10,7 @@ #include "azure/core/context.hpp" #include "azure/core/http/http.hpp" +#include "azure/core/http/policies/policy.hpp" #include "azure/core/http/transport.hpp" namespace Azure { namespace Core { namespace Http { @@ -199,6 +200,13 @@ namespace Azure { namespace Core { namespace Http { { } + /** + * @brief Construct a new CurlTransport object based on common Azure HTTP Transport Options + * + * @param options Common Azure Core Transport Options. + */ + CurlTransport(Azure::Core::Http::Policies::TransportOptions const& options); + /** * @brief Destroys a CurlTransport object. * diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 39bf804618..07aa72078f 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -137,7 +137,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { */ struct TransportOptions final { -#if !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) /** * @brief The URL for the proxy server to use for this connection. * @@ -172,7 +171,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * This means that the expected root certificate is the only certificate that will be trusted. */ std::string ExpectedTlsRootCertificate{}; -#endif // !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) /** * @brief #Azure::Core::Http::HttpTransport that the transport policy will use to send and diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 5879a82adf..cf28a899d2 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -11,6 +11,7 @@ #include "azure/core/context.hpp" #include "azure/core/http/http.hpp" +#include "azure/core/http/policies/policy.hpp" #include "azure/core/http/transport.hpp" #include "azure/core/internal/unique_handle.hpp" @@ -252,6 +253,18 @@ namespace Azure { namespace Core { */ WinHttpTransport(WinHttpTransportOptions const& options = WinHttpTransportOptions()); + /** + * @brief Constructs `%WinHttpTransport`. + * + * @param options Optional parameter to override the default settings. + */ + /** + * @brief Constructs `%WinHttpTransport` object based on common Azure HTTP Transport Options + * + * @param options Common Azure Core Transport Options to override the default settings. + */ + WinHttpTransport(Azure::Core::Http::Policies::TransportOptions const& options); + /** * @brief Implements the HTTP transport interface to send an HTTP Request and produce an HTTP * RawResponse. diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 717af480d9..1c8c8eed22 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -254,6 +254,48 @@ static void CleanupThread() // Do actual connections release work here, without holding the mutex. } } + +std::string PemEncodeFromBase64(std::string const& base64, std::string const& pemType) +{ + std::stringstream rv; + rv << "-----BEGIN " << pemType << "-----" << std::endl; + std::string encodedValue(base64); + + // Insert crlf characters every 80 characters into the base64 encoded key to make it + // prettier. + size_t insertPos = 80; + while (insertPos < encodedValue.length()) + { + encodedValue.insert(insertPos, "\r\n"); + insertPos += 82; /* 80 characters plus the \r\n we just inserted */ + } + + rv << encodedValue << std::endl << "-----END " << pemType << "-----" << std::endl; + return rv.str(); +} + +Azure::Core::Http::CurlTransportOptions CurlTransportOptionsFromTransportOptions( + Azure::Core::Http::Policies::TransportOptions const& transportOptions) +{ + Azure::Core::Http::CurlTransportOptions curlOptions; + curlOptions.Proxy = transportOptions.HttpProxy; + if (!transportOptions.ProxyUserName.empty()) + { + curlOptions.ProxyUsername = transportOptions.ProxyUserName; + } + curlOptions.ProxyPassword = transportOptions.ProxyPassword; + + curlOptions.SslOptions.EnableCertificateRevocationListCheck + = transportOptions.EnableCertificateRevocationListCheck; + + if (!transportOptions.ExpectedTlsRootCertificate.empty()) + { + curlOptions.SslOptions.PemEncodedExpectedRootCertificates + = PemEncodeFromBase64(transportOptions.ExpectedTlsRootCertificate, "CERTIFICATE"); + } + return curlOptions; +} + } // namespace using Azure::Core::Context; @@ -271,6 +313,11 @@ using Azure::Core::Http::_detail::CurlConnectionPool; Azure::Core::Http::_detail::CurlConnectionPool Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool; +CurlTransport::CurlTransport(Azure::Core::Http::Policies::TransportOptions const& options) + : CurlTransport(CurlTransportOptionsFromTransportOptions(options)) +{ +} + std::unique_ptr CurlTransport::Send(Request& request, Context const& context) { // Create CurlSession to perform request diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index c286c05d56..8550f39f10 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -31,25 +31,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa || transportOptions.EnableCertificateRevocationListCheck || !transportOptions.ExpectedTlsRootCertificate.empty()); } - - std::string PemEncodeFromBase64(std::string const& base64, std::string const& pemType) - { - std::stringstream rv; - rv << "-----BEGIN " << pemType << "-----" << std::endl; - std::string encodedValue(base64); - - // Insert crlf characters every 80 characters into the base64 encoded key to make it - // prettier. - size_t insertPos = 80; - while (insertPos < encodedValue.length()) - { - encodedValue.insert(insertPos, "\r\n"); - insertPos += 82; /* 80 characters plus the \r\n we just inserted */ - } - - rv << encodedValue << std::endl << "-----END " << pemType << "-----" << std::endl; - return rv.str(); - } } // namespace std::shared_ptr GetTransportAdapter(TransportOptions const& transportOptions) @@ -65,39 +46,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa static std::shared_ptr defaultTransport(std::make_shared()); if (AreTransportOptionsSpecified(transportOptions)) { - WinHttpTransportOptions httpOptions; - if (transportOptions.HttpProxy.HasValue()) - { - // WinHTTP proxy strings are semicolon separated elements, each of which - // has the following format: - // ([=]["://"][":"]) - std::string proxyString; - proxyString = "http=" + transportOptions.HttpProxy.Value(); - proxyString += ";"; - proxyString += "https=" + transportOptions.HttpProxy.Value(); - httpOptions.ProxyInformation = proxyString; - } - httpOptions.ProxyUserName = transportOptions.ProxyUserName; - httpOptions.ProxyPassword = transportOptions.ProxyPassword; - // Note that WinHTTP accepts a set of root certificates, even though transportOptions only - // specifies a single one. - if (!transportOptions.ExpectedTlsRootCertificate.empty()) - { - httpOptions.ExpectedTlsRootCertificates.push_back( - transportOptions.ExpectedTlsRootCertificate); - } - if (transportOptions.EnableCertificateRevocationListCheck) - { - httpOptions.EnableCertificateRevocationListCheck; - } - // If you specify an expected TLS root certificate, you also need to enable ignoring unknown - // CAs. - if (!transportOptions.ExpectedTlsRootCertificate.empty()) - { - httpOptions.IgnoreUnknownCertificateAuthority; - } - - return std::make_shared(httpOptions); + return std::make_shared(transportOptions); } else { @@ -110,24 +59,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa static std::shared_ptr defaultTransport(std::make_shared()); if (AreTransportOptionsSpecified(transportOptions)) { - CurlTransportOptions curlOptions; - curlOptions.Proxy = transportOptions.HttpProxy; - if (!transportOptions.ProxyUserName.empty()) - { - curlOptions.ProxyUsername = transportOptions.ProxyUserName; - } - curlOptions.ProxyPassword = transportOptions.ProxyPassword; - - curlOptions.SslOptions.EnableCertificateRevocationListCheck - = transportOptions.EnableCertificateRevocationListCheck; - - if (!transportOptions.ExpectedTlsRootCertificate.empty()) - { - curlOptions.SslOptions.PemEncodedExpectedRootCertificates - = PemEncodeFromBase64(transportOptions.ExpectedTlsRootCertificate, "CERTIFICATE"); - } - - return std::make_shared(curlOptions); + return std::make_shared(transportOptions); } return defaultTransport; #else diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index c4b17496bc..073f99f3b3 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -513,11 +513,56 @@ Azure::Core::_internal::UniqueHandle WinHttpTransport::CreateSessionH return sessionHandle; } +namespace { +WinHttpTransportOptions WinHttpTransportOptionsFromTransportOptions( + Azure::Core::Http::Policies::TransportOptions const& transportOptions) +{ + WinHttpTransportOptions httpOptions; + if (transportOptions.HttpProxy.HasValue()) + { + // WinHTTP proxy strings are semicolon separated elements, each of which + // has the following format: + // ([=]["://"][":"]) + std::string proxyString; + proxyString = "http=" + transportOptions.HttpProxy.Value(); + proxyString += ";"; + proxyString += "https=" + transportOptions.HttpProxy.Value(); + httpOptions.ProxyInformation = proxyString; + } + httpOptions.ProxyUserName = transportOptions.ProxyUserName; + httpOptions.ProxyPassword = transportOptions.ProxyPassword; + // Note that WinHTTP accepts a set of root certificates, even though transportOptions only + // specifies a single one. + if (!transportOptions.ExpectedTlsRootCertificate.empty()) + { + httpOptions.ExpectedTlsRootCertificates.push_back(transportOptions.ExpectedTlsRootCertificate); + } + if (transportOptions.EnableCertificateRevocationListCheck) + { + httpOptions.EnableCertificateRevocationListCheck; + } + // If you specify an expected TLS root certificate, you also need to enable ignoring unknown + // CAs. + if (!transportOptions.ExpectedTlsRootCertificate.empty()) + { + httpOptions.IgnoreUnknownCertificateAuthority; + } + + return httpOptions; +} +} // namespace + WinHttpTransport::WinHttpTransport(WinHttpTransportOptions const& options) : m_options(options), m_sessionHandle(CreateSessionHandle()) { } +WinHttpTransport::WinHttpTransport( + Azure::Core::Http::Policies::TransportOptions const& transportOptions) + : WinHttpTransport(WinHttpTransportOptionsFromTransportOptions(transportOptions)) +{ +} + Azure::Core::_internal::UniqueHandle WinHttpTransport::CreateConnectionHandle( Azure::Core::Url const& url, Azure::Core::Context const& context) diff --git a/sdk/core/azure-core/test/ut/azure_core_test.cpp b/sdk/core/azure-core/test/ut/azure_core_test.cpp index 9f82b4628d..bf312f1565 100644 --- a/sdk/core/azure-core/test/ut/azure_core_test.cpp +++ b/sdk/core/azure-core/test/ut/azure_core_test.cpp @@ -5,8 +5,13 @@ #if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) #include -#include #endif +#include +#include + +// C Runtime Library errors trigger SIGABRT. Catch that signal handler and report it on the test +// log. +void AbortHandler(int signal) { std::cout << "abort() has been called: " << signal << std::endl; } int main(int argc, char** argv) { @@ -16,6 +21,8 @@ int main(int argc, char** argv) signal(SIGPIPE, SIG_IGN); #endif + signal(SIGABRT, AbortHandler); + testing::InitGoogleTest(&argc, argv); auto r = RUN_ALL_TESTS(); From 53afb38148dbdd21c2b80b6a14f50471de37e87d Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 3 Oct 2022 17:00:13 -0700 Subject: [PATCH 65/75] Make Proxy UserName be Azure::Nullable --- .../inc/azure/core/http/curl_transport.hpp | 2 +- .../inc/azure/core/http/policies/policy.hpp | 20 ++++++++++++++++++- .../azure/core/http/win_http_transport.hpp | 2 +- sdk/core/azure-core/src/http/curl/curl.cpp | 14 ++++++------- .../src/http/curl/curl_session_private.hpp | 2 +- .../azure-core/src/http/transport_policy.cpp | 13 +++++++----- .../src/http/winhttp/win_http_transport.cpp | 4 ++-- 7 files changed, 39 insertions(+), 18 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index f19f1ff3c2..5ed07c4ac2 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -95,7 +95,7 @@ namespace Azure { namespace Core { namespace Http { * @remark The default value is an empty string (no proxy). * */ - std::string ProxyUsername; + Azure::Nullable ProxyUsername; /** * @brief Password to be used for proxy connections. diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 07aa72078f..560cc80940 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -142,16 +142,25 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * * @remark If an empty string is specified, it instructs the transport to disable all proxies, * including system proxies. + * + * @remark This field is only used if the customer has not specified a default transport adapter. + * If the customer has set a Transport adapter, this option is ignored. */ Azure::Nullable HttpProxy{}; /** * @brief The username to use when authenticating with the proxy server. + * + * @remark This field is only used if the customer has not specified a default transport + * adapter. If the customer has set a Transport adapter, this option is ignored. */ - std::string ProxyUserName{}; + Azure::Nullable ProxyUserName{}; /** * @brief The password to use when authenticating with the proxy server. + * + * @remark This field is only used if the customer has not specified a default transport + * adapter. If the customer has set a Transport adapter, this option is ignored. */ Azure::Nullable ProxyPassword{}; @@ -159,6 +168,9 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * @brief Enable TLS Certificate validation against a certificate revocation list. * * @remark Note that by default, CRL validation is *disabled*. + * + * @remark This field is only used if the customer has not specified a default transport + * adapter. If the customer has set a Transport adapter, this option is ignored. */ bool EnableCertificateRevocationListCheck{false}; @@ -169,6 +181,9 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * @remark Note that with the schannel and sectransp crypto backends, setting the * expected root certificate disables access to the system certificate store. * This means that the expected root certificate is the only certificate that will be trusted. + * + * @remark This field is only used if the customer has not specified a default transport + * adapter. If the customer has set a Transport adapter, this option is ignored. */ std::string ExpectedTlsRootCertificate{}; @@ -185,6 +200,9 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * @remark When using a custom transport adapter, the implementation for * `::AzureSdkGetCustomHttpTransport()` must be linked in the end-user application. * + * @remark If the caller specifies a value for Transport, then all the other options in + * TransportOptions will be ignored, since the caller will have already configured the transport. + * */ std::shared_ptr Transport; }; diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index cf28a899d2..d28e551bef 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -151,7 +151,7 @@ namespace Azure { namespace Core { /** * @brief User name for proxy authentication. */ - std::string ProxyUserName; + Azure::Nullable ProxyUserName; /** * @brief Password for proxy authentication. diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 1c8c8eed22..94c1c38f5f 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -279,7 +279,7 @@ Azure::Core::Http::CurlTransportOptions CurlTransportOptionsFromTransportOptions { Azure::Core::Http::CurlTransportOptions curlOptions; curlOptions.Proxy = transportOptions.HttpProxy; - if (!transportOptions.ProxyUserName.empty()) + if (!transportOptions.ProxyUserName.HasValue()) { curlOptions.ProxyUsername = transportOptions.ProxyUserName; } @@ -406,7 +406,7 @@ CURLcode CurlSession::Perform(Context const& context) } // If we are using an HTTP proxy, connecting to an HTTP resource and it has been configured with a // username and password, we want to set the proxy authentication header. - if (m_httpProxy.HasValue() && m_request.GetUrl().GetScheme() == "http" && !m_httpProxyUser.empty() + if (m_httpProxy.HasValue() && m_request.GetUrl().GetScheme() == "http" && m_httpProxyUser.HasValue() && m_httpProxyPassword.HasValue()) { Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Setting proxy authentication header"); @@ -414,7 +414,7 @@ CURLcode CurlSession::Perform(Context const& context) "Proxy-Authorization", "Basic " + Azure::Core::_internal::Convert::Base64Encode( - m_httpProxyUser + ":" + m_httpProxyPassword.Value())); + m_httpProxyUser.Value() + ":" + m_httpProxyPassword.Value())); } // use expect:100 for PUT requests. Server will decide if it can take our request @@ -1247,7 +1247,7 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption options.Proxy.HasValue() ? (options.Proxy.Value().empty() ? "NoProxy" : options.Proxy.Value()) : "0"); key.append(","); - key.append(options.ProxyUsername.empty() ? "0" : options.ProxyUsername); + key.append(options.ProxyUsername.ValueOr("0")); key.append(","); key.append(options.ProxyPassword.ValueOr("0")); key.append(","); @@ -2128,13 +2128,13 @@ CurlConnection::CurlConnection( } } - if (!options.ProxyUsername.empty()) + if (options.ProxyUsername.HasValue()) { - if (!SetLibcurlOption(m_handle, CURLOPT_PROXYUSERNAME, options.ProxyUsername.c_str(), &result)) + if (!SetLibcurlOption(m_handle, CURLOPT_PROXYUSERNAME, options.ProxyUsername.Value().c_str(), &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName - + ". Failed to set proxy username to:" + options.ProxyUsername + ". " + + ". Failed to set proxy username to:" + options.ProxyUsername.Value() + ". " + std::string(curl_easy_strerror(result))); } } diff --git a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp index d4f50651ac..1d8d1ae7d4 100644 --- a/sdk/core/azure-core/src/http/curl/curl_session_private.hpp +++ b/sdk/core/azure-core/src/http/curl/curl_session_private.hpp @@ -365,7 +365,7 @@ namespace Azure { namespace Core { namespace Http { bool m_keepAlive = true; Azure::Nullable m_httpProxy; - std::string m_httpProxyUser; + Azure::Nullable m_httpProxyUser; Azure::Nullable m_httpProxyPassword; /** diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index 8550f39f10..8e9f9efa9b 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -23,11 +23,14 @@ using namespace Azure::Core::Http::Policies::_internal; namespace Azure { namespace Core { namespace Http { namespace Policies { namespace _detail { namespace { - bool AreTransportOptionsSpecified(TransportOptions const& transportOptions) + /** + * @brief Returns "true" if any specific transport options have been specified. + */ + bool AreAnyTransportOptionsSpecified(TransportOptions const& transportOptions) { return ( transportOptions.HttpProxy.HasValue() || transportOptions.ProxyPassword.HasValue() - || !transportOptions.ProxyUserName.empty() + || !transportOptions.ProxyUserName.HasValue() || transportOptions.EnableCertificateRevocationListCheck || !transportOptions.ExpectedTlsRootCertificate.empty()); } @@ -44,7 +47,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa // concurrently, the initialization occurs exactly once. We depend on this behavior to ensure // that the singleton defaultTransport is correctly initialized. static std::shared_ptr defaultTransport(std::make_shared()); - if (AreTransportOptionsSpecified(transportOptions)) + if (AreAnyTransportOptionsSpecified(transportOptions)) { return std::make_shared(transportOptions); } @@ -57,7 +60,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa } #elif defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER) static std::shared_ptr defaultTransport(std::make_shared()); - if (AreTransportOptionsSpecified(transportOptions)) + if (AreAnyTransportOptionsSpecified(transportOptions)) { return std::make_shared(transportOptions); } @@ -75,7 +78,7 @@ TransportPolicy::TransportPolicy(TransportOptions const& options) : m_options(op if (m_options.Transport) { #if !defined(BUILD_TRANSPORT_CUSTOM_ADAPTER) - if (_detail::AreTransportOptionsSpecified(options)) + if (_detail::AreAnyTransportOptionsSpecified(options)) { AZURE_ASSERT_MSG( false, "Invalid parameter: Proxies cannot be specified when a transport is specified."); diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index 073f99f3b3..2d51637cf5 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -656,13 +656,13 @@ Azure::Core::_internal::UniqueHandle WinHttpTransport::CreateRequestH GetErrorAndThrow("Error while setting Proxy information."); } } - if (!m_options.ProxyUserName.empty() || m_options.ProxyPassword.HasValue()) + if (m_options.ProxyUserName.HasValue() || m_options.ProxyPassword.HasValue()) { if (!WinHttpSetCredentials( request.get(), WINHTTP_AUTH_TARGET_PROXY, WINHTTP_AUTH_SCHEME_BASIC, - StringToWideString(m_options.ProxyUserName).c_str(), + StringToWideString(m_options.ProxyUserName.Value()).c_str(), StringToWideString(m_options.ProxyPassword.Value()).c_str(), 0)) { From b8089989b715249b6249791e15e50a9fbe8c24b2 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 3 Oct 2022 17:39:29 -0700 Subject: [PATCH 66/75] Update sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index 5ed07c4ac2..a8e28364dd 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -172,7 +172,7 @@ namespace Azure { namespace Core { namespace Http { std::chrono::milliseconds ConnectionTimeout = _detail::DefaultConnectionTimeout; /** - * @brief If set, integrates libcurls internal tracing with Azure logging. + * @brief If set, integrates libcurl's internal tracing with Azure logging. */ bool EnableCurlTracing = false; }; From ceda7e855af629e867006296b8a7eea99b7c2c6a Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Mon, 3 Oct 2022 17:46:14 -0700 Subject: [PATCH 67/75] Alphabetize vcpkg.json; added explicit wil dependencies --- sdk/core/azure-core/cgmanifest.json | 10 ++++++++++ sdk/core/azure-core/vcpkg.json | 8 ++++---- sdk/core/azure-core/vcpkg/Config.cmake.in | 2 ++ vcpkg.json | 8 ++++---- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sdk/core/azure-core/cgmanifest.json b/sdk/core/azure-core/cgmanifest.json index a84431c793..c4ba0a4eb8 100644 --- a/sdk/core/azure-core/cgmanifest.json +++ b/sdk/core/azure-core/cgmanifest.json @@ -21,6 +21,16 @@ }, "DevelopmentDependency": false }, + { + "Component": { + "Type": "git", + "git": { + "RepositoryUrl": "https://github.com/microsoft/wil", + "CommitHash": "f9284c19c9873664978b873b8858d7dfacc6af1e" + } + }, + "DevelopmentDependency": true + }, { "Component": { "Type": "git", diff --git a/sdk/core/azure-core/vcpkg.json b/sdk/core/azure-core/vcpkg.json index ecc2bf32ed..f3168e17f8 100644 --- a/sdk/core/azure-core/vcpkg.json +++ b/sdk/core/azure-core/vcpkg.json @@ -6,10 +6,6 @@ "name": "openssl", "platform": "!windows & !uwp" }, - { - "name": "wil", - "platform": "windows" - }, { "name": "vcpkg-cmake", "host": true @@ -17,6 +13,10 @@ { "name": "vcpkg-cmake-config", "host": true + }, + { + "name": "wil", + "platform": "windows" } ], "default-features": [ diff --git a/sdk/core/azure-core/vcpkg/Config.cmake.in b/sdk/core/azure-core/vcpkg/Config.cmake.in index fc0bf3d98d..b956374fe5 100644 --- a/sdk/core/azure-core/vcpkg/Config.cmake.in +++ b/sdk/core/azure-core/vcpkg/Config.cmake.in @@ -12,6 +12,8 @@ endif() if(NOT WIN32) find_dependency(OpenSSL) +else() + find_dependency(wil) endif() include("${CMAKE_CURRENT_LIST_DIR}/azure-core-cppTargets.cmake") diff --git a/vcpkg.json b/vcpkg.json index cae82b4b86..1e586685dd 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -13,14 +13,14 @@ { "name": "openssl" }, - { - "name": "wil", - "platform": "windows" - }, { "name": "opentelemetry-cpp", "platform": "!uwp", "version>=": "1.3.0" + }, + { + "name": "wil", + "platform": "windows" } ] } From 4ffa915bc6b97dbeb355cd683c5f7c421f25af62 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 09:54:58 -0700 Subject: [PATCH 68/75] Cleaned up find_package conditional --- sdk/core/azure-core/vcpkg/Config.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/core/azure-core/vcpkg/Config.cmake.in b/sdk/core/azure-core/vcpkg/Config.cmake.in index b956374fe5..8b22867ca2 100644 --- a/sdk/core/azure-core/vcpkg/Config.cmake.in +++ b/sdk/core/azure-core/vcpkg/Config.cmake.in @@ -10,10 +10,10 @@ if(@BUILD_TRANSPORT_CURL@) find_dependency(CURL @CURL_MIN_REQUIRED_VERSION@) endif() -if(NOT WIN32) - find_dependency(OpenSSL) -else() +if(WIN32) find_dependency(wil) +else() + find_dependency(OpenSSL) endif() include("${CMAKE_CURRENT_LIST_DIR}/azure-core-cppTargets.cmake") From 69b8525ce75a3661a1bba5248f67187f608ae242 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 10:00:13 -0700 Subject: [PATCH 69/75] Two bugs introduced by making username nullable --- sdk/core/azure-core/src/http/curl/curl.cpp | 2 +- sdk/core/azure-core/src/http/transport_policy.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 94c1c38f5f..f99a1ffda6 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -279,7 +279,7 @@ Azure::Core::Http::CurlTransportOptions CurlTransportOptionsFromTransportOptions { Azure::Core::Http::CurlTransportOptions curlOptions; curlOptions.Proxy = transportOptions.HttpProxy; - if (!transportOptions.ProxyUserName.HasValue()) + if (transportOptions.ProxyUserName.HasValue()) { curlOptions.ProxyUsername = transportOptions.ProxyUserName; } diff --git a/sdk/core/azure-core/src/http/transport_policy.cpp b/sdk/core/azure-core/src/http/transport_policy.cpp index 8e9f9efa9b..ec90e0253c 100644 --- a/sdk/core/azure-core/src/http/transport_policy.cpp +++ b/sdk/core/azure-core/src/http/transport_policy.cpp @@ -30,7 +30,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { namespa { return ( transportOptions.HttpProxy.HasValue() || transportOptions.ProxyPassword.HasValue() - || !transportOptions.ProxyUserName.HasValue() + || transportOptions.ProxyUserName.HasValue() || transportOptions.EnableCertificateRevocationListCheck || !transportOptions.ExpectedTlsRootCertificate.empty()); } From c231c4a2d91a368e551a965c9a3cbde7b219fce9 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 10:15:10 -0700 Subject: [PATCH 70/75] clang-format --- .../inc/azure/core/http/policies/policy.hpp | 13 +++++++------ sdk/core/azure-core/src/http/curl/curl.cpp | 7 ++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 560cc80940..eb47716bb0 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -142,15 +142,15 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * * @remark If an empty string is specified, it instructs the transport to disable all proxies, * including system proxies. - * - * @remark This field is only used if the customer has not specified a default transport adapter. - * If the customer has set a Transport adapter, this option is ignored. + * + * @remark This field is only used if the customer has not specified a default transport + * adapter. If the customer has set a Transport adapter, this option is ignored. */ Azure::Nullable HttpProxy{}; /** * @brief The username to use when authenticating with the proxy server. - * + * * @remark This field is only used if the customer has not specified a default transport * adapter. If the customer has set a Transport adapter, this option is ignored. */ @@ -181,7 +181,7 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * @remark Note that with the schannel and sectransp crypto backends, setting the * expected root certificate disables access to the system certificate store. * This means that the expected root certificate is the only certificate that will be trusted. - * + * * @remark This field is only used if the customer has not specified a default transport * adapter. If the customer has set a Transport adapter, this option is ignored. */ @@ -201,7 +201,8 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { * `::AzureSdkGetCustomHttpTransport()` must be linked in the end-user application. * * @remark If the caller specifies a value for Transport, then all the other options in - * TransportOptions will be ignored, since the caller will have already configured the transport. + * TransportOptions will be ignored, since the caller will have already configured the + * transport. * */ std::shared_ptr Transport; diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index f99a1ffda6..3263b8cc5e 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -406,8 +406,8 @@ CURLcode CurlSession::Perform(Context const& context) } // If we are using an HTTP proxy, connecting to an HTTP resource and it has been configured with a // username and password, we want to set the proxy authentication header. - if (m_httpProxy.HasValue() && m_request.GetUrl().GetScheme() == "http" && m_httpProxyUser.HasValue() - && m_httpProxyPassword.HasValue()) + if (m_httpProxy.HasValue() && m_request.GetUrl().GetScheme() == "http" + && m_httpProxyUser.HasValue() && m_httpProxyPassword.HasValue()) { Log::Write(Logger::Level::Verbose, LogMsgPrefix + "Setting proxy authentication header"); this->m_request.SetHeader( @@ -2130,7 +2130,8 @@ CurlConnection::CurlConnection( if (options.ProxyUsername.HasValue()) { - if (!SetLibcurlOption(m_handle, CURLOPT_PROXYUSERNAME, options.ProxyUsername.Value().c_str(), &result)) + if (!SetLibcurlOption( + m_handle, CURLOPT_PROXYUSERNAME, options.ProxyUsername.Value().c_str(), &result)) { throw TransportException( _detail::DefaultFailedToGetNewConnectionTemplate + hostDisplayName From baf15d675189521d11d47c288b968ae49c6efdb3 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 10:19:36 -0700 Subject: [PATCH 71/75] Update sdk/core/azure-core/cgmanifest.json Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> --- sdk/core/azure-core/cgmanifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/cgmanifest.json b/sdk/core/azure-core/cgmanifest.json index c4ba0a4eb8..e2a629c88f 100644 --- a/sdk/core/azure-core/cgmanifest.json +++ b/sdk/core/azure-core/cgmanifest.json @@ -29,7 +29,7 @@ "CommitHash": "f9284c19c9873664978b873b8858d7dfacc6af1e" } }, - "DevelopmentDependency": true + "DevelopmentDependency": false }, { "Component": { From ea40d1a48c990eb39f6a9b9311d8fbd998e45089 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 10:22:01 -0700 Subject: [PATCH 72/75] Added wil to vcpkg/vcpkg.json --- sdk/core/azure-core/vcpkg/vcpkg.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/core/azure-core/vcpkg/vcpkg.json b/sdk/core/azure-core/vcpkg/vcpkg.json index 5c53637162..bc300bd5c9 100644 --- a/sdk/core/azure-core/vcpkg/vcpkg.json +++ b/sdk/core/azure-core/vcpkg/vcpkg.json @@ -22,6 +22,10 @@ { "name": "vcpkg-cmake-config", "host": true + }, + { + "name": "wil", + "platform": "windows" } ], "default-features": [ From 31b805feba4e1e2b95e481b3b4ee1c2ebec7cbf3 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 12:33:01 -0700 Subject: [PATCH 73/75] More code coverage fixes --- sdk/core/azure-core/src/cryptography/md5.cpp | 6 +++--- .../azure-core/test/ut/curl_options_test.cpp | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/sdk/core/azure-core/src/cryptography/md5.cpp b/sdk/core/azure-core/src/cryptography/md5.cpp index 79a4a1210f..939c153a13 100644 --- a/sdk/core/azure-core/src/cryptography/md5.cpp +++ b/sdk/core/azure-core/src/cryptography/md5.cpp @@ -167,7 +167,7 @@ class Md5OpenSSL final : public Azure::Core::Cryptography::Hash { { if (1 != EVP_DigestUpdate(m_context, data, length)) { - throw std::runtime_error("Crypto error while updating Md5Hash."); + throw std::runtime_error("Crypto error while updating Md5Hash.");// LCOV_EXCL_LINE } } @@ -178,7 +178,7 @@ class Md5OpenSSL final : public Azure::Core::Cryptography::Hash { unsigned char hash[EVP_MAX_MD_SIZE]; if (1 != EVP_DigestFinal(m_context, hash, &size)) { - throw std::runtime_error("Crypto error while computing Md5Hash."); + throw std::runtime_error("Crypto error while computing Md5Hash.");// LCOV_EXCL_LINE } return std::vector(std::begin(hash), std::begin(hash) + size); @@ -194,7 +194,7 @@ class Md5OpenSSL final : public Azure::Core::Cryptography::Hash { } if (1 != EVP_DigestInit_ex(m_context, EVP_md5(), NULL)) { - throw std::runtime_error("Crypto error while init Md5Hash."); + throw std::runtime_error("Crypto error while init Md5Hash.");// LCOV_EXCL_LINE } } diff --git a/sdk/core/azure-core/test/ut/curl_options_test.cpp b/sdk/core/azure-core/test/ut/curl_options_test.cpp index c8dc62238c..a1ffdf3aab 100644 --- a/sdk/core/azure-core/test/ut/curl_options_test.cpp +++ b/sdk/core/azure-core/test/ut/curl_options_test.cpp @@ -15,6 +15,7 @@ #endif #include +#include #include #include "transport_adapter_base_test.hpp" @@ -95,6 +96,26 @@ namespace Azure { namespace Core { namespace Test { .ConnectionPoolIndex.clear()); } + class CurlDerived : public Azure::Core::Http::CurlTransport { + std::unique_ptr m_connection; + + public: + void OnUpgradedConnection( + std::unique_ptr&& connection) override + { + m_connection = std::move(connection); + } + }; + + // Call the base OnUpgradedConnection method from a class derived from CurlTransport - this + // primarily is there to increase code coverage. + TEST(CurlTransportOptions, OnUpgradedConnection) + { + CurlDerived derived; + std::unique_ptr connection; + derived.OnUpgradedConnection(std::move(connection)); + } + /* // Requires libcurl version >= 7.68 TEST(CurlTransportOptions, nativeCA) From 296322a4f784ce7d8909b89c50e1c18e598d8823 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 12:47:20 -0700 Subject: [PATCH 74/75] Backed out change accidentally added; clang-format --- sdk/attestation/azure-security-attestation/CMakeLists.txt | 1 - sdk/core/azure-core/src/cryptography/md5.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/attestation/azure-security-attestation/CMakeLists.txt b/sdk/attestation/azure-security-attestation/CMakeLists.txt index b336ba653d..0fd43b0753 100644 --- a/sdk/attestation/azure-security-attestation/CMakeLists.txt +++ b/sdk/attestation/azure-security-attestation/CMakeLists.txt @@ -20,7 +20,6 @@ include(AzureConfigRTTI) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if(NOT AZ_ALL_LIBRARIES) find_package(azure-core-cpp "1.5.0" CONFIG QUIET) diff --git a/sdk/core/azure-core/src/cryptography/md5.cpp b/sdk/core/azure-core/src/cryptography/md5.cpp index 939c153a13..1bfb9c23e2 100644 --- a/sdk/core/azure-core/src/cryptography/md5.cpp +++ b/sdk/core/azure-core/src/cryptography/md5.cpp @@ -167,7 +167,7 @@ class Md5OpenSSL final : public Azure::Core::Cryptography::Hash { { if (1 != EVP_DigestUpdate(m_context, data, length)) { - throw std::runtime_error("Crypto error while updating Md5Hash.");// LCOV_EXCL_LINE + throw std::runtime_error("Crypto error while updating Md5Hash."); // LCOV_EXCL_LINE } } @@ -178,7 +178,7 @@ class Md5OpenSSL final : public Azure::Core::Cryptography::Hash { unsigned char hash[EVP_MAX_MD_SIZE]; if (1 != EVP_DigestFinal(m_context, hash, &size)) { - throw std::runtime_error("Crypto error while computing Md5Hash.");// LCOV_EXCL_LINE + throw std::runtime_error("Crypto error while computing Md5Hash."); // LCOV_EXCL_LINE } return std::vector(std::begin(hash), std::begin(hash) + size); @@ -194,7 +194,7 @@ class Md5OpenSSL final : public Azure::Core::Cryptography::Hash { } if (1 != EVP_DigestInit_ex(m_context, EVP_md5(), NULL)) { - throw std::runtime_error("Crypto error while init Md5Hash.");// LCOV_EXCL_LINE + throw std::runtime_error("Crypto error while init Md5Hash."); // LCOV_EXCL_LINE } } From f2ceeebb7a66f793c8524d88551638f72858b18e Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 4 Oct 2022 13:39:37 -0700 Subject: [PATCH 75/75] flagged retry policy changes in changelog --- sdk/core/azure-core/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index c84853d5b4..3eb5860751 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -13,6 +13,12 @@ ### Breaking Changes +- Updated retry policy timeouts to conform to Azure guidelines. + - The default delay between retries is changed from 4 seconds to 800ms. + - The maximum retry delay is changed from 2 minutes to 60 seconds (one minute). + + If the original behavior is desired, customers can adjust these timeouts by changing the `RetryDelay` and `MaxRetryDelay` fields in in the `TransportOptions` structure. + ### Bugs Fixed ### Other Changes