aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/tvmauth/client/misc/default_uid_checker.h
diff options
context:
space:
mode:
authoralexnick <alexnick@yandex-team.ru>2022-02-17 14:23:34 +0300
committeralexnick <alexnick@yandex-team.ru>2022-02-17 14:23:34 +0300
commitfd03a905d0671edeffde43ade486dc608bf69d95 (patch)
treed01659ada27349df9be25f8a8d5dab4f9ec4cd12 /library/cpp/tvmauth/client/misc/default_uid_checker.h
parent3dba88133a0e2bf63394fdba2affc51a771eff03 (diff)
downloadydb-fd03a905d0671edeffde43ade486dc608bf69d95.tar.gz
remove tvm dependecy KIKIMR-14386
ref:d40a6e54d3da55ed1f9c9a0763552940acb0988b
Diffstat (limited to 'library/cpp/tvmauth/client/misc/default_uid_checker.h')
-rw-r--r--library/cpp/tvmauth/client/misc/default_uid_checker.h46
1 files changed, 0 insertions, 46 deletions
diff --git a/library/cpp/tvmauth/client/misc/default_uid_checker.h b/library/cpp/tvmauth/client/misc/default_uid_checker.h
deleted file mode 100644
index 1594f826bd..0000000000
--- a/library/cpp/tvmauth/client/misc/default_uid_checker.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#pragma once
-
-#include "async_updater.h"
-
-#include <library/cpp/tvmauth/client/exception.h>
-
-#include <library/cpp/tvmauth/checked_user_ticket.h>
-#include <library/cpp/tvmauth/src/user_impl.h>
-
-namespace NTvmAuth {
- class TDefaultUidChecker {
- public:
- TDefaultUidChecker(TAsyncUpdaterPtr updater)
- : Updater_(std::move(updater))
- {
- Y_ENSURE(Updater_);
- GetCache();
- }
-
- /*!
- * Checking must be enabled in TClientSettings
- * Can throw exception if cache is out of date or wrong config
- * @param ticket
- */
- TCheckedUserTicket Check(TCheckedUserTicket ticket) const {
- NRoles::TConsumerRolesPtr roles = GetCache()->GetRolesForUser(ticket);
- if (roles) {
- return ticket;
- }
-
- TUserTicketImplPtr impl = THolder(NInternal::TCanningKnife::GetU(ticket));
- impl->SetStatus(ETicketStatus::NoRoles);
- return TCheckedUserTicket(std::move(impl));
- }
-
- private:
- NRoles::TRolesPtr GetCache() const {
- NRoles::TRolesPtr c = Updater_->GetRoles();
- Y_ENSURE_EX(c, TBrokenTvmClientSettings() << "Need to use TClientSettings::EnableRolesFetching()");
- return c;
- }
-
- private:
- TAsyncUpdaterPtr Updater_;
- };
-}