Keeps the instances an admin trusts or blocks for federated sign-in (federation_peers). Users of a trusted instance sign in here directly, those of a blocked one never do, and an instance on neither list is invite only. federation-service.ts reads it at each sign-in, /manage edits it through routes/federation.ts, and the login page offers the trusted ones.

Functions

f
getPeerStatus(issuer: string): PeerStatus | null

Returns what an admin decided about the instance at issuer, or null when it is on neither list.

f
listPeers(trustedOnly: boolean): FederationPeer[]

Returns the instances on the lists, by name: every one for /manage, or only the trusted ones, which the login page offers.

f
removePeer(host: string): void

Takes the instance whose host is host off the lists, for /manage: its users are invite only again, and those already here may sign in again if it was blocked.

f
setPeer(
instance: string,
status: PeerStatus
): Promise<FederationPeer>

Puts the instance instance names, by its API's address or its pages' (resolveIssuer), on the list of status, for /manage, and returns it. A trusted one must answer as a gerbeur instance, whose name is kept; a blocked one is blocked whether it answers or not, keeping the name it had. Blocking one ends the sessions of its users here at once: their tokens stop counting by getSessionState, and this closes their sockets.