debian: do not load APIClientAuthentication in authentic (#69296)
This commit is contained in:
parent
20dcea566c
commit
22c8c2cb89
|
@ -393,14 +393,17 @@ BROKER_TASK_EXPIRES = 600
|
|||
|
||||
STATICS_HASH_COUNTER = '/var/lib/publik/statics-counter'
|
||||
|
||||
# Django Rest Framework: allow only Publik-signed URLs
|
||||
# Django Rest Framework: allow Publik-signed URLs and APIClient
|
||||
if 'rest_framework' in INSTALLED_APPS:
|
||||
if 'REST_FRAMEWORK' not in globals():
|
||||
REST_FRAMEWORK = {}
|
||||
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = (
|
||||
'hobo.rest_authentication.PublikAuthentication',
|
||||
'hobo.rest_authentication.APIClientAuthentication',
|
||||
)
|
||||
if 'authentic2' not in INSTALLED_APPS:
|
||||
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = (
|
||||
'hobo.rest_authentication.PublikAuthentication',
|
||||
'hobo.rest_authentication.APIClientAuthentication',
|
||||
)
|
||||
else:
|
||||
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ('hobo.rest_authentication.PublikAuthentication',)
|
||||
REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES'] = ('rest_framework.permissions.IsAuthenticated',)
|
||||
REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = ('rest_framework.renderers.JSONRenderer',)
|
||||
|
||||
|
|
Loading…
Reference in New Issue