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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyramid_debugauth-0.0.2.tar.gz.
File metadata
- Download URL: pyramid_debugauth-0.0.2.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a230fc3742da5d5d0299928a55666a52d28ed0186a387a07bdec7c2cb11a963d
|
|
| MD5 |
337c4a5db2797694e02f4c0ed853424b
|
|
| BLAKE2b-256 |
85e54ccf850e38aa90baf122ea076d805ae07906936cd96b9f3d50dc40c43294
|
File details
Details for the file pyramid_debugauth-0.0.2-py2-none-any.whl.
File metadata
- Download URL: pyramid_debugauth-0.0.2-py2-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3400b72278ea4d7ecd67f6b485c30da279dfc068a32d66b6b377815e2488c498
|
|
| MD5 |
6bc29fb1e1810119a5f277e8ff30de2d
|
|
| BLAKE2b-256 |
3dab8e44233d9a3642fc205afe55087539ee375fe6af0dcaa8da6f4d62d2c8df
|