summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/ops/__init__.py
blob: bfdfd7bbc1235adf55e58073b8f07821b05ec4cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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",
]