SchemeConfig.h
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 #ifndef SQUID_SRC_AUTH_SCHEMECONFIG_H
10 #define SQUID_SRC_AUTH_SCHEMECONFIG_H
11 
12 #if USE_AUTH
13 
14 #include "AccessLogEntry.h"
15 #include "auth/forward.h"
16 #include "auth/UserRequest.h"
17 #include "helper/ChildConfig.h"
18 
19 class StoreEntry;
20 class HttpReply;
21 class HttpRequest;
22 class wordlist;
23 
24 /* for Http::HdrType parameters-by-value */
25 #include "HttpHeader.h"
26 
27 namespace Format
28 {
29 class Format;
30 }
31 
32 namespace Auth
33 {
34 
47 {
48 
49 public:
50  static UserRequest::Pointer CreateAuthUser(const char *proxy_auth, AccessLogEntry::Pointer &al);
51 
52  static SchemeConfig *Find(const char *proxy_auth);
55  static SchemeConfig *GetParsed(const char *proxy_auth);
57 
58  virtual ~SchemeConfig() {}
59 
66  virtual bool active() const = 0;
67 
78  virtual UserRequest::Pointer decode(char const *proxy_auth, const HttpRequest *request, const char *requestRealm) = 0;
79 
87  virtual void done();
88 
97  virtual bool configured() const = 0;
98 
103  virtual void rotateHelpers(void) = 0;
104 
110  virtual bool dump(StoreEntry *, const char *, SchemeConfig *) const;
111 
114 
116  virtual void init(SchemeConfig *) = 0;
117 
119  virtual void registerWithCacheManager(void);
120 
122  virtual void parse(SchemeConfig *, int, char *);
123 
125  virtual const char * type() const = 0;
126 
127 public:
132  int keep_alive = 1;
133  int utf8 = 0;
134 
135 protected:
143  bool isCP1251EncodingAllowed(const HttpRequest *request);
144 
147 };
148 
149 } // namespace Auth
150 
151 #endif /* USE_AUTH */
152 #endif /* SQUID_SRC_AUTH_SCHEMECONFIG_H */
153 
virtual bool active() const =0
HTTP Authentication.
Definition: Config.h:18
virtual UserRequest::Pointer decode(char const *proxy_auth, const HttpRequest *request, const char *requestRealm)=0
virtual void fixHeader(UserRequest::Pointer, HttpReply *, Http::HdrType, HttpRequest *)=0
Definition: SBuf.h:93
bool isCP1251EncodingAllowed(const HttpRequest *request)
int utf8
whether to accept UTF-8 characterset instead of ASCII. default: off
Definition: SchemeConfig.h:133
Helper::ChildConfig authenticateChildren
Definition: SchemeConfig.h:128
static SchemeConfig * Find(const char *proxy_auth)
Definition: SchemeConfig.cc:59
SBuf realm
RFC 7235 section 2.2 - Protection Space (Realm)
Definition: SchemeConfig.h:146
virtual ~SchemeConfig()
Definition: SchemeConfig.h:58
virtual void parse(SchemeConfig *, int, char *)
Definition: SchemeConfig.cc:84
virtual bool configured() const =0
virtual const char * type() const =0
wordlist * authenticateProgram
Helper program to run, includes all parameters.
Definition: SchemeConfig.h:129
static SchemeConfig * GetParsed(const char *proxy_auth)
Definition: SchemeConfig.cc:70
Format::Format * keyExtras
The compiled request format.
Definition: SchemeConfig.h:131
int keep_alive
whether to close the connection on auth challenges. default: on
Definition: SchemeConfig.h:132
static UserRequest::Pointer CreateAuthUser(const char *proxy_auth, AccessLogEntry::Pointer &al)
Definition: SchemeConfig.cc:33
virtual void done()
virtual void init(SchemeConfig *)=0
virtual bool dump(StoreEntry *, const char *, SchemeConfig *) const
virtual void registerWithCacheManager(void)
Definition: SchemeConfig.cc:80
virtual void rotateHelpers(void)=0
String keyExtrasLine
The format of the request to the auth helper.
Definition: SchemeConfig.h:130

 

Introduction

Documentation

Support

Miscellaneous