#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 (allow_t 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...
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static bool Start (Method method, VectPoint vp, HttpRequest *req, HttpReply *rep, AccessLogEntry::Pointer &al, Adaptation::Initiator *initiator)
 
static void AccessCheckCallbackWrapper (allow_t, void *)
 
static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...
 

Protected Member Functions

 AccessCheck (const ServiceFilter &aFilter, Adaptation::Initiator *)
 
 ~AccessCheck ()
 
virtual void start ()
 called by AsyncStart; do not call directly More...
 
virtual bool doneAll () const
 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...
 

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...
 
const InstanceId< AsyncJobid
 job identifier More...
 

Private Types

typedef int Candidate
 
typedef std::vector< CandidateCandidates
 

Private Member Functions

 CBDATA_CLASS (AccessCheck)
 
Candidate topCandidate () const
 
ServiceGroupPointer topGroup () const
 
void callBack (const ServiceGroupPointer &g)
 
bool isCandidate (AccessRule &r)
 

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

typedef void Adaptation::AccessCheck::AccessCheckCallback(ServiceGroupPointer group, void *data)

Definition at line 35 of file AccessCheck.h.

Definition at line 51 of file AccessCheck.h.

Definition at line 52 of file AccessCheck.h.

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

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

Definition at line 62 of file AccessCheck.cc.

References NULL.

Member Function Documentation

void Adaptation::AccessCheck::AccessCheckCallbackWrapper ( allow_t  answer,
void *  data 
)
static
Todo:
AYJ 2008-06-12: If answer == ACCESS_AUTH_REQUIRED we should be kicking off an authentication before continuing with this request. see bug 2400 for details.

Definition at line 151 of file AccessCheck.cc.

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

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, debugs, and HERE().

void AsyncJob::callEnd ( )
virtualinherited
void AsyncJob::callStart ( AsyncCall call)
inherited
bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

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

Adaptation::AccessCheck::CBDATA_CLASS ( AccessCheck  )
private
void Adaptation::AccessCheck::check ( )
protected

Definition at line 104 of file AccessCheck.cc.

References Adaptation::AllRules(), debugs, HERE(), i, and Adaptation::AccessRule::id.

void Adaptation::AccessCheck::checkCandidates ( )

Definition at line 126 of file AccessCheck.cc.

References dash_str, debugs, Adaptation::FindRule(), HERE(), HTTPMSGLOCK(), Must, and NULL.

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

Definition at line 90 of file AsyncJob.cc.

References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.

Referenced by AsyncJob::callEnd(), and Downloader::downloadFinished().

virtual bool Adaptation::AccessCheck::doneAll ( ) const
inlineprotectedvirtual

Reimplemented from AsyncJob.

Definition at line 68 of file AccessCheck.h.

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, HERE(), Adaptation::AccessRule::id, and Adaptation::ServiceGroup::wants().

void Adaptation::AccessCheck::noteAnswer ( allow_t  answer)

Definition at line 172 of file AccessCheck.cc.

References allow_t::allowed(), debugs, HERE(), Must, and NULL.

Referenced by AccessCheckCallbackWrapper().

bool Adaptation::AccessCheck::Start ( Method  method,
VectPoint  vp,
HttpRequest req,
HttpReply rep,
AccessLogEntry::Pointer al,
Adaptation::Initiator initiator 
)
static
void Adaptation::AccessCheck::start ( )
protectedvirtual

Reimplemented from AsyncJob.

Definition at line 72 of file AccessCheck.cc.

References AsyncJob::start().

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited
Candidate Adaptation::AccessCheck::topCandidate ( ) const
inlineprivate

Definition at line 54 of file AccessCheck.h.

References candidates.

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

Definition at line 203 of file AccessCheck.cc.

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

bool Adaptation::AccessCheck::usedDynamicRules ( )
protected

returns true if previous services configured dynamic chaining "rules"

Definition at line 82 of file AccessCheck.cc.

References debugs, Adaptation::History::extractFutureServices(), HERE(), and Must.

Member Data Documentation

ACLFilledChecklist* Adaptation::AccessCheck::acl_checklist
private

Definition at line 49 of file AccessCheck.h.

Candidates Adaptation::AccessCheck::candidates
private

Definition at line 53 of file AccessCheck.h.

Referenced by topCandidate().

const ServiceFilter Adaptation::AccessCheck::filter
private

Definition at line 47 of file AccessCheck.h.

Referenced by AccessCheck().

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 70 of file AsyncJob.h.

AsyncCall::Pointer AsyncJob::inCall
protectedinherited
const char* AsyncJob::stopReason
protectedinherited
CbcPointer<Adaptation::Initiator> Adaptation::AccessCheck::theInitiator
private

Definition at line 48 of file AccessCheck.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors