ExtUser.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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
27ACLExtUser::ACLExtUser(ACLData<char const *> *newData, char const *newType) : data (newData), type_ (newType) {}
28
29char const *
31{
32 return type_;
33}
34
35const Acl::Options &
37{
38 return data->lineOptions();
39}
40
41void
43{
44 data->parse();
45}
46
47int
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
64bool
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() override
Definition: ExtUser.cc:22
ACLExtUser(ACLData< char const * > *newData, char const *)
Definition: ExtUser.cc:27
ACLData< char const * > * data
Definition: ExtUser.h:37
int match(ACLChecklist *checklist) override
Matches the actual data in checklist against this ACL.
Definition: ExtUser.cc:48
char const * type_
Definition: ExtUser.h:38
SBufList dump() const override
Definition: ExtUser.cc:59
bool empty() const override
Definition: ExtUser.cc:65
const Acl::Options & lineOptions() override
Definition: ExtUser.cc:36
void parse() override
parses node representation in squid.conf; dies on failures
Definition: ExtUser.cc:42
char const * typeString() const override
Definition: ExtUser.cc:30
HttpRequest::Pointer 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:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors