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. |
Xuanwo
left a comment
There was a problem hiding this comment.
This PR looks good to me now!
|
cc @sylvestre, would you like to take another look? |
Co-authored-by: Sylvestre Ledru <[email protected]>
|
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
sccacheusers to write AWS policies to accept or rejectsccacherequests to an S3 bucket based on theirsccacheversion.The user agent header value is like
sccache/0.7.7.