1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 17:26:39 +02:00

Also allow hashed RPC tokens in the config file.

This commit is contained in:
Sadie Powell
2025-05-04 14:39:20 +01:00
parent 4b854d3935
commit 72f5e3580f
4 changed files with 70 additions and 23 deletions
+7 -5
View File
@@ -281,12 +281,14 @@ public:
for (int i = 0; i < modconf.CountBlock("token"); ++i)
{
const auto &block = modconf.GetBlock("token", i);
const auto &token = block.Get<const Anope::string>("token");
if (!token.empty())
RPC::Token token;
token.token = block.Get<const Anope::string>("token");
if (!token.token.empty())
{
std::vector<Anope::string> methods;
spacesepstream(block.Get<const Anope::string>("methods")).GetTokens(methods);
jsonrpcinterface.tokens.emplace(token, methods);
token.token_hash = block.Get<const Anope::string>("token_hash");
spacesepstream(block.Get<const Anope::string>("methods")).GetTokens(token.methods);
jsonrpcinterface.tokens.emplace_back(token);
}
}