]> git.ipfire.org Git - thirdparty/squid.git/blame - src/acl/ExtUser.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / acl / ExtUser.cc
CommitLineData
abb929f0 1/*
77b1029d 2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
abb929f0 3 *
bbc27441
AJ
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.
abb929f0 7 */
8
bbc27441
AJ
9/* DEBUG: section 28 Access Control */
10
582c2af2 11#include "squid.h"
2f1431ea
AJ
12
13#if USE_AUTH
14
127dce76
AR
15#include "acl/ExtUser.h"
16#include "acl/FilledChecklist.h"
17#include "acl/RegexData.h"
18#include "acl/UserData.h"
abb929f0 19#include "client_side.h"
d3dddfb5 20#include "http/Stream.h"
abb929f0 21
abb929f0 22ACLExtUser::~ACLExtUser()
23{
00d77d6b 24 delete data;
abb929f0 25}
26
27ACLExtUser::ACLExtUser(ACLData<char const *> *newData, char const *newType) : data (newData), type_ (newType) {}
28
29ACLExtUser::ACLExtUser (ACLExtUser const &old) : data (old.data->clone()), type_ (old.type_)
30{}
31
32ACLExtUser &
33ACLExtUser::operator= (ACLExtUser const &rhs)
34{
35 data = rhs.data->clone();
36 type_ = rhs.type_;
37 return *this;
38}
39
40char const *
41ACLExtUser::typeString() const
42{
43 return type_;
44}
45
4eac3407
CT
46void
47ACLExtUser::parseFlags()
48{
49 ParseFlags(Acl::NoOptions(), data->supportedFlags());
50}
51
abb929f0 52void
53ACLExtUser::parse()
54{
abb929f0 55 data->parse();
56}
57
58int
127dce76 59ACLExtUser::match(ACLChecklist *cl)
abb929f0 60{
af6a12ee 61 ACLFilledChecklist *checklist = Filled(cl);
abb929f0 62 if (checklist->request->extacl_user.size()) {
a7a42b14 63 return data->match(checklist->request->extacl_user.termedBuf());
abb929f0 64 } else {
65 return -1;
66 }
67}
68
8966008b 69SBufList
abb929f0 70ACLExtUser::dump() const
71{
72 return data->dump();
73}
74
75bool
4b0f5de8 76ACLExtUser::empty () const
abb929f0 77{
1bebfd93 78 return data->empty();
abb929f0 79}
80
81ACL *
82ACLExtUser::clone() const
83{
84 return new ACLExtUser(*this);
85}
86
2f1431ea 87#endif /* USE_AUTH */
f53969cc 88