#include <SchemeConfig.h>

Collaboration diagram for Auth::SchemeConfig:

Public Member Functions

 SchemeConfig ()
virtual ~SchemeConfig ()
virtual bool active () const =0
virtual UserRequest::Pointer decode (char const *proxy_auth, const char *requestRealm)=0
virtual void done ()
virtual bool configured () const =0
virtual void rotateHelpers (void)=0
virtual bool dump (StoreEntry *, const char *, SchemeConfig *) const
virtual void fixHeader (UserRequest::Pointer, HttpReply *, Http::HdrType, HttpRequest *)=0
virtual void init (SchemeConfig *)=0
virtual void registerWithCacheManager (void)
virtual void parse (SchemeConfig *, int, char *)
virtual const char * type () const =0

Static Public Member Functions

static UserRequest::Pointer CreateAuthUser (const char *proxy_auth, AccessLogEntry::Pointer &al)
static SchemeConfigFind (const char *proxy_auth)
static SchemeConfigGetParsed (const char *proxy_auth)

Public Attributes

Helper::ChildConfig authenticateChildren
wordlistauthenticateProgram = nullptr
 Helper program to run, includes all parameters. More...
String keyExtrasLine
 The format of the request to the auth helper. More...
Format::FormatkeyExtras = nullptr
 The compiled request format. More...
int keep_alive = 1
 whether to close the connection on auth challenges. default: on More...
int utf8 = 0
 wheter to accept UTF-8 characterset instead of ASCII. default: off More...

Protected Attributes

SBuf realm
 RFC 7235 section 2.2 - Protection Space (Realm) More...

Detailed Description

I am the configuration for an auth scheme. Currently each scheme has only one instance of me, but this may change.
This class is treated like a ref counted class. If the children ever stop being singletons, implement the ref counting...

Definition at line 46 of file SchemeConfig.h.

Constructor & Destructor Documentation

Auth::SchemeConfig::SchemeConfig ( )

Definition at line 56 of file SchemeConfig.h.

virtual Auth::SchemeConfig::~SchemeConfig ( )

Definition at line 58 of file SchemeConfig.h.

Member Function Documentation

virtual bool Auth::SchemeConfig::active ( ) const
pure virtual

Used by squid to determine whether the auth module has successfully initialised itself with the current configuration.

Return values
trueAuthentication Module loaded and running.
falseNo Authentication Module loaded.

Referenced by configDoConfigure(), and CreateAuthUser().

virtual bool Auth::SchemeConfig::configured ( ) const
pure virtual

The configured function is used to see if the auth module has been given valid parameters and is able to handle authentication requests.

Return values
trueAuthentication Module configured ready for use.
falseNot configured or Configuration Error. No other module functions except Shutdown/Dump/Parse/FreeConfig will be called by Squid.
Auth::UserRequest::Pointer Auth::SchemeConfig::CreateAuthUser ( const char *  proxy_auth,
AccessLogEntry::Pointer al 

Get an User credentials object filled out for the given Proxy- or WWW-Authenticate header. Any decoding which needs to be done will be done.

It may be a cached AuthUser or a new Unauthenticated object. It may also be NULL reflecting that no user could be created.

Definition at line 32 of file SchemeConfig.cc.

References active(), Format::Format::assemble(), assert, MemBuf::content(), DBG_IMPORTANT, debugs, decode(), Find(), MemBuf::hasContent(), HERE(), keyExtras, NULL, MemBuf::reset(), and shutting_down.

Referenced by Auth::UserRequest::authenticate().

virtual UserRequest::Pointer Auth::SchemeConfig::decode ( char const *  proxy_auth,
const char *  requestRealm 
pure virtual

new decode API: virtual factory pattern

Responsible for decoding the passed authentication header, creating or linking to a AuthUser object and for storing any needed details to complete authentication in Auth::UserRequest::authenticate().
proxy_authLogin Pattern to parse.
Return values
*Details needed to authenticate.

Referenced by CreateAuthUser().

void Auth::SchemeConfig::done ( )

squid is finished with this config, release any unneeded resources. If a singleton, delete will not occur. if not a singleton (future), delete will occur when no references are held.

we need a 'done for reconfigure' and a 'done permanently' concept.

Definition at line 174 of file SchemeConfig.cc.

References NULL.

bool Auth::SchemeConfig::dump ( StoreEntry entry,
const char *  name,
Auth::SchemeConfig scheme 
) const

Responsible for writing to the StoreEntry the configuration parameters that a user would put in a config file to recreate the running configuration. Returns whether the scheme is configured.

Definition at line 139 of file SchemeConfig.cc.

References wordlist::key, wordlist::next, NULL, SQUIDSBUFPH, SQUIDSBUFPRINT, storeAppendPrintf(), and type().

virtual void Auth::SchemeConfig::fixHeader ( UserRequest::Pointer  ,
HttpReply ,
Http::HdrType  ,
pure virtual

add headers as needed when challenging for auth

Referenced by Auth::UserRequest::AddReplyAuthHeader().

Auth::SchemeConfig * Auth::SchemeConfig::GetParsed ( const char *  proxy_auth)

Call this method if you need a guarantee that all auth schemes has been already configured.

Definition at line 69 of file SchemeConfig.cc.

References fatalf().

Referenced by Auth::SchemesConfig::expand().

virtual void Auth::SchemeConfig::init ( SchemeConfig )
pure virtual

prepare to handle requests

void Auth::SchemeConfig::registerWithCacheManager ( void  )

expose any/all statistics to a CacheManager

Default behaviour is to expose nothing

Definition at line 79 of file SchemeConfig.cc.

virtual void Auth::SchemeConfig::rotateHelpers ( void  )
pure virtual

Shutdown just the auth helpers. For use by log rotate etc. where auth needs to stay running, with the helpers restarted.

virtual const char* Auth::SchemeConfig::type ( ) const
pure virtual

the http string id

Referenced by Auth::UserRequest::authenticate(), dump(), and parse().

Member Data Documentation

Helper::ChildConfig Auth::SchemeConfig::authenticateChildren

Definition at line 128 of file SchemeConfig.h.

wordlist* Auth::SchemeConfig::authenticateProgram = nullptr

Definition at line 129 of file SchemeConfig.h.

int Auth::SchemeConfig::keep_alive = 1

Definition at line 132 of file SchemeConfig.h.

Format::Format* Auth::SchemeConfig::keyExtras = nullptr

Definition at line 131 of file SchemeConfig.h.

Referenced by CreateAuthUser().

String Auth::SchemeConfig::keyExtrasLine

Definition at line 130 of file SchemeConfig.h.

SBuf Auth::SchemeConfig::realm

Definition at line 137 of file SchemeConfig.h.

int Auth::SchemeConfig::utf8 = 0

Definition at line 133 of file SchemeConfig.h.

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






Web Site Translations