#include <User.h>
Public Types | |
typedef RefCount< User > | Pointer |
Public Member Functions | |
~User () override | |
void | absorb (Auth::User::Pointer from) |
char const * | username () const |
void | username (char const *) |
set stored username and userKey More... | |
const SBuf | userKey () const |
virtual int32_t | ttl () const =0 |
void | clearIp () |
void | removeIp (Ip::Address) |
void | addIp (Ip::Address) |
virtual void | addToNameCache ()=0 |
add the Auth::User to the protocol-specific username cache. More... | |
CredentialState | credentials () const |
void | credentials (CredentialState) |
Static Public Member Functions | |
static SBuf | BuildUserKey (const char *username, const char *realm) |
static void | CredentialsCacheStats (StoreEntry *output) |
static CbcPointer< Auth::CredentialsCache > | Cache () |
Public Attributes | |
Auth::Type | auth_type |
Auth::SchemeConfig * | config |
dlink_list | proxy_match_cache |
size_t | ipcount |
long | expiretime |
NotePairs | notes |
list of key=value pairs the helper produced More... | |
Protected Member Functions | |
User (Auth::SchemeConfig *, const char *requestRealm) | |
Private Attributes | |
CredentialState | credentials_state |
const char * | username_ |
SBuf | requestRealm_ |
SBuf | userKey_ |
dlink_list | ip_list |
Detailed Description
This is the main user related structure. It stores user-related data, and is persistent across requests. It can even persist across multiple external authentications. One major benefit of preserving this structure is the cached ACL match results. This structure, is private to the authentication framework.
Member Typedef Documentation
◆ Pointer
typedef RefCount<User> Auth::User::Pointer |
Constructor & Destructor Documentation
◆ User()
|
protected |
Definition at line 23 of file User.cc.
References debugs, dlink_list::head, ip_list, proxy_match_cache, and dlink_list::tail.
◆ ~User()
|
override |
Definition at line 120 of file User.cc.
References aclCacheMatchFlush(), assert, Auth::AUTH_UNKNOWN, debugs, and xfree.
Member Function Documentation
◆ absorb()
void Auth::User::absorb | ( | Auth::User::Pointer | from | ) |
Combine two user structs. ONLY to be called from within a scheme module. The scheme module is responsible for ensuring that the two users can be merged without invalidating all the request scheme data. The scheme is also responsible for merging any user related scheme data itself. The caller is responsible for altering all refcount pointers to the 'from' object. They are invalid once this method is complete.
Definition at line 59 of file User.cc.
References assert, dlink_node::data, debugs, dlinkAddTail(), dlinkDelete(), dlink_list::head, AuthUserIP::ip_expiretime, ip_list, AuthUserIP::ipaddr, ipcount, max(), dlink_node::next, AuthUserIP::node, notes, and squid_curtime.
◆ addIp()
void Auth::User::addIp | ( | Ip::Address | ipaddr | ) |
Definition at line 184 of file User.cc.
References assert, debugs, dlinkAddTail(), dlinkDelete(), AuthUserIP::ip_expiretime, AuthUserIP::ipaddr, Auth::Config::ipTtl, dlink_node::next, AuthUserIP::node, squid_curtime, and Auth::TheConfig.
Referenced by authenticateAuthUserRequestSetIp().
◆ addToNameCache()
|
pure virtual |
◆ BuildUserKey()
|
static |
Definition at line 229 of file User.cc.
References SBuf::append(), and SBuf::Printf().
◆ Cache()
|
static |
◆ clearIp()
void Auth::User::clearIp | ( | ) |
Definition at line 139 of file User.cc.
References assert, dlinkDelete(), dlink_node::next, and AuthUserIP::node.
Referenced by authenticateAuthUserRequestClearIp().
◆ credentials() [1/2]
Auth::CredentialState Auth::User::credentials | ( | ) | const |
◆ credentials() [2/2]
void Auth::User::credentials | ( | CredentialState | newCreds | ) |
◆ CredentialsCacheStats()
|
static |
Dump the username cache statistics for viewing...
Definition at line 243 of file User.cc.
References authenticateCachedUsersList(), Auth::CredentialState_str, Auth::Config::credentialsTtl, squid_curtime, SQUIDSBUFPH, SQUIDSBUFPRINT, storeAppendPrintf(), Auth::TheConfig, and Auth::Type_str.
Referenced by statRegisterWithCacheManager().
◆ removeIp()
void Auth::User::removeIp | ( | Ip::Address | ipaddr | ) |
Definition at line 161 of file User.cc.
References assert, dlinkDelete(), AuthUserIP::ipaddr, dlink_node::next, and AuthUserIP::node.
Referenced by authenticateAuthUserRequestRemoveIp().
◆ ttl()
|
pure virtual |
How long these credentials are still valid for. Negative numbers means already expired.
◆ userKey()
|
inline |
◆ username() [1/2]
|
inline |
◆ username() [2/2]
void Auth::User::username | ( | char const * | aString | ) |
Member Data Documentation
◆ auth_type
Auth::Type Auth::User::auth_type |
- Deprecated:
- this determines what scheme owns the user data.
◆ config
Auth::SchemeConfig* Auth::User::config |
the config for this user
Definition at line 50 of file User.h.
Referenced by Auth::UserRequest::AddReplyAuthHeader().
◆ credentials_state
|
private |
◆ expiretime
◆ ip_list
|
private |
◆ ipcount
size_t Auth::User::ipcount |
Definition at line 52 of file User.h.
Referenced by absorb(), and authenticateAuthUserRequestIPCount().
◆ notes
NotePairs Auth::User::notes |
Definition at line 56 of file User.h.
Referenced by absorb(), and authTryGetUser().
◆ proxy_match_cache
dlink_list Auth::User::proxy_match_cache |
◆ requestRealm_
|
private |
◆ userKey_
|
private |
◆ username_
|
private |
DPW 2007-05-08 The username_ memory will be allocated via xstrdup(). It is our responsibility.
Definition at line 107 of file User.h.
Referenced by username().
The documentation for this class was generated from the following files: