Skip to content

0.0.2

Latest

Choose a tag to compare

@Jc2k Jc2k released this 15 Jan 09:07
· 1 commit to master since this release

A new authorize_or_raise allows you to handle authentication failures yourself using Flasks error handling:

@app.route('/api/v1/apples/list')
def list_apples():
    authorize_or_raise('ListApples', 'apples')
    return jsonify([{'name': 'fred', 'weight': 50, 'color': 'red'}])

@self.app.errorhandler(AuthorizationFailed)
def handle_invalid_usage(error):
    return 'Authorization has failed'

This release adds a new TINYAUTH_VERIFY setting. This allows you to pass False to entirely disable SSL verification of your tinyauth backend or to pass the path to a CA bundle.

Additionally you can now also set TINYAUTH_BYPASS in your dev environment to completely bypass authentication and authorization.