Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set explicit User-Agent string when accessing S3 #1353

Closed
dmp42 opened this issue Jan 14, 2016 · 6 comments
Closed

Set explicit User-Agent string when accessing S3 #1353

dmp42 opened this issue Jan 14, 2016 · 6 comments

Comments

@dmp42
Copy link
Contributor

dmp42 commented Jan 14, 2016

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

@stevvooe
Copy link
Collaborator

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

@BrianBland
Copy link
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

@BrianBland
Copy link
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)

@stevvooe
Copy link
Collaborator

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

@RichardScothern
Copy link
Contributor

+1. Do it!

On Tue, Jan 19, 2016 at 3:56 PM, Stephen Day notifications@github.com
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)
.

@RichardScothern
Copy link
Contributor

Implemented.

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

No branches or pull requests

4 participants