diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/ops/__init__.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/ops/__init__.py | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/ops/__init__.py b/packages/meshbay-node/src/meshbay_node/ops/__init__.py new file mode 100644 index 0000000..bfdfd7b --- /dev/null +++ b/packages/meshbay-node/src/meshbay_node/ops/__init__.py @@ -0,0 +1,167 @@ +""" +Operator operations — one implementation, several front doors. + +Three things ask this node to act: the CLI (over the loopback admin API), the +local admin UI, and — from Stage B3 — signed MNP messages from a paired client. +They must agree, and the way to make them agree is not to write the operation +three times and hope. + +**C1 and C6 were both "a second path into the node with its own weaker +handshake."** Two implementations of `revoke` with two authorization checks is +the same shape one size down. So each operation lives here once, takes the +daemon's `state`, and knows nothing about HTTP, argv or MNP. The adapters +translate: `ui/app.py` turns `OpError` into a JSON response, the CLI prints it, +the MNP handler sends an error frame. + +**Authorization is not here.** Reaching this module already means the caller got +past its adapter's check — the loopback session token (11.5.3) for the API, an +Ed25519 signature verified against the roster for MNP. These functions do what +they are told; deciding who may tell them is the adapter's job and stays visible +in the adapter. +""" + +from meshbay_node.ops.apps import ( + _validate_app_dirs, + rematch_video, + set_app_directories, + set_app_directory, + set_chat_directory, + set_chat_link_preview, + set_enabled_apps, + set_musicbrainz_enabled, + set_search_listed, + set_tmdb_config, + set_tmdb_enabled, +) +from meshbay_node.ops.chat import ( + _wrap_for_node, + chat_epoch_keys, + chat_status, + encrypt_chat_history, + ensure_chat_epoch, + open_chat_epoch, + prune_chat, +) +from meshbay_node.ops.core import ( + OpError, + _config, + _group_ctx, + _hub, + _roster, +) +from meshbay_node.ops.files import ( + delete_file, + index_cache_stats, + prune_index_cache, +) +from meshbay_node.ops.groups import ( + attach_group, + detach_group, + list_groups, + set_gek, +) +from meshbay_node.ops.members import ( + _invite_url, + cancel_invite, + cancel_link_invitation, + create_invite, + create_link_invitation, + create_link_invite, + pair_operator, + read_roster, + resolve_user, + revoke_member, + unpin_member, +) +from meshbay_node.ops.node_toml import ( + _find_group_range, + _insert_roots_block, + _remove_roots_block, + _update_node_toml, + _update_root_field, +) +from meshbay_node.ops.roots import ( + add_root, + eject_root, + plug_root, + remove_root, + update_root, +) +from meshbay_node.ops.settings import ( + NODE_SETTING_WRITERS, + _group_limits, + clear_denylist, + get_node_settings, + list_transfers, + read_denylist, + reload_config, + set_node_settings, + set_scan_settings, + set_transfer_limits, + start_reload, +) + +__all__ = [ + "NODE_SETTING_WRITERS", + "OpError", + "_config", + "_find_group_range", + "_group_ctx", + "_group_limits", + "_hub", + "_insert_roots_block", + "_invite_url", + "_remove_roots_block", + "_roster", + "_update_node_toml", + "_update_root_field", + "_validate_app_dirs", + "_wrap_for_node", + "add_root", + "attach_group", + "cancel_invite", + "cancel_link_invitation", + "chat_epoch_keys", + "chat_status", + "clear_denylist", + "create_invite", + "create_link_invitation", + "create_link_invite", + "delete_file", + "detach_group", + "eject_root", + "encrypt_chat_history", + "ensure_chat_epoch", + "get_node_settings", + "index_cache_stats", + "list_groups", + "list_transfers", + "open_chat_epoch", + "pair_operator", + "plug_root", + "prune_chat", + "prune_index_cache", + "read_denylist", + "read_roster", + "reload_config", + "rematch_video", + "remove_root", + "resolve_user", + "revoke_member", + "set_app_directories", + "set_app_directory", + "set_chat_directory", + "set_chat_link_preview", + "set_enabled_apps", + "set_gek", + "set_musicbrainz_enabled", + "set_node_settings", + "set_scan_settings", + "set_search_listed", + "set_tmdb_config", + "set_tmdb_enabled", + "set_transfer_limits", + "start_reload", + "unpin_member", + "update_root", +] |