https://github.com/iudeen/asgijwtsignaturevalidatormiddleware
https://github.com/iudeen/asgijwtsignaturevalidatormiddleware
fastapi hacktoberfest hacktoberfest2022 jwt middleware
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/iudeen/asgijwtsignaturevalidatormiddleware
- Owner: iudeen
- License: mit
- Created: 2022-07-13T10:56:29.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-11-13T20:53:30.000Z (7 months ago)
- Last Synced: 2025-11-13T22:24:25.052Z (7 months ago)
- Topics: fastapi, hacktoberfest, hacktoberfest2022, jwt, middleware
- Language: Python
- Homepage:
- Size: 71.3 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JWT Signature Validator
JWT Signature Middleware is a pure ASGI Middleware that can be used with AGSI frameworks like FastAPI, Starlette and Sanic.
## Installation
```bash
pip install jwt-signature-validator
```
## Usage
```python
from fastapi import FastAPI
from jwt_signature_validator import EncodedPayloadSignatureMiddleware
from pydantic import BaseModel
app = FastAPI()
app.add_middleware(
EncodedPayloadSignatureMiddleware,
jwt_secret="hello",
jwt_algorithms=["HS256"],
protect_hosts=["*"]
)
class Model(BaseModel):
text: str
@app.post("/")
def check(req: Model):
return req
```
## License
This project is licensed under the terms of the MIT license.