]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/ExtUser.cc
Source Format Enforcement (#963)
[thirdparty/squid.git] / src / acl / ExtUser.cc
1 /*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 /* DEBUG: section 28 Access Control */
10
11 #include "squid.h"
12
13 #if USE_AUTH
14
15 #include "acl/ExtUser.h"
16 #include "acl/FilledChecklist.h"
17 #include "acl/RegexData.h"
18 #include "acl/UserData.h"
19 #include "client_side.h"
20 #include "http/Stream.h"
21
22 ACLExtUser::~ACLExtUser()
23 {
24 delete data;
25 }
26
27 ACLExtUser::ACLExtUser(ACLData<char const *> *newData, char const *newType) : data (newData), type_ (newType) {}
28
29 char const *
30 ACLExtUser::typeString() const
31 {
32 return type_;
33 }
34
35 const Acl::Options &
36 ACLExtUser::lineOptions()
37 {
38 return data->lineOptions();
39 }
40
41 void
42 ACLExtUser::parse()
43 {
44 data->parse();
45 }
46
47 int
48 ACLExtUser::match(ACLChecklist *cl)
49 {
50 ACLFilledChecklist *checklist = Filled(cl);
51 if (checklist->request->extacl_user.size()) {
52 return data->match(checklist->request->extacl_user.termedBuf());
53 } else {
54 return -1;
55 }
56 }
57
58 SBufList
59 ACLExtUser::dump() const
60 {
61 return data->dump();
62 }
63
64 bool
65 ACLExtUser::empty () const
66 {
67 return data->empty();
68 }
69
70 #endif /* USE_AUTH */
71