Skip to main content

FastAPI middleware to redirect spam requests to a random 10 hours of video

Project description

GitHub Actions status Coverage PyPi Shield uv version Python Versions Shield License Shield

🍔 fastapi-spam

FastAPI middleware to redirect spam requests to a random 10 hours of video. Ported from django-spam (I'm the creator), which was inspired by this Nick Craver Tweet from 2018.

Installation

pip install fastapi-spam

Usage

Add the TenHoursOfRedirect middleware to your FastAPI app (or Starlette).

from fastapi import FastAPI

from fastapi_spam.middleware import TenHoursOfRedirect


app = FastAPI()

...

app.add_middleware(TenHoursOfRedirect)

Now, any time an intruder tries to access an endpoint in SPAM_ROUTES, they will be redirected to a random 10 hours of video...take that bots!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_spam-0.0.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_spam-0.0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_spam-0.0.2.tar.gz.

File metadata

  • Download URL: fastapi_spam-0.0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastapi_spam-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3bb9b3ddccc541a95c9465c0e4525ae3cb7226d4b22e41d440d285a68a61c5de
MD5 9ecffaef9bb3b598941b0fc2a3ae2b24
BLAKE2b-256 b4aa2f389db8202031a945d1427af9456c1ee749ecb31a8e85741f677ec213ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_spam-0.0.2.tar.gz:

Publisher: main.yaml on nickatnight/fastapi-spam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_spam-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: fastapi_spam-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastapi_spam-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 404782a427d642a1e8d045b8a583f71434d59694a30e4a11e19e7906ca1804ab
MD5 6941b7e79f2de940f032658d7fab29b9
BLAKE2b-256 6f391afa6a957801f91b572eb1fde1df575c5f6d851c444faab71a554acc5ed1

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_spam-0.0.2-py3-none-any.whl:

Publisher: main.yaml on nickatnight/fastapi-spam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page