This repository has been archived on 2026-10-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2026-06-17 23:17:31 +02:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
from karldns.settings import _is_reserved_admin_path, _validate_launch_secrets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_reserved_admin_path_matches_exact_and_nested_public_routes() -> None:
|
|
|
|
|
assert _is_reserved_admin_path("/api")
|
|
|
|
|
assert _is_reserved_admin_path("/api/v1")
|
|
|
|
|
assert _is_reserved_admin_path("/logo.png")
|
2026-10-28 08:47:52 +01:00
|
|
|
assert _is_reserved_admin_path("/llms.txt")
|
2026-06-17 23:17:31 +02:00
|
|
|
assert not _is_reserved_admin_path("/ops")
|
|
|
|
|
assert not _is_reserved_admin_path("/apix")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_launch_secrets_require_strong_admin_password() -> None:
|
|
|
|
|
with pytest.raises(RuntimeError, match="DDNS_ADMIN_PASSWORD"):
|
|
|
|
|
_validate_launch_secrets("short", "")
|