Provides test code access to CacheManager internal symbols. More...

Inheritance diagram for CacheManagerInternals:
Collaboration diagram for CacheManagerInternals:

Public Types

typedef std::vector< Mgr::ActionProfilePointerMenu
 

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 (char const *action, char const *desc, OBJH *handler, int pw_req_flag, int atomic)
 
void registerProfile (char const *action, char const *desc, Mgr::ClassActionCreationHandler *handler, int pw_req_flag, int atomic)
 
Mgr::ActionProfilePointer findAction (char const *action) const
 
Mgr::Action::Pointer createNamedAction (const char *actionName)
 
Mgr::Action::Pointer createRequestedAction (const Mgr::ActionParams &)
 
const Menumenu () 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 SBufWellKnownUrlPathPrefix ()
 initial URL path characters that identify cache manager requests More...
 
static CacheManagerGetInstance ()
 
static void PutCommonResponseHeaders (HttpReply &, const char *httpOrigin)
 

Protected Member Functions

void registerProfile (const Mgr::ActionProfilePointer &profile)
 Registers new profiles, ignoring attempts to register a duplicate. More...
 
Mgr::CommandPointer ParseUrl (const AnyP::Uri &)
 
void ParseHeaders (const HttpRequest *request, Mgr::ActionParams &params)
 
int CheckPassword (const Mgr::Command &cmd)
 
char * PasswdGet (Mgr::ActionPasswordList *, const char *)
 

Protected Attributes

Menu menu_
 

Detailed Description

Definition at line 39 of file testCacheManager.cc.

Member Typedef Documentation

◆ Menu

Definition at line 35 of file CacheManager.h.

Member Function Documentation

◆ ActionProtection()

const char * CacheManager::ActionProtection ( const Mgr::ActionProfilePointer profile)
inherited

◆ CheckPassword()

int CacheManager::CheckPassword ( const Mgr::Command cmd)
protectedinherited
Return values
0if mgr->password is good or "none"
1if mgr->password is "disable"
!0if mgr->password does not match configured password

Definition at line 265 of file cache_manager.cc.

References action(), 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()

Mgr::Action::Pointer CacheManager::createNamedAction ( const char *  actionName)
inherited

Definition at line 133 of file cache_manager.cc.

References CacheManager::findAction(), and Must.

Referenced by Mgr::Response::Response(), and TestCacheManager::testRegister().

◆ createRequestedAction()

Mgr::Action::Pointer CacheManager::createRequestedAction ( const Mgr::ActionParams params)
inherited

◆ findAction()

Mgr::ActionProfile::Pointer CacheManager::findAction ( char const *  action) const
inherited

Locates an action in the actions registry ActionsList.

Return values
NULLif Action not found
CacheManagerAction*if the action was found

Definition at line 115 of file cache_manager.cc.

References action(), debugs, CacheManager::menu_, and Must.

Referenced by CacheManager::createNamedAction(), CacheManager::createRequestedAction(), CacheManager::ParseUrl(), and CacheManager::registerProfile().

◆ GetInstance()

◆ menu()

const Menu & CacheManager::menu ( ) const
inlineinherited

Definition at line 49 of file CacheManager.h.

References CacheManager::menu_.

Referenced by Mgr::MenuAction::dump().

◆ ParseHeaders()

◆ ParseUrl()

Mgr::Command::Pointer CacheManager::ParseUrl ( const AnyP::Uri uri)
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 175 of file cache_manager.cc.

References AnyP::Uri::absolute(), action(), CacheManager::ActionProtection(), Assure, 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()

char * CacheManager::PasswdGet ( Mgr::ActionPasswordList a,
const char *  action 
)
protectedinherited

◆ PutCommonResponseHeaders()

void CacheManager::PutCommonResponseHeaders ( HttpReply response,
const char *  httpOrigin 
)
staticinherited

Add HTTP response headers specific/common to all cache manager replies, including cache manager errors and Action reports.

Parameters
httpOriginthe value of Origin header in the trigger HTTP request (or nil)

Definition at line 451 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() [1/3]

void CacheManager::registerProfile ( char const *  action,
char const *  desc,
Mgr::ClassActionCreationHandler handler,
int  pw_req_flag,
int  atomic 
)
inherited

◆ registerProfile() [2/3]

void CacheManager::registerProfile ( char const *  action,
char const *  desc,
OBJH handler,
int  pw_req_flag,
int  atomic 
)
inherited

Registers a C-style action, which is implemented as a pointer to a function taking as argument a pointer to a StoreEntry and returning void. Implemented via CacheManagerActionLegacy.

Definition at line 84 of file cache_manager.cc.

References action(), debugs, handler(), and CacheManager::registerProfile().

Referenced by Mgr::RegisterAction(), CacheManager::registerProfile(), and TestCacheManager::testRegister().

◆ registerProfile() [3/3]

void CacheManager::registerProfile ( const Mgr::ActionProfilePointer profile)
protectedinherited

Definition at line 66 of file cache_manager.cc.

References debugs, CacheManager::findAction(), CacheManager::menu_, and Must.

◆ start()

◆ testInvalidUrl()

void CacheManagerInternals::testInvalidUrl ( const AnyP::Uri url,
const char *  problem 
)

checks CacheManager parsing of the given invalid URL

Parameters
problema bad part of the URL or its description

Definition at line 63 of file testCacheManager.cc.

References Debug::Extra(), and CacheManager::ParseUrl().

◆ testValidUrl()

void CacheManagerInternals::testValidUrl ( const AnyP::Uri url)

Definition at line 51 of file testCacheManager.cc.

References CurrentException(), Debug::Extra(), and CacheManager::ParseUrl().

◆ WellKnownUrlPathPrefix()

const SBuf & CacheManager::WellKnownUrlPathPrefix ( )
staticinherited

Member Data Documentation

◆ menu_

Menu CacheManager::menu_
protectedinherited

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors