An ASGI Middleware to sign payload using JWT
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fce5a27d47af44751993cae7db62d7bac822c4193b56aee1af485a96b36a38f1
|
|
| MD5 |
6facf92fbe98f14f0e160f34f610af55
|
|
| BLAKE2b-256 |
bfd49d9cb8b5335e0e89bdd471434f0662cd7e549d333612529ff5a08eae39f5
|
File details
Details for the file jwt_signature_validator-0.2.0-py3-none-any.whl.
File metadata
- Download URL: jwt_signature_validator-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
349dae830539d0b5b9d1ddfc1e5e21cfa2167b813dd1f88a4155e35eff9770c0
|
|
| MD5 |
56532436e26483f9f969d2a0c09bae90
|
|
| BLAKE2b-256 |
b7e5d8ea5aac6508c06740346e6ac9242802c5e31dd8c32694ee9dd082b48daf
|