From a20770c172359e88dc53bd4ea7bb026102c88456 Mon Sep 17 00:00:00 2001 From: xige-16 Date: Thu, 1 Dec 2022 10:35:16 +0800 Subject: [PATCH] Delete logs that print sensitive information (#20889) Signed-off-by: xige-16 Signed-off-by: xige-16 --- internal/core/src/storage/MinioChunkManager.cpp | 15 +++++++-------- internal/core/unittest/test_retrieve.cpp | 1 - 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/internal/core/src/storage/MinioChunkManager.cpp b/internal/core/src/storage/MinioChunkManager.cpp index d32c01cdd4..e7f9dff70f 100644 --- a/internal/core/src/storage/MinioChunkManager.cpp +++ b/internal/core/src/storage/MinioChunkManager.cpp @@ -102,13 +102,13 @@ MinioChunkManager::MinioChunkManager(const StorageConfig& storage_config) if (storage_config.useIAM) { auto provider = std::make_shared(); + auto aws_credentials = provider->GetAWSCredentials(); + AssertInfo(!aws_credentials.GetAWSAccessKeyId().empty(), "if use iam, access key id should not be empty"); + AssertInfo(!aws_credentials.GetAWSSecretKey().empty(), "if use iam, secret key should not be empty"); + AssertInfo(!aws_credentials.GetSessionToken().empty(), "if use iam, token should not be empty"); + client_ = std::make_shared(provider, config, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never, false); - - LOG_SEGCORE_INFO_C << "use iam mode, credentials{ access_id:" - << provider->GetAWSCredentials().GetAWSAccessKeyId() - << " access_key:" << provider->GetAWSCredentials().GetAWSSecretKey() - << " token:" << provider->GetAWSCredentials().GetSessionToken() << "}"; } else { AssertInfo(!storage_config.access_key_id.empty(), "if not use iam, access key should not be empty"); AssertInfo(!storage_config.access_key_value.empty(), "if not use iam, access value should not be empty"); @@ -127,9 +127,8 @@ MinioChunkManager::MinioChunkManager(const StorageConfig& storage_config) // } LOG_SEGCORE_INFO_C << "init MinioChunkManager with parameter[endpoint: '" << storage_config.address - << "', access_key:'" << storage_config.access_key_id << "', access_value:'" - << storage_config.access_key_value << "', default_bucket_name:'" << storage_config.bucket_name - << "', use_secure:'" << std::boolalpha << storage_config.useSSL << "']"; + << "', default_bucket_name:'" << storage_config.bucket_name << "', use_secure:'" + << std::boolalpha << storage_config.useSSL << "']"; } MinioChunkManager::~MinioChunkManager() { diff --git a/internal/core/unittest/test_retrieve.cpp b/internal/core/unittest/test_retrieve.cpp index fe5f3040f1..fd22aa8e33 100644 --- a/internal/core/unittest/test_retrieve.cpp +++ b/internal/core/unittest/test_retrieve.cpp @@ -333,7 +333,6 @@ TEST(Retrieve, Delete) { Assert(field2.has_vectors()); auto field2_data = field2.vectors().float_vector(); ASSERT_EQ(field2_data.data_size(), DIM * req_size); - } int64_t row_count = 0;