Skip to content

[IDEV-2437] enhancement: Add timeout parameter to dnsdb Client#12

Open
briluza wants to merge 2 commits into
nextfrom
IDEV-2437
Open

[IDEV-2437] enhancement: Add timeout parameter to dnsdb Client#12
briluza wants to merge 2 commits into
nextfrom
IDEV-2437

Conversation

@briluza

@briluza briluza commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Changes:

  • Added timeout parameter in the dnsdb client (requests library)
  • Added test cases
  • Update the README to include verify and timeout parameters in the Client docs.

Comment thread dnsdb2/client.py Outdated
proxies (Dict[str, str]): HTTP proxies to use. Mapping of protocol to URL.
insecure (bool): Skip https validation.
verify (str): Either a boolean, in which case it controls whether we verify the server’s TLS certificate, or a string, in which case it must be a path to a CA bundle to use.
timeout (float or tuple): Seconds to wait for the server before raising an error. Use a (connect_timeout, read_timeout) tuple to set them independently. None means no timeout.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Might want to be a little bit more precise because this sounds like a generic read timeout but AFAIK it's not; it's the time-to-first-read timeout.

So maybe, "Seconds to wait for server connect/initial read before raising an error."

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done.

Comment thread dnsdb2/client.py Outdated
swclient: str = DEFAULT_SWCLIENT, version: str = DEFAULT_VERSION,
proxies: Dict[str, str] = None, insecure: bool = False, verify: Union[str, bool, None] = None):
proxies: Dict[str, str] = None, insecure: bool = False, verify: Union[str, bool, None] = None,
timeout: Union[float, tuple, None] = None):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about tuple[float, float] for maximum precision?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

make sense, done updating the typehint

@shw700 shw700 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please change target branch to next

@briluza briluza changed the base branch from master to next June 16, 2026 17:17
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.

2 participants