Skip to content

Commit f204cd7

Browse files
committed
Do not add CreatedAt to describe result
1 parent b5434a5 commit f204cd7

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

ydb/core/tx/schemeshard/ut_login/ut_login.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -872,54 +872,6 @@ Y_UNIT_TEST_SUITE(TSchemeShardLoginTest) {
872872
});
873873
CheckUserIsLockedOutPermanently(runtime);
874874
}
875-
876-
Y_UNIT_TEST(CheckTimeOfUserCreating) {
877-
TTestBasicRuntime runtime;
878-
TTestEnv env(runtime);
879-
ui64 txId = 100;
880-
881-
{
882-
auto describe = DescribePath(runtime, TTestTxConfig::SchemeShard, "/MyRoot");
883-
CheckSecurityState(describe, {.PublicKeysSize = 0, .SidsSize = 0});
884-
}
885-
886-
887-
{
888-
std::chrono::time_point<std::chrono::system_clock> start = std::chrono::system_clock::now();
889-
CreateAlterLoginCreateUser(runtime, ++txId, "/MyRoot", "user1", "password1");
890-
std::chrono::time_point<std::chrono::system_clock> finish = std::chrono::system_clock::now();
891-
auto describeResult = DescribePath(runtime, TTestTxConfig::SchemeShard, "/MyRoot");
892-
CheckSecurityState(describeResult, {.PublicKeysSize = 0, .SidsSize = 1});
893-
894-
NLogin::TLoginProvider tmpLoginProvider;
895-
tmpLoginProvider.UpdateSecurityState(describeResult.GetPathDescription().GetDomainDescription().GetSecurityState());
896-
const auto& sid = tmpLoginProvider.Sids["user1"];
897-
UNIT_ASSERT(sid.CreatedAt >= start && sid.CreatedAt <= finish);
898-
}
899-
900-
{
901-
std::chrono::time_point<std::chrono::system_clock> start = std::chrono::system_clock::now();
902-
CreateAlterLoginCreateUser(runtime, ++txId, "/MyRoot", "user2", "password2");
903-
std::chrono::time_point<std::chrono::system_clock> finish = std::chrono::system_clock::now();
904-
auto describeResult = DescribePath(runtime, TTestTxConfig::SchemeShard, "/MyRoot");
905-
CheckSecurityState(describeResult, {.PublicKeysSize = 0, .SidsSize = 2});
906-
907-
NLogin::TLoginProvider tmpLoginProvider;
908-
tmpLoginProvider.UpdateSecurityState(describeResult.GetPathDescription().GetDomainDescription().GetSecurityState());
909-
const auto& sid = tmpLoginProvider.Sids["user2"];
910-
UNIT_ASSERT(sid.CreatedAt >= start && sid.CreatedAt <= finish);
911-
}
912-
913-
{
914-
auto describeResult = DescribePath(runtime, TTestTxConfig::SchemeShard, "/MyRoot");
915-
NLogin::TLoginProvider tmpLoginProvider;
916-
tmpLoginProvider.UpdateSecurityState(describeResult.GetPathDescription().GetDomainDescription().GetSecurityState());
917-
const auto& sid1 = tmpLoginProvider.Sids["user1"];
918-
const auto& sid2 = tmpLoginProvider.Sids["user2"];
919-
920-
UNIT_ASSERT(sid1.CreatedAt < sid2.CreatedAt);
921-
}
922-
}
923875
}
924876

925877
namespace NSchemeShardUT_Private {

ydb/library/login/login.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ NLoginProto::TSecurityState TLoginProvider::GetSecurityState() const {
632632
for (const auto& subSid : sidInfo.Members) {
633633
sid.AddMembers(subSid);
634634
}
635-
sid.SetCreatedAt(std::chrono::duration_cast<std::chrono::milliseconds>(sidInfo.CreatedAt.time_since_epoch()).count());
635+
// do not set CreatedAt. It does not need in describe result
636636
// no user hash here
637637
}
638638
}

0 commit comments

Comments
 (0)