From 160f30becb5fc81f3a404f076c70e46d90397b69 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 22 Nov 2025 15:55:58 +0100 Subject: [PATCH] refactor: Rename k_redacted_password to k_redacted_secret --- src/ccache/storage/remote/httpstorage.cpp | 4 ++-- src/ccache/storage/remote/redisstorage.cpp | 4 ++-- src/ccache/storage/storage.cpp | 2 +- src/ccache/storage/storage.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ccache/storage/remote/httpstorage.cpp b/src/ccache/storage/remote/httpstorage.cpp index d3aacc58..be4d7afe 100644 --- a/src/ccache/storage/remote/httpstorage.cpp +++ b/src/ccache/storage/remote/httpstorage.cpp @@ -321,8 +321,8 @@ HttpStorage::redact_secrets(std::vector& attributes) const return attr.key == "bearer-token"; }); if (bearer_token_attribute != attributes.end()) { - bearer_token_attribute->value = storage::k_redacted_password; - bearer_token_attribute->raw_value = storage::k_redacted_password; + bearer_token_attribute->value = storage::k_redacted_secret; + bearer_token_attribute->raw_value = storage::k_redacted_secret; } } diff --git a/src/ccache/storage/remote/redisstorage.cpp b/src/ccache/storage/remote/redisstorage.cpp index 53151016..bd163e7d 100644 --- a/src/ccache/storage/remote/redisstorage.cpp +++ b/src/ccache/storage/remote/redisstorage.cpp @@ -310,12 +310,12 @@ RedisStorageBackend::authenticate(const Url& url) if (password) { if (user) { // redis://user:password@host - LOG("Redis AUTH {} {}", *user, storage::k_redacted_password); + LOG("Redis AUTH {} {}", *user, storage::k_redacted_secret); util::value_or_throw( redis_command("AUTH %s %s", user->c_str(), password->c_str())); } else { // redis://password@host - LOG("Redis AUTH {}", storage::k_redacted_password); + LOG("Redis AUTH {}", storage::k_redacted_secret); util::value_or_throw(redis_command("AUTH %s", password->c_str())); } } diff --git a/src/ccache/storage/storage.cpp b/src/ccache/storage/storage.cpp index 29501634..c9ce6c35 100644 --- a/src/ccache/storage/storage.cpp +++ b/src/ccache/storage/storage.cpp @@ -250,7 +250,7 @@ get_redacted_url_str_for_logging(const Url& url) { Url redacted_url(url); if (!url.user_info().empty()) { - redacted_url.user_info(k_redacted_password); + redacted_url.user_info(k_redacted_secret); } return redacted_url.str(); } diff --git a/src/ccache/storage/storage.hpp b/src/ccache/storage/storage.hpp index 6a8a9eff..5fa22edc 100644 --- a/src/ccache/storage/storage.hpp +++ b/src/ccache/storage/storage.hpp @@ -36,7 +36,7 @@ namespace storage { -constexpr auto k_redacted_password = "********"; +constexpr auto k_redacted_secret = "********"; std::vector get_features(); -- 2.47.3