-
Notifications
You must be signed in to change notification settings - Fork 552
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 User Agent Header for S3 Requests #2137
Conversation
Closes mozilla#2136. This PR configures the S3 backend to use a custom HTTP client which has a user agent header set. The user agent header enables `sccache` users to write AWS policies to accept or reject `sccache` requests to an S3 bucket based on their `sccache` version.
hmm. i'll have to fix this import issue. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2137 +/- ##
==========================================
- Coverage 30.91% 30.49% -0.42%
==========================================
Files 53 53
Lines 20112 20486 +374
Branches 9755 9954 +199
==========================================
+ Hits 6217 6248 +31
- Misses 7922 8189 +267
- Partials 5973 6049 +76 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good to me now!
cc @sylvestre, would you like to take another look? |
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
thanks |
@ajschmidt8 , just for note: do this really works in the prebuilt binary automatically (if you run the binary without |
rust's and Cargo sets these values at compile time. so they won't need to be defined externally. it will work in the prebuilt binary automatically. @AJIOB, just curious. do you intend to use this feature? if so, what's your use case? |
No, I just confused about backward compatibility with existing usages of S3 backend. |
Closes #2136.
This PR configures the S3 backend to use a custom HTTP client that has a user agent header set.
The user agent header enables
sccache
users to write AWS policies to accept or rejectsccache
requests to an S3 bucket based on theirsccache
version.The user agent header value is like
sccache/0.7.7
.