项目作者: ahopkins

项目描述 :
Authentication, JWT, and permission scoping for Sanic
高级语言: Python
项目地址: git://github.com/ahopkins/sanic-jwt.git
创建时间: 2017-08-06T11:06:22Z
项目社区:https://github.com/ahopkins/sanic-jwt

开源协议:MIT License

下载


Sanic JWT

Latest PyPI version
Python versions
Version status
MIT License

Build Status
Documentation
Codacy Badge
Test Coverage
Code style: black

Sanic JWT adds authentication protection and endpoints to Sanic.

It is both easy to get up and running, and extensible for the
developer. It can act to protect endpoints and also provide authentication scoping, all wrapped into a nice JWT.

Read the documentation | View the source code


What do I do?

It’s easy: (1) install, (2) initialize, and (3) authenticate.

Install:

  1. pip install sanic-jwt

Initialize:

  1. from sanic import Sanic
  2. from sanic_jwt import Initialize
  3. def my_authenticate(request, *args, **kwargs):
  4. ...
  5. app = Sanic()
  6. Initialize(
  7. app,
  8. authenticate=my_authenticate
  9. )

Authenticate:

  1. http://localhost/auth

Can I customize it?

Definitely! Sanic JWT is made to allow developers to customize the operation to fit their needs. Check out the documentation to learn how.