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

Develop #222

Merged
merged 2 commits into from
Nov 22, 2024
Merged
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
3 changes: 3 additions & 0 deletions project/base_settings/auth_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def auth_from_env(auth):

# relax samesite (django-blti>=2.2.1),
# but protect cookies from casual snooping
SESSION_COOKIE_SAMESITE = 'None'
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

Expand All @@ -111,6 +112,8 @@ def auth_from_env(auth):
LTI_CONSUMERS = {'0000-0000-0000': '01234567ABCDEF'}
BLTI_AES_KEY = bytes('AE91AE1DF0E6FB44', encoding='utf8')
BLTI_AES_IV = bytes('01C8837249AE8667', encoding='utf8')
MIDDLEWARE.remove('blti.middleware.SameSiteMiddleware')
CSRF_COOKIE_SECURE = False
else:
# BLTI consumer key:secret pairs in env as a serialized dict
LTI_CONSUMERS = json.loads(os.getenv('LTI_CONSUMERS', '{}'))
Expand Down
2 changes: 2 additions & 0 deletions project/base_settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_SCHEME', 'https')

if all([os.getenv('CLUSTER_CNAME'), os.getenv('HOSTNAME')]):
ALLOWED_HOSTS = [
os.getenv('CLUSTER_CNAME'), # External hostname
Expand Down
Loading