]>
Commit | Line | Data |
---|---|---|
e6ccf245 | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
e6ccf245 | 3 | * |
bbc27441 AJ |
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. | |
e6ccf245 | 7 | */ |
8 | ||
97066760 AR |
9 | #ifndef SQUID_AUTH_GADGETS_H |
10 | #define SQUID_AUTH_GADGETS_H | |
e6ccf245 | 11 | |
2f1431ea AJ |
12 | #if USE_AUTH |
13 | ||
5817ee13 | 14 | #include "auth/Config.h" |
56a49fda | 15 | #include "auth/User.h" |
602d9612 | 16 | #include "hash.h" |
a2ac85d9 | 17 | |
63be0a78 | 18 | /** |
19 | \ingroup AuthAPI | |
20 | * | |
427cb33a | 21 | * This is used to link AuthUsers objects into the username cache. |
63be0a78 | 22 | * Because some schemes may link in aliases to a user, |
23 | * the link is not part of the AuthUser structure itself. | |
427cb33a AJ |
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. | |
63be0a78 | 29 | */ |
ec5858ff A |
30 | class AuthUserHashPointer : public hash_link |
31 | { | |
b001e822 | 32 | MEMPROXY_CLASS(AuthUserHashPointer); |
62e76326 | 33 | |
741c2986 | 34 | public: |
d87154ee | 35 | AuthUserHashPointer(Auth::User::Pointer); |
4ee6f984 | 36 | ~AuthUserHashPointer() { auth_user = NULL; }; |
62e76326 | 37 | |
d87154ee | 38 | Auth::User::Pointer user() const; |
62e76326 | 39 | |
e6ccf245 | 40 | private: |
d87154ee | 41 | Auth::User::Pointer auth_user; |
e6ccf245 | 42 | }; |
43 | ||
c6cf8dee AJ |
44 | namespace Auth |
45 | { | |
46 | class Scheme; | |
47 | } | |
924f73bc | 48 | class ConnStateData; |
97066760 | 49 | class StoreEntry; |
e6ccf245 | 50 | |
63be0a78 | 51 | /** |
52 | \ingroup AuthAPI | |
53 | \todo this should be a generic cachemgr API type ? | |
54 | */ | |
e6ccf245 | 55 | typedef void AUTHSSTATS(StoreEntry *); |
e6ccf245 | 56 | |
63be0a78 | 57 | /// \ingroup AuthAPI |
8a648e8d | 58 | void authenticateInit(Auth::ConfigVector *); |
0bcb6908 AJ |
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 | */ | |
8a648e8d | 70 | void authenticateReset(void); |
0bcb6908 | 71 | |
8a648e8d | 72 | void authenticateRotate(void); |
a2ac85d9 | 73 | |
63be0a78 | 74 | /// \ingroup AuthAPI |
8a648e8d | 75 | void authenticateFreeProxyAuthUserACLResults(void *data); |
63be0a78 | 76 | /// \ingroup AuthAPI |
8a648e8d | 77 | int authenticateActiveSchemeCount(void); |
63be0a78 | 78 | /// \ingroup AuthAPI |
8a648e8d | 79 | int authenticateSchemeCount(void); |
a2ac85d9 | 80 | |
63be0a78 | 81 | /// \ingroup AuthAPI |
8a648e8d | 82 | void authenticateOnCloseConnection(ConnStateData * conn); |
e6ccf245 | 83 | |
2f1431ea | 84 | #endif /* USE_AUTH */ |
97066760 | 85 | #endif /* SQUID_AUTH_GADGETS_H */ |
f53969cc | 86 |