Skip to content

Commit

Permalink
Merge 0452ce7 into 69bc320
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriyPA authored Mar 19, 2024
2 parents 69bc320 + 0452ce7 commit 5615584
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ydb/library/yql/providers/yt/provider/yql_yt_datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ class TYtDataSource : public TDataProviderBase {
const TString& token = properties.Value("token", "");

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

TYtClusterConfig cluster;
cluster.SetName(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class TYtDqIntegration: public TDqIntegrationBase {
if (auto maybeYtReadTable = TMaybeNode<TYtReadTable>(read)) {
TMaybeNode<TCoSecureParam> secParams;
const auto cluster = maybeYtReadTable.Cast().DataSource().Cluster();
if (State_->Configuration->Auth.Get().GetOrElse(TString()) || State_->Configuration->Tokens.contains(cluster)) {
if (State_->Configuration->Auth.Get().GetOrElse(TString()) || State_->Configuration->Tokens.Value(cluster, "")) {
secParams = Build<TCoSecureParam>(ctx, read->Pos()).Name().Build(TString("cluster:default_").append(cluster)).Done();
}
return Build<TDqReadWrap>(ctx, read->Pos())
Expand Down

0 comments on commit 5615584

Please sign in to comment.