feat: surface remnawave panel webhook settings
This commit is contained in:
@@ -230,6 +230,32 @@ def test_payment_provider_settings_include_webhook_metadata():
|
||||
assert "webhook_path" not in manifest["PAYMENT_STARS_WEBAPP_LABEL_RU"]
|
||||
|
||||
|
||||
def test_remnawave_settings_include_panel_webhook_metadata():
|
||||
manifest = _manifest_by_key()
|
||||
field = manifest["PANEL_WEBHOOK_SECRET"]
|
||||
remnawave_keys = (
|
||||
"PANEL_API_URL",
|
||||
"PANEL_API_KEY",
|
||||
"PANEL_WEBHOOK_SECRET",
|
||||
"USER_SQUAD_UUIDS",
|
||||
"USER_EXTERNAL_SQUAD_UUID",
|
||||
)
|
||||
|
||||
assert field["webhook_path"] == "/webhook/panel"
|
||||
assert field["webhook_requires_base_url"] is True
|
||||
assert field["provider_id"] == "remnawave"
|
||||
assert field["webhook_hint_i18n_key"] == "admin_settings_panel_webhook_url_hint"
|
||||
for setting_key in remnawave_keys:
|
||||
assert manifest[setting_key]["section"] == "remnawave"
|
||||
assert manifest[setting_key]["section_order"] == 3
|
||||
assert manifest[setting_key]["subsection"] is None
|
||||
|
||||
for language in ("ru", "en"):
|
||||
messages = _locale(language)
|
||||
assert "admin_settings_section_remnawave" in messages
|
||||
assert field["webhook_hint_i18n_key"] in messages
|
||||
|
||||
|
||||
def test_payment_provider_admin_only_toggles_are_mutually_exclusive():
|
||||
manifest = _manifest_by_key()
|
||||
|
||||
|
||||
@@ -760,10 +760,13 @@ class AdminSettingsSecurityTests(unittest.IsolatedAsyncioTestCase):
|
||||
response = await admin_api.admin_settings_get_route(request)
|
||||
|
||||
payload = json.loads(response.text)
|
||||
section_ids = [section["id"] for section in payload["sections"]]
|
||||
fields = {
|
||||
field["key"]: field for section in payload["sections"] for field in section["fields"]
|
||||
}
|
||||
|
||||
self.assertLess(section_ids.index("general"), section_ids.index("remnawave"))
|
||||
self.assertLess(section_ids.index("remnawave"), section_ids.index("payments"))
|
||||
self.assertEqual(
|
||||
fields["FREEKASSA_ENABLED"]["webhook_url"],
|
||||
"https://web.tnnl.cc/webhook/freekassa",
|
||||
@@ -773,6 +776,11 @@ class AdminSettingsSecurityTests(unittest.IsolatedAsyncioTestCase):
|
||||
fields["PAYMENT_PLATEGA_CRYPTO_WEBAPP_LABEL_RU"]["webhook_url"],
|
||||
"https://web.tnnl.cc/webhook/platega",
|
||||
)
|
||||
self.assertEqual(
|
||||
fields["PANEL_WEBHOOK_SECRET"]["webhook_url"],
|
||||
"https://web.tnnl.cc/webhook/panel",
|
||||
)
|
||||
self.assertTrue(fields["PANEL_WEBHOOK_SECRET"]["webhook_requires_base_url"])
|
||||
self.assertNotIn("webhook_url", fields["PAYMENT_STARS_WEBAPP_LABEL_RU"])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user