Skip to main content

Debug Authentication Policy for Pyramid

Project description

Debug Authentication Policy for Pyramid. Provide a simple and standard way to define the pyramid principals from the HTTP client.

Installation

Install using setuptools, e.g. (within a virtualenv):

$ pip install pyramid_debugauth

Setup

Once pyramid_debugauth is installed, you can define a authentication policy with config.set_authentication_policy.

In your Pyramid project:

from pyramid.authorization import ACLAuthorizationPolicy
from pyramid_debugauth import DebugAuthenticationPolicy

config = Configurator(.....)
config.set_authentication_policy(DebugAuthenticationPolicy())
config.set_authorization_policy(ACLAuthorizationPolicy())

Usage

The DebugAuthenticationPolicy allows a client to impersonate any user and specify any number of principals desired using the standard Authorization http header and a non-standard auth-scheme Debug (RFC 7235):

Authorization: *Debug* user_id [principal_1] [principal_2] ...

With common http clients:

$ curl http://localhost:6543 -H '*Authorization: Debug bob admin*'
$ http http://localhost:6543 '*Authorization: Debug bob admin*'

Development

Running tests:

$ virtualenv venv
$ . venv/bin/activate
(venv)$ pip install -r requirements-test.txt
(venv)$ nosetests

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

pyramid_debugauth-0.0.1.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file pyramid_debugauth-0.0.1.tar.gz.

File metadata

File hashes

Hashes for pyramid_debugauth-0.0.1.tar.gz
Algorithm Hash digest
SHA256 425e33b4a6138567662fd8e7058f2c5f13b1e7d658bcfe86ed8d1e041c710b3c
MD5 52523469fc4c8096439e63843388f018
BLAKE2b-256 499cd9c401612d8af834049d54108effe22a19cd454872fd9816111fba9beffc

See more details on using hashes here.

Provenance

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