mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(federation): 🔥 Remove old code and simplify federation requests
This commit is contained in:
parent
ad9ed2598c
commit
2f823317c2
18 changed files with 182 additions and 302 deletions
|
|
@ -1,8 +1,4 @@
|
|||
import { parseUserAddress, userAddressValidator } from "@/api";
|
||||
import {
|
||||
FederationRequester,
|
||||
SignatureConstructor,
|
||||
} from "@lysand-org/federation";
|
||||
import { Args } from "@oclif/core";
|
||||
import chalk from "chalk";
|
||||
import ora from "ora";
|
||||
|
|
@ -47,11 +43,7 @@ export default class FederationUserFetch extends BaseCommand<
|
|||
|
||||
const requester = await User.getServerActor();
|
||||
|
||||
const signatureConstructor = await SignatureConstructor.fromStringKey(
|
||||
requester.data.privateKey ?? "",
|
||||
requester.getUri(),
|
||||
);
|
||||
const manager = new FederationRequester(signatureConstructor);
|
||||
const manager = await requester.getFederationRequester();
|
||||
|
||||
const uri = await User.webFinger(manager, username, host);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
import { parseUserAddress, userAddressValidator } from "@/api";
|
||||
import {
|
||||
FederationRequester,
|
||||
SignatureConstructor,
|
||||
} from "@lysand-org/federation";
|
||||
import { Args } from "@oclif/core";
|
||||
import chalk from "chalk";
|
||||
import ora from "ora";
|
||||
|
|
@ -47,11 +43,7 @@ export default class FederationUserFinger extends BaseCommand<
|
|||
|
||||
const requester = await User.getServerActor();
|
||||
|
||||
const signatureConstructor = await SignatureConstructor.fromStringKey(
|
||||
requester.data.privateKey ?? "",
|
||||
requester.getUri(),
|
||||
);
|
||||
const manager = new FederationRequester(signatureConstructor);
|
||||
const manager = await requester.getFederationRequester();
|
||||
|
||||
const uri = await User.webFinger(manager, username, host);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue