#include <User.h>

Inheritance diagram for Auth::User:
Collaboration diagram for Auth::User:

Public Types

typedef RefCount< UserPointer
 

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::CredentialsCacheCache ()
 

Public Attributes

Auth::Type auth_type
 
Auth::SchemeConfigconfig
 
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.

Definition at line 36 of file User.h.

Member Typedef Documentation

◆ Pointer

Definition at line 39 of file User.h.

Constructor & Destructor Documentation

◆ User()

Auth::User::User ( Auth::SchemeConfig aConfig,
const char *  requestRealm 
)
protected

Definition at line 23 of file User.cc.

References debugs, dlink_list::head, ip_list, proxy_match_cache, and dlink_list::tail.

◆ ~User()

Auth::User::~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()

◆ addToNameCache()

virtual void Auth::User::addToNameCache ( )
pure virtual

◆ BuildUserKey()

SBuf Auth::User::BuildUserKey ( const char *  username,
const char *  realm 
)
static

Definition at line 229 of file User.cc.

References SBuf::append(), and SBuf::Printf().

◆ Cache()

static CbcPointer< Auth::CredentialsCache > Auth::User::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

Definition at line 38 of file User.cc.

◆ credentials() [2/2]

void Auth::User::credentials ( CredentialState  newCreds)

Definition at line 44 of file User.cc.

◆ CredentialsCacheStats()

void Auth::User::CredentialsCacheStats ( StoreEntry output)
static

◆ removeIp()

void Auth::User::removeIp ( Ip::Address  ipaddr)

◆ ttl()

virtual int32_t Auth::User::ttl ( ) const
pure virtual

How long these credentials are still valid for. Negative numbers means already expired.

◆ userKey()

const SBuf Auth::User::userKey ( ) const
inline

Definition at line 66 of file User.h.

References userKey_.

◆ username() [1/2]

char const * Auth::User::username ( ) const
inline

Definition at line 62 of file User.h.

References username_.

◆ username() [2/2]

void Auth::User::username ( char const *  aString)

Definition at line 267 of file User.cc.

References assert, safe_free, and xstrdup.

Member Data Documentation

◆ auth_type

Auth::Type Auth::User::auth_type
Deprecated:
this determines what scheme owns the user data.

Definition at line 48 of file User.h.

◆ 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

CredentialState Auth::User::credentials_state
private

The current state these credentials are in: Unchecked Authenticated Pending helper result Handshake happening in stateful auth. Failed auth

Definition at line 99 of file User.h.

◆ expiretime

long Auth::User::expiretime

Definition at line 53 of file User.h.

◆ ip_list

dlink_list Auth::User::ip_list
private

what ip addresses has this user been seen at?, plus a list length cache

Definition at line 121 of file User.h.

Referenced by User(), and absorb().

◆ 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

Definition at line 51 of file User.h.

Referenced by User().

◆ requestRealm_

SBuf Auth::User::requestRealm_
private

A realm for the user depending on request, designed to identify users, with the same username and different authentication domains.

Definition at line 113 of file User.h.

◆ userKey_

SBuf Auth::User::userKey_
private

A Unique key for the user, consist by username and requestRealm_

Definition at line 118 of file User.h.

Referenced by userKey().

◆ username_

const char* Auth::User::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:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors