]> git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/Gadgets.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / auth / Gadgets.h
1 /*
2 * $Id$
3 *
4 *
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
7 *
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
30 *
31 */
32
33 #ifndef SQUID_AUTH_GADGETS_H
34 #define SQUID_AUTH_GADGETS_H
35
36 #include "hash.h"
37 #include "MemPool.h"
38 #include "auth/Config.h"
39 #include "auth/User.h"
40
41 class AuthUser;
42
43 /**
44 \ingroup AuthAPI
45 *
46 * This is used to link AuthUsers objects into the username cache.
47 * Because some schemes may link in aliases to a user,
48 * the link is not part of the AuthUser structure itself.
49 *
50 * Code must not hold onto copies of these objects.
51 * They may exist only so long as the AuthUser being referenced
52 * is recorded in the cache. Any caller using hash_remove_link
53 * must then delete the AuthUserHashPointer.
54 */
55 class AuthUserHashPointer : public hash_link
56 {
57 /* first two items must be same as hash_link */
58
59 public:
60 MEMPROXY_CLASS(AuthUserHashPointer);
61
62 AuthUserHashPointer(AuthUser::Pointer);
63 ~AuthUserHashPointer() { auth_user = NULL; };
64
65 AuthUser::Pointer user() const;
66
67 private:
68 AuthUser::Pointer auth_user;
69 };
70
71 MEMPROXY_CLASS_INLINE(AuthUserHashPointer);
72
73 class ConnStateData;
74 class AuthScheme;
75 class StoreEntry;
76
77 /**
78 \ingroup AuthAPI
79 \todo this should be a generic cachemgr API type ?
80 */
81 typedef void AUTHSSTATS(StoreEntry *);
82
83 /// \ingroup AuthAPI
84 extern void authenticateInit(Auth::authConfig *);
85
86 /** \ingroup AuthAPI
87 * Remove all idle authentication state. Intended for use by reconfigure.
88 *
89 * Removes the username cache contents and global configuration state.
90 * Stops just short of detaching the auth components completely.
91 *
92 * Currently active requests should finish. Howevee new requests will not use
93 * authentication unless something causes the global config to be rebuilt.
94 * Such as a configure load action adding config and re-running authenticateInit().
95 */
96 extern void authenticateReset(void);
97
98 extern void authenticateRotate(void);
99
100 /// \ingroup AuthAPI
101 extern void authenticateFreeProxyAuthUserACLResults(void *data);
102 /// \ingroup AuthAPI
103 extern int authenticateActiveSchemeCount(void);
104 /// \ingroup AuthAPI
105 extern int authenticateSchemeCount(void);
106
107 /// \ingroup AuthAPI
108 extern void authenticateOnCloseConnection(ConnStateData * conn);
109
110 #endif /* SQUID_AUTH_GADGETS_H */