]> git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/AclProxyAuth.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / auth / AclProxyAuth.h
1 /*
2 * Copyright (C) 1996-2017 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 #ifndef SQUID_ACLPROXYAUTH_H
10 #define SQUID_ACLPROXYAUTH_H
11
12 #if USE_AUTH
13
14 #include "acl/Acl.h"
15 #include "acl/Checklist.h"
16 #include "acl/Data.h"
17
18 class ProxyAuthLookup : public ACLChecklist::AsyncState
19 {
20
21 public:
22 static ProxyAuthLookup *Instance();
23 virtual void checkForAsync(ACLChecklist *) const;
24
25 private:
26 static ProxyAuthLookup instance_;
27 static void LookupDone(void *data);
28 };
29
30 class ACLProxyAuth : public ACL
31 {
32 MEMPROXY_CLASS(ACLProxyAuth);
33
34 public:
35 ~ACLProxyAuth();
36 ACLProxyAuth(ACLData<char const *> *, char const *);
37 ACLProxyAuth(ACLProxyAuth const &);
38 ACLProxyAuth &operator =(ACLProxyAuth const &);
39
40 virtual char const *typeString() const;
41 virtual void parse();
42 virtual bool isProxyAuth() const {return true;}
43
44 virtual int match(ACLChecklist *checklist);
45 virtual SBufList dump() const;
46 virtual bool valid() const;
47 virtual bool empty() const;
48 virtual bool requiresRequest() const {return true;}
49
50 virtual ACL *clone() const;
51 virtual int matchForCache(ACLChecklist *checklist);
52
53 private:
54 static Prototype UserRegistryProtoype;
55 static ACLProxyAuth UserRegistryEntry_;
56 static Prototype RegexRegistryProtoype;
57 static ACLProxyAuth RegexRegistryEntry_;
58 int matchProxyAuth(ACLChecklist *);
59 ACLData<char const *> *data;
60 char const *type_;
61 };
62
63 #endif /* USE_AUTH */
64 #endif /* SQUID_ACLPROXYAUTH_H */
65