Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
async-healthcheck
is a compact asynchronous health check library built using only the Python standard library. It provides a simple way to monitor the health of your application by checking the status of various synchronous and asynchronous functions.
You can install async-healthcheck
directly from PyPI:
pip install async-healthcheck
Here is a basic usage example:
from async_healthcheck import start_healthcheck
def sync_check():
# Perform some synchronous health check (e.g., check database connection)
return True
async def async_check():
# Perform some asynchronous health check (e.g., check API availability)
return True
async def main():
server = await start_healthcheck(
sync_callables=[sync_check],
async_callables=[async_check],
host="127.0.0.1",
path="/healthcheck",
port=8000,
)
# The server is now running and can be accessed at http://127.0.0.1:8000/healthcheck
if __name__ == "__main__":
import asyncio
asyncio.run(main())
In this example, start_healthcheck
starts a health check server that runs the provided synchronous and asynchronous checks when a GET request is made to the specified path (default is /healthcheck
). If all checks pass, it returns a 200 status code; if any check fails, it returns a 500 status code.
Tests are located in the tests
directory and can be run using the standard Python unittest module:
PYTHONPATH="async_healthcheck" poetry run python -m unittest discover -s tests
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
A compact asynchronous healthcheck using only the standard library
We found that async-healthcheck 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.