aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-12-16 11:07:00 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-12-16 11:39:12 +0300
commit1cf043797ad3677c3d0a54f979f9276566f87e56 (patch)
treef0b0d60a6dda8cef6c2ba0aa09ccf91fd46e04ee /yql/essentials
parent298c87e7f86b567bfb7ff820bf713ba4c4337ba8 (diff)
downloadydb-1cf043797ad3677c3d0a54f979f9276566f87e56.tar.gz
Intermediate changes
commit_hash:71505d9b4c79d9a466594ad4a98440be1a183837
Diffstat (limited to 'yql/essentials')
-rw-r--r--yql/essentials/core/url_lister/url_lister_manager.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/yql/essentials/core/url_lister/url_lister_manager.cpp b/yql/essentials/core/url_lister/url_lister_manager.cpp
index fddf005fa0..ead04ad683 100644
--- a/yql/essentials/core/url_lister/url_lister_manager.cpp
+++ b/yql/essentials/core/url_lister/url_lister_manager.cpp
@@ -3,6 +3,10 @@
#include <yql/essentials/ast/yql_expr.h>
#include <yql/essentials/utils/fetch/fetch.h>
+#include <util/generic/maybe.h>
+
+#include <tuple>
+
namespace NYql::NPrivate {
@@ -20,11 +24,12 @@ public:
auto urlWithoutParameters = SubstParameters(url, Parameters, nullptr);
auto preprocessedUrl = urlWithoutParameters;
+ TString alias;
if (UrlPreprocessing) {
- preprocessedUrl = UrlPreprocessing->Preprocess(urlWithoutParameters).first;
+ std::tie(preprocessedUrl, alias) = UrlPreprocessing->Preprocess(urlWithoutParameters);
}
- TString token;
+ TMaybe<TString> token;
if (tokenName) {
if (!Credentials) {
ythrow yexception() << "Missing credentials";
@@ -38,9 +43,17 @@ public:
token = credential->Content;
}
+ if (!token && alias && Credentials) {
+ if (auto credential = Credentials->FindCredential("default_" + alias)) {
+ token = credential->Content;
+ }
+ }
+
+ token = token.OrElse("");
+
for (const auto& urlLister: UrlListers) {
if (urlLister->Accept(preprocessedUrl)) {
- return urlLister->ListUrl(preprocessedUrl, token);
+ return urlLister->ListUrl(preprocessedUrl, *token);
}
}