allow-server-side-sessions (#855)

This commit is contained in:
jodygilbert 2021-01-24 08:09:53 +00:00 committed by GitHub
parent 8f6a800836
commit 7f86730909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -47,7 +47,8 @@ legal_envvars = (
'SAML_ASSERTION_ENCRYPTED',
'OFFLINE_MODE',
'REMOTE_USER_LOGOUT_URL',
'REMOTE_USER_COOKIES'
'REMOTE_USER_COOKIES',
'FILESYSTEM_SESSIONS_ENABLED'
)
legal_envvars_int = ('PORT', 'MAIL_PORT', 'SAML_METADATA_CACHE_LIFETIME')
@ -65,7 +66,8 @@ legal_envvars_bool = (
'SAML_LOGOUT',
'SAML_ASSERTION_ENCRYPTED',
'OFFLINE_MODE',
'REMOTE_USER_ENABLED'
'REMOTE_USER_ENABLED',
'FILESYSTEM_SESSIONS_ENABLED'
)
# import everything from environment variables

View File

@ -4,6 +4,7 @@ from flask import Flask
from flask_seasurf import SeaSurf
from flask_mail import Mail
from werkzeug.middleware.proxy_fix import ProxyFix
from flask_session import Session
from .lib import utils
@ -78,6 +79,12 @@ def create_app(config=None):
from flask_sslify import SSLify
_sslify = SSLify(app) # lgtm [py/unused-local-variable]
# Load Flask-Session
if app.config.get('FILESYSTEM_SESSIONS_ENABLED'):
app.config['SESSION_TYPE'] = 'filesystem'
sess = Session()
sess.init_app(app)
# SMTP
app.mail = Mail(app)

View File

@ -8,6 +8,7 @@ BIND_ADDRESS = '0.0.0.0'
PORT = 9191
HSTS_ENABLED = False
OFFLINE_MODE = False
FILESYSTEM_SESSIONS_ENABLED = False
### DATABASE CONFIG
SQLA_DB_USER = 'pda'

View File

@ -27,3 +27,4 @@ pytimeparse==1.1.8
PyYAML==5.3.1
Flask-SSLify==0.1.5
Flask-Mail==0.9.1
flask-session==0.3.2