Skip to content
Snippets Groups Projects
Verified Commit 1408500e authored by magicfelix's avatar magicfelix
Browse files

Unprotect GraphQL endpoint

parent 64b57e89
No related branches found
No related tags found
1 merge request!1131Resolve: Unprotect GraphQL endpoint
Pipeline #103730 passed with warnings
......@@ -8,6 +8,7 @@ from django.views.i18n import JavaScriptCatalog
import calendarweek.django
from ckeditor_uploader import views as ckeditor_uploader_views
from graphene_django.views import GraphQLView
from health_check.urls import urlpatterns as health_urls
from oauth2_provider.views import ConnectDiscoveryInfoView
from rules.contrib.views import permission_required
......@@ -140,7 +141,7 @@ urlpatterns = [
name="oauth2_provider:authorize",
),
path("oauth/", include("oauth2_provider.urls", namespace="oauth2_provider")),
path("graphql/", csrf_exempt(views.PrivateGraphQLView.as_view(graphiql=True)), name="graphql"),
path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=True)), name="graphql"),
path("__i18n__/", include("django.conf.urls.i18n")),
path(
"ckeditor/upload/",
......
......@@ -44,7 +44,6 @@ from django_celery_results.models import TaskResult
from django_filters.views import FilterView
from django_tables2 import RequestConfig, SingleTableMixin, SingleTableView
from dynamic_preferences.forms import preference_form_builder
from graphene_django.views import GraphQLView
from guardian.shortcuts import GroupObjectPermission, UserObjectPermission, get_objects_for_user
from haystack.generic_views import SearchView
from haystack.inputs import AutoQuery
......@@ -1585,7 +1584,3 @@ class ICalFeedCreateView(PermissionRequiredMixin, AdvancedCreateView):
obj.person = self.request.user.person
obj.save()
return super().form_valid(form)
class PrivateGraphQLView(LoginRequiredMixin, GraphQLView):
"""GraphQL view that requires a valid user session."""
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