userver: userver/server/handlers/auth/auth_checker_factory.hpp File Reference
Loading...
Searching...
No Matches
auth_checker_factory.hpp File Reference

Detailed Description

Authorization factory registration and base classes.

Definition in file auth_checker_factory.hpp.

Go to the source code of this file.

#include <stdexcept>
#include <string>
#include <string_view>
#include <vector>
#include <userver/components/component_context.hpp>
#include <userver/server/handlers/auth/auth_checker_base.hpp>
#include <userver/server/handlers/handler_config.hpp>
#include <userver/utils/not_null.hpp>
This graph shows which files directly or indirectly include this file:

Classes

class  server::handlers::auth::AuthCheckerFactoryBase
 Base class for all the authorization factory checkers. More...

Namespaces

namespace  server::handlers
 Most common userver HTTP handlers.

Functions

template<typename AuthCheckerFactory>
void server::handlers::auth::RegisterAuthCheckerFactory (std::string_view auth_type)
 Function to call from main() to register an authorization checker.
template<typename AuthCheckerFactory>
void server::handlers::auth::RegisterAuthCheckerFactory ()
 Registers an authorization checker using its kAuthType member.

Function Documentation

◆ RegisterAuthCheckerFactory() [1/2]

template<typename AuthCheckerFactory>
void server::handlers::auth::RegisterAuthCheckerFactory ( )

Registers an authorization checker using its kAuthType member.

Template Parameters
AuthCheckerFactoryadditionally must have a static constexpr std::string_view kAuthType = "..." member.
Examples
samples/postgres_auth/postgres_service.cpp.

Definition at line 66 of file auth_checker_factory.hpp.

◆ RegisterAuthCheckerFactory() [2/2]

template<typename AuthCheckerFactory>
void server::handlers::auth::RegisterAuthCheckerFactory ( std::string_view auth_type)

Function to call from main() to register an authorization checker.

Template Parameters
AuthCheckerFactorymust: 1) inherit from server::handlers::auth::AuthCheckerFactoryBase; 2) have a constructor from const components::ComponentContext&.
Parameters
auth_typeHandler auth type to associate with the factory.
Examples
samples/postgres_auth/postgres_service.cpp.

Definition at line 55 of file auth_checker_factory.hpp.