]>
Commit | Line | Data |
---|---|---|
f5691f9c | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
f5691f9c | 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. | |
f5691f9c | 7 | */ |
8 | ||
f7f3304a | 9 | #include "squid.h" |
12daeef6 | 10 | #include "auth/basic/Config.h" |
616cfc4c | 11 | #include "auth/basic/Scheme.h" |
675b8408 AR |
12 | #include "debug/Messages.h" |
13 | #include "debug/Stream.h" | |
5817ee13 AJ |
14 | #include "helper.h" |
15 | ||
aee3523a | 16 | Auth::Scheme::Pointer Auth::Basic::Scheme::_instance = nullptr; |
f5691f9c | 17 | |
c6cf8dee | 18 | Auth::Scheme::Pointer |
d6374be6 | 19 | Auth::Basic::Scheme::GetInstance() |
f5691f9c | 20 | { |
aee3523a | 21 | if (_instance == nullptr) { |
d6374be6 | 22 | _instance = new Auth::Basic::Scheme(); |
5817ee13 AJ |
23 | AddScheme(_instance); |
24 | } | |
25 | return _instance; | |
f5691f9c | 26 | } |
27 | ||
28 | char const * | |
c6cf8dee | 29 | Auth::Basic::Scheme::type() const |
f5691f9c | 30 | { |
31 | return "basic"; | |
32 | } | |
33 | ||
5817ee13 | 34 | void |
c6cf8dee | 35 | Auth::Basic::Scheme::shutdownCleanup() |
5817ee13 | 36 | { |
aee3523a | 37 | if (_instance == nullptr) |
d6374be6 | 38 | return; |
5817ee13 | 39 | |
aee3523a | 40 | _instance = nullptr; |
c59baaa8 | 41 | debugs(29, Critical(12), "Shutdown: Basic authentication."); |
5817ee13 AJ |
42 | } |
43 | ||
dc79fed8 | 44 | Auth::SchemeConfig * |
d6374be6 | 45 | Auth::Basic::Scheme::createConfig() |
5817ee13 | 46 | { |
372fccd6 | 47 | Auth::Basic::Config *newCfg = new Auth::Basic::Config; |
dc79fed8 | 48 | return dynamic_cast<Auth::SchemeConfig*>(newCfg); |
5817ee13 | 49 | } |
f53969cc | 50 |