Skip to content

provide user-agent customization? #2611

@jku

Description

@jku

At some point we decided to not offer the ability to customize RequestsFetcher. The idea was that if someone wants to to customize, they can provide their own fetcher (possibly forking RequestsFetcher). In general this still seems reasonable.

There is one small customization I wish we had made easier: user-agent. It would be really useful for repository implementations to know which versions of which apps are connecting to the repository -- and it's a little much to expect apps to implement complete fetchers just to do that.

So maybe we should make extending the user-agent easier:

  • maybe add user-agent field to UpdaterConfig and forward the value to RequestsFetcher
  • alternatively make RequestsFetcher public and add an optional constructor argument user-agent

I think I like the first option more since it only increases the UpdaterConfig API (the downside is that only affects the default fetcher).

In both cases I think the argument should be added to the default user agent so you end up with MyApp/0.1 tuf/4.0.0 requests/1.2.3 in the repository logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions