From 988a0eecd522431980174910db28e45a63ff2710 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 12:32:24 +0200 Subject: feat(cli): account, rm -r and mkdir, Tab completion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit account shows the account and does what the sign-up form and the Profile page do: register (the passphrase floor and the hub's proof of work checked here, the recovery key printed once), verify, change the passphrase, reset a forgotten one, change the e-mail address, sign out everywhere, delete. A new passphrase carries the copy of the account's keys each node keeps for browsers first — opened under the old M, the same keys sealed under the new one — and only then tells the hub; a refusal sets the copies back. A reset restores them from the recovery copy. The connections that do it never make keys nor ask for a device approval. This machine keeps the M it changed away from, so a node out of reach is carried at its next connection; a copy under an M it does not know is no longer rewritten, which locked the browsers out after a passphrase changed elsewhere. rm -r removes a folder and all it holds, from the node's operator key: the files, then the folders deepest first, one confirmation that counts them. mkdir makes folders, --parents the missing ones (not -p, the passphrase). completion bash|powershell prints the script that makes Tab complete actions, verbs, options and the paths of the groups this machine is signed in to, cached two minutes; the deb and rpm packages install the bash one. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-cli/src/meshbay_cli/client/account.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/meshbay-cli/src/meshbay_cli/client/account.py') diff --git a/packages/meshbay-cli/src/meshbay_cli/client/account.py b/packages/meshbay-cli/src/meshbay_cli/client/account.py index 96483e9..fae1add 100644 --- a/packages/meshbay-cli/src/meshbay_cli/client/account.py +++ b/packages/meshbay-cli/src/meshbay_cli/client/account.py @@ -89,6 +89,13 @@ class Account: m = self.secrets.get("master") return unb64(m) if m else None + @property + def previous_masters(self) -> list[bytes]: + """The `M` of passphrases this machine changed away from: a copy a node + still holds under one is carried over at the next connection.""" + current = self.secrets.get("master") + return [unb64(m) for m in self.secrets.get("previous_masters", []) if m != current] + @property def legacy(self) -> bytes | None: a = self.secrets.get("legacy") @@ -175,6 +182,8 @@ class Account: "pepper_version": int(r.get("bundle_pepper_version") or 1), "legacy": b64(a), "identities": self.secrets.get("identities", {}) if same_account else {}, + "previous_masters": [m for m in self.secrets.get("previous_masters", []) + if m != b64(master)] if same_account else [], } if remember: device = (self.secrets.get("device_sk") if same_account else None) -- cgit v1.2.3