Commit d4f71167 authored by ale's avatar ale

formatting

parent 68759f29
......@@ -163,18 +163,18 @@ def logout():
def create_app(config_file=None, config={}):
# Some defaults for our configuration.
app.config.update({
'SSO_SECRET_KEY': '/etc/sso/secret.key',
'SSO_PUBLIC_KEY': '/etc/sso/public.key',
'SSO_AUTH_MODULE': 'sso_server.auth.auth_test',
'HTML_TITLE': 'SSO',
'HTML_BANNER': 'Single Sign-On',
})
'SSO_SECRET_KEY': '/etc/sso/secret.key',
'SSO_PUBLIC_KEY': '/etc/sso/public.key',
'SSO_AUTH_MODULE': 'sso_server.auth.auth_test',
'HTML_TITLE': 'SSO',
'HTML_BANNER': 'Single Sign-On',
})
# Set saner defaults for Flask session config.
app.config.update({
'SESSION_COOKIE_HTTPONLY': True,
'SESSION_COOKIE_SECURE': True,
})
'SESSION_COOKIE_HTTPONLY': True,
'SESSION_COOKIE_SECURE': True,
})
# Load the user-provided configuration.
app.config.update(config)
......@@ -183,14 +183,6 @@ def create_app(config_file=None, config={}):
else:
app.config.from_envvar('APP_CONFIG', silent=True)
# Optionally enable Sentry.
if 'SENTRY_DSN' in app.config:
try:
from raven.contrib.flask import Sentry
sentry = Sentry(app)
except ImportError:
pass
# Check configuration for required attributes.
required_attrs = ['SSO_DOMAIN', 'SSO_SECRET_KEY', 'SSO_PUBLIC_KEY',
'SSO_AUTH_MODULE']
......@@ -199,6 +191,14 @@ def create_app(config_file=None, config={}):
raise Exception('Missing required configuration attributes: %s',
', '.join(missing_attrs))
# Optionally enable Sentry.
if 'SENTRY_DSN' in app.config:
try:
from raven.contrib.flask import Sentry
sentry = Sentry(app)
except ImportError:
pass
app.login_service = login_service.LoginService(app.config)
return app
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment