Unverified Commit 731e208b authored by Hong Minhee's avatar Hong Minhee
Browse files

`fedify inbox`: Embed actor to Delete(Application)

parent 3b55db22
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -11,6 +11,11 @@ To be released.
 -  Fixed a bug of `Object.toJsonLd()` method where it had incorrectly compacted
    the `name` property when it was not a language map.

 -  The `Delete(Application)` activities sent by the `fedify inbox` command now
    embed the entire actor object instead of just the actor's URI so that
    the peers can verify the actor's signature without fetching the actor
    object.


Version 1.0.1
-------------
+19 −12
Original line number Diff line number Diff line
@@ -194,18 +194,25 @@ async function acceptsFollowFrom(actor: Actor): Promise<boolean> {
const peers: Record<string, Actor> = {};

async function sendDeleteToPeers(server: TemporaryServer): Promise<void> {
  const ctx = federation.createContext(server.url, -1);
  const actorId = ctx.getActorUri("i");
  const ctx = federation.createContext(new Request(server.url), -1);
  const actor = (await ctx.getActor("i"))!;
  try {
    await ctx.sendActivity(
      { identifier: "i" },
      Object.values(peers),
      new Delete({
      id: new URL(`#delete`, actorId),
      actor: actorId,
        id: new URL(`#delete`, actor.id!),
        actor: actor.id!,
        to: PUBLIC_COLLECTION,
      object: actorId,
        object: actor,
      }),
    );
  } catch (error) {
    logger.error(
      "Failed to send Delete(Application) activities to peers:\n{error}",
      { error },
    );
  }
}

const followers: Record<string, Actor> = {};