Flask-Heroku-Auth
A set of Flask Route decorators to enable either Session-Based Authentication via Heroku’s OAuth mechanism, or Basic Stateless Authentication via Heroku’s API Key facilities.
Installation
pip install flask-heroku-auth
Configuration
To enable regex routes within your application
from flask import Flask
from flask_heroku_auth import HerokuAuth
app = Flask(__name__)
HerokuAuth(app)
or
from flask import Flask
from flask_heroku_auth import HerokuAuth
auth = HerokuAuth()
def create_app():
app = Flask(__name__)
auth.init_app(app)
return app
From here, it is a matter of decorating the appropriate routes.
For example, the following would implement authentication via the Heroku OAuth facility
@app.route('/')
@auth.oauth
def index():
return "Ok"
On the other hand, you may wish to authenticate via the Heroku API Key facility. In this case, the credentials are sent through with every request as an ‘Authorization’ header
@app.route('/')
@auth.api
def index():
return "Ok"
You can also restrict access to a Heroku user who has an @heroku.com email address.
@app.route('/')
@auth.oauth
@auth.herokai_only
def index():
return "Ok"
History
0.0.5 (14/11/2012)
Introduced a template filter for the current user.
0.0.4 (1/11/2012)
Minor Tweaks.
0.0.3 (16/09/2012)
User field is now not required for sudo operations.
0.0.2 (24/08/2012)
Checking for ‘herokai_only’ now occurs only if the user is logged in.
0.0.1 (24/08/2012)
Conception
Initial Commit of Package to GitHub.
Metadata
Release files for Flask-Heroku-Auth 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Flask-Heroku-Auth-0.0.5.tar.gz | 5.9 kB | Without provenance | Details for Flask-Heroku-Auth-0.0.5.tar.gz |
Release files / Flask-Heroku-Auth-0.0.5.tar.gz
| Download URL | Flask-Heroku-Auth-0.0.5.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef8e6bb6d04ffe7bfdf8c3d915f9b43bf5a014ca2b54834e6d37919ad503bae6
|
|
BLAKE2b-256 checksum How to use checksums |
f26b158b0a0d6daf78aa4f1377ec7e53179f7c7c1e639a7de08fb672d208c9b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Flask-Heroku-Auth 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.