diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-23 18:16:02 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-23 18:16:02 +0200 |
| commit | 1d169141f3a5542efda2f7fdb0bb88308c06191b (patch) | |
| tree | 86162905ad819d8c9dd325ccf9629bcdacc50bbf /packages/meshbay-hub | |
| parent | 35a7764db3f58a93c32206cb3ce74bb2f03967e7 (diff) | |
| download | meshbay-1d169141f3a5542efda2f7fdb0bb88308c06191b.tar.gz | |
feat(node): member invite --link and member cancel in the CLI
The CLI makes both halves itself — the node's code, then the hub's
ticket bound to the address — and prints the link; a refused ticket
takes the code back, and cancel takes back both. The CLI never asks the
hub to mail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub')
| -rw-r--r-- | packages/meshbay-hub/tests/test_invite_link_client.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_invite_link_client.py b/packages/meshbay-hub/tests/test_invite_link_client.py index c5c0101..be9885a 100644 --- a/packages/meshbay-hub/tests/test_invite_link_client.py +++ b/packages/meshbay-hub/tests/test_invite_link_client.py @@ -96,6 +96,16 @@ def test_one_shape_between_the_hub_and_the_page(tmp_path, monkeypatch): assert got["lower"]["c"] == CODE +def test_the_cli_writes_the_same_link(monkeypatch): + """`meshbay-node member invite --link` builds its link on the node, from the + hub address it was configured with; it must be the hub's own shape.""" + from meshbay_node.ops import _invite_url + monkeypatch.setattr(mail_mod, "_hub_url", "https://hub.example") + n = NODE_PK_STD.replace("+", "-").replace("/", "_").rstrip("=") + assert (_invite_url("https://hub.example/", GROUP, TICKET, NODE_PK_STD, CODE) + == invite_links.invite_url(GROUP, TICKET, n, CODE)) + + @pytest.mark.parametrize("tamper", [ lambda u: u.replace("v=1", "v=2"), lambda u: u.replace(CODE, "K7P2-9WQ"), |