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 is awesome, but the documentation pages (Swagger or Redoc) all depend on external CDNs, which is problematic if you want to run on disconnected networks.
This package includes the required files from the CDN and serves them locally. It also provides a super-simple way to get a FastAPI instance configured to use those files.
Under the hood, this simply automates the process described in the official documentation here.
You can install this package from PyPi:
pip install fastapi-offline
Given the example from the FastAPI tutorial:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
Simply create a fastapi_offline.FastAPIOffline
object instead:
from fastapi_offline import FastAPIOffline
app = FastAPIOffline()
@app.get("/")
async def root():
return {"message": "Hello World"}
Any options passed to FastAPIOffline()
except docs_url
, redoc_url
, favicon_url
, and static_url
are passed through to FastAPI()
. docs_url
and redoc_url
are handled by fastapi-offline
, and use the same syntax as normal fastapi
library.
static_url
can be used to set the path for the static js/css files, e.g. static_url=/static-files
(default: /static-offline-docs
).
By default, the FastAPI favicon.png
is included and used as the shortcut icon on the docs pages. If you want to use a different one, you can specify it with the favicon_url
argument:
app = FastAPIOffline(
favicon_url="http://my.cool.site/favicon.png"
)
favicon.png
file is included in this package. The original license (MIT) and copyright apply to that file.FAQs
FastAPI without reliance on CDNs for docs
We found that fastapi-offline 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.