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

Allow providing a PSR-18 HTTP client (or just timeout controls?) #21

Open
Firehed opened this issue Aug 9, 2024 · 0 comments · May be fixed by #22
Open

Allow providing a PSR-18 HTTP client (or just timeout controls?) #21

Firehed opened this issue Aug 9, 2024 · 0 comments · May be fixed by #22
Labels
enhancement New feature or request

Comments

@Firehed
Copy link
Contributor

Firehed commented Aug 9, 2024

Besides making the library's own unit testing easier, this allows users to provide preconfigured clients. This is MOSTLY to support customizing timeouts, but could improve handling other network tweaks (such as proxies, buffering, DNS, etc)

This should NOT be a required parameter, and ideally is done in a way that adds no additional runtime dependencies. In practice, this also means that providing an HTTP Client also requires providing a RequestFactory and StreamFactory, to avoid ending up in a weird transitional situation

Areas of caution:

  • Allowing HTTP clients we don't directly control opens up the possibility of being given one that has insecure settings (such as SSL verification being disabled). The PSR interface doesn't provide a mechanism to detect and reject this.
  • Similarly, a misconfigured client could break authentication or transport options. This is mostly "on your own head be it", but does invite problems that are otherwise avoided
@Firehed Firehed added the enhancement New feature or request label Aug 9, 2024
@Firehed Firehed linked a pull request Aug 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant