Skip to content

Instantly share code, notes, and snippets.

View aandrusyk-amplify's full-sized avatar

Andriy Andrusyk aandrusyk-amplify

  • Lviv, Ukraine
View GitHub Profile
@mmerickel
mmerickel / basic_auth_example.py
Last active April 27, 2021 18:27
Basic Auth in Pyramid with simple ACLs
from pyramid.authentication import BasicAuthAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.config import Configurator
from pyramid.httpexceptions import HTTPForbidden
from pyramid.httpexceptions import HTTPUnauthorized
from pyramid.security import ALL_PERMISSIONS
from pyramid.security import Allow
from pyramid.security import Authenticated
from pyramid.security import forget
from pyramid.view import forbidden_view_config