newsdev/nyt-pyiap

Name: nyt-pyiap

Owner: NYT Newsroom Developers

Description: A set of Python functions and middlewares for common frameworks for validating JWT tokens set by Google IAP.

Created: 2017-05-09 17:50:19.0

Updated: 2018-05-22 23:01:49.0

Pushed: 2018-05-01 19:53:25.0

Homepage: null

Size: 30

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NYT PyIAP

Validating JWT tokens from the Google Identity-Aware Proxy as middleware.

Install
install -e git+git@github.com:newsdev/nyt-pyiap.git
Usage
Django
Add to settings

Update your settings.py file to add the Django middleware.

LEWARE_CLASSES = [
.
yiap.django.VerifyJWTMiddleware',
.

The request object in views.py will have two new attributes added:

Flask

Update your Flask app.py to wrap your instantiated Flask() application's wsgi_app with the VerifyJWTMiddleware.

= Flask(__name__)
wsgi_app = VerifyJWTMiddleware(app.wsgi_app)

The request.environ object in app.py will have two new attributes added:

Contributing

TBD.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.