An ASGI Middleware to get payload from JWTs
Project description
JWT Signature Validator
JWT Signature Middleware is a pure ASGI Middleware that can be used with AGSI frameworks like FastAPI, Starlette and Sanic.
Installation
pip install jwt-signature-validator
Usage
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for jwt_signature_validator-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4613d76fedcd71dfbad2ee50aaadc07b4fe82ad8193aef84df61d033f4fa8fb |
|
MD5 | 631fa0ce64ed8aa2378f82a1bf07fbc3 |
|
BLAKE2b-256 | 66c067f9c5879865545da3a3f9bbfae7338bdf9a0a0d9c7451123f5731f778bf |
Close
Hashes for jwt_signature_validator-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04a234bfc698d6cf15213ad1b610e41c2beafce32445e594fa1943130294e895 |
|
MD5 | f1a447137fd28c727b8007a60b67ff65 |
|
BLAKE2b-256 | b8d55a7af8656fe771f145bc8c2d7b434f62bd8e5946562254a178fb147e474c |