Skip to content

Conversation

@AkshatM
Copy link
Contributor

@AkshatM AkshatM commented Oct 22, 2025

  • Simplify interface: concentrate into lookup_component method

    This change removes the following constructs:

    1. WebBotAuthSignedMessage
    2. SignedMessage::fetch_all_signature_headers
    3. SignedMessage::fetch_all_signature_inputs

    and modifies the lookup_component method to be the primary source of
    information about a message. The goal here is to make it possible to
    treat all HTTP headers, including special ones like Signature-Agent,
    etc. on the same footing. It also removes a source of complexity for
    implementors, since they would need to maintain an independent method
    just to fetch special values.

  • Add support for parsing Signature-Agent as an sfv::Dictionary

    This change supports handling Signature-Agent as either an
    sfv::Dictionary or an sfv::Item. To decide which way to process, it
    relies on whether or not the Signature-Agent header listed in the
    Signature-Input field has an associated key parameter. If present,
    it attempts to parse as a dictionary.

    I've added tests to ensure both types can be handled perfectly well.

This change removes the following constructs:

1. `WebBotAuthSignedMessage`
2. `SignedMessage::fetch_all_signature_headers`
3. `SignedMessage::fetch_all_signature_inputs`

and modifies the `lookup_component` method to be the primary source of
information about a message. The goal here is to make it possible to
treat all HTTP headers, including special ones like `Signature-Agent`,
etc. on the same footing. It also removes a source of complexity for
implementors, since they would need to maintain an independent method
just to fetch special values.
@AkshatM AkshatM requested a review from thibmeu October 22, 2025 03:36
@AkshatM AkshatM self-assigned this Oct 22, 2025
@AkshatM AkshatM changed the title Signature agent as sfv dictionary Add support for parsing Signature-Agent as sfv::Dictionary + simplify library Oct 22, 2025
Copy link
Collaborator

@thibmeu thibmeu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good. let's ensure we don't publish the crate yet, there will be some changes.

nits on the example file: would be good to have the origin of the key to make sure it's not used in prod

This change supports handling Signature-Agent as either an
sfv::Dictionary or an sfv::Item. To decide which way to process, it
relies on whether or not the `Signature-Agent` header listed in the
`Signature-Input` field has an associated `key` parameter. If present,
it attempts to parse as a dictionary.

I've added tests to ensure both types can be handled perfectly well.
@AkshatM AkshatM force-pushed the signature_agent_as_sfv_dictionary branch from 6277dee to 5dca4c0 Compare October 22, 2025 14:49
@AkshatM AkshatM merged commit 8ba0c4a into main Oct 22, 2025
9 checks passed
@AkshatM AkshatM deleted the signature_agent_as_sfv_dictionary branch October 22, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants