diff options
author | komels <komels@yandex-team.ru> | 2022-04-14 13:10:53 +0300 |
---|---|---|
committer | komels <komels@yandex-team.ru> | 2022-04-14 13:10:53 +0300 |
commit | 21c9b0e6b039e9765eb414c406c2b86e8cea6850 (patch) | |
tree | f40ebc18ff8958dfbd189954ad024043ca983ea5 /library/cpp/tvmauth/utils.cpp | |
parent | 9a4effa852abe489707139c2b260dccc6f4f9aa9 (diff) | |
download | ydb-21c9b0e6b039e9765eb414c406c2b86e8cea6850.tar.gz |
Final part on compatibility layer: LOGBROKER-7215
ref:777c67aadbf705d19034a09a792b2df61ba53697
Diffstat (limited to 'library/cpp/tvmauth/utils.cpp')
-rw-r--r-- | library/cpp/tvmauth/utils.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library/cpp/tvmauth/utils.cpp b/library/cpp/tvmauth/utils.cpp new file mode 100644 index 0000000000..a06cd6f5ba --- /dev/null +++ b/library/cpp/tvmauth/utils.cpp @@ -0,0 +1,18 @@ +#include "utils.h" + +namespace NTvmAuth::NUtils { + TStringBuf RemoveTicketSignature(TStringBuf ticketBody) { + if (ticketBody.size() < 2 || + ticketBody[0] != '3' || + ticketBody[1] != ':') { + return ticketBody; + } + + size_t pos = ticketBody.rfind(':'); + if (pos == TStringBuf::npos) { // impossible + return ticketBody; + } + + return ticketBody.substr(0, pos + 1); + } +} |