aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-02 10:20:09 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-02 10:20:09 +0200
commite4f61771131be635b9e81a19203a00707b4b19df (patch)
treed80e4edafbeade3c27137e6753140e6585a26b9b /packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js
parente941cc4c39c38a12220153ea572bd4c7bb92fde0 (diff)
downloadmeshbay-e4f61771131be635b9e81a19203a00707b4b19df.tar.gz
feat(mnp): sharing a folder is decided on the node's machine only (MNP 6.0)
root_add, root_update and group_attach leave MNP: adding a directory and switching writable/removable go through the loopback API (native dialog in the desktop app) or the CLI. The operator's Settings tab still lists the roots from any browser, read-only. The desktop app refuses to sign those ops; a loopback flag change now reaches open pages (publish_roots). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js49
1 files changed, 0 insertions, 49 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js b/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js
index 1a5a4c0..32307c5 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js
@@ -255,23 +255,6 @@ extendTransport(class {
return msg;
}
- async addRoot(groupId, path, { name, kind, writable, removable } = {}, signFn) {
- const msg = await this._sendAndWait({
- type: 'root_add', v: '1.1',
- group_id: groupId, path,
- name: name || '', kind: kind || 'generic',
- writable: !!writable, removable: !!removable,
- });
- if (msg.type === 'error') throw new Error(msg.detail);
- if (msg.type === 'admin_challenge') {
- // Everything the node will act on is in the subject, `writable` included.
- const subject = window.MeshBayCrypto.rootAddSubject(
- path, name || '', kind || 'generic', !!writable, !!removable);
- return this._authorizeAdminOp(msg, 'root_add', subject, signFn);
- }
- return msg;
- }
-
async removeRoot(groupId, rootName, signFn) {
const msg = await this._sendAndWait({
type: 'root_remove', v: '0.1',
@@ -284,24 +267,6 @@ extendTransport(class {
return msg;
}
- async updateRoot(groupId, rootName, { writable, removable } = {}, signFn) {
- const updates = [];
- if (writable !== undefined) updates.push(`rw=${writable ? 'on' : 'off'}`);
- if (removable !== undefined) updates.push(`rem=${removable ? 'on' : 'off'}`);
- const subject = updates.length ? `${rootName}:${updates.join(',')}` : rootName;
- const msg = await this._sendAndWait({
- type: 'root_update', v: '1.1',
- group_id: groupId, root_name: rootName,
- ...(writable !== undefined && { writable }),
- ...(removable !== undefined && { removable }),
- });
- if (msg.type === 'error') throw new Error(msg.detail);
- if (msg.type === 'admin_challenge') {
- return this._authorizeAdminOp(msg, 'root_update', subject, signFn);
- }
- return msg;
- }
-
async ejectRoot(groupId, rootName, signFn) {
const msg = await this._sendAndWait({
type: 'root_eject', v: '1.1',
@@ -370,20 +335,6 @@ extendTransport(class {
return msg;
}
- async attachGroup(name, sharedDir, uploadDir, signFn) {
- const msg = await this._sendAndWait({
- type: 'group_attach', v: '0.1',
- name, shared_dir: sharedDir, upload_dir: uploadDir || '', writable: true,
- });
- if (msg.type === 'error') throw new Error(msg.detail);
- if (msg.type === 'admin_challenge') {
- // The directory being exposed is signed, not only the group's name.
- const subject = window.MeshBayCrypto.groupAttachSubject(name, sharedDir, true);
- return this._authorizeAdminOp(msg, 'group_attach', subject, signFn);
- }
- return msg;
- }
-
async detachGroup(name, signFn) {
const msg = await this._sendAndWait({
type: 'group_detach', v: '0.1', name,