Skip to content
Snippets Groups Projects
Commit 12e4da4e authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

pattern: introduce a verify_certs shortcut

This setting allows disabling HTTPS certificate verification, if needed.
parent d8909899
No related branches found
Tags v4.4.0
1 merge request!520Introduce timeouts and TLS verification override
......@@ -92,6 +92,7 @@ class Lister(Generic[StateType, PageType]):
record_batch_size: maximum number of records to flush to the scheduler at once.
connect_timeout: requests connection timeout in seconds.
read_timeout: requests read timeout in seconds.
verify_certs: whether to verify the TLS certificates in HTTPS requests.
requests_extra_kwargs: extra keyword arguments to pass to :mod:`requests` calls.
Generic types:
......@@ -118,6 +119,7 @@ class Lister(Generic[StateType, PageType]):
record_batch_size: int = 1000,
connect_timeout: float = 120,
read_timeout: float = 60,
verify_certs: bool = True,
requests_extra_kwargs: Dict[str, Any] = {},
):
if not self.LISTER_NAME:
......@@ -175,6 +177,8 @@ class Lister(Generic[StateType, PageType]):
self.enable_origins = enable_origins
self.record_batch_size = record_batch_size
self.requests_extra_kwargs = requests_extra_kwargs
if not verify_certs:
self.requests_extra_kwargs["verify"] = False
self.requests_extra_kwargs["timeout"] = (connect_timeout, read_timeout)
def build_url(self, instance: str) -> str:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment