library to protect your fastapi applications
Project description
FastShield Web application firewall, easy to integration, fast to code
Installation
pip install fastshield
Example
- code with a simple
vulnerability
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastshield.middleware import FSHackMiddleware
app = FastAPI()
app.add_middleware(FSHackMiddleware) # security middleware
@app.get("/redirect_endpoint")
def read_root(redirect_url: str):
return HTMLResponse(
f"""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>xss hack test</title>
</head>
<body>
<script>window.location="{redirect_url}"</script>
</body>
</html>
"""
)
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
fastshield-0.0.5.tar.gz
(7.0 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastshield-0.0.5.tar.gz.
File metadata
- Download URL: fastshield-0.0.5.tar.gz
- Upload date:
- Size: 7.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96d7a24be8fc446ecd67966e165ead83d11e1df8421cc7b7b845e16bee3e2610
|
|
| MD5 |
7dc1d0ea8f7255f1f0536dc1e71d6616
|
|
| BLAKE2b-256 |
1814fdb00c5e3dd54c6f1e79cd3610586932366688fbbe29161ed8082b0cc473
|
File details
Details for the file fastshield-0.0.5-py3-none-any.whl.
File metadata
- Download URL: fastshield-0.0.5-py3-none-any.whl
- Upload date:
- Size: 7.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d60ac506629f9afa93970288220abc2d8445df6306306ee38cca2106dd7940ec
|
|
| MD5 |
5bd2dd67fb8ac01fce25e3fa4c3c60ac
|
|
| BLAKE2b-256 |
ffdbe5712af875f5a940e8c06299f500dd74dd0e4331de775ddb8c0c5593222a
|