v4: federated sign-in closes the holes a review found — a callback link made from someone else's sign-in signed the visitor in to that account, a password reset left the user's sessions on other instances open, and events could be lost, reordered or delayed. FederatedSignIn keeps the sign-in's state in sessionStorage (utils/auth/federation.ts) and FederationCallback finishes only a sign-in this tab started. A password reset tells the instances the user signed in to, as a change does. The outbox delivers each instance's events in the order they were made, the first that fails holding back the rest, so a late older update no longer undoes a newer one, and delivers to every instance at once, so a dead one delays none of the others; an event queued during a run is sent by it.

Receiving, a home's keys that can't be fetched answer 502, which the sender retries, instead of 401, which it dropped; a bad update answers 400 rather than 502; a blocked instance's events answer 403; events are limited to a burst of 120 per instance, and a token naming an unknown key refetches the keys at most once a minute. An avatar must be on its issuer's origin, and its URL is versioned by its file's write time instead of updatedAt, so a profile edit no longer makes clients download it again. An instance that doesn't answer can be blocked, keeping its name, though not trusted.

303 backend tests and 703 frontend tests pass, the federation tests 8 times in a row, and deno check, tsc, eslint, doc:lint and i18n:compile --strict are clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
khannurien
2026-10-09 16:05:11 +00:00
parent c77e173767
commit 66e402bd91
19 changed files with 447 additions and 128 deletions

File diff suppressed because one or more lines are too long

View File

@@ -391,7 +391,7 @@ msgstr "Auto"
msgid "Back to login"
msgstr "Back to login"
#: src/pages/FederationCallback.tsx:66
#: src/pages/FederationCallback.tsx:71
msgid "Back to the login page"
msgstr "Back to the login page"
@@ -545,7 +545,7 @@ msgstr "Community"
msgid "Confirm new password"
msgstr "Confirm new password"
#: src/components/federation/FederatedSignIn.tsx:111
#: src/components/federation/FederatedSignIn.tsx:113
msgid "Connecting…"
msgstr "Connecting…"
@@ -553,7 +553,7 @@ msgstr "Connecting…"
msgid "Connection lost — this message may not have been sent"
msgstr "Connection lost — this message may not have been sent"
#: src/components/federation/FederatedSignIn.tsx:113
#: src/components/federation/FederatedSignIn.tsx:115
msgid "Continue"
msgstr "Continue"
@@ -602,7 +602,7 @@ msgstr "Couldn't load a preview for this link — check it, or post it as-is and
msgid "Couldn't load the chat."
msgstr "Couldn't load the chat."
#: src/components/federation/FederatedSignIn.tsx:102
#: src/components/federation/FederatedSignIn.tsx:104
msgid "Couldn't reach that instance"
msgstr "Couldn't reach that instance"
@@ -1066,7 +1066,7 @@ msgstr "invited by you"
msgid "Invitees"
msgstr "Invitees"
#: src/components/federation/FederatedSignIn.tsx:105
#: src/components/federation/FederatedSignIn.tsx:107
msgid "Its address, like music.example"
msgstr "Its address, like music.example"
@@ -1155,7 +1155,7 @@ msgid "Loading…"
msgstr "Loading…"
#: src/components/layout/AppHeader.tsx:208
#: src/pages/FederationCallback.tsx:31
#: src/pages/FederationCallback.tsx:32
#: src/pages/UserLogin.tsx:44
#: src/pages/UserLogin.tsx:71
#: src/pages/UserLogin.tsx:90
@@ -1171,7 +1171,7 @@ msgid "Log in to vote"
msgstr "Log in to vote"
#. placeholder {0}: peer.name ?? peer.host
#: src/components/federation/FederatedSignIn.tsx:97
#: src/components/federation/FederatedSignIn.tsx:99
msgid "Log in with {0}"
msgstr "Log in with {0}"
@@ -1184,7 +1184,7 @@ msgstr "Log out"
msgid "Logging in…"
msgstr "Logging in…"
#: src/pages/FederationCallback.tsx:63
#: src/pages/FederationCallback.tsx:68
#: src/pages/UserLogin.tsx:76
msgid "Login failed"
msgstr "Login failed"
@@ -1390,11 +1390,11 @@ msgstr "Open the chat"
msgid "or <0>browse files</0>"
msgstr "or <0>browse files</0>"
#: src/components/federation/FederatedSignIn.tsx:82
#: src/components/federation/FederatedSignIn.tsx:84
msgid "Or join with your account on another gerbeur"
msgstr "Or join with your account on another gerbeur"
#: src/components/federation/FederatedSignIn.tsx:83
#: src/components/federation/FederatedSignIn.tsx:85
msgid "Or log in with your account on another gerbeur"
msgstr "Or log in with your account on another gerbeur"
@@ -1730,7 +1730,7 @@ msgid "Sign in to {name}?"
msgstr "Sign in to {name}?"
#: src/pages/Authorize.tsx:154
#: src/pages/FederationCallback.tsx:73
#: src/pages/FederationCallback.tsx:78
msgid "Signing you in…"
msgstr "Signing you in…"
@@ -1838,10 +1838,14 @@ msgstr "This page does not exist."
msgid "This reset link is missing or malformed."
msgstr "This reset link is missing or malformed."
#: src/pages/FederationCallback.tsx:38
#: src/pages/FederationCallback.tsx:39
msgid "This sign-in link is incomplete."
msgstr "This sign-in link is incomplete."
#: src/pages/FederationCallback.tsx:47
msgid "This sign-in was started elsewhere. Start again from the login page."
msgstr "This sign-in was started elsewhere. Start again from the login page."
#: src/pages/Settings.tsx:201
msgid "This site doesn't send email, so no digest goes out."
msgstr "This site doesn't send email, so no digest goes out."

File diff suppressed because one or more lines are too long

View File

@@ -391,7 +391,7 @@ msgstr "Auto"
msgid "Back to login"
msgstr "Retour à la connexion"
#: src/pages/FederationCallback.tsx:66
#: src/pages/FederationCallback.tsx:71
msgid "Back to the login page"
msgstr "Retour à la page de connexion"
@@ -545,7 +545,7 @@ msgstr "Communauté"
msgid "Confirm new password"
msgstr "Confirmer le nouveau mot de passe"
#: src/components/federation/FederatedSignIn.tsx:111
#: src/components/federation/FederatedSignIn.tsx:113
msgid "Connecting…"
msgstr "Connexion…"
@@ -553,7 +553,7 @@ msgstr "Connexion…"
msgid "Connection lost — this message may not have been sent"
msgstr "Connexion perdue — ce message n'a peut-être pas été envoyé"
#: src/components/federation/FederatedSignIn.tsx:113
#: src/components/federation/FederatedSignIn.tsx:115
msgid "Continue"
msgstr "Continuer"
@@ -602,7 +602,7 @@ msgstr "Impossible de charger un aperçu pour ce lien — vérifiez-le, ou publi
msgid "Couldn't load the chat."
msgstr "Impossible de charger le chat."
#: src/components/federation/FederatedSignIn.tsx:102
#: src/components/federation/FederatedSignIn.tsx:104
msgid "Couldn't reach that instance"
msgstr "Impossible de joindre cette instance"
@@ -1066,7 +1066,7 @@ msgstr "sur votre invitation"
msgid "Invitees"
msgstr "Invités"
#: src/components/federation/FederatedSignIn.tsx:105
#: src/components/federation/FederatedSignIn.tsx:107
msgid "Its address, like music.example"
msgstr "Son adresse, comme music.example"
@@ -1155,7 +1155,7 @@ msgid "Loading…"
msgstr "Chargement…"
#: src/components/layout/AppHeader.tsx:208
#: src/pages/FederationCallback.tsx:31
#: src/pages/FederationCallback.tsx:32
#: src/pages/UserLogin.tsx:44
#: src/pages/UserLogin.tsx:71
#: src/pages/UserLogin.tsx:90
@@ -1171,7 +1171,7 @@ msgid "Log in to vote"
msgstr "Se connecter pour voter"
#. placeholder {0}: peer.name ?? peer.host
#: src/components/federation/FederatedSignIn.tsx:97
#: src/components/federation/FederatedSignIn.tsx:99
msgid "Log in with {0}"
msgstr "Se connecter avec {0}"
@@ -1184,7 +1184,7 @@ msgstr "Se déconnecter"
msgid "Logging in…"
msgstr "Connexion…"
#: src/pages/FederationCallback.tsx:63
#: src/pages/FederationCallback.tsx:68
#: src/pages/UserLogin.tsx:76
msgid "Login failed"
msgstr "Connexion échouée"
@@ -1390,11 +1390,11 @@ msgstr "Ouvrir la tribune"
msgid "or <0>browse files</0>"
msgstr "ou <0>parcourir les fichiers</0>"
#: src/components/federation/FederatedSignIn.tsx:82
#: src/components/federation/FederatedSignIn.tsx:84
msgid "Or join with your account on another gerbeur"
msgstr "Ou rejoignez-nous avec votre compte d'un autre gerbeur"
#: src/components/federation/FederatedSignIn.tsx:83
#: src/components/federation/FederatedSignIn.tsx:85
msgid "Or log in with your account on another gerbeur"
msgstr "Ou connectez-vous avec votre compte d'un autre gerbeur"
@@ -1730,7 +1730,7 @@ msgid "Sign in to {name}?"
msgstr "Se connecter à {name} ?"
#: src/pages/Authorize.tsx:154
#: src/pages/FederationCallback.tsx:73
#: src/pages/FederationCallback.tsx:78
msgid "Signing you in…"
msgstr "Connexion…"
@@ -1838,10 +1838,14 @@ msgstr "Rien à voir, circulez."
msgid "This reset link is missing or malformed."
msgstr "Ce lien de réinitialisation est absent ou malformé."
#: src/pages/FederationCallback.tsx:38
#: src/pages/FederationCallback.tsx:39
msgid "This sign-in link is incomplete."
msgstr "Ce lien de connexion est incomplet."
#: src/pages/FederationCallback.tsx:47
msgid "This sign-in was started elsewhere. Start again from the login page."
msgstr "Cette connexion a été commencée ailleurs. Recommencez depuis la page de connexion."
#: src/pages/Settings.tsx:201
msgid "This site doesn't send email, so no digest goes out."
msgstr "Ce site n'envoie pas d'e-mails, aucun résumé ne part donc."