Skip to content
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

feat: add support for basic auth, insecure tls and headers #5061

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

ricardomaraschini
Copy link
Contributor

Description

add suport for basic auth, insecure tls and headers to the download package. this PR is part of an adr implementation that i plan to introduce gradually.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist:

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@ricardomaraschini ricardomaraschini requested a review from a team as a code owner October 1, 2024 17:43
@ricardomaraschini ricardomaraschini force-pushed the add-basic-auth-insecure-tls-and-headers branch from 2a0f2ef to effb5fb Compare October 1, 2024 17:56
// This is a one-shot HTTP client which should release resources immediately.
DisableKeepAlives: true,
},
transport := http.DefaultTransport.(*http.Transport).Clone()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a deliberate decision not to use the default transport here, as it defines a bunch of timeouts that make configuration difficult. I think for this simple use case the staleness timeout is all that's needed.

The only thing that's probably good to set here is ProxyFromEnvironment. I'd even say setting this here should actually be backported.

Copy link
Contributor Author

@ricardomaraschini ricardomaraschini Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the proxy issue I have opened #5064, once that is merged I can rebase this one and get rid of the Clone() call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that #5064 is merged I have rebased this to avoid cloning the default transport. Let me know what you think.

@ricardomaraschini ricardomaraschini force-pushed the add-basic-auth-insecure-tls-and-headers branch 2 times, most recently from a5b654a to e4abd28 Compare October 2, 2024 12:56
Copy link
Contributor

github-actions bot commented Oct 2, 2024

This pull request has merge conflicts that need to be resolved.

add suport for basic auth, insecure tls and headers to the download package.

Signed-off-by: Ricardo Maraschini <[email protected]>
@ricardomaraschini ricardomaraschini force-pushed the add-basic-auth-insecure-tls-and-headers branch from e4abd28 to 036aad8 Compare October 2, 2024 14:54
@twz123 twz123 added the chore label Oct 3, 2024
@ricardomaraschini ricardomaraschini merged commit 02974c2 into main Oct 3, 2024
90 checks passed
@ricardomaraschini ricardomaraschini deleted the add-basic-auth-insecure-tls-and-headers branch October 3, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants