Skip to content

Commit c59c0d9

Browse files
Merge 1384a8f into 849f74f
2 parents 849f74f + 1384a8f commit c59c0d9

File tree

6 files changed

+46
-30
lines changed

6 files changed

+46
-30
lines changed

ydb/core/persqueue/partition_monitoring.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <ydb/core/protos/counters_pq.pb.h>
1313
#include <ydb/core/protos/msgbus.pb.h>
1414
#include <ydb/library/persqueue/topic_parser/topic_parser.h>
15+
#include <ydb/library/protobuf_printer/security_printer.h>
1516
#include <ydb/public/lib/base/msgbus.h>
1617
#include <library/cpp/html/pcdata/pcdata.h>
1718
#include <library/cpp/monlib/service/pages/templates.h>
@@ -22,6 +23,14 @@
2223

2324
namespace NKikimr::NPQ {
2425

26+
TString PrintConfig(const NKikimrPQ::TPQTabletConfig& cfg) {
27+
TSecurityTextFormatPrinter<NKikimrPQ::TPQTabletConfig> printer;
28+
printer.SetSingleLineMode(true);
29+
TString string;
30+
printer.PrintToString(cfg, &string);
31+
return string;
32+
}
33+
2534
void HtmlOutput(IOutputStream& out, const TString& line, const std::deque<std::pair<TKey, ui32>>& keys) {
2635
HTML(out) {
2736
TABLE() {
@@ -107,7 +116,7 @@ void TPartition::HandleMonitoring(TEvPQ::TEvMonRequest::TPtr& ev, const TActorCo
107116
out << "AvgWriteSize per " << avg.GetDuration().ToString() << " is " << avg.GetValue() << " bytes";
108117
res.push_back(out.Str()); out.Clear();
109118
}
110-
out << Config.DebugString(); res.push_back(out.Str()); out.Clear();
119+
out << PrintConfig(Config); res.push_back(out.Str()); out.Clear();
111120
HTML(out) {
112121
DIV_CLASS_ID("tab-pane fade", Sprintf("partition_%u", Partition.InternalPartitionId)) {
113122
TABLE_SORTABLE_CLASS("table") {

ydb/core/protos/pqconfig.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ message TMirrorPartitionConfig {
219219
message TCredentials {
220220
message IamCredentials {
221221
optional string Endpoint = 1;
222-
optional string ServiceAccountKey = 2;
222+
optional string ServiceAccountKey = 2 [(Ydb.sensitive) = true];
223223
}
224224
oneof Credentials {
225-
string OauthToken = 1;
226-
string JwtParams = 2;
225+
string OauthToken = 1 [(Ydb.sensitive) = true];
226+
string JwtParams = 2 [(Ydb.sensitive) = true];
227227
IamCredentials Iam = 3;
228228
}
229229
}

ydb/core/tx/schemeshard/schemeshard__operation.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ NKikimrScheme::TEvModifySchemeTransaction GetRecordForPrint(const NKikimrScheme:
8585
return recordForPrint;
8686
}
8787

88+
TString PrintSecurely(const NKikimrScheme::TEvModifySchemeTransaction& record) {
89+
TSecurityTextFormatPrinter<NKikimrScheme::TEvModifySchemeTransaction> printer;
90+
printer.SetSingleLineMode(true);
91+
TString string;
92+
printer.PrintToString(record, &string);
93+
return string;
94+
}
95+
8896
THolder<TProposeResponse> TSchemeShard::IgniteOperation(TProposeRequest& request, TOperationContext& context) {
8997
THolder<TProposeResponse> response = nullptr;
9098

@@ -183,7 +191,7 @@ THolder<TProposeResponse> TSchemeShard::IgniteOperation(TProposeRequest& request
183191
<< ", already accepted parts: " << operation->Parts.size()
184192
<< ", propose result status: " << NKikimrScheme::EStatus_Name(response->Record.GetStatus())
185193
<< ", with reason: " << response->Record.GetReason()
186-
<< ", tx message: " << GetRecordForPrint(record).ShortDebugString());
194+
<< ", tx message: " << PrintSecurely(record));
187195
}
188196

189197
Y_VERIFY_S(context.IsUndoChangesSafe(),
@@ -194,7 +202,7 @@ THolder<TProposeResponse> TSchemeShard::IgniteOperation(TProposeRequest& request
194202
<< ", already accepted parts: " << operation->Parts.size()
195203
<< ", propose result status: " << NKikimrScheme::EStatus_Name(response->Record.GetStatus())
196204
<< ", with reason: " << response->Record.GetReason()
197-
<< ", tx message: " << GetRecordForPrint(record).ShortDebugString());
205+
<< ", tx message: " << PrintSecurely(record));
198206

199207
context.OnComplete = {}; // recreate
200208
context.DbChanges = {};
@@ -237,7 +245,7 @@ struct TSchemeShard::TTxOperationPropose: public NTabletFlatExecutor::TTransacti
237245

238246
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
239247
"TTxOperationPropose Execute"
240-
<< ", message: " << GetRecordForPrint(Request->Get()->Record).ShortDebugString()
248+
<< ", message: " << PrintSecurely(Request->Get()->Record)
241249
<< ", at schemeshard: " << selfId);
242250

243251
txc.DB.NoMoreReadsForTx();

ydb/public/api/protos/draft/persqueue_common.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ enum ECodec {
3535

3636
message Credentials {
3737
oneof credentials {
38-
bytes tvm_service_ticket = 1;
39-
bytes oauth_token = 2;
38+
bytes tvm_service_ticket = 1 [(Ydb.sensitive) = true];
39+
bytes oauth_token = 2 [(Ydb.sensitive) = true];
4040
}
4141
}
42-

ydb/public/api/protos/ydb_persqueue_v1.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ message OffsetsRange {
3838

3939
// In-session reauthentication and reauthorization, lets user increase session lifetime. You should wait for 'update_token_response' before sending next 'update_token_request'.
4040
message UpdateTokenRequest {
41-
string token = 1;
41+
string token = 1 [(Ydb.sensitive) = true];
4242
}
4343

4444
message UpdateTokenResponse {
@@ -788,7 +788,7 @@ message MigrationStreamingReadClientMessage {
788788
}
789789

790790
// User credentials if update is needed or empty string.
791-
bytes token = 20;
791+
bytes token = 20 [(Ydb.sensitive) = true];
792792
}
793793

794794
/**
@@ -1073,8 +1073,8 @@ message Credentials {
10731073
string service_account_key = 2;
10741074
}
10751075
oneof credentials {
1076-
string oauth_token = 1;
1077-
string jwt_params = 2;
1076+
string oauth_token = 1 [(Ydb.sensitive) = true];
1077+
string jwt_params = 2 [(Ydb.sensitive) = true];
10781078
Iam iam = 3;
10791079
}
10801080
}

ydb/public/api/protos/ydb_topic.proto

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ message OffsetsRange {
4343
// In-session reauthentication and reauthorization, lets user increase session lifetime.
4444
// Client should wait for UpdateTokenResponse before sending next UpdateTokenRequest.
4545
message UpdateTokenRequest {
46-
string token = 1;
46+
string token = 1 [(Ydb.sensitive) = true];
4747
}
4848

4949
message UpdateTokenResponse {
@@ -167,7 +167,7 @@ message StreamWriteMessage {
167167
// Explicit partition id to write to.
168168
int64 partition_id = 6;
169169
// Explicit partition location to write to.
170-
PartitionWithGeneration partition_with_generation = 8;
170+
PartitionWithGeneration partition_with_generation = 8;
171171
}
172172
// Message metadata. Overall size is limited to 4096 symbols (all keys and values combined).
173173
repeated MetadataItem metadata_items = 7 [(Ydb.size).le = 1000];
@@ -534,7 +534,7 @@ message StreamReadMessage {
534534

535535
// Flag of graceful stop, used only when InitRequest.direct_read is true
536536
// Client must pass this value unchanged from the StopPartitionSessionRequest.
537-
// Server can sent two StopPartitionSessionRequests, the first with graceful=true, the second with graceful=false. The client must answer both of them.
537+
// Server can sent two StopPartitionSessionRequests, the first with graceful=true, the second with graceful=false. The client must answer both of them.
538538
bool graceful = 2;
539539
}
540540

@@ -563,22 +563,22 @@ message StreamReadMessage {
563563
// Messages for bidirectional streaming rpc StreamDirectRead
564564
message StreamDirectReadMessage {
565565

566-
// Client-server message for direct read session.
566+
// Client-server message for direct read session.
567567
// InitDirectRead - command from client to create and start a direct read session.
568568
// StartDirectReadPartitionSession - command from client to create and start a direct read partition session.
569-
// UpdateTokenRequest - request to update auth token
569+
// UpdateTokenRequest - request to update auth token
570570
message FromClient {
571571
oneof client_message {
572572
InitDirectRead init_direct_read = 1;
573573
StartDirectReadPartitionSession start_direct_read_partition_session = 2;
574-
UpdateTokenRequest update_token_request = 3;
574+
UpdateTokenRequest update_token_request = 3;
575575
}
576576
}
577577

578-
// Server-client message for direct read session.
578+
// Server-client message for direct read session.
579579
// DirectReadResponse - portion of message data.
580580
// StopDirectReadPartitionSession - command from server to stop a direct read partition session.
581-
// UpdateTokenResponse - acknowledgment of token update.
581+
// UpdateTokenResponse - acknowledgment of token update.
582582
message FromServer {
583583
// Server status of response.
584584
Ydb.StatusIds.StatusCode status = 1;
@@ -642,13 +642,13 @@ message StreamDirectReadMessage {
642642
message DirectReadResponse {
643643
// Partition session identifier.
644644
int64 partition_session_id = 1;
645-
645+
646646
// Read request identifier.
647647
int64 direct_read_id = 2;
648648

649649
// Messages data
650650
StreamReadMessage.ReadResponse.PartitionData partition_data = 3;
651-
}
651+
}
652652
}
653653

654654
message TransactionIdentity {
@@ -843,7 +843,7 @@ message CreateTopicRequest {
843843
// How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
844844
// Default limit - 36 hours.
845845
google.protobuf.Duration retention_period = 4;
846-
846+
847847
// How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
848848
// Zero value means infinite limit.
849849
int64 retention_storage_mb = 5 [(Ydb.value) = ">= 0"];
@@ -923,7 +923,7 @@ message DescribeTopicResult {
923923

924924
// Settings for partitioning
925925
PartitioningSettings partitioning_settings = 2;
926-
926+
927927
// Partitions description.
928928
repeated PartitionInfo partitions = 3;
929929

@@ -932,7 +932,7 @@ message DescribeTopicResult {
932932
//
933933
// How long data in partition should be stored.
934934
google.protobuf.Duration retention_period = 4;
935-
935+
936936
// How much data in partition should be stored.
937937
// Zero value means infinite limit.
938938
int64 retention_storage_mb = 5;
@@ -943,7 +943,7 @@ message DescribeTopicResult {
943943
// Writes with codec not from this list are forbidden.
944944
// If empty, codec compatibility check for the topic is disabled.
945945
SupportedCodecs supported_codecs = 7;
946-
946+
947947
// Partition write speed in bytes per second.
948948
// Zero value means default limit: 1 MB per second.
949949
int64 partition_write_speed_bytes_per_second = 8;
@@ -1135,7 +1135,7 @@ message AlterTopicRequest {
11351135
// How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
11361136
// Default limit - 36 hours.
11371137
google.protobuf.Duration set_retention_period = 4;
1138-
1138+
11391139
// How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
11401140
optional int64 set_retention_storage_mb = 5 [(Ydb.value) = ">= 0"];
11411141

@@ -1148,7 +1148,7 @@ message AlterTopicRequest {
11481148

11491149
// Partition write speed in bytes per second. Must be less than database limit. Default limit - 1 MB/s.
11501150
optional int64 set_partition_write_speed_bytes_per_second = 8 [(Ydb.value) = ">= 0"];
1151-
1151+
11521152
// Burst size for write in partition, in bytes. Must be less than database limit. Default limit - 1 MB.
11531153
optional int64 set_partition_write_burst_bytes = 9 [(Ydb.value) = ">= 0"];
11541154

0 commit comments

Comments
 (0)