]> git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/Gadgets.h
Merge from trunk
[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 /* first two items must be same as hash_link */
57
58 public:
59 MEMPROXY_CLASS(AuthUserHashPointer);
60
61 AuthUserHashPointer(AuthUser::Pointer);
62 ~AuthUserHashPointer() { auth_user = NULL; };
63
64 AuthUser::Pointer user() const;
65
66 private:
67 AuthUser::Pointer auth_user;
68 };
69
70 MEMPROXY_CLASS_INLINE(AuthUserHashPointer);
71
72 class ConnStateData;
73 class AuthScheme;
74 class StoreEntry;
75
76 /**
77 \ingroup AuthAPI
78 \todo this should be a generic cachemgr API type ?
79 */
80 typedef void AUTHSSTATS(StoreEntry *);
81
82 /// \ingroup AuthAPI
83 extern void authenticateInit(Auth::authConfig *);
84
85 /** \ingroup AuthAPI
86 * Remove all idle authentication state. Intended for use by reconfigure.
87 *
88 * Removes the username cache contents and global configuration state.
89 * Stops just short of detaching the auth components completely.
90 *
91 * Currently active requests should finish. Howevee new requests will not use
92 * authentication unless something causes the global config to be rebuilt.
93 * Such as a configure load action adding config and re-running authenticateInit().
94 */
95 extern void authenticateReset(void);
96
97 extern void authenticateRotate(void);
98
99 /// \ingroup AuthAPI
100 extern void authenticateFreeProxyAuthUserACLResults(void *data);
101 /// \ingroup AuthAPI
102 extern int authenticateActiveSchemeCount(void);
103 /// \ingroup AuthAPI
104 extern int authenticateSchemeCount(void);
105
106 /// \ingroup AuthAPI
107 extern void authenticateOnCloseConnection(ConnStateData * conn);
108
109 #endif /* SQUID_AUTH_GADGETS_H */