<#18875 Add option to specify header in File targe...
# github-notifications
c
#18875 Add option to specify header in File target http request Issue created by picarro-abardales Is your feature request related to a problem? Please describe. I want to be able to specify a header in the http request in the File target. The header will be used to authenticate and download a resource, which would then be used in some test suite. Describe the solution you'd like I don't have strong opinions on how this should be done in the File target, but I do think that we want to read the secrets from an environment variable, or a .env file, or both. With curl, it would look something like
Copy code
curl --header "my-api-key:$(API_KEY)" <https://example.com/secure-resourece>
Describe alternatives you've considered I've thought of asking our ops people to remove authentication for the resource, i.e. working around the issue. I've also tried creating a custom shell command in Pants that runs the
curl
call and unpacks the data after downloading it. Additional context This will be used by my team to download some binary data that is used while running tests. The data in question is some sensor data that is produced by our instrument and we don't want it to be added to our code repository. pantsbuild/pants