Commit 9592318a authored by Georgios D. Tsoukalas's avatar Georgios D. Tsoukalas

make quotaholder token a required setting

parent 2855792e
......@@ -35,7 +35,7 @@
from django.http import HttpResponse
from django.db import transaction
from django.conf import settings
from synnefo.lib.commissioning import CallError, get_callpoint
from synnefo.lib.commissioning import CallError
from .callpoint import API_Callpoint
......@@ -62,9 +62,8 @@ def view(request, appname='quotaholder', version=None, callname=None):
if (appname, version) not in callpoints:
return HttpResponse(status=404)
if hasattr(settings, 'QUOTAHOLDER_TOKEN'):
if request.META['HTTP_X_AUTH_TOKEN'] != settings.QUOTAHOLDER_TOKEN:
return HttpResponse(status=403, content='invalid token')
if request.META['HTTP_X_AUTH_TOKEN'] != settings.QUOTAHOLDER_TOKEN:
return HttpResponse(status=403, content='invalid token')
callpoint = callpoints[(appname, version)]
body = _get_body(request)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment