Provides test code access to CacheManager internal symbols. More...
![Inheritance graph](classCacheManagerInternals__inherit__graph.png)
![Collaboration graph](classCacheManagerInternals__coll__graph.png)
Public Types | |
typedef std::vector< Mgr::ActionProfilePointer > | Menu |
Public Member Functions | |
void | testValidUrl (const AnyP::Uri &) |
checks CacheManager parsing of the given valid URL More... | |
void | testInvalidUrl (const AnyP::Uri &, const char *problem) |
void | registerProfile (const Mgr::ActionProfilePointer &) |
remembers the given profile while ignoring attempts to register a same-name duplicate More... | |
Mgr::ActionProfilePointer | findAction (char const *action) const |
Mgr::Action::Pointer | createNamedAction (const char *actionName) |
Mgr::Action::Pointer | createRequestedAction (const Mgr::ActionParams &) |
const Menu & | menu () const |
void | start (const Comm::ConnectionPointer &client, HttpRequest *request, StoreEntry *entry, const AccessLogEntryPointer &ale) |
const char * | ActionProtection (const Mgr::ActionProfilePointer &profile) |
Static Public Member Functions | |
static const SBuf & | WellKnownUrlPathPrefix () |
initial URL path characters that identify cache manager requests More... | |
static CacheManager * | GetInstance () |
static void | PutCommonResponseHeaders (HttpReply &, const char *httpOrigin) |
Protected Member Functions | |
Mgr::CommandPointer | ParseUrl (const AnyP::Uri &) |
void | ParseHeaders (const HttpRequest *request, Mgr::ActionParams ¶ms) |
int | CheckPassword (const Mgr::Command &cmd) |
char * | PasswdGet (Mgr::ActionPasswordList *, const char *) |
Protected Attributes | |
Menu | menu_ |
Detailed Description
Definition at line 40 of file testCacheManager.cc.
Member Typedef Documentation
◆ Menu
|
inherited |
Definition at line 35 of file CacheManager.h.
Member Function Documentation
◆ ActionProtection()
|
inherited |
Definition at line 359 of file cache_manager.cc.
References assert, Config, SquidConfig::passwd_list, and CacheManager::PasswdGet().
Referenced by Mgr::MenuAction::dump(), and CacheManager::ParseUrl().
◆ CheckPassword()
|
protectedinherited |
- Return values
-
0 if mgr->password is good or "none" 1 if mgr->password is "disable" !0 if mgr->password does not match configured password
Definition at line 216 of file cache_manager.cc.
References assert, Config, debugs, Mgr::Command::params, SquidConfig::passwd_list, CacheManager::PasswdGet(), Mgr::ActionParams::password, Mgr::Command::profile, and String::size().
Referenced by CacheManager::start().
◆ createNamedAction()
|
inherited |
Definition at line 84 of file cache_manager.cc.
References CacheManager::findAction(), and Must.
Referenced by Mgr::Response::Response(), and TestCacheManager::testRegister().
◆ createRequestedAction()
|
inherited |
Definition at line 97 of file cache_manager.cc.
References Mgr::ActionParams::actionName, CacheManager::findAction(), Must, and String::termedBuf().
Referenced by Ipc::Strand::handleCacheMgrRequest(), and Ipc::Coordinator::handleCacheMgrRequest().
◆ findAction()
|
inherited |
Locates an action in the actions registry ActionsList.
- Return values
-
NULL if Action not found CacheManagerAction* if the action was found
Definition at line 66 of file cache_manager.cc.
References debugs, CacheManager::menu_, and Must.
Referenced by CacheManager::createNamedAction(), CacheManager::createRequestedAction(), CacheManager::ParseUrl(), and CacheManager::registerProfile().
◆ GetInstance()
|
staticinherited |
Definition at line 422 of file cache_manager.cc.
References debugs, and Mgr::RegisterBasics().
Referenced by Mgr::MenuAction::dump(), Ipc::Strand::handleCacheMgrRequest(), Ipc::Coordinator::handleCacheMgrRequest(), internalStart(), Mgr::RegisterAction(), Mgr::Response::Response(), TestCacheManager::testCreate(), TestCacheManager::testParseUrl(), and TestCacheManager::testRegister().
◆ menu()
|
inlineinherited |
Definition at line 46 of file CacheManager.h.
References CacheManager::menu_.
Referenced by Mgr::MenuAction::dump().
◆ ParseHeaders()
|
protectedinherited |
Definition at line 176 of file cache_manager.cc.
References assert, Http::AUTHORIZATION, DBG_IMPORTANT, debugs, HttpRequest::flags, HttpHeader::getAuthToken(), Http::Message::header, Mgr::ActionParams::httpFlags, Mgr::ActionParams::httpMethod, HttpRequestMethod::id(), HttpRequest::method, SBuf::npos, Mgr::ActionParams::password, SBufToString(), and Mgr::ActionParams::userName.
Referenced by CacheManager::start().
◆ ParseUrl()
|
protectedinherited |
Parses the action requested by the user and checks via CacheManager::ActionProtection() that the item is accessible by the user.
Syntax:
[ scheme "://" authority ] '/squid-internal-mgr' path-absolute [ "?" query ] [ "#" fragment ]
see RFC 3986 for definitions of scheme, authority, path-absolute, query
- Returns
- Mgr::Command object with action to perform and parameters it might use
Definition at line 126 of file cache_manager.cc.
References AnyP::Uri::absolute(), CacheManager::ActionProtection(), Assure, SBuf::c_str(), CharacterSet::complement(), debugs, CacheManager::findAction(), Here, AnyP::Uri::host(), Mgr::QueryParams::Parse(), AnyP::Uri::path(), SBufToString(), ToSBuf(), and CacheManager::WellKnownUrlPathPrefix().
Referenced by CacheManager::start(), testInvalidUrl(), and testValidUrl().
◆ PasswdGet()
|
protectedinherited |
Definition at line 382 of file cache_manager.cc.
References Mgr::ActionPasswordList::actions, Mgr::ActionPasswordList::next, and Mgr::ActionPasswordList::passwd.
Referenced by CacheManager::ActionProtection(), and CacheManager::CheckPassword().
◆ PutCommonResponseHeaders()
|
staticinherited |
Add HTTP response headers specific/common to all cache manager replies, including cache manager errors and Action reports.
- Parameters
-
httpOrigin the value of Origin header in the trigger HTTP request (or nil)
Definition at line 401 of file cache_manager.cc.
References Http::Message::header, HttpHdrCc::noCache(), HttpHdrCc::noStore(), Http::Message::putCc(), and HttpHeader::putExt().
Referenced by Mgr::Action::fillEntry(), Mgr::Inquirer::start(), and CacheManager::start().
◆ registerProfile()
|
inherited |
Definition at line 48 of file cache_manager.cc.
References debugs, CacheManager::findAction(), CacheManager::menu_, and Must.
Referenced by Mgr::RegisterAction().
◆ start()
|
inherited |
Main entry point in the Cache Manager's activity. Gets called as part of the forward chain if the right URL is detected there. Initiates all needed internal work and renders the response.
Definition at line 246 of file cache_manager.cc.
References HttpReply::body, ErrorState::BuildHttpReply(), CacheManager::CheckPassword(), StoreEntry::complete(), HttpBody::content(), CurrentException(), DBG_IMPORTANT, debugs, ERR_CACHE_MGR_ACCESS_DENIED, ERR_INVALID_URL, errorAppendEntry(), StoreEntry::expires, HttpHeader::getStr(), HttpHeader::has(), Http::Message::header, Here, IamWorkerProcess(), MGR_INDEX, Must, Http::ORIGIN, CacheManager::ParseHeaders(), CacheManager::ParseUrl(), Http::ProtocolVersion(), HttpHeader::putAuth(), CacheManager::PutCommonResponseHeaders(), StoreEntry::replaceHttpReply(), Http::scNotFound, Http::scOkay, Http::scUnauthorized, Http::StatusLine::set(), HttpReply::sline, squid_curtime, AsyncJob::Start(), HttpRequest::url, StoreEntry::url(), ErrorState::url, UsingSmp(), and xstrdup.
Referenced by internalStart().
◆ testInvalidUrl()
void CacheManagerInternals::testInvalidUrl | ( | const AnyP::Uri & | url, |
const char * | problem | ||
) |
checks CacheManager parsing of the given invalid URL
- Parameters
-
problem a bad part of the URL or its description
Definition at line 58 of file testCacheManager.cc.
References CacheManager::ParseUrl().
◆ testValidUrl()
void CacheManagerInternals::testValidUrl | ( | const AnyP::Uri & | url | ) |
Definition at line 52 of file testCacheManager.cc.
References CacheManager::ParseUrl().
◆ WellKnownUrlPathPrefix()
|
staticinherited |
Definition at line 107 of file cache_manager.cc.
Referenced by ForSomeCacheManager(), CacheManager::ParseUrl(), and TestCacheManager::testParseUrl().
Member Data Documentation
◆ menu_
|
protectedinherited |
Definition at line 66 of file CacheManager.h.
Referenced by CacheManager::findAction(), CacheManager::menu(), and CacheManager::registerProfile().
The documentation for this class was generated from the following file:
- src/tests/testCacheManager.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