Skip to main content

Datapunt authorization

Project description

https://img.shields.io/badge/python-3.4%2C%203.5%2C%203.6-blue.svg https://img.shields.io/badge/license-MPLv2.0-blue.svg

Interface to authorization logic in the backend of Amsterdam’s (Netherlands) open data distribution platform, [Datapunt](http://data.amsterdam.nl).

In Datapunt authorization levels associated with users are stored in a central database. When a user accesses a resource she needs to provide a cryptographically secure token. That token contains the user’s authorization level. The resource in turn uses that information to decide what information the user can access.

Install

$ pip install datapunt-authorization

In order to use this library you need to have access to a Postgress database.

Usage

import authorization
import authorization_levels  # pip install datapunt-authorization-levels

authzmap = authorization.AuthzMap(**psycopgconf)

if authzmap['myuser'] == authorization_levels.LEVEL_EMPLOYEE:
        ...  # do some eployee-e things

Contribute

Activate your virtualenv, install the egg in editable mode, and start coding:

$ source env/bin/activate
$ pip install -e .

Testing:

make test

Documentation

The docs can be found at [datapunt-authorization.readthedocs.io](https://datapunt-authorization.readthedocs.io).

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

datapunt-authorization-0.2.0.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file datapunt-authorization-0.2.0.tar.gz.

File metadata

File hashes

Hashes for datapunt-authorization-0.2.0.tar.gz
Algorithm Hash digest
SHA256 05c51b3685001af6881161f1c781594fbae2fde0fc4e21c1687b795d0602baa2
MD5 eeb227481ae6c767f6d8387510b2b881
BLAKE2b-256 e562465c64fbf5e616fa346528f082fd5d87832e09ea36abdd252a999d1e7059

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page