Relay DNS and mailbox provisioning over restricted SSH connections

This commit is contained in:
parkel committed 2026-11-21 17:31:00 +01:00
1 parent df9f7c3284
commit dc19e4a59a
10 files changed
+91 -2

No files matched your search

+4
View File
@@ -212,6 +212,10 @@ def apply_on_local_node(
if len(body) > RESPONSE_LIMIT:
raise ValueError(f"The {node} returned an oversized response.")
if not body:
raise ValueError(
f"The {node} closed the connection without a response."
)
invalid_response = (
f"The {node} returned an invalid response for this {resource}."
)
@@ -149,6 +149,22 @@ class DnsPublicationTests(TestCase):
class DnsPublicationSocketTests(SimpleTestCase):
def test_closed_connection_reports_a_missing_reply(self):
zone = DnsZone(
"site.example",
1,
("ns.provider.example",),
"hostmaster.site.example",
)
with patch("coulobre.hosting.node_client.socket.socket") as socket:
connection = socket.return_value.__enter__.return_value
connection.makefile.return_value.__enter__.return_value = BytesIO()
with self.assertRaisesMessage(
ValueError,
"The BIND9 node closed the connection without a response.",
):
publish_local_zone(zone)
def test_receipt_must_identify_the_exact_soa_serial(self):
zone = DnsZone(
"site.example",