Skip to main content
r/Pyramid icon

r/Pyramid

members
online

I generated a visual representation of Pyramid's codebase I generated a visual representation of Pyramid's codebase

Hey all, I am a python dev for quite some time. However it is rare that I contribute to open-source projects. It is because I think it seems quite intimidating at the very start. That is why I created an open-source tool to generate interactive diagrams so I can quickly explore a codebase, I generated a diagram for the Pyramid's codebase.
The full interactive diagram is on github: https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/pyramid/on_boarding.md

The tool I developed:
https://github.com/CodeBoarding/CodeBoarding


Pyramid Auth classes in Pyramid 2.x Pyramid Auth classes in Pyramid 2.x

Hi Everyone,

I’m working on upgrading a project from Pyramid 1.4 to 2.x, and I’ve hit a roadblock with the deprecation of AuthTktAuthenticationPolicy and ACLAuthorizationPolicy. These were the backbone of my authentication and authorization system, and I’m unsure how to transition to the new implementation in Pyramid 2.x.

I would appreciate any guidance or examples on how to replace these deprecated classes with the recommended approach in Pyramid 2.x. Below is a snippet of my current setup:

from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.config import Configurator


def main(settings):
    authn_policy = AuthTktAuthenticationPolicy(
        "somesecret123", cookie_name="session-id", wild_domain=True, hashalg="sha512"
    )
    authz_policy = ACLAuthorizationPolicy()

    config = Configurator(
        settings=settings,
        authentication_policy=authn_policy,
        authorization_policy=authz_policy,
    )