Skip to content

Set explicit User-Agent string when accessing S3 #1353

Closed

Description

@dmp42

Using a distinctive UA string containing the registry version + go version would help debugging (distinguish registry queries from other systems accessing the bucket).

That UA string should be set only for the registry, and not for distribution as a library.

cc @RichardScothern

Activity

  1. stevvooe commented on Jan 14, 2016

    @stevvooe
    Collaborator

    @dmp42 So, this should be set in the S3 library?

  2. BrianBland commented on Jan 14, 2016

    @BrianBland
    Contributor

    Yeah, I'm trying to see if there's any extensible way to modify the S3 client through the goamz library that would enable a change like this, would have to modify the http Client/Transport found here: https://github.com/AdRoll/goamz/blob/master/s3/s3.go#L1165

  3. BrianBland commented on Jan 14, 2016

    @BrianBland
    Contributor

    Read over the v4 auth documentation and only the Host, Content-Type and any x-amz-* headers need to be signed, so changing other headers at the final transport wouldn't break signatures. I'd suggest adding something akin to our client RequestModifier, or at least HeaderModifier (https://github.com/docker/distribution/blob/master/registry/client/transport/transport.go#L11), but interestingly enough the official http.RoundTripper docs suggest that RoundTrip should not modify the request (https://golang.org/pkg/net/http/#RoundTripper)

  4. stevvooe commented on Jan 19, 2016

    @stevvooe
    Collaborator

    @BrianBland The only way to fix this would probably to refactor goamz to allow injection of an http.Client.

  5. RichardScothern commented on Jan 20, 2016

    @RichardScothern

    +1. Do it!

    On Tue, Jan 19, 2016 at 3:56 PM, Stephen Day [email protected]
    wrote:

    @BrianBland https://github.com/BrianBland The only way to fix this
    would probably to refactor goamz to allow injection of an http.Client.

    —
    Reply to this email directly or view it on GitHub
    #1353 (comment)
    .

  6. added this to the Registry/2.4 milestone on Jan 21, 2016
  7. RichardScothern commented on Apr 4, 2016

    @RichardScothern

    Implemented.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions