From 1506fe5d82bb98a044737f2a4f47160aa2908280 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Fri, 24 Nov 2023 21:23:20 +0000 Subject: [PATCH] Add Auth_Provider --- .gitignore | 1 + data_management/rest/views.py | 9 ++++++++- data_management/urls.py | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0bba6c3..15a77db 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ session_port.log session_address.log coverage.xml .coverage +.DS_Store \ No newline at end of file diff --git a/data_management/rest/views.py b/data_management/rest/views.py index 70cf09e..e5eb4b3 100644 --- a/data_management/rest/views.py +++ b/data_management/rest/views.py @@ -14,9 +14,10 @@ from django_filters import constants, filters from django.contrib.auth.models import Group from django.contrib.auth import get_user_model -from django.http import Http404 +from django.http import Http404, JsonResponse from django.shortcuts import get_object_or_404 from django.db.models import Q +from django.conf import settings from data_management import models, object_storage, settings from data_management import object_storage @@ -563,3 +564,9 @@ class CodeRunViewSet(BaseViewSet, mixins.UpdateModelMixin, mixins.DestroyModelMi data['renderer_classes'] = BaseViewSet.renderer_classes + [TextRenderer] globals()[name + "ViewSet"] = type(name + "ViewSet", (BaseViewSet,), data) +def auth_provider(request): + """Returns Auth Provider in Json Format""" + _data = { + "Auth_Provider":settings.AUTH_METHOD + } + return JsonResponse(_data) \ No newline at end of file diff --git a/data_management/urls.py b/data_management/urls.py index 6b077c0..16353fa 100644 --- a/data_management/urls.py +++ b/data_management/urls.py @@ -39,6 +39,7 @@ path('data/', views.get_data), path('api/data/', api_views.ObjectStorageView.as_view()), path('api/data', api_views.ObjectStorageView.as_view()), + path('api/auth-provider', api_views.auth_provider), path('logout', views.logout), ]