gavinchou commented on code in PR #43544:
URL: https://github.com/apache/doris/pull/43544#discussion_r1836568283
##########
cloud/src/meta-service/meta_service_helper.h:
##########
@@ -101,7 +116,25 @@ void finish_rpc(std::string_view func_name,
brpc::Controller* ctrl, Response* re
LOG(INFO) << "finish " << func_name << " from " << ctrl->remote_side()
<< " status=" << res->status().ShortDebugString()
<< " delete_bitmap_size=" <<
res->segment_delete_bitmaps_size();
-
+ } else if constexpr (std::is_same_v<Response, GetObjStoreInfoRequest> ||
+ std::is_same_v<Response, GetStageRequest>) {
+ std::string debug_string = res->DebugString();
+ // Check if "sk" field exists in the debug string, assuming "sk"
appears as "sk: value"
+ size_t pos = debug_string.find("sk: ");
+ if (pos != std::string::npos) {
+ // Found "sk" field, extract its value and perform MD5 encryption
+ size_t sk_value_start = debug_string.find('\"', pos) + 1;
+ size_t sk_value_end = debug_string.find('\"', sk_value_start);
+
+ std::string sk_value =
+ debug_string.substr(sk_value_start, sk_value_end -
sk_value_start);
+ std::string encrypted_sk = md5(sk_value);
+
+ // Replace the original "sk" value with the encrypted MD5 value
+ debug_string.replace(sk_value_start, sk_value_end -
sk_value_start, encrypted_sk);
Review Comment:
meta_service.cpp
`TEST_SYNC_PIONT("sk response", &debug_string);`
test.cpp
```
SyncPoint::set_callback("sk response", [](args) {
EXPECT_NE(((string*) args[0])->find("sk: xxxx"), std::string::npos);
}
);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]