userver: storages::secdist::Secdist Class Reference
Loading...
Searching...
No Matches
storages::secdist::Secdist Class Referencefinal

#include <userver/storages/secdist/secdist.hpp>

Detailed Description

Client to retrieve credentials from the components::Secdist and to subscribe to their updates.

Examples
samples/digest_auth_service/auth_digest.hpp.

Definition at line 112 of file secdist.hpp.

Public Member Functions

 Secdist (SecdistConfig::Settings settings)
const storages::secdist::SecdistConfigGet () const
rcu::ReadablePtr< storages::secdist::SecdistConfigGetSnapshot () const
template<typename Class>
void UpdateAndListen (utils::ResourceScopeStorage &scopes, Class *obj, std::string_view name, void(Class::*func)(const storages::secdist::SecdistConfig &secdist))
template<typename Class>
concurrent::AsyncEventSubscriberScope UpdateAndListen (Class *obj, std::string_view name, void(Class::*func)(const storages::secdist::SecdistConfig &secdist))
bool IsPeriodicUpdateEnabled () const noexcept

Member Function Documentation

◆ Get()

const storages::secdist::SecdistConfig & storages::secdist::Secdist::Get ( ) const

Returns secdist data loaded on service start. Does not support secdist updating during service work.

◆ GetSnapshot()

rcu::ReadablePtr< storages::secdist::SecdistConfig > storages::secdist::Secdist::GetSnapshot ( ) const

Returns fresh secdist data (from last update). Supports secdist updating during service work.

◆ UpdateAndListen() [1/2]

template<typename Class>
concurrent::AsyncEventSubscriberScope storages::secdist::Secdist::UpdateAndListen ( Class * obj,
std::string_view name,
void(Class::* func )(const storages::secdist::SecdistConfig &secdist) )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Deprecated
Use the overload that takes utils::ResourceScopeStorage.

Store the returned scope as a member and call Unsubscribe explicitly.

Definition at line 188 of file secdist.hpp.

◆ UpdateAndListen() [2/2]

template<typename Class>
void storages::secdist::Secdist::UpdateAndListen ( utils::ResourceScopeStorage & scopes,
Class * obj,
std::string_view name,
void(Class::* func )(const storages::secdist::SecdistConfig &secdist) )

Subscribes to secdist updates using a member function, named OnSecdistUpdate by convention. Also immediately invokes the function with the current secdist data.

Further updates are delivered after utils::ResourceScopeStorage::AfterConstruction, including those updates that arrived before it. Unsubscribe runs in utils::ResourceScopeStorage::BeforeDestruction.

Parameters
scopesstorage that owns the subscription lifetime. In a component constructor pass context.Scopes() or components::GetResourceScopes.

Definition at line 176 of file secdist.hpp.


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