aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbbiff <bbiff@yandex-team.com>2022-09-01 11:03:19 +0300
committerbbiff <bbiff@yandex-team.com>2022-09-01 11:03:19 +0300
commitefcc81d2e83c5cdf710b08669626067def17340f (patch)
tree8c620326451aac61688629b9a841898cda2b8c55
parentcc3dd66211358c885715bc6dc0ab24283d040dea (diff)
downloadydb-efcc81d2e83c5cdf710b08669626067def17340f.tar.gz
PR from branch users/bbiff/
added visibility filter staging changes yq_client visibility filter
-rw-r--r--ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_bindings.cpp5
-rw-r--r--ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_connections.cpp6
-rw-r--r--ydb/public/api/protos/fq.proto2
-rw-r--r--ydb/public/api/protos/yq.proto1
4 files changed, 14 insertions, 0 deletions
diff --git a/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_bindings.cpp b/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_bindings.cpp
index 18f0cc999a..d277f5b070 100644
--- a/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_bindings.cpp
+++ b/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_bindings.cpp
@@ -204,6 +204,11 @@ void TYdbControlPlaneStorageActor::Handle(TEvControlPlaneStorage::TEvListBinding
filters.push_back("`" USER_COLUMN_NAME "` = $user");
}
+ if (request.filter().visibility() != YandexQuery::Acl::VISIBILITY_UNSPECIFIED) {
+ queryBuilder.AddInt64("visibility", request.filter().visibility());
+ filters.push_back("`" VISIBILITY_COLUMN_NAME "` = $visibility");
+ }
+
filter = JoinSeq(" AND ", filters);
}
diff --git a/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_connections.cpp b/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_connections.cpp
index efe5efb184..40a0aaa38d 100644
--- a/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_connections.cpp
+++ b/ydb/core/yq/libs/control_plane_storage/ydb_control_plane_storage_connections.cpp
@@ -108,6 +108,7 @@ void TYdbControlPlaneStorageActor::Handle(TEvControlPlaneStorage::TEvCreateConne
validators.push_back(validatorCountConnections);
const auto query = queryBuilder.Build();
+
auto debugInfo = Config.Proto.GetEnableDebugMode() ? std::make_shared<TDebugInfo>() : TDebugInfoPtr{};
TAsyncStatus result = Write(NActors::TActivationContext::ActorSystem(), query.Sql, query.Params, requestCounters, debugInfo, validators);
auto prepare = [response] { return *response; };
@@ -196,6 +197,11 @@ void TYdbControlPlaneStorageActor::Handle(TEvControlPlaneStorage::TEvListConnect
filters.push_back("`" CONNECTION_TYPE_COLUMN_NAME "` = $connection_type");
}
+ if (request.filter().visibility() != YandexQuery::Acl::VISIBILITY_UNSPECIFIED) {
+ queryBuilder.AddInt64("visibility", request.filter().visibility());
+ filters.push_back("`" VISIBILITY_COLUMN_NAME "` = $visibility");
+ }
+
filter = JoinSeq(" AND ", filters);
}
diff --git a/ydb/public/api/protos/fq.proto b/ydb/public/api/protos/fq.proto
index 4424cd46aa..357dd1ac04 100644
--- a/ydb/public/api/protos/fq.proto
+++ b/ydb/public/api/protos/fq.proto
@@ -519,6 +519,7 @@ message ListConnectionsRequest {
string name = 1 [(Ydb.length).le = 1024]; // connections whose name contains the filter.name substring
bool created_by_me = 2;
ConnectionSetting.ConnectionType connection_type = 3;
+ Acl.Visibility visibility = 4;
}
Filter filter = 4;
}
@@ -734,6 +735,7 @@ message ListBindingsRequest {
string connection_id = 1 [(Ydb.length).le = 1024];
string name = 2 [(Ydb.length).le = 1024]; // bindings whose name contains the filter.name substring
bool created_by_me = 3;
+ Acl.Visibility visibility = 4;
}
Filter filter = 4;
}
diff --git a/ydb/public/api/protos/yq.proto b/ydb/public/api/protos/yq.proto
index 0645b88656..3683722c12 100644
--- a/ydb/public/api/protos/yq.proto
+++ b/ydb/public/api/protos/yq.proto
@@ -522,6 +522,7 @@ message ListConnectionsRequest {
string name = 1 [(Ydb.length).le = 1024]; // connections whose name contains the filter.name substring
bool created_by_me = 2;
ConnectionSetting.ConnectionType connection_type = 3;
+ Acl.Visibility visibility = 4;
}
Filter filter = 4;
}