From 2c8143a702af04d6779622b2ea050ed77f7b530b Mon Sep 17 00:00:00 2001 From: JinmingHu Date: Fri, 27 Oct 2023 10:12:03 +0800 Subject: [PATCH] Fix the regex to match client secret in OAuth requests, ignore `Cookie` when matching requests (#5070) Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Co-authored-by: microzchang --- sdk/core/azure-core-test/src/test_proxy_manager.cpp | 5 ++++- sdk/storage/assets.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/core/azure-core-test/src/test_proxy_manager.cpp b/sdk/core/azure-core-test/src/test_proxy_manager.cpp index afcaef32c..6d21f0909 100644 --- a/sdk/core/azure-core-test/src/test_proxy_manager.cpp +++ b/sdk/core/azure-core-test/src/test_proxy_manager.cpp @@ -242,7 +242,9 @@ void TestProxyManager::SetProxySanitizer() addSanitizer(SanitizerType::General, g_accountRegex, "account"); addSanitizer( - SanitizerType::Body, "client_secret=(?[a-zA-Z0-9\\%]+)", "clientsecret"); + SanitizerType::Body, + "client_secret=(?[a-zA-Z0-9\\%_~\\-\\.]+)", + "clientsecret"); const std::string storageSasSignatureRegex = "\\?.*sig=(?[a-zA-Z0-9\\%\\/+=]+)"; addSanitizer(SanitizerType::Uri, storageSasSignatureRegex, "sassig"); addSanitizer(SanitizerType::Header, storageSasSignatureRegex, "sassig", "x-ms-copy-source"); @@ -266,6 +268,7 @@ void TestProxyManager::SetProxySanitizer() const std::vector excludedHeaders = { "Expect", "Connection", + "Cookie", }; jsonRoot["excludedHeaders"] = std::accumulate( excludedHeaders.begin(), diff --git a/sdk/storage/assets.json b/sdk/storage/assets.json index 3884b0c46..1ca6d58c9 100644 --- a/sdk/storage/assets.json +++ b/sdk/storage/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "cpp", "TagPrefix": "cpp/storage", - "Tag": "cpp/storage_5ae381f797" + "Tag": "cpp/storage_f8b8f80b3c" }