diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-01 15:52:08 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-01 15:52:08 +0200 |
| commit | fcac9dcb6ba0ad346a754c7b9e7c59d38b64a4e8 (patch) | |
| tree | 7c8c3d419346c01c44b722ec8a8456817e88502b | |
| parent | a64fe23de95f1495a831a1595b398fdd6149097e (diff) | |
| download | meshbay-fcac9dcb6ba0ad346a754c7b9e7c59d38b64a4e8.tar.gz | |
fix(client): rotating a group key asks nothing
Rotation narrows rather than widens: members still connected receive the
new key, and nothing already shared changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 files changed, 8 insertions, 30 deletions
diff --git a/docs/MESHBAY_DESIGN.md b/docs/MESHBAY_DESIGN.md index 51c7eb7..2419916 100644 --- a/docs/MESHBAY_DESIGN.md +++ b/docs/MESHBAY_DESIGN.md @@ -2441,11 +2441,11 @@ What running it establishes, and what each fact costs: process checks the arguments — ids are ids, names are encoded — builds the request and adds the node's token. `node:start` writes the hub this application is signed in to and a username the hub would register, never a value the page - supplies verbatim. **What widens what the node shares or admits, or replaces its - group key, is confirmed by a dialog the main process draws**: hosting a group or - sharing a folder with a folder not chosen in the native folder picker (one chosen - there is its own confirmation, so the ordinary path asks nothing), rotating the key, - clearing the denylist, and pointing the node at another account. The words come + supplies verbatim. **What widens what the node shares or admits is + confirmed by a dialog the main process draws**: hosting a group or sharing a + folder with a folder not chosen in the native folder picker (one chosen there is + its own confirmation, so the ordinary path asks nothing), clearing the denylist, + and pointing the node at another account. The words come from the interface's catalogues, read by the main process; the page sets the language and nothing else. An in-page confirmation is one a script in the page can answer for itself. **Every channel answers only the packaged page's top-level diff --git a/packages/meshbay-client/src/main.js b/packages/meshbay-client/src/main.js index dba40b4..c1ff540 100644 --- a/packages/meshbay-client/src/main.js +++ b/packages/meshbay-client/src/main.js @@ -2222,16 +2222,7 @@ function registerBridge() { ejectRoot: (a) => ['PUT', `${root(a)}/eject`], plugRoot: (a) => ['PUT', `${root(a)}/plug`], removeRoot: (a) => ['DELETE', root(a)], - // Creating a missing key replaces nothing -- the node keeps an existing one - // -- so only a rotation is asked about. - initGek: async (a) => { - const target = group(a); - if (a.rotate) { - await confirmOrRefuse('node.gek_rotate_confirm'); - return ['POST', `${target}/gek?rotate=true`]; - } - return ['POST', `${target}/gek`]; - }, + initGek: (a) => ['POST', `${group(a)}/gek${a.rotate ? '?rotate=true' : ''}`], pairOperator: () => ['POST', '/api/operator/pair'], roster: (a) => ['GET', a.groupId ? `/api/roster?group_id=${anId(a.groupId, 'the group')}` : '/api/roster'], diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js index d51e89a..c650f75 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js @@ -977,7 +977,6 @@ export default { 'node.gek_init_hint': 'Noch kein Gruppenschlüssel. Führen Sie GEK init über die CLI aus, um einen einzurichten.', 'node.gek_public_hint': 'Schlüsselrotation ist für öffentliche Gruppen nicht verfügbar.', 'node.gek_rotate': 'Gruppenschlüssel rotieren', - 'node.gek_rotate_confirm': 'Gruppenschlüssel rotieren? Verbundene Mitglieder erhalten den neuen Schlüssel automatisch. Bereits heruntergeladene Inhalte sind nicht betroffen.', 'node.gek_rotated': 'Gruppenschlüssel rotiert.', 'node.roster': 'Mitgliederliste', 'node.roster_load': 'Mitgliederliste laden', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js index 74d4f78..b4e4adf 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js @@ -1039,7 +1039,6 @@ export default { 'node.not_operator': 'Could not reach your node. Make sure it is running.', 'node.gek': 'Group key', 'node.gek_rotate': 'Rotate group key', - 'node.gek_rotate_confirm': 'Rotate the group key? Connected members will receive the new key automatically. Content already downloaded is unaffected.', 'node.gek_rotated': 'Group key rotated.', 'node.gek_init_hint': 'No group key yet. Run GEK init from the CLI to set one up.', 'node.gek_public_hint': 'Key rotation is not available for public groups.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js index fa06816..7422b13 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js @@ -971,7 +971,6 @@ export default { 'node.gek_init_hint': 'Aún no hay clave de grupo. Ejecute GEK init desde la línea de comandos para configurarla.', 'node.gek_public_hint': 'La rotación de clave no está disponible para los grupos públicos.', 'node.gek_rotate': 'Rotar clave de grupo', - 'node.gek_rotate_confirm': '¿Rotar la clave de grupo? Los miembros conectados recibirán la nueva clave automáticamente. El contenido ya descargado no se ve afectado.', 'node.gek_rotated': 'Clave de grupo rotada.', 'node.roster': 'Registro', 'node.roster_load': 'Cargar registro', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js index e0c5d36..d7d9228 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js @@ -983,7 +983,6 @@ export default { 'node.gek_init_hint': 'Aucune clé de groupe pour l\'instant. Lancez GEK init depuis la ligne de commande pour en créer une.', 'node.gek_public_hint': 'La rotation de clé n\'est pas disponible pour les groupes publics.', 'node.gek_rotate': 'Rotation de la clé de groupe', - 'node.gek_rotate_confirm': 'Effectuer la rotation de la clé de groupe ? Les membres connectés recevront la nouvelle clé automatiquement. Le contenu déjà téléchargé n\'est pas affecté.', 'node.gek_rotated': 'Clé de groupe renouvelée.', 'node.roster': 'Registre', 'node.roster_load': 'Charger le registre', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js index 8a0bb9b..5052378 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js @@ -979,7 +979,6 @@ export default { 'node.gek_init_hint': 'Nessuna chiave di gruppo ancora. Esegua GEK init dalla riga di comando per configurarla.', 'node.gek_public_hint': 'La rotazione delle chiavi non è disponibile per i gruppi pubblici.', 'node.gek_rotate': 'Ruota chiave di gruppo', - 'node.gek_rotate_confirm': 'Ruotare la chiave di gruppo? I membri connessi riceveranno la nuova chiave automaticamente. I contenuti già scaricati non saranno interessati.', 'node.gek_rotated': 'Chiave di gruppo ruotata.', 'node.roster': 'Roster', 'node.roster_load': 'Carica roster', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js index 419b502..47a968c 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js @@ -965,7 +965,6 @@ export default { 'node.gek_init_hint': 'グループ鍵が未設定です。CLI から GEK init を実行して設定してください。', 'node.gek_public_hint': '公開グループでは鍵のローテーションは利用できません。', 'node.gek_rotate': 'グループ鍵をローテーション', - 'node.gek_rotate_confirm': 'グループ鍵をローテーションしますか?接続中のメンバーは新しい鍵を自動的に受け取ります。ダウンロード済みのコンテンツには影響しません。', 'node.gek_rotated': 'グループ鍵をローテーションしました。', 'node.roster': '名簿', 'node.roster_load': '名簿を読み込む', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js index b8d26e9..eaad700 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js @@ -981,7 +981,6 @@ export default { 'node.gek_init_hint': 'Nog geen groepssleutel. Voer GEK init uit via de CLI om er een in te stellen.', 'node.gek_public_hint': 'Sleutelrotatie is niet beschikbaar voor openbare groepen.', 'node.gek_rotate': 'Groepssleutel roteren', - 'node.gek_rotate_confirm': 'De groepssleutel roteren? Verbonden leden ontvangen de nieuwe sleutel automatisch. Reeds gedownloade inhoud wordt niet beïnvloed.', 'node.gek_rotated': 'Groepssleutel geroteerd.', 'node.roster': 'Ledenlijst', 'node.roster_load': 'Ledenlijst laden', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js index 197735f..2635fb0 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js @@ -1003,7 +1003,6 @@ export default { 'node.gek_init_hint': 'Nie ma jeszcze klucza grupy. Uruchom GEK init z wiersza poleceń, aby go skonfigurować.', 'node.gek_public_hint': 'Rotacja klucza nie jest dostępna dla grup publicznych.', 'node.gek_rotate': 'Zmień klucz grupy', - 'node.gek_rotate_confirm': 'Zmienić klucz grupy? Połączeni członkowie otrzymają nowy klucz automatycznie. Wcześniej pobrane treści pozostaną bez zmian.', 'node.gek_rotated': 'Klucz grupy zmieniony.', 'node.roster': 'Rejestr', 'node.roster_load': 'Wczytaj rejestr', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js index 48cab52..207c1b7 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js @@ -972,7 +972,6 @@ export default { 'node.gek_init_hint': 'Ainda não há chave de grupo. Execute GEK init na CLI para configurá-la.', 'node.gek_public_hint': 'A rotação de chave não está disponível para grupos públicos.', 'node.gek_rotate': 'Rotacionar chave do grupo', - 'node.gek_rotate_confirm': 'Rotacionar a chave do grupo? Os membros conectados receberão a nova chave automaticamente. O conteúdo já baixado não é afetado.', 'node.gek_rotated': 'Chave do grupo rotacionada.', 'node.roster': 'Cadastro', 'node.roster_load': 'Carregar cadastro', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js index 3e3bd5b..3ea8699 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js @@ -953,7 +953,6 @@ export default { 'node.gek_init_hint': '尚无群组密钥。请从命令行运行 GEK 初始化来设置。', 'node.gek_public_hint': '公开群组不支持密钥轮换。', 'node.gek_rotate': '轮换群组密钥', - 'node.gek_rotate_confirm': '轮换群组密钥?已连接的成员将自动收到新密钥。已下载的内容不受影响。', 'node.gek_rotated': '群组密钥已轮换。', 'node.roster': '花名册', 'node.roster_load': '加载花名册', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js index 41e9567..9d230c1 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js @@ -339,8 +339,6 @@ export function NodePage({ groups, token, username }) { } }, [rosterGroup, loadRoster]); - // No confirmation drawn here: replacing the key is asked natively by the - // app itself (node:op), which a script in this page cannot answer. const rotateGek = useCallback(async (groupId) => { setBusy(true); setActionMsg(''); diff --git a/packages/meshbay-hub/tests/test_desktop_shell.py b/packages/meshbay-hub/tests/test_desktop_shell.py index 60aa32f..5474439 100644 --- a/packages/meshbay-hub/tests/test_desktop_shell.py +++ b/packages/meshbay-hub/tests/test_desktop_shell.py @@ -425,10 +425,9 @@ def test_the_page_names_node_operations_not_routes(): assert defined <= used, f"defined but never called: {defined - used}" -@pytest.mark.parametrize("op", ["attachGroup", "addRoot", "initGek", "clearDenylist"]) +@pytest.mark.parametrize("op", ["attachGroup", "addRoot", "clearDenylist"]) def test_what_widens_the_node_is_confirmed_natively(op): - """Sharing a folder, hosting a group, replacing the key, re-admitting a - revoked subject: asked by a dialog the main process draws, which a script in + """Sharing a folder, hosting a group, re-admitting a revoked subject: asked by a dialog the main process draws, which a script in the page cannot answer. A folder chosen in the native picker is its own confirmation.""" body = _node_ops()[op] |