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