extractUsername();
extractPassword();
}
- currentRequest = NULL;
+ currentRequest = NULL; // AYJ: why ?? we have only just filled it with data!
+ // so that we dont have circular UserRequest->User->UseRequest loops persisting outside the auth decode sequence????
+
+ // okay we dont need the original buffer string any more.
httpAuthHeader = NULL;
}
return auth_user_request;
}
- /* now lookup and see if we have a matching auth_user structure in
- * memory. */
-
- AuthUser *auth_user;
+ /* now lookup and see if we have a matching auth_user structure in memory. */
+ AuthUser *auth_user = NULL;
if ((auth_user = authBasicAuthUserFindUsername(local_basic.username())) == NULL) {
+ /* TODO: optimize. make "local_basic" the object we will store. dont allocate, duplicate, discard. */
auth_user = local_basic.makeCachedFrom();
basic_auth = dynamic_cast<BasicUser *>(auth_user);
assert (basic_auth);
} else {
basic_auth = dynamic_cast<BasicUser *>(auth_user);
- assert (basic_auth);
- basic_auth->updateCached (&local_basic);
+ assert(basic_auth);
+ basic_auth->updateCached(&local_basic);
}
/* link the request to the in-cache user */
auth_user_request->user(basic_auth);
-
basic_auth->addRequest(auth_user_request);
-
return auth_user_request;
}
dlink_list queue;
+ /**
+ * Configuration flag. May only be altered by the configuration parser.
+ *
+ * Indicates that all uses of this external_acl_type helper require authentication
+ * details to be processed. If none are available its a fail match.
+ */
bool require_auth;
enum {
if (acl->def->require_auth) {
int ti;
/* Make sure the user is authenticated */
+ debugs(82, 3, "aclMatchExternal: " << acl->def->name << " check user authenticated.");
if ((ti = AuthenticateAcl(ch)) != 1) {
debugs(82, 2, "aclMatchExternal: " << acl->def->name << " user not authenticated (" << ti << ")");
return ti;
}
+ debugs(82, 3, "aclMatchExternal: " << acl->def->name << " user is authenticated.");
}
key = makeExternalAclKey(ch, acl);
- acl->def->require_auth = NULL;
-
if (!key) {
/* Not sufficient data to process */
return -1;
if (acl->def->require_auth) {
int ti;
/* Make sure the user is authenticated */
+ debugs(82, 3, "aclMatchExternal: " << acl->def->name << " check user authenticated.");
if ((ti = AuthenticateAcl(ch)) != 1) {
debugs(82, 1, "externalAclLookup: " << acl->def->name <<
callback(callback_data, NULL);
return;
}
+ debugs(82, 3, "aclMatchExternal: " << acl->def->name << " user is authenticated.");
}
const char *key = makeExternalAclKey(ch, acl);