FastAPI Tarpit
FastAPI middleware that purposely delays incoming connections on unused routes.
Definition of a tarpit from Wikipedia:
A tarpit is a service on a computer system (usually a server) that purposely delays incoming connections. The technique was developed as a defense against a computer worm, and the idea is that network abuses such as spamming or broad scanning are less effective, and therefore less attractive, if they take too long. The concept is analogous with a tar pit, in which animals can get bogged down and slowly sink under the surface, like in a swamp.
Installation
Install the package using pip:
pip install fastapi-tarpit
Usage
from fastapi import FastAPI
from fastapi_tarpit import HTTPTarpitMiddleware
app = FastAPI()
app.add_middleware(HTTPTarpitMiddleware)
@app.get("/foo")
async def foobar():
return {"foo": "bar"}
The code above triggers the tarpit on any other routes than /foo, and
routes related to docs.
Metadata
Release files for fastapi-tarpit 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastapi_tarpit-1.0.4.tar.gz | 4.8 kB | Without provenance | Details for fastapi_tarpit-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastapi_tarpit-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for fastapi_tarpit-1.0.4-py3-none-any.whl |
Total release size: 10.5 kB
Release files / fastapi_tarpit-1.0.4.tar.gz
| Download URL | fastapi_tarpit-1.0.4.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bb31ee39de55f2279e44956f2416332c27f1ab6ac3d47810d456a50c14fb363
|
|
BLAKE2b-256 checksum How to use checksums |
73bb193cf4b84f6ef91338a6c1d9c3af96c9448916bc45103e75ecef1d0e4a70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Release files / fastapi_tarpit-1.0.4-py3-none-any.whl
| Download URL | fastapi_tarpit-1.0.4-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00fac06d18c022a3b270207450a890d698566b21cbd2bc7142744ef2eed62b87
|
|
BLAKE2b-256 checksum How to use checksums |
e6206899bdd63397abce1c959086e138e06dfafa498caffe8e03ad1d1adfb6ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Security for fastapi-tarpit 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.