aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Bogolyubskiy <i@bogolyubskiyalexey.ru>2022-06-06 16:47:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-06-06 16:47:12 +0300
commit614990fcbe2cb95637e3aeecc2467ae30a73b54d (patch)
tree808d1394cbadea32eabdd61b8e61a1bf0d358ead
parent00ae6ca0fc95a0f7710c47631e0cbe6f788589ac (diff)
downloadydb-614990fcbe2cb95637e3aeecc2467ae30a73b54d.tar.gz
[merge to 22-2] [ymq] don't write to log user data from response SQS-692
[ymq] don't write to log user data from response SQS-692 init REVIEW: 2608586 REVIEW: 2609342 x-ydb-stable-ref: 3599d367427ac23a54c37999a68794170c64cf3b
-rw-r--r--ydb/core/ymq/actor/proxy_actor.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/ydb/core/ymq/actor/proxy_actor.cpp b/ydb/core/ymq/actor/proxy_actor.cpp
index b482f88cce..2cad630ce2 100644
--- a/ydb/core/ymq/actor/proxy_actor.cpp
+++ b/ydb/core/ymq/actor/proxy_actor.cpp
@@ -13,6 +13,48 @@
namespace NKikimr::NSQS {
+TString SecurityPrint(const NKikimrClient::TSqsResponse& resp) {
+ switch (resp.GetResponseCase()) {
+ case NKikimrClient::TSqsResponse::kChangeMessageVisibility:
+ case NKikimrClient::TSqsResponse::kCreateQueue:
+ case NKikimrClient::TSqsResponse::kGetQueueAttributes:
+ case NKikimrClient::TSqsResponse::kDeleteMessage:
+ case NKikimrClient::TSqsResponse::kDeleteQueue:
+ case NKikimrClient::TSqsResponse::kListQueues:
+ case NKikimrClient::TSqsResponse::kPurgeQueue:
+ case NKikimrClient::TSqsResponse::kSendMessage:
+ case NKikimrClient::TSqsResponse::kSetQueueAttributes:
+ case NKikimrClient::TSqsResponse::kGetQueueUrl:
+ case NKikimrClient::TSqsResponse::kChangeMessageVisibilityBatch:
+ case NKikimrClient::TSqsResponse::kDeleteMessageBatch:
+ case NKikimrClient::TSqsResponse::kSendMessageBatch:
+ case NKikimrClient::TSqsResponse::kCreateUser:
+ case NKikimrClient::TSqsResponse::kDeleteUser:
+ case NKikimrClient::TSqsResponse::kListUsers:
+ case NKikimrClient::TSqsResponse::kModifyPermissions:
+ case NKikimrClient::TSqsResponse::kListPermissions:
+ case NKikimrClient::TSqsResponse::kDeleteQueueBatch:
+ case NKikimrClient::TSqsResponse::kPurgeQueueBatch:
+ case NKikimrClient::TSqsResponse::kGetQueueAttributesBatch:
+ case NKikimrClient::TSqsResponse::kListDeadLetterSourceQueues:
+ case NKikimrClient::TSqsResponse::kCountQueues:{
+ return TStringBuilder() << resp;
+ }
+ case NKikimrClient::TSqsResponse::kReceiveMessage: {
+ NKikimrClient::TSqsResponse respCopy = resp;
+ for (auto& msg : *respCopy.MutableReceiveMessage()->MutableMessages()) {
+ msg.SetData(TStringBuilder() << "[...user_data_" << msg.GetData().size() << "bytes" << "...]");
+ }
+ return TStringBuilder() << respCopy;
+ }
+ default: {
+ return TStringBuilder() << "unsupported to print response with case=" << static_cast<ui64>(resp.GetResponseCase()) << "request=" << resp.GetRequestId();
+ }
+ }
+ Y_VERIFY(false);
+}
+
+
void TProxyActor::Bootstrap() {
this->Become(&TProxyActor::StateFunc);
@@ -94,7 +136,7 @@ void TProxyActor::SendReplyAndDie(const NKikimrClient::TSqsResponse& resp) {
if (ErrorResponse_) {
RLOG_SQS_WARN("Sending error reply from proxy actor: " << resp);
} else {
- RLOG_SQS_DEBUG("Sending reply from proxy actor: " << resp);
+ RLOG_SQS_DEBUG("Sending reply from proxy actor: " << SecurityPrint(resp));
}
Cb_->DoSendReply(resp);
PassAway();