12#include <userver/cache/expirable_lru_cache.hpp>
13#include <userver/concurrent/mpsc_queue.hpp>
14#include <userver/concurrent/variable.hpp>
15#include <userver/crypto/hash.hpp>
16#include <userver/rcu/rcu_map.hpp>
17#include <userver/server/handlers/auth/digest/auth_checker_base.hpp>
18#include <userver/server/handlers/auth/digest/auth_checker_settings.hpp>
19#include <userver/server/handlers/auth/digest/directives_parser.hpp>
20#include <userver/server/http/http_request.hpp>
21#include <userver/server/http/http_response.hpp>
22#include <userver/server/http/http_status.hpp>
23#include <userver/server/request/request_context.hpp>
25USERVER_NAMESPACE_BEGIN
27namespace server::handlers::auth::digest {
29struct NonceInfo
final {
31 NonceInfo(
const std::string& nonce, TimePoint expiration_time, std::int64_t nonce_count);
33 TimePoint expiration_time;
34 std::int64_t nonce_count;
43 AuthStandaloneCheckerBase(
46 const SecdistConfig& secdist_config,
53 std::optional<UserData>
FetchUserData(
const std::string& username)
const override;
55 const std::string& username,
56 const std::string& nonce,
57 std::int64_t nonce_count,
58 TimePoint nonce_creation_time
64 virtual std::optional<UserData::HA1> GetHA1(std::string_view username)
const = 0;
70 mutable rcu::RcuMap<std::string, concurrent::Variable<NonceInfo>> user_data_;
73 mutable NonceCache unnamed_nonces_;