diff --git a/docs/2-handbook/external-accounts/matrix.md b/docs/2-handbook/external-accounts/matrix.md
index 49b76b7e3..c7977c17c 100644
--- a/docs/2-handbook/external-accounts/matrix.md
+++ b/docs/2-handbook/external-accounts/matrix.md
@@ -46,15 +46,5 @@ logout fails because the homeserver no longer recognises the token, the delete
goes ahead as if it had worked. Any other failed logout, or an account with no
homeserver stored, leaves the account in place and the dialog says why.
-The checkbox also decides what happens to the account's key-backup passphrase,
-the secret its end-to-end key backup opens with. With it off, the passphrase
-stays, so linking the same account again finds the passphrase the backup used
-and the agent can recover its keys. With it on, the controller deletes the
-passphrase after the account, and a later link gets a new one, which can't open
-a backup made with the old one. Tick it when you've lost the account for good.
-If the controller can't delete the passphrase, the account is already gone and
-the dialog says so; deleting the account again with the box ticked finishes the
-job.
-
The agent isn't told about a delete. Its matrix daemon drops the account the
next time it lists the accounts, within two minutes.
diff --git a/docs/4-implementation/swarm/matrix-provisioning.md b/docs/4-implementation/swarm/matrix-provisioning.md
index ed1e608df..de147f604 100644
--- a/docs/4-implementation/swarm/matrix-provisioning.md
+++ b/docs/4-implementation/swarm/matrix-provisioning.md
@@ -173,12 +173,6 @@ registration's `as_token`, and `swarm-controller` reads it from there.
primary-token reset therefore comes back with its history. With no passphrase
stored yet the account comes up without backup and picks it up on the
next daemon start. A failure is a `WARN` and never stops the daemon.
- The passphrase outlives a plain unlink, so a relink reuses it. A revoking
- unlink (`?revoke=true`, after the logout succeeded) deletes it too, every
- version, after the account's own entry; when that last delete fails the route
- answers 500 with the account already gone, and sending the revoking delete
- again finishes it (the controller's `delete` grant on
- `metadata/swarm/agents/+/matrix-recovery/+`).
The module's retired hive-side code, its evaluation assertions and the
fluffychat-web build fixes are in the
diff --git a/frontend/packages/swarm-ui/src/agent/detail/LinkedAccounts.tsx b/frontend/packages/swarm-ui/src/agent/detail/LinkedAccounts.tsx
index d8fc72fe7..eadd22cad 100644
--- a/frontend/packages/swarm-ui/src/agent/detail/LinkedAccounts.tsx
+++ b/frontend/packages/swarm-ui/src/agent/detail/LinkedAccounts.tsx
@@ -126,7 +126,7 @@ export function LinkedAccounts({
{deleteTarget.kind === "matrix" ? (
diff --git a/nix/host-modules/swarm-bao.nix b/nix/host-modules/swarm-bao.nix
index 269a9fdf0..3f6cd481a 100644
--- a/nix/host-modules/swarm-bao.nix
+++ b/nix/host-modules/swarm-bao.nix
@@ -509,10 +509,6 @@ let
capabilities = ["delete"]
}
- path "${credentialMountPath}/metadata/swarm/agents/+/matrix-recovery/+" {
- capabilities = ["delete"]
- }
-
path "${credentialMountPath}/metadata/swarm/agents/+/forge/+" {
capabilities = ["delete"]
}
diff --git a/nix/module-eval/bao-grants.nix b/nix/module-eval/bao-grants.nix
index 3cdfa80aa..bc48af733 100644
--- a/nix/module-eval/bao-grants.nix
+++ b/nix/module-eval/bao-grants.nix
@@ -2547,14 +2547,12 @@ let
lib.hasInfix "path \"secret/metadata/swarm/agents/+/matrix/\" {\n capabilities = [\"list\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/agents/+/forge/\" {\n capabilities = [\"list\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/agents/+/gitlab/\" {\n capabilities = [\"list\"]\n}" s
- && stanzas == 10;
+ && stanzas == 9;
}
{
# `linked_accounts` deletes one matrix account, forge account, GitLab
# account, GitHub token or backend environment through `delete_all_versions`, which
- # addresses its metadata path. A revoking matrix delete also deletes that
- # account's key-backup passphrase, at `matrix-recovery/`, the one
- # place the controller may delete a passphrase.
+ # addresses its metadata path.
# A trailing `+` is one segment, so each stanza reaches the accounts
# directly in that directory and nothing deeper. Pinned as whole stanzas,
# so `list` or `read` here, which would expose version history, fails.
@@ -2564,7 +2562,6 @@ let
s = baoGrantHere.systemd.services.swarm-bao-controller-policy.script;
in
lib.hasInfix "path \"secret/metadata/swarm/agents/+/matrix/+\" {\n capabilities = [\"delete\"]\n}" s
- && lib.hasInfix "path \"secret/metadata/swarm/agents/+/matrix-recovery/+\" {\n capabilities = [\"delete\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/agents/+/forge/+\" {\n capabilities = [\"delete\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/agents/+/gitlab/+\" {\n capabilities = [\"delete\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/agents/+/github-token\" {\n capabilities = [\"delete\"]\n}" s
diff --git a/swarm-controller/src/linked_accounts.rs b/swarm-controller/src/linked_accounts.rs
index 0cd0f0720..aa2c2ceb9 100644
--- a/swarm-controller/src/linked_accounts.rs
+++ b/swarm-controller/src/linked_accounts.rs
@@ -366,9 +366,6 @@ pub(crate) enum Removal {
Revoke(String),
/// The store refused or could not be reached.
Store(Error),
- /// The account is deleted, and the store refused or could not be reached
- /// when its key-backup passphrase was deleted.
- Recovery(Error),
}
impl Removal {
@@ -387,13 +384,6 @@ impl Removal {
),
),
Self::Store(e) => error_problem(StatusCode::INTERNAL_SERVER_ERROR, &e.to_string()),
- Self::Recovery(e) => error_problem(
- StatusCode::INTERNAL_SERVER_ERROR,
- &format!(
- "the account was deleted, but its key-backup passphrase was not: {e}; \
- delete the account again with revoke to finish"
- ),
- ),
}
}
}
@@ -421,64 +411,23 @@ async fn remove(store: &impl AccountStore, path: &str) -> Result<(), Removal> {
/// Delete the matrix account at `path`. With `revoke`, its token is first
/// handed to `revoke` with the stored homeserver, and the entry stays when that
/// fails.
-///
-/// `passphrase` is the account's key-backup passphrase, given on a revoking
-/// delete only: it goes last, once the account is gone, and a store that
-/// refuses is [`Removal::Recovery`]. A plain delete leaves it, so a relink
-/// finds the passphrase its backup was enabled with. An account already gone is
-/// not an error when `passphrase` is given, so a revoking delete that stopped
-/// at the passphrase can be sent again and finish.
async fn remove_matrix(
store: &impl AccountStore,
path: &str,
- passphrase: Option<&str>,
revoke: Option,
) -> Result<(), Removal>
where
F: FnOnce(String, String) -> Fut,
Fut: Future