ExtUser.cc
Go to the documentation of this file.
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 
23 {
24  delete data;
25 }
26 
27 ACLExtUser::ACLExtUser(ACLData<char const *> *newData, char const *newType) : data (newData), type_ (newType) {}
28 
29 char const *
31 {
32  return type_;
33 }
34 
35 const Acl::Options &
37 {
38  return data->lineOptions();
39 }
40 
41 void
43 {
44  data->parse();
45 }
46 
47 int
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 
60 {
61  return data->dump();
62 }
63 
64 bool
66 {
67  return data->empty();
68 }
69 
70 #endif /* USE_AUTH */
71 
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
virtual void parse()=0
virtual SBufList dump() const =0
virtual bool match(M)=0
virtual bool empty() const =0
virtual const Acl::Options & lineOptions()
supported ACL "line" options (e.g., "-i")
Definition: Data.h:26
ACLExtUser(ACLData< char const * > *newData, char const *)
Definition: ExtUser.cc:27
ACLData< char const * > * data
Definition: ExtUser.h:37
virtual SBufList dump() const
Definition: ExtUser.cc:59
char const * type_
Definition: ExtUser.h:38
~ACLExtUser()
Definition: ExtUser.cc:22
virtual const Acl::Options & lineOptions()
Definition: ExtUser.cc:36
virtual void parse()
parses node representation in squid.conf; dies on failures
Definition: ExtUser.cc:42
virtual bool empty() const
Definition: ExtUser.cc:65
virtual char const * typeString() const
Definition: ExtUser.cc:30
virtual int match(ACLChecklist *checklist)
Matches the actual data in checklist against this ACL.
Definition: ExtUser.cc:48
HttpRequest * request
String extacl_user
Definition: HttpRequest.h:178
char const * termedBuf() const
Definition: SquidString.h:92
size_type size() const
Definition: SquidString.h:73
std::vector< const Option * > Options
Definition: Options.h:214
std::list< SBuf > SBufList
Definition: forward.h:22

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors