Skip to content

Commit ce6f23b

Browse files
authored
Fixed error due to empty token (#2966)
1 parent d6681e8 commit ce6f23b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ydb/library/yql/providers/yt/provider/yql_yt_datasource.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ class TYtDataSource : public TDataProviderBase {
9999
const TString& token = properties.Value("token", "");
100100

101101
State_->Configuration->AddValidCluster(name);
102-
State_->Configuration->Tokens[name] = ComposeStructuredTokenJsonForTokenAuthWithSecret(properties.Value("tokenReference", ""), token);
102+
if (token) {
103+
// Empty token is forbidden for yt reader
104+
State_->Configuration->Tokens[name] = ComposeStructuredTokenJsonForTokenAuthWithSecret(properties.Value("tokenReference", ""), token);
105+
}
103106

104107
TYtClusterConfig cluster;
105108
cluster.SetName(name);

ydb/library/yql/providers/yt/provider/yql_yt_dq_integration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ class TYtDqIntegration: public TDqIntegrationBase {
507507
if (auto maybeYtReadTable = TMaybeNode<TYtReadTable>(read)) {
508508
TMaybeNode<TCoSecureParam> secParams;
509509
const auto cluster = maybeYtReadTable.Cast().DataSource().Cluster();
510-
if (State_->Configuration->Auth.Get().GetOrElse(TString()) || State_->Configuration->Tokens.contains(cluster)) {
510+
if (State_->Configuration->Auth.Get().GetOrElse(TString()) || State_->Configuration->Tokens.Value(cluster, "")) {
511511
secParams = Build<TCoSecureParam>(ctx, read->Pos()).Name().Build(TString("cluster:default_").append(cluster)).Done();
512512
}
513513
return Build<TDqReadWrap>(ctx, read->Pos())

0 commit comments

Comments
 (0)