Skip to content
Snippets Groups Projects
Commit a602ca82 authored by m431m's avatar m431m :speech_balloon:
Browse files

Define SessionCsrfExemptAuthentication

parent 3bad4a24
No related branches found
No related tags found
1 merge request!3REDMINE_ISSUES-15052 Force Csrf Exempt
......@@ -18,6 +18,8 @@ import logging
from django.conf import settings
from drfreverseproxy.views import ProxyView
from rest_framework.authentication import BasicAuthentication
from rest_framework.authentication import SessionAuthentication
from rest_framework import permissions
......@@ -28,9 +30,19 @@ ONEGEOSUITE_MAPSTORE_UPSTREAM = settings.ONEGEOSUITE_MAPSTORE_UPSTREAM
ONEGEOSUITE_MAPSTORE_AUTH_HEADER = settings.ONEGEOSUITE_MAPSTORE_AUTH_HEADER
class SessionCsrfExemptAuthentication(SessionAuthentication):
def enforce_csrf(self, request):
pass
class MapstoreProxyView(ProxyView):
upstream = ONEGEOSUITE_MAPSTORE_UPSTREAM
authentication_classes = [
SessionCsrfExemptAuthentication,
BasicAuthentication,
]
permission_classes = [
permissions.AllowAny,
]
......@@ -53,4 +65,3 @@ class MapstoreProxyView(ProxyView):
headers[ONEGEOSUITE_MAPSTORE_AUTH_HEADER] = self.request.user.username
return headers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment