]> git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/Gadgets.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / auth / Gadgets.h
1 /*
2 * Copyright (C) 1996-2014 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_AUTH_GADGETS_H
10 #define SQUID_AUTH_GADGETS_H
11
12 #if USE_AUTH
13
14 #include "auth/Config.h"
15 #include "auth/User.h"
16 #include "hash.h"
17 #include "MemPool.h"
18
19 /**
20 \ingroup AuthAPI
21 *
22 * This is used to link AuthUsers objects into the username cache.
23 * Because some schemes may link in aliases to a user,
24 * the link is not part of the AuthUser structure itself.
25 *
26 * Code must not hold onto copies of these objects.
27 * They may exist only so long as the AuthUser being referenced
28 * is recorded in the cache. Any caller using hash_remove_link
29 * must then delete the AuthUserHashPointer.
30 */
31 class AuthUserHashPointer : public hash_link
32 {
33 /* first two items must be same as hash_link */
34
35 public:
36 MEMPROXY_CLASS(AuthUserHashPointer);
37
38 AuthUserHashPointer(Auth::User::Pointer);
39 ~AuthUserHashPointer() { auth_user = NULL; };
40
41 Auth::User::Pointer user() const;
42
43 private:
44 Auth::User::Pointer auth_user;
45 };
46
47 MEMPROXY_CLASS_INLINE(AuthUserHashPointer);
48
49 namespace Auth
50 {
51 class Scheme;
52 }
53 class ConnStateData;
54 class StoreEntry;
55
56 /**
57 \ingroup AuthAPI
58 \todo this should be a generic cachemgr API type ?
59 */
60 typedef void AUTHSSTATS(StoreEntry *);
61
62 /// \ingroup AuthAPI
63 void authenticateInit(Auth::ConfigVector *);
64
65 /** \ingroup AuthAPI
66 * Remove all idle authentication state. Intended for use by reconfigure.
67 *
68 * Removes the username cache contents and global configuration state.
69 * Stops just short of detaching the auth components completely.
70 *
71 * Currently active requests should finish. Howevee new requests will not use
72 * authentication unless something causes the global config to be rebuilt.
73 * Such as a configure load action adding config and re-running authenticateInit().
74 */
75 void authenticateReset(void);
76
77 void authenticateRotate(void);
78
79 /// \ingroup AuthAPI
80 void authenticateFreeProxyAuthUserACLResults(void *data);
81 /// \ingroup AuthAPI
82 int authenticateActiveSchemeCount(void);
83 /// \ingroup AuthAPI
84 int authenticateSchemeCount(void);
85
86 /// \ingroup AuthAPI
87 void authenticateOnCloseConnection(ConnStateData * conn);
88
89 #endif /* USE_AUTH */
90 #endif /* SQUID_AUTH_GADGETS_H */