Skip to content
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

Implement an async mode #17

Closed
meeb opened this issue Nov 17, 2022 · 3 comments
Closed

Implement an async mode #17

meeb opened this issue Nov 17, 2022 · 3 comments

Comments

@meeb
Copy link
Owner

meeb commented Nov 17, 2022

As all remote interactions from whoisit are just basic HTTP requests, with the exception of the additional custom SSL handshake options, an interface should be added to expose an async mode. aiohttp would be a reasonably low overhead drop-in replacement for the current requests sessions. This would add an extra dependency on aiohttp and that aiohttp has compiled extensions so async mode would need to be opt-in to maintain pure Python support.

@MrPranav101
Copy link

@meeb I would like to work on a PR for this, is this something you would be interested in working on together/is this already being worked on?

@meeb
Copy link
Owner Author

meeb commented Jul 25, 2023

Thanks for the offer! You're welcome to attempt to work on a PR for this and I'm happy to accept any well formatted contributions. I've been bottle-necked with other work for some time. What I was planning on doing for this was use aiohttp as a drop-in for requests in https://github.com/meeb/whoisit/blob/main/whoisit/utils.py to provide async support, which is pretty straight forward.

The complication here is the requirement to support an optional decrease in SSL cipher suite strength to accommodate some of the more esoteric and legacy RDAP endpoints that exist (support for the allow_insecure=True whoisit argument).

Most of the time for this issue is going to be spent on regression testing, test suites and reading into the internals of aiohttp rather than just switching out requests.get(...) for async aiohttp_session.get(...).

From memory I believe this is going to be replacing the requests HTTPAdapter with an aiohttp TCPConnector with a custom SSL context. This also requires creating the SSL context without using the create_urllib3_context(...) wrapper as urllib3 would be dropped when aiohttp is switched in.

@meeb
Copy link
Owner Author

meeb commented Jul 27, 2024

Thanks to @sam-kleiner this is now implemented in the new v3.0.0 release.

@meeb meeb closed this as completed Jul 27, 2024
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

No branches or pull requests

2 participants