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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d92dbb205d97e3d0ae87f0f428005db5ec5439a2b19cde5b73437c6ac18b28ee |
|
MD5 | f6f9d67e89ae2792345f1ce989ff6251 |
|
BLAKE2b-256 | 27891246f8c37da80eeca011eaca745d6284742363b698db25f806b4fd065b35 |
Close
Hashes for jwt_signature_validator-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e63249bd5bcc366c0ea041bb1575e4eef9a1771ec7ed788b753e6328ca3ba59 |
|
MD5 | 1c6339c7dc4225ccdd7878b30e6c34cb |
|
BLAKE2b-256 | 71239e65d2ea24688d0041428b79b9f0a7d8da850b902cd56355609909dd265a |