Skip to main content

An ASGI Middleware to get payload from JWTs

Project description

JWT Signature Validator

Latest Commit
Package version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jwt_signature_validator-0.0.3.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

jwt_signature_validator-0.0.3-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page