35 assert(proxy_auth !=
nullptr);
36 debugs(29, 9,
"header = '" << proxy_auth <<
"'");
40 if (config ==
nullptr || !config->
active()) {
42 "Unsupported or unconfigured/inactive proxy-auth scheme, '" << proxy_auth <<
"'");
62 if (strncasecmp(proxy_auth, scheme->type(), strlen(scheme->type())) == 0)
72 if (
auto *cfg = Find(proxy_auth))
74 fatalf(
"auth_schemes: required authentication method '%s' is not configured", proxy_auth);
86 if (strcmp(param_str,
"program") == 0) {
87 if (authenticateProgram)
94 }
else if (strcmp(param_str,
"realm") == 0) {
99 while (token && *token &&
xisspace(*token))
102 if (!token || !*token) {
110 }
else if (strcmp(param_str,
"children") == 0) {
111 authenticateChildren.parseConfig();
113 }
else if (strcmp(param_str,
"key_extras") == 0) {
116 if (!nlf->
parse(keyExtrasLine.termedBuf())) {
126 if (
char *t = strtok(
nullptr,
w_space)) {
127 debugs(29,
DBG_CRITICAL,
"FATAL: Unexpected argument '" << t <<
"' after request_format specification");
130 }
else if (strcmp(param_str,
"keep_alive") == 0) {
132 }
else if (strcmp(param_str,
"utf8") == 0) {
135 debugs(29,
DBG_CRITICAL,
"ERROR: Unrecognised " << scheme->
type() <<
" auth scheme parameter '" << param_str <<
"'");
142 if (!authenticateProgram)
145 const char *schemeType = scheme->
type();
147 wordlist *list = authenticateProgram;
149 while (list !=
nullptr) {
157 storeAppendPrintf(entry,
"%s %s children %d startup=%d idle=%d concurrency=%d\n",
159 authenticateChildren.n_max, authenticateChildren.n_startup,
160 authenticateChildren.n_idle, authenticateChildren.concurrency);
162 if (keyExtrasLine.size() > 0)
163 storeAppendPrintf(entry,
"%s %s key_extras \"%s\"\n", name, schemeType, keyExtrasLine.termedBuf());
179 keyExtrasLine.clean();
185 return (authenticateProgram && authenticateChildren.n_max != 0);
202 if (lang[0] ==
'*' && lang[1] ==
'\0')
205 if ((strncmp(lang,
"ru", 2) == 0
206 || strncmp(lang,
"uk", 2) == 0
207 || strncmp(lang,
"be", 2) == 0
208 || strncmp(lang,
"bg", 2) == 0
209 || strncmp(lang,
"sr", 2) == 0)) {
210 if (lang[2] ==
'-') {
211 if (strcmp(lang + 3,
"latn") == 0)
#define SQUIDSBUFPRINT(s)
void parse_onoff(int *var)
void parse_wordlist(wordlist **list)
void requirePathnameExists(const char *name, const char *path)
Auth::ConfigVector schemes
set of auth_params directives
bool isCP1251EncodingAllowed(const HttpRequest *request)
virtual bool active() const =0
virtual void registerWithCacheManager(void)
virtual UserRequest::Pointer decode(char const *proxy_auth, const HttpRequest *request, const char *requestRealm)=0
virtual void parse(SchemeConfig *, size_t, char *)
virtual bool dump(StoreEntry *, const char *, SchemeConfig *) const
static SchemeConfig * GetParsed(const char *proxy_auth)
Format::Format * keyExtras
The compiled request format.
virtual const char * type() const =0
static SchemeConfig * Find(const char *proxy_auth)
static UserRequest::Pointer CreateAuthUser(const char *proxy_auth, AccessLogEntry::Pointer &al)
virtual bool configured() const
static char * NextQuotedToken()
static char * NextQuotedOrToEol()
char * content()
start of the added data
#define DBG_PARSE_NOTE(x)
#define debugs(SECTION, LEVEL, CONTENT)
bool strHdrAcptLangGetItem(const String &hdr, char *lang, int langLen, size_t &pos)
void fatalf(const char *fmt,...)
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
void wordlistDestroy(wordlist **list)
destroy a wordlist