Skip to main content

An ASGI Middleware to sign payload using JWT

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.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jwt_signature_validator-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file jwt_signature_validator-0.2.0.tar.gz.

File metadata

  • Download URL: jwt_signature_validator-0.2.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for jwt_signature_validator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fce5a27d47af44751993cae7db62d7bac822c4193b56aee1af485a96b36a38f1
MD5 6facf92fbe98f14f0e160f34f610af55
BLAKE2b-256 bfd49d9cb8b5335e0e89bdd471434f0662cd7e549d333612529ff5a08eae39f5

See more details on using hashes here.

File details

Details for the file jwt_signature_validator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jwt_signature_validator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 349dae830539d0b5b9d1ddfc1e5e21cfa2167b813dd1f88a4155e35eff9770c0
MD5 56532436e26483f9f969d2a0c09bae90
BLAKE2b-256 b7e5d8ea5aac6508c06740346e6ac9242802c5e31dd8c32694ee9dd082b48daf

See more details on using hashes here.

Supported by

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