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.
fastapi-route-logger-middleware
Advanced tools
Simple middleware for FastAPI to generate log entries on all requests
Basic middleware to log requests made to routes in FastAPI applications.
pip install fastapi-route-logger-middleware
The component is FastAPI middleware.
app.add_middleware(RouteLoggerMiddleware)
Additional arguments can be provided, when needed:
logger
- The Logger instance to use. Defaults to the default logger (logging.getLogger(__name__)
).skip_routes
- A list of strings that represent the start of routes that should not be logged. Default is an empty
list. This is a "begins with" type match so an entry of "/health"
will block the routes /health/check
and /healthcheck
.skip_regexes
- A list of regex strings that will be matched against routes that should not be logged. Default is an empty
list. This uses compiled regexes and matches against the entire path. An entry of ".*/health"
will not log the routes /health
and /api/1.0/health
.The sample-site in the code repository contains a sample FastAPI site with this middleware integrated. Check the included readme for more information.
FAQs
Simple middleware for FastAPI to generate log entries on all requests
We found that fastapi-route-logger-middleware 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.