Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change UnencryptedCookieSessionFactoryConfig to BeakerSessionFactoryC… #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
README = CHANGES = ''

setup(name='velruse',
version='1.1.1',
version='1.1.2',
description=(
'Simplifying third-party authentication for web applications.'),
long_description=README + '\n\n' + CHANGES,
Expand Down
11 changes: 7 additions & 4 deletions velruse/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from pyramid.config import Configurator
from pyramid.exceptions import ConfigurationError
from pyramid.response import Response
from pyramid_beaker import session_factory_from_settings
from pyramid_beaker import BeakerSessionFactoryConfig

from velruse.app.utils import generate_token
from velruse.app.utils import redirect_form
Expand Down Expand Up @@ -73,7 +75,6 @@ def default_setup(config):
specified then an in-memory storage backend will be used.

"""
from pyramid.session import UnencryptedCookieSessionFactoryConfig

log.info('Using an unencrypted cookie-based session. This can be '
'changed by pointing the "velruse.setup" setting at a different '
Expand All @@ -88,9 +89,11 @@ def default_setup(config):
'restarting the app.')
secret = ''.join('%02x' % ord(x) for x in os.urandom(16))
log.info('autogenerated session secret: %s', secret)
factory = UnencryptedCookieSessionFactoryConfig(
secret, cookie_name=cookie_name)
config.set_session_factory(factory)
session_factory = BeakerSessionFactoryConfig(
key=cookie_name,
secret=secret,
)
config.set_session_factory(session_factory)

# setup backing storage
storage_string = settings.get('store', 'memory')
Expand Down