Helper::ChildConfig redirectChildren;
Helper::ChildConfig storeIdChildren;
- time_t authenticateGCInterval;
- time_t authenticateTTL;
- time_t authenticateIpTTL;
struct {
char *surrogate_id;
/// the ACL list for auth_schemes directives
acl_access *schemeAccess = nullptr;
+
+ /// the authenticate_cache_garbage_interval
+ time_t authenticateGCInterval;
+
+ /// the authenticate_ttl
+ time_t authenticateTTL;
+
+ /// the authenticate_ip_ttl
+ time_t authenticateIpTTL;
};
extern Auth::Config TheConfig;
#include "squid.h"
#include "acl/Gadgets.h"
+#include "auth/Config.h"
#include "auth/CredentialsCache.h"
#include "base/RunnersRegistry.h"
#include "Debug.h"
#include "event.h"
-#include "SquidConfig.h"
-#include "SquidTime.h"
namespace Auth {
CredentialsCache::cleanup()
{
// cache entries with expiretime <= expirationTime are to be evicted
- const time_t expirationTime = current_time.tv_sec - ::Config.authenticateTTL;
+ const time_t expirationTime = current_time.tv_sec - Auth::TheConfig.authenticateTTL;
const auto end = store_.end();
for (auto i = store_.begin(); i != end;) {
if (!gcScheduled_ && store_.size()) {
gcScheduled_ = true;
eventAdd(cacheCleanupEventName, &CredentialsCache::Cleanup,
- this, ::Config.authenticateGCInterval, 1);
+ this, Auth::TheConfig.authenticateGCInterval, 1);
}
}
#include "squid.h"
#include "acl/Acl.h"
#include "acl/Gadgets.h"
+#include "auth/Config.h"
#include "auth/CredentialsCache.h"
#include "auth/Gadgets.h"
-#include "auth/SchemeConfig.h"
#include "auth/User.h"
#include "auth/UserRequest.h"
#include "event.h"
#include "globals.h"
-#include "SquidConfig.h"
#include "SquidTime.h"
#include "Store.h"
/* This ip has already been seen. */
found = 1;
/* update IP ttl */
- ipdata->ip_expiretime = squid_curtime + ::Config.authenticateIpTTL;
+ ipdata->ip_expiretime = squid_curtime + Auth::TheConfig.authenticateIpTTL;
} else if (ipdata->ip_expiretime <= squid_curtime) {
/* This IP has expired - remove from the seen list */
dlinkDelete(&ipdata->node, &ip_list);
return;
/* This ip is not in the seen list */
- ipdata = new AuthUserIP(ipaddr, squid_curtime + ::Config.authenticateIpTTL);
+ ipdata = new AuthUserIP(ipaddr, squid_curtime + Auth::TheConfig.authenticateIpTTL);
dlinkAddTail(ipdata, &ipdata->node, &ip_list);
Auth::Type_str[auth_user->auth_type],
CredentialState_str[auth_user->credentials()],
auth_user->ttl(),
- static_cast<int32_t>(auth_user->expiretime - squid_curtime + ::Config.authenticateTTL),
+ static_cast<int32_t>(auth_user->expiretime - squid_curtime + Auth::TheConfig.authenticateTTL),
auth_user->username(),
SQUIDSBUFPRINT(auth_user->userKey())
);
#include "HttpReply.h"
#include "HttpRequest.h"
#include "MemBuf.h"
-#include "SquidConfig.h"
/* Generic Functions */
#include "squid.h"
#include "auth/basic/Config.h"
#include "auth/basic/User.h"
+#include "auth/Config.h"
#include "auth/CredentialsCache.h"
#include "Debug.h"
-#include "SquidConfig.h"
-#include "SquidTime.h"
Auth::Basic::User::User(Auth::SchemeConfig *aConfig, const char *aRequestRealm) :
Auth::User(aConfig, aRequestRealm),
return -1; // TTL is obsolete NOW.
int32_t basic_ttl = expiretime - squid_curtime + static_cast<Auth::Basic::Config*>(config)->credentialsTTL;
- int32_t global_ttl = static_cast<int32_t>(expiretime - squid_curtime + ::Config.authenticateTTL);
+ int32_t global_ttl = static_cast<int32_t>(expiretime - squid_curtime + Auth::TheConfig.authenticateTTL);
return min(basic_ttl, global_ttl);
}
*/
#include "squid.h"
+#include "auth/Config.h"
#include "auth/CredentialsCache.h"
#include "auth/digest/Config.h"
#include "auth/digest/User.h"
#include "Debug.h"
#include "dlink.h"
-#include "SquidConfig.h"
-#include "SquidTime.h"
Auth::Digest::User::User(Auth::SchemeConfig *aConfig, const char *aRequestRealm) :
Auth::User(aConfig, aRequestRealm),
int32_t
Auth::Digest::User::ttl() const
{
- int32_t global_ttl = static_cast<int32_t>(expiretime - squid_curtime + ::Config.authenticateTTL);
+ int32_t global_ttl = static_cast<int32_t>(expiretime - squid_curtime + Auth::TheConfig.authenticateTTL);
/* find the longest lasting nonce. */
int32_t latest_nonce = -1;
DOC_END
NAME: authenticate_cache_garbage_interval
+IFDEF: USE_AUTH
TYPE: time_t
DEFAULT: 1 hour
-LOC: Config.authenticateGCInterval
+LOC: Auth::TheConfig.authenticateGCInterval
DOC_START
The time period between garbage collection across the username cache.
This is a trade-off between memory utilization (long intervals - say
DOC_END
NAME: authenticate_ttl
+IFDEF: USE_AUTH
TYPE: time_t
DEFAULT: 1 hour
-LOC: Config.authenticateTTL
+LOC: Auth::TheConfig.authenticateTTL
DOC_START
The time a user & their credentials stay in the logged in
user cache since their last request. When the garbage
DOC_END
NAME: authenticate_ip_ttl
+IFDEF: USE_AUTH
TYPE: time_t
-LOC: Config.authenticateIpTTL
+LOC: Auth::TheConfig.authenticateIpTTL
DEFAULT: 1 second
DOC_START
If you use proxy authentication and the 'max_user_ip' ACL,