diff options
author | DMokhnatkin <dmitriy.mokhnatkin@gmail.com> | 2022-05-27 23:12:19 +0300 |
---|---|---|
committer | DMokhnatkin <dmitriy.mokhnatkin@gmail.com> | 2022-05-27 23:12:19 +0300 |
commit | 92388697e54c5e532f61d04f20070b9a244ea02c (patch) | |
tree | 2fe27564cf71b6645f72787a290f41cb253f17f3 | |
parent | 6a8c6ddbf2e38b4836785a795a5ea48c483db210 (diff) | |
download | ydb-92388697e54c5e532f61d04f20070b9a244ea02c.tar.gz |
YQ-1055: rename x-yq-scope
ref:63400771126de842756857d4d9d7f3870b470986
-rw-r--r-- | ydb/core/grpc_services/rpc_yq.cpp | 10 | ||||
-rw-r--r-- | ydb/core/grpc_services/service_yq.h | 5 | ||||
-rw-r--r-- | ydb/public/lib/yq/helpers.h | 6 |
3 files changed, 15 insertions, 6 deletions
diff --git a/ydb/core/grpc_services/rpc_yq.cpp b/ydb/core/grpc_services/rpc_yq.cpp index 7caf783442..094a691ebd 100644 --- a/ydb/core/grpc_services/rpc_yq.cpp +++ b/ydb/core/grpc_services/rpc_yq.cpp @@ -66,15 +66,19 @@ public: } Token = *authToken; - const TString scope = Request_->GetPeerMetaValues("x-yq-scope").GetOrElse(""); + TString scope = Request_->GetPeerMetaValues("x-fq-scope").GetOrElse(""); + if (scope.empty()) { + scope = Request_->GetPeerMetaValues("x-yq-scope").GetOrElse(""); // TODO: remove YQ-1055 + } + if (!scope.StartsWith("yandexcloud://")) { - ReplyWithStatus("x-yq-scope should start with yandexcloud:// but got " + scope, StatusIds::BAD_REQUEST); + ReplyWithStatus("x-fq-scope should start with yandexcloud:// but got " + scope, StatusIds::BAD_REQUEST); return; } const TVector<TString> path = StringSplitter(scope).Split('/').SkipEmpty(); if (path.size() != 2 && path.size() != 3) { - ReplyWithStatus("x-yq-scope format is invalid. Must be yandexcloud://folder_id, but got " + scope, StatusIds::BAD_REQUEST); + ReplyWithStatus("x-fq-scope format is invalid. Must be yandexcloud://folder_id, but got " + scope, StatusIds::BAD_REQUEST); return; } diff --git a/ydb/core/grpc_services/service_yq.h b/ydb/core/grpc_services/service_yq.h index 3beb78c191..d64051aec1 100644 --- a/ydb/core/grpc_services/service_yq.h +++ b/ydb/core/grpc_services/service_yq.h @@ -30,7 +30,10 @@ public: } bool TryCustomAttributeProcess(const TSchemeBoardEvents::TDescribeSchemeResult& , ICheckerIface* iface) override { - const TString scope = GetPeerMetaValues("x-yq-scope").GetOrElse(""); + TString scope = GetPeerMetaValues("x-fq-scope").GetOrElse(""); + if (scope.empty()) { + scope = GetPeerMetaValues("x-yq-scope").GetOrElse(""); // TODO: remove YQ-1055 + } if (scope.StartsWith("yandexcloud://")) { const TVector<TString> path = StringSplitter(scope).Split('/').SkipEmpty(); if (path.size() == 2 || path.size() == 3) { diff --git a/ydb/public/lib/yq/helpers.h b/ydb/public/lib/yq/helpers.h index f07331f38f..10f64dd6a3 100644 --- a/ydb/public/lib/yq/helpers.h +++ b/ydb/public/lib/yq/helpers.h @@ -9,7 +9,8 @@ template<typename T> T CreateYqSettings(const TString& folderId) { T settings; - settings.Header_ = {{ "x-yq-scope", TScope::YandexCloudScopeSchema + "://" + folderId }}; + settings.Header_ = {{ "x-yq-scope", TScope::YandexCloudScopeSchema + "://" + folderId }}; // TODO: remove YQ-1055 + settings.Header_ = {{ "x-fq-scope", TScope::YandexCloudScopeSchema + "://" + folderId }}; return settings; } @@ -17,7 +18,8 @@ template<typename T> T CreateYqSettings(const TScope& scope) { T settings; - settings.Header_ = {{ "x-yq-scope", scope.ToString() }}; + settings.Header_ = {{ "x-yq-scope", scope.ToString() }}; // TODO: remove YQ-1055 + settings.Header_ = {{ "x-fq-scope", scope.ToString() }}; return settings; } |