Skip to content

Commit b390c9d

Browse files
Don't use GetRawData for logging (#10450)
1 parent 341b429 commit b390c9d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

ydb/core/fq/libs/compute/ydb/control_plane/monitoring_rest_client_actor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class TMonitoringRestServiceActor : public NActors::TActor<TMonitoringRestServic
5656
.Build()
5757
);
5858
auto ticket = CredentialsProvider->GetAuthInfo();
59-
LOG_D(httpRequest->GetRawData() << " using ticket " << NKikimr::MaskTicket(ticket));
59+
LOG_D(httpRequest->GetObfuscatedData() << " using ticket " << NKikimr::MaskTicket(ticket));
6060
httpRequest->Set("Authorization", ticket);
6161

6262
auto httpSenderId = Register(NYql::NDq::CreateHttpSenderActor(SelfId(), HttpProxyId, NYql::NDq::THttpSenderRetryPolicy::GetNoRetryPolicy()));
@@ -83,7 +83,7 @@ class TMonitoringRestServiceActor : public NActors::TActor<TMonitoringRestServic
8383
forwardResponse->Issues.AddIssue(error);
8484
Send(request->Sender, forwardResponse.release(), 0, request->Cookie);
8585
return;
86-
}
86+
}
8787

8888
try {
8989
NJson::TJsonReaderConfig jsonConfig;

ydb/library/actors/http/http.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,13 @@ class THttpResponse {
199199

200200
template <typename HeaderType, typename BufferType>
201201
class THttpBase : public HeaderType, public BufferType {
202-
public:
202+
protected:
203+
// Returns raw, non-obfuscated data
203204
TStringBuf GetRawData() const {
204205
return TStringBuf(BufferType::Data(), BufferType::Size());
205206
}
206207

208+
public:
207209
TString GetObfuscatedData() const {
208210
THeaders headers(HeaderType::Headers);
209211
TStringBuf authorization(headers["Authorization"]);

ydb/mvp/oidc_proxy/oidc_protected_page.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void THandlerSessionServiceCheck::HandleProxy(NHttp::TEvHttpProxy::TEvHttpIncomi
5353
}
5454
} else {
5555
static constexpr size_t MAX_LOGGED_SIZE = 1024;
56-
LOG_DEBUG_S(ctx, EService::MVP, "Can not process request to protected resource:\n" << event->Get()->Request->GetRawData().substr(0, MAX_LOGGED_SIZE));
56+
LOG_DEBUG_S(ctx, EService::MVP, "Can not process request to protected resource:\n" << event->Get()->Request->GetObfuscatedData().substr(0, MAX_LOGGED_SIZE));
5757
httpResponse = CreateResponseForNotExistingResponseFromProtectedResource(event->Get()->GetError());
5858
}
5959
ctx.Send(Sender, new NHttp::TEvHttpProxy::TEvHttpOutgoingResponse(httpResponse));

0 commit comments

Comments
 (0)