Skip to content

Implement HTTP Message Signatures (RFC 9421) #208

@dahlia

Description

According their recent announcement and the related issue on their issue tracker, Mastodon will be implementing HTTP Message Signatures (RFC 9421) in the next two minor versions (4.4 and 4.5). Since Mastodon is the most widely-used fediverse software, we need to implement RFC 9421 to maintain compatibility.

Background

  • Mastodon currently uses Cavage HTTP Signatures (draft-cavage-http-signatures-12)
  • In Mastodon 4.4, they will add support for validating RFC 9421 signatures
  • In Mastodon 4.5, they will start signing requests using RFC 9421

Implementation requirements

Double-knocking implementation

We need to implement double-knocking to maintain compatibility with servers using different HTTP signature versions:

  1. First attempt: Try RFC 9421 signature
  2. If rejected (HTTP 401): Fall back to Cavage HTTP Signatures
  3. Handle both signature verification methods for incoming requests

Core requirements

  1. Implement RFC 9421 signature verification
  2. Implement RFC 9421 signature generation
  3. Maintain backwards compatibility with Cavage HTTP Signatures for other fediverse software
  4. Add tests to verify correct signature generation and verification
  5. Update documentation to reflect the new signature support

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions