File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ class Properties
160160 const std::string& key = kv.first ;
161161 const std::string value = kv.second .toString ();
162162
163- static const std::regex reSensitiveKey (R"( .+\.password|.+\.username|.+secret)" );
163+ static const std::regex reSensitiveKey (R"( .+\.password|.+\.username|.+secret|.+key|.+pem )" );
164164 const bool isSensitive = std::regex_match (key, reSensitiveKey);
165165
166166 ret.append (ret.empty () ? " " : " |" ).append (key).append (" =" ).append (isSensitive ? " *" : value);
Original file line number Diff line number Diff line change @@ -120,7 +120,9 @@ TEST(Properties, SensitiveProperties)
120120 { " ssl.keystore.password" , { " passwordB" } },
121121 { " sasl.username" , { " userName" } },
122122 { " sasl.password" , { " passwordC" } },
123+ { " ssl.key.pem" , { " pem" } },
124+ { " ssl_key" , { " key" } },
123125 }};
124126
125- EXPECT_EQ (" sasl.password=*|sasl.username=*|ssl.key.password=*|ssl.keystore.password=*" , props.toString ());
127+ EXPECT_EQ (" sasl.password=*|sasl.username=*|ssl.key.password=*|ssl.key.pem=*|ssl. keystore.password=*|ssl_key =*" , props.toString ());
126128}
You can’t perform that action at this time.
0 commit comments