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.3.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.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_spam-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 23c9e13bd1d49bcb46ceb095233b49d38318bb4df63a91f3c8d09a49215740e3
MD5 8a7b4e9ef37e0b8ab5fc8ade5b95a3ad
BLAKE2b-256 9a03795e50892826c6ba3b5bdd3cbc4f335423c46f2ab9a1bc747bbb6041fe75

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_spam-0.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: fastapi_spam-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 65b31541d4af434c9c6f11e7d9f8deac0782a9bb64e548d20a7bf1b890508fdd
MD5 7a39971d729dee151755094571e8869e
BLAKE2b-256 560441dc1179682bcb179e97bff5f36c2b9a08806044075cf637ac2d7a38a14a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_spam-0.0.3-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