Skip to main content

Pyramid Security Extension

Project description

A simple pyramid extension to provides contexts based authentication policy. To register authentication methods:

from pyramid.security import remember, forget

class Context(object):
    pass

def authenticated_userid(request):
    return unauthenticated_userid(request)

def unauthenticated_userid(request):
    "A dummy example"
    return request.POST.get('userid')

def effective_principals(request):
    if unauthenticated_userid(request):
        return ['User']
    return []

def includeme(config):
    from pyramid_contextauth import get_authentication_policy
    policy = get_authentication_policy(config)
    policy.register_context(
        Context,
        authenticated_userid,
        unauthenticated_userid,
        effective_principals,
        remember,
        forget
        )

Project details


Release history Release notifications

History Node

0.7.3

History Node

0.7.2

History Node

0.7.1

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2.1

History Node

0.2

History Node

0.1.1

History Node

0.0.3

History Node

0.0.2

This version
History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyramid_contextauth-0.0.1.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None Feb 14, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page