aboutsummaryrefslogtreecommitdiffstats
path: root/yt/cpp
diff options
context:
space:
mode:
authoriudovin <iudovin@yandex-team.com>2024-08-09 11:30:38 +0300
committeriudovin <iudovin@yandex-team.com>2024-08-09 11:43:50 +0300
commit62ccfdc1ce4ac9894be1609fb76b7fc9d51df018 (patch)
tree125cd8ffea237fe360026fdfc1dbf78761a86efd /yt/cpp
parent01c244076acb5711ad2b8ac37a218888494055b2 (diff)
downloadydb-62ccfdc1ce4ac9894be1609fb76b7fc9d51df018.tar.gz
Fix transaction pinger tvm auth
675586a233e3aba3e3f532d76dc228ad0f72ad93
Diffstat (limited to 'yt/cpp')
-rw-r--r--yt/cpp/mapreduce/client/transaction_pinger.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/yt/cpp/mapreduce/client/transaction_pinger.cpp b/yt/cpp/mapreduce/client/transaction_pinger.cpp
index 314fa2957b..3b6ff2efc5 100644
--- a/yt/cpp/mapreduce/client/transaction_pinger.cpp
+++ b/yt/cpp/mapreduce/client/transaction_pinger.cpp
@@ -5,6 +5,7 @@
#include <yt/cpp/mapreduce/interface/config.h>
#include <yt/cpp/mapreduce/interface/error_codes.h>
#include <yt/cpp/mapreduce/interface/logging/yt_log.h>
+#include <yt/cpp/mapreduce/interface/tvm.h>
#include <yt/cpp/mapreduce/common/wait_proxy.h>
#include <yt/cpp/mapreduce/common/retry_lib.h>
@@ -70,8 +71,10 @@ void PingTx(NHttp::IClientPtr httpClient, const TPingableTransaction& tx)
headers->Add("Host", url);
headers->Add("User-Agent", TProcessState::Get()->ClientVersion);
- const auto& token = tx.GetContext().Token;
- if (!token.empty()) {
+ if (const auto& serviceTicketAuth = tx.GetContext().ServiceTicketAuth) {
+ const auto serviceTicket = serviceTicketAuth->Ptr->IssueServiceTicket();
+ headers->Add("X-Ya-Service-Ticket", serviceTicket);
+ } else if (const auto& token = tx.GetContext().Token; !token.empty()) {
headers->Add("Authorization", "OAuth " + token);
}