Client library for accessing GaaP services
Project description
Python package providing a WSGI middleware for accessing GaaP services.
Installation
pip3 install ags_client
Usage
Registration
You will need a client ID and client secret from the GaaP Identity Broker. You can’t get these yet, but soon will by emailing us with a brief summary of:
who you are
what project you’re going to be using it on
Quick Start
Flask
For example: given your Flask app is defined in webservice.py in a variable named app, create a file called wsgi.py:
import ags
from webservice import app
app.wsgi_app = ags.Client(app.wsgi_app)
Then start your app with a WSGI server such as Gunicorn or uWSGI. Eg:
gunicorn wsgi:app
Configuration
The middleware looks for certain environment variables for settings. The following variables are REQUIRED:
- AGS_CLIENT_ID
The client ID that you have been issued
- AGS_CLIENT_SECRET
The client secret that you have been issued
- AGS_CLIENT_AUTHENTICATED_URLS
Comma separated list of paths in your web application that require authentication. May include regular expressions.
The following variables are OPTIONAL:
- AGS_CLIENT_SIGN_OUT_PATH
Path to sign out view in your application - default: sign-out
The following variables can be used to override defaults, but usually should not be used:
- AGS_BROKER_AUTH_ENDPOINT
The path to the OIDC authentication endpoint on the broker
- AGS_BROKER_JWKS_URI
The path to the OIDC jwks_uri endpoint on the broker
- AGS_BROKER_TOKEN_ENDPOINT
The path to the OIDC token endpoint on the broker
- AGS_BROKER_URL
The URL of the OIDC identity broker
- AGS_CLIENT_CALLBACK_PATH
Overrides default OIDC callback path
Support
This source code is provided as-is, with no incident response or support levels. Please log all questions, issues, and feature requests in the Github issue tracker for this repo, and we’ll take a look as soon as we can. If you’re reporting a bug, then it really helps if you can provide the smallest possible bit of code that reproduces the issue. A failing test is even better!
Contributing
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed
Check the issue tracker to make sure someone hasn’t already requested and/or contributed the feature
Fork the project
Start a feature/bugfix branch
Commit and push until you are happy with your contribution
Make sure your changes are covered by unit tests, so that we don’t break it unintentionally in the future.
Please don’t mess with setup.py, version or history.
Copyright
Copyright © 2016 HM Government (Government Digital Service). See LICENSE for further details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ags_client-0.0.14-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad753f90c7998489166e97387bc4eec99d82814b4c698555ea7381d3e782bbaa |
|
MD5 | 8ae06e7ec30241fd8629e0c8d7f82617 |
|
BLAKE2b-256 | 7fcf81cd766610b57f47c3d61b22474d7c04c518220e73c6ef25a8513631d0cb |