forked from openedx/edx-drf-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_settings.py
70 lines (54 loc) · 1.77 KB
/
test_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""
These settings are here to use during tests, because django requires them.
In a real-world use case, apps in this project are installed into other
Django applications, so these settings will not be used.
"""
SECRET_KEY = 'insecure-secret-key'
ROOT_URLCONF = 'csrf.urls'
INSTALLED_APPS = (
'csrf.apps.CsrfAppConfig',
'django.contrib.auth',
'django.contrib.contenttypes',
'edx_rest_framework_extensions',
'rest_framework_jwt',
'waffle',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'default.db',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
EDX_DRF_EXTENSIONS = {}
# USER_SETTINGS overrides for djangorestframework-jwt APISettings class
# See https://github.com/GetBlimp/django-rest-framework-jwt/blob/master/rest_framework_jwt/settings.py
JWT_AUTH = {
'JWT_AUDIENCE': 'test-aud',
'JWT_DECODE_HANDLER': 'edx_rest_framework_extensions.auth.jwt.decoder.jwt_decode_handler',
'JWT_ISSUER': 'test-iss',
'JWT_LEEWAY': 1,
'JWT_SECRET_KEY': 'test-key',
'JWT_SUPPORTED_VERSION': '1.0.0',
'JWT_VERIFY_AUDIENCE': False,
'JWT_VERIFY_EXPIRATION': True,
'JWT_AUTH_HEADER_PREFIX': 'JWT',
# JWT_ISSUERS enables token decoding for multiple issuers (Note: This is not a native DRF-JWT field)
# We use it to allow different values for the 'ISSUER' field, but keep the same SECRET_KEY and
# AUDIENCE values across all issuers.
'JWT_ISSUERS': [
{
'ISSUER': 'test-issuer-1',
'SECRET_KEY': 'test-secret-key',
'AUDIENCE': 'test-audience',
},
{
'ISSUER': 'test-issuer-2',
'SECRET_KEY': 'test-secret-key',
'AUDIENCE': 'test-audience',
}
],
}