/*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#include "auth/User.h"
#include "auth/UserRequest.h"
#include "client_side.h"
+#include "http/Stream.h"
#include "HttpRequest.h"
ACLProxyAuth::~ACLProxyAuth()
delete data;
}
-ACLProxyAuth::ACLProxyAuth(ACLData<char const *> *newData, char const *theType) : data(newData), type_(theType) {}
+ACLProxyAuth::ACLProxyAuth(ACLData<char const *> *newData, char const *theType) :
+ data(newData),
+ type_(theType)
+{}
-ACLProxyAuth::ACLProxyAuth(ACLProxyAuth const &old) : data(old.data->clone()), type_(old.type_)
+ACLProxyAuth::ACLProxyAuth(ACLProxyAuth const &old) :
+ data(old.data->clone()),
+ type_(old.type_)
{}
ACLProxyAuth &
return type_;
}
+void
+ACLProxyAuth::parseFlags()
+{
+ ParseFlags(Acl::NoOptions(), data->supportedFlags());
+}
+
void
ACLProxyAuth::parse()
{
int
ACLProxyAuth::match(ACLChecklist *checklist)
{
- allow_t answer = AuthenticateAcl(checklist);
+ auto answer = AuthenticateAcl(checklist);
// convert to tri-state ACL match 1,0,-1
switch (answer) {
ACLProxyAuth::matchProxyAuth(ACLChecklist *cl)
{
ACLFilledChecklist *checklist = Filled(cl);
- if (checklist->request->flags.sslBumped)
- return 1; // AuthenticateAcl() already handled this bumped request
- if (!authenticateUserAuthenticated(Filled(checklist)->auth_user_request)) {
- return 0;
+ if (!checklist->request->flags.sslBumped) {
+ if (!authenticateUserAuthenticated(checklist->auth_user_request)) {
+ return 0;
+ }
}
/* check to see if we have matched the user-acl before */
int result = cacheMatchAcl(&checklist->auth_user_request->user()->proxy_match_cache, checklist);
checklist->auth_user_request = NULL;
return result;
}
+