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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_spam-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 f5ca474c12dda04267f335d13894e1eb98aec49acc7627d41328e75e2a369b78
MD5 3caf601d715eb2ba7d8ec245d9573614
BLAKE2b-256 e3132f578ab0adc2c1dacdeecb52d12c4753227455c424d20f3a8f649787d559

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: fastapi_spam-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 473cd9beb0c51be06c8905728208c91aa893012472a27f67d195f83020cb664f
MD5 9fcf906c1d840d70819fb1d4f1cdd89a
BLAKE2b-256 31427e38ba2f155ba3258d233b944b33553b737006aeb994792f4cafbcb8c40d

See more details on using hashes here.

Provenance

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