userver: server::handlers::auth::digest::AuthCheckerBase Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
server::handlers::auth::digest::AuthCheckerBase Class Referenceabstract

#include <userver/server/handlers/auth/digest/auth_checker_base.hpp>

Detailed Description

Base class for digest authentication checkers. Implements a digest-authentication logic.

Examples
samples/digest_auth_service/auth_digest.cpp.

Definition at line 73 of file auth_checker_base.hpp.

+ Inheritance diagram for server::handlers::auth::digest::AuthCheckerBase:
+ Collaboration diagram for server::handlers::auth::digest::AuthCheckerBase:

Public Member Functions

 AuthCheckerBase (const AuthCheckerSettings &digest_settings, std::string &&realm, const SecdistConfig &secdist_config)
 
 AuthCheckerBase (const AuthCheckerBase &)=delete
 
 AuthCheckerBase (AuthCheckerBase &&)=delete
 
AuthCheckerBaseoperator= (const AuthCheckerBase &)=delete
 
AuthCheckerBaseoperator= (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< UserDataFetchUserData (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
 

Constructor & Destructor Documentation

◆ AuthCheckerBase()

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.

◆ ~AuthCheckerBase()

server::handlers::auth::digest::AuthCheckerBase::~AuthCheckerBase ( )
overridevirtual

Member Function Documentation

◆ CheckAuth()

AuthCheckResult server::handlers::auth::digest::AuthCheckerBase::CheckAuth ( const http::HttpRequest & request,
request::RequestContext & request_context ) const
finalvirtual

The main checking function that is called for each request.

Implements server::handlers::auth::AuthCheckerBase.

◆ FetchUserData()

virtual std::optional< UserData > server::handlers::auth::digest::AuthCheckerBase::FetchUserData ( const std::string & username) const
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.

◆ GetUnnamedNonceCreationTime()

virtual std::optional< TimePoint > server::handlers::auth::digest::AuthCheckerBase::GetUnnamedNonceCreationTime ( const std::string & nonce) const
pure virtual

Returns "nonce" creation time from "Nonce Pool" if exists.

Implemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.

◆ PushUnnamedNonce()

virtual void server::handlers::auth::digest::AuthCheckerBase::PushUnnamedNonce ( std::string nonce) const
pure virtual

Pushes "nonce" not tied to username to "Nonce Pool".

Implemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.

◆ SetUserData()

virtual void server::handlers::auth::digest::AuthCheckerBase::SetUserData ( const std::string & username,
const std::string & nonce,
std::int64_t nonce_count,
TimePoint nonce_creation_time ) const
pure virtual

Sets user authentication data to storage.

Implemented in server::handlers::auth::digest::AuthStandaloneCheckerBase.

◆ SupportsUserAuth()

bool server::handlers::auth::digest::AuthCheckerBase::SupportsUserAuth ( ) const
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.


The documentation for this class was generated from the following file: