MCPcopy Index your code
hub / github.com/ahopkins/sanic-jwt

github.com/ahopkins/sanic-jwt @v1.8.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.8.0 ↗ · + Follow
935 symbols 2,606 edges 81 files 34 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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:

pip install sanic-jwt

Initialize:

from sanic import Sanic
from sanic_jwt import Initialize

def my_authenticate(request, *args, **kwargs):
    ...

app = Sanic()
Initialize(
    app,
    authenticate=my_authenticate
)

Authenticate:

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.

Core symbols most depended-on inside this repo

update
called by 71
sanic_jwt/configuration.py
get
called by 68
example/cbv.py
validate_single_scope
called by 21
sanic_jwt/validators.py
get
called by 21
sanic_jwt/endpoints.py
initialize
called by 15
sanic_jwt/initialization.py
_get_url_prefix
called by 9
sanic_jwt/initialization.py
extract_payload
called by 7
sanic_jwt/authentication.py
_get_algorithm
called by 5
sanic_jwt/authentication.py

Shape

Function 422
Method 310
Class 117
Route 86

Languages

Python100%

Modules by API surface

tests/test_endpoints_scoped.py62 symbols
sanic_jwt/exceptions.py50 symbols
tests/conftest.py40 symbols
sanic_jwt/authentication.py37 symbols
tests/test_initialize.py30 symbols
tests/test_configuration.py29 symbols
sanic_jwt/configuration.py27 symbols
tests/test_decorators.py26 symbols
example/scopes.py26 symbols
tests/test_endpoints_jwt_cryptography.py25 symbols
example/custom_authentication_cls_complex.py24 symbols
tests/test_endpoints_cookies.py22 symbols

For agents

$ claude mcp add sanic-jwt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact