]> git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/SchemesConfig.h
Added auth_schemes to control schemes presence and order in 401s/407s.
[thirdparty/squid.git] / src / auth / SchemesConfig.h
1 /*
2 * Copyright (C) 1996-2016 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_SCHEMES_CONFIG_H
10 #define SQUID_SCHEMES_CONFIG_H
11
12 #if USE_AUTH
13
14 #include "auth/Config.h"
15
16 namespace Auth
17 {
18
19 /**
20 * \ingroup AuthAPI
21 * Stores authentication schemes list, configured by auth_schemes
22 * directive.
23 */
24 class SchemesConfig
25 {
26 public:
27 SchemesConfig(const char *s, const bool q) : schemes(s), quoted(q), rawSchemes(schemes.c_str()) {}
28 /// Expands special "ALL" scheme name (if provided), removes
29 /// duplicates and fills authConfigs vector.
30 void expand();
31
32 public:
33 /// corresponding vector of Auth::Config objects
34 ConfigVector authConfigs;
35
36 private:
37 /// raw auth schemes list (may have duplicates)
38 SBuf schemes;
39 const bool quoted;
40
41 public:
42 /// optimization for storing schemes.c_str()
43 const char *rawSchemes;
44 };
45
46 typedef std::vector<SchemesConfig> SchemesConfigs;
47
48 } // namespace Auth
49
50 #endif /* USE_AUTH */
51 #endif /* SQUID_SCHEMES_CONFIG_H */
52