Open flapili opened 1 year ago
I thinks it should be pretty easy to add this feature, I can submit a PR if needed (I'm just a bit rusted about testings, if 100% codecov is targeted I'll need onboarding / help 😅 )
Thanks for the thorough explanation of the motivation behind this request, @flapili! While we don't want to expose this type of config via the CLI, we think that exposing the ability to pass a full client object is a good idea for the reasons you listed.
First check
Prefect Version
2.x
Describe the current behavior
for now (https://github.com/PrefectHQ/prefect/blob/a334ec7626861fd07eb5c378c875943a806f7822/src/prefect/agent.py#L633) the prefect agent get a fresh client without passing any httpx settings
Describe the proposed behavior
allow the possibility to pass httpx settings to prefect Agent from code
Example Use
Additional context
I'm building an app which use prefect to schedule jobs and I would like to secure the api, I wrote a POC for the api: https://prefect-community.slack.com/archives/CL09KU1K7/p1681831679514849?thread_ts=1681818646.342989&cid=CL09KU1K7
but that mean I need to bypass the cli and handle the agent by myself, pretty simple according to https://github.com/PrefectHQ/prefect/blob/a334ec7626861fd07eb5c378c875943a806f7822/src/prefect/cli/agent.py#L164