diff options
author | karganov <karganov@yandex-team.ru> | 2022-02-10 16:49:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:31 +0300 |
commit | 7d6a5a2f731d2d29adbdb4c9f90a988b71629938 (patch) | |
tree | 8122547fcfe11aa16e5ad742b1f522f3aff0c61f | |
parent | b71160d74af133cecefa76510d6ed1f414f9009d (diff) | |
download | ydb-7d6a5a2f731d2d29adbdb4c9f90a988b71629938.tar.gz |
Restoring authorship annotation for <karganov@yandex-team.ru>. Commit 1 of 2.
-rw-r--r-- | library/cpp/tvmauth/client/ut/disk_cache_ut.cpp | 20 | ||||
-rw-r--r-- | library/cpp/tvmauth/src/ut/parser_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/tvmauth/src/ut/public_ut.cpp | 40 | ||||
-rw-r--r-- | library/cpp/tvmauth/src/ut/service_ut.cpp | 8 | ||||
-rw-r--r-- | library/cpp/tvmauth/src/ut/utils_ut.cpp | 42 |
5 files changed, 56 insertions, 56 deletions
diff --git a/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp b/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp index 7dd851c9b3..cbb6ab16a5 100644 --- a/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp +++ b/library/cpp/tvmauth/client/ut/disk_cache_ut.cpp @@ -21,19 +21,19 @@ Y_UNIT_TEST_SUITE(ClientDisk) { TString hash = TDiskReader::GetHash("asd"); UNIT_ASSERT(hash); UNIT_ASSERT_VALUES_EQUAL(32, hash.size()); - UNIT_ASSERT_VALUES_EQUAL("Zj5_qYg31bPlqjBW76z8IV0rCsHmv-iN-McV6ybS1-g", NUtils::Bin2base64url(hash)); + UNIT_ASSERT_VALUES_EQUAL("Zj5_qYg31bPlqjBW76z8IV0rCsHmv-iN-McV6ybS1-g", NUtils::Bin2base64url(hash)); } Y_UNIT_TEST(Timestamp) { time_t t = 100500; TString s = TDiskWriter::WriteTimestamp(t); - UNIT_ASSERT_VALUES_EQUAL("lIgBAAAAAAA", NUtils::Bin2base64url(s)); + UNIT_ASSERT_VALUES_EQUAL("lIgBAAAAAAA", NUtils::Bin2base64url(s)); UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); t = 123123123213089; s = TDiskWriter::WriteTimestamp(t); - UNIT_ASSERT_VALUES_EQUAL("IdMF1vpvAAA", NUtils::Bin2base64url(s)); + UNIT_ASSERT_VALUES_EQUAL("IdMF1vpvAAA", NUtils::Bin2base64url(s)); UNIT_ASSERT_VALUES_EQUAL(t, TDiskReader::GetTimestamp(s)); t = time(nullptr); @@ -56,9 +56,9 @@ Y_UNIT_TEST_SUITE(ClientDisk) { TDiskReader r("qwerty", &l); UNIT_ASSERT(r.ParseData(toFile)); - UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); + UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); UNIT_ASSERT_VALUES_EQUAL(time, r.Time()); - UNIT_ASSERT_VALUES_EQUAL("6: File 'qwerty' was successfully read\n", + UNIT_ASSERT_VALUES_EQUAL("6: File 'qwerty' was successfully read\n", l.Stream.Str()); } @@ -68,7 +68,7 @@ Y_UNIT_TEST_SUITE(ClientDisk) { TString toFile = TDiskWriter::PrepareData(TIME, DATA); TDiskReader r("qwerty", &l); UNIT_ASSERT(!r.ParseData(toFile.substr(0, 17))); - UNIT_ASSERT_VALUES_EQUAL("4: File 'qwerty' is too small\n", + UNIT_ASSERT_VALUES_EQUAL("4: File 'qwerty' is too small\n", l.Stream.Str()); } @@ -79,7 +79,7 @@ Y_UNIT_TEST_SUITE(ClientDisk) { toFile[17] = toFile[17] + 1; TDiskReader r("qwerty", &l); UNIT_ASSERT(!r.ParseData(toFile)); - UNIT_ASSERT_VALUES_EQUAL("4: Content of 'qwerty' was incorrectly changed\n", + UNIT_ASSERT_VALUES_EQUAL("4: Content of 'qwerty' was incorrectly changed\n", l.Stream.Str()); } @@ -88,7 +88,7 @@ Y_UNIT_TEST_SUITE(ClientDisk) { TDiskReader r(GetFilePath("ok.cache"), &l); UNIT_ASSERT(r.Read()); - UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); + UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); UNIT_ASSERT_VALUES_EQUAL(TIME, r.Time()); UNIT_ASSERT_C(l.Stream.Str().find("was successfully read") != TString::npos, l.Stream.Str()); } @@ -98,7 +98,7 @@ Y_UNIT_TEST_SUITE(ClientDisk) { TDiskReader r("missing", &l); UNIT_ASSERT(!r.Read()); - UNIT_ASSERT_VALUES_EQUAL("7: File 'missing' does not exist\n", + UNIT_ASSERT_VALUES_EQUAL("7: File 'missing' does not exist\n", l.Stream.Str()); } @@ -132,7 +132,7 @@ Y_UNIT_TEST_SUITE(ClientDisk) { TDiskReader r(path, &l); UNIT_ASSERT_C(r.Read(), l.Stream.Str()); - UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); + UNIT_ASSERT_VALUES_EQUAL(DATA, r.Data()); UNIT_ASSERT(TInstant::Now() - r.Time() < TDuration::Minutes(5)); UNIT_ASSERT_C(l.Stream.Str().find("was successfully read") != TString::npos, l.Stream.Str()); diff --git a/library/cpp/tvmauth/src/ut/parser_ut.cpp b/library/cpp/tvmauth/src/ut/parser_ut.cpp index 530f45331a..5dc4c855c7 100644 --- a/library/cpp/tvmauth/src/ut/parser_ut.cpp +++ b/library/cpp/tvmauth/src/ut/parser_ut.cpp @@ -14,7 +14,7 @@ Y_UNIT_TEST_SUITE(ParserTestSuite) { UNIT_ASSERT_EXCEPTION(TParserTvmKeys::ParseStrV1("3:asds"), TMalformedTvmKeysException); UNIT_ASSERT_EXCEPTION(TParserTvmKeys::ParseStrV1("1:+a/sds"), TMalformedTvmKeysException); - UNIT_ASSERT_VALUES_EQUAL("sdsd", NUtils::Bin2base64url(TParserTvmKeys::ParseStrV1("1:sdsd"))); + UNIT_ASSERT_VALUES_EQUAL("sdsd", NUtils::Bin2base64url(TParserTvmKeys::ParseStrV1("1:sdsd"))); } Y_UNIT_TEST(TicketsStrV3) { diff --git a/library/cpp/tvmauth/src/ut/public_ut.cpp b/library/cpp/tvmauth/src/ut/public_ut.cpp index 74a483d57b..5c37649cd8 100644 --- a/library/cpp/tvmauth/src/ut/public_ut.cpp +++ b/library/cpp/tvmauth/src/ut/public_ut.cpp @@ -12,23 +12,23 @@ using namespace NTvmAuth; Y_UNIT_TEST_SUITE(CommonPublicInterfaceTestSuite){ Y_UNIT_TEST(StatusTest){ - UNIT_ASSERT_VALUES_EQUAL("OK", + UNIT_ASSERT_VALUES_EQUAL("OK", StatusToString(ETicketStatus::Ok)); - UNIT_ASSERT_VALUES_EQUAL("Expired ticket", + UNIT_ASSERT_VALUES_EQUAL("Expired ticket", StatusToString(ETicketStatus::Expired)); - UNIT_ASSERT_VALUES_EQUAL("Invalid BlackBox environment", + UNIT_ASSERT_VALUES_EQUAL("Invalid BlackBox environment", StatusToString(ETicketStatus::InvalidBlackboxEnv)); - UNIT_ASSERT_VALUES_EQUAL("Invalid ticket destination", + UNIT_ASSERT_VALUES_EQUAL("Invalid ticket destination", StatusToString(ETicketStatus::InvalidDst)); - UNIT_ASSERT_VALUES_EQUAL("Invalid ticket type", + UNIT_ASSERT_VALUES_EQUAL("Invalid ticket type", StatusToString(ETicketStatus::InvalidTicketType)); - UNIT_ASSERT_VALUES_EQUAL("Malformed ticket", + UNIT_ASSERT_VALUES_EQUAL("Malformed ticket", StatusToString(ETicketStatus::Malformed)); - UNIT_ASSERT_VALUES_EQUAL("Invalid ticket signature", + UNIT_ASSERT_VALUES_EQUAL("Invalid ticket signature", StatusToString(ETicketStatus::SignBroken)); - UNIT_ASSERT_VALUES_EQUAL("Context does not have required key to check ticket: public keys are too old", + UNIT_ASSERT_VALUES_EQUAL("Context does not have required key to check ticket: public keys are too old", StatusToString(ETicketStatus::MissingKey)); - UNIT_ASSERT_VALUES_EQUAL("Unsupported ticket version", + UNIT_ASSERT_VALUES_EQUAL("Unsupported ticket version", StatusToString(ETicketStatus::UnsupportedVersion)); } } @@ -77,7 +77,7 @@ Y_UNIT_TEST_SUITE(PublicInterfaceServiceTestSuite) { Y_UNIT_TEST(ContextSignTest) { TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - UNIT_ASSERT_VALUES_EQUAL( + UNIT_ASSERT_VALUES_EQUAL( "NsPTYak4Cfk-4vgau5lab3W4GPiTtb2etuj3y4MDPrk", context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "")); } @@ -126,14 +126,14 @@ Y_UNIT_TEST_SUITE(PublicInterfaceServiceTestSuite) { TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_2); UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); - UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;", checkedTicket.DebugInfo()); + UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;", checkedTicket.DebugInfo()); } Y_UNIT_TEST(Ticket3Test) { TServiceContext context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_3); UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket.GetStatus()); - UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;", checkedTicket.DebugInfo()); + UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;", checkedTicket.DebugInfo()); } Y_UNIT_TEST(TicketCheckingTest) { @@ -168,21 +168,21 @@ Y_UNIT_TEST_SUITE(PublicInterfaceServiceTestSuite) { } Y_UNIT_TEST(RemoveSignatureTest) { - UNIT_ASSERT_VALUES_EQUAL("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", + UNIT_ASSERT_VALUES_EQUAL("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", NUtils::RemoveTicketSignature("1:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", + UNIT_ASSERT_VALUES_EQUAL("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", NUtils::RemoveTicketSignature("2:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", + UNIT_ASSERT_VALUES_EQUAL("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds", NUtils::RemoveTicketSignature("4:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds", + UNIT_ASSERT_VALUES_EQUAL("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds", NUtils::RemoveTicketSignature("3.serv.ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", + UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", + UNIT_ASSERT_VALUES_EQUAL("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:", NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs:asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("3:serv:", + UNIT_ASSERT_VALUES_EQUAL("3:serv:", NUtils::RemoveTicketSignature("3:serv:ASDkljbjhsdbfLJHABFJHBslfbsfjs.asdxcvbxcvniueliuweklsvds")); - UNIT_ASSERT_VALUES_EQUAL("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf", + UNIT_ASSERT_VALUES_EQUAL("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf", NUtils::RemoveTicketSignature("asdxcbvfgdsgfasdfxczvdsgfxcdvbcbvf")); } diff --git a/library/cpp/tvmauth/src/ut/service_ut.cpp b/library/cpp/tvmauth/src/ut/service_ut.cpp index 5b6b5143bd..cd4a936f10 100644 --- a/library/cpp/tvmauth/src/ut/service_ut.cpp +++ b/library/cpp/tvmauth/src/ut/service_ut.cpp @@ -43,7 +43,7 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(ServiceTestSuite) { Y_UNIT_TEST(ContextSignTest) { TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); - UNIT_ASSERT_VALUES_EQUAL( + UNIT_ASSERT_VALUES_EQUAL( "NsPTYak4Cfk-4vgau5lab3W4GPiTtb2etuj3y4MDPrk", context.SignCgiParamsForTvm(IntToString<10>(std::numeric_limits<time_t>::max()), "13,28", "")); } @@ -66,7 +66,7 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(ServiceTestSuite) { TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_2); UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;", checkedTicket->DebugInfo()); + UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;scope=bb:sess1;scope=bb:sess10;scope=bb:sess100;scope=bb:sess11;scope=bb:sess12;scope=bb:sess13;scope=bb:sess14;scope=bb:sess15;scope=bb:sess16;scope=bb:sess17;scope=bb:sess18;scope=bb:sess19;scope=bb:sess2;scope=bb:sess20;scope=bb:sess21;scope=bb:sess22;scope=bb:sess23;scope=bb:sess24;scope=bb:sess25;scope=bb:sess26;scope=bb:sess27;scope=bb:sess28;scope=bb:sess29;scope=bb:sess3;scope=bb:sess30;scope=bb:sess31;scope=bb:sess32;scope=bb:sess33;scope=bb:sess34;scope=bb:sess35;scope=bb:sess36;scope=bb:sess37;scope=bb:sess38;scope=bb:sess39;scope=bb:sess4;scope=bb:sess40;scope=bb:sess41;scope=bb:sess42;scope=bb:sess43;scope=bb:sess44;scope=bb:sess45;scope=bb:sess46;scope=bb:sess47;scope=bb:sess48;scope=bb:sess49;scope=bb:sess5;scope=bb:sess50;scope=bb:sess51;scope=bb:sess52;scope=bb:sess53;scope=bb:sess54;scope=bb:sess55;scope=bb:sess56;scope=bb:sess57;scope=bb:sess58;scope=bb:sess59;scope=bb:sess6;scope=bb:sess60;scope=bb:sess61;scope=bb:sess62;scope=bb:sess63;scope=bb:sess64;scope=bb:sess65;scope=bb:sess66;scope=bb:sess67;scope=bb:sess68;scope=bb:sess69;scope=bb:sess7;scope=bb:sess70;scope=bb:sess71;scope=bb:sess72;scope=bb:sess73;scope=bb:sess74;scope=bb:sess75;scope=bb:sess76;scope=bb:sess77;scope=bb:sess78;scope=bb:sess79;scope=bb:sess8;scope=bb:sess80;scope=bb:sess81;scope=bb:sess82;scope=bb:sess83;scope=bb:sess84;scope=bb:sess85;scope=bb:sess86;scope=bb:sess87;scope=bb:sess88;scope=bb:sess89;scope=bb:sess9;scope=bb:sess90;scope=bb:sess91;scope=bb:sess92;scope=bb:sess93;scope=bb:sess94;scope=bb:sess95;scope=bb:sess96;scope=bb:sess97;scope=bb:sess98;scope=bb:sess99;", checkedTicket->DebugInfo()); UNIT_ASSERT(!checkedTicket->GetIssuerUid()); } @@ -74,7 +74,7 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(ServiceTestSuite) { TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_3); UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;", checkedTicket->DebugInfo()); + UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;", checkedTicket->DebugInfo()); UNIT_ASSERT(!checkedTicket->GetIssuerUid()); } @@ -82,7 +82,7 @@ Y_UNIT_TEST_SUITE_IMPLEMENTATION(ServiceTestSuite) { TServiceContext::TImpl context(SECRET, OUR_ID, NUnittest::TVMKNIFE_PUBLIC_KEYS); auto checkedTicket = context.Check(VALID_SERVICE_TICKET_ISSUER); UNIT_ASSERT_EQUAL(ETicketStatus::Ok, checkedTicket->GetStatus()); - UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;issuer_uid=789654123;", + UNIT_ASSERT_VALUES_EQUAL("ticket_type=serv;expiration_time=9223372036854775807;src=229;dst=28;issuer_uid=789654123;", checkedTicket->DebugInfo()); UNIT_ASSERT(checkedTicket->GetIssuerUid()); UNIT_ASSERT_VALUES_EQUAL(789654123, *checkedTicket->GetIssuerUid()); diff --git a/library/cpp/tvmauth/src/ut/utils_ut.cpp b/library/cpp/tvmauth/src/ut/utils_ut.cpp index c9cb81c36f..adf2ccd9d2 100644 --- a/library/cpp/tvmauth/src/ut/utils_ut.cpp +++ b/library/cpp/tvmauth/src/ut/utils_ut.cpp @@ -10,52 +10,52 @@ Y_UNIT_TEST_SUITE(UtilsTestSuite) { using namespace NTvmAuth; Y_UNIT_TEST(base64Test) { - UNIT_ASSERT_VALUES_EQUAL("-hHx", NUtils::Bin2base64url("\xfa\x11\xf1")); - UNIT_ASSERT_VALUES_EQUAL("-hHx_g", NUtils::Bin2base64url("\xfa\x11\xf1\xfe")); - UNIT_ASSERT_VALUES_EQUAL("-hHx_v8", NUtils::Bin2base64url("\xfa\x11\xf1\xfe\xff")); + UNIT_ASSERT_VALUES_EQUAL("-hHx", NUtils::Bin2base64url("\xfa\x11\xf1")); + UNIT_ASSERT_VALUES_EQUAL("-hHx_g", NUtils::Bin2base64url("\xfa\x11\xf1\xfe")); + UNIT_ASSERT_VALUES_EQUAL("-hHx_v8", NUtils::Bin2base64url("\xfa\x11\xf1\xfe\xff")); - UNIT_ASSERT_VALUES_EQUAL("", NUtils::Base64url2bin("hHx++")); - UNIT_ASSERT_VALUES_EQUAL("", NUtils::Base64url2bin("&*^")); - UNIT_ASSERT_VALUES_EQUAL("", NUtils::Base64url2bin("")); - UNIT_ASSERT_VALUES_EQUAL("", NUtils::Bin2base64url("")); + UNIT_ASSERT_VALUES_EQUAL("", NUtils::Base64url2bin("hHx++")); + UNIT_ASSERT_VALUES_EQUAL("", NUtils::Base64url2bin("&*^")); + UNIT_ASSERT_VALUES_EQUAL("", NUtils::Base64url2bin("")); + UNIT_ASSERT_VALUES_EQUAL("", NUtils::Bin2base64url("")); - UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1", NUtils::Base64url2bin("-hHx")); - UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe", NUtils::Base64url2bin("-hHx_g")); - UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe", NUtils::Base64url2bin("-hHx_g=")); - UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe", NUtils::Base64url2bin("-hHx_g==")); - UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe\xff", NUtils::Base64url2bin("-hHx_v8")); - UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe\xff", NUtils::Base64url2bin("-hHx_v8=")); + UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1", NUtils::Base64url2bin("-hHx")); + UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe", NUtils::Base64url2bin("-hHx_g")); + UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe", NUtils::Base64url2bin("-hHx_g=")); + UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe", NUtils::Base64url2bin("-hHx_g==")); + UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe\xff", NUtils::Base64url2bin("-hHx_v8")); + UNIT_ASSERT_VALUES_EQUAL("\xfa\x11\xf1\xfe\xff", NUtils::Base64url2bin("-hHx_v8=")); - UNIT_ASSERT_VALUES_EQUAL("SGVsbG8sIGV2ZXJ5Ym9keSE", + UNIT_ASSERT_VALUES_EQUAL("SGVsbG8sIGV2ZXJ5Ym9keSE", NUtils::Bin2base64url(("Hello, everybody!"))); - UNIT_ASSERT_VALUES_EQUAL("Hello, everybody!", + UNIT_ASSERT_VALUES_EQUAL("Hello, everybody!", NUtils::Base64url2bin(("SGVsbG8sIGV2ZXJ5Ym9keSE"))); - UNIT_ASSERT_VALUES_EQUAL("VGhlIE1hZ2ljIFdvcmRzIGFyZSBTcXVlYW1pc2ggT3NzaWZyYWdl", + UNIT_ASSERT_VALUES_EQUAL("VGhlIE1hZ2ljIFdvcmRzIGFyZSBTcXVlYW1pc2ggT3NzaWZyYWdl", NUtils::Bin2base64url(("The Magic Words are Squeamish Ossifrage"))); - UNIT_ASSERT_VALUES_EQUAL("The Magic Words are Squeamish Ossifrage", + UNIT_ASSERT_VALUES_EQUAL("The Magic Words are Squeamish Ossifrage", NUtils::Base64url2bin(("VGhlIE1hZ2ljIFdvcmRzIGFyZSBTcXVlYW1pc2ggT3NzaWZyYWdl"))); } Y_UNIT_TEST(sign) { - UNIT_ASSERT_VALUES_EQUAL("wkGfeuopf709ozPAeGcDMqtZXPzsWvuNJ1BL586dSug", + UNIT_ASSERT_VALUES_EQUAL("wkGfeuopf709ozPAeGcDMqtZXPzsWvuNJ1BL586dSug", NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOVnvOqe-WyD1"), "1490000000", "13,19", "bb:sess,bb:sess2")); - UNIT_ASSERT_VALUES_EQUAL("HANDYrA4ApQMQ5cfSWZk_InHWJffoXAa57P_X_B5s4M", + UNIT_ASSERT_VALUES_EQUAL("HANDYrA4ApQMQ5cfSWZk_InHWJffoXAa57P_X_B5s4M", NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), "1490000000", "13,19", "bb:sess,bb:sess2")); - UNIT_ASSERT_VALUES_EQUAL("T-M-3_qtjRM1dR_3hS1CRlHBTZRKK04doHXBJw-5VRk", + UNIT_ASSERT_VALUES_EQUAL("T-M-3_qtjRM1dR_3hS1CRlHBTZRKK04doHXBJw-5VRk", NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), "1490000001", "13,19", "bb:sess,bb:sess2")); - UNIT_ASSERT_VALUES_EQUAL("gwB6M_9Jij50ZADmlDMnoyLc6AhQmtq6MClgGzO1PBE", + UNIT_ASSERT_VALUES_EQUAL("gwB6M_9Jij50ZADmlDMnoyLc6AhQmtq6MClgGzO1PBE", NUtils::SignCgiParamsForTvm(NUtils::Base64url2bin("GRMJrKnj4fOasvOqe-WyD1"), "1490000001", "13,19", |