Skip to content

Parse Accept-Signature on the client side #170

Closed

Description

@rosylilly

Use case

When a server answers a request from my ActivityPub server (mycroblog/my) with a 401 and Accept-Signature, the server signs again with the requested components, label, tag, and nonce. httpsig can build Accept-Signature with AcceptSignatureBuilder but can't parse it, so I parse it myself with httpsfv.

Possible shape

func ParseAcceptSignature(header http.Header) ([]SignatureRequest, error)

SignatureRequest would hold Label, Components (in the form WithComponents accepts), KeyID, Algorithm, Tag, Nonce, Created and Expires (both bool), and Extensions (SignatureParameters).

This differs from the shape in my PR comment. created and expires are booleans in a request, so they don't fit the Created() and Expires() accessors of SignatureParameters.

signatureRequirements.fromInnerList looks like a good base. It currently rejects unknown parameters, though, while WithParameter can add them to a request.

I'm happy to open a PR if you'd like this.

Activity

  1. dadrus commented on Nov 4, 2026

    @dadrus
    Owner

    Thanks for the FR, @rosylilly! That makes a lot of sense.

    One thought: should ParseAcceptSignature accept a *Message rather than http.Header? I'm trying to keep httpsig framework-agnostic, and Message is the abstraction for that. Just thinking out loud here.

    Other than that, go for it! Looking forward to your PR. I'd suggest basing it on #166, since it already contains the relevant API changes. Once #166 is merged, you can rebase onto main. That should save you some merge work.

  2. rosylilly commented on Nov 5, 2026

    @rosylilly
    ContributorAuthor

    @dadrus I've opened #176. Please review it. I'd appreciate your feedback.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions