JWT library for fly
Project description
fly-jwt
fly-jwt is JWT library for fly.
Hello World
from fly import Fly
from fly_jwt import require_jwt, jwt_payload
app = Fly()
@require_jwt(
algorithm="HS256",
private_key="secret",
)
@app.get("/")
def hello(request):
# How to get a JWT payload
payload = jwt_payload(request)
return "Hello World"
client send request.
GET / HTTP1.1
.
.
.
Authorization: Bearer `JWT CONTENT`
if authentication successed, execute hello
function.
if authentication failed, return 401 response.
Dependency
-
fly
-
cryptography
-
PyJWT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fly_jwt-0.1.0.tar.gz
(4.3 kB
view hashes)