#include <userver/server/handlers/auth/digest/auth_checker_base.hpp>
Base class for digest authentication checkers. Implements a digest-authentication logic.
Definition at line 73 of file auth_checker_base.hpp.
Public Member Functions | |
AuthCheckerBase (const AuthCheckerSettings &digest_settings, std::string &&realm, const SecdistConfig &secdist_config) | |
AuthCheckerBase (const AuthCheckerBase &)=delete | |
AuthCheckerBase (AuthCheckerBase &&)=delete | |
AuthCheckerBase & | operator= (const AuthCheckerBase &)=delete |
AuthCheckerBase & | operator= (AuthCheckerBase &&)=delete |
AuthCheckResult | CheckAuth (const http::HttpRequest &request, request::RequestContext &request_context) const final |
The main checking function that is called for each request. | |
bool | SupportsUserAuth () const noexcept override |
virtual std::optional< UserData > | FetchUserData (const std::string &username) const =0 |
virtual void | SetUserData (const std::string &username, const std::string &nonce, std::int64_t nonce_count, TimePoint nonce_creation_time) const =0 |
Sets user authentication data to storage. | |
virtual void | PushUnnamedNonce (std::string nonce) const =0 |
Pushes "nonce" not tied to username to "Nonce Pool". | |
virtual std::optional< TimePoint > | GetUnnamedNonceCreationTime (const std::string &nonce) const =0 |
Returns "nonce" creation time from "Nonce Pool" if exists. | |
Additional Inherited Members | |
Protected Member Functions inherited from server::handlers::auth::AuthCheckerBase | |
void | SetUserAuthInfo (server::request::RequestContext &request_context, server::auth::UserAuthInfo &&info) const |
server::handlers::auth::digest::AuthCheckerBase::AuthCheckerBase | ( | const AuthCheckerSettings & | digest_settings, |
std::string && | realm, | ||
const SecdistConfig & | secdist_config ) |
Assepts digest-authentication settings from server::handlers::auth::DigestCheckerSettingsComponent and "realm" from handler config in static_config.yaml.
|
overridevirtual |
Reimplemented from server::handlers::auth::AuthCheckerBase.
|
finalvirtual |
The main checking function that is called for each request.
Implements server::handlers::auth::AuthCheckerBase.
|
pure virtual |
The implementation should return std::nullopt if the user is not registered. If the user is registered, but he is not in storage, the implementation can create him with arbitrary data.
Implemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.
|
pure virtual |
Returns "nonce" creation time from "Nonce Pool" if exists.
Implemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.
|
pure virtual |
Pushes "nonce" not tied to username to "Nonce Pool".
Implemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.
|
pure virtual |
Sets user authentication data to storage.
Implemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.
|
inlineoverridevirtualnoexcept |
Returns "true" if the checker is allowed to write authentication information about the user to the RequestContext.
Implements server::handlers::auth::AuthCheckerBase.
Reimplemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.
Definition at line 95 of file auth_checker_base.hpp.