File aws-patches.patch of Package milvus

From 38849e52ea2eeec3c681ce7a3fc124aa41c5b91d Mon Sep 17 00:00:00 2001
From: Christian Goll <cgoll@suse.com>
Date: Mon, 27 Jan 2025 11:06:25 +0100
Subject: [PATCH] aws patches

Signed-off-by: Christian Goll <cgoll@suse.com>
---
 internal/core/src/storage/AliyunSTSClient.cpp       | 2 +-
 internal/core/src/storage/ChunkManager.cpp          | 2 ++
 internal/core/src/storage/MinioChunkManager.cpp     | 2 ++
 internal/core/src/storage/MinioChunkManager.h       | 2 ++
 internal/core/src/storage/TencentCloudSTSClient.cpp | 2 +-
 5 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/internal/core/src/storage/AliyunSTSClient.cpp b/internal/core/src/storage/AliyunSTSClient.cpp
index cf54f9d4..f604aff2 100644
--- a/internal/core/src/storage/AliyunSTSClient.cpp
+++ b/internal/core/src/storage/AliyunSTSClient.cpp
@@ -124,7 +124,7 @@ AliyunSTSCredentialsClient::GetAssumeRoleWithWebIdentityCredentials(
             Aws::Http::HttpMethod::HTTP_POST,
             Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
 
-    httpRequest->SetUserAgent(Aws::Client::ComputeUserAgentString());
+    httpRequest->SetUserAgent(Aws::Client::ComputeUserAgentString(nullptr));
 
     std::shared_ptr<Aws::IOStream> body =
         Aws::MakeShared<Aws::StringStream>("STS_RESOURCE_CLIENT_LOG_TAG");
diff --git a/internal/core/src/storage/ChunkManager.cpp b/internal/core/src/storage/ChunkManager.cpp
index c6d89086..072d020b 100644
--- a/internal/core/src/storage/ChunkManager.cpp
+++ b/internal/core/src/storage/ChunkManager.cpp
@@ -122,6 +122,7 @@ GcpChunkManager::GcpChunkManager(const StorageConfig& storage_config) {
     default_bucket_name_ = storage_config.bucket_name;
     remote_root_path_ = storage_config.root_path;
 
+    /*
     if (storage_config.useIAM) {
         sdk_options_.httpOptions.httpClientFactory_create_fn = []() {
             auto credentials = std::make_shared<
@@ -131,6 +132,7 @@ GcpChunkManager::GcpChunkManager(const StorageConfig& storage_config) {
                 GOOGLE_CLIENT_FACTORY_ALLOCATION_TAG, credentials);
         };
     }
+    */
 
     InitSDKAPIDefault(storage_config.log_level);
 
diff --git a/internal/core/src/storage/MinioChunkManager.cpp b/internal/core/src/storage/MinioChunkManager.cpp
index d1a26917..151adee6 100644
--- a/internal/core/src/storage/MinioChunkManager.cpp
+++ b/internal/core/src/storage/MinioChunkManager.cpp
@@ -106,6 +106,7 @@ MinioChunkManager::InitSDKAPI(RemoteStorageType type,
         sigemptyset(&psa.sa_mask);
         sigaddset(&psa.sa_mask, SIGPIPE);
         sigaction(SIGPIPE, &psa, 0);
+        /*
         if (type == RemoteStorageType::GOOGLE_CLOUD && useIAM) {
             sdk_options_.httpOptions.httpClientFactory_create_fn = []() {
                 auto credentials = std::make_shared<
@@ -115,6 +116,7 @@ MinioChunkManager::InitSDKAPI(RemoteStorageType type,
                     GOOGLE_CLIENT_FACTORY_ALLOCATION_TAG, credentials);
             };
         }
+        */
         LOG_INFO("init aws with log level:{}", log_level_str);
         auto get_aws_log_level = [](const std::string& level_str) {
             Aws::Utils::Logging::LogLevel level =
diff --git a/internal/core/src/storage/MinioChunkManager.h b/internal/core/src/storage/MinioChunkManager.h
index 0760bb99..3884f6ef 100644
--- a/internal/core/src/storage/MinioChunkManager.h
+++ b/internal/core/src/storage/MinioChunkManager.h
@@ -313,6 +313,7 @@ class GoogleHttpClientFactory : public Aws::Http::HttpClientFactory {
             Aws::MakeShared<Aws::Http::Standard::StandardHttpRequest>(
                 GOOGLE_CLIENT_FACTORY_ALLOCATION_TAG, uri, method);
         request->SetResponseStreamFactory(streamFactory);
+        /*
         auto auth_header = credentials_->AuthorizationHeader();
         if (!auth_header.ok()) {
             PanicInfo(
@@ -323,6 +324,7 @@ class GoogleHttpClientFactory : public Aws::Http::HttpClientFactory {
         request->SetHeaderValue(auth_header->first.c_str(),
                                 auth_header->second.c_str());
 
+        */
         return request;
     }
 
diff --git a/internal/core/src/storage/TencentCloudSTSClient.cpp b/internal/core/src/storage/TencentCloudSTSClient.cpp
index 18915c2b..81cfdfe3 100644
--- a/internal/core/src/storage/TencentCloudSTSClient.cpp
+++ b/internal/core/src/storage/TencentCloudSTSClient.cpp
@@ -85,7 +85,7 @@ TencentCloudSTSCredentialsClient::GetAssumeRoleWithWebIdentityCredentials(
             Aws::Http::HttpMethod::HTTP_POST,
             Aws::Utils::Stream::DefaultResponseStreamFactoryMethod));
 
-    httpRequest->SetUserAgent(Aws::Client::ComputeUserAgentString());
+    httpRequest->SetUserAgent(Aws::Client::ComputeUserAgentString(nullptr));
     httpRequest->SetHeaderValue("Authorization", "SKIP");
     httpRequest->SetHeaderValue("Host", "sts.tencentcloudapi.com");
     httpRequest->SetHeaderValue("X-TC-Action", "AssumeRoleWithWebIdentity");
-- 
2.43.0

openSUSE Build Service is sponsored by