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,
32 std::int64_t nonce_count);
34 TimePoint expiration_time;
35 std::int64_t nonce_count;
46 const SecdistConfig& secdist_config,
47 std::size_t ways, std::size_t way_size);
52 const std::string& username)
const override;
53 void SetUserData(
const std::string& username,
const std::string& nonce,
54 std::int64_t nonce_count,
55 TimePoint nonce_creation_time)
const override;
61 virtual std::optional<UserData::HA1> GetHA1(
62 std::string_view username)
const = 0;
68 mutable rcu::RcuMap<std::string, concurrent::Variable<NonceInfo>> user_data_;
71 mutable NonceCache unnamed_nonces_;