#include <AccessCheck.h>

Inheritance diagram for Adaptation::AccessCheck:
Collaboration diagram for Adaptation::AccessCheck:

Public Types

typedef void AccessCheckCallback(ServiceGroupPointer group, void *data)
 
typedef CbcPointer< AsyncJobPointer
 

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< AsyncJobid
 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< CandidateCandidates
 

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::InitiatortheInitiator
 the job which ordered this access check More...
 
ACLFilledChecklistacl_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

Definition at line 51 of file AccessCheck.h.

◆ Candidates

Definition at line 52 of file AccessCheck.h.

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ AccessCheck()

Adaptation::AccessCheck::AccessCheck ( const ServiceFilter aFilter,
Adaptation::Initiator initiator 
)
protected

Definition at line 46 of file AccessCheck.cc.

References debugs, filter, HttpRequest::icapHistory(), and Adaptation::ServiceFilter::request.

Referenced by Start().

◆ ~AccessCheck()

Adaptation::AccessCheck::~AccessCheck ( )
overrideprotected

Definition at line 61 of file AccessCheck.cc.

Member Function Documentation

◆ AccessCheckCallbackWrapper()

void Adaptation::AccessCheck::AccessCheckCallbackWrapper ( Acl::Answer  answer,
void *  data 
)
static

Definition at line 151 of file AccessCheck.cc.

References asyncCall(), debugs, noteAnswer(), and ScheduleCallHere.

◆ callBack()

void Adaptation::AccessCheck::callBack ( const ServiceGroupPointer g)
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()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 117 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, and AsyncJob::inCall.

◆ CBDATA_CHILD()

Adaptation::AccessCheck::CBDATA_CHILD ( AccessCheck  )
private

◆ check()

void Adaptation::AccessCheck::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()

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited

◆ done()

bool AsyncJob::done ( ) const
protectedinherited

◆ doneAll()

bool Adaptation::AccessCheck::doneAll ( ) const
inlineoverrideprotectedvirtual

Reimplemented from AsyncJob.

Definition at line 68 of file AccessCheck.h.

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )
inlineinherited

Definition at line 73 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ isCandidate()

bool Adaptation::AccessCheck::isCandidate ( AccessRule r)
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()

◆ 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()

void AsyncJob::RegisterWithCacheManager ( )
staticinherited

Definition at line 215 of file AsyncJob.cc.

References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().

Referenced by mainInitialize().

◆ ReportAllJobs()

void AsyncJob::ReportAllJobs ( StoreEntry e)
staticprotectedinherited

Definition at line 198 of file AsyncJob.cc.

References AllJobs().

Referenced by AsyncJob::RegisterWithCacheManager().

◆ start()

void Adaptation::AccessCheck::start ( )
overrideprotectedvirtual

Reimplemented from AsyncJob.

Definition at line 71 of file AccessCheck.cc.

References AsyncJob::start().

◆ Start() [1/2]

◆ Start() [2/2]

bool Adaptation::AccessCheck::Start ( Method  method,
VectPoint  vp,
HttpRequest req,
HttpReply rep,
const AccessLogEntryPointer al,
Adaptation::Initiator initiator 
)
static

◆ status()

◆ swanSong()

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

◆ topCandidate()

Candidate Adaptation::AccessCheck::topCandidate ( ) const
inlineprivate

Definition at line 54 of file AccessCheck.h.

References candidates.

◆ topGroup()

Adaptation::ServiceGroupPointer Adaptation::AccessCheck::topGroup ( ) const
private

Definition at line 203 of file AccessCheck.cc.

References debugs, Adaptation::FindGroup(), and Adaptation::FindRule().

◆ usedDynamicRules()

bool Adaptation::AccessCheck::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

ACLFilledChecklist* Adaptation::AccessCheck::acl_checklist
private

Definition at line 49 of file AccessCheck.h.

◆ candidates

Candidates Adaptation::AccessCheck::candidates
private

Definition at line 53 of file AccessCheck.h.

Referenced by topCandidate().

◆ filter

const ServiceFilter Adaptation::AccessCheck::filter
private

Definition at line 47 of file AccessCheck.h.

Referenced by AccessCheck().

◆ id

const InstanceId<AsyncJob> AsyncJob::id
inherited

Definition at line 75 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall
protectedinherited

◆ started_

bool AsyncJob::started_ = false
protectedinherited

Definition at line 88 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ swanSang_

bool AsyncJob::swanSang_ = false
protectedinherited

Definition at line 89 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().

◆ theInitiator

CbcPointer<Adaptation::Initiator> Adaptation::AccessCheck::theInitiator
private

Definition at line 48 of file AccessCheck.h.

◆ typeName


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors