Commit d14a3233 authored by Georgios D. Tsoukalas's avatar Georgios D. Tsoukalas
Browse files

cyclades: remove all csrf_exempt usage.

The csrf middleware is not to be installed with cyclades,
therefore there is no need to use csrf_exempt.
parent d7f41fac
......@@ -35,7 +35,6 @@ import logging
import urlparse
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
......@@ -71,7 +70,6 @@ def proxy(request, url, headers={}, body=None):
return HttpResponse(data, status=status)
@csrf_exempt
def delegate_to_resources_service(request):
logger.debug("Delegate resources request to %s" % RESOURCES_URL)
token = request.META.get('HTTP_X_AUTH_TOKEN')
......@@ -80,7 +78,6 @@ def delegate_to_resources_service(request):
body=request.raw_post_data)
@csrf_exempt
def delegate_to_user_quota_service(request):
logger.debug("Delegate quotas request to %s" % USER_QUOTA_URL)
token = request.META.get('HTTP_X_AUTH_TOKEN')
......@@ -89,7 +86,6 @@ def delegate_to_user_quota_service(request):
body=request.raw_post_data)
@csrf_exempt
def delegate_to_feedback_service(request):
logger.debug("Delegate feedback request to %s" % USER_FEEDBACK_URL)
token = request.META.get('HTTP_X_AUTH_TOKEN')
......@@ -98,7 +94,6 @@ def delegate_to_feedback_service(request):
body=request.raw_post_data)
@csrf_exempt
def delegate_to_user_catalogs_service(request):
token = request.META.get('HTTP_X_AUTH_TOKEN')
headers = {'X-Auth-Token': token, 'content-type': 'application/json'}
......
......@@ -33,7 +33,6 @@
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from snf_django.lib.api.proxy import proxy
from functools import partial
......@@ -56,8 +55,8 @@ PROXY_USER_SERVICES = getattr(settings, 'CYCLADES_PROXY_USER_SERVICES', True)
if PROXY_USER_SERVICES:
urlpatterns += patterns(
'',
(r'^login/?$', csrf_exempt(astakos_proxy)),
(r'^feedback/?$', csrf_exempt(astakos_proxy)),
(r'^user_catalogs/?$', csrf_exempt(astakos_proxy)),
(r'^astakos/api/', csrf_exempt(astakos_proxy)),
(r'^login/?$', astakos_proxy),
(r'^feedback/?$', astakos_proxy),
(r'^user_catalogs/?$', astakos_proxy),
(r'^astakos/api/', astakos_proxy),
)
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