function setPeer
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.

Parameters

instance: string
status: PeerStatus

Return Type

Promise<FederationPeer>

Throws

APIException

400 when instance names no instance, or this one, 502 when an instance to trust doesn't answer as a gerbeur instance.

Usage

import { setPeer } from "api/services/federation-peer-service.ts";