30 debugs(29, 5,
"Terminating Auth credentials cache: " <<
name);
37 debugs(29, 5,
"Clearing Auth credentials cache: " <<
name);
42 debugs(29, 5,
"Reconfiguring Auth credentials cache: " <<
name);
58 cacheCleanupEventName(prettyEvName)
60 debugs(29, 5,
"initializing " << name <<
" credentials cache");
67 debugs(29, 6,
"lookup for " << userKey);
68 auto p =
store_.find(userKey);
77 debugs(29, 5,
"checkpoint");
89 const auto end =
store_.end();
90 for (
auto i =
store_.begin(); i != end;) {
91 debugs(29, 6,
"considering " << i->first <<
"(expires in " <<
92 (expirationTime - i->second->expiretime) <<
" sec)");
93 if (i->second->expiretime <= expirationTime) {
94 debugs(29, 6,
"evicting " << i->first);
107 debugs(29, 6,
"adding " << userKey <<
" (" << anAuth_user->username() <<
")");
108 store_[userKey] = anAuth_user;
114std::vector<Auth::User::Pointer>
117 std::vector<Auth::User::Pointer> rv(
size(),
nullptr);
118 std::transform(
store_.begin(),
store_.end(), rv.begin(),
119 [](StoreType::value_type v) { return v.second; }
121 std::sort(rv.begin(), rv.end(),
123 return strcmp(lhs->username(), rhs->username()) < 0;
bool RegisterRunner(RegisteredRunner *rr)
registers a given runner with the given registry and returns true on success
#define CBDATA_CLASS_INIT(type)
time_t credentialsTtl
the authenticate_ttl
void endingShutdown() override
CbcPointer< CredentialsCache > whichCache
reference to the scheme cache which is being managed
~CredentialCacheRr() override
CredentialCacheRr(const char *n, CredentialsCache *const c)
const char * name
name of the cache being managed, for logs
void syncConfig() override
Cache of Auth::User credentials, keyed by Auth::User::userKey.
Auth::User::Pointer lookup(const SBuf &userKey) const
bool gcScheduled_
whether a cleanup (garbage collection) event has been scheduled
void cleanup()
cache garbage collection, removes timed-out entries
void doConfigChangeCleanup()
std::vector< Auth::User::Pointer > sortedUsersList() const
static void Cleanup(void *)
CredentialsCache(const char *name, const char *const eventName)
const char *const cacheCleanupEventName
void insert(const SBuf &userKey, const Auth::User::Pointer &anAuth_user)
add an user to the cache with the provided key
#define debugs(SECTION, LEVEL, CONTENT)
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
void aclCacheMatchFlush(dlink_list *cache)
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format