-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add auth header support. #52
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,8 @@ func init() { | |
pflag.String("http-proto", "https", "Set to 'http' if necessary") | ||
pflag.String("http-user", "", "HTTP username for pulling the remote file") | ||
pflag.String("http-pass", "", "HTTP password for pulling the remote file") | ||
|
||
pflag.String("http-header-name", "", "HTTP header name") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Let's fill it with context. "HTTP header name for pulling the remote file" |
||
pflag.String("http-header-value", "", "HTTP header value") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Let's fill it with context. "HTTP header value for pulling the remote file" |
||
pflag.String("http-url", "", "Remote endpoint to retrieve the file from") | ||
pflag.String("http-checksum-url", "", "Remote endpoint to retrieve the checksum from") | ||
pflag.String("s3-arn", "", "Remote object ARN in S3 to retrieve") | ||
|
@@ -168,6 +169,8 @@ func getAnsibleRepository(runDir string) error { | |
downloader := httpDownloader{ | ||
username: viper.GetString("http-user"), | ||
password: viper.GetString("http-pass"), | ||
headerName: viper.GetString("http-header-name"), | ||
headerValue: viper.GetString("http-header-value"), | ||
} | ||
err = idempotentFileDownload(downloader, remoteHttpURL, checksumURL, localCacheFile) | ||
} else if s3Obj != "" { | ||
|
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.
Can we include the new fields in the test?