From 3f99335eecdef9e5bdb864a8284e83246b674baf Mon Sep 17 00:00:00 2001 From: Josue Kouka Date: Mon, 15 Feb 2016 18:17:15 +0100 Subject: [PATCH] add hobo rest_authentication class to service (#9974) --- debian/debian_config_common.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/debian_config_common.py b/debian/debian_config_common.py index 19baf00..744b370 100644 --- a/debian/debian_config_common.py +++ b/debian/debian_config_common.py @@ -196,3 +196,16 @@ BROKER_URL = 'amqp://' BROKER_TASK_EXPIRES = 120 STATICS_HASH_COUNTER = '/var/lib/publik/statics-counter' + + +if 'rest_framework' in INSTALLED_APPS: + if 'REST_FRAMEWORK' not in globals(): + REST_FRAMEWORK = {} + + if 'DEFAULT_AUTHENTICATION_CLASSES' in REST_FRAMEWORK: + REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] += ('hobo.rest_authentication.PublikAuthentication',) + else: + REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ('hobo.rest_authentication.PublikAuthentication',) + +HOBO_ANONYMOUS_SERVICE_USER_CLASS = 'hobo.rest_authentication.AnonymousAdminServiceUser' + -- 2.7.0