https://github.com/rscarrera27/Sanic-JWT-Extended
⚡️An open source Sanic extension that provides "extended" JWT support
https://github.com/rscarrera27/Sanic-JWT-Extended
authentication authorization jwt jwt-authentication sanic
Last synced: 5 months ago
JSON representation
⚡️An open source Sanic extension that provides "extended" JWT support
- Host: GitHub
- URL: https://github.com/rscarrera27/Sanic-JWT-Extended
- Owner: rscarrera27
- License: mit
- Created: 2018-11-06T13:32:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T23:48:39.000Z (over 1 year ago)
- Last Synced: 2024-11-06T21:18:59.460Z (5 months ago)
- Topics: authentication, authorization, jwt, jwt-authentication, sanic
- Language: Python
- Homepage: https://sanic-jwt-extended.seonghyeon.dev
- Size: 276 KB
- Stars: 35
- Watchers: 1
- Forks: 8
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sanic - Sanic-JWT-Extended - jwt-extended, provides access/refresh token with fresh, easy custom claim insertion, and role-based access control (Extensions / Authentication)
README
🛡 Sanic-JWT-Extended 🛡
| | |
|:----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Buiild | [](https://github.com/NovemberOscar/Sanic-JWT-Extended/actions?query=workflow%3ATests) [](https://github.com/NovemberOscar/Sanic-JWT-Extended/actions?query=workflow%3A%22Upload+to+PyPI%22) [](https://app.netlify.com/sites/sanic-jwt-extended/deploys) |
| Quality | [](https://codecov.io/gh/NovemberOscar/Sanic-JWT-Extended) [](https://www.codacy.com/manual/NovemberOscar/Sanic-JWT-Extended?utm_source=github.com&utm_medium=referral&utm_content=NovemberOscar/Sanic-JWT-Extended&utm_campaign=Badge_Grade) [](https://codeclimate.com/github/NovemberOscar/Sanic-JWT-Extended/maintainability) |
| Package |    |
| Stats | [](https://pepy.tech/project/sanic-jwt-extended) [](https://pepy.tech/project/sanic-jwt-extended/month) |
| Community | [](https://gitter.im/Sanic-JWT-Extended/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) |> **☢️ This is README of 1.0 version. [Click here](https://github.com/NovemberOscar/Sanic-JWT-Extended/tree/v0.4.4) to checkout legacy version(v0.4.4)**
## 🚀 What is Sanic-JWT-Extended?
Sanic-JWT-Extended is an open source Sanic extension that provides JWT support (comply with RFC standard)## 💡 Why Sanic-JWT-Extended?
Sanic-JWT-Extended not only adds support for using JSON Web Tokens (JWT) to Sanic for protecting views,
but also many helpful (and **optional**) features built in to make working with JSON Web Tokens
easier. These include:* Support for adding public claims with [namespacing](https://auth0.com/docs/tokens/concepts/claims-namespacing)
* Support for adding private claims
* [Refresh tokens](https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/)
* Token freshness and separate view decorators to only allow fresh tokens
* Access control
* blacklist support with some built-in blacklist
* Provides Token object for easier jwt manifulation## ⚡️ Installation
```shell script
$ pip install sanic-jwt-extended --pre
```
```shell script
$ poetry add sanic-jwt-extended --git https://github.com/NovemberOscar/Sanic-JWT-Extended.git
```
```shell script
$ pipenv install sanic-jwt-extended --pre
```## 🛠 Developing Sanic-JWT-Extended
### Prerequesties
- [poetry](https://github.com/sdispater/poetry)### Installaion
```shell script
$ make env
```
this will install dependencies with poetry. if poetry not found, will install poetry.### Development
- `make format`: this will format your code with `isort` and `black`
- `make check`: this will lint your code with `isort`, `black`, `mypy` and `pylint`
- `make clean`: this will remove temporary things.### Commit Convention
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)### Testing
```shell script
$ make check # check convention and type
$ poetry run pytest
```with coverage:
```shell script
$ poetry run pytest --cov=sanic_jwt_extended tests/
```**Make sure you wrote TCs about your work!**