0001-debian-do-not-load-APIClientAuthentication-in-authen.patch
debian/debian_config_common.py | ||
---|---|---|
393 | 393 | |
394 | 394 |
STATICS_HASH_COUNTER = '/var/lib/publik/statics-counter' |
395 | 395 | |
396 |
# Django Rest Framework: allow only Publik-signed URLs
|
|
396 |
# Django Rest Framework: allow Publik-signed URLs and APIClient
|
|
397 | 397 |
if 'rest_framework' in INSTALLED_APPS: |
398 | 398 |
if 'REST_FRAMEWORK' not in globals(): |
399 | 399 |
REST_FRAMEWORK = {} |
400 |
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ( |
|
401 |
'hobo.rest_authentication.PublikAuthentication', |
|
402 |
'hobo.rest_authentication.APIClientAuthentication', |
|
403 |
) |
|
400 |
if 'authentic2' not in INSTALLED_APPS: |
|
401 |
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ( |
|
402 |
'hobo.rest_authentication.PublikAuthentication', |
|
403 |
'hobo.rest_authentication.APIClientAuthentication', |
|
404 |
) |
|
405 |
else: |
|
406 |
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ('hobo.rest_authentication.PublikAuthentication',) |
|
404 | 407 |
REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES'] = ('rest_framework.permissions.IsAuthenticated',) |
405 | 408 |
REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = ('rest_framework.renderers.JSONRenderer',) |
406 | 409 | |
407 |
- |