]> git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/basic/Scheme.cc
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / auth / basic / Scheme.cc
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 #include "squid.h"
10 #include "auth/basic/Scheme.h"
11 #include "Debug.h"
12 #include "helper.h"
13
14 /* for Auth::Config */
15 #include "auth/basic/auth_basic.h"
16
17 Auth::Scheme::Pointer Auth::Basic::Scheme::_instance = NULL;
18
19 Auth::Scheme::Pointer
20 Auth::Basic::Scheme::GetInstance()
21 {
22 if (_instance == NULL) {
23 _instance = new Auth::Basic::Scheme();
24 AddScheme(_instance);
25 }
26 return _instance;
27 }
28
29 char const *
30 Auth::Basic::Scheme::type() const
31 {
32 return "basic";
33 }
34
35 void
36 Auth::Basic::Scheme::shutdownCleanup()
37 {
38 if (_instance == NULL)
39 return;
40
41 _instance = NULL;
42 debugs(29, DBG_CRITICAL, "Shutdown: Basic authentication.");
43 }
44
45 Auth::Config *
46 Auth::Basic::Scheme::createConfig()
47 {
48 Auth::Basic::Config *newCfg = new Auth::Basic::Config;
49 return dynamic_cast<Auth::Config*>(newCfg);
50 }