mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
chore: add verify to Windmill python object for httpx (#2900)
* chore: add `verify` to Windmill python object for httpx * move it before get_client
This commit is contained in:
committed by
GitHub
parent
8056741f0c
commit
82d9238b35
@@ -23,7 +23,7 @@ JobStatus = Literal["RUNNING", "WAITING", "COMPLETED"]
|
||||
|
||||
|
||||
class Windmill:
|
||||
def __init__(self, base_url=None, token=None, workspace=None):
|
||||
def __init__(self, base_url=None, token=None, workspace=None, verify=True):
|
||||
base = base_url or os.environ.get("BASE_INTERNAL_URL")
|
||||
|
||||
self.base_url = f"{base}/api"
|
||||
@@ -32,6 +32,7 @@ class Windmill:
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {self.token}",
|
||||
}
|
||||
self.verify = verify
|
||||
self.client = self.get_client()
|
||||
self.workspace = workspace or os.environ.get("WM_WORKSPACE")
|
||||
self.path = os.environ.get("WM_JOB_PATH")
|
||||
@@ -42,6 +43,7 @@ class Windmill:
|
||||
return httpx.Client(
|
||||
base_url=self.base_url,
|
||||
headers=self.headers,
|
||||
verify=self.verify,
|
||||
)
|
||||
|
||||
def get(self, endpoint, raise_for_status=True, **kwargs) -> httpx.Response:
|
||||
|
||||
Reference in New Issue
Block a user