]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/SchemesConfig.cc
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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.
10 #include "auth/Config.h"
12 #include "parser/Tokenizer.h"
17 addUnique(const SBuf
&scheme
, std::vector
<SBuf
> &vec
)
19 static const SBuf
all("ALL");
21 for (const auto config
: Auth::TheConfig
.schemes
)
22 addUnique(SBuf(config
->type()), vec
);
23 } else if (std::find(vec
.begin(), vec
.end(), scheme
) == vec
.end())
24 vec
.push_back(scheme
);
28 Auth::SchemesConfig::expand()
30 static const CharacterSet
delimiters("delimiters", ",");
31 static const CharacterSet
quotedDelimiters("quotedDelimiters", ", ");
32 const CharacterSet
*resultDelimiters
= quoted
? "edDelimiters
: &delimiters
;
33 std::vector
<SBuf
> expanded
;
34 Parser::Tokenizer
t(schemes
);
36 while (t
.token(scheme
, *resultDelimiters
))
37 addUnique(scheme
, expanded
);
38 t
.skipAllTrailing(CharacterSet::SP
+ CharacterSet::HTAB
);
39 if (!t
.remaining().isEmpty())
40 addUnique(t
.remaining(), expanded
);
43 transform(expanded
.begin(), expanded
.end(),
44 back_inserter(authConfigs
), [](SBuf
&s
) {
45 return Auth::SchemeConfig::GetParsed(s
.c_str());