7#include <userver/server/auth/user_auth_info.hpp>
8#include <userver/server/handlers/exceptions.hpp>
9#include <userver/server/http/http_request.hpp>
10#include <userver/server/request/request_context.hpp>
12USERVER_NAMESPACE_BEGIN
14namespace server::handlers::auth {
17 enum class Status { kTokenNotFound, kInternalCheckFailure, kInvalidToken, kForbidden, kOk };
19 Status status{Status::kOk};
20 std::optional<std::string> reason{};
21 std::optional<std::string> ext_reason{};
25const std::string& GetDefaultReasonForStatus(
AuthCheckResult::Status status);
30 virtual ~AuthCheckerBase();
35 [[
nodiscard]]
virtual bool SupportsUserAuth()
const noexcept = 0;
38 void SetUserAuthInfo(server::
request::RequestContext& request_context, server::auth::UserAuthInfo&& info)
const;