diff options
Diffstat (limited to 'packages/meshbay-cli/src/meshbay_cli/client/account.py')
| -rw-r--r-- | packages/meshbay-cli/src/meshbay_cli/client/account.py | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ -90,6 +90,13 @@ class Account: 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") return unb64(a) if a else None @@ -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) |