Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A simple yet efficient Python AsyncIO rate limiter.
pip install asynciolimiter
# Limit to 10 requests per 5 second (equiv to 2 requests per second)
>>> limiter = asynciolimiter.Limiter(10/5)
>>> async def main():
... await limiter.wait() # Wait for a slot to be available.
... pass # do stuff
>>> limiter = Limiter(1/3)
>>> async def request():
... await limiter.wait()
... print("Request") # Do stuff
...
>>> async def main():
... # Schedule 1 request every 3 seconds.
... await asyncio.gather(*(request() for _ in range(10)))
Limiter
: Limits by requests per second and takes into account CPU heavy
tasks or other delays that can occur while the process is sleeping.LeakyBucketLimiter
: Limits by requests per second according to the
leaky bucket algorithm. Has a maximum capacity and an initial burst of
requests.StrictLimiter
: Limits by requests per second, without taking CPU or other
process sleeps into account. There are no bursts and the resulting rate will
always be a less than the set limit.Full documentation available on Read the Docs.
Licensed under the MIT License.
See contributing.md.
FAQs
Rate limiter for Async IO
We found that asynciolimiter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.