Skip to content

Commit

Permalink
Changed secret initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
al-indigo committed Oct 15, 2015
1 parent dd77380 commit b0aee29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lingvodoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,6 @@ def main(global_config, **settings):
DBSession.configure(bind=engine)
Base.metadata.bind = engine
from pyramid.config import Configurator
authentication_policy = AuthTktAuthenticationPolicy('secret_string_that_you_should_change',
hashalg='sha512', callback=groupfinder)
authorization_policy = ACLAuthorizationPolicy()
config_file = global_config['__file__']
parser = ConfigParser()
parser.read(config_file)
Expand All @@ -504,6 +501,10 @@ def main(global_config, **settings):
storage[k] = v
settings['storage'] = storage
config = Configurator(settings=settings)

authentication_policy = AuthTktAuthenticationPolicy(settings['secret'],
hashalg='sha512', callback=groupfinder)
authorization_policy = ACLAuthorizationPolicy()
config.set_authentication_policy(authentication_policy)
config.set_authorization_policy(authorization_policy)
config.include('pyramid_chameleon')
Expand Down
2 changes: 2 additions & 0 deletions postgres.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
[app:main]
use = egg:lingvodoc

secret = 'secret string'

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
Expand Down

0 comments on commit b0aee29

Please sign in to comment.