Cache of Auth::User credentials, keyed by Auth::User::userKey. More...

#include <CredentialsCache.h>

Collaboration diagram for Auth::CredentialsCache:

Public Member Functions

 CredentialsCache (const char *name, const char *const eventName)
 
 ~CredentialsCache ()=default
 
 CredentialsCache (const CredentialsCache &)=delete
 
CredentialsCacheoperator= (const CredentialsCache &)=delete
 
Auth::User::Pointer lookup (const SBuf &userKey) const
 
void insert (const SBuf &userKey, Auth::User::Pointer anAuth_user)
 add an user to the cache with the provided key More...
 
void reset ()
 clear cache More...
 
size_t size () const
 
void cleanup ()
 cache garbage collection, removes timed-out entries More...
 
void doConfigChangeCleanup ()
 
std::vector< Auth::User::PointersortedUsersList () const
 

Static Public Member Functions

static void Cleanup (void *)
 

Private Types

typedef std::unordered_map
< SBuf, Auth::User::Pointer
StoreType
 key is User::userKey(), mapped value is User::Pointer More...
 

Private Member Functions

 CBDATA_CLASS (CredentialsCache)
 
void scheduleCleanup ()
 

Private Attributes

bool gcScheduled_
 whether a cleanup (garbage collection) event has been scheduled More...
 
StoreType store_
 
const char *const cacheCleanupEventName
 

Detailed Description

Definition at line 21 of file CredentialsCache.h.

Member Typedef Documentation

typedef std::unordered_map<SBuf, Auth::User::Pointer> Auth::CredentialsCache::StoreType
private

Definition at line 70 of file CredentialsCache.h.

Constructor & Destructor Documentation

Auth::CredentialsCache::CredentialsCache ( const char *  name,
const char *const  eventName 
)
explicit

Definition at line 56 of file CredentialsCache.cc.

References debugs, and RegisterRunner().

Auth::CredentialsCache::~CredentialsCache ( )
default
Auth::CredentialsCache::CredentialsCache ( const CredentialsCache )
delete

Member Function Documentation

Auth::CredentialsCache::CBDATA_CLASS ( CredentialsCache  )
private
void Auth::CredentialsCache::Cleanup ( void *  data)
static

periodic cleanup function, removes timed-out entries

Must be static to support EVH interface. Argument will be this

Definition at line 75 of file CredentialsCache.cc.

References cleanup(), data, and debugs.

Referenced by scheduleCleanup().

void Auth::CredentialsCache::cleanup ( )
void Auth::CredentialsCache::doConfigChangeCleanup ( )

Cleanup cache data after a reconfiguration has occured. Similar to cleanup() but also flushes stale config dependent state from retained entries.

Definition at line 140 of file CredentialsCache.cc.

References aclCacheMatchFlush(), cleanup(), i, and store_.

void Auth::CredentialsCache::insert ( const SBuf userKey,
Auth::User::Pointer  anAuth_user 
)

Definition at line 105 of file CredentialsCache.cc.

References debugs, scheduleCleanup(), and store_.

Auth::User::Pointer Auth::CredentialsCache::lookup ( const SBuf userKey) const
Returns
a pointer to cached credentials, or nil if none found

Definition at line 65 of file CredentialsCache.cc.

References debugs, p, and store_.

CredentialsCache& Auth::CredentialsCache::operator= ( const CredentialsCache )
delete
void Auth::CredentialsCache::reset ( )
inline

Definition at line 39 of file CredentialsCache.h.

References store_.

void Auth::CredentialsCache::scheduleCleanup ( )
private

Definition at line 130 of file CredentialsCache.cc.

References cacheCleanupEventName, Cleanup(), eventAdd(), gcScheduled_, store_, and Auth::TheConfig.

Referenced by cleanup(), and insert().

size_t Auth::CredentialsCache::size ( ) const
inline
Returns
number of cached usernames

Definition at line 42 of file CredentialsCache.h.

References store_.

Referenced by sortedUsersList().

std::vector< Auth::User::Pointer > Auth::CredentialsCache::sortedUsersList ( ) const
Returns
alphanumerically sorted list of usernames

Definition at line 115 of file CredentialsCache.cc.

References size(), and store_.

Member Data Documentation

const char* const Auth::CredentialsCache::cacheCleanupEventName
private

Definition at line 74 of file CredentialsCache.h.

Referenced by scheduleCleanup().

bool Auth::CredentialsCache::gcScheduled_
private

Definition at line 67 of file CredentialsCache.h.

Referenced by cleanup(), and scheduleCleanup().

StoreType Auth::CredentialsCache::store_
private

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors