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