summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_hub_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_hub_api.py')
-rw-r--r--packages/meshbay-hub/tests/test_hub_api.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_hub_api.py b/packages/meshbay-hub/tests/test_hub_api.py
index 5bb6af9..73f7fea 100644
--- a/packages/meshbay-hub/tests/test_hub_api.py
+++ b/packages/meshbay-hub/tests/test_hub_api.py
@@ -682,6 +682,17 @@ async def test_webrtc_signaling_roundtrip(client, app):
fake_ws = FakeWS(node_id)
_connected_nodes[node_id] = fake_ws
+ # The caller must share an active group with the node, which is what this
+ # test used to get away without: a node registered for no group skipped the
+ # membership check entirely, so this exercised the relay through the hole
+ # rather than through the door. Registering the group is what a real node
+ # does on its socket.
+ from meshbay_hub.api.revocation import _node_groups
+ r = await client.post("/v1/groups", json={"name": "sig-group"},
+ headers={"Authorization": f"Bearer {token}"})
+ assert r.status_code == 201, r.text
+ _node_groups[node_id] = [r.json()["group_id"]]
+
try:
r = await client.post(f"/v1/nodes/{node_id}/webrtc/offer",
json={"sdp": "v=0\r\noffer-sdp", "ice_candidates": []},
@@ -693,6 +704,7 @@ async def test_webrtc_signaling_roundtrip(client, app):
assert "peer_id" in data
finally:
_connected_nodes.pop(node_id, None)
+ _node_groups.pop(node_id, None)
# ── IP log cleanup (8.9) ────────────────────────────────────────────────────