Making it a bit clearer what this member actually is.
static AuthUserRequest::Pointer CreateAuthUser(const char *proxy_auth);
static AuthConfig *Find(const char *proxy_auth);
- AuthConfig() : authenticateChildren(20), authenticate(NULL) {}
+ AuthConfig() : authenticateChildren(20), authenticateProgram(NULL) {}
virtual ~AuthConfig() {}
public:
HelperChildConfig authenticateChildren;
- wordlist *authenticate;
+ wordlist *authenticateProgram; ///< Helper program to run, includes all parameters
};
namespace Auth
return 0;
return module_direction();
-
- return -2;
}
void
bool
AuthBasicConfig::configured() const
{
- if ((authenticate != NULL) && (authenticateChildren.n_max != 0) &&
+ if ((authenticateProgram != NULL) && (authenticateChildren.n_max != 0) &&
(basicAuthRealm != NULL)) {
debugs(29, 9, HERE << "returning configured");
return true;
void
AuthBasicConfig::fixHeader(AuthUserRequest::Pointer auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
{
- if (authenticate) {
+ if (authenticateProgram) {
debugs(29, 9, HERE << "Sending type:" << hdrType << " header: 'Basic realm=\"" << basicAuthRealm << "\"'");
httpHeaderPutStrf(&rep->header, hdrType, "Basic realm=\"%s\"", basicAuthRealm);
}
delete basicauthenticators;
basicauthenticators = NULL;
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
if (basicAuthRealm)
safe_free(basicAuthRealm);
void
AuthBasicConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme)
{
- wordlist *list = authenticate;
+ wordlist *list = authenticateProgram;
storeAppendPrintf(entry, "%s %s", name, "basic");
while (list != NULL) {
AuthBasicConfig::parse(AuthConfig * scheme, int n_configured, char *param_str)
{
if (strcasecmp(param_str, "program") == 0) {
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
- parse_wordlist(&authenticate);
+ parse_wordlist(&authenticateProgram);
- requirePathnameExists("auth_param basic program", authenticate->key);
+ requirePathnameExists("auth_param basic program", authenticateProgram->key);
} else if (strcasecmp(param_str, "children") == 0) {
authenticateChildren.parseConfig();
} else if (strcasecmp(param_str, "realm") == 0) {
void
AuthBasicConfig::init(AuthConfig * schemeCfg)
{
- if (authenticate) {
+ if (authenticateProgram) {
authbasic_initialised = 1;
if (basicauthenticators == NULL)
basicauthenticators = new helper("basicauthenticator");
- basicauthenticators->cmdline = authenticate;
+ basicauthenticators->cmdline = authenticateProgram;
basicauthenticators->childs = authenticateChildren;
assert(basic_auth != NULL);
debugs(29, 9, HERE << "'" << basic_auth->username() << ":" << basic_auth->passwd << "'");
- if (static_cast<AuthBasicConfig*>(AuthConfig::Find("basic"))->authenticate == NULL) {
+ if (static_cast<AuthBasicConfig*>(AuthConfig::Find("basic"))->authenticateProgram == NULL) {
debugs(29, DBG_CRITICAL, "ERROR: No Basic authentication program configured.");
handler(data, NULL);
return;
void
AuthDigestConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme)
{
- wordlist *list = authenticate;
+ wordlist *list = authenticateProgram;
debugs(29, 9, "authDigestCfgDump: Dumping configuration");
storeAppendPrintf(entry, "%s %s", name, "digest");
bool
AuthDigestConfig::configured() const
{
- if ((authenticate != NULL) &&
+ if ((authenticateProgram != NULL) &&
(authenticateChildren.n_max != 0) &&
(digestAuthRealm != NULL) && (noncemaxduration > -1))
return true;
void
AuthDigestConfig::fixHeader(AuthUserRequest::Pointer auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
{
- if (!authenticate)
+ if (!authenticateProgram)
return;
int stale = 0;
void
AuthDigestConfig::init(AuthConfig * scheme)
{
- if (authenticate) {
+ if (authenticateProgram) {
DigestFieldsInfo = httpHeaderBuildFieldsInfo(DigestAttrs, DIGEST_ENUM_END);
authenticateDigestNonceSetup();
authdigest_initialised = 1;
if (digestauthenticators == NULL)
digestauthenticators = new helper("digestauthenticator");
- digestauthenticators->cmdline = authenticate;
+ digestauthenticators->cmdline = authenticateProgram;
digestauthenticators->childs = authenticateChildren;
void
AuthDigestConfig::done()
{
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
safe_free(digestAuthRealm);
}
AuthDigestConfig::parse(AuthConfig * scheme, int n_configured, char *param_str)
{
if (strcasecmp(param_str, "program") == 0) {
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
- parse_wordlist(&authenticate);
+ parse_wordlist(&authenticateProgram);
- requirePathnameExists("auth_param digest program", authenticate->key);
+ requirePathnameExists("auth_param digest program", authenticateProgram->key);
} else if (strcasecmp(param_str, "children") == 0) {
authenticateChildren.parseConfig();
} else if (strcasecmp(param_str, "realm") == 0) {
return;
#endif
- if ((static_cast<AuthDigestConfig*>(AuthConfig::Find("digest"))->authenticate) && authDigestNonceLastRequest(nonce)) {
+ if ((static_cast<AuthDigestConfig*>(AuthConfig::Find("digest"))->authenticateProgram) && authDigestNonceLastRequest(nonce)) {
flags.authinfo_sent = 1;
debugs(29, 9, "authDigestAddHead: Sending type:" << type << " header: 'nextnonce=\"" << authenticateDigestNonceNonceb64(nonce) << "\"");
httpHeaderPutStrf(&rep->header, type, "nextnonce=\"%s\"", authenticateDigestNonceNonceb64(nonce));
assert(user() != NULL && user()->auth_type == AUTH_DIGEST);
debugs(29, 9, "authenticateStart: '\"" << user()->username() << "\":\"" << realm << "\"'");
- if (static_cast<AuthDigestConfig*>(AuthConfig::Find("digest"))->authenticate == NULL) {
+ if (static_cast<AuthDigestConfig*>(AuthConfig::Find("digest"))->authenticateProgram == NULL) {
debugs(29, DBG_CRITICAL, "ERROR: No Digest authentication program configured.");
handler(data, NULL);
return;
delete negotiateauthenticators;
negotiateauthenticators = NULL;
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
debugs(29, 2, "negotiateScheme::done: Negotiate authentication Shutdown.");
}
void
AuthNegotiateConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme)
{
- wordlist *list = authenticate;
+ wordlist *list = authenticateProgram;
storeAppendPrintf(entry, "%s %s", name, "negotiate");
while (list != NULL) {
AuthNegotiateConfig::parse(AuthConfig * scheme, int n_configured, char *param_str)
{
if (strcasecmp(param_str, "program") == 0) {
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
- parse_wordlist(&authenticate);
+ parse_wordlist(&authenticateProgram);
- requirePathnameExists("auth_param negotiate program", authenticate->key);
+ requirePathnameExists("auth_param negotiate program", authenticateProgram->key);
} else if (strcasecmp(param_str, "children") == 0) {
authenticateChildren.parseConfig();
} else if (strcasecmp(param_str, "keep_alive") == 0) {
void
AuthNegotiateConfig::init(AuthConfig * scheme)
{
- if (authenticate) {
+ if (authenticateProgram) {
authnegotiate_initialised = 1;
assert(proxy_auth_cache);
- negotiateauthenticators->cmdline = authenticate;
+ negotiateauthenticators->cmdline = authenticateProgram;
negotiateauthenticators->childs = authenticateChildren;
bool
AuthNegotiateConfig::configured() const
{
- if ((authenticate != NULL) && (authenticateChildren.n_max != 0)) {
+ if (authenticateProgram && (authenticateChildren.n_max != 0)) {
debugs(29, 9, "AuthNegotiateConfig::configured: returning configured");
return true;
}
{
AuthNegotiateUserRequest *negotiate_request;
- if (!authenticate)
+ if (!authenticateProgram)
return;
/* Need keep-alive */
debugs(29, 8, HERE << "auth state is '" << user()->credentials() << "'");
- if (static_cast<AuthNegotiateConfig*>(AuthConfig::Find("negotiate"))->authenticate == NULL) {
+ if (static_cast<AuthNegotiateConfig*>(AuthConfig::Find("negotiate"))->authenticateProgram == NULL) {
debugs(29, DBG_CRITICAL, "ERROR: No Negotiate authentication program configured.");
handler(data, NULL);
return;
delete ntlmauthenticators;
ntlmauthenticators = NULL;
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
debugs(29, 2, "ntlmScheme::done: NTLM authentication Shutdown.");
}
void
AuthNTLMConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme)
{
- wordlist *list = authenticate;
+ wordlist *list = authenticateProgram;
storeAppendPrintf(entry, "%s %s", name, "ntlm");
while (list != NULL) {
AuthNTLMConfig::parse(AuthConfig * scheme, int n_configured, char *param_str)
{
if (strcasecmp(param_str, "program") == 0) {
- if (authenticate)
- wordlistDestroy(&authenticate);
+ if (authenticateProgram)
+ wordlistDestroy(&authenticateProgram);
- parse_wordlist(&authenticate);
+ parse_wordlist(&authenticateProgram);
- requirePathnameExists("auth_param ntlm program", authenticate->key);
+ requirePathnameExists("auth_param ntlm program", authenticateProgram->key);
} else if (strcasecmp(param_str, "children") == 0) {
authenticateChildren.parseConfig();
} else if (strcasecmp(param_str, "keep_alive") == 0) {
void
AuthNTLMConfig::init(AuthConfig * scheme)
{
- if (authenticate) {
+ if (authenticateProgram) {
authntlm_initialised = 1;
assert(proxy_auth_cache);
- ntlmauthenticators->cmdline = authenticate;
+ ntlmauthenticators->cmdline = authenticateProgram;
ntlmauthenticators->childs = authenticateChildren;
bool
AuthNTLMConfig::configured() const
{
- if ((authenticate != NULL) && (authenticateChildren.n_max != 0)) {
+ if ((authenticateProgram != NULL) && (authenticateChildren.n_max != 0)) {
debugs(29, 9, "AuthNTLMConfig::configured: returning configured");
return true;
}
void
AuthNTLMConfig::fixHeader(AuthUserRequest::Pointer auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request)
{
- if (!authenticate)
+ if (!authenticateProgram)
return;
/* Need keep-alive */
debugs(29, 8, HERE << "credentials state is '" << user()->credentials() << "'");
- if (static_cast<AuthNTLMConfig*>(AuthConfig::Find("ntlm"))->authenticate == NULL) {
+ if (static_cast<AuthNTLMConfig*>(AuthConfig::Find("ntlm"))->authenticateProgram == NULL) {
debugs(29, DBG_CRITICAL, "ERROR: NTLM Start: no NTLM program configured.");
handler(data, NULL);
return;