Skip to main content

JWT library for fly

Project description

fly-jwt

Test

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


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)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page