Skip to content

Remove quote authorization adapters as Fedify adds options #54

Description

@dahlia

Background

#53 moved BotKit's FEP-044f code onto quoteInteraction from @fedify/interaction-controls, but most of the code it added is adapters that preserve BotKit's behavior where it differs from Fedify 2.4.0. I described them in fedify-dev/fedify#1206, along with the options that would make them unnecessary. Remove each adapter when Fedify ships the corresponding option, and keep those whose options don't land.

Implementation

The adapters live in packages/botkit/src/:

  • bot-impl.ts captures hasFollower() errors thrown inside matchesApprovalCollection and rethrows them after evaluatePolicy() (L1394–L1424). Replace this with Fedify's option to let callback errors propagate.
  • bot-impl.ts builds a fallback canQuote rule from the bot's quotePolicy, and evaluates each approval axis on a separate clone of the target, with two calls to evaluatePolicy() (L1380–L1428). With a fallback rule option and an automatic-first precedence option, this becomes a single call.
  • bot-impl.ts passes verifyRequest() a normalized clone of the request that fills in a missing attribution and prefers quote over a conflicting quoteUrl (L1273–L1292). Hackers' Pub requested a different lenient mode in Let interaction-controls callers tell transient failures from rejections fedify#1206 that still rejects missing attribution, so this adapter may shrink rather than disappear.
  • quote-authorization.ts checks the authorization ID before handing an object to verifyAuthorization() (L70–L94). An authorizationId option for objects would replace that check and might also make the custom verifyAuthenticity callback unnecessary.

Upgrade Fedify in both deno.json and the pnpm catalog first.

Verification

#53 added a test for each adapter in bot-impl.test.ts and quote-authorization.test.ts. Keep them passing with the same expected outcomes, and run mise run test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions