42 debugs(83, 3,
"adaptation off, skipping");
48 AsyncJob(
"AccessCheck"), filter(aFilter),
49 theInitiator(initiator)
74 if (!usedDynamicRules())
87 if (services.empty()) {
88 debugs(85, 5,
"no service-proposed rules for " << filter);
92 debugs(85,3,
"using stored service-proposed rules: " << services);
104 debugs(93, 4,
"start checking");
106 typedef AccessRules::iterator ARI;
109 if (isCandidate(*r)) {
110 debugs(93, 5,
"check: rule '" << r->
id <<
"' is a candidate");
111 candidates.push_back(r->
id);
126 debugs(93, 4,
"has " << candidates.size() <<
" rules");
128 while (!candidates.empty()) {
132 acl_checklist->updateAle(filter.al);
133 acl_checklist->updateReply(filter.reply);
134 acl_checklist->syncAle(filter.request,
nullptr);
139 candidates.erase(candidates.begin());
142 debugs(93, 4,
"NO candidates left");
150 debugs(93, 8,
"callback answer=" << answer);
161 asyncCall(93,7,
"Adaptation::AccessCheck::noteAnswer",
171 Must(!candidates.empty());
172 debugs(93,5, topCandidate() <<
" answer=" << answer);
184 candidates.erase(candidates.begin());
195 noteAdaptationAclCheckDone, g);
203 if (candidates.size()) {
206 debugs(93,5,
"top group for " << r->id <<
" is " << g);
208 debugs(93,5,
"no rule for " << topCandidate());
211 debugs(93,5,
"no candidates");
222 debugs(93,7,
"checking candidacy of " << r.
id <<
", group " <<
232 const bool wants = g->
wants(filter);
#define ScheduleCallHere(call)
RefCount< AsyncCallT< Dialer > > asyncCall(int aDebugSection, int aDebugLevel, const char *aName, const Dialer &aDialer)
#define CallJobHere1(debugSection, debugLevel, job, Class, method, arg1)
static const cbdata_type CBDATA_UNKNOWN
static MakingPointer Make(const acl_access *a, HttpRequest *r)
static void NonBlockingCheck(MakingPointer &&p, ACLCB *cb, void *data)
const ServiceFilter filter
ServiceGroupPointer topGroup() const
void callBack(const ServiceGroupPointer &g)
void noteAnswer(Acl::Answer answer)
process the results of the ACL check
bool usedDynamicRules()
not done until mustStop
void check()
Walk the access rules list to find rules with applicable service groups.
bool isCandidate(AccessRule &r)
void start() override
called by AsyncStart; do not call directly
static bool Start(Method method, VectPoint vp, HttpRequest *req, HttpReply *, const AccessLogEntryPointer &, Adaptation::Initiator *)
AccessCheck(const ServiceFilter &aFilter, Adaptation::Initiator *)
static void AccessCheckCallbackWrapper(Acl::Answer, void *)
a temporary service chain built upon another service request
DynamicGroupCfg extractCurrentServices(const ServiceFilter &)
returns and forgets planned/future services matching the given filter
information used to search for adaptation services
HttpRequest * request
HTTP request being adapted or cause; may be nil.
bool wants(const ServiceFilter &filter) const
static void Start(const Pointer &job)
virtual void start()
called by AsyncStart; do not call directly
Adaptation::Icap::History::Pointer icapHistory() const
Returns possibly nil history, creating it if icap logging is enabled.
#define debugs(SECTION, LEVEL, CONTENT)
ServiceGroupPointer FindGroup(const ServiceGroup::Id &id)
AccessRule * FindRule(const AccessRule::Id &id)