23#if !defined(HELPER_INPUT_BUFFER)
24#define HELPER_INPUT_BUFFER 8192
28Auth::Basic::UserRequest::authenticated()
const
30 Auth::Basic::User
const *basic_auth =
dynamic_cast<Auth::Basic::User
const *
>(user().getRaw());
32 if (basic_auth && basic_auth->authenticated())
39Auth::Basic::UserRequest::credentialsStr()
41 Auth::Basic::User
const *basic_auth =
dynamic_cast<Auth::Basic::User
const *
>(user().getRaw());
43 return basic_auth->passwd;
55 if (!user() || user()->credentials() !=
Auth::Ok)
60 debugs(29, 4,
"credentials expired - rechecking");
65 debugs(29, 9,
"user '" << user()->username() <<
"' authenticated");
73Auth::Basic::UserRequest::module_direction()
79 switch (user()->credentials()) {
103 Auth::Basic::User *basic_auth =
dynamic_cast<Auth::Basic::User *
>(user().getRaw());
104 assert(basic_auth !=
nullptr);
105 debugs(29, 9,
"'" << basic_auth->username() <<
":" << basic_auth->passwd <<
"'");
121 basic_auth->queue =
node;
136 if (
const char *keyExtras = helperRequestKeyExtras(request, al))
137 sz = snprintf(buf,
sizeof(buf),
"%s %s %s\n", usern, pass, keyExtras);
139 sz = snprintf(buf,
sizeof(buf),
"%s %s\n", usern, pass);
142 debugs(9,
DBG_CRITICAL,
"ERROR: Basic Authentication Failure. Can not build helper validation request.");
144 }
else if (
static_cast<size_t>(sz) >=
sizeof(buf)) {
145 debugs(9,
DBG_CRITICAL,
"ERROR: Basic Authentication Failure. user:password exceeds " <<
sizeof(buf) <<
" bytes.");
153Auth::Basic::UserRequest::HandleReply(
void *data,
const Helper::Reply &reply)
157 debugs(29, 5,
"reply=" << reply);
171 assert(basic_auth !=
nullptr);
189 while (basic_auth->queue) {
191 basic_auth->queue->handler(
cbdata);
194 basic_auth->queue->
next =
nullptr;
195 delete basic_auth->queue;
197 basic_auth->queue = tmpnode;
Helper::ClientPointer basicauthenticators
#define HELPER_INPUT_BUFFER
#define cbdataReferenceDone(var)
#define cbdataReferenceValidDone(var, ptr)
static SchemeConfig * Find(const char *proxy_auth)
UserRequest::Pointer auth_user_request
void setDenyMessage(char const *)
virtual User::Pointer user()
Helper::ResultCode result
The helper response 'result' field.
const MemBuf & other() const
char * content()
start of the added data
std::vector< SBuf > Names
#define debugs(SECTION, LEVEL, CONTENT)
void helperSubmit(const Helper::Client::Pointer &hlp, const char *const buf, HLPCB *const callback, void *const data)
@ CRED_ERROR
ERROR in the auth module. Cannot determine the state of this request.
@ CRED_LOOKUP
Credentials need to be validated with the backend helper.
@ CRED_VALID
Credentials are valid and a up to date. The OK/Failed state is accurate.
#define rfc1738_escape(x)
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
char * xstrncpy(char *dst, const char *src, size_t n)