@@ -42,6 +42,35 @@ void TGRpcTopicService::DoUpdateOffsetsInTransaction(std::unique_ptr<IRequestOpC
42
42
TActivationContext::AsActorContext ().Register (new TUpdateOffsetsInTransactionActor (p.release ()));
43
43
}
44
44
45
+ namespace {
46
+
47
+ using namespace NKikimr ;
48
+
49
+ void YdsProcessAttr (const TSchemeBoardEvents::TDescribeSchemeResult& schemeData, NGRpcService::ICheckerIface* checker) {
50
+ static const std::vector<TString> allowedAttributes = {" folder_id" , " service_account_id" , " database_id" };
51
+ // full list of permissions for compatibility. remove old permissions later.
52
+ static const TVector<TString> permissions = {
53
+ " ydb.databases.list" ,
54
+ " ydb.databases.create" ,
55
+ " ydb.databases.connect" ,
56
+ " ydb.tables.select" ,
57
+ " ydb.schemas.getMetadata" ,
58
+ " ydb.streams.write"
59
+ };
60
+ TVector<std::pair<TString, TString>> attributes;
61
+ attributes.reserve (schemeData.GetPathDescription ().UserAttributesSize ());
62
+ for (const auto & attr : schemeData.GetPathDescription ().GetUserAttributes ()) {
63
+ if (std::find (allowedAttributes.begin (), allowedAttributes.end (), attr.GetKey ()) != allowedAttributes.end ()) {
64
+ attributes.emplace_back (attr.GetKey (), attr.GetValue ());
65
+ }
66
+ }
67
+ if (!attributes.empty ()) {
68
+ checker->SetEntries ({{permissions, attributes}});
69
+ }
70
+ }
71
+
72
+ }
73
+
45
74
void TGRpcTopicService::SetupIncomingRequests (NYdbGrpc::TLoggerPtr logger) {
46
75
47
76
using namespace std ::placeholders;
@@ -145,7 +174,7 @@ void TGRpcTopicService::SetupIncomingRequests(NYdbGrpc::TLoggerPtr logger) {
145
174
})
146
175
147
176
ADD_REQUEST (DescribePartition, TopicService, DescribePartitionRequest, DescribePartitionResponse, {
148
- ActorSystem_->Send (GRpcRequestProxyId_, new TEvDescribePartitionRequest (ctx, &DoDescribePartitionRequest, TRequestAuxSettings{RLSWITCH (TRateLimiterMode::Rps), nullptr , TAuditMode::Off}));
177
+ ActorSystem_->Send (GRpcRequestProxyId_, new TEvDescribePartitionRequest (ctx, &DoDescribePartitionRequest, TRequestAuxSettings{RLSWITCH (TRateLimiterMode::Rps), YdsProcessAttr , TAuditMode::Off}));
149
178
})
150
179
#undef ADD_REQUEST
151
180
0 commit comments