#include <SchemeConfig.h>

| Public Member Functions | |
| SchemeConfig () | |
| virtual | ~SchemeConfig () | 
| virtual bool | active () const =0 | 
| virtual UserRequest::Pointer | decode (char const *proxy_auth, const HttpRequest *request, const char *requestRealm)=0 | 
| virtual void | done () | 
| virtual bool | configured () const | 
| 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 *, size_t, char *) | 
| virtual const char * | type () const =0 | 
| Static Public Member Functions | |
| static UserRequest::Pointer | CreateAuthUser (const char *proxy_auth, AccessLogEntry::Pointer &al) | 
| static SchemeConfig * | Find (const char *proxy_auth) | 
| static SchemeConfig * | GetParsed (const char *proxy_auth) | 
| Public Attributes | |
| Helper::ChildConfig | authenticateChildren | 
| wordlist * | authenticateProgram = nullptr | 
| Helper program to run, includes all parameters.  More... | |
| String | keyExtrasLine | 
| The format of the request to the auth helper.  More... | |
| Format::Format * | keyExtras = nullptr | 
| The compiled request format.  More... | |
| int | keep_alive = 1 | 
| whether to close the connection on auth challenges. default: on  More... | |
| int | utf8 = 0 | 
| whether to accept UTF-8 characterset instead of ASCII. default: off  More... | |
| Protected Member Functions | |
| bool | isCP1251EncodingAllowed (const HttpRequest *request) | 
| 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
◆ SchemeConfig()
| 
 | inline | 
Definition at line 56 of file SchemeConfig.h.
◆ ~SchemeConfig()
| 
 | inlinevirtual | 
Definition at line 58 of file SchemeConfig.h.
Member Function Documentation
◆ active()
| 
 | pure virtual | 
Used by squid to determine whether the auth module has successfully initialised itself with the current configuration.
- Return values
- 
  true Authentication Module loaded and running. false No Authentication Module loaded. 
Referenced by configDoConfigure(), and CreateAuthUser().
◆ configured()
| 
 | 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
- 
  true Authentication Module configured ready for use. false Not configured or Configuration Error. No other module functions except Shutdown/Dump/Parse/FreeConfig will be called by Squid. 
Definition at line 183 of file SchemeConfig.cc.
◆ CreateAuthUser()
| 
 | static | 
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 33 of file SchemeConfig.cc.
References active(), Format::Format::assemble(), assert, MemBuf::content(), DBG_IMPORTANT, debugs, decode(), Find(), MemBuf::hasContent(), keyExtras, AccessLogEntry::request, MemBuf::reset(), and shutting_down.
Referenced by Auth::UserRequest::authenticate().
◆ decode()
| 
 | 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().
- Parameters
- 
  proxy_auth Login Pattern to parse. 
- Return values
- 
  * Details needed to authenticate. 
Referenced by CreateAuthUser().
◆ done()
| 
 | virtual | 
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.
TODO: need a 'done for reconfigure' and a 'done permanently' concept.
Definition at line 175 of file SchemeConfig.cc.
◆ dump()
| 
 | virtual | 
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 140 of file SchemeConfig.cc.
References wordlist::key, wordlist::next, SQUIDSBUFPH, SQUIDSBUFPRINT, storeAppendPrintf(), and type().
◆ Find()
| 
 | static | 
Definition at line 59 of file SchemeConfig.cc.
References Auth::TheConfig.
Referenced by authDigestLogUsername(), authDigestNonceIsStale(), authDigestNonceIsValid(), authDigestNonceLastRequest(), Auth::UserRequest::authenticate(), authenticateCachedUsersList(), authenticateDigestNonceCacheCleanup(), authenticateDigestNonceSetup(), configDoConfigure(), CreateAuthUser(), and parse_authparam().
◆ fixHeader()
| 
 | pure virtual | 
add headers as needed when challenging for auth
Referenced by Auth::UserRequest::AddReplyAuthHeader().
◆ GetParsed()
| 
 | static | 
Call this method if you need a guarantee that all auth schemes has been already configured.
Definition at line 70 of file SchemeConfig.cc.
References fatalf().
Referenced by Auth::SchemesConfig::expand().
◆ init()
| 
 | pure virtual | 
prepare to handle requests
◆ isCP1251EncodingAllowed()
| 
 | protected | 
Parse Accept-Language header and return whether a CP1251 encoding allowed or not.
CP1251 (aka Windows-1251) is an 8-bit character encoding, designed to cover languages that use the Cyrillic script.
Definition at line 189 of file SchemeConfig.cc.
References Http::ACCEPT_LANGUAGE, HttpHeader::getList(), Http::Message::header, strHdrAcptLangGetItem(), and xisalpha.
◆ parse()
| 
 | virtual | 
parse config options
Definition at line 84 of file SchemeConfig.cc.
References DBG_CRITICAL, DBG_IMPORTANT, DBG_PARSE_NOTE, debugs, ConfigParser::NextQuotedOrToEol(), ConfigParser::NextQuotedToken(), Format::Format::parse(), parse_onoff(), parse_wordlist(), requirePathnameExists(), self_destruct(), type(), w_space, wordlistDestroy(), and xisspace.
Referenced by parse_authparam().
◆ registerWithCacheManager()
| 
 | virtual | 
expose any/all statistics to a CacheManager
Default behaviour is to expose nothing
Definition at line 80 of file SchemeConfig.cc.
◆ rotateHelpers()
| 
 | pure virtual | 
Shutdown just the auth helpers. For use by log rotate etc. where auth needs to stay running, with the helpers restarted.
◆ type()
| 
 | pure virtual | 
the http string id
Referenced by Auth::UserRequest::authenticate(), dump(), and parse().
Member Data Documentation
◆ authenticateChildren
| Helper::ChildConfig Auth::SchemeConfig::authenticateChildren | 
Definition at line 128 of file SchemeConfig.h.
◆ authenticateProgram
| wordlist* Auth::SchemeConfig::authenticateProgram = nullptr | 
Definition at line 129 of file SchemeConfig.h.
◆ keep_alive
| int Auth::SchemeConfig::keep_alive = 1 | 
Definition at line 132 of file SchemeConfig.h.
◆ keyExtras
| Format::Format* Auth::SchemeConfig::keyExtras = nullptr | 
Definition at line 131 of file SchemeConfig.h.
Referenced by CreateAuthUser().
◆ keyExtrasLine
| String Auth::SchemeConfig::keyExtrasLine | 
Definition at line 130 of file SchemeConfig.h.
◆ realm
| 
 | protected | 
Definition at line 146 of file SchemeConfig.h.
◆ utf8
| int Auth::SchemeConfig::utf8 = 0 | 
Definition at line 133 of file SchemeConfig.h.
The documentation for this class was generated from the following files:
- src/auth/SchemeConfig.h
- src/auth/SchemeConfig.cc
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products
