JSR

Registers a callback for incoming activities whose HTTP signatures could not be verified.

The regular inbox listeners registered through on continue to receive only verified activities. This hook is an opt-in escape hatch for applications that need to inspect unverified deliveries and optionally override the default 401 Unauthorized response.

Examples

Example 1

federation
  .setInboxListeners("/users/{identifier}/inbox", "/inbox")
  .onUnverifiedActivity((ctx, activity, reason) => {
    if (
      reason.type === "keyFetchError" &&
      "status" in reason.result &&
      reason.result.status === 410
    ) {
      return new Response(null, { status: 202 });
    }
  });

Parameters

A callback to handle an unverified activity.

Return Type

The setters object so that settings can be chained.

Read the original on jsr.io ↗