Skip to main content

Pyramid_debugauth

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

Warning: This pyramid is totally unsafe for production and should be restricted to debug usage / development phase.

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'

Or using a non-standard authorization query parameter:

http://localhost:6543/protected?authorization=debug%20user_id%20principal_1

With common http clients:

$ curl http://localhost:6543?authorization=debug%20bob%20admin

$ http http://localhost:6543?authorization=debug\ bob\ admin

Development

Running tests:

$ virtualenv venv
$ . venv/bin/activate
(venv)$ pip install -e .[dev]
(venv)$ nosetests

Changelog

0.2.0 (2018-02-09)

  • Switch to Github

  • Switch to setuptools (from d2to1)

  • Fix crash in tests with recent versions of Pyramid

0.1.2 (2014-12-03)

  • Permit setting a custom callback.

0.1.1 (2014-09-09)

  • Add ability to authenticate via Query String

0.0.2 (2014-09-08)

  • Minimal feature set

  • First release on PyPI

Release files for pyramid_debugauth 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyramid_debugauth 0.2.0
File Size Uploaded
pyramid_debugauth-0.2.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyramid_debugauth 0.2.0
File Interpreter ABI Platform
pyramid_debugauth-0.2.0-py2-none-any.whl Python 2 none any Details

Total release size: 11.3 kB

Release files / pyramid_debugauth-0.2.0.tar.gz

Download URL pyramid_debugauth-0.2.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b01e0de21c5fa3718286571b5d41ac73dd844b92f7e963d4d82fb2176ca05a3f
BLAKE2b-256 checksum
How to use checksums
88d9aee01de02e1ffe8e493ebe0b6e93900dcccc98d1563aaec452ad8ded59d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyramid_debugauth-0.2.0-py2-none-any.whl

Download URL pyramid_debugauth-0.2.0-py2-none-any.whl
Size 6.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
e89135a3f562cdf45cd2f055f4b63b604fae4512513342b082924e198da0fc47
BLAKE2b-256 checksum
How to use checksums
a4789bacb1aca23953177aaaf20a12580872b0fe5be55f3b9601d16682f0957f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page