Skip to content

Commit 595621e

Browse files
committed
feat!: remove mock toggle endpoint
The `mock-toggles` REST endpoint was used for testing a feature used by 2U for collecting the configuration of settings in OeX IDAs. The feature was never fully implemented in Credentials and this endpoint is no longer being used, so we are removing it.
1 parent 31ade69 commit 595621e

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

credentials/urls.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from credentials.apps.plugins.constants import PROJECT_TYPE
3333
from credentials.apps.records.views import ProgramListingView
3434
from credentials.apps.verifiable_credentials.toggles import is_verifiable_credentials_enabled
35-
from credentials.views import FaviconView, MockToggleStateView
35+
from credentials.views import FaviconView
3636

3737

3838
admin.autodiscover()
@@ -65,7 +65,6 @@
6565
path("records/", include(("credentials.apps.records.urls", "records"), namespace="records")),
6666
re_path(r"^program-listing/", ProgramListingView.as_view(), name="program_listing"),
6767
re_path(r"^favicon\.ico$", FaviconView.as_view(permanent=True)),
68-
path("mock-toggles", MockToggleStateView.as_view()),
6968
]
7069

7170
if is_verifiable_credentials_enabled():

credentials/views.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
from django.conf import settings
22
from django.views.generic.base import RedirectView
3-
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
4-
from edx_rest_framework_extensions.permissions import IsStaff
5-
from rest_framework import permissions, views
6-
from rest_framework.authentication import SessionAuthentication
7-
from rest_framework.response import Response
83

94

105
class FaviconView(RedirectView):
@@ -16,41 +11,3 @@ def get_redirect_url(self, *_args, **_kwargs):
1611
if not settings.FAVICON_URL:
1712
return None
1813
return settings.FAVICON_URL
19-
20-
21-
class MockToggleStateView(views.APIView): # pragma: no cover
22-
"""
23-
A mock endpoint showing that we can require a staff JWT in this IDA,
24-
and allowing us to test integration of multiple IDAs into toggle state
25-
reports (ARCHBOM-1569). This can go away once edx-toggles is ready and
26-
integrated.
27-
"""
28-
29-
authentication_classes = (
30-
JwtAuthentication,
31-
SessionAuthentication,
32-
)
33-
permission_classes = (
34-
permissions.IsAuthenticated,
35-
IsStaff,
36-
)
37-
38-
def get(self, request):
39-
return Response(
40-
{
41-
"waffle_flags": [
42-
{
43-
"name": "mock.flag",
44-
"class": "WaffleFlag",
45-
"module": "mock.core.djangoapps.fake",
46-
"code_owner": "platform-arch",
47-
"computed_status": "off",
48-
}
49-
],
50-
"waffle_switches": [],
51-
"django_settings": [
52-
{"name": "MOCK_DEBUG", "is_active": False},
53-
{"name": "OTHER_MOCK['stuff']", "is_active": True},
54-
],
55-
}
56-
)

0 commit comments

Comments
 (0)