Archived
Simplify pending setup secrets
This commit is contained in:
1 parent
5fee087b60
commit
8f07bbde84
6 files changed
+29
-23
No files matched your search
@@ -161,6 +161,9 @@ def test_hostname_api_lifecycle_and_history(tmp_path: Path) -> None:
|
||||
dashboard_secret = body["dashboard_url"].rsplit("/", 1)[1]
|
||||
update_path = _path(body["update_url"])
|
||||
register_path = _path(body["registration_url"])
|
||||
assert dashboard_secret.startswith("karl_")
|
||||
assert update_path.rsplit("/", 1)[1].startswith("karl_")
|
||||
assert register_path.rsplit("/", 1)[1].startswith("karl_")
|
||||
|
||||
pending = client.get(f"/api/v1/hostnames/{dashboard_secret}")
|
||||
assert pending.status_code == 200
|
||||
@@ -214,6 +217,7 @@ def test_hostname_api_can_rotate_update_url(tmp_path: Path) -> None:
|
||||
assert rotated.status_code == 200
|
||||
assert rotated.json()["hostname"] == body["hostname"]
|
||||
assert rotated.json()["update_url"] != body["update_url"]
|
||||
assert new_update_path.rsplit("/", 1)[1].startswith("karl_")
|
||||
assert client.get(old_update_path, params={"myip": "203.0.113.11"}).status_code == 404
|
||||
assert client.get(new_update_path, params={"myip": "203.0.113.12"}).status_code == 200
|
||||
|
||||
|
||||
+9
-7
@@ -28,8 +28,9 @@ def test_self_service_managed_hostname_generates_random_account(tmp_path: Path)
|
||||
assert response.status_code == 200
|
||||
assert "/m/" in str(response.url)
|
||||
assert "Update-URL:" in response.text
|
||||
assert "CNAME target:" in response.text
|
||||
assert "Register URL:" in response.text
|
||||
assert "Domainnamen:" in response.text
|
||||
assert "CNAME target:" not in response.text
|
||||
assert "Register URL:" not in response.text
|
||||
assert "Router setup." in response.text
|
||||
assert "Use your own DNS name." in response.text
|
||||
assert "Manual updates" in response.text
|
||||
@@ -40,7 +41,7 @@ def test_self_service_managed_hostname_generates_random_account(tmp_path: Path)
|
||||
assert "Secret:" in response.text
|
||||
assert ".ddns.example.net" in response.text
|
||||
assert "/api/v1/router/update/" in response.text
|
||||
assert "/api/v1/router/register/" in response.text
|
||||
assert "/api/v1/router/register/" not in response.text
|
||||
assert "/m/" in response.text
|
||||
assert 'type="password"' not in response.text
|
||||
assert "Copy setup values" not in response.text
|
||||
@@ -79,8 +80,9 @@ def test_hostname_without_login_generates_update_and_dashboard_links(tmp_path: P
|
||||
assert response.status_code == 200
|
||||
assert "/m/" in str(response.url)
|
||||
assert "Update-URL:" in response.text
|
||||
assert "CNAME target:" in response.text
|
||||
assert "Register URL:" in response.text
|
||||
assert "Domainnamen:" in response.text
|
||||
assert "CNAME target:" not in response.text
|
||||
assert "Register URL:" not in response.text
|
||||
assert "Private dashboard:" in response.text
|
||||
assert "Pending setup" in response.text
|
||||
assert "Register hostname" in response.text
|
||||
@@ -89,8 +91,8 @@ def test_hostname_without_login_generates_update_and_dashboard_links(tmp_path: P
|
||||
assert "Copy setup values" not in response.text
|
||||
assert "Paste this exact URL into the FRITZ!Box" in response.text
|
||||
assert "Copy manual update commands" in response.text
|
||||
assert response.text.count("copy-field-secret") >= 3
|
||||
assert response.text.count("copy-field-public") >= 2
|
||||
assert response.text.count("copy-field-secret") >= 2
|
||||
assert response.text.count("copy-field-public") >= 1
|
||||
assert ".ddns.example.net" in response.text
|
||||
assert 'type="password"' not in response.text
|
||||
|
||||
|
||||
Reference in new issue
Block a user