aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrgayazov <bulat@ydb.tech>2023-03-01 14:06:20 +0300
committerbrgayazov <bulat@ydb.tech>2023-03-01 14:06:20 +0300
commit051784e75332678046725975d83db3a39ab53037 (patch)
treee194ab938753b78a64638c2bd90c4e1aeef16d28
parent15ded925a4fa8406d38729a5d8f46359141fcc6a (diff)
downloadydb-051784e75332678046725975d83db3a39ab53037.tar.gz
Fix bug with ignore anonymous-auth from stdin
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_profile.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp b/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp
index 3a03bd11a1..2a44a0e3c2 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_profile.cpp
@@ -321,13 +321,20 @@ void TCommandProfileCommon::GetOptionsFromStdin() {
continue;
}
- if (line.StartsWith("use-metadata-credentials")) {
+ if (trimmedLine.StartsWith("use-metadata-credentials")) {
if (UseMetadataCredentials) {
throw TMisuseException() << "You entered too many \"use-metadata-credentials\" options.";
}
UseMetadataCredentials = true;
continue;
}
+ if (trimmedLine.StartsWith("anonymous-auth")) {
+ if (AnonymousAuth) {
+ throw TMisuseException() << "You entered too many \"anonymous-auth\" options.";
+ }
+ AnonymousAuth = true;
+ continue;
+ }
for (const auto& [str, ref] : options) {
if (trimmedLine.StartsWith(str + ":")) {