-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[FEATURE REQUEST] file.managed / cp.cache_file - support for headers for http(s) urls #61052
Comments
Seconding this; surprised this isn't implemented already. This is also a necessity for e.g. using token auth to Vault to fetch an internal CA chain (which cannot be done via the quite limited Vault module). |
Same, this would be very useful |
This would be useful for using nexus as well. |
+1 I stumbled upon this feature request while researching how to auth to https servers using file.managed. |
Would love to use this as well. If someone hints me a bit in the direction where I can find the important pieces in the code, I'd be pleased to implement it. |
I also want to +1 this. I'm here because I have a server that won't let |
… will not return data when there is no Accept header. And unfortunately salt.utils.http.query does not set an Accept header. So file.managed can't download the albert key file.
Is your feature request related to a problem? Please describe.
It would be extremely useful to be able to pass headers / auth information when using file.managed states. Certain file downloads are secured behind rest apis or basic auth.
Describe the solution you'd like
Similar to what was proposed here: #40537 (comment). Having the ability to pass additional args to the http(s) servers when using the source variable.
arg options should include the ability to set request type (GET), headers including content types, auth params (user/password)
Describe alternatives you've considered
Using cmd.run to do a curl with the required args. Which is not exactly a great use-case and makes it harder to trigger follow on tasks if the file is changed. eg: https://stackoverflow.com/questions/31504258/using-file-managed-for-downloading-a-file-in-salt
Additional context
Example uses.
downloading private builds from gitlab/github via the api which requires header auth
The text was updated successfully, but these errors were encountered: