Skip to main content

pyramid_contextauth

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

from pyramid.security import remember, forget


class Context(object):
    pass


class ContextAuthenticationPolicy:
    def authenticated_userid(self, request):
        return unauthenticated_userid(request)

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

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

    def remember(self, request, prinicpal, **kw):
        return remember(request, prinicpal, **kw)

    def forget(self, request):
        return forget(request)


def includeme(config):
    from pyramid_contextauth import get_authentication_policy
    policy = get_authentication_policy(config)
    policy.register_context(Context, ContextAuthenticationPolicy)

Release files for pyramid_contextauth 0.1.1

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_contextauth 0.1.1
File Size Uploaded
pyramid_contextauth-0.1.1.tar.gz 3.4 kB Details

Release files / pyramid_contextauth-0.1.1.tar.gz

Download URL pyramid_contextauth-0.1.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
74fffb965105b0ffb329501f9d6a092b15389201eed60493c1c31ea3e26dcf6c
BLAKE2b-256 checksum
How to use checksums
ebc8599f89c569aed61225f80bb712fb8393efe8bdb46ce024711713b1edd7e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2.1

1 release file

0.2

1 release file

This release

0.1.1 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

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