Flask Authorization for Pandas!
Project description
**Flask-Authorization-Panda is a Flask extension that provides decorators
for various authentication methods for RESTful web services.
Currently, only HTTP Basic Authentication is supported. **
Usage
-----
>>> from flask.ext.flask_authorization_panda import basic_auth
During app initialization, store your required username/password in
the config attribute::
app = Flask(__name__)
app.config['basic_auth_credentials'] = dict(username='admin',
password='secret')
Finally, simple apply the @basic_auth decorator to methods which you
want to require HTTP Basic Auth::
>>> @app.route('/')
>>> @basic_auth
>>> def hello_world():
>>> return jsonify({"statusCode": 200, "message": "Ok"})
This will result in all calls against the decorated method to (1) check for
for credentials on the request.authorization object and (2) verify that
they match the contents of app.config['basic_auth_credentials]'
for various authentication methods for RESTful web services.
Currently, only HTTP Basic Authentication is supported. **
Usage
-----
>>> from flask.ext.flask_authorization_panda import basic_auth
During app initialization, store your required username/password in
the config attribute::
app = Flask(__name__)
app.config['basic_auth_credentials'] = dict(username='admin',
password='secret')
Finally, simple apply the @basic_auth decorator to methods which you
want to require HTTP Basic Auth::
>>> @app.route('/')
>>> @basic_auth
>>> def hello_world():
>>> return jsonify({"statusCode": 200, "message": "Ok"})
This will result in all calls against the decorated method to (1) check for
for credentials on the request.authorization object and (2) verify that
they match the contents of app.config['basic_auth_credentials]'
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
Close
Hashes for Flask-Authorization-Panda-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5deae093b0c93332945076736f4f0b99916fded0bf93762ea575eb2f122f319c |
|
MD5 | 002d3a6fe945655bd3ee3c23e44f60c9 |
|
BLAKE2b-256 | bbc7c4935cc6028c46cefd826a4daca21480c0fc363bec6f862e56c0076335c6 |