Metadata-Version: 2.4
Name: jwt-signature-validator
Version: 0.2.0
Summary: An ASGI Middleware to sign payload using JWT
Author-email: Irfanuddin Shafi Ahmed <irfanudeen08@gmail.com>
License-Expression: MIT
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.128.0
Requires-Dist: pyjwt>=2.11.0
Description-Content-Type: text/markdown

<h1 align="center">
    <strong>JWT Signature Validator</strong>
</h1>
<p align="center">
    <a href="https://github.com/iudeen/jwt-signature-validator" target="_blank">
        <img src="https://img.shields.io/github/last-commit/iudeen/ASGIJWTSignatureValidatorMiddleware" alt="Latest Commit">
    </a>
        <img src="https://img.shields.io/github/workflow/status/iudeen/ASGIJWTSignatureValidatorMiddleware/CI">
        <img src="https://img.shields.io/codecov/c/github/iudeen/jwt-signature-validator">
    <br />
    <a href="https://pypi.org/project/jwt-signature-validator" target="_blank">
        <img src="https://img.shields.io/pypi/v/jwt-signature-validator" alt="Package version">
    </a>
    <img src="https://img.shields.io/pypi/pyversions/jwt-signature-validator">
    <img src="https://img.shields.io/github/license/iudeen/ASGIJWTSignatureValidatorMiddleware">
</p>

JWT Signature Middleware is a pure ASGI Middleware that can be used with AGSI frameworks like FastAPI, Starlette and Sanic.


## Installation

```bash
pip install jwt-signature-validator
```

## Usage

```python
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.
