Skip to content

{client,config}: allow passing through additional httpx arguments #105

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

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

zane-zeroflucs
Copy link
Contributor

Does what it says on the tin.

Adds a httpx_args dict to Config, and a with_httpx_args() helper, which if specified multiple times will update the set of existing arguments. This is passed to the Client and AuthenticatedClient constructors.

Use case - using a HTTP proxy, e.g. httpx_args={'proxy': 'http://my-proxy:8080'}.

@CLAassistant
Copy link

CLAassistant commented Aug 26, 2024

CLA assistant check
All committers have signed the CLA.

@zane-zeroflucs
Copy link
Contributor Author

zane-zeroflucs commented Aug 26, 2024

I see CI is failing - presumably flake8 & tests
I also can't get them passing locally on a clean checkout.

@HarnessTheChaos
Copy link

HI! Thanks for this PR. We'll have @erdirowlands review when is is back from PTO and complete the testing. Is this blocking any issue that makes this more urgent? Thanks!

Matt
Product Team

@steve-gray
Copy link

We're just trying to get it all working inside a service we've migrated into an air-gapped network, so we'd appreciate it sooner rather than later - but can wait a while if needed. Our workaround is either a fork of the package or just dropping FF usage temporarily.

@@ -177,7 +177,7 @@ def authenticate(self):
verify = self._config.tls_trusted_cas_file

client = Client(base_url=self._config.base_url, verify_ssl=verify,
raise_on_unexpected_status=True)
raise_on_unexpected_status=True, httpx_args=self._config.httpx_args)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shorten line length to get CI passing for flake8

Suggested change
raise_on_unexpected_status=True, httpx_args=self._config.httpx_args)
raise_on_unexpected_status=True,
httpx_args=self._config.httpx_args)

Copy link
Contributor

Choose a reason for hiding this comment

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

I've gone ahead and merged this into a feature branch and I will make the change there.

@erdirowlands erdirowlands changed the base branch from main to FFM-11935 August 27, 2024 12:15
Copy link
Contributor

@erdirowlands erdirowlands left a comment

Choose a reason for hiding this comment

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

This looks great. I'm going to merge this into a feature branch which will make it easier for me to test + and follow our release process (docs/samples) etc. I'll do any required tidy up as required by our CI there as well.
I will then aim to get the changes released by the end of the day UK time all being well.

@erdirowlands erdirowlands merged commit bc0e1fb into harness:FFM-11935 Aug 27, 2024
1 check failed
erdirowlands added a commit that referenced this pull request Aug 27, 2024
* {client,config}: allow passing through additional httpx arguments (#105)

* FFM-11935 Fix line length for flake8 / Update docs and add sample.

* FFM-11935 Update docstring and flake8 formatting change

---------

Co-authored-by: Zane van Iperen <162071496+zane-zeroflucs@users.noreply.github.com>
@erdirowlands
Copy link
Contributor

Hi, just a heads up this feature has been released in 1.7.0

https://github.com/harness/ff-python-server-sdk/releases/tag/1.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy