Add "General.GetRPCCommands" RPC command

This commit is contained in:
badaix 2025-02-04 21:11:32 +01:00
parent 6b94392f2c
commit f264080c77
7 changed files with 106 additions and 20 deletions

View file

@ -697,7 +697,7 @@ TEST_CASE("Auth")
AuthInfo auth(settings);
auto ec = auth.authenticateBasic(base64_encode("badaix:secret"));
REQUIRE(!ec);
REQUIRE(auth.hasAuthInfo());
REQUIRE(auth.isAuthenticated());
REQUIRE(auth.hasPermission("stream"));
}
@ -710,7 +710,7 @@ TEST_CASE("Auth")
AuthInfo auth(settings);
auto ec = auth.authenticateBasic(base64_encode("badaix:secret"));
REQUIRE(!ec);
REQUIRE(auth.hasAuthInfo());
REQUIRE(auth.isAuthenticated());
REQUIRE(!auth.hasPermission("stream"));
}
@ -722,12 +722,12 @@ TEST_CASE("Auth")
AuthInfo auth(settings);
auto ec = auth.authenticateBasic(base64_encode("badaix:wrong_password"));
REQUIRE(ec == AuthErrc::wrong_password);
REQUIRE(!auth.hasAuthInfo());
REQUIRE(!auth.isAuthenticated());
REQUIRE(!auth.hasPermission("stream"));
ec = auth.authenticateBasic(base64_encode("unknown_user:secret"));
REQUIRE(ec == AuthErrc::unknown_user);
REQUIRE(!auth.hasAuthInfo());
REQUIRE(!auth.isAuthenticated());
REQUIRE(!auth.hasPermission("stream"));
}
}