#include <AccessCheck.h>
Public Types | |
typedef void | AccessCheckCallback(ServiceGroupPointer group, void *data) |
typedef CbcPointer< AsyncJob > | Pointer |
Public Member Functions | |
void | checkCandidates () |
void | noteAnswer (Acl::Answer answer) |
process the results of the ACL check More... | |
bool | canBeCalled (AsyncCall &call) const |
whether we can be called More... | |
void | callStart (AsyncCall &call) |
virtual void | callEnd () |
called right after the called job method More... | |
virtual void | callException (const std::exception &e) |
called when the job throws during an async call More... | |
void | handleStopRequest () |
process external request to terminate now (i.e. during this async call) More... | |
virtual void * | toCbdata ()=0 |
Static Public Member Functions | |
static bool | Start (Method method, VectPoint vp, HttpRequest *req, HttpReply *, const AccessLogEntryPointer &, Adaptation::Initiator *) |
static void | AccessCheckCallbackWrapper (Acl::Answer, void *) |
static void | Start (const Pointer &job) |
static void | RegisterWithCacheManager () |
Public Attributes | |
const InstanceId< AsyncJob > | id |
job identifier More... | |
Protected Member Functions | |
AccessCheck (const ServiceFilter &aFilter, Adaptation::Initiator *) | |
~AccessCheck () override | |
void | start () override |
called by AsyncStart; do not call directly More... | |
bool | doneAll () const override |
whether positive goal has been reached More... | |
bool | usedDynamicRules () |
not done until mustStop More... | |
void | check () |
Walk the access rules list to find rules with applicable service groups. More... | |
void | deleteThis (const char *aReason) |
void | mustStop (const char *aReason) |
bool | done () const |
the job is destroyed in callEnd() when done() More... | |
virtual void | swanSong () |
virtual const char * | status () const |
internal cleanup; do not call directly More... | |
Static Protected Member Functions | |
static void | ReportAllJobs (StoreEntry *) |
writes a cache manager report about all jobs existing in this worker More... | |
Protected Attributes | |
const char * | stopReason |
reason for forcing done() to be true More... | |
const char * | typeName |
kid (leaf) class name, for debugging More... | |
AsyncCall::Pointer | inCall |
the asynchronous call being handled, if any More... | |
bool | started_ = false |
Start() has finished successfully. More... | |
bool | swanSang_ = false |
swanSong() was called More... | |
Private Types | |
typedef int | Candidate |
typedef std::vector< Candidate > | Candidates |
Private Member Functions | |
CBDATA_CHILD (AccessCheck) | |
Candidate | topCandidate () const |
ServiceGroupPointer | topGroup () const |
void | callBack (const ServiceGroupPointer &g) |
bool | isCandidate (AccessRule &r) |
virtual void | finalizedInCbdataChild ()=0 |
hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More... | |
Private Attributes | |
const ServiceFilter | filter |
CbcPointer< Adaptation::Initiator > | theInitiator |
the job which ordered this access check More... | |
ACLFilledChecklist * | acl_checklist |
Candidates | candidates |
Detailed Description
Definition at line 30 of file AccessCheck.h.
Member Typedef Documentation
◆ AccessCheckCallback
typedef void Adaptation::AccessCheck::AccessCheckCallback(ServiceGroupPointer group, void *data) |
Definition at line 35 of file AccessCheck.h.
◆ Candidate
|
private |
Definition at line 51 of file AccessCheck.h.
◆ Candidates
|
private |
Definition at line 52 of file AccessCheck.h.
◆ Pointer
|
inherited |
Definition at line 34 of file AsyncJob.h.
Constructor & Destructor Documentation
◆ AccessCheck()
|
protected |
Definition at line 46 of file AccessCheck.cc.
References debugs, filter, HttpRequest::icapHistory(), and Adaptation::ServiceFilter::request.
Referenced by Start().
◆ ~AccessCheck()
|
overrideprotected |
Definition at line 61 of file AccessCheck.cc.
Member Function Documentation
◆ AccessCheckCallbackWrapper()
|
static |
Definition at line 151 of file AccessCheck.cc.
References asyncCall(), debugs, noteAnswer(), and ScheduleCallHere.
◆ callBack()
|
private |
call back with a possibly nil group; the job ends here because all failures at this point are fatal to the access check process
Definition at line 194 of file AccessCheck.cc.
References CallJobHere1, and debugs.
◆ callEnd()
|
virtualinherited |
called right after the called job method
Reimplemented in Adaptation::Icap::Xaction.
Definition at line 152 of file AsyncJob.cc.
References assert, AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::done(), AsyncJob::inCall, AsyncJob::started_, AsyncJob::status(), AsyncJob::swanSang_, AsyncJob::swanSong(), and AsyncJob::typeName.
Referenced by Adaptation::Icap::Xaction::callEnd(), and AsyncJob::deleteThis().
◆ callException()
|
virtualinherited |
Reimplemented in ConnStateData, ClientHttpRequest, Adaptation::Icap::ModXact, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Ipc::Forwarder, Ipc::Inquirer, and Ftp::Server.
Definition at line 143 of file AsyncJob.cc.
References cbdataReferenceValid(), debugs, Must, AsyncJob::mustStop(), and CbdataParent::toCbdata().
Referenced by ConnStateData::callException(), Adaptation::Icap::Xaction::callException(), Ipc::Forwarder::callException(), Ipc::Inquirer::callException(), and Ftp::Server::callException().
◆ callStart()
|
inherited |
called just before the called method
Definition at line 130 of file AsyncJob.cc.
References cbdataReferenceValid(), AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::inCall, Must, AsyncJob::status(), CbdataParent::toCbdata(), and AsyncJob::typeName.
◆ canBeCalled()
|
inherited |
Definition at line 117 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, and AsyncJob::inCall.
◆ CBDATA_CHILD()
|
private |
◆ check()
|
protected |
Definition at line 103 of file AccessCheck.cc.
References Adaptation::AllRules(), debugs, and Adaptation::AccessRule::id.
◆ checkCandidates()
void Adaptation::AccessCheck::checkCandidates | ( | ) |
Definition at line 125 of file AccessCheck.cc.
References dash_str, debugs, Adaptation::FindRule(), HTTPMSGLOCK(), and Must.
◆ deleteThis()
|
protectedinherited |
Definition at line 65 of file AsyncJob.cc.
References asyncCall(), AsyncJob::callEnd(), debugs, AsyncJob::deleteThis(), AsyncJob::inCall, JobMemFun(), Must, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by ConnStateData::connStateClosed(), and AsyncJob::deleteThis().
◆ done()
|
protectedinherited |
Definition at line 106 of file AsyncJob.cc.
References AsyncJob::doneAll(), and AsyncJob::stopReason.
Referenced by AsyncJob::callEnd(), HappyConnOpener::checkForNewConnection(), Downloader::downloadFinished(), and HappyConnOpener::maybeOpenPrimeConnection().
◆ doneAll()
|
inlineoverrideprotectedvirtual |
Reimplemented from AsyncJob.
Definition at line 68 of file AccessCheck.h.
◆ finalizedInCbdataChild()
|
privatepure virtualinherited |
◆ handleStopRequest()
|
inlineinherited |
Definition at line 73 of file AsyncJob.h.
References AsyncJob::mustStop().
◆ isCandidate()
|
private |
Returns true iff the rule's service group will be used after ACL matches. Used to detect rules worth ACl-checking.
Definition at line 223 of file AccessCheck.cc.
References debugs, Adaptation::FindGroup(), Adaptation::AccessRule::groupId, Adaptation::AccessRule::id, and Adaptation::ServiceGroup::wants().
◆ mustStop()
|
protectedinherited |
Definition at line 85 of file AsyncJob.cc.
References debugs, AsyncJob::inCall, Must, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by HttpStateData::abortAll(), AsyncJob::callException(), HttpStateData::continueAfterParsingHeader(), HttpStateData::drop1xx(), HttpStateData::handleMoreRequestBodyAvailable(), AsyncJob::handleStopRequest(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), HttpStateData::proceedAfter1xx(), ConnStateData::proxyProtocolError(), HttpStateData::readReply(), HttpStateData::start(), and HttpStateData::wroteLast().
◆ noteAnswer()
void Adaptation::AccessCheck::noteAnswer | ( | Acl::Answer | answer | ) |
Definition at line 172 of file AccessCheck.cc.
References Acl::Answer::allowed(), debugs, and Must.
Referenced by AccessCheckCallbackWrapper().
◆ RegisterWithCacheManager()
|
staticinherited |
Definition at line 215 of file AsyncJob.cc.
References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().
Referenced by mainInitialize().
◆ ReportAllJobs()
|
staticprotectedinherited |
Definition at line 198 of file AsyncJob.cc.
References AllJobs().
Referenced by AsyncJob::RegisterWithCacheManager().
◆ start()
|
overrideprotectedvirtual |
Reimplemented from AsyncJob.
Definition at line 71 of file AccessCheck.cc.
References AsyncJob::start().
◆ Start() [1/2]
|
staticinherited |
Promises to start the configured job (eventually). The job is deemed to be running asynchronously beyond this point, so the caller should only access the job object via AsyncCalls rather than directly.
swanSong() is only called for jobs for which this method has returned successfully (i.e. without throwing).
Definition at line 37 of file AsyncJob.cc.
References CallJobHere, AsyncJob::start(), and AsyncJob::started_.
Referenced by Ftp::Server::AcceptCtrlConnection(), clientListenerConnectionOpened(), Ipc::Coordinator::handleCacheMgrRequest(), Ipc::Coordinator::handleSnmpRequest(), httpAccept(), httpsAccept(), httpStart(), idnsInitVC(), Ftp::Gateway::listenForDataChannel(), Ftp::Server::listenForDataConnection(), Log::TcpLogger::Open(), peerProbeConnect(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), Ipc::SendMessage(), Mgr::Inquirer::sendResponse(), snmpConstructReponse(), SquidMain(), CacheManager::start(), Start(), Rock::Rebuild::Start(), JobWaitBase::start_(), BodyPipe::startAutoConsumptionIfNeeded(), Ftp::StartGateway(), Ftp::StartRelay(), PeerPoolMgrsRr::syncConfig(), and Rock::SwapDir::updateHeaders().
◆ Start() [2/2]
|
static |
Definition at line 30 of file AccessCheck.cc.
References AccessCheck(), debugs, Adaptation::Config::Enabled, and AsyncJob::Start().
Referenced by Client::adaptOrFinalizeReply(), and ClientHttpRequest::doCallouts().
◆ status()
|
protectedvirtualinherited |
for debugging, starts with space
Reimplemented in Adaptation::Ecap::XactionRep, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Adaptation::Initiate, Http::Tunneler, Comm::TcpAcceptor, HappyConnOpener, Ipc::Inquirer, and Security::PeerConnector.
Definition at line 182 of file AsyncJob.cc.
References MemBuf::append(), Packable::appendf(), MemBuf::content(), MemBuf::reset(), AsyncJob::stopReason, and MemBuf::terminate().
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), Adaptation::Initiate::status(), and Comm::TcpAcceptor::status().
◆ swanSong()
|
inlineprotectedvirtualinherited |
Reimplemented in Adaptation::Ecap::XactionRep, Adaptation::Icap::Launcher, Adaptation::Icap::ModXact, Adaptation::Icap::ModXactLauncher, Adaptation::Icap::OptXact, Adaptation::Icap::Xaction, Adaptation::Initiate, Adaptation::Iterator, ConnStateData, Client, Ftp::Relay, Http::Tunneler, Comm::ConnOpener, Comm::TcpAcceptor, Downloader, Rock::HeaderUpdater, Rock::Rebuild, HappyConnOpener, Ipc::Forwarder, Ipc::Inquirer, Ipc::UdsSender, Log::TcpLogger, Mgr::Filler, Mgr::Forwarder, Mgr::StoreToCommWriter, PeerPoolMgr, Security::PeerConnector, Server, and Snmp::Forwarder.
Definition at line 61 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), Client::swanSong(), Http::Tunneler::swanSong(), Comm::ConnOpener::swanSong(), Comm::TcpAcceptor::swanSong(), Rock::HeaderUpdater::swanSong(), HappyConnOpener::swanSong(), Ipc::UdsSender::swanSong(), Log::TcpLogger::swanSong(), PeerPoolMgr::swanSong(), Security::PeerConnector::swanSong(), and Server::swanSong().
◆ toCbdata()
|
pure virtualinherited |
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
◆ topCandidate()
|
inlineprivate |
Definition at line 54 of file AccessCheck.h.
References candidates.
◆ topGroup()
|
private |
Definition at line 203 of file AccessCheck.cc.
References debugs, Adaptation::FindGroup(), and Adaptation::FindRule().
◆ usedDynamicRules()
|
protected |
returns true if previous services configured dynamic chaining "rules"
Definition at line 81 of file AccessCheck.cc.
References debugs, Adaptation::History::extractCurrentServices(), and Must.
Member Data Documentation
◆ acl_checklist
|
private |
Definition at line 49 of file AccessCheck.h.
◆ candidates
|
private |
Definition at line 53 of file AccessCheck.h.
Referenced by topCandidate().
◆ filter
|
private |
Definition at line 47 of file AccessCheck.h.
Referenced by AccessCheck().
◆ id
|
inherited |
Definition at line 75 of file AsyncJob.h.
◆ inCall
|
protectedinherited |
Definition at line 86 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::canBeCalled(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
◆ started_
|
protectedinherited |
Definition at line 88 of file AsyncJob.h.
Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().
◆ stopReason
|
protectedinherited |
Definition at line 84 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and HappyConnOpener::status().
◆ swanSang_
|
protectedinherited |
Definition at line 89 of file AsyncJob.h.
Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().
◆ theInitiator
|
private |
Definition at line 48 of file AccessCheck.h.
◆ typeName
|
protectedinherited |
Definition at line 85 of file AsyncJob.h.
Referenced by AsyncJob::AsyncJob(), Adaptation::Icap::Xaction::Xaction(), AsyncJob::~AsyncJob(), AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
The documentation for this class was generated from the following files:
- src/adaptation/AccessCheck.h
- src/adaptation/AccessCheck.cc